Changeset 278bc93 in rtems-libbsd for rtemsbsd/sys


Ignore:
Timestamp:
03/16/15 20:39:14 (9 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, 5-freebsd-12, 6-freebsd-12, freebsd-9.3, master
Children:
4dab3a0
Parents:
a0828f9
git-author:
Sebastian Huber <sebastian.huber@…> (03/16/15 20:39:14)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/15/15 13:40:55)
Message:

usb: Import USB support from libusb

Location:
rtemsbsd/sys/dev/usb
Files:
4 added
2 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c

    ra0828f9 r278bc93  
    8888static device_attach_t ehci_mpc83xx_attach;
    8989static device_detach_t ehci_mpc83xx_detach;
     90static device_suspend_t ehci_mpc83xx_suspend;
     91static device_resume_t ehci_mpc83xx_resume;
     92
     93static int
     94ehci_mpc83xx_suspend(device_t self)
     95{
     96        ehci_softc_t *e = device_get_softc(self);
     97        int eno = bus_generic_suspend(self);
     98
     99        if (eno != 0) {
     100                return (eno);
     101        }
     102
     103        ehci_suspend(e);
     104
     105        return (0);
     106}
     107
     108static int
     109ehci_mpc83xx_resume(device_t self)
     110{
     111        ehci_softc_t *e = device_get_softc(self);
     112
     113        ehci_resume(e);
     114
     115        bus_generic_resume(self);
     116
     117        return (0);
     118}
     119
    90120
    91121static int
     
    117147        volatile uint32_t *control = &mpc83xx.usb_dr.control;
    118148
     149#ifdef BSP_USB_EHCI_MPC83XX_HAS_ULPI
     150        *control = CONTROL_PHY_CLOCK_SEL;
     151#else
    119152        *control = CONTROL_PLL_RESET | CONTROL_REFSEL(0x2U);
    120153        *control = CONTROL_UTMI_PHY_EN | CONTROL_REFSEL(0x2U);
     154#endif
    121155
    122156        while ((*control & CONTROL_PHY_CLK_VALID) == 0) {
     
    147181        mpc83xx.usb_dr.snoop1 = SNOOP_ADDR(0x0) | SNOOP_SIZE_2GB;
    148182        mpc83xx.usb_dr.snoop2 = SNOOP_ADDR(0x80000) | SNOOP_SIZE_2GB;
     183#ifdef BSP_USB_EHCI_MPC83XX_HAS_ULPI
     184        mpc83xx.usb_dr.control = CONTROL_PHY_CLOCK_SEL | CONTROL_USB_EN;
     185        mpc83xx.usb_dr.portsc1 = htole32(PORTSC_PTS_ULPI);
     186#else
    149187        mpc83xx.usb_dr.control = CONTROL_UTMI_PHY_EN | CONTROL_REFSEL(0x2) | CONTROL_USB_EN;
    150188        mpc83xx.usb_dr.portsc1 = htole32(PORTSC_PTS_UTMI);
     189#endif
    151190#if 0
    152191        mpc83xx.usb_dr.pri_ctrl = 0xcU;
     
    251290        DEVMETHOD(device_attach, ehci_mpc83xx_attach),
    252291        DEVMETHOD(device_detach, ehci_mpc83xx_detach),
    253         DEVMETHOD(device_suspend,bus_generic_suspend),
    254         DEVMETHOD(device_resume, bus_generic_resume),
     292        DEVMETHOD(device_suspend, ehci_mpc83xx_suspend),
     293        DEVMETHOD(device_resume, ehci_mpc83xx_resume),
    255294        DEVMETHOD(device_shutdown, bus_generic_shutdown),
    256295
Note: See TracChangeset for help on using the changeset viewer.