Delboy

Untitled

May 10th, 2011
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.07 KB | None | 0 0
  1. +void dwc_otg_power_on (void)
  2. +{
  3. +   // clear power
  4. +   writel(readl(DANUBE_PMU_PWDCR) | 0x41, DANUBE_PMU_PWDCR);
  5. +   // set clock gating
  6. +   writel(readl(DANUBE_CGU_IFCCR) | 0x30, DANUBE_CGU_IFCCR);
  7. +   // set power
  8. +   writel(readl(DANUBE_PMU_PWDCR) & ~0x1, DANUBE_PMU_PWDCR);
  9. +   writel(readl(DANUBE_PMU_PWDCR) & ~0x40, DANUBE_PMU_PWDCR);
  10. +   writel(readl(DANUBE_PMU_PWDCR) & ~0x8000, DANUBE_PMU_PWDCR);
  11.  
  12.    
  13.  
  14.  
  15.  
  16.     // set clock gating
  17.     set_bit (4, DANUBE_CGU_IFCCR);
  18.         set_bit (5, DANUBE_CGU_IFCCR);
  19.  
  20.         // set power
  21.         clear_bit (0, DANUBE_PMU_PWDCR);
  22.         clear_bit (6, DANUBE_PMU_PWDCR);
  23.         clear_bit (15, DANUBE_PMU_PWDCR);
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.         ifxmips_w32(0x8b87, IFXMIPS_GPIO_P1_ALTSEL0);
  32.                 ifxmips_w32(0x400, IFXMIPS_GPIO_P1_ALTSEL1);
  33.                 ifxmips_w32(0xf3fc, IFXMIPS_GPIO_P1_OD);
  34.                 ifxmips_w32(0xfb3e, IFXMIPS_GPIO_P1_DIR);
  35.                 ifxmips_w32(0x850, IFXMIPS_GPIO_P1_PUDSEL);
  36.                 ifxmips_w32(ifxmips_r32(IFXMIPS_GPIO_P1_OUT) | (1<<13), IFXMIPS_GPIO_P1_OUT);
  37.  
  38. to ifxmips_usb_vbus_enable function.
Advertisement
Add Comment
Please, Sign In to add comment