Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97238b35 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Felipe Balbi
Browse files

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: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent e96bdc3d
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -120,6 +120,22 @@
			status = "okay";
		};

		musb: usb@47400000 {
			status = "okay";

			control@44e10000 {
				status = "okay";
			};

			phy@47401300 {
				status = "okay";
			};

			usb@47401000 {
				status = "okay";
			};
		};

		i2c0: i2c@44e0b000 {
			pinctrl-names = "default";
			pinctrl-0 = <&i2c0_pins>;
+24 −0
Original line number Diff line number Diff line
@@ -171,6 +171,30 @@
			};
		};

		musb: usb@47400000 {
			status = "okay";

			control@44e10000 {
				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>;
+16 −0
Original line number Diff line number Diff line
@@ -207,6 +207,22 @@
			};
		};

		musb: usb@47400000 {
			status = "okay";

			control@44e10000 {
				status = "okay";
			};

			phy@47401300 {
				status = "okay";
			};

			usb@47401000 {
				status = "okay";
			};
		};

		epwmss2: epwmss@48304000 {
			status = "okay";

+83 −14
Original line number Diff line number Diff line
@@ -26,6 +26,10 @@
		serial5 = &uart5;
		d_can0 = &dcan0;
		d_can1 = &dcan1;
		usb0 = &usb0;
		usb1 = &usb1;
		phy0 = &usb0_phy;
		phy1 = &usb1_phy;
	};

	cpus {
@@ -333,21 +337,86 @@
			status = "disabled";
		};

		usb@47400000 {
		usb: usb@47400000 {
			compatible = "ti,am33xx-usb";
			reg = <0x47400000 0x1000>;
			ranges;
			#address-cells = <1>;
			#size-cells = <1>;
			ti,hwmods = "usb_otg_hs";
			status = "disabled";

			ctrl_mod: control@44e10000 {
				compatible = "ti,am335x-usb-ctrl-module";
				reg = <0x44e10620 0x10
					0x44e10648 0x4>;
				reg-names = "phy_ctrl", "wakeup";
				status = "disabled";
			};

			usb0_phy: phy@47401300 {
				compatible = "ti,am335x-usb-phy";
				reg = <0x47401300 0x100>;
				reg-names = "phy";
				status = "disabled";
				ti,ctrl_mod = <&ctrl_mod>;
			};

			usb0: usb@47401000 {
				compatible = "ti,musb-am33xx";
			reg = <0x47400000 0x1000	/* usbss */
			       0x47401000 0x800		/* musb instance 0 */
			       0x47401800 0x800>;	/* musb instance 1 */
			interrupts = <17		/* usbss */
				      18		/* musb instance 0 */
				      19>;		/* musb instance 1 */
				ranges;
				#address-cells = <1>;
				#size-cells = <1>;
				reg = <0x47401000 0x200>;
				reg-names = "control";
				status = "disabled";

				musb0: usb@47401400 {
					compatible = "mg,musbmhdrc";
					reg = <0x47401400 0x400>;
					reg-names = "mc";
					interrupts = <18>;
					interrupt-names = "mc";
					multipoint = <1>;
					num-eps = <16>;
					ram-bits = <12>;
			port0-mode = <3>;
			port1-mode = <3>;
					port-mode = <3>;
					power = <250>;
			ti,hwmods = "usb_otg_hs";
					phys = <&usb0_phy>;
				};
			};

			usb1_phy: phy@47401b00 {
				compatible = "ti,am335x-usb-phy";
				reg = <0x47401b00 0x100>;
				reg-names = "phy";
				status = "disabled";
				ti,ctrl_mod = <&ctrl_mod>;
			};

			usb1: usb@47401800 {
				compatible = "ti,musb-am33xx";
				ranges;
				#address-cells = <1>;
				#size-cells = <1>;
				reg = <0x47401800 0x200>;
				reg-names = "control";
				status = "disabled";

				musb1: usb@47401c00 {
					compatible = "mg,musbmhdrc";
					reg = <0x47401c00 0x400>;
					reg-names = "mc";
					interrupts = <19>;
					interrupt-names = "mc";
					multipoint = <1>;
					num-eps = <16>;
					ram-bits = <12>;
					port-mode = <3>;
					power = <250>;
					phys = <&usb1_phy>;
				};
			};
		};

		epwmss0: epwmss@48300000 {
+4 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ config USB_MUSB_AM35X

config USB_MUSB_DSPS
	tristate "TI DSPS platforms"
	select USB_MUSB_AM335X_CHILD

config USB_MUSB_BLACKFIN
	tristate "Blackfin"
@@ -93,6 +94,9 @@ config USB_MUSB_UX500

endchoice

config USB_MUSB_AM335X_CHILD
	tristate

choice
	prompt 'MUSB DMA mode'
	default MUSB_PIO_ONLY if ARCH_MULTIPLATFORM
Loading