Hi, guys here. for u-boot-2010.03(also u-boot-2010.05 I belive) on s3c2440,
if I "usb start" and then "usb stop", all of the nand operate will report failure. I look into the u-boot code, and found that it seems something wrong in s3c24x0 usb code, see below. >From s3c2440 and s3c2410 datasheet, the bit 4 of CLKCON register is used for enable/disable Nand Controller, and bit 6 is used for enable/disable usb host controller. so, I guess, this is why "usb start"+"usb stop" will cause "nand xxx" to failure. because "usb stop" disable the Nand Controll Clock. the following patch was tested on a s3c2440 board. and It seems work. Is this correct ? I saw these piece of code been there for so a long time (from u-boot-1.1.5). I am not very sure now. Thank you and sorry for my poor english. /WX =============================================================================== diff --git a/cpu/arm920t/s3c24x0/usb.c b/cpu/arm920t/s3c24x0/usb.c index e468ed0..abae409 100644 --- a/cpu/arm920t/s3c24x0/usb.c +++ b/cpu/arm920t/s3c24x0/usb.c @@ -46,7 +46,7 @@ int usb_cpu_init(void) /* * Enable USB host clock. */ - writel(readl(&clk_power->CLKCON) | (1 << 4), &clk_power->CLKCON); + writel(readl(&clk_power->CLKCON) | (1 << 6), &clk_power->CLKCON); return 0; } @@ -54,15 +54,14 @@ int usb_cpu_init(void) int usb_cpu_stop(void) { struct s3c24x0_clock_power *clk_power = s3c24x0_get_base_clock_power(); - /* may not want to do this */ - writel(readl(&clk_power->CLKCON) & ~(1 << 4), &clk_power->CLKCON); + writel(readl(&clk_power->CLKCON) & ~(1 << 6), &clk_power->CLKCON); return 0; } int usb_cpu_init_fail(void) { struct s3c24x0_clock_power *clk_power = s3c24x0_get_base_clock_power(); - writel(readl(&clk_power->CLKCON) & ~(1 << 4), &clk_power->CLKCON); + writel(readl(&clk_power->CLKCON) & ~(1 << 6), &clk_power->CLKCON); return 0; } diff --git a/cpu/arm920t/s3c24x0/usb_ohci.c b/cpu/arm920t/s3c24x0/usb_ohci.c index 5aa8d64..2e6818d 100644 --- a/cpu/arm920t/s3c24x0/usb_ohci.c +++ b/cpu/arm920t/s3c24x0/usb_ohci.c @@ -55,14 +55,14 @@ #define min_t(type, x, y) \ ({ type __x = (x); type __y = (y); __x < __y ? __x : __y; }) -#undef DEBUG +#define DEBUG #ifdef DEBUG #define dbg(format, arg...) printf("DEBUG: " format "\n", ## arg) #else #define dbg(format, arg...) do {} while(0) #endif /* DEBUG */ #define err(format, arg...) printf("ERROR: " format "\n", ## arg) -#undef SHOW_INFO +#define SHOW_INFO #ifdef SHOW_INFO #define info(format, arg...) printf("INFO: " format "\n", ## arg) #else @@ -1672,7 +1672,7 @@ int usb_lowlevel_init(void) /* * Enable USB host clock. */ - clk_power->CLKCON |= (1 << 4); + clk_power->CLKCON |= (1 << 6); memset(&gohci, 0, sizeof(struct ohci)); memset(&urb_priv, 0, sizeof(struct urb_priv)); @@ -1709,7 +1709,7 @@ int usb_lowlevel_init(void) if (hc_reset(&gohci) < 0) { hc_release_ohci(&gohci); /* Initialization failed */ - clk_power->CLKCON &= ~(1 << 4); + clk_power->CLKCON &= ~(1 << 6); return -1; } @@ -1722,7 +1722,7 @@ int usb_lowlevel_init(void) err("can't start usb-%s", gohci.slot_name); hc_release_ohci(&gohci); /* Initialization failed */ - clk_power->CLKCON &= ~(1 << 4); + clk_power->CLKCON &= ~(1 << 6); return -1; } #ifdef DEBUG @@ -1748,7 +1748,7 @@ int usb_lowlevel_stop(void) /* call hc_release_ohci() here ? */ hc_reset(&gohci); /* may not want to do this */ - clk_power->CLKCON &= ~(1 << 4); + clk_power->CLKCON &= ~(1 << 6); return 0; } ======================================================================================
_______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot