Skip to contentSkip to conversation

No subject

PATCH [email protected] 1 participant 1 message Jan 23, 2009

lore
Share & tools
lore
#0 lore raw

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

===============================================================================

cpu/arm920t/s3c24x0/usb.c +3 -4
index e468ed0..abae409 100644
@@ -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;
 }
 
cpu/arm920t/s3c24x0/usb_ohci.c +6 -6
index 5aa8d64..2e6818d 100644
@@ -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;
 }
 ======================================================================================

--0016364179a51b7d66048bae03c8--