@@ -1061,6 +1061,15 @@ static int priv_clock_enable(void)
1061
1061
HAL_SYSCFG_SetOTGPHYReferenceClockSelection (SYSCFG_OTG_HS_PHY_CLK_SELECT_1 );
1062
1062
/* Configuring the SYSCFG registers OTG_HS PHY : OTG_HS PHY enable*/
1063
1063
HAL_SYSCFG_EnableOTGPHY (SYSCFG_OTG_HS_PHY_ENABLE );
1064
+ #elif DT_HAS_COMPAT_STATUS_OKAY (st_stm32n6_otghs )
1065
+ /* Enable Vdd USB voltage monitoring */
1066
+ LL_PWR_EnableVddUSBMonitoring ();
1067
+ while (__HAL_PWR_GET_FLAG (PWR_FLAG_USB33RDY )) {
1068
+ /* Wait FOR VDD33USB ready */
1069
+ }
1070
+
1071
+ /* Enable VDDUSB */
1072
+ LL_PWR_EnableVddUSB ();
1064
1073
#elif defined(PWR_USBSCR_USB33SV ) || defined(PWR_SVMCR_USV )
1065
1074
/*
1066
1075
* VDDUSB independent USB supply (PWR clock is on)
@@ -1136,13 +1145,15 @@ static int priv_clock_enable(void)
1136
1145
/* Both OTG HS and USBPHY sleep clock MUST be disabled here at the same time */
1137
1146
LL_AHB2_GRP1_DisableClockStopSleep (LL_AHB2_GRP1_PERIPH_OTG_HS ||
1138
1147
LL_AHB2_GRP1_PERIPH_USBPHY );
1139
- #else
1148
+ #elif ! DT_HAS_COMPAT_STATUS_OKAY ( st_stm32n6_otghs )
1140
1149
LL_AHB1_GRP1_DisableClockLowPower (LL_AHB1_GRP1_PERIPH_OTGHSULPI );
1141
1150
#endif /* defined(CONFIG_SOC_SERIES_STM32H7X) */
1142
1151
1143
1152
#if USB_OTG_HS_EMB_PHY
1153
+ #if !DT_HAS_COMPAT_STATUS_OKAY (st_stm32n6_otghs )
1144
1154
LL_APB2_GRP1_EnableClock (LL_APB2_GRP1_PERIPH_OTGPHYC );
1145
1155
#endif
1156
+ #endif
1146
1157
#elif defined(CONFIG_SOC_SERIES_STM32H7X ) && DT_HAS_COMPAT_STATUS_OKAY (st_stm32_otgfs )
1147
1158
/* The USB2 controller only works in FS mode, but the ULPI clock needs
1148
1159
* to be disabled in sleep mode for it to work.
@@ -1171,9 +1182,11 @@ static int priv_clock_disable(void)
1171
1182
static struct udc_ep_config ep_cfg_in [DT_INST_PROP (0 , num_bidir_endpoints )];
1172
1183
static struct udc_ep_config ep_cfg_out [DT_INST_PROP (0 , num_bidir_endpoints )];
1173
1184
1185
+ #if !DT_HAS_COMPAT_STATUS_OKAY (st_stm32n6_otghs )
1174
1186
PINCTRL_DT_INST_DEFINE (0 );
1175
1187
static const struct pinctrl_dev_config * usb_pcfg =
1176
1188
PINCTRL_DT_INST_DEV_CONFIG_GET (0 );
1189
+ #endif
1177
1190
1178
1191
#if USB_OTG_HS_ULPI_PHY
1179
1192
static const struct gpio_dt_spec ulpi_reset =
@@ -1256,11 +1269,13 @@ static int udc_stm32_driver_init0(const struct device *dev)
1256
1269
IRQ_CONNECT (UDC_STM32_IRQ , UDC_STM32_IRQ_PRI , udc_stm32_irq ,
1257
1270
DEVICE_DT_INST_GET (0 ), 0 );
1258
1271
1272
+ #if !DT_HAS_COMPAT_STATUS_OKAY (st_stm32n6_otghs )
1259
1273
err = pinctrl_apply_state (usb_pcfg , PINCTRL_STATE_DEFAULT );
1260
1274
if (err < 0 ) {
1261
1275
LOG_ERR ("USB pinctrl setup failed (%d)" , err );
1262
1276
return err ;
1263
1277
}
1278
+ #endif
1264
1279
1265
1280
#ifdef SYSCFG_CFGR1_USB_IT_RMP
1266
1281
/*
0 commit comments