From 4ce2d379bb538085c960eedd5fd1dd393f497bb7 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 9 Mar 2022 13:12:47 -0500 Subject: [PATCH] stm32: Simplify CCIPR2 register assignment on stm32g0 Signed-off-by: Kevin O'Connor --- src/stm32/stm32g0.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/stm32/stm32g0.c b/src/stm32/stm32g0.c index ee0230f4..d3815328 100644 --- a/src/stm32/stm32g0.c +++ b/src/stm32/stm32g0.c @@ -94,11 +94,8 @@ clock_setup(void) while ((RCC->CFGR & RCC_CFGR_SWS_Msk) != (2 << RCC_CFGR_SWS_Pos)) ; - // Enable USB clock - if (CONFIG_USBSERIAL) { - // PLLQCLK - RCC->CCIPR2 |= RCC_CCIPR2_USBSEL_1; - } + // Use PLLQCLK for USB (setting USBSEL=2 works in practice) + RCC->CCIPR2 = RCC_CCIPR2_USBSEL_1; }