Subversion Repositories freemyipod

Rev

Rev 636 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 636 Rev 720
Line 134... Line 134...
134
static void usb_reset(void)
134
static void usb_reset(void)
135
{
135
{
136
    DCTL = 0x802;  /* Soft Disconnect */
136
    DCTL = 0x802;  /* Soft Disconnect */
137
 
137
 
138
    OPHYPWR = 0;  /* PHY: Power up */
138
    OPHYPWR = 0;  /* PHY: Power up */
-
 
139
    udelay(10);
139
    OPHYUNK1 = 1;
140
    OPHYUNK1 = 1;
140
    OPHYUNK2 = 0xE3F;
141
    OPHYUNK2 = 0xE3F;
141
    OPHYCLK = SYNOPSYSOTG_CLOCK;
-
 
142
    ORSTCON = 1;  /* PHY: Assert Software Reset */
142
    ORSTCON = 1;  /* PHY: Assert Software Reset */
143
    udelay(10);
143
    udelay(10);
144
    ORSTCON = 0;  /* PHY: Deassert Software Reset */
144
    ORSTCON = 0;  /* PHY: Deassert Software Reset */
-
 
145
    udelay(10);
145
    OPHYUNK3 = 0x600;
146
    OPHYUNK3 = 0x600;
-
 
147
    OPHYCLK = SYNOPSYSOTG_CLOCK;
-
 
148
    sleep(400);
146
 
149
 
147
    GRSTCTL = 1;  /* OTG: Assert Software Reset */
150
    GRSTCTL = 1;  /* OTG: Assert Software Reset */
148
    while (GRSTCTL & 1);  /* Wait for OTG to ack reset */
151
    while (GRSTCTL & 1);  /* Wait for OTG to ack reset */
149
    while (!(GRSTCTL & 0x80000000));  /* Wait for OTG AHB master idle */
152
    while (!(GRSTCTL & 0x80000000));  /* Wait for OTG AHB master idle */
150
 
153
 
Line 364... Line 367...
364
 
367
 
365
void usb_drv_power_down(void)
368
void usb_drv_power_down(void)
366
{
369
{
367
    DCTL = 0x802;  /* Soft Disconnect */
370
    DCTL = 0x802;  /* Soft Disconnect */
368
 
371
 
369
    ORSTCON = 1;  /* Put the PHY into reset (needed to get current down) */
-
 
370
    PCGCCTL = 1;  /* Shut down PHY clock */
-
 
371
    OPHYPWR = 0xF;  /* PHY: Power down */
372
    OPHYPWR = 0xF;  /* PHY: Power down */
-
 
373
    udelay(10);
-
 
374
    ORSTCON = 7;  /* Put the PHY into reset (needed to get current down) */
-
 
375
    udelay(10);
-
 
376
    PCGCCTL = 1;  /* Shut down PHY clock */
372
    
377
    
373
    clockgate_enable(CLOCKGATE_USB_1, false);
378
    clockgate_enable(CLOCKGATE_USB_1, false);
374
    clockgate_enable(CLOCKGATE_USB_2, false);
379
    clockgate_enable(CLOCKGATE_USB_2, false);
375
}
380
}
376
 
381