Changeset 278bc93 in rtems-libbsd


Ignore:
Timestamp:
Mar 16, 2015, 8:39:14 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, fd86c091b97759106da7355ce1dd81ebe030e285, freebsd-9.3, f020f08430150c1656a0ad0a1de13699db9b980b
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

Files:
4 added
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    ra0828f9 r278bc93  
    661661LIB_C_FILES += rtemsbsd/pppd/utils.c
    662662LIB_C_FILES += rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c
    663 LIB_C_FILES += rtemsbsd/sys/dev/usb/controller/ohci_lpc24xx.c
    664 LIB_C_FILES += rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c
     663LIB_C_FILES += rtemsbsd/sys/dev/usb/controller/ohci_lpc.c
     664LIB_C_FILES += rtemsbsd/sys/dev/usb/controller/usb_otg_transceiver.c
     665LIB_C_FILES += rtemsbsd/sys/dev/usb/controller/usb_otg_transceiver_dump.c
    665666LIB_C_FILES += rtemsbsd/sys/dev/smc/if_smc_nexus.c
    666667LIB_C_FILES += rtemsbsd/sys/dev/ffec/if_ffec_mcf548x.c
  • freebsd/sys/dev/usb/controller/ehci.c

    ra0828f9 r278bc93  
    592592}
    593593
    594 static void
     594#ifndef __rtems__
     595static void
     596#else /* __rtems__ */
     597void
     598#endif /* __rtems__ */
    595599ehci_suspend(ehci_softc_t *sc)
    596600{
     
    601605}
    602606
    603 static void
     607#ifndef __rtems__
     608static void
     609#else /* __rtems__ */
     610void
     611#endif /* __rtems__ */
    604612ehci_resume(ehci_softc_t *sc)
    605613{
  • freebsd/sys/dev/usb/controller/ehci.h

    ra0828f9 r278bc93  
    473473void    ehci_detach(struct ehci_softc *sc);
    474474void    ehci_interrupt(ehci_softc_t *sc);
     475#ifdef __rtems__
     476void    ehci_suspend(ehci_softc_t *sc);
     477void    ehci_resume(ehci_softc_t *sc);
     478#endif /* __rtems__ */
    475479
    476480#endif                                  /* _EHCI_H_ */
  • libbsd.py

    ra0828f9 r278bc93  
    118118            'pppd/utils.c',
    119119            'sys/dev/usb/controller/ehci_mpc83xx.c',
    120             'sys/dev/usb/controller/ohci_lpc24xx.c',
    121             'sys/dev/usb/controller/ohci_lpc32xx.c',
     120            'sys/dev/usb/controller/ohci_lpc.c',
     121            'sys/dev/usb/controller/usb_otg_transceiver.c',
     122            'sys/dev/usb/controller/usb_otg_transceiver_dump.c',
    122123            'sys/dev/smc/if_smc_nexus.c',
    123124            'sys/dev/ffec/if_ffec_mcf548x.c',
  • 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.