1 #include "hal_clk.h"
2 #include "hal_reset.h"
3 #include "usb_sun20iw1.h"
4 
5 #define USB_RISCV_GIC_OFFSET 16
6 
7 static const struct platform_usb_config usb_hci_table[] =
8 {
9     {//enci-0
10         .name       = "sunxi-ehci0",
11         .pbase      = SUNXI_USB_EHCI0_PBASE,
12         .irq        = 62 - USB_RISCV_GIC_OFFSET,
13         .usb_clk    = CLK_BUS_EHCI0,
14         .usb_rst    = RST_BUS_EHCI0,
15         .phy_clk    = 0,
16         .phy_rst    = RST_USB_PHY0
17     },
18 
19     {//enci-1
20         .name       = "sunxi-ehci1",
21         .pbase      = SUNXI_USB_EHCI1_PBASE,
22         .irq        = 65 - USB_RISCV_GIC_OFFSET,
23         .usb_clk    = CLK_BUS_EHCI1,
24         .usb_rst    = RST_BUS_EHCI1,
25         .phy_clk    = 0,
26         .phy_rst    = RST_USB_PHY1
27     }
28 };
29 
30 static const struct platform_usb_config usb_otg_table =
31 {
32     .name       = "sunxi-otg",
33     .pbase      = SUNXI_USB_OTG_PBASE,
34     .irq        = 61 - USB_RISCV_GIC_OFFSET,
35     .usb_clk    = CLK_BUS_OTG,
36     .usb_rst    = RST_BUS_OTG,
37     .phy_clk    = 0,
38     .phy_rst    = RST_USB_PHY0
39 };
40 
platform_get_hci_table(void)41 struct platform_usb_config *platform_get_hci_table(void)
42 {
43     return (struct platform_usb_config *)usb_hci_table;
44 }
45 
platform_get_otg_table(void)46 struct platform_usb_config *platform_get_otg_table(void)
47 {
48     return (struct platform_usb_config *)&usb_otg_table;
49 }
50