[PATCH 4/5] usb: musb: dsps: use proper child nodes
This moves the two instances from the big node into two child nodes. The glue layer ontop does almost nothing. There is one devices containing the control module for USB (2) phy, (2) usb and later the dma engine. The usb device is the glue device which contains the musb device as a child. This is what we do ever since. The new file musb_am335x is just here to prob the new bus and populate child devices. There are a lot of changes to the dsps file as a result of the changes: - musb_core_offset This is gone. The device tree provides memory ressources information for the device there is no need to fix things - instances This is gone as well. If we have two instances then we have have two child enabled nodes in the device tree. For instance the SoC in beagle bone has two USB instances but only one has been wired up so there is no need to load and init the second instance since it won't be used. - dsps_glue is now per glue device In the past there was one of this structs but with an array of two and each instance accessed its variable depending on the platform device id. - no unneeded copy of structs I do not know why struct dsps_musb_wrapper is copied but it is not necessary. The same goes for musb_hdrc_platform_data which allocated on demand and then again by platform_device_add_data(). One copy is enough. Signed-off-by: Sebastian Andrzej Siewior bige...@linutronix.de --- arch/arm/boot/dts/am335x-bone.dts | 16 +++ arch/arm/boot/dts/am335x-evm.dts | 24 arch/arm/boot/dts/am335x-evmsk.dts | 16 +++ arch/arm/boot/dts/am33xx.dtsi | 97 -- drivers/usb/musb/Kconfig | 4 + drivers/usb/musb/Makefile | 3 + drivers/usb/musb/musb_am335x.c | 55 drivers/usb/musb/musb_dsps.c | 255 ++--- 8 files changed, 299 insertions(+), 171 deletions(-) create mode 100644 drivers/usb/musb/musb_am335x.c diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts index 444b4ed..a8907b5 100644 --- a/arch/arm/boot/dts/am335x-bone.dts +++ b/arch/arm/boot/dts/am335x-bone.dts @@ -120,6 +120,22 @@ status = okay; }; + musb: usb@4740 { + status = okay; + + control@44e1 { + status = okay; + }; + + phy@47401300 { + status = okay; + }; + + usb@47401000 { + status = okay; + }; + }; + i2c0: i2c@44e0b000 { pinctrl-names = default; pinctrl-0 = i2c0_pins; diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts index 3aee1a4..b2987e0 100644 --- a/arch/arm/boot/dts/am335x-evm.dts +++ b/arch/arm/boot/dts/am335x-evm.dts @@ -171,6 +171,30 @@ }; }; + musb: usb@4740 { + status = okay; + + control@44e1 { + status = okay; + }; + + phy@47401300 { + status = okay; + }; + + phy@47401b00 { + status = okay; + }; + + usb@47401000 { + status = okay; + }; + + usb@47401800 { + status = okay; + }; + }; + i2c1: i2c@4802a000 { pinctrl-names = default; pinctrl-0 = i2c1_pins; diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts index 0c8ad17..e92446c 100644 --- a/arch/arm/boot/dts/am335x-evmsk.dts +++ b/arch/arm/boot/dts/am335x-evmsk.dts @@ -207,6 +207,22 @@ }; }; + musb: usb@4740 { + status = okay; + + control@44e1 { + status = okay; + }; + + phy@47401300 { + status = okay; + }; + + usb@47401000 { + status = okay; + }; + }; + epwmss2: epwmss@48304000 { status = okay; diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi index 38b446b..e1e773c 100644 --- a/arch/arm/boot/dts/am33xx.dtsi +++ b/arch/arm/boot/dts/am33xx.dtsi @@ -26,6 +26,10 @@ serial5 = uart5; d_can0 = dcan0; d_can1 = dcan1; + usb0 = usb0; +
Re: [PATCH 4/5] usb: musb: dsps: use proper child nodes
On Fri, Jul 05, 2013 at 03:32:57PM +0200, Sebastian Andrzej Siewior wrote: This moves the two instances from the big node into two child nodes. The glue layer ontop does almost nothing. This could be two indepentant child nodes but I have no idea how 'ti,hwmods = usb_otg_hs;' affects the two musb controler. Signed-off-by: Sebastian Andrzej Siewior bige...@linutronix.de pretty good :-) -- balbi signature.asc Description: Digital signature
[PATCH 4/5] usb: musb: dsps: use proper child nodes
This moves the two instances from the big node into two child nodes. The glue layer ontop does almost nothing. This could be two indepentant child nodes but I have no idea how 'ti,hwmods = usb_otg_hs;' affects the two musb controler. Signed-off-by: Sebastian Andrzej Siewior bige...@linutronix.de --- arch/arm/boot/dts/am335x-bone.dts | 8 ++ arch/arm/boot/dts/am335x-evm.dts | 16 arch/arm/boot/dts/am335x-evmsk.dts | 16 arch/arm/boot/dts/am33xx.dtsi | 47 --- drivers/usb/musb/musb_dsps.c | 51 ++ 5 files changed, 97 insertions(+), 41 deletions(-) diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts index 83184e5..ae50fd7 100644 --- a/arch/arm/boot/dts/am335x-bone.dts +++ b/arch/arm/boot/dts/am335x-bone.dts @@ -124,6 +124,14 @@ status = okay; }; + musb: usb@4740 { + status = okay; + + usb0@47401000 { + status = okay; + }; + }; + i2c0: i2c@44e0b000 { pinctrl-names = default; pinctrl-0 = i2c0_pins; diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts index 317637a..dc236f4 100644 --- a/arch/arm/boot/dts/am335x-evm.dts +++ b/arch/arm/boot/dts/am335x-evm.dts @@ -175,6 +175,22 @@ status = okay; }; + musb1_phy: phy1@47401800 { + status = okay; + }; + + musb: usb@4740 { + status = okay; + + usb0@47401000 { + status = okay; + }; + + usb1@47401800 { + status = okay; + }; + }; + i2c1: i2c@4802a000 { pinctrl-names = default; pinctrl-0 = i2c1_pins; diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts index 99d9444..74ce579 100644 --- a/arch/arm/boot/dts/am335x-evmsk.dts +++ b/arch/arm/boot/dts/am335x-evmsk.dts @@ -211,6 +211,22 @@ status = okay; }; + musb1_phy: phy1@47401800 { + status = okay; + }; + + musb: usb@4740 { + status = okay; + + usb0@47401000 { + status = okay; + }; + + usb1@47401800 { + status = okay; + }; + }; + epwmss2: epwmss@48304000 { status = okay; diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi index 66bb420..bb2298c 100644 --- a/arch/arm/boot/dts/am33xx.dtsi +++ b/arch/arm/boot/dts/am33xx.dtsi @@ -349,22 +349,41 @@ status = disabled; }; - usb@4740 { + musb: usb@4740 { compatible = ti,musb-am33xx; - reg = 0x4740 0x1000/* usbss */ - 0x47401000 0x800 /* musb instance 0 */ - 0x47401800 0x800; /* musb instance 1 */ - interrupts = 17/* usbss */ - 18/* musb instance 0 */ - 19; /* musb instance 1 */ - multipoint = 1; - num-eps = 16; - ram-bits = 12; - port0-mode = 3; - port1-mode = 3; - power = 250; + reg = 0x4740 0x1000; + ranges; + #address-cells = 1; + #size-cells = 1; + interrupts = 17; ti,hwmods = usb_otg_hs; - phys = musb1_phy; + status = disabled; + + usb0@47401000 { + reg = 0x47401000 0x800; + interrupts = 18; + interrupt-names = mc; + multipoint = 1; + num-eps = 16; + ram-bits = 12; + port-mode = 3; + power = 250; + phys = musb0_phy; + status = disabled; + }; + + usb1@47401800 { + reg = 0x47401800 0x800; +
Re: [PATCH 4/5] usb: musb: dsps: use proper child nodes
Hi Sebastian, 2013/7/5 Sebastian Andrzej Siewior bige...@linutronix.de: This moves the two instances from the big node into two child nodes. The glue layer ontop does almost nothing. This could be two indepentant child nodes but I have no idea how 'ti,hwmods = usb_otg_hs;' affects the two musb controler. Signed-off-by: Sebastian Andrzej Siewior bige...@linutronix.de --- arch/arm/boot/dts/am335x-bone.dts | 8 ++ arch/arm/boot/dts/am335x-evm.dts | 16 arch/arm/boot/dts/am335x-evmsk.dts | 16 arch/arm/boot/dts/am33xx.dtsi | 47 --- drivers/usb/musb/musb_dsps.c | 51 ++ 5 files changed, 97 insertions(+), 41 deletions(-) diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts index 83184e5..ae50fd7 100644 --- a/arch/arm/boot/dts/am335x-bone.dts +++ b/arch/arm/boot/dts/am335x-bone.dts @@ -124,6 +124,14 @@ status = okay; }; + musb: usb@4740 { + status = okay; + + usb0@47401000 { + status = okay; + }; + }; + i2c0: i2c@44e0b000 { pinctrl-names = default; pinctrl-0 = i2c0_pins; diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts index 317637a..dc236f4 100644 --- a/arch/arm/boot/dts/am335x-evm.dts +++ b/arch/arm/boot/dts/am335x-evm.dts @@ -175,6 +175,22 @@ status = okay; }; + musb1_phy: phy1@47401800 { + status = okay; + }; + + musb: usb@4740 { + status = okay; + + usb0@47401000 { + status = okay; + }; + + usb1@47401800 { + status = okay; + }; + }; + i2c1: i2c@4802a000 { pinctrl-names = default; pinctrl-0 = i2c1_pins; diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts index 99d9444..74ce579 100644 --- a/arch/arm/boot/dts/am335x-evmsk.dts +++ b/arch/arm/boot/dts/am335x-evmsk.dts @@ -211,6 +211,22 @@ status = okay; }; + musb1_phy: phy1@47401800 { + status = okay; + }; + + musb: usb@4740 { + status = okay; + + usb0@47401000 { + status = okay; + }; + + usb1@47401800 { + status = okay; + }; + }; + epwmss2: epwmss@48304000 { status = okay; diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi index 66bb420..bb2298c 100644 --- a/arch/arm/boot/dts/am33xx.dtsi +++ b/arch/arm/boot/dts/am33xx.dtsi @@ -349,22 +349,41 @@ status = disabled; }; - usb@4740 { + musb: usb@4740 { compatible = ti,musb-am33xx; - reg = 0x4740 0x1000/* usbss */ - 0x47401000 0x800 /* musb instance 0 */ - 0x47401800 0x800; /* musb instance 1 */ - interrupts = 17/* usbss */ - 18/* musb instance 0 */ - 19; /* musb instance 1 */ - multipoint = 1; - num-eps = 16; - ram-bits = 12; - port0-mode = 3; - port1-mode = 3; - power = 250; + reg = 0x4740 0x1000; + ranges; + #address-cells = 1; + #size-cells = 1; + interrupts = 17; ti,hwmods = usb_otg_hs; - phys = musb1_phy; + status = disabled; + + usb0@47401000 { + reg = 0x47401000 0x800; + interrupts = 18; + interrupt-names = mc; + multipoint = 1; + num-eps = 16; + ram-bits = 12; + port-mode = 3; + power = 250; + phys =
Re: [PATCH 4/5] usb: musb: dsps: use proper child nodes
On 07/05/2013 05:08 PM, Enric Balletbo Serra wrote: Hi Sebastian, Hi Enric, I'm trying to test these patches but I've problems, I've following error, [ 10.096492] musb-dsps 4740.usb: failed to get memory for instance 0 [ 10.103481] musb-dsps 4740.usb: failed to create child pdev I'm missing something ? This is printed if you don't have the memory for the child device. Did you update your device tree? Thanks in advance, Enric Sebastian -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 4/5] usb: musb: dsps: use proper child nodes
2013/7/5 Sebastian Andrzej Siewior bige...@linutronix.de: On 07/05/2013 05:08 PM, Enric Balletbo Serra wrote: Hi Sebastian, Hi Enric, I'm trying to test these patches but I've problems, I've following error, [ 10.096492] musb-dsps 4740.usb: failed to get memory for instance 0 [ 10.103481] musb-dsps 4740.usb: failed to create child pdev I'm missing something ? This is printed if you don't have the memory for the child device. Did you update your device tree? Fixed, I didn't update my DT for my custom board properly. Thanks. Thanks in advance, Enric Sebastian -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 4/5] usb: musb: dsps: use proper child nodes
On 07/05/2013 05:22 PM, Enric Balletbo Serra wrote: Fixed, I didn't update my DT for my custom board properly. Thanks. Good. I hate breaking the compatibility for DT but unfortunately it is beyond repair. Sebastian -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html