MIPS: ralink: use the dwc2 driver for the rt305x USB controller
Subsystems (3)
PATCH 2/3 MIPS: ralink: setup dma_mask for the rt305x dwc2 usb controller
In reply to Matthijs KooijmanFrom: John Crispin <[email protected]>
Add code to setup the dma mask for the usb dwc2 platform driver on Ralink SoC. This contains a bit more code than strictly necessary, so it can also be used to set up ehci and ohci on other ralink platforms later on.
--- arch/mips/ralink/Makefile | 2 +- arch/mips/ralink/common.h | 2 ++ arch/mips/ralink/mt7620.c | 5 +++++ arch/mips/ralink/of.c | 2 ++ arch/mips/ralink/rt288x.c | 4 ++++ arch/mips/ralink/rt305x-usb.c | 51 +++++++++++++++++++++++++++++++++++++++++++ arch/mips/ralink/rt3883.c | 5 +++++ 7 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 arch/mips/ralink/rt305x-usb.c
v2: Rebased on top of mips-next-3.10
Switched order with next patch
Renamed ralink_usb_platform() to ralink_usb_init() Added empty function to rt288x.c
arch/mips/ralink/Makefile +1 -1
@@ -9,7 +9,7 @@ obj-y := prom.o of.o reset.o clk.o irq.o obj-$(CONFIG_SOC_RT288X) += rt288x.o -obj-$(CONFIG_SOC_RT305X) += rt305x.o +obj-$(CONFIG_SOC_RT305X) += rt305x.o rt305x-usb.o obj-$(CONFIG_SOC_RT3883) += rt3883.o obj-$(CONFIG_SOC_MT7620) += mt7620.o
arch/mips/ralink/common.h +2 -0
@@ -50,4 +50,6 @@ extern void prom_soc_init(struct ralink_soc_info *soc_info);__iomem void *plat_of_remap_node (const char *node); +void ralink_usb_init (void ); +#endif /* _RALINK_COMMON_H__ */
arch/mips/ralink/mt7620.c +5 -0
@@ -137,6 +137,11 @@ struct ralink_pinmux rt_gpio_pinmux = { .uart_mask = MT7620_GPIO_MODE_GPIO, }; +void ralink_usb_init (void ) +{ + +} +void __init ralink_clk_init (void ) {unsigned long cpu_rate, sys_rate;
arch/mips/ralink/of.c +2 -0
@@ -108,6 +108,8 @@ static int __init plat_of_setup(void)if (of_platform_populate (NULL , of_ids,NULL ,NULL ))panic ("failed to populate DT\n" ); +ralink_usb_init (); +return 0 ; }
arch/mips/ralink/rt288x.c +4 -0
@@ -74,6 +74,10 @@ struct ralink_pinmux rt_gpio_pinmux = { .wdt_reset = rt288x_wdt_reset, }; +void ralink_usb_init (void ) +{ +} +void __init ralink_clk_init (void ) {unsigned long cpu_rate;
arch/mips/ralink/rt305x-usb.c new file +51 -0
51 lines not on this page · raw message
arch/mips/ralink/rt3883.c +5 -0
@@ -166,6 +166,11 @@ struct ralink_pinmux rt_gpio_pinmux = { .pci_mask = RT3883_GPIO_MODE_PCI_MASK, }; +void ralink_usb_init (void ) +{ +} + +void __init ralink_clk_init (void ) {unsigned long cpu_rate, sys_rate;
Signature · 1 line
1.8.0
PATCH 3/3 owrt: MIPS: ralink: add usb platform support
In reply to Matthijs KooijmanFrom: John Crispin <[email protected]>
Add code to load the platform ehci/ohci driver on Ralink SoC. For the usb core to work we need to populate the platform_data during boot, prior to the usb driver being loaded.
--- arch/mips/ralink/Makefile | 2 +- arch/mips/ralink/rt305x-usb.c | 74 ++++++++++++++++++++++++++ arch/mips/ralink/rt3883-usb.c | 118 ++++++++++++++++++++++++++++++++++++++++++ arch/mips/ralink/rt3883.c | 5 -- 4 files changed, 193 insertions(+), 6 deletions(-) create mode 100644 arch/mips/ralink/rt3883-usb.c
v2: Rebased on top of mips-next-3.10
Switched order with previous patch
This patch isn't intended for mips-next-3.10 yet.
arch/mips/ralink/Makefile +1 -1
@@ -10,7 +10,7 @@ obj-y := prom.o of.o reset.o clk.o irq.o obj-$(CONFIG_SOC_RT288X) += rt288x.o obj-$(CONFIG_SOC_RT305X) += rt305x.o rt305x-usb.o -obj-$(CONFIG_SOC_RT3883) += rt3883.o +obj-$(CONFIG_SOC_RT3883) += rt3883.o rt3883-usb.o obj-$(CONFIG_SOC_MT7620) += mt7620.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
arch/mips/ralink/rt305x-usb.c +74 -0
95 lines not on this page · raw message
arch/mips/ralink/rt3883-usb.c new file +118 -0
118 lines not on this page · raw message
arch/mips/ralink/rt3883.c +0 -5
@@ -166,11 +166,6 @@ struct ralink_pinmux rt_gpio_pinmux = { .pci_mask = RT3883_GPIO_MODE_PCI_MASK, }; -void ralink_usb_init (void ) -{ -} - -void __init ralink_clk_init (void ) {unsigned long cpu_rate, sys_rate;
Signature · 1 line
1.8.0
PATCH 1/3 MIPS: ralink: use the dwc2 driver for the rt305x USB controller
This sets up the devicetree file for the rt3050 chip series and rt3052 eval board to use the right compatible string for the dwc2 driver.
--- arch/mips/ralink/dts/rt3050.dtsi | 10 ++++++++++ arch/mips/ralink/dts/rt3052_eval.dts | 4 ++++ 2 files changed, 14 insertions(+)
v2: Rebased on top of mips-next-3.10
Renamed device from "otg" to "usb"
arch/mips/ralink/dts/rt3050.dtsi +10 -0
@@ -55,4 +55,14 @@ reg-shift = <2>; }; }; + + usb@101c0000 { + compatible = "ralink,rt3050-usb", "snps,dwc2"; + reg = <0x101c0000 40000>; + + interrupt-parent = <&intc>; + interrupts = <18>; + + status = "disabled"; + }; };
arch/mips/ralink/dts/rt3052_eval.dts +4 -0
@@ -45,4 +45,8 @@ reg = <0x50000 0x7b0000>; }; }; + + usb@101c0000 { + status = "ok"; + }; };
Signature · 1 line
1.8.0
John Crispin
maintainerRe: [PATCH 3/3] owrt: MIPS: ralink: add usb platform support
In reply to Matthijs KooijmanQuoted 9 lines · Matthijs Kooijman
From: John Crispin<[email protected]>
Add code to load the platform ehci/ohci driver on Ralink SoC. For the usb core to work we need to populate the
platform_dataduring boot, prior to the usb driver being loaded.Signed-off-by John Crispin<[email protected]>[[email protected]: Extracted non-ohci/ehci 3052 code into separate patch]Signed-off-by Matthijs Kooijman<[email protected]>
Hi,
this patch sits ontop of a patch from openwrt that adds a OF binding for ohci/ehci so it wont go upstream until the usb people decided how to expose ohci-platform and ehci-platform in OF
John
John Crispin
maintainerRe: [PATCH 2/3] MIPS: ralink: setup dma_mask for the rt305x dwc2 usb controller
In reply to Matthijs Kooijmanarch/mips/ralink/mt7620.c struct ralink_pinmux rt_gpio_pinmux = { · line 144
Quoted 13 lines · Matthijs Kooijman
arch/mips/ralink/mt7620.c +5
-0@@ -137,6 +137,11 @@ struct ralink_pinmux rt_gpio_pinmux = { .uart_mask = MT7620_GPIO_MODE_GPIO, }; +void ralink_usb_init (void ) +{ + +} +
Hi,
i'll post a different patch later that eliminates the need for these empty stubs.
John
Re: [PATCH 3/3] owrt: MIPS: ralink: add usb platform support
In reply to John CrispinHello.
Quoted 6 lines · John Crispin
Quoted 5 lines
From: John Crispin<[email protected]>
Add code to load the platform ehci/ohci driver on Ralink SoC. For the usb core to work we need to populate the
platform_dataduring boot, prior to the usb driver being loaded.
Quoted 7 lines
Quoted 3 lines
Signed-off-by John Crispin<[email protected]>[[email protected]: Extracted non-ohci/ehci 3052 code into separate patch]Signed-off-by Matthijs Kooijman<[email protected]>this patch sits ontop of a patch from openwrt that adds a OF binding for ohci/ehci so it wont go upstream until the usb people decided how to expose ohci-platform and ehci-platform in OF
Note that there's already a patch exposing ehci-platform to DT in Greg's
'usb-next' branch:
Quoted 1 line
John
WBR, Sergei