From 3e326ece9eba8184f5d48aa4fb87760a8f6f0f10 Mon Sep 17 00:00:00 2001 From: Markus Klotzbuecher Date: Mon, 22 May 2006 16:33:54 +0200 Subject: This patch adds USB storage support for the delta board. This is the first board to make use of a generic OHCI driver, that calls hooks for board dependant initialization. --- board/delta/delta.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'board/delta') diff --git a/board/delta/delta.c b/board/delta/delta.c index b127ac8..d9fe8cb 100644 --- a/board/delta/delta.c +++ b/board/delta/delta.c @@ -99,6 +99,52 @@ int board_late_init(void) } +/* board dependant usb stuff */ +int usb_board_init() +{ + /* + * Enable USB host clock. + */ + CKENA |= (CKENA_2_USBHOST | CKENA_20_UDC); + udelay(100); + + /* Configure Port 2 for Host (USB Client Registers) */ + UP2OCR = 0x3000c; + +#if 0 + GPIO2_2 = 0x801; /* USBHPEN - Alt. Fkt. 1 */ + GPIO3_2 = 0x801; /* USBHPWR - Alt. Fkt. 1 */ +#endif + + UHCHR |= UHCHR_FHR; + wait_ms(11); /* udelay(11); */ + UHCHR &= ~UHCHR_FHR; + + UHCHR |= UHCHR_FSBIR; + while (UHCHR & UHCHR_FSBIR) + udelay(1); + +#if 0 + UHCHR |= UHCHR_PCPL; /* USBHPEN is active low */ + UHCHR |= UHCHR_PSPL; /* USBHPWR is active low */ +#endif + + UHCHR &= ~UHCHR_SSEP0; + UHCHR &= ~UHCHR_SSEP1; + UHCHR &= ~UHCHR_SSE; + + return 0; +} + +int usb_board_stop() +{ + /* may not want to do this */ + /* CKENA &= ~(CKENA_2_USBHOST | CKENA_20_UDC); */ + + return 0; +} + + /* * Magic Key Handling, mainly copied from board/lwmon/lwmon.c */ @@ -324,6 +370,12 @@ static void init_DA9030() return; } + val = 0x80; + if(i2c_write(addr, IRQ_MASK_B, 1, &val, 1)) { + printf("Error accessing DA9030 via i2c.\n"); + return; + } + i2c_reg_write(addr, REG_CONTROL_1_97, 0xfd); /* disable LDO1, enable LDO6 */ i2c_reg_write(addr, LDO2_3, 0xd1); /* LDO2 =1,9V, LDO3=3,1V */ i2c_reg_write(addr, LDO4_5, 0xcc); /* LDO2 =1,9V, LDO3=3,1V */ -- cgit v1.1 From 24e37645e7378b20fa8f20e2996c8fb8e90c70c9 Mon Sep 17 00:00:00 2001 From: Markus Klotzbuecher Date: Tue, 23 May 2006 10:33:11 +0200 Subject: More cleanup for the delta board and the generic usb_ohci driver. Added CFG_USB_BOARD_INIT and CFG_USB_CPU_INIT for enabling board and cpu specific initialization and cleanup hooks respectively. --- board/delta/delta.c | 55 ++--------------------------------------------------- 1 file changed, 2 insertions(+), 53 deletions(-) (limited to 'board/delta') diff --git a/board/delta/delta.c b/board/delta/delta.c index d9fe8cb..6e22774 100644 --- a/board/delta/delta.c +++ b/board/delta/delta.c @@ -1,10 +1,6 @@ /* - * (C) Copyright 2002 - * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net - * - * (C) Copyright 2002 - * Sysgo Real-Time Solutions, GmbH - * Marius Groeger + * (C) Copyright 2006 + * DENX Software Engineering * * See file CREDITS for list of people who contributed to this * project. @@ -98,53 +94,6 @@ int board_late_init(void) return 0; } - -/* board dependant usb stuff */ -int usb_board_init() -{ - /* - * Enable USB host clock. - */ - CKENA |= (CKENA_2_USBHOST | CKENA_20_UDC); - udelay(100); - - /* Configure Port 2 for Host (USB Client Registers) */ - UP2OCR = 0x3000c; - -#if 0 - GPIO2_2 = 0x801; /* USBHPEN - Alt. Fkt. 1 */ - GPIO3_2 = 0x801; /* USBHPWR - Alt. Fkt. 1 */ -#endif - - UHCHR |= UHCHR_FHR; - wait_ms(11); /* udelay(11); */ - UHCHR &= ~UHCHR_FHR; - - UHCHR |= UHCHR_FSBIR; - while (UHCHR & UHCHR_FSBIR) - udelay(1); - -#if 0 - UHCHR |= UHCHR_PCPL; /* USBHPEN is active low */ - UHCHR |= UHCHR_PSPL; /* USBHPWR is active low */ -#endif - - UHCHR &= ~UHCHR_SSEP0; - UHCHR &= ~UHCHR_SSEP1; - UHCHR &= ~UHCHR_SSE; - - return 0; -} - -int usb_board_stop() -{ - /* may not want to do this */ - /* CKENA &= ~(CKENA_2_USBHOST | CKENA_20_UDC); */ - - return 0; -} - - /* * Magic Key Handling, mainly copied from board/lwmon/lwmon.c */ -- cgit v1.1