diff options
author | Nicolas Reinecke <nr@das-labor.org> | 2016-11-14 01:33:46 +0100 |
---|---|---|
committer | Nicolas Reinecke <nr@das-labor.org> | 2016-12-05 11:37:44 +0100 |
commit | 580af16b82c465835801102fe1879f7fffa3296a (patch) | |
tree | e543353b6d887ef713c6dd17a2858a8acfe5f8ae /os | |
parent | de0c3e70c689cb8861497c245904ab10001e0721 (diff) | |
download | ChibiOS-Contrib-580af16b82c465835801102fe1879f7fffa3296a.tar.gz ChibiOS-Contrib-580af16b82c465835801102fe1879f7fffa3296a.tar.bz2 ChibiOS-Contrib-580af16b82c465835801102fe1879f7fffa3296a.zip |
usbh: add otg stepping 2 code
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/ports/STM32/LLD/USBHv1/hal_stm32_otg.h | 4 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_stm32_otg.h b/os/hal/ports/STM32/LLD/USBHv1/hal_stm32_otg.h index a0594a3..3322e51 100644 --- a/os/hal/ports/STM32/LLD/USBHv1/hal_stm32_otg.h +++ b/os/hal/ports/STM32/LLD/USBHv1/hal_stm32_otg.h @@ -430,12 +430,16 @@ typedef struct { * @name GCCFG register bit definitions * @{ */ +/* Definitions for stepping 1.*/ #define GCCFG_NOVBUSSENS (1U<<21) /**< VBUS sensing disable. */ #define GCCFG_SOFOUTEN (1U<<20) /**< SOF output enable. */ #define GCCFG_VBUSBSEN (1U<<19) /**< Enable the VBUS sensing "B" device. */ #define GCCFG_VBUSASEN (1U<<18) /**< Enable the VBUS sensing "A" device. */ + +/* Definitions for stepping 2.*/ +#define GCCFG_VBDEN (1U<<21) /**< VBUS sensing enable. */ #define GCCFG_PWRDWN (1U<<16) /**< Power down. */ /** @} */ diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c index 0618d83..523f14d 100644 --- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c +++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c @@ -1386,12 +1386,20 @@ static void _usbh_start(USBHDriver *usbh) { otgp->PCGCCTL = 0; /* Internal FS PHY activation.*/ +#if STM32_OTG_STEPPING == 1 #if defined(BOARD_OTG_NOVBUSSENS) otgp->GCCFG = GCCFG_NOVBUSSENS | GCCFG_PWRDWN; #else otgp->GCCFG = GCCFG_PWRDWN; #endif +#elif STM32_OTG_STEPPING == 2 +#if defined(BOARD_OTG_NOVBUSSENS) + otgp->GCCFG = GCCFG_PWRDWN; +#else + otgp->GCCFG = (GCCFG_VBDEN | GCCFG_PWRDWN); +#endif +#endif /* 48MHz 1.1 PHY.*/ otgp->HCFG = HCFG_FSLSS | HCFG_FSLSPCS_48; |