Skip to content

Commit 125a3f0

Browse files
refactor(usb): Include supported PHYs information in SoC
1 parent ce59bd4 commit 125a3f0

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

components/soc/esp32p4/usb_dwc_periph.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const usb_dwc_info_t usb_dwc_info = {
4242
.fsls_signals = NULL,
4343
.otg_signals = NULL,
4444
.internal_phy_io = NULL, // HS PHY is not mapped to any GPIO
45+
.supported_phys = USB_PHY_INST_UTMI_0,
4546
.irq = ETS_USB_OTG_INTR_SOURCE,
4647
.irq_2nd_cpu = ETS_USB_OTG_ENDP_MULTI_PROC_INTR_SOURCE,
4748
},
@@ -50,6 +51,7 @@ const usb_dwc_info_t usb_dwc_info = {
5051
.fsls_signals = NULL,
5152
.otg_signals = &dwc_fs_otg_signals,
5253
.internal_phy_io = &internal_phy_io,
54+
.supported_phys = USB_PHY_INST_FSLS_INTERN_0,
5355
.irq = ETS_USB_OTG11_CH0_INTR_SOURCE,
5456
.irq_2nd_cpu = -1,
5557
},

components/soc/esp32s2/usb_dwc_periph.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const usb_dwc_info_t usb_dwc_info = {
5252
.fsls_signals = &fsls_signals,
5353
.otg_signals = &otg_signals,
5454
.internal_phy_io = &internal_phy_io,
55+
.supported_phys = USB_PHY_INST_FSLS_INTERN_0,
5556
.irq = ETS_USB_INTR_SOURCE,
5657
.irq_2nd_cpu = -1,
5758
},

components/soc/esp32s3/usb_dwc_periph.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const usb_dwc_info_t usb_dwc_info = {
5252
.fsls_signals = &fsls_signals,
5353
.otg_signals = &otg_signals,
5454
.internal_phy_io = &internal_phy_io,
55+
.supported_phys = USB_PHY_INST_FSLS_INTERN_0,
5556
.irq = ETS_USB_INTR_SOURCE,
5657
.irq_2nd_cpu = -1,
5758
},

components/soc/include/soc/usb_dwc_periph.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ extern "C" {
1616

1717
/* ---------------------------------- Types --------------------------------- */
1818

19+
/**
20+
* @brief USB PHY Instance Type
21+
*/
22+
typedef enum {
23+
USB_PHY_INST_FSLS_INTERN_0 = (1 << 0),
24+
USB_PHY_INST_FSLS_INTERN_1 = (1 << 1),
25+
USB_PHY_INST_UTMI_0 = (1 << 2),
26+
USB_PHY_INST_EXTERN = (1 << 3),
27+
} usb_phy_inst_t;
28+
1929
/**
2030
* @brief USB PHY FSLS Serial Interface Signals
2131
*
@@ -83,6 +93,7 @@ typedef struct {
8393
const usb_fsls_serial_signal_conn_t * const fsls_signals; // Must be set if external PHY is supported by controller
8494
const usb_otg_signal_conn_t * const otg_signals;
8595
const usb_internal_phy_io_t * const internal_phy_io; // Must be set for internal FSLS PHY(s)
96+
const usb_phy_inst_t supported_phys; // Bitmap of supported PHYs by this controller
8697
const int irq;
8798
const int irq_2nd_cpu; // The USB-DWC can provide 2nd interrupt so each CPU can have its own interrupt line. Set to -1 if not supported
8899
} controllers [SOC_USB_OTG_PERIPH_NUM];

0 commit comments

Comments
 (0)