All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
@ 2013-12-13 19:22 ` Tony Lindgren
  0 siblings, 0 replies; 18+ messages in thread
From: Tony Lindgren @ 2013-12-13 19:22 UTC (permalink / raw)
  To: linux-arm-kernel, linux-omap; +Cc: devicetree, Igor Grinberg, Mike Rapoport

This adds support for CompuLab SBC-T3530, also known as cm-t3730:

http://compulab.co.il/products/sbcs/sbc-t3530/

It seems that with the sbc-3xxx mainboard is also used on
SBC-T3517 and SBC-T3730 with just a different CPU module:

http://compulab.co.il/products/sbcs/sbc-t3517/
http://compulab.co.il/products/sbcs/sbc-t3730/

So let's add a common omap3-sb-t35.dtsi and then separate SoC
specific omap3-sbc-t3730.dts, omap3-sbc-t3530.dts and
omap3-sbc-t3517.dts.

I've tested this with SBC-T3730 as that's the only one I have.
At least serial, both Ethernet controllers, MMC, and wl12xx WLAN
work.

Note that WLAN seems to be different for SBC-T3530. And SBC-T3517
may need some changes for the EMAC Ethernet if that's used
instead of the smsc911x.

Cc: devicetree@vger.kernel.org
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/boot/dts/Makefile            |   3 +
 arch/arm/boot/dts/omap3-sb-t35.dtsi   | 135 ++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/omap3-sbc-t3517.dts |  18 +++++
 arch/arm/boot/dts/omap3-sbc-t3530.dts |  18 +++++
 arch/arm/boot/dts/omap3-sbc-t3730.dts | 130 ++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/pdata-quirks.c    |   7 ++
 6 files changed, 311 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap3-sb-t35.dtsi
 create mode 100644 arch/arm/boot/dts/omap3-sbc-t3517.dts
 create mode 100644 arch/arm/boot/dts/omap3-sbc-t3530.dts
 create mode 100644 arch/arm/boot/dts/omap3-sbc-t3730.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index fc37bca..41370d2 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -179,6 +179,9 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
 	omap2420-n810-wimax.dtb \
 	omap3430-sdp.dtb \
 	omap3-beagle.dtb \
+	omap3-sbc-t3530.dtb \
+	omap3-sbc-t3730.dtb \
+	omap3-sbc-t3517.dtb \
 	omap3-devkit8000.dtb \
 	omap3-beagle-xm.dtb \
 	omap3-evm.dtb \
diff --git a/arch/arm/boot/dts/omap3-sb-t35.dtsi b/arch/arm/boot/dts/omap3-sb-t35.dtsi
new file mode 100644
index 0000000..fc676c5
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sb-t35.dtsi
@@ -0,0 +1,135 @@
+/*
+ * Common support for CompuLab SB-T35 used on SBC-T3530, SBC-T3517 and SBC-T3730
+ */
+
+/ {
+	aliases {
+		ethernet0 = &smsc1;
+		ethernet1 = &smsc2;
+	};
+
+	cpus {
+		cpu@0 {
+			cpu0-supply = <&vcc>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		ledb {
+			label = "cm-t35:green";
+			gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>;  /* gpio186 */
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	vddvario: regulator-vddvario {
+		compatible = "regulator-fixed";
+		regulator-name = "vddvario";
+		regulator-always-on;
+	};
+
+	vdd33a: regulator-vdd33a {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd33a";
+		regulator-always-on;
+	};
+};
+
+&gpmc {
+	ranges = <5 0 0x2c000000 0x01000000>,
+		 <4 0 0x2d000000 0x01000000>;
+
+	smsc1: ethernet@5,0 {
+		compatible = "smsc,lan9221", "smsc,lan9115";
+		interrupt-parent = <&gpio6>;
+		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+		reg = <5 0 0xff>;
+		bank-width = <2>;
+		gpmc,mux-add-data;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <186>;
+		gpmc,cs-wr-off-ns = <186>;
+		gpmc,adv-on-ns = <12>;
+		gpmc,adv-rd-off-ns = <48>;
+		gpmc,adv-wr-off-ns = <48>;
+		gpmc,oe-on-ns = <54>;
+		gpmc,oe-off-ns = <168>;
+		gpmc,we-on-ns = <54>;
+		gpmc,we-off-ns = <168>;
+		gpmc,rd-cycle-ns = <186>;
+		gpmc,wr-cycle-ns = <186>;
+		gpmc,access-ns = <114>;
+		gpmc,page-burst-access-ns = <6>;
+		gpmc,bus-turnaround-ns = <12>;
+		gpmc,cycle2cycle-delay-ns = <18>;
+		gpmc,wr-data-mux-bus-ns = <90>;
+		gpmc,wr-access-ns = <186>;
+		gpmc,cycle2cycle-samecsen;
+		gpmc,cycle2cycle-diffcsen;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
+
+	smsc2: ethernet@4,0 {
+		compatible = "smsc,lan9221", "smsc,lan9115";
+		interrupt-parent = <&gpio3>;
+		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
+		reg = <4 0 0xff>;
+		bank-width = <2>;
+		gpmc,mux-add-data;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <186>;
+		gpmc,cs-wr-off-ns = <186>;
+		gpmc,adv-on-ns = <12>;
+		gpmc,adv-rd-off-ns = <48>;
+		gpmc,adv-wr-off-ns = <48>;
+		gpmc,oe-on-ns = <54>;
+		gpmc,oe-off-ns = <168>;
+		gpmc,we-on-ns = <54>;
+		gpmc,we-off-ns = <168>;
+		gpmc,rd-cycle-ns = <186>;
+		gpmc,wr-cycle-ns = <186>;
+		gpmc,access-ns = <114>;
+		gpmc,page-burst-access-ns = <6>;
+		gpmc,bus-turnaround-ns = <12>;
+		gpmc,cycle2cycle-delay-ns = <18>;
+		gpmc,wr-data-mux-bus-ns = <90>;
+		gpmc,wr-access-ns = <186>;
+		gpmc,cycle2cycle-samecsen;
+		gpmc,cycle2cycle-diffcsen;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
+};
+
+&i2c1 {
+	clock-frequency = <2600000>;
+
+	twl: twl@48 {
+		reg = <0x48>;
+		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
+		interrupt-parent = <&intc>;
+	};
+};
+
+#include "twl4030.dtsi"
+#include "twl4030_omap3.dtsi"
+
+&i2c3 {
+	clock-frequency = <400000>;
+};
+
+&mmc1 {
+	vmmc-supply = <&vmmc1>;
+	vmmc_aux-supply = <&vsim>;
+	bus-width = <8>;
+};
+
+&twl_gpio {
+	ti,use-leds;
+};
diff --git a/arch/arm/boot/dts/omap3-sbc-t3517.dts b/arch/arm/boot/dts/omap3-sbc-t3517.dts
new file mode 100644
index 0000000..2df885b
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sbc-t3517.dts
@@ -0,0 +1,18 @@
+/*
+ * Suppport for CompuLab SBC-T3517 with CM-T3517
+ */
+/dts-v1/;
+
+#include "am3517.dtsi"
+#include "omap3-sb-t35.dtsi"
+
+
+/ {
+	model = "CompuLab SBC-T3517 with CM-T3517";
+	compatible = "compulab,omap3-sbc-t3517", "ti,am3517", "ti,omap3";
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x10000000>; /* 256 MB */
+	};
+};
diff --git a/arch/arm/boot/dts/omap3-sbc-t3530.dts b/arch/arm/boot/dts/omap3-sbc-t3530.dts
new file mode 100644
index 0000000..5156147
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sbc-t3530.dts
@@ -0,0 +1,18 @@
+/*
+ * Suppport for CompuLab SBC-T3530 with CM-T3530
+ */
+/dts-v1/;
+
+#include "omap34xx.dtsi"
+#include "omap3-sb-t35.dtsi"
+
+
+/ {
+	model = "CompuLab SBC-T3530 with CM-T3530";
+	compatible = "compulab,omap3-sbc-t3530", "ti,omap34xx", "ti,omap3";
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x10000000>; /* 256 MB */
+	};
+};
diff --git a/arch/arm/boot/dts/omap3-sbc-t3730.dts b/arch/arm/boot/dts/omap3-sbc-t3730.dts
new file mode 100644
index 0000000..836f742
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sbc-t3730.dts
@@ -0,0 +1,130 @@
+/*
+ * Suppport for CompuLab SBC-T3730 with CM-T3730
+ */
+/dts-v1/;
+
+#include "omap36xx.dtsi"
+#include "omap3-sb-t35.dtsi"
+
+
+/ {
+	model = "CompuLab SBC-T3730 with CM-T3730";
+	compatible = "compulab,omap3-sbc-t3730", "ti,omap36xx", "ti,omap3";
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x10000000>; /* 256 MB */
+	};
+
+	wl12xx_vmmc2: wl12xx_vmmc2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vw1271";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl12xx_gpio>;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		gpio = <&gpio3 9 GPIO_ACTIVE_HIGH>;   /* gpio73 */
+		startup-delay-us = <20000>;
+		enable-active-high;
+	};
+
+	wl12xx_vaux2: wl12xx_vaux2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vwl1271_vaux2";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		gpio = <&twl_gpio 2 GPIO_ACTIVE_HIGH>;
+		startup-delay-us = <70000>;
+		enable-active-high;
+		vin-supply = <&vaux2>;
+	};
+};
+
+&omap3_pmx_core {
+	mmc1_pins: pinmux_mmc1_pins {
+		pinctrl-single,pins = <
+			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
+			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
+			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
+			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
+			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
+			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
+			0x120 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat4.sdmmc1_dat4 */
+			0x122 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat5.sdmmc1_dat5 */
+			0x124 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat6.sdmmc1_dat6 */
+			0x126 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat7.sdmmc1_dat7 */
+		>;
+	};
+
+	mmc2_pins: pinmux_mmc2_pins {
+		pinctrl-single,pins = <
+			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
+			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
+			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
+			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
+			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
+			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
+			0x136 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat5.sdmmc2_dir_dat1 */
+			0x138 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat6.sdmmc2_dir_cmd */
+			0x13a (PIN_INPUT | MUX_MODE1)		/* sdmmc2_dat7.sdmmc2_clkin */
+		>;
+	};
+
+	smsc1_pins: pinmux_smsc1_pins {
+		pinctrl-single,pins = <
+			0x88 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs5.gpmc_ncs5 */
+			0x16a (PIN_INPUT_PULLUP | MUX_MODE4)	/* uart3_cts_rctx.gpio_163 */
+		>;
+	};
+
+	smsc2_pins: pinmux_smsc2_pins {
+		pinctrl-single,pins = <
+			0x86 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs4.gpmc_ncs4 */
+			0xa2 (PIN_INPUT_PULLUP | MUX_MODE4)	/* gpmc_wait3.gpio_65 */
+		>;
+	};
+
+	uart3_pins: pinmux_uart3_pins {
+		pinctrl-single,pins = <
+			0x16e (PIN_INPUT | MUX_MODE0)		/* uart3_rx_irrx.uart3_rx_irrx */
+			0x170 (PIN_OUTPUT | MUX_MODE0)		/* uart3_tx_irtx.uart3_tx_irtx */
+		>;
+	};
+
+	wl12xx_gpio: pinmux_wl12xx_gpio {
+		pinctrl-single,pins = <
+			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
+			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
+		>;
+	};
+};
+
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+};
+
+&mmc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_pins>;
+	vmmc-supply = <&wl12xx_vmmc2>;
+	vmmc_aux-supply = <&wl12xx_vaux2>;
+	non-removable;
+	bus-width = <4>;
+	cap-power-off-card;
+};
+
+&smsc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&smsc1_pins>;
+};
+
+&smsc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&smsc2_pins>;
+};
+
+&uart3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart3_pins>;
+};
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 78c6233..1a1bfc0 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -93,6 +93,12 @@ static void __init hsmmc2_internal_input_clk(void)
 	omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
 }
 
+static void __init omap3_sbc_t3730_legacy_init(void)
+{
+	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
+	omap_ads7846_init(1, 57, 0, NULL);
+}
+
 static void __init omap3_igep0020_legacy_init(void)
 {
 	omap3_igep2_display_init_of();
@@ -229,6 +235,7 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
  */
 static struct pdata_init pdata_quirks[] __initdata = {
 #ifdef CONFIG_ARCH_OMAP3
+	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
 	{ "nokia,omap3-n900", hsmmc2_internal_input_clk, },
 	{ "nokia,omap3-n9", hsmmc2_internal_input_clk, },
 	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },
-- 
1.8.1.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
@ 2013-12-13 19:22 ` Tony Lindgren
  0 siblings, 0 replies; 18+ messages in thread
From: Tony Lindgren @ 2013-12-13 19:22 UTC (permalink / raw)
  To: linux-arm-kernel

This adds support for CompuLab SBC-T3530, also known as cm-t3730:

http://compulab.co.il/products/sbcs/sbc-t3530/

It seems that with the sbc-3xxx mainboard is also used on
SBC-T3517 and SBC-T3730 with just a different CPU module:

http://compulab.co.il/products/sbcs/sbc-t3517/
http://compulab.co.il/products/sbcs/sbc-t3730/

So let's add a common omap3-sb-t35.dtsi and then separate SoC
specific omap3-sbc-t3730.dts, omap3-sbc-t3530.dts and
omap3-sbc-t3517.dts.

I've tested this with SBC-T3730 as that's the only one I have.
At least serial, both Ethernet controllers, MMC, and wl12xx WLAN
work.

Note that WLAN seems to be different for SBC-T3530. And SBC-T3517
may need some changes for the EMAC Ethernet if that's used
instead of the smsc911x.

Cc: devicetree at vger.kernel.org
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/boot/dts/Makefile            |   3 +
 arch/arm/boot/dts/omap3-sb-t35.dtsi   | 135 ++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/omap3-sbc-t3517.dts |  18 +++++
 arch/arm/boot/dts/omap3-sbc-t3530.dts |  18 +++++
 arch/arm/boot/dts/omap3-sbc-t3730.dts | 130 ++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/pdata-quirks.c    |   7 ++
 6 files changed, 311 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap3-sb-t35.dtsi
 create mode 100644 arch/arm/boot/dts/omap3-sbc-t3517.dts
 create mode 100644 arch/arm/boot/dts/omap3-sbc-t3530.dts
 create mode 100644 arch/arm/boot/dts/omap3-sbc-t3730.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index fc37bca..41370d2 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -179,6 +179,9 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
 	omap2420-n810-wimax.dtb \
 	omap3430-sdp.dtb \
 	omap3-beagle.dtb \
+	omap3-sbc-t3530.dtb \
+	omap3-sbc-t3730.dtb \
+	omap3-sbc-t3517.dtb \
 	omap3-devkit8000.dtb \
 	omap3-beagle-xm.dtb \
 	omap3-evm.dtb \
diff --git a/arch/arm/boot/dts/omap3-sb-t35.dtsi b/arch/arm/boot/dts/omap3-sb-t35.dtsi
new file mode 100644
index 0000000..fc676c5
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sb-t35.dtsi
@@ -0,0 +1,135 @@
+/*
+ * Common support for CompuLab SB-T35 used on SBC-T3530, SBC-T3517 and SBC-T3730
+ */
+
+/ {
+	aliases {
+		ethernet0 = &smsc1;
+		ethernet1 = &smsc2;
+	};
+
+	cpus {
+		cpu at 0 {
+			cpu0-supply = <&vcc>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		ledb {
+			label = "cm-t35:green";
+			gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>;  /* gpio186 */
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	vddvario: regulator-vddvario {
+		compatible = "regulator-fixed";
+		regulator-name = "vddvario";
+		regulator-always-on;
+	};
+
+	vdd33a: regulator-vdd33a {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd33a";
+		regulator-always-on;
+	};
+};
+
+&gpmc {
+	ranges = <5 0 0x2c000000 0x01000000>,
+		 <4 0 0x2d000000 0x01000000>;
+
+	smsc1: ethernet at 5,0 {
+		compatible = "smsc,lan9221", "smsc,lan9115";
+		interrupt-parent = <&gpio6>;
+		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+		reg = <5 0 0xff>;
+		bank-width = <2>;
+		gpmc,mux-add-data;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <186>;
+		gpmc,cs-wr-off-ns = <186>;
+		gpmc,adv-on-ns = <12>;
+		gpmc,adv-rd-off-ns = <48>;
+		gpmc,adv-wr-off-ns = <48>;
+		gpmc,oe-on-ns = <54>;
+		gpmc,oe-off-ns = <168>;
+		gpmc,we-on-ns = <54>;
+		gpmc,we-off-ns = <168>;
+		gpmc,rd-cycle-ns = <186>;
+		gpmc,wr-cycle-ns = <186>;
+		gpmc,access-ns = <114>;
+		gpmc,page-burst-access-ns = <6>;
+		gpmc,bus-turnaround-ns = <12>;
+		gpmc,cycle2cycle-delay-ns = <18>;
+		gpmc,wr-data-mux-bus-ns = <90>;
+		gpmc,wr-access-ns = <186>;
+		gpmc,cycle2cycle-samecsen;
+		gpmc,cycle2cycle-diffcsen;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
+
+	smsc2: ethernet at 4,0 {
+		compatible = "smsc,lan9221", "smsc,lan9115";
+		interrupt-parent = <&gpio3>;
+		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
+		reg = <4 0 0xff>;
+		bank-width = <2>;
+		gpmc,mux-add-data;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <186>;
+		gpmc,cs-wr-off-ns = <186>;
+		gpmc,adv-on-ns = <12>;
+		gpmc,adv-rd-off-ns = <48>;
+		gpmc,adv-wr-off-ns = <48>;
+		gpmc,oe-on-ns = <54>;
+		gpmc,oe-off-ns = <168>;
+		gpmc,we-on-ns = <54>;
+		gpmc,we-off-ns = <168>;
+		gpmc,rd-cycle-ns = <186>;
+		gpmc,wr-cycle-ns = <186>;
+		gpmc,access-ns = <114>;
+		gpmc,page-burst-access-ns = <6>;
+		gpmc,bus-turnaround-ns = <12>;
+		gpmc,cycle2cycle-delay-ns = <18>;
+		gpmc,wr-data-mux-bus-ns = <90>;
+		gpmc,wr-access-ns = <186>;
+		gpmc,cycle2cycle-samecsen;
+		gpmc,cycle2cycle-diffcsen;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
+};
+
+&i2c1 {
+	clock-frequency = <2600000>;
+
+	twl: twl at 48 {
+		reg = <0x48>;
+		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
+		interrupt-parent = <&intc>;
+	};
+};
+
+#include "twl4030.dtsi"
+#include "twl4030_omap3.dtsi"
+
+&i2c3 {
+	clock-frequency = <400000>;
+};
+
+&mmc1 {
+	vmmc-supply = <&vmmc1>;
+	vmmc_aux-supply = <&vsim>;
+	bus-width = <8>;
+};
+
+&twl_gpio {
+	ti,use-leds;
+};
diff --git a/arch/arm/boot/dts/omap3-sbc-t3517.dts b/arch/arm/boot/dts/omap3-sbc-t3517.dts
new file mode 100644
index 0000000..2df885b
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sbc-t3517.dts
@@ -0,0 +1,18 @@
+/*
+ * Suppport for CompuLab SBC-T3517 with CM-T3517
+ */
+/dts-v1/;
+
+#include "am3517.dtsi"
+#include "omap3-sb-t35.dtsi"
+
+
+/ {
+	model = "CompuLab SBC-T3517 with CM-T3517";
+	compatible = "compulab,omap3-sbc-t3517", "ti,am3517", "ti,omap3";
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x10000000>; /* 256 MB */
+	};
+};
diff --git a/arch/arm/boot/dts/omap3-sbc-t3530.dts b/arch/arm/boot/dts/omap3-sbc-t3530.dts
new file mode 100644
index 0000000..5156147
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sbc-t3530.dts
@@ -0,0 +1,18 @@
+/*
+ * Suppport for CompuLab SBC-T3530 with CM-T3530
+ */
+/dts-v1/;
+
+#include "omap34xx.dtsi"
+#include "omap3-sb-t35.dtsi"
+
+
+/ {
+	model = "CompuLab SBC-T3530 with CM-T3530";
+	compatible = "compulab,omap3-sbc-t3530", "ti,omap34xx", "ti,omap3";
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x10000000>; /* 256 MB */
+	};
+};
diff --git a/arch/arm/boot/dts/omap3-sbc-t3730.dts b/arch/arm/boot/dts/omap3-sbc-t3730.dts
new file mode 100644
index 0000000..836f742
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sbc-t3730.dts
@@ -0,0 +1,130 @@
+/*
+ * Suppport for CompuLab SBC-T3730 with CM-T3730
+ */
+/dts-v1/;
+
+#include "omap36xx.dtsi"
+#include "omap3-sb-t35.dtsi"
+
+
+/ {
+	model = "CompuLab SBC-T3730 with CM-T3730";
+	compatible = "compulab,omap3-sbc-t3730", "ti,omap36xx", "ti,omap3";
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x10000000>; /* 256 MB */
+	};
+
+	wl12xx_vmmc2: wl12xx_vmmc2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vw1271";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl12xx_gpio>;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		gpio = <&gpio3 9 GPIO_ACTIVE_HIGH>;   /* gpio73 */
+		startup-delay-us = <20000>;
+		enable-active-high;
+	};
+
+	wl12xx_vaux2: wl12xx_vaux2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vwl1271_vaux2";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		gpio = <&twl_gpio 2 GPIO_ACTIVE_HIGH>;
+		startup-delay-us = <70000>;
+		enable-active-high;
+		vin-supply = <&vaux2>;
+	};
+};
+
+&omap3_pmx_core {
+	mmc1_pins: pinmux_mmc1_pins {
+		pinctrl-single,pins = <
+			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
+			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
+			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
+			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
+			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
+			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
+			0x120 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat4.sdmmc1_dat4 */
+			0x122 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat5.sdmmc1_dat5 */
+			0x124 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat6.sdmmc1_dat6 */
+			0x126 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat7.sdmmc1_dat7 */
+		>;
+	};
+
+	mmc2_pins: pinmux_mmc2_pins {
+		pinctrl-single,pins = <
+			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
+			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
+			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
+			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
+			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
+			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
+			0x136 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat5.sdmmc2_dir_dat1 */
+			0x138 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat6.sdmmc2_dir_cmd */
+			0x13a (PIN_INPUT | MUX_MODE1)		/* sdmmc2_dat7.sdmmc2_clkin */
+		>;
+	};
+
+	smsc1_pins: pinmux_smsc1_pins {
+		pinctrl-single,pins = <
+			0x88 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs5.gpmc_ncs5 */
+			0x16a (PIN_INPUT_PULLUP | MUX_MODE4)	/* uart3_cts_rctx.gpio_163 */
+		>;
+	};
+
+	smsc2_pins: pinmux_smsc2_pins {
+		pinctrl-single,pins = <
+			0x86 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs4.gpmc_ncs4 */
+			0xa2 (PIN_INPUT_PULLUP | MUX_MODE4)	/* gpmc_wait3.gpio_65 */
+		>;
+	};
+
+	uart3_pins: pinmux_uart3_pins {
+		pinctrl-single,pins = <
+			0x16e (PIN_INPUT | MUX_MODE0)		/* uart3_rx_irrx.uart3_rx_irrx */
+			0x170 (PIN_OUTPUT | MUX_MODE0)		/* uart3_tx_irtx.uart3_tx_irtx */
+		>;
+	};
+
+	wl12xx_gpio: pinmux_wl12xx_gpio {
+		pinctrl-single,pins = <
+			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
+			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
+		>;
+	};
+};
+
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+};
+
+&mmc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_pins>;
+	vmmc-supply = <&wl12xx_vmmc2>;
+	vmmc_aux-supply = <&wl12xx_vaux2>;
+	non-removable;
+	bus-width = <4>;
+	cap-power-off-card;
+};
+
+&smsc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&smsc1_pins>;
+};
+
+&smsc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&smsc2_pins>;
+};
+
+&uart3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart3_pins>;
+};
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 78c6233..1a1bfc0 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -93,6 +93,12 @@ static void __init hsmmc2_internal_input_clk(void)
 	omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
 }
 
+static void __init omap3_sbc_t3730_legacy_init(void)
+{
+	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
+	omap_ads7846_init(1, 57, 0, NULL);
+}
+
 static void __init omap3_igep0020_legacy_init(void)
 {
 	omap3_igep2_display_init_of();
@@ -229,6 +235,7 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
  */
 static struct pdata_init pdata_quirks[] __initdata = {
 #ifdef CONFIG_ARCH_OMAP3
+	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
 	{ "nokia,omap3-n900", hsmmc2_internal_input_clk, },
 	{ "nokia,omap3-n9", hsmmc2_internal_input_clk, },
 	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },
-- 
1.8.1.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
  2013-12-13 19:22 ` Tony Lindgren
@ 2013-12-16 13:55   ` Igor Grinberg
  -1 siblings, 0 replies; 18+ messages in thread
From: Igor Grinberg @ 2013-12-16 13:55 UTC (permalink / raw)
  To: Tony Lindgren, linux-arm-kernel, linux-omap; +Cc: devicetree, Dmitry Lifshitz

Hi Tony,

On 12/13/13 21:22, Tony Lindgren wrote:
> This adds support for CompuLab SBC-T3530, also known as cm-t3730:
> 
> http://compulab.co.il/products/sbcs/sbc-t3530/
> 
> It seems that with the sbc-3xxx mainboard is also used on
> SBC-T3517 and SBC-T3730 with just a different CPU module:
> 
> http://compulab.co.il/products/sbcs/sbc-t3517/
> http://compulab.co.il/products/sbcs/sbc-t3730/
> 
> So let's add a common omap3-sb-t35.dtsi and then separate SoC
> specific omap3-sbc-t3730.dts, omap3-sbc-t3530.dts and
> omap3-sbc-t3517.dts.
> 
> I've tested this with SBC-T3730 as that's the only one I have.
> At least serial, both Ethernet controllers, MMC, and wl12xx WLAN
> work.
> 
> Note that WLAN seems to be different for SBC-T3530.

Yes, it is Marvell 8686 chipset using the libertas driver.

> And SBC-T3517
> may need some changes for the EMAC Ethernet if that's used
> instead of the smsc911x.
> 
> Cc: devicetree@vger.kernel.org
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Cc: Mike Rapoport <mike@compulab.co.il>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Great job!
I'm sorry I couldn't make it in time with the conversion... :-(

> ---
>  arch/arm/boot/dts/Makefile            |   3 +
>  arch/arm/boot/dts/omap3-sb-t35.dtsi   | 135 ++++++++++++++++++++++++++++++++++
>  arch/arm/boot/dts/omap3-sbc-t3517.dts |  18 +++++
>  arch/arm/boot/dts/omap3-sbc-t3530.dts |  18 +++++
>  arch/arm/boot/dts/omap3-sbc-t3730.dts | 130 ++++++++++++++++++++++++++++++++
>  arch/arm/mach-omap2/pdata-quirks.c    |   7 ++
>  6 files changed, 311 insertions(+)
>  create mode 100644 arch/arm/boot/dts/omap3-sb-t35.dtsi
>  create mode 100644 arch/arm/boot/dts/omap3-sbc-t3517.dts
>  create mode 100644 arch/arm/boot/dts/omap3-sbc-t3530.dts
>  create mode 100644 arch/arm/boot/dts/omap3-sbc-t3730.dts
> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index fc37bca..41370d2 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -179,6 +179,9 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
>  	omap2420-n810-wimax.dtb \
>  	omap3430-sdp.dtb \
>  	omap3-beagle.dtb \
> +	omap3-sbc-t3530.dtb \
> +	omap3-sbc-t3730.dtb \
> +	omap3-sbc-t3517.dtb \
>  	omap3-devkit8000.dtb \
>  	omap3-beagle-xm.dtb \
>  	omap3-evm.dtb \
> diff --git a/arch/arm/boot/dts/omap3-sb-t35.dtsi b/arch/arm/boot/dts/omap3-sb-t35.dtsi
> new file mode 100644
> index 0000000..fc676c5
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap3-sb-t35.dtsi
> @@ -0,0 +1,135 @@
> +/*
> + * Common support for CompuLab SB-T35 used on SBC-T3530, SBC-T3517 and SBC-T3730
> + */
> +
> +/ {
> +	aliases {
> +		ethernet0 = &smsc1;
> +		ethernet1 = &smsc2;
> +	};

SB-T35 has only one SMSC Ethernet on-board (smsc2),
while the first one is on the cm-t3530 and cm-t3730 modules.
SBC-T3517 has only one _SMSC_ Ethernet and it is on the SB-T35 base board.
cm-t3517 has EMAC Ethernet on-board instead of the SMSC.

There is also another base board - CB-T3, which turns into
EM-T3530 and EM-T3730 once you plug the cm-t3530 or cm-t3730 into CB-T3.

http://compulab.co.il/products/handheld-computers/em-t3730/
http://compulab.co.il/products/handheld-computers/em-t3530/

The CB-T3 base board does not have any Ethernet controllers on it,
so the EM-T3x systems have only one Ethernet controller - the one on the
CPU board - SMSC.

This makes it four boards:
sb-t35 - base board has only one Ethernet controller (SMSC)
cb-t3 - base board has no Ethernet controllers
cm-t3530 - CPU board (plugged into sb-t35) has only one Ethernet controller (SMSC)
cm-t3730 - CPU board (plugged into sb-t35) has only one Ethernet controller (SMSC)
cm-t3537 - CPU board (plugged into sb-t35) has only one Ethernet controller (EMAC)

The SBC-Txxx and EM-Txxx- means both boards connected (base board with CPU board).

> +
> +	cpus {
> +		cpu@0 {
> +			cpu0-supply = <&vcc>;
> +		};
> +	};
> +
> +	leds {
> +		compatible = "gpio-leds";
> +		ledb {
> +			label = "cm-t35:green";
> +			gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>;  /* gpio186 */
> +			linux,default-trigger = "heartbeat";

Although all CPU boards have the same GPIO routed to the heartbeat LED,
this property is related to the CPU board and not to the base (mother) board.
The same GPIO is used intensionally for s/w simplicity.
If we are about to save code duplication, I'd like to have a common
to CPU boards file, say omap3-cm-t3x.dtsi - that way it will better reflect
the actual hardware.

> +		};
> +	};
> +
> +	vddvario: regulator-vddvario {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vddvario";
> +		regulator-always-on;
> +	};
> +
> +	vdd33a: regulator-vdd33a {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vdd33a";
> +		regulator-always-on;
> +	};
> +};
> +
> +&gpmc {
> +	ranges = <5 0 0x2c000000 0x01000000>,
> +		 <4 0 0x2d000000 0x01000000>;
> +
> +	smsc1: ethernet@5,0 {
> +		compatible = "smsc,lan9221", "smsc,lan9115";
> +		interrupt-parent = <&gpio6>;
> +		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
> +		reg = <5 0 0xff>;
> +		bank-width = <2>;
> +		gpmc,mux-add-data;
> +		gpmc,cs-on-ns = <0>;
> +		gpmc,cs-rd-off-ns = <186>;
> +		gpmc,cs-wr-off-ns = <186>;
> +		gpmc,adv-on-ns = <12>;
> +		gpmc,adv-rd-off-ns = <48>;
> +		gpmc,adv-wr-off-ns = <48>;
> +		gpmc,oe-on-ns = <54>;
> +		gpmc,oe-off-ns = <168>;
> +		gpmc,we-on-ns = <54>;
> +		gpmc,we-off-ns = <168>;
> +		gpmc,rd-cycle-ns = <186>;
> +		gpmc,wr-cycle-ns = <186>;
> +		gpmc,access-ns = <114>;
> +		gpmc,page-burst-access-ns = <6>;
> +		gpmc,bus-turnaround-ns = <12>;
> +		gpmc,cycle2cycle-delay-ns = <18>;
> +		gpmc,wr-data-mux-bus-ns = <90>;
> +		gpmc,wr-access-ns = <186>;
> +		gpmc,cycle2cycle-samecsen;
> +		gpmc,cycle2cycle-diffcsen;
> +		vddvario-supply = <&vddvario>;
> +		vdd33a-supply = <&vdd33a>;
> +		reg-io-width = <4>;
> +		smsc,save-mac-address;
> +	};

This one also should be a part of CPU board file or the common file.

> +
> +	smsc2: ethernet@4,0 {
> +		compatible = "smsc,lan9221", "smsc,lan9115";
> +		interrupt-parent = <&gpio3>;
> +		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
> +		reg = <4 0 0xff>;
> +		bank-width = <2>;
> +		gpmc,mux-add-data;
> +		gpmc,cs-on-ns = <0>;
> +		gpmc,cs-rd-off-ns = <186>;
> +		gpmc,cs-wr-off-ns = <186>;
> +		gpmc,adv-on-ns = <12>;
> +		gpmc,adv-rd-off-ns = <48>;
> +		gpmc,adv-wr-off-ns = <48>;
> +		gpmc,oe-on-ns = <54>;
> +		gpmc,oe-off-ns = <168>;
> +		gpmc,we-on-ns = <54>;
> +		gpmc,we-off-ns = <168>;
> +		gpmc,rd-cycle-ns = <186>;
> +		gpmc,wr-cycle-ns = <186>;
> +		gpmc,access-ns = <114>;
> +		gpmc,page-burst-access-ns = <6>;
> +		gpmc,bus-turnaround-ns = <12>;
> +		gpmc,cycle2cycle-delay-ns = <18>;
> +		gpmc,wr-data-mux-bus-ns = <90>;
> +		gpmc,wr-access-ns = <186>;
> +		gpmc,cycle2cycle-samecsen;
> +		gpmc,cycle2cycle-diffcsen;
> +		vddvario-supply = <&vddvario>;
> +		vdd33a-supply = <&vdd33a>;
> +		reg-io-width = <4>;
> +		smsc,save-mac-address;
> +	};
> +};
> +
> +&i2c1 {
> +	clock-frequency = <2600000>;
> +
> +	twl: twl@48 {
> +		reg = <0x48>;
> +		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
> +		interrupt-parent = <&intc>;
> +	};
> +};

This one should be a part of the common file.

> +
> +#include "twl4030.dtsi"
> +#include "twl4030_omap3.dtsi"
> +
> +&i2c3 {
> +	clock-frequency = <400000>;
> +};
> +
> +&mmc1 {
> +	vmmc-supply = <&vmmc1>;
> +	vmmc_aux-supply = <&vsim>;

Is it essential to always provide vmmc_aux-supply property?
In fact, the TPS65930 does not have the VSIM supply...
It is a mistake in the upstream board file.
I fixed this locally a while ago, but haven't submitted upstream...
So we should either leave this property unpopulated (if we can...) or
provide a fixed regulator to populate it.

> +	bus-width = <8>;

I'm not sure what this property should reflect.
Both cm-t3530 and cm-t3730 use 4 bit MMC1 bus.

> +};
> +
> +&twl_gpio {
> +	ti,use-leds;
> +};
> diff --git a/arch/arm/boot/dts/omap3-sbc-t3517.dts b/arch/arm/boot/dts/omap3-sbc-t3517.dts
> new file mode 100644
> index 0000000..2df885b
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap3-sbc-t3517.dts
> @@ -0,0 +1,18 @@
> +/*
> + * Suppport for CompuLab SBC-T3517 with CM-T3517
> + */
> +/dts-v1/;
> +
> +#include "am3517.dtsi"
> +#include "omap3-sb-t35.dtsi"
> +
> +
> +/ {
> +	model = "CompuLab SBC-T3517 with CM-T3517";
> +	compatible = "compulab,omap3-sbc-t3517", "ti,am3517", "ti,omap3";
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x80000000 0x10000000>; /* 256 MB */

Can we support multiple memory sizes through static DT, or
the only way is to update this property in the bootloader?

> +	};
> +};
> diff --git a/arch/arm/boot/dts/omap3-sbc-t3530.dts b/arch/arm/boot/dts/omap3-sbc-t3530.dts
> new file mode 100644
> index 0000000..5156147
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap3-sbc-t3530.dts
> @@ -0,0 +1,18 @@
> +/*
> + * Suppport for CompuLab SBC-T3530 with CM-T3530
> + */
> +/dts-v1/;
> +
> +#include "omap34xx.dtsi"
> +#include "omap3-sb-t35.dtsi"
> +
> +
> +/ {
> +	model = "CompuLab SBC-T3530 with CM-T3530";
> +	compatible = "compulab,omap3-sbc-t3530", "ti,omap34xx", "ti,omap3";
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x80000000 0x10000000>; /* 256 MB */
> +	};
> +};
> diff --git a/arch/arm/boot/dts/omap3-sbc-t3730.dts b/arch/arm/boot/dts/omap3-sbc-t3730.dts
> new file mode 100644
> index 0000000..836f742
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap3-sbc-t3730.dts
> @@ -0,0 +1,130 @@
> +/*
> + * Suppport for CompuLab SBC-T3730 with CM-T3730
> + */
> +/dts-v1/;
> +
> +#include "omap36xx.dtsi"
> +#include "omap3-sb-t35.dtsi"
> +
> +
> +/ {
> +	model = "CompuLab SBC-T3730 with CM-T3730";
> +	compatible = "compulab,omap3-sbc-t3730", "ti,omap36xx", "ti,omap3";
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x80000000 0x10000000>; /* 256 MB */
> +	};
> +
> +	wl12xx_vmmc2: wl12xx_vmmc2 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vw1271";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&wl12xx_gpio>;
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +		gpio = <&gpio3 9 GPIO_ACTIVE_HIGH>;   /* gpio73 */
> +		startup-delay-us = <20000>;
> +		enable-active-high;
> +	};
> +
> +	wl12xx_vaux2: wl12xx_vaux2 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vwl1271_vaux2";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +		gpio = <&twl_gpio 2 GPIO_ACTIVE_HIGH>;
> +		startup-delay-us = <70000>;
> +		enable-active-high;
> +		vin-supply = <&vaux2>;
> +	};
> +};
> +
> +&omap3_pmx_core {
> +	mmc1_pins: pinmux_mmc1_pins {
> +		pinctrl-single,pins = <
> +			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
> +			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
> +			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
> +			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
> +			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
> +			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
> +			0x120 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat4.sdmmc1_dat4 */
> +			0x122 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat5.sdmmc1_dat5 */
> +			0x124 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat6.sdmmc1_dat6 */
> +			0x126 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat7.sdmmc1_dat7 */

The dat{4,5,6,7} pins are not used either on cm-t3530, or cm-t3730.

> +		>;
> +	};
> +
> +	mmc2_pins: pinmux_mmc2_pins {
> +		pinctrl-single,pins = <
> +			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
> +			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
> +			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
> +			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
> +			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
> +			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */

Here the following is missing:
0x134 (PIN_OUTPUT | MUX_MODE1)	/* sdmmc2_dat4.sdmmc2_dir_dat0 */

> +			0x136 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat5.sdmmc2_dir_dat1 */
> +			0x138 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat6.sdmmc2_dir_cmd */
> +			0x13a (PIN_INPUT | MUX_MODE1)		/* sdmmc2_dat7.sdmmc2_clkin */

All four above pins (dat{4,5,6,7}) should be muxed only on cm-t3530.
cm-t3730 uses the sdmmc2_dat4 (gpio136) for wl12xx irq,
and does nor use the rest (dat{5,6,7}) at all.

> +		>;
> +	};
> +
> +	smsc1_pins: pinmux_smsc1_pins {
> +		pinctrl-single,pins = <
> +			0x88 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs5.gpmc_ncs5 */
> +			0x16a (PIN_INPUT_PULLUP | MUX_MODE4)	/* uart3_cts_rctx.gpio_163 */
> +		>;
> +	};
> +
> +	smsc2_pins: pinmux_smsc2_pins {
> +		pinctrl-single,pins = <
> +			0x86 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs4.gpmc_ncs4 */
> +			0xa2 (PIN_INPUT_PULLUP | MUX_MODE4)	/* gpmc_wait3.gpio_65 */
> +		>;
> +	};
> +
> +	uart3_pins: pinmux_uart3_pins {
> +		pinctrl-single,pins = <
> +			0x16e (PIN_INPUT | MUX_MODE0)		/* uart3_rx_irrx.uart3_rx_irrx */
> +			0x170 (PIN_OUTPUT | MUX_MODE0)		/* uart3_tx_irtx.uart3_tx_irtx */
> +		>;
> +	};
> +
> +	wl12xx_gpio: pinmux_wl12xx_gpio {
> +		pinctrl-single,pins = <
> +			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
> +			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
> +		>;
> +	};
> +};
> +
> +&mmc1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc1_pins>;
> +};
> +
> +&mmc2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc2_pins>;
> +	vmmc-supply = <&wl12xx_vmmc2>;
> +	vmmc_aux-supply = <&wl12xx_vaux2>;
> +	non-removable;
> +	bus-width = <4>;
> +	cap-power-off-card;
> +};
> +
> +&smsc1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&smsc1_pins>;
> +};
> +
> +&smsc2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&smsc2_pins>;
> +};
> +
> +&uart3 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&uart3_pins>;
> +};
> diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
> index 78c6233..1a1bfc0 100644
> --- a/arch/arm/mach-omap2/pdata-quirks.c
> +++ b/arch/arm/mach-omap2/pdata-quirks.c
> @@ -93,6 +93,12 @@ static void __init hsmmc2_internal_input_clk(void)
>  	omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
>  }
>  
> +static void __init omap3_sbc_t3730_legacy_init(void)
> +{
> +	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
> +	omap_ads7846_init(1, 57, 0, NULL);
> +}
> +
>  static void __init omap3_igep0020_legacy_init(void)
>  {
>  	omap3_igep2_display_init_of();
> @@ -229,6 +235,7 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
>   */
>  static struct pdata_init pdata_quirks[] __initdata = {
>  #ifdef CONFIG_ARCH_OMAP3
> +	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
>  	{ "nokia,omap3-n900", hsmmc2_internal_input_clk, },
>  	{ "nokia,omap3-n9", hsmmc2_internal_input_clk, },
>  	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },
> 

-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
@ 2013-12-16 13:55   ` Igor Grinberg
  0 siblings, 0 replies; 18+ messages in thread
From: Igor Grinberg @ 2013-12-16 13:55 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Tony,

On 12/13/13 21:22, Tony Lindgren wrote:
> This adds support for CompuLab SBC-T3530, also known as cm-t3730:
> 
> http://compulab.co.il/products/sbcs/sbc-t3530/
> 
> It seems that with the sbc-3xxx mainboard is also used on
> SBC-T3517 and SBC-T3730 with just a different CPU module:
> 
> http://compulab.co.il/products/sbcs/sbc-t3517/
> http://compulab.co.il/products/sbcs/sbc-t3730/
> 
> So let's add a common omap3-sb-t35.dtsi and then separate SoC
> specific omap3-sbc-t3730.dts, omap3-sbc-t3530.dts and
> omap3-sbc-t3517.dts.
> 
> I've tested this with SBC-T3730 as that's the only one I have.
> At least serial, both Ethernet controllers, MMC, and wl12xx WLAN
> work.
> 
> Note that WLAN seems to be different for SBC-T3530.

Yes, it is Marvell 8686 chipset using the libertas driver.

> And SBC-T3517
> may need some changes for the EMAC Ethernet if that's used
> instead of the smsc911x.
> 
> Cc: devicetree at vger.kernel.org
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Cc: Mike Rapoport <mike@compulab.co.il>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Great job!
I'm sorry I couldn't make it in time with the conversion... :-(

> ---
>  arch/arm/boot/dts/Makefile            |   3 +
>  arch/arm/boot/dts/omap3-sb-t35.dtsi   | 135 ++++++++++++++++++++++++++++++++++
>  arch/arm/boot/dts/omap3-sbc-t3517.dts |  18 +++++
>  arch/arm/boot/dts/omap3-sbc-t3530.dts |  18 +++++
>  arch/arm/boot/dts/omap3-sbc-t3730.dts | 130 ++++++++++++++++++++++++++++++++
>  arch/arm/mach-omap2/pdata-quirks.c    |   7 ++
>  6 files changed, 311 insertions(+)
>  create mode 100644 arch/arm/boot/dts/omap3-sb-t35.dtsi
>  create mode 100644 arch/arm/boot/dts/omap3-sbc-t3517.dts
>  create mode 100644 arch/arm/boot/dts/omap3-sbc-t3530.dts
>  create mode 100644 arch/arm/boot/dts/omap3-sbc-t3730.dts
> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index fc37bca..41370d2 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -179,6 +179,9 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
>  	omap2420-n810-wimax.dtb \
>  	omap3430-sdp.dtb \
>  	omap3-beagle.dtb \
> +	omap3-sbc-t3530.dtb \
> +	omap3-sbc-t3730.dtb \
> +	omap3-sbc-t3517.dtb \
>  	omap3-devkit8000.dtb \
>  	omap3-beagle-xm.dtb \
>  	omap3-evm.dtb \
> diff --git a/arch/arm/boot/dts/omap3-sb-t35.dtsi b/arch/arm/boot/dts/omap3-sb-t35.dtsi
> new file mode 100644
> index 0000000..fc676c5
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap3-sb-t35.dtsi
> @@ -0,0 +1,135 @@
> +/*
> + * Common support for CompuLab SB-T35 used on SBC-T3530, SBC-T3517 and SBC-T3730
> + */
> +
> +/ {
> +	aliases {
> +		ethernet0 = &smsc1;
> +		ethernet1 = &smsc2;
> +	};

SB-T35 has only one SMSC Ethernet on-board (smsc2),
while the first one is on the cm-t3530 and cm-t3730 modules.
SBC-T3517 has only one _SMSC_ Ethernet and it is on the SB-T35 base board.
cm-t3517 has EMAC Ethernet on-board instead of the SMSC.

There is also another base board - CB-T3, which turns into
EM-T3530 and EM-T3730 once you plug the cm-t3530 or cm-t3730 into CB-T3.

http://compulab.co.il/products/handheld-computers/em-t3730/
http://compulab.co.il/products/handheld-computers/em-t3530/

The CB-T3 base board does not have any Ethernet controllers on it,
so the EM-T3x systems have only one Ethernet controller - the one on the
CPU board - SMSC.

This makes it four boards:
sb-t35 - base board has only one Ethernet controller (SMSC)
cb-t3 - base board has no Ethernet controllers
cm-t3530 - CPU board (plugged into sb-t35) has only one Ethernet controller (SMSC)
cm-t3730 - CPU board (plugged into sb-t35) has only one Ethernet controller (SMSC)
cm-t3537 - CPU board (plugged into sb-t35) has only one Ethernet controller (EMAC)

The SBC-Txxx and EM-Txxx- means both boards connected (base board with CPU board).

> +
> +	cpus {
> +		cpu at 0 {
> +			cpu0-supply = <&vcc>;
> +		};
> +	};
> +
> +	leds {
> +		compatible = "gpio-leds";
> +		ledb {
> +			label = "cm-t35:green";
> +			gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>;  /* gpio186 */
> +			linux,default-trigger = "heartbeat";

Although all CPU boards have the same GPIO routed to the heartbeat LED,
this property is related to the CPU board and not to the base (mother) board.
The same GPIO is used intensionally for s/w simplicity.
If we are about to save code duplication, I'd like to have a common
to CPU boards file, say omap3-cm-t3x.dtsi - that way it will better reflect
the actual hardware.

> +		};
> +	};
> +
> +	vddvario: regulator-vddvario {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vddvario";
> +		regulator-always-on;
> +	};
> +
> +	vdd33a: regulator-vdd33a {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vdd33a";
> +		regulator-always-on;
> +	};
> +};
> +
> +&gpmc {
> +	ranges = <5 0 0x2c000000 0x01000000>,
> +		 <4 0 0x2d000000 0x01000000>;
> +
> +	smsc1: ethernet at 5,0 {
> +		compatible = "smsc,lan9221", "smsc,lan9115";
> +		interrupt-parent = <&gpio6>;
> +		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
> +		reg = <5 0 0xff>;
> +		bank-width = <2>;
> +		gpmc,mux-add-data;
> +		gpmc,cs-on-ns = <0>;
> +		gpmc,cs-rd-off-ns = <186>;
> +		gpmc,cs-wr-off-ns = <186>;
> +		gpmc,adv-on-ns = <12>;
> +		gpmc,adv-rd-off-ns = <48>;
> +		gpmc,adv-wr-off-ns = <48>;
> +		gpmc,oe-on-ns = <54>;
> +		gpmc,oe-off-ns = <168>;
> +		gpmc,we-on-ns = <54>;
> +		gpmc,we-off-ns = <168>;
> +		gpmc,rd-cycle-ns = <186>;
> +		gpmc,wr-cycle-ns = <186>;
> +		gpmc,access-ns = <114>;
> +		gpmc,page-burst-access-ns = <6>;
> +		gpmc,bus-turnaround-ns = <12>;
> +		gpmc,cycle2cycle-delay-ns = <18>;
> +		gpmc,wr-data-mux-bus-ns = <90>;
> +		gpmc,wr-access-ns = <186>;
> +		gpmc,cycle2cycle-samecsen;
> +		gpmc,cycle2cycle-diffcsen;
> +		vddvario-supply = <&vddvario>;
> +		vdd33a-supply = <&vdd33a>;
> +		reg-io-width = <4>;
> +		smsc,save-mac-address;
> +	};

This one also should be a part of CPU board file or the common file.

> +
> +	smsc2: ethernet at 4,0 {
> +		compatible = "smsc,lan9221", "smsc,lan9115";
> +		interrupt-parent = <&gpio3>;
> +		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
> +		reg = <4 0 0xff>;
> +		bank-width = <2>;
> +		gpmc,mux-add-data;
> +		gpmc,cs-on-ns = <0>;
> +		gpmc,cs-rd-off-ns = <186>;
> +		gpmc,cs-wr-off-ns = <186>;
> +		gpmc,adv-on-ns = <12>;
> +		gpmc,adv-rd-off-ns = <48>;
> +		gpmc,adv-wr-off-ns = <48>;
> +		gpmc,oe-on-ns = <54>;
> +		gpmc,oe-off-ns = <168>;
> +		gpmc,we-on-ns = <54>;
> +		gpmc,we-off-ns = <168>;
> +		gpmc,rd-cycle-ns = <186>;
> +		gpmc,wr-cycle-ns = <186>;
> +		gpmc,access-ns = <114>;
> +		gpmc,page-burst-access-ns = <6>;
> +		gpmc,bus-turnaround-ns = <12>;
> +		gpmc,cycle2cycle-delay-ns = <18>;
> +		gpmc,wr-data-mux-bus-ns = <90>;
> +		gpmc,wr-access-ns = <186>;
> +		gpmc,cycle2cycle-samecsen;
> +		gpmc,cycle2cycle-diffcsen;
> +		vddvario-supply = <&vddvario>;
> +		vdd33a-supply = <&vdd33a>;
> +		reg-io-width = <4>;
> +		smsc,save-mac-address;
> +	};
> +};
> +
> +&i2c1 {
> +	clock-frequency = <2600000>;
> +
> +	twl: twl at 48 {
> +		reg = <0x48>;
> +		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
> +		interrupt-parent = <&intc>;
> +	};
> +};

This one should be a part of the common file.

> +
> +#include "twl4030.dtsi"
> +#include "twl4030_omap3.dtsi"
> +
> +&i2c3 {
> +	clock-frequency = <400000>;
> +};
> +
> +&mmc1 {
> +	vmmc-supply = <&vmmc1>;
> +	vmmc_aux-supply = <&vsim>;

Is it essential to always provide vmmc_aux-supply property?
In fact, the TPS65930 does not have the VSIM supply...
It is a mistake in the upstream board file.
I fixed this locally a while ago, but haven't submitted upstream...
So we should either leave this property unpopulated (if we can...) or
provide a fixed regulator to populate it.

> +	bus-width = <8>;

I'm not sure what this property should reflect.
Both cm-t3530 and cm-t3730 use 4 bit MMC1 bus.

> +};
> +
> +&twl_gpio {
> +	ti,use-leds;
> +};
> diff --git a/arch/arm/boot/dts/omap3-sbc-t3517.dts b/arch/arm/boot/dts/omap3-sbc-t3517.dts
> new file mode 100644
> index 0000000..2df885b
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap3-sbc-t3517.dts
> @@ -0,0 +1,18 @@
> +/*
> + * Suppport for CompuLab SBC-T3517 with CM-T3517
> + */
> +/dts-v1/;
> +
> +#include "am3517.dtsi"
> +#include "omap3-sb-t35.dtsi"
> +
> +
> +/ {
> +	model = "CompuLab SBC-T3517 with CM-T3517";
> +	compatible = "compulab,omap3-sbc-t3517", "ti,am3517", "ti,omap3";
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x80000000 0x10000000>; /* 256 MB */

Can we support multiple memory sizes through static DT, or
the only way is to update this property in the bootloader?

> +	};
> +};
> diff --git a/arch/arm/boot/dts/omap3-sbc-t3530.dts b/arch/arm/boot/dts/omap3-sbc-t3530.dts
> new file mode 100644
> index 0000000..5156147
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap3-sbc-t3530.dts
> @@ -0,0 +1,18 @@
> +/*
> + * Suppport for CompuLab SBC-T3530 with CM-T3530
> + */
> +/dts-v1/;
> +
> +#include "omap34xx.dtsi"
> +#include "omap3-sb-t35.dtsi"
> +
> +
> +/ {
> +	model = "CompuLab SBC-T3530 with CM-T3530";
> +	compatible = "compulab,omap3-sbc-t3530", "ti,omap34xx", "ti,omap3";
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x80000000 0x10000000>; /* 256 MB */
> +	};
> +};
> diff --git a/arch/arm/boot/dts/omap3-sbc-t3730.dts b/arch/arm/boot/dts/omap3-sbc-t3730.dts
> new file mode 100644
> index 0000000..836f742
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap3-sbc-t3730.dts
> @@ -0,0 +1,130 @@
> +/*
> + * Suppport for CompuLab SBC-T3730 with CM-T3730
> + */
> +/dts-v1/;
> +
> +#include "omap36xx.dtsi"
> +#include "omap3-sb-t35.dtsi"
> +
> +
> +/ {
> +	model = "CompuLab SBC-T3730 with CM-T3730";
> +	compatible = "compulab,omap3-sbc-t3730", "ti,omap36xx", "ti,omap3";
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x80000000 0x10000000>; /* 256 MB */
> +	};
> +
> +	wl12xx_vmmc2: wl12xx_vmmc2 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vw1271";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&wl12xx_gpio>;
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +		gpio = <&gpio3 9 GPIO_ACTIVE_HIGH>;   /* gpio73 */
> +		startup-delay-us = <20000>;
> +		enable-active-high;
> +	};
> +
> +	wl12xx_vaux2: wl12xx_vaux2 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vwl1271_vaux2";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +		gpio = <&twl_gpio 2 GPIO_ACTIVE_HIGH>;
> +		startup-delay-us = <70000>;
> +		enable-active-high;
> +		vin-supply = <&vaux2>;
> +	};
> +};
> +
> +&omap3_pmx_core {
> +	mmc1_pins: pinmux_mmc1_pins {
> +		pinctrl-single,pins = <
> +			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
> +			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
> +			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
> +			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
> +			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
> +			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
> +			0x120 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat4.sdmmc1_dat4 */
> +			0x122 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat5.sdmmc1_dat5 */
> +			0x124 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat6.sdmmc1_dat6 */
> +			0x126 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat7.sdmmc1_dat7 */

The dat{4,5,6,7} pins are not used either on cm-t3530, or cm-t3730.

> +		>;
> +	};
> +
> +	mmc2_pins: pinmux_mmc2_pins {
> +		pinctrl-single,pins = <
> +			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
> +			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
> +			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
> +			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
> +			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
> +			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */

Here the following is missing:
0x134 (PIN_OUTPUT | MUX_MODE1)	/* sdmmc2_dat4.sdmmc2_dir_dat0 */

> +			0x136 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat5.sdmmc2_dir_dat1 */
> +			0x138 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat6.sdmmc2_dir_cmd */
> +			0x13a (PIN_INPUT | MUX_MODE1)		/* sdmmc2_dat7.sdmmc2_clkin */

All four above pins (dat{4,5,6,7}) should be muxed only on cm-t3530.
cm-t3730 uses the sdmmc2_dat4 (gpio136) for wl12xx irq,
and does nor use the rest (dat{5,6,7}) at all.

> +		>;
> +	};
> +
> +	smsc1_pins: pinmux_smsc1_pins {
> +		pinctrl-single,pins = <
> +			0x88 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs5.gpmc_ncs5 */
> +			0x16a (PIN_INPUT_PULLUP | MUX_MODE4)	/* uart3_cts_rctx.gpio_163 */
> +		>;
> +	};
> +
> +	smsc2_pins: pinmux_smsc2_pins {
> +		pinctrl-single,pins = <
> +			0x86 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs4.gpmc_ncs4 */
> +			0xa2 (PIN_INPUT_PULLUP | MUX_MODE4)	/* gpmc_wait3.gpio_65 */
> +		>;
> +	};
> +
> +	uart3_pins: pinmux_uart3_pins {
> +		pinctrl-single,pins = <
> +			0x16e (PIN_INPUT | MUX_MODE0)		/* uart3_rx_irrx.uart3_rx_irrx */
> +			0x170 (PIN_OUTPUT | MUX_MODE0)		/* uart3_tx_irtx.uart3_tx_irtx */
> +		>;
> +	};
> +
> +	wl12xx_gpio: pinmux_wl12xx_gpio {
> +		pinctrl-single,pins = <
> +			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
> +			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
> +		>;
> +	};
> +};
> +
> +&mmc1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc1_pins>;
> +};
> +
> +&mmc2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc2_pins>;
> +	vmmc-supply = <&wl12xx_vmmc2>;
> +	vmmc_aux-supply = <&wl12xx_vaux2>;
> +	non-removable;
> +	bus-width = <4>;
> +	cap-power-off-card;
> +};
> +
> +&smsc1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&smsc1_pins>;
> +};
> +
> +&smsc2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&smsc2_pins>;
> +};
> +
> +&uart3 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&uart3_pins>;
> +};
> diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
> index 78c6233..1a1bfc0 100644
> --- a/arch/arm/mach-omap2/pdata-quirks.c
> +++ b/arch/arm/mach-omap2/pdata-quirks.c
> @@ -93,6 +93,12 @@ static void __init hsmmc2_internal_input_clk(void)
>  	omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
>  }
>  
> +static void __init omap3_sbc_t3730_legacy_init(void)
> +{
> +	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
> +	omap_ads7846_init(1, 57, 0, NULL);
> +}
> +
>  static void __init omap3_igep0020_legacy_init(void)
>  {
>  	omap3_igep2_display_init_of();
> @@ -229,6 +235,7 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
>   */
>  static struct pdata_init pdata_quirks[] __initdata = {
>  #ifdef CONFIG_ARCH_OMAP3
> +	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
>  	{ "nokia,omap3-n900", hsmmc2_internal_input_clk, },
>  	{ "nokia,omap3-n9", hsmmc2_internal_input_clk, },
>  	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },
> 

-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
  2013-12-16 13:55   ` Igor Grinberg
@ 2013-12-16 19:17     ` Tony Lindgren
  -1 siblings, 0 replies; 18+ messages in thread
From: Tony Lindgren @ 2013-12-16 19:17 UTC (permalink / raw)
  To: Igor Grinberg; +Cc: linux-arm-kernel, linux-omap, devicetree, Dmitry Lifshitz

* Igor Grinberg <grinberg@compulab.co.il> [131216 05:57]:
> On 12/13/13 21:22, Tony Lindgren wrote:
> 
> SB-T35 has only one SMSC Ethernet on-board (smsc2),
> while the first one is on the cm-t3530 and cm-t3730 modules.
> SBC-T3517 has only one _SMSC_ Ethernet and it is on the SB-T35 base board.
> cm-t3517 has EMAC Ethernet on-board instead of the SMSC.

OK, I'll move that.
 
> There is also another base board - CB-T3, which turns into
> EM-T3530 and EM-T3730 once you plug the cm-t3530 or cm-t3730 into CB-T3.
> 
> http://compulab.co.il/products/handheld-computers/em-t3730/
> http://compulab.co.il/products/handheld-computers/em-t3530/
> 
> The CB-T3 base board does not have any Ethernet controllers on it,
> so the EM-T3x systems have only one Ethernet controller - the one on the
> CPU board - SMSC.

OK
 
> This makes it four boards:
> sb-t35 - base board has only one Ethernet controller (SMSC)
> cb-t3 - base board has no Ethernet controllers
> cm-t3530 - CPU board (plugged into sb-t35) has only one Ethernet controller (SMSC)
> cm-t3730 - CPU board (plugged into sb-t35) has only one Ethernet controller (SMSC)
> cm-t3537 - CPU board (plugged into sb-t35) has only one Ethernet controller (EMAC)
> 
> The SBC-Txxx and EM-Txxx- means both boards connected (base board with CPU board).

OK
 
> > +
> > +	cpus {
> > +		cpu@0 {
> > +			cpu0-supply = <&vcc>;
> > +		};
> > +	};
> > +
> > +	leds {
> > +		compatible = "gpio-leds";
> > +		ledb {
> > +			label = "cm-t35:green";
> > +			gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>;  /* gpio186 */
> > +			linux,default-trigger = "heartbeat";
> 
> Although all CPU boards have the same GPIO routed to the heartbeat LED,
> this property is related to the CPU board and not to the base (mother) board.
> The same GPIO is used intensionally for s/w simplicity.
> If we are about to save code duplication, I'd like to have a common
> to CPU boards file, say omap3-cm-t3x.dtsi - that way it will better reflect
> the actual hardware.

OK will move.
 
> > +&i2c1 {
> > +	clock-frequency = <2600000>;
> > +
> > +	twl: twl@48 {
> > +		reg = <0x48>;
> > +		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
> > +		interrupt-parent = <&intc>;
> > +	};
> > +};
> 
> This one should be a part of the common file.

OK 

> > +#include "twl4030.dtsi"
> > +#include "twl4030_omap3.dtsi"
> > +
> > +&i2c3 {
> > +	clock-frequency = <400000>;
> > +};
> > +
> > +&mmc1 {
> > +	vmmc-supply = <&vmmc1>;
> > +	vmmc_aux-supply = <&vsim>;
> 
> Is it essential to always provide vmmc_aux-supply property?
> In fact, the TPS65930 does not have the VSIM supply...
> It is a mistake in the upstream board file.

OK

> I fixed this locally a while ago, but haven't submitted upstream...
> So we should either leave this property unpopulated (if we can...) or
> provide a fixed regulator to populate it.
> 
> > +	bus-width = <8>;
> 
> I'm not sure what this property should reflect.
> Both cm-t3530 and cm-t3730 use 4 bit MMC1 bus.

Hmm except with the muxing it seems to work just fine with 8-bit :)
I noticed that by accident as I copied the entry from omap3-evm.

So it seems that all the 8 lines are available for the MMC1, but can
be optionally also routed somewhere else?
 
> > +++ b/arch/arm/boot/dts/omap3-sbc-t3517.dts
> > @@ -0,0 +1,18 @@
> > +/*
> > + * Suppport for CompuLab SBC-T3517 with CM-T3517
> > + */
> > +/dts-v1/;
> > +
> > +#include "am3517.dtsi"
> > +#include "omap3-sb-t35.dtsi"
> > +
> > +
> > +/ {
> > +	model = "CompuLab SBC-T3517 with CM-T3517";
> > +	compatible = "compulab,omap3-sbc-t3517", "ti,am3517", "ti,omap3";
> > +
> > +	memory {
> > +		device_type = "memory";
> > +		reg = <0x80000000 0x10000000>; /* 256 MB */
> 
> Can we support multiple memory sizes through static DT, or
> the only way is to update this property in the bootloader?

Well we should probably have a minimal .dts file for the variants
too that can include omap3-cm-t37.dts and so on. I guess some
bootloaders are capable of rewriting the .dtb too.
 
> > +	mmc1_pins: pinmux_mmc1_pins {
> > +		pinctrl-single,pins = <
> > +			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
> > +			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
> > +			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
> > +			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
> > +			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
> > +			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
> > +			0x120 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat4.sdmmc1_dat4 */
> > +			0x122 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat5.sdmmc1_dat5 */
> > +			0x124 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat6.sdmmc1_dat6 */
> > +			0x126 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat7.sdmmc1_dat7 */
> 
> The dat{4,5,6,7} pins are not used either on cm-t3530, or cm-t3730.

But it seems to work and makes MMC1 faster :) Might be worth checking
though, maybe those pins have multiple optional routings available?
 
> > +	mmc2_pins: pinmux_mmc2_pins {
> > +		pinctrl-single,pins = <
> > +			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
> > +			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
> > +			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
> > +			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
> > +			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
> > +			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
> 
> Here the following is missing:
> 0x134 (PIN_OUTPUT | MUX_MODE1)	/* sdmmc2_dat4.sdmmc2_dir_dat0 */

That seems to be used for the wl12xx GPIO, so it's listed at
wl12xx_gpio below.
 
> > +			0x136 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat5.sdmmc2_dir_dat1 */
> > +			0x138 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat6.sdmmc2_dir_cmd */
> > +			0x13a (PIN_INPUT | MUX_MODE1)		/* sdmmc2_dat7.sdmmc2_clkin */
> 
> All four above pins (dat{4,5,6,7}) should be muxed only on cm-t3530.
> cm-t3730 uses the sdmmc2_dat4 (gpio136) for wl12xx irq,
> and does nor use the rest (dat{5,6,7}) at all.

Hmm OK, maybe those extra pins also have alternative routings available?
 
> > +	wl12xx_gpio: pinmux_wl12xx_gpio {
> > +		pinctrl-single,pins = <
> > +			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
> > +			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
> > +		>;
> > +	};
> > +};

Regards,

Tony

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
@ 2013-12-16 19:17     ` Tony Lindgren
  0 siblings, 0 replies; 18+ messages in thread
From: Tony Lindgren @ 2013-12-16 19:17 UTC (permalink / raw)
  To: linux-arm-kernel

* Igor Grinberg <grinberg@compulab.co.il> [131216 05:57]:
> On 12/13/13 21:22, Tony Lindgren wrote:
> 
> SB-T35 has only one SMSC Ethernet on-board (smsc2),
> while the first one is on the cm-t3530 and cm-t3730 modules.
> SBC-T3517 has only one _SMSC_ Ethernet and it is on the SB-T35 base board.
> cm-t3517 has EMAC Ethernet on-board instead of the SMSC.

OK, I'll move that.
 
> There is also another base board - CB-T3, which turns into
> EM-T3530 and EM-T3730 once you plug the cm-t3530 or cm-t3730 into CB-T3.
> 
> http://compulab.co.il/products/handheld-computers/em-t3730/
> http://compulab.co.il/products/handheld-computers/em-t3530/
> 
> The CB-T3 base board does not have any Ethernet controllers on it,
> so the EM-T3x systems have only one Ethernet controller - the one on the
> CPU board - SMSC.

OK
 
> This makes it four boards:
> sb-t35 - base board has only one Ethernet controller (SMSC)
> cb-t3 - base board has no Ethernet controllers
> cm-t3530 - CPU board (plugged into sb-t35) has only one Ethernet controller (SMSC)
> cm-t3730 - CPU board (plugged into sb-t35) has only one Ethernet controller (SMSC)
> cm-t3537 - CPU board (plugged into sb-t35) has only one Ethernet controller (EMAC)
> 
> The SBC-Txxx and EM-Txxx- means both boards connected (base board with CPU board).

OK
 
> > +
> > +	cpus {
> > +		cpu at 0 {
> > +			cpu0-supply = <&vcc>;
> > +		};
> > +	};
> > +
> > +	leds {
> > +		compatible = "gpio-leds";
> > +		ledb {
> > +			label = "cm-t35:green";
> > +			gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>;  /* gpio186 */
> > +			linux,default-trigger = "heartbeat";
> 
> Although all CPU boards have the same GPIO routed to the heartbeat LED,
> this property is related to the CPU board and not to the base (mother) board.
> The same GPIO is used intensionally for s/w simplicity.
> If we are about to save code duplication, I'd like to have a common
> to CPU boards file, say omap3-cm-t3x.dtsi - that way it will better reflect
> the actual hardware.

OK will move.
 
> > +&i2c1 {
> > +	clock-frequency = <2600000>;
> > +
> > +	twl: twl at 48 {
> > +		reg = <0x48>;
> > +		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
> > +		interrupt-parent = <&intc>;
> > +	};
> > +};
> 
> This one should be a part of the common file.

OK 

> > +#include "twl4030.dtsi"
> > +#include "twl4030_omap3.dtsi"
> > +
> > +&i2c3 {
> > +	clock-frequency = <400000>;
> > +};
> > +
> > +&mmc1 {
> > +	vmmc-supply = <&vmmc1>;
> > +	vmmc_aux-supply = <&vsim>;
> 
> Is it essential to always provide vmmc_aux-supply property?
> In fact, the TPS65930 does not have the VSIM supply...
> It is a mistake in the upstream board file.

OK

> I fixed this locally a while ago, but haven't submitted upstream...
> So we should either leave this property unpopulated (if we can...) or
> provide a fixed regulator to populate it.
> 
> > +	bus-width = <8>;
> 
> I'm not sure what this property should reflect.
> Both cm-t3530 and cm-t3730 use 4 bit MMC1 bus.

Hmm except with the muxing it seems to work just fine with 8-bit :)
I noticed that by accident as I copied the entry from omap3-evm.

So it seems that all the 8 lines are available for the MMC1, but can
be optionally also routed somewhere else?
 
> > +++ b/arch/arm/boot/dts/omap3-sbc-t3517.dts
> > @@ -0,0 +1,18 @@
> > +/*
> > + * Suppport for CompuLab SBC-T3517 with CM-T3517
> > + */
> > +/dts-v1/;
> > +
> > +#include "am3517.dtsi"
> > +#include "omap3-sb-t35.dtsi"
> > +
> > +
> > +/ {
> > +	model = "CompuLab SBC-T3517 with CM-T3517";
> > +	compatible = "compulab,omap3-sbc-t3517", "ti,am3517", "ti,omap3";
> > +
> > +	memory {
> > +		device_type = "memory";
> > +		reg = <0x80000000 0x10000000>; /* 256 MB */
> 
> Can we support multiple memory sizes through static DT, or
> the only way is to update this property in the bootloader?

Well we should probably have a minimal .dts file for the variants
too that can include omap3-cm-t37.dts and so on. I guess some
bootloaders are capable of rewriting the .dtb too.
 
> > +	mmc1_pins: pinmux_mmc1_pins {
> > +		pinctrl-single,pins = <
> > +			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
> > +			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
> > +			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
> > +			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
> > +			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
> > +			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
> > +			0x120 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat4.sdmmc1_dat4 */
> > +			0x122 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat5.sdmmc1_dat5 */
> > +			0x124 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat6.sdmmc1_dat6 */
> > +			0x126 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat7.sdmmc1_dat7 */
> 
> The dat{4,5,6,7} pins are not used either on cm-t3530, or cm-t3730.

But it seems to work and makes MMC1 faster :) Might be worth checking
though, maybe those pins have multiple optional routings available?
 
> > +	mmc2_pins: pinmux_mmc2_pins {
> > +		pinctrl-single,pins = <
> > +			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
> > +			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
> > +			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
> > +			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
> > +			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
> > +			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
> 
> Here the following is missing:
> 0x134 (PIN_OUTPUT | MUX_MODE1)	/* sdmmc2_dat4.sdmmc2_dir_dat0 */

That seems to be used for the wl12xx GPIO, so it's listed at
wl12xx_gpio below.
 
> > +			0x136 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat5.sdmmc2_dir_dat1 */
> > +			0x138 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat6.sdmmc2_dir_cmd */
> > +			0x13a (PIN_INPUT | MUX_MODE1)		/* sdmmc2_dat7.sdmmc2_clkin */
> 
> All four above pins (dat{4,5,6,7}) should be muxed only on cm-t3530.
> cm-t3730 uses the sdmmc2_dat4 (gpio136) for wl12xx irq,
> and does nor use the rest (dat{5,6,7}) at all.

Hmm OK, maybe those extra pins also have alternative routings available?
 
> > +	wl12xx_gpio: pinmux_wl12xx_gpio {
> > +		pinctrl-single,pins = <
> > +			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
> > +			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
> > +		>;
> > +	};
> > +};

Regards,

Tony

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
  2013-12-16 19:17     ` Tony Lindgren
@ 2013-12-17  7:14       ` Igor Grinberg
  -1 siblings, 0 replies; 18+ messages in thread
From: Igor Grinberg @ 2013-12-17  7:14 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-arm-kernel, linux-omap, devicetree, Dmitry Lifshitz,
	Nikita Kiryanov

On 12/16/13 21:17, Tony Lindgren wrote:
> * Igor Grinberg <grinberg@compulab.co.il> [131216 05:57]:
>> On 12/13/13 21:22, Tony Lindgren wrote:
>>
>> SB-T35 has only one SMSC Ethernet on-board (smsc2),
>> while the first one is on the cm-t3530 and cm-t3730 modules.
>> SBC-T3517 has only one _SMSC_ Ethernet and it is on the SB-T35 base board.
>> cm-t3517 has EMAC Ethernet on-board instead of the SMSC.
> 
> OK, I'll move that.
>  
>> There is also another base board - CB-T3, which turns into
>> EM-T3530 and EM-T3730 once you plug the cm-t3530 or cm-t3730 into CB-T3.
>>
>> http://compulab.co.il/products/handheld-computers/em-t3730/
>> http://compulab.co.il/products/handheld-computers/em-t3530/
>>
>> The CB-T3 base board does not have any Ethernet controllers on it,
>> so the EM-T3x systems have only one Ethernet controller - the one on the
>> CPU board - SMSC.
> 
> OK
>  
>> This makes it four boards:
>> sb-t35 - base board has only one Ethernet controller (SMSC)
>> cb-t3 - base board has no Ethernet controllers
>> cm-t3530 - CPU board (plugged into sb-t35) has only one Ethernet controller (SMSC)
>> cm-t3730 - CPU board (plugged into sb-t35) has only one Ethernet controller (SMSC)
>> cm-t3537 - CPU board (plugged into sb-t35) has only one Ethernet controller (EMAC)
>>
>> The SBC-Txxx and EM-Txxx- means both boards connected (base board with CPU board).
> 
> OK
>  
>>> +
>>> +	cpus {
>>> +		cpu@0 {
>>> +			cpu0-supply = <&vcc>;
>>> +		};
>>> +	};
>>> +
>>> +	leds {
>>> +		compatible = "gpio-leds";
>>> +		ledb {
>>> +			label = "cm-t35:green";
>>> +			gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>;  /* gpio186 */
>>> +			linux,default-trigger = "heartbeat";
>>
>> Although all CPU boards have the same GPIO routed to the heartbeat LED,
>> this property is related to the CPU board and not to the base (mother) board.
>> The same GPIO is used intensionally for s/w simplicity.
>> If we are about to save code duplication, I'd like to have a common
>> to CPU boards file, say omap3-cm-t3x.dtsi - that way it will better reflect
>> the actual hardware.
> 
> OK will move.
>  
>>> +&i2c1 {
>>> +	clock-frequency = <2600000>;
>>> +
>>> +	twl: twl@48 {
>>> +		reg = <0x48>;
>>> +		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
>>> +		interrupt-parent = <&intc>;
>>> +	};
>>> +};
>>
>> This one should be a part of the common file.
> 
> OK 
> 
>>> +#include "twl4030.dtsi"
>>> +#include "twl4030_omap3.dtsi"
>>> +
>>> +&i2c3 {
>>> +	clock-frequency = <400000>;
>>> +};
>>> +
>>> +&mmc1 {
>>> +	vmmc-supply = <&vmmc1>;
>>> +	vmmc_aux-supply = <&vsim>;
>>
>> Is it essential to always provide vmmc_aux-supply property?
>> In fact, the TPS65930 does not have the VSIM supply...
>> It is a mistake in the upstream board file.
> 
> OK
> 
>> I fixed this locally a while ago, but haven't submitted upstream...
>> So we should either leave this property unpopulated (if we can...) or
>> provide a fixed regulator to populate it.
>>
>>> +	bus-width = <8>;
>>
>> I'm not sure what this property should reflect.
>> Both cm-t3530 and cm-t3730 use 4 bit MMC1 bus.
> 
> Hmm except with the muxing it seems to work just fine with 8-bit :)

Yes, this is because they are just not connected on sb-t35.

> I noticed that by accident as I copied the entry from omap3-evm.
> 
> So it seems that all the 8 lines are available for the MMC1, but can
> be optionally also routed somewhere else?

The concept of having CPU board and base (mother) board implies
that our customers build a base board of their own.
This way, the customer decides what to do with those lines.
cm-t3x just makes them available on the connector, while
neither sb-t35, nor cb-t3 uses them.

>  
>>> +++ b/arch/arm/boot/dts/omap3-sbc-t3517.dts
>>> @@ -0,0 +1,18 @@
>>> +/*
>>> + * Suppport for CompuLab SBC-T3517 with CM-T3517
>>> + */
>>> +/dts-v1/;
>>> +
>>> +#include "am3517.dtsi"
>>> +#include "omap3-sb-t35.dtsi"
>>> +
>>> +
>>> +/ {
>>> +	model = "CompuLab SBC-T3517 with CM-T3517";
>>> +	compatible = "compulab,omap3-sbc-t3517", "ti,am3517", "ti,omap3";
>>> +
>>> +	memory {
>>> +		device_type = "memory";
>>> +		reg = <0x80000000 0x10000000>; /* 256 MB */
>>
>> Can we support multiple memory sizes through static DT, or
>> the only way is to update this property in the bootloader?
> 
> Well we should probably have a minimal .dts file for the variants
> too that can include omap3-cm-t37.dts and so on. I guess some
> bootloaders are capable of rewriting the .dtb too.

Ok. So what do you think, is it fine to have something like:
omap3-cm-t3x.dtsi		- common to cm-t3x cpu boards
omap3-cm-t3x30.dtsi		- common to cm-t3730 and cm-t3530
omap3-cm-t3730.dtsi		- cm-t3730 specific
omap3-cm-t3530.dtsi		- cm-t3530 specific
omap3-cm-t3517.dtsi		- cm-t3517 specific
omap3-sb-t35.dtsi		- sb-t35 specific
omap3-cb-t3.dtsi		- cb-t3 specific
omap3-sbc-t3730-256mb.dts	- sb-t35 with cm-t3730 and 256MB memory size
omap3-sbc-t3730-128mb.dts	- sb-t35 with cm-t3730 and 128MB memory size
omap3-sbc-t3730-64mb.dts	- sb-t35 with cm-t3730 and 64MB memory size
omap3-sbc-t3530-256mb.dts	- sb-t35 with cm-t3530 and 256MB memory size
omap3-sbc-t3530-128mb.dts	- sb-t35 with cm-t3530 and 128MB memory size
omap3-sbc-t3530-64mb.dts	- sb-t35 with cm-t3530 and 64MB memory size
omap3-sbc-t3517-256mb.dts	- sb-t35 with cm-t3517 and 256MB memory size
omap3-sbc-t3517-128mb.dts	- sb-t35 with cm-t3517 and 128MB memory size
omap3-em-t3730-256mb.dts	- cb-t3 with cm-t3730 and 256MB memory size
omap3-em-t3730-128mb.dts	- cb-t3 with cm-t3730 and 128MB memory size
omap3-em-t3730-64mb.dts		- cb-t3 with cm-t3730 and 64MB memory size
omap3-em-t3530-256mb.dts	- cb-t3 with cm-t3530 and 256MB memory size
omap3-em-t3530-128mb.dts	- cb-t3 with cm-t3530 and 128MB memory size
omap3-em-t3530-64mb.dts		- cb-t3 with cm-t3530 and 64MB memory size

or is it too much... ;-)))
The above gives the full coverage of the 2x3 boards.

I think we can drop the different memory sizes and
let boot loader adjust the blob. This will make the list shorter:
omap3-cm-t3x.dtsi	- common to cm-t3x cpu boards
omap3-cm-t3x30.dtsi	- common to cm-t3730 and cm-t3530
omap3-cm-t3730.dtsi	- cm-t3730 specific
omap3-cm-t3530.dtsi	- cm-t3530 specific
omap3-cm-t3517.dtsi	- cm-t3517 specific
omap3-sb-t35.dtsi	- sb-t35 specific
omap3-cb-t3.dtsi	- cb-t3 specific
omap3-sbc-t3730.dts	- sb-t35 with cm-t3730 and default memory size
omap3-sbc-t3530.dts	- sb-t35 with cm-t3530 and default memory size
omap3-sbc-t3517.dts	- sb-t35 with cm-t3517 and default memory size
omap3-em-t3730.dts	- cb-t3 with cm-t3730 and default memory size
omap3-em-t3530.dts	- cb-t3 with cm-t3530 and default memory size

So what do you think?

>  
>>> +	mmc1_pins: pinmux_mmc1_pins {
>>> +		pinctrl-single,pins = <
>>> +			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
>>> +			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
>>> +			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
>>> +			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
>>> +			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
>>> +			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
>>> +			0x120 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat4.sdmmc1_dat4 */
>>> +			0x122 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat5.sdmmc1_dat5 */
>>> +			0x124 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat6.sdmmc1_dat6 */
>>> +			0x126 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat7.sdmmc1_dat7 */
>>
>> The dat{4,5,6,7} pins are not used either on cm-t3530, or cm-t3730.
> 
> But it seems to work and makes MMC1 faster :) Might be worth checking
> though, maybe those pins have multiple optional routings available?

They are routed to the connector of the base board and then...
just not connected...
Interesting, how that can make the MMC1 faster? Are you sure?

>  
>>> +	mmc2_pins: pinmux_mmc2_pins {
>>> +		pinctrl-single,pins = <
>>> +			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
>>> +			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
>>> +			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
>>> +			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
>>> +			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
>>> +			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
>>
>> Here the following is missing:
>> 0x134 (PIN_OUTPUT | MUX_MODE1)	/* sdmmc2_dat4.sdmmc2_dir_dat0 */
> 
> That seems to be used for the wl12xx GPIO, so it's listed at
> wl12xx_gpio below.

Yes, but only on cm-t3730 (and actually starting from revision 1.2),
not cm-t3530...

>  
>>> +			0x136 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat5.sdmmc2_dir_dat1 */
>>> +			0x138 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat6.sdmmc2_dir_cmd */
>>> +			0x13a (PIN_INPUT | MUX_MODE1)		/* sdmmc2_dat7.sdmmc2_clkin */
>>
>> All four above pins (dat{4,5,6,7}) should be muxed only on cm-t3530.
>> cm-t3730 uses the sdmmc2_dat4 (gpio136) for wl12xx irq,
>> and does nor use the rest (dat{5,6,7}) at all.
> 
> Hmm OK, maybe those extra pins also have alternative routings available?

The same as with MMC1, they are routed to the connector and
not routed at all on sb-t35.

>  
>>> +	wl12xx_gpio: pinmux_wl12xx_gpio {
>>> +		pinctrl-single,pins = <
>>> +			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
>>> +			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
>>> +		>;
>>> +	};
>>> +};
> 
> Regards,
> 
> Tony
> 

-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
@ 2013-12-17  7:14       ` Igor Grinberg
  0 siblings, 0 replies; 18+ messages in thread
From: Igor Grinberg @ 2013-12-17  7:14 UTC (permalink / raw)
  To: linux-arm-kernel

On 12/16/13 21:17, Tony Lindgren wrote:
> * Igor Grinberg <grinberg@compulab.co.il> [131216 05:57]:
>> On 12/13/13 21:22, Tony Lindgren wrote:
>>
>> SB-T35 has only one SMSC Ethernet on-board (smsc2),
>> while the first one is on the cm-t3530 and cm-t3730 modules.
>> SBC-T3517 has only one _SMSC_ Ethernet and it is on the SB-T35 base board.
>> cm-t3517 has EMAC Ethernet on-board instead of the SMSC.
> 
> OK, I'll move that.
>  
>> There is also another base board - CB-T3, which turns into
>> EM-T3530 and EM-T3730 once you plug the cm-t3530 or cm-t3730 into CB-T3.
>>
>> http://compulab.co.il/products/handheld-computers/em-t3730/
>> http://compulab.co.il/products/handheld-computers/em-t3530/
>>
>> The CB-T3 base board does not have any Ethernet controllers on it,
>> so the EM-T3x systems have only one Ethernet controller - the one on the
>> CPU board - SMSC.
> 
> OK
>  
>> This makes it four boards:
>> sb-t35 - base board has only one Ethernet controller (SMSC)
>> cb-t3 - base board has no Ethernet controllers
>> cm-t3530 - CPU board (plugged into sb-t35) has only one Ethernet controller (SMSC)
>> cm-t3730 - CPU board (plugged into sb-t35) has only one Ethernet controller (SMSC)
>> cm-t3537 - CPU board (plugged into sb-t35) has only one Ethernet controller (EMAC)
>>
>> The SBC-Txxx and EM-Txxx- means both boards connected (base board with CPU board).
> 
> OK
>  
>>> +
>>> +	cpus {
>>> +		cpu at 0 {
>>> +			cpu0-supply = <&vcc>;
>>> +		};
>>> +	};
>>> +
>>> +	leds {
>>> +		compatible = "gpio-leds";
>>> +		ledb {
>>> +			label = "cm-t35:green";
>>> +			gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>;  /* gpio186 */
>>> +			linux,default-trigger = "heartbeat";
>>
>> Although all CPU boards have the same GPIO routed to the heartbeat LED,
>> this property is related to the CPU board and not to the base (mother) board.
>> The same GPIO is used intensionally for s/w simplicity.
>> If we are about to save code duplication, I'd like to have a common
>> to CPU boards file, say omap3-cm-t3x.dtsi - that way it will better reflect
>> the actual hardware.
> 
> OK will move.
>  
>>> +&i2c1 {
>>> +	clock-frequency = <2600000>;
>>> +
>>> +	twl: twl at 48 {
>>> +		reg = <0x48>;
>>> +		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
>>> +		interrupt-parent = <&intc>;
>>> +	};
>>> +};
>>
>> This one should be a part of the common file.
> 
> OK 
> 
>>> +#include "twl4030.dtsi"
>>> +#include "twl4030_omap3.dtsi"
>>> +
>>> +&i2c3 {
>>> +	clock-frequency = <400000>;
>>> +};
>>> +
>>> +&mmc1 {
>>> +	vmmc-supply = <&vmmc1>;
>>> +	vmmc_aux-supply = <&vsim>;
>>
>> Is it essential to always provide vmmc_aux-supply property?
>> In fact, the TPS65930 does not have the VSIM supply...
>> It is a mistake in the upstream board file.
> 
> OK
> 
>> I fixed this locally a while ago, but haven't submitted upstream...
>> So we should either leave this property unpopulated (if we can...) or
>> provide a fixed regulator to populate it.
>>
>>> +	bus-width = <8>;
>>
>> I'm not sure what this property should reflect.
>> Both cm-t3530 and cm-t3730 use 4 bit MMC1 bus.
> 
> Hmm except with the muxing it seems to work just fine with 8-bit :)

Yes, this is because they are just not connected on sb-t35.

> I noticed that by accident as I copied the entry from omap3-evm.
> 
> So it seems that all the 8 lines are available for the MMC1, but can
> be optionally also routed somewhere else?

The concept of having CPU board and base (mother) board implies
that our customers build a base board of their own.
This way, the customer decides what to do with those lines.
cm-t3x just makes them available on the connector, while
neither sb-t35, nor cb-t3 uses them.

>  
>>> +++ b/arch/arm/boot/dts/omap3-sbc-t3517.dts
>>> @@ -0,0 +1,18 @@
>>> +/*
>>> + * Suppport for CompuLab SBC-T3517 with CM-T3517
>>> + */
>>> +/dts-v1/;
>>> +
>>> +#include "am3517.dtsi"
>>> +#include "omap3-sb-t35.dtsi"
>>> +
>>> +
>>> +/ {
>>> +	model = "CompuLab SBC-T3517 with CM-T3517";
>>> +	compatible = "compulab,omap3-sbc-t3517", "ti,am3517", "ti,omap3";
>>> +
>>> +	memory {
>>> +		device_type = "memory";
>>> +		reg = <0x80000000 0x10000000>; /* 256 MB */
>>
>> Can we support multiple memory sizes through static DT, or
>> the only way is to update this property in the bootloader?
> 
> Well we should probably have a minimal .dts file for the variants
> too that can include omap3-cm-t37.dts and so on. I guess some
> bootloaders are capable of rewriting the .dtb too.

Ok. So what do you think, is it fine to have something like:
omap3-cm-t3x.dtsi		- common to cm-t3x cpu boards
omap3-cm-t3x30.dtsi		- common to cm-t3730 and cm-t3530
omap3-cm-t3730.dtsi		- cm-t3730 specific
omap3-cm-t3530.dtsi		- cm-t3530 specific
omap3-cm-t3517.dtsi		- cm-t3517 specific
omap3-sb-t35.dtsi		- sb-t35 specific
omap3-cb-t3.dtsi		- cb-t3 specific
omap3-sbc-t3730-256mb.dts	- sb-t35 with cm-t3730 and 256MB memory size
omap3-sbc-t3730-128mb.dts	- sb-t35 with cm-t3730 and 128MB memory size
omap3-sbc-t3730-64mb.dts	- sb-t35 with cm-t3730 and 64MB memory size
omap3-sbc-t3530-256mb.dts	- sb-t35 with cm-t3530 and 256MB memory size
omap3-sbc-t3530-128mb.dts	- sb-t35 with cm-t3530 and 128MB memory size
omap3-sbc-t3530-64mb.dts	- sb-t35 with cm-t3530 and 64MB memory size
omap3-sbc-t3517-256mb.dts	- sb-t35 with cm-t3517 and 256MB memory size
omap3-sbc-t3517-128mb.dts	- sb-t35 with cm-t3517 and 128MB memory size
omap3-em-t3730-256mb.dts	- cb-t3 with cm-t3730 and 256MB memory size
omap3-em-t3730-128mb.dts	- cb-t3 with cm-t3730 and 128MB memory size
omap3-em-t3730-64mb.dts		- cb-t3 with cm-t3730 and 64MB memory size
omap3-em-t3530-256mb.dts	- cb-t3 with cm-t3530 and 256MB memory size
omap3-em-t3530-128mb.dts	- cb-t3 with cm-t3530 and 128MB memory size
omap3-em-t3530-64mb.dts		- cb-t3 with cm-t3530 and 64MB memory size

or is it too much... ;-)))
The above gives the full coverage of the 2x3 boards.

I think we can drop the different memory sizes and
let boot loader adjust the blob. This will make the list shorter:
omap3-cm-t3x.dtsi	- common to cm-t3x cpu boards
omap3-cm-t3x30.dtsi	- common to cm-t3730 and cm-t3530
omap3-cm-t3730.dtsi	- cm-t3730 specific
omap3-cm-t3530.dtsi	- cm-t3530 specific
omap3-cm-t3517.dtsi	- cm-t3517 specific
omap3-sb-t35.dtsi	- sb-t35 specific
omap3-cb-t3.dtsi	- cb-t3 specific
omap3-sbc-t3730.dts	- sb-t35 with cm-t3730 and default memory size
omap3-sbc-t3530.dts	- sb-t35 with cm-t3530 and default memory size
omap3-sbc-t3517.dts	- sb-t35 with cm-t3517 and default memory size
omap3-em-t3730.dts	- cb-t3 with cm-t3730 and default memory size
omap3-em-t3530.dts	- cb-t3 with cm-t3530 and default memory size

So what do you think?

>  
>>> +	mmc1_pins: pinmux_mmc1_pins {
>>> +		pinctrl-single,pins = <
>>> +			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
>>> +			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
>>> +			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
>>> +			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
>>> +			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
>>> +			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
>>> +			0x120 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat4.sdmmc1_dat4 */
>>> +			0x122 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat5.sdmmc1_dat5 */
>>> +			0x124 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat6.sdmmc1_dat6 */
>>> +			0x126 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat7.sdmmc1_dat7 */
>>
>> The dat{4,5,6,7} pins are not used either on cm-t3530, or cm-t3730.
> 
> But it seems to work and makes MMC1 faster :) Might be worth checking
> though, maybe those pins have multiple optional routings available?

They are routed to the connector of the base board and then...
just not connected...
Interesting, how that can make the MMC1 faster? Are you sure?

>  
>>> +	mmc2_pins: pinmux_mmc2_pins {
>>> +		pinctrl-single,pins = <
>>> +			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
>>> +			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
>>> +			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
>>> +			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
>>> +			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
>>> +			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
>>
>> Here the following is missing:
>> 0x134 (PIN_OUTPUT | MUX_MODE1)	/* sdmmc2_dat4.sdmmc2_dir_dat0 */
> 
> That seems to be used for the wl12xx GPIO, so it's listed at
> wl12xx_gpio below.

Yes, but only on cm-t3730 (and actually starting from revision 1.2),
not cm-t3530...

>  
>>> +			0x136 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat5.sdmmc2_dir_dat1 */
>>> +			0x138 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat6.sdmmc2_dir_cmd */
>>> +			0x13a (PIN_INPUT | MUX_MODE1)		/* sdmmc2_dat7.sdmmc2_clkin */
>>
>> All four above pins (dat{4,5,6,7}) should be muxed only on cm-t3530.
>> cm-t3730 uses the sdmmc2_dat4 (gpio136) for wl12xx irq,
>> and does nor use the rest (dat{5,6,7}) at all.
> 
> Hmm OK, maybe those extra pins also have alternative routings available?

The same as with MMC1, they are routed to the connector and
not routed at all on sb-t35.

>  
>>> +	wl12xx_gpio: pinmux_wl12xx_gpio {
>>> +		pinctrl-single,pins = <
>>> +			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
>>> +			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
>>> +		>;
>>> +	};
>>> +};
> 
> Regards,
> 
> Tony
> 

-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
  2013-12-17  7:14       ` Igor Grinberg
@ 2013-12-17 19:31         ` Tony Lindgren
  -1 siblings, 0 replies; 18+ messages in thread
From: Tony Lindgren @ 2013-12-17 19:31 UTC (permalink / raw)
  To: Igor Grinberg
  Cc: linux-arm-kernel, linux-omap, devicetree, Dmitry Lifshitz,
	Nikita Kiryanov

* Igor Grinberg <grinberg@compulab.co.il> [131216 23:16]:
> On 12/16/13 21:17, Tony Lindgren wrote:
> > * Igor Grinberg <grinberg@compulab.co.il> [131216 05:57]:
> >> On 12/13/13 21:22, Tony Lindgren wrote:
>
> Ok. So what do you think, is it fine to have something like:
> omap3-cm-t3x.dtsi		- common to cm-t3x cpu boards
> omap3-cm-t3x30.dtsi		- common to cm-t3730 and cm-t3530
> omap3-cm-t3730.dtsi		- cm-t3730 specific
> omap3-cm-t3530.dtsi		- cm-t3530 specific
> omap3-cm-t3517.dtsi		- cm-t3517 specific
> omap3-sb-t35.dtsi		- sb-t35 specific
> omap3-cb-t3.dtsi		- cb-t3 specific
> omap3-sbc-t3730-256mb.dts	- sb-t35 with cm-t3730 and 256MB memory size
> omap3-sbc-t3730-128mb.dts	- sb-t35 with cm-t3730 and 128MB memory size
> omap3-sbc-t3730-64mb.dts	- sb-t35 with cm-t3730 and 64MB memory size
> omap3-sbc-t3530-256mb.dts	- sb-t35 with cm-t3530 and 256MB memory size
> omap3-sbc-t3530-128mb.dts	- sb-t35 with cm-t3530 and 128MB memory size
> omap3-sbc-t3530-64mb.dts	- sb-t35 with cm-t3530 and 64MB memory size
> omap3-sbc-t3517-256mb.dts	- sb-t35 with cm-t3517 and 256MB memory size
> omap3-sbc-t3517-128mb.dts	- sb-t35 with cm-t3517 and 128MB memory size
> omap3-em-t3730-256mb.dts	- cb-t3 with cm-t3730 and 256MB memory size
> omap3-em-t3730-128mb.dts	- cb-t3 with cm-t3730 and 128MB memory size
> omap3-em-t3730-64mb.dts		- cb-t3 with cm-t3730 and 64MB memory size
> omap3-em-t3530-256mb.dts	- cb-t3 with cm-t3530 and 256MB memory size
> omap3-em-t3530-128mb.dts	- cb-t3 with cm-t3530 and 128MB memory size
> omap3-em-t3530-64mb.dts		- cb-t3 with cm-t3530 and 64MB memory size
> 
> or is it too much... ;-)))
> The above gives the full coverage of the 2x3 boards.

Yeah probably best to patch in the size of the RAM in u-boot :)
 
> I think we can drop the different memory sizes and
> let boot loader adjust the blob. This will make the list shorter:
> omap3-cm-t3x.dtsi	- common to cm-t3x cpu boards
> omap3-cm-t3x30.dtsi	- common to cm-t3730 and cm-t3530
> omap3-cm-t3730.dtsi	- cm-t3730 specific
> omap3-cm-t3530.dtsi	- cm-t3530 specific
> omap3-cm-t3517.dtsi	- cm-t3517 specific
> omap3-sb-t35.dtsi	- sb-t35 specific
> omap3-cb-t3.dtsi	- cb-t3 specific
> omap3-sbc-t3730.dts	- sb-t35 with cm-t3730 and default memory size
> omap3-sbc-t3530.dts	- sb-t35 with cm-t3530 and default memory size
> omap3-sbc-t3517.dts	- sb-t35 with cm-t3517 and default memory size
> omap3-em-t3730.dts	- cb-t3 with cm-t3730 and default memory size
> omap3-em-t3530.dts	- cb-t3 with cm-t3530 and default memory size
> 
> So what do you think?
 
Makes sense to me. I've updated the patch below to use the following:

omap3-cm-t3x30.dtsi	- common to cm-t3730 and cm-t3530
omap3-cm-t3730.dts	- cm-t3730 specific, should work on it's own too, not a .dtsi
omap3-sb-t35.dtsi	- sb-t35 specific
omap3-sbc-t3730.dts	- sb-t35 with cm-t3730 and default memory size

So the only changes compared to your naming are to not use .dtsi
extension for omap3-cm-t3730.dts, and I did not add omap3-cm-t3x.dtsi
as I don't know the details.

It's probably best that you guys take over this patch from here and
add omap3-cm-t3x30.dtsi if needed.

I got the basic stuff working for what I need right now for my router
to work, which is MMC, both Ethernet controllers and wl12xx. So I'm
not going to tweak this patch further. Of course having the battery
charging working would be nice for a router to have a backup battery :)

There are still some issues I've noticed:

1. Removing and reinserting the wl12xx modules seems to kill the
   WLAN

2. Ethernet interfaces only come up if there's a cable connected
  
> >>> +	mmc1_pins: pinmux_mmc1_pins {
> >>> +		pinctrl-single,pins = <
> >>> +			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
> >>> +			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
> >>> +			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
> >>> +			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
> >>> +			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
> >>> +			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
> >>> +			0x120 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat4.sdmmc1_dat4 */
> >>> +			0x122 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat5.sdmmc1_dat5 */
> >>> +			0x124 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat6.sdmmc1_dat6 */
> >>> +			0x126 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat7.sdmmc1_dat7 */
> >>
> >> The dat{4,5,6,7} pins are not used either on cm-t3530, or cm-t3730.
> > 
> > But it seems to work and makes MMC1 faster :) Might be worth checking
> > though, maybe those pins have multiple optional routings available?
> 
> They are routed to the connector of the base board and then...
> just not connected...
> Interesting, how that can make the MMC1 faster? Are you sure?
 
Nope :) I did a read test with dd, no difference in speed. So they
must not be connected like you said. It's weird that MMC works
at all with bus-width = <8> though, go figure..
  
> >>> +	mmc2_pins: pinmux_mmc2_pins {
> >>> +		pinctrl-single,pins = <
> >>> +			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
> >>> +			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
> >>> +			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
> >>> +			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
> >>> +			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
> >>> +			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
> >>
> >> Here the following is missing:
> >> 0x134 (PIN_OUTPUT | MUX_MODE1)	/* sdmmc2_dat4.sdmmc2_dir_dat0 */
> > 
> > That seems to be used for the wl12xx GPIO, so it's listed at
> > wl12xx_gpio below.
> 
> Yes, but only on cm-t3730 (and actually starting from revision 1.2),
> not cm-t3530...

Sounds like that needs another set of .dts files, or patching in the
bootloader. 
 
> >>> +			0x136 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat5.sdmmc2_dir_dat1 */
> >>> +			0x138 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat6.sdmmc2_dir_cmd */
> >>> +			0x13a (PIN_INPUT | MUX_MODE1)		/* sdmmc2_dat7.sdmmc2_clkin */
> >>
> >> All four above pins (dat{4,5,6,7}) should be muxed only on cm-t3530.
> >> cm-t3730 uses the sdmmc2_dat4 (gpio136) for wl12xx irq,
> >> and does nor use the rest (dat{5,6,7}) at all.
> > 
> > Hmm OK, maybe those extra pins also have alternative routings available?
> 
> The same as with MMC1, they are routed to the connector and
> not routed at all on sb-t35.

Left out the extra mmc2 pins too. 
 
> >>> +	wl12xx_gpio: pinmux_wl12xx_gpio {
> >>> +		pinctrl-single,pins = <
> >>> +			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
> >>> +			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
> >>> +		>;
> >>> +	};
> >>> +};

And I added pdata-quirks.c support for dealing with the TWL GPIO for now.

Regards,

Tony

8< ----------------------------------
From: Tony Lindgren <tony@atomide.com>
Date: Tue, 10 Dec 2013 15:03:34 -0800
Subject: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730

This adds support for CompuLab SBC-T3530, also known as cm-t3730:

http://compulab.co.il/products/sbcs/sbc-t3530/

It seems that with the sbc-3xxx mainboard is also used on
SBC-T3517 and SBC-T3730 with just a different CPU module:

http://compulab.co.il/products/sbcs/sbc-t3517/
http://compulab.co.il/products/sbcs/sbc-t3730/

So let's add a common omap3-sb-t35.dtsi and then separate SoC
specific omap3-sbc-t3730.dts, omap3-sbc-t3530.dts and
omap3-sbc-t3517.dts.

I've tested this with SBC-T3730 as that's the only one I have.
At least serial, both Ethernet controllers, MMC, and wl12xx WLAN
work.

Note that WLAN seems to be different for SBC-T3530. And SBC-T3517
may need some changes for the EMAC Ethernet if that's used
instead of the smsc911x.

Cc: devicetree@vger.kernel.org
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index fc37bca..b7af502 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -179,6 +179,8 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
 	omap2420-n810-wimax.dtb \
 	omap3430-sdp.dtb \
 	omap3-beagle.dtb \
+	omap3-cm-t3730.dtb \
+	omap3-sbc-t3730.dtb \
 	omap3-devkit8000.dtb \
 	omap3-beagle-xm.dtb \
 	omap3-evm.dtb \
diff --git a/arch/arm/boot/dts/omap3-cm-t3730.dts b/arch/arm/boot/dts/omap3-cm-t3730.dts
new file mode 100644
index 0000000..80cf668
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-cm-t3730.dts
@@ -0,0 +1,105 @@
+/*
+ * Support for CompuLab CM-T3730
+ */
+/dts-v1/;
+
+#include "omap36xx.dtsi"
+#include "omap3-cm-t3x30.dtsi"
+
+/ {
+	model = "CompuLab CM-T3730";
+	compatible = "compulab,omap3-cm-t3730", "ti,omap36xx", "ti,omap3";
+
+	wl12xx_vmmc2: wl12xx_vmmc2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vw1271";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl12xx_gpio>;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		gpio = <&gpio3 9 GPIO_ACTIVE_HIGH>;   /* gpio73 */
+		startup-delay-us = <20000>;
+		enable-active-high;
+	};
+
+	wl12xx_vaux2: wl12xx_vaux2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vwl1271_vaux2";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vaux2>;
+	};
+};
+
+&omap3_pmx_core {
+	mmc1_pins: pinmux_mmc1_pins {
+		pinctrl-single,pins = <
+			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
+			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
+			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
+			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
+			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
+			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
+		>;
+	};
+
+	mmc2_pins: pinmux_mmc2_pins {
+		pinctrl-single,pins = <
+			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
+			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
+			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
+			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
+			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
+			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
+		>;
+	};
+
+	smsc1_pins: pinmux_smsc1_pins {
+		pinctrl-single,pins = <
+			0x88 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs5.gpmc_ncs5 */
+			0x16a (PIN_INPUT_PULLUP | MUX_MODE4)	/* uart3_cts_rctx.gpio_163 */
+		>;
+	};
+
+	uart3_pins: pinmux_uart3_pins {
+		pinctrl-single,pins = <
+			0x16e (PIN_INPUT | MUX_MODE0)		/* uart3_rx_irrx.uart3_rx_irrx */
+			0x170 (PIN_OUTPUT | MUX_MODE0)		/* uart3_tx_irtx.uart3_tx_irtx */
+		>;
+	};
+
+	wl12xx_gpio: pinmux_wl12xx_gpio {
+		pinctrl-single,pins = <
+			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
+			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
+		>;
+	};
+};
+
+&mmc1 {
+	vmmc-supply = <&vmmc1>;
+	vmmc_aux-supply = <&vsim>;
+	bus-width = <4>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+};
+
+&mmc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_pins>;
+	vmmc-supply = <&wl12xx_vmmc2>;
+	vmmc_aux-supply = <&wl12xx_vaux2>;
+	non-removable;
+	bus-width = <4>;
+	cap-power-off-card;
+};
+
+&smsc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&smsc1_pins>;
+};
+
+&uart3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart3_pins>;
+};
diff --git a/arch/arm/boot/dts/omap3-cm-t3x30.dtsi b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
new file mode 100644
index 0000000..bf1b72c
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
@@ -0,0 +1,95 @@
+/*
+ * Common support for CompuLab CM-T3530 and  CM-T3730
+ */
+
+/ {
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x10000000>; /* 256 MB */
+	};
+
+	cpus {
+		cpu@0 {
+			cpu0-supply = <&vcc>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		ledb {
+			label = "cm-t35:green";
+			gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>;  /* gpio186 */
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	vddvario: regulator-vddvario {
+		compatible = "regulator-fixed";
+		regulator-name = "vddvario";
+		regulator-always-on;
+	};
+
+	vdd33a: regulator-vdd33a {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd33a";
+		regulator-always-on;
+	};
+};
+
+&gpmc {
+	ranges = <5 0 0x2c000000 0x01000000>;
+
+	smsc1: ethernet@5,0 {
+		compatible = "smsc,lan9221", "smsc,lan9115";
+		interrupt-parent = <&gpio6>;
+		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+		reg = <5 0 0xff>;
+		bank-width = <2>;
+		gpmc,mux-add-data;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <186>;
+		gpmc,cs-wr-off-ns = <186>;
+		gpmc,adv-on-ns = <12>;
+		gpmc,adv-rd-off-ns = <48>;
+		gpmc,adv-wr-off-ns = <48>;
+		gpmc,oe-on-ns = <54>;
+		gpmc,oe-off-ns = <168>;
+		gpmc,we-on-ns = <54>;
+		gpmc,we-off-ns = <168>;
+		gpmc,rd-cycle-ns = <186>;
+		gpmc,wr-cycle-ns = <186>;
+		gpmc,access-ns = <114>;
+		gpmc,page-burst-access-ns = <6>;
+		gpmc,bus-turnaround-ns = <12>;
+		gpmc,cycle2cycle-delay-ns = <18>;
+		gpmc,wr-data-mux-bus-ns = <90>;
+		gpmc,wr-access-ns = <186>;
+		gpmc,cycle2cycle-samecsen;
+		gpmc,cycle2cycle-diffcsen;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
+};
+
+&i2c1 {
+	clock-frequency = <2600000>;
+
+	twl: twl@48 {
+		reg = <0x48>;
+		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
+		interrupt-parent = <&intc>;
+	};
+};
+
+#include "twl4030.dtsi"
+#include "twl4030_omap3.dtsi"
+
+&i2c3 {
+	clock-frequency = <400000>;
+};
+
+&twl_gpio {
+	ti,use-leds;
+};
diff --git a/arch/arm/boot/dts/omap3-sb-t35.dtsi b/arch/arm/boot/dts/omap3-sb-t35.dtsi
new file mode 100644
index 0000000..b9a2fed
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sb-t35.dtsi
@@ -0,0 +1,40 @@
+/*
+ * Common support for CompuLab SB-T35 used on SBC-T3530, SBC-T3517 and SBC-T3730
+ */
+
+&gpmc {
+	ranges = <4 0 0x2d000000 0x01000000>;
+
+	smsc2: ethernet@4,0 {
+		compatible = "smsc,lan9221", "smsc,lan9115";
+		interrupt-parent = <&gpio3>;
+		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
+		reg = <4 0 0xff>;
+		bank-width = <2>;
+		gpmc,mux-add-data;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <186>;
+		gpmc,cs-wr-off-ns = <186>;
+		gpmc,adv-on-ns = <12>;
+		gpmc,adv-rd-off-ns = <48>;
+		gpmc,adv-wr-off-ns = <48>;
+		gpmc,oe-on-ns = <54>;
+		gpmc,oe-off-ns = <168>;
+		gpmc,we-on-ns = <54>;
+		gpmc,we-off-ns = <168>;
+		gpmc,rd-cycle-ns = <186>;
+		gpmc,wr-cycle-ns = <186>;
+		gpmc,access-ns = <114>;
+		gpmc,page-burst-access-ns = <6>;
+		gpmc,bus-turnaround-ns = <12>;
+		gpmc,cycle2cycle-delay-ns = <18>;
+		gpmc,wr-data-mux-bus-ns = <90>;
+		gpmc,wr-access-ns = <186>;
+		gpmc,cycle2cycle-samecsen;
+		gpmc,cycle2cycle-diffcsen;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
+};
diff --git a/arch/arm/boot/dts/omap3-sbc-t3730.dts b/arch/arm/boot/dts/omap3-sbc-t3730.dts
new file mode 100644
index 0000000..c119bd5
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sbc-t3730.dts
@@ -0,0 +1,30 @@
+/*
+ * Suppport for CompuLab SBC-T3730 with CM-T3730
+ */
+
+#include "omap3-cm-t3730.dts"
+#include "omap3-sb-t35.dtsi"
+
+/ {
+	model = "CompuLab SBC-T3730 with CM-T3730";
+	compatible = "compulab,omap3-sbc-t3730", "compulab,omap3-cm-t3730", "ti,omap36xx", "ti,omap3";
+};
+
+&gpmc {
+	ranges = <5 0 0x2c000000 0x01000000>,
+		 <4 0 0x2d000000 0x01000000>;
+};
+
+&smsc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&smsc2_pins>;
+};
+
+&omap3_pmx_core {
+	smsc2_pins: pinmux_smsc2_pins {
+		pinctrl-single,pins = <
+			0x86 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs4.gpmc_ncs4 */
+			0xa2 (PIN_INPUT_PULLUP | MUX_MODE4)	/* gpmc_wait3.gpio_65 */
+		>;
+	};
+};
\ No newline at end of file
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 78c6233..6cc7521 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -93,6 +93,33 @@ static void __init hsmmc2_internal_input_clk(void)
 	omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
 }
 
+static int omap3_sbc_t3730_twl_callback(struct device *dev,
+					   unsigned gpio,
+					   unsigned ngpio)
+{
+	int res;
+
+	res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
+			       "wlan rst");
+	if (res)
+		return res;
+
+	gpio_export(gpio, 0);
+
+	return 0;
+}
+
+static void __init omap3_sbc_t3730_twl_init(void)
+{
+	twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
+}
+
+static void __init omap3_sbc_t3730_legacy_init(void)
+{
+	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
+	omap_ads7846_init(1, 57, 0, NULL);
+}
+
 static void __init omap3_igep0020_legacy_init(void)
 {
 	omap3_igep2_display_init_of();
@@ -201,6 +228,9 @@ static struct pdata_init auxdata_quirks[] __initdata = {
 	{ "nokia,n810", omap2420_n8x0_legacy_init, },
 	{ "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
 #endif
+#ifdef CONFIG_ARCH_OMAP3
+	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, },
+#endif
 	{ /* sentinel */ },
 };
 
@@ -229,6 +259,7 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
  */
 static struct pdata_init pdata_quirks[] __initdata = {
 #ifdef CONFIG_ARCH_OMAP3
+	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
 	{ "nokia,omap3-n900", hsmmc2_internal_input_clk, },
 	{ "nokia,omap3-n9", hsmmc2_internal_input_clk, },
 	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
@ 2013-12-17 19:31         ` Tony Lindgren
  0 siblings, 0 replies; 18+ messages in thread
From: Tony Lindgren @ 2013-12-17 19:31 UTC (permalink / raw)
  To: linux-arm-kernel

* Igor Grinberg <grinberg@compulab.co.il> [131216 23:16]:
> On 12/16/13 21:17, Tony Lindgren wrote:
> > * Igor Grinberg <grinberg@compulab.co.il> [131216 05:57]:
> >> On 12/13/13 21:22, Tony Lindgren wrote:
>
> Ok. So what do you think, is it fine to have something like:
> omap3-cm-t3x.dtsi		- common to cm-t3x cpu boards
> omap3-cm-t3x30.dtsi		- common to cm-t3730 and cm-t3530
> omap3-cm-t3730.dtsi		- cm-t3730 specific
> omap3-cm-t3530.dtsi		- cm-t3530 specific
> omap3-cm-t3517.dtsi		- cm-t3517 specific
> omap3-sb-t35.dtsi		- sb-t35 specific
> omap3-cb-t3.dtsi		- cb-t3 specific
> omap3-sbc-t3730-256mb.dts	- sb-t35 with cm-t3730 and 256MB memory size
> omap3-sbc-t3730-128mb.dts	- sb-t35 with cm-t3730 and 128MB memory size
> omap3-sbc-t3730-64mb.dts	- sb-t35 with cm-t3730 and 64MB memory size
> omap3-sbc-t3530-256mb.dts	- sb-t35 with cm-t3530 and 256MB memory size
> omap3-sbc-t3530-128mb.dts	- sb-t35 with cm-t3530 and 128MB memory size
> omap3-sbc-t3530-64mb.dts	- sb-t35 with cm-t3530 and 64MB memory size
> omap3-sbc-t3517-256mb.dts	- sb-t35 with cm-t3517 and 256MB memory size
> omap3-sbc-t3517-128mb.dts	- sb-t35 with cm-t3517 and 128MB memory size
> omap3-em-t3730-256mb.dts	- cb-t3 with cm-t3730 and 256MB memory size
> omap3-em-t3730-128mb.dts	- cb-t3 with cm-t3730 and 128MB memory size
> omap3-em-t3730-64mb.dts		- cb-t3 with cm-t3730 and 64MB memory size
> omap3-em-t3530-256mb.dts	- cb-t3 with cm-t3530 and 256MB memory size
> omap3-em-t3530-128mb.dts	- cb-t3 with cm-t3530 and 128MB memory size
> omap3-em-t3530-64mb.dts		- cb-t3 with cm-t3530 and 64MB memory size
> 
> or is it too much... ;-)))
> The above gives the full coverage of the 2x3 boards.

Yeah probably best to patch in the size of the RAM in u-boot :)
 
> I think we can drop the different memory sizes and
> let boot loader adjust the blob. This will make the list shorter:
> omap3-cm-t3x.dtsi	- common to cm-t3x cpu boards
> omap3-cm-t3x30.dtsi	- common to cm-t3730 and cm-t3530
> omap3-cm-t3730.dtsi	- cm-t3730 specific
> omap3-cm-t3530.dtsi	- cm-t3530 specific
> omap3-cm-t3517.dtsi	- cm-t3517 specific
> omap3-sb-t35.dtsi	- sb-t35 specific
> omap3-cb-t3.dtsi	- cb-t3 specific
> omap3-sbc-t3730.dts	- sb-t35 with cm-t3730 and default memory size
> omap3-sbc-t3530.dts	- sb-t35 with cm-t3530 and default memory size
> omap3-sbc-t3517.dts	- sb-t35 with cm-t3517 and default memory size
> omap3-em-t3730.dts	- cb-t3 with cm-t3730 and default memory size
> omap3-em-t3530.dts	- cb-t3 with cm-t3530 and default memory size
> 
> So what do you think?
 
Makes sense to me. I've updated the patch below to use the following:

omap3-cm-t3x30.dtsi	- common to cm-t3730 and cm-t3530
omap3-cm-t3730.dts	- cm-t3730 specific, should work on it's own too, not a .dtsi
omap3-sb-t35.dtsi	- sb-t35 specific
omap3-sbc-t3730.dts	- sb-t35 with cm-t3730 and default memory size

So the only changes compared to your naming are to not use .dtsi
extension for omap3-cm-t3730.dts, and I did not add omap3-cm-t3x.dtsi
as I don't know the details.

It's probably best that you guys take over this patch from here and
add omap3-cm-t3x30.dtsi if needed.

I got the basic stuff working for what I need right now for my router
to work, which is MMC, both Ethernet controllers and wl12xx. So I'm
not going to tweak this patch further. Of course having the battery
charging working would be nice for a router to have a backup battery :)

There are still some issues I've noticed:

1. Removing and reinserting the wl12xx modules seems to kill the
   WLAN

2. Ethernet interfaces only come up if there's a cable connected
  
> >>> +	mmc1_pins: pinmux_mmc1_pins {
> >>> +		pinctrl-single,pins = <
> >>> +			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
> >>> +			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
> >>> +			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
> >>> +			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
> >>> +			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
> >>> +			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
> >>> +			0x120 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat4.sdmmc1_dat4 */
> >>> +			0x122 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat5.sdmmc1_dat5 */
> >>> +			0x124 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat6.sdmmc1_dat6 */
> >>> +			0x126 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat7.sdmmc1_dat7 */
> >>
> >> The dat{4,5,6,7} pins are not used either on cm-t3530, or cm-t3730.
> > 
> > But it seems to work and makes MMC1 faster :) Might be worth checking
> > though, maybe those pins have multiple optional routings available?
> 
> They are routed to the connector of the base board and then...
> just not connected...
> Interesting, how that can make the MMC1 faster? Are you sure?
 
Nope :) I did a read test with dd, no difference in speed. So they
must not be connected like you said. It's weird that MMC works
at all with bus-width = <8> though, go figure..
  
> >>> +	mmc2_pins: pinmux_mmc2_pins {
> >>> +		pinctrl-single,pins = <
> >>> +			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
> >>> +			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
> >>> +			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
> >>> +			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
> >>> +			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
> >>> +			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
> >>
> >> Here the following is missing:
> >> 0x134 (PIN_OUTPUT | MUX_MODE1)	/* sdmmc2_dat4.sdmmc2_dir_dat0 */
> > 
> > That seems to be used for the wl12xx GPIO, so it's listed at
> > wl12xx_gpio below.
> 
> Yes, but only on cm-t3730 (and actually starting from revision 1.2),
> not cm-t3530...

Sounds like that needs another set of .dts files, or patching in the
bootloader. 
 
> >>> +			0x136 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat5.sdmmc2_dir_dat1 */
> >>> +			0x138 (PIN_OUTPUT | MUX_MODE1)		/* sdmmc2_dat6.sdmmc2_dir_cmd */
> >>> +			0x13a (PIN_INPUT | MUX_MODE1)		/* sdmmc2_dat7.sdmmc2_clkin */
> >>
> >> All four above pins (dat{4,5,6,7}) should be muxed only on cm-t3530.
> >> cm-t3730 uses the sdmmc2_dat4 (gpio136) for wl12xx irq,
> >> and does nor use the rest (dat{5,6,7}) at all.
> > 
> > Hmm OK, maybe those extra pins also have alternative routings available?
> 
> The same as with MMC1, they are routed to the connector and
> not routed at all on sb-t35.

Left out the extra mmc2 pins too. 
 
> >>> +	wl12xx_gpio: pinmux_wl12xx_gpio {
> >>> +		pinctrl-single,pins = <
> >>> +			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
> >>> +			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
> >>> +		>;
> >>> +	};
> >>> +};

And I added pdata-quirks.c support for dealing with the TWL GPIO for now.

Regards,

Tony

8< ----------------------------------
From: Tony Lindgren <tony@atomide.com>
Date: Tue, 10 Dec 2013 15:03:34 -0800
Subject: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730

This adds support for CompuLab SBC-T3530, also known as cm-t3730:

http://compulab.co.il/products/sbcs/sbc-t3530/

It seems that with the sbc-3xxx mainboard is also used on
SBC-T3517 and SBC-T3730 with just a different CPU module:

http://compulab.co.il/products/sbcs/sbc-t3517/
http://compulab.co.il/products/sbcs/sbc-t3730/

So let's add a common omap3-sb-t35.dtsi and then separate SoC
specific omap3-sbc-t3730.dts, omap3-sbc-t3530.dts and
omap3-sbc-t3517.dts.

I've tested this with SBC-T3730 as that's the only one I have.
At least serial, both Ethernet controllers, MMC, and wl12xx WLAN
work.

Note that WLAN seems to be different for SBC-T3530. And SBC-T3517
may need some changes for the EMAC Ethernet if that's used
instead of the smsc911x.

Cc: devicetree at vger.kernel.org
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index fc37bca..b7af502 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -179,6 +179,8 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
 	omap2420-n810-wimax.dtb \
 	omap3430-sdp.dtb \
 	omap3-beagle.dtb \
+	omap3-cm-t3730.dtb \
+	omap3-sbc-t3730.dtb \
 	omap3-devkit8000.dtb \
 	omap3-beagle-xm.dtb \
 	omap3-evm.dtb \
diff --git a/arch/arm/boot/dts/omap3-cm-t3730.dts b/arch/arm/boot/dts/omap3-cm-t3730.dts
new file mode 100644
index 0000000..80cf668
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-cm-t3730.dts
@@ -0,0 +1,105 @@
+/*
+ * Support for CompuLab CM-T3730
+ */
+/dts-v1/;
+
+#include "omap36xx.dtsi"
+#include "omap3-cm-t3x30.dtsi"
+
+/ {
+	model = "CompuLab CM-T3730";
+	compatible = "compulab,omap3-cm-t3730", "ti,omap36xx", "ti,omap3";
+
+	wl12xx_vmmc2: wl12xx_vmmc2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vw1271";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl12xx_gpio>;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		gpio = <&gpio3 9 GPIO_ACTIVE_HIGH>;   /* gpio73 */
+		startup-delay-us = <20000>;
+		enable-active-high;
+	};
+
+	wl12xx_vaux2: wl12xx_vaux2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vwl1271_vaux2";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vaux2>;
+	};
+};
+
+&omap3_pmx_core {
+	mmc1_pins: pinmux_mmc1_pins {
+		pinctrl-single,pins = <
+			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
+			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
+			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
+			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
+			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
+			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
+		>;
+	};
+
+	mmc2_pins: pinmux_mmc2_pins {
+		pinctrl-single,pins = <
+			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
+			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
+			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
+			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
+			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
+			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
+		>;
+	};
+
+	smsc1_pins: pinmux_smsc1_pins {
+		pinctrl-single,pins = <
+			0x88 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs5.gpmc_ncs5 */
+			0x16a (PIN_INPUT_PULLUP | MUX_MODE4)	/* uart3_cts_rctx.gpio_163 */
+		>;
+	};
+
+	uart3_pins: pinmux_uart3_pins {
+		pinctrl-single,pins = <
+			0x16e (PIN_INPUT | MUX_MODE0)		/* uart3_rx_irrx.uart3_rx_irrx */
+			0x170 (PIN_OUTPUT | MUX_MODE0)		/* uart3_tx_irtx.uart3_tx_irtx */
+		>;
+	};
+
+	wl12xx_gpio: pinmux_wl12xx_gpio {
+		pinctrl-single,pins = <
+			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
+			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
+		>;
+	};
+};
+
+&mmc1 {
+	vmmc-supply = <&vmmc1>;
+	vmmc_aux-supply = <&vsim>;
+	bus-width = <4>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+};
+
+&mmc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_pins>;
+	vmmc-supply = <&wl12xx_vmmc2>;
+	vmmc_aux-supply = <&wl12xx_vaux2>;
+	non-removable;
+	bus-width = <4>;
+	cap-power-off-card;
+};
+
+&smsc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&smsc1_pins>;
+};
+
+&uart3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart3_pins>;
+};
diff --git a/arch/arm/boot/dts/omap3-cm-t3x30.dtsi b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
new file mode 100644
index 0000000..bf1b72c
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
@@ -0,0 +1,95 @@
+/*
+ * Common support for CompuLab CM-T3530 and  CM-T3730
+ */
+
+/ {
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x10000000>; /* 256 MB */
+	};
+
+	cpus {
+		cpu at 0 {
+			cpu0-supply = <&vcc>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		ledb {
+			label = "cm-t35:green";
+			gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>;  /* gpio186 */
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	vddvario: regulator-vddvario {
+		compatible = "regulator-fixed";
+		regulator-name = "vddvario";
+		regulator-always-on;
+	};
+
+	vdd33a: regulator-vdd33a {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd33a";
+		regulator-always-on;
+	};
+};
+
+&gpmc {
+	ranges = <5 0 0x2c000000 0x01000000>;
+
+	smsc1: ethernet at 5,0 {
+		compatible = "smsc,lan9221", "smsc,lan9115";
+		interrupt-parent = <&gpio6>;
+		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+		reg = <5 0 0xff>;
+		bank-width = <2>;
+		gpmc,mux-add-data;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <186>;
+		gpmc,cs-wr-off-ns = <186>;
+		gpmc,adv-on-ns = <12>;
+		gpmc,adv-rd-off-ns = <48>;
+		gpmc,adv-wr-off-ns = <48>;
+		gpmc,oe-on-ns = <54>;
+		gpmc,oe-off-ns = <168>;
+		gpmc,we-on-ns = <54>;
+		gpmc,we-off-ns = <168>;
+		gpmc,rd-cycle-ns = <186>;
+		gpmc,wr-cycle-ns = <186>;
+		gpmc,access-ns = <114>;
+		gpmc,page-burst-access-ns = <6>;
+		gpmc,bus-turnaround-ns = <12>;
+		gpmc,cycle2cycle-delay-ns = <18>;
+		gpmc,wr-data-mux-bus-ns = <90>;
+		gpmc,wr-access-ns = <186>;
+		gpmc,cycle2cycle-samecsen;
+		gpmc,cycle2cycle-diffcsen;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
+};
+
+&i2c1 {
+	clock-frequency = <2600000>;
+
+	twl: twl at 48 {
+		reg = <0x48>;
+		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
+		interrupt-parent = <&intc>;
+	};
+};
+
+#include "twl4030.dtsi"
+#include "twl4030_omap3.dtsi"
+
+&i2c3 {
+	clock-frequency = <400000>;
+};
+
+&twl_gpio {
+	ti,use-leds;
+};
diff --git a/arch/arm/boot/dts/omap3-sb-t35.dtsi b/arch/arm/boot/dts/omap3-sb-t35.dtsi
new file mode 100644
index 0000000..b9a2fed
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sb-t35.dtsi
@@ -0,0 +1,40 @@
+/*
+ * Common support for CompuLab SB-T35 used on SBC-T3530, SBC-T3517 and SBC-T3730
+ */
+
+&gpmc {
+	ranges = <4 0 0x2d000000 0x01000000>;
+
+	smsc2: ethernet at 4,0 {
+		compatible = "smsc,lan9221", "smsc,lan9115";
+		interrupt-parent = <&gpio3>;
+		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
+		reg = <4 0 0xff>;
+		bank-width = <2>;
+		gpmc,mux-add-data;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <186>;
+		gpmc,cs-wr-off-ns = <186>;
+		gpmc,adv-on-ns = <12>;
+		gpmc,adv-rd-off-ns = <48>;
+		gpmc,adv-wr-off-ns = <48>;
+		gpmc,oe-on-ns = <54>;
+		gpmc,oe-off-ns = <168>;
+		gpmc,we-on-ns = <54>;
+		gpmc,we-off-ns = <168>;
+		gpmc,rd-cycle-ns = <186>;
+		gpmc,wr-cycle-ns = <186>;
+		gpmc,access-ns = <114>;
+		gpmc,page-burst-access-ns = <6>;
+		gpmc,bus-turnaround-ns = <12>;
+		gpmc,cycle2cycle-delay-ns = <18>;
+		gpmc,wr-data-mux-bus-ns = <90>;
+		gpmc,wr-access-ns = <186>;
+		gpmc,cycle2cycle-samecsen;
+		gpmc,cycle2cycle-diffcsen;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
+};
diff --git a/arch/arm/boot/dts/omap3-sbc-t3730.dts b/arch/arm/boot/dts/omap3-sbc-t3730.dts
new file mode 100644
index 0000000..c119bd5
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sbc-t3730.dts
@@ -0,0 +1,30 @@
+/*
+ * Suppport for CompuLab SBC-T3730 with CM-T3730
+ */
+
+#include "omap3-cm-t3730.dts"
+#include "omap3-sb-t35.dtsi"
+
+/ {
+	model = "CompuLab SBC-T3730 with CM-T3730";
+	compatible = "compulab,omap3-sbc-t3730", "compulab,omap3-cm-t3730", "ti,omap36xx", "ti,omap3";
+};
+
+&gpmc {
+	ranges = <5 0 0x2c000000 0x01000000>,
+		 <4 0 0x2d000000 0x01000000>;
+};
+
+&smsc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&smsc2_pins>;
+};
+
+&omap3_pmx_core {
+	smsc2_pins: pinmux_smsc2_pins {
+		pinctrl-single,pins = <
+			0x86 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs4.gpmc_ncs4 */
+			0xa2 (PIN_INPUT_PULLUP | MUX_MODE4)	/* gpmc_wait3.gpio_65 */
+		>;
+	};
+};
\ No newline at end of file
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 78c6233..6cc7521 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -93,6 +93,33 @@ static void __init hsmmc2_internal_input_clk(void)
 	omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
 }
 
+static int omap3_sbc_t3730_twl_callback(struct device *dev,
+					   unsigned gpio,
+					   unsigned ngpio)
+{
+	int res;
+
+	res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
+			       "wlan rst");
+	if (res)
+		return res;
+
+	gpio_export(gpio, 0);
+
+	return 0;
+}
+
+static void __init omap3_sbc_t3730_twl_init(void)
+{
+	twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
+}
+
+static void __init omap3_sbc_t3730_legacy_init(void)
+{
+	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
+	omap_ads7846_init(1, 57, 0, NULL);
+}
+
 static void __init omap3_igep0020_legacy_init(void)
 {
 	omap3_igep2_display_init_of();
@@ -201,6 +228,9 @@ static struct pdata_init auxdata_quirks[] __initdata = {
 	{ "nokia,n810", omap2420_n8x0_legacy_init, },
 	{ "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
 #endif
+#ifdef CONFIG_ARCH_OMAP3
+	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, },
+#endif
 	{ /* sentinel */ },
 };
 
@@ -229,6 +259,7 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
  */
 static struct pdata_init pdata_quirks[] __initdata = {
 #ifdef CONFIG_ARCH_OMAP3
+	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
 	{ "nokia,omap3-n900", hsmmc2_internal_input_clk, },
 	{ "nokia,omap3-n9", hsmmc2_internal_input_clk, },
 	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
  2013-12-17 19:31         ` Tony Lindgren
@ 2013-12-18  8:45           ` Igor Grinberg
  -1 siblings, 0 replies; 18+ messages in thread
From: Igor Grinberg @ 2013-12-18  8:45 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-arm-kernel, linux-omap, devicetree, Dmitry Lifshitz,
	Nikita Kiryanov

On 12/17/13 21:31, Tony Lindgren wrote:
> * Igor Grinberg <grinberg@compulab.co.il> [131216 23:16]:
>> On 12/16/13 21:17, Tony Lindgren wrote:
>>> * Igor Grinberg <grinberg@compulab.co.il> [131216 05:57]:
>>>> On 12/13/13 21:22, Tony Lindgren wrote:

[...]

>  
>> I think we can drop the different memory sizes and
>> let boot loader adjust the blob. This will make the list shorter:
>> omap3-cm-t3x.dtsi	- common to cm-t3x cpu boards
>> omap3-cm-t3x30.dtsi	- common to cm-t3730 and cm-t3530
>> omap3-cm-t3730.dtsi	- cm-t3730 specific
>> omap3-cm-t3530.dtsi	- cm-t3530 specific
>> omap3-cm-t3517.dtsi	- cm-t3517 specific
>> omap3-sb-t35.dtsi	- sb-t35 specific
>> omap3-cb-t3.dtsi	- cb-t3 specific
>> omap3-sbc-t3730.dts	- sb-t35 with cm-t3730 and default memory size
>> omap3-sbc-t3530.dts	- sb-t35 with cm-t3530 and default memory size
>> omap3-sbc-t3517.dts	- sb-t35 with cm-t3517 and default memory size
>> omap3-em-t3730.dts	- cb-t3 with cm-t3730 and default memory size
>> omap3-em-t3530.dts	- cb-t3 with cm-t3530 and default memory size
>>
>> So what do you think?
>  
> Makes sense to me. I've updated the patch below to use the following:
> 
> omap3-cm-t3x30.dtsi	- common to cm-t3730 and cm-t3530
> omap3-cm-t3730.dts	- cm-t3730 specific, should work on it's own too, not a .dtsi
> omap3-sb-t35.dtsi	- sb-t35 specific
> omap3-sbc-t3730.dts	- sb-t35 with cm-t3730 and default memory size
> 
> So the only changes compared to your naming are to not use .dtsi
> extension for omap3-cm-t3730.dts, and I did not add omap3-cm-t3x.dtsi
> as I don't know the details.

Ok.

> 
> It's probably best that you guys take over this patch from here and
> add omap3-cm-t3x30.dtsi if needed.

Ok.

> 
> I got the basic stuff working for what I need right now for my router
> to work, which is MMC, both Ethernet controllers and wl12xx. So I'm
> not going to tweak this patch further. Of course having the battery
> charging working would be nice for a router to have a backup battery :)
> 
> There are still some issues I've noticed:
> 
> 1. Removing and reinserting the wl12xx modules seems to kill the
>    WLAN
> 
> 2. Ethernet interfaces only come up if there's a cable connected

I see. Ok then, we'll try to figure those things out.

[...]

>>>>> +	mmc2_pins: pinmux_mmc2_pins {
>>>>> +		pinctrl-single,pins = <
>>>>> +			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
>>>>> +			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
>>>>> +			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
>>>>> +			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
>>>>> +			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
>>>>> +			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
>>>>
>>>> Here the following is missing:
>>>> 0x134 (PIN_OUTPUT | MUX_MODE1)	/* sdmmc2_dat4.sdmmc2_dir_dat0 */
>>>
>>> That seems to be used for the wl12xx GPIO, so it's listed at
>>> wl12xx_gpio below.
>>
>> Yes, but only on cm-t3730 (and actually starting from revision 1.2),
>> not cm-t3530...
> 
> Sounds like that needs another set of .dts files, or patching in the
> bootloader. 

Yep, IMO, .dts will be better, as I think pinmux is something
the kernel should be aware of...

[...]

> 8< ----------------------------------
> From: Tony Lindgren <tony@atomide.com>
> Date: Tue, 10 Dec 2013 15:03:34 -0800
> Subject: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
> 
> This adds support for CompuLab SBC-T3530, also known as cm-t3730:
> 
> http://compulab.co.il/products/sbcs/sbc-t3530/
> 
> It seems that with the sbc-3xxx mainboard is also used on
> SBC-T3517 and SBC-T3730 with just a different CPU module:
> 
> http://compulab.co.il/products/sbcs/sbc-t3517/
> http://compulab.co.il/products/sbcs/sbc-t3730/
> 
> So let's add a common omap3-sb-t35.dtsi and then separate SoC
> specific omap3-sbc-t3730.dts, omap3-sbc-t3530.dts and
> omap3-sbc-t3517.dts.
> 
> I've tested this with SBC-T3730 as that's the only one I have.
> At least serial, both Ethernet controllers, MMC, and wl12xx WLAN
> work.
> 
> Note that WLAN seems to be different for SBC-T3530. And SBC-T3517
> may need some changes for the EMAC Ethernet if that's used
> instead of the smsc911x.
> 
> Cc: devicetree@vger.kernel.org
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Cc: Mike Rapoport <mike@compulab.co.il>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Acked-by: Igor Grinberg <grinberg@compulab.co.il>

This one looks great!
Really minor comments below (we can fix those later)

[...]

> diff --git a/arch/arm/boot/dts/omap3-cm-t3730.dts b/arch/arm/boot/dts/omap3-cm-t3730.dts
> new file mode 100644
> index 0000000..80cf668
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap3-cm-t3730.dts

[...]

> +&mmc1 {
> +	vmmc-supply = <&vmmc1>;
> +	vmmc_aux-supply = <&vsim>;

vsim is not present in TPS65930...
can be just left empty or set to a fixed voltage regulator.

> +	bus-width = <4>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc1_pins>;
> +};

[...]

> diff --git a/arch/arm/boot/dts/omap3-cm-t3x30.dtsi b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
> new file mode 100644
> index 0000000..bf1b72c
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi

[...]

> +&i2c1 {
> +	clock-frequency = <2600000>;

There is also an EEPROM on this bus, although we still don't
have it registered in the dts, but it can be registered from
userspace and is also accessible using i2c-tools.
This should be 400KHz max for the EEPROM to work.

> +
> +	twl: twl@48 {
> +		reg = <0x48>;
> +		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
> +		interrupt-parent = <&intc>;
> +	};
> +};

[...]


-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
@ 2013-12-18  8:45           ` Igor Grinberg
  0 siblings, 0 replies; 18+ messages in thread
From: Igor Grinberg @ 2013-12-18  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

On 12/17/13 21:31, Tony Lindgren wrote:
> * Igor Grinberg <grinberg@compulab.co.il> [131216 23:16]:
>> On 12/16/13 21:17, Tony Lindgren wrote:
>>> * Igor Grinberg <grinberg@compulab.co.il> [131216 05:57]:
>>>> On 12/13/13 21:22, Tony Lindgren wrote:

[...]

>  
>> I think we can drop the different memory sizes and
>> let boot loader adjust the blob. This will make the list shorter:
>> omap3-cm-t3x.dtsi	- common to cm-t3x cpu boards
>> omap3-cm-t3x30.dtsi	- common to cm-t3730 and cm-t3530
>> omap3-cm-t3730.dtsi	- cm-t3730 specific
>> omap3-cm-t3530.dtsi	- cm-t3530 specific
>> omap3-cm-t3517.dtsi	- cm-t3517 specific
>> omap3-sb-t35.dtsi	- sb-t35 specific
>> omap3-cb-t3.dtsi	- cb-t3 specific
>> omap3-sbc-t3730.dts	- sb-t35 with cm-t3730 and default memory size
>> omap3-sbc-t3530.dts	- sb-t35 with cm-t3530 and default memory size
>> omap3-sbc-t3517.dts	- sb-t35 with cm-t3517 and default memory size
>> omap3-em-t3730.dts	- cb-t3 with cm-t3730 and default memory size
>> omap3-em-t3530.dts	- cb-t3 with cm-t3530 and default memory size
>>
>> So what do you think?
>  
> Makes sense to me. I've updated the patch below to use the following:
> 
> omap3-cm-t3x30.dtsi	- common to cm-t3730 and cm-t3530
> omap3-cm-t3730.dts	- cm-t3730 specific, should work on it's own too, not a .dtsi
> omap3-sb-t35.dtsi	- sb-t35 specific
> omap3-sbc-t3730.dts	- sb-t35 with cm-t3730 and default memory size
> 
> So the only changes compared to your naming are to not use .dtsi
> extension for omap3-cm-t3730.dts, and I did not add omap3-cm-t3x.dtsi
> as I don't know the details.

Ok.

> 
> It's probably best that you guys take over this patch from here and
> add omap3-cm-t3x30.dtsi if needed.

Ok.

> 
> I got the basic stuff working for what I need right now for my router
> to work, which is MMC, both Ethernet controllers and wl12xx. So I'm
> not going to tweak this patch further. Of course having the battery
> charging working would be nice for a router to have a backup battery :)
> 
> There are still some issues I've noticed:
> 
> 1. Removing and reinserting the wl12xx modules seems to kill the
>    WLAN
> 
> 2. Ethernet interfaces only come up if there's a cable connected

I see. Ok then, we'll try to figure those things out.

[...]

>>>>> +	mmc2_pins: pinmux_mmc2_pins {
>>>>> +		pinctrl-single,pins = <
>>>>> +			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
>>>>> +			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
>>>>> +			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
>>>>> +			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
>>>>> +			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
>>>>> +			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
>>>>
>>>> Here the following is missing:
>>>> 0x134 (PIN_OUTPUT | MUX_MODE1)	/* sdmmc2_dat4.sdmmc2_dir_dat0 */
>>>
>>> That seems to be used for the wl12xx GPIO, so it's listed at
>>> wl12xx_gpio below.
>>
>> Yes, but only on cm-t3730 (and actually starting from revision 1.2),
>> not cm-t3530...
> 
> Sounds like that needs another set of .dts files, or patching in the
> bootloader. 

Yep, IMO, .dts will be better, as I think pinmux is something
the kernel should be aware of...

[...]

> 8< ----------------------------------
> From: Tony Lindgren <tony@atomide.com>
> Date: Tue, 10 Dec 2013 15:03:34 -0800
> Subject: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
> 
> This adds support for CompuLab SBC-T3530, also known as cm-t3730:
> 
> http://compulab.co.il/products/sbcs/sbc-t3530/
> 
> It seems that with the sbc-3xxx mainboard is also used on
> SBC-T3517 and SBC-T3730 with just a different CPU module:
> 
> http://compulab.co.il/products/sbcs/sbc-t3517/
> http://compulab.co.il/products/sbcs/sbc-t3730/
> 
> So let's add a common omap3-sb-t35.dtsi and then separate SoC
> specific omap3-sbc-t3730.dts, omap3-sbc-t3530.dts and
> omap3-sbc-t3517.dts.
> 
> I've tested this with SBC-T3730 as that's the only one I have.
> At least serial, both Ethernet controllers, MMC, and wl12xx WLAN
> work.
> 
> Note that WLAN seems to be different for SBC-T3530. And SBC-T3517
> may need some changes for the EMAC Ethernet if that's used
> instead of the smsc911x.
> 
> Cc: devicetree at vger.kernel.org
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Cc: Mike Rapoport <mike@compulab.co.il>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Acked-by: Igor Grinberg <grinberg@compulab.co.il>

This one looks great!
Really minor comments below (we can fix those later)

[...]

> diff --git a/arch/arm/boot/dts/omap3-cm-t3730.dts b/arch/arm/boot/dts/omap3-cm-t3730.dts
> new file mode 100644
> index 0000000..80cf668
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap3-cm-t3730.dts

[...]

> +&mmc1 {
> +	vmmc-supply = <&vmmc1>;
> +	vmmc_aux-supply = <&vsim>;

vsim is not present in TPS65930...
can be just left empty or set to a fixed voltage regulator.

> +	bus-width = <4>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mmc1_pins>;
> +};

[...]

> diff --git a/arch/arm/boot/dts/omap3-cm-t3x30.dtsi b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
> new file mode 100644
> index 0000000..bf1b72c
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi

[...]

> +&i2c1 {
> +	clock-frequency = <2600000>;

There is also an EEPROM on this bus, although we still don't
have it registered in the dts, but it can be registered from
userspace and is also accessible using i2c-tools.
This should be 400KHz max for the EEPROM to work.

> +
> +	twl: twl at 48 {
> +		reg = <0x48>;
> +		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
> +		interrupt-parent = <&intc>;
> +	};
> +};

[...]


-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
  2013-12-18  8:45           ` Igor Grinberg
@ 2013-12-18 21:16             ` Tony Lindgren
  -1 siblings, 0 replies; 18+ messages in thread
From: Tony Lindgren @ 2013-12-18 21:16 UTC (permalink / raw)
  To: Igor Grinberg
  Cc: linux-arm-kernel, linux-omap, devicetree, Dmitry Lifshitz,
	Nikita Kiryanov

* Igor Grinberg <grinberg@compulab.co.il> [131218 00:47]:
> 
> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
> 
> This one looks great!
> Really minor comments below (we can fix those later)

Updated patch below, then signing it off to you guys :)
 
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/omap3-cm-t3730.dts
> 
> [...]
> 
> > +&mmc1 {
> > +	vmmc-supply = <&vmmc1>;
> > +	vmmc_aux-supply = <&vsim>;
> 
> vsim is not present in TPS65930...
> can be just left empty or set to a fixed voltage regulator.

Oops right if the pins 4 - 8 are not connected, no aux regulator
is needed.
 
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
> 
> [...]
> 
> > +&i2c1 {
> > +	clock-frequency = <2600000>;
> 
> There is also an EEPROM on this bus, although we still don't
> have it registered in the dts, but it can be registered from
> userspace and is also accessible using i2c-tools.
> This should be 400KHz max for the EEPROM to work.

OK updated that too below.

I've kept your Ack as the changes were minor. If no other
comments, I will apply this into omap-for-v3.14/dt probably
on Thursday.

Regards,

Tony

8< ----------------------------
From: Tony Lindgren <tony@atomide.com>
Date: Wed, 18 Dec 2013 13:13:21 -0800
Subject: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730

This adds support for CompuLab SBC-T3530, also known as cm-t3730:

http://compulab.co.il/products/sbcs/sbc-t3530/

It seems that with the sbc-3xxx mainboard is also used on
SBC-T3517 and SBC-T3730 with just a different CPU module:

http://compulab.co.il/products/sbcs/sbc-t3517/
http://compulab.co.il/products/sbcs/sbc-t3730/

So let's add a common omap3-sb-t35.dtsi and then separate SoC
specific omap3-sbc-t3730.dts, omap3-sbc-t3530.dts and
omap3-sbc-t3517.dts.

I've tested this with SBC-T3730 as that's the only one I have.
At least serial, both Ethernet controllers, MMC, and wl12xx WLAN
work.

Note that WLAN seems to be different for SBC-T3530. And SBC-T3517
may need some changes for the EMAC Ethernet if that's used
instead of the smsc911x.

Cc: devicetree@vger.kernel.org
Cc: Mike Rapoport <mike@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index fc37bca..b7af502 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -179,6 +179,8 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
 	omap2420-n810-wimax.dtb \
 	omap3430-sdp.dtb \
 	omap3-beagle.dtb \
+	omap3-cm-t3730.dtb \
+	omap3-sbc-t3730.dtb \
 	omap3-devkit8000.dtb \
 	omap3-beagle-xm.dtb \
 	omap3-evm.dtb \
diff --git a/arch/arm/boot/dts/omap3-cm-t3730.dts b/arch/arm/boot/dts/omap3-cm-t3730.dts
new file mode 100644
index 0000000..486f4d6
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-cm-t3730.dts
@@ -0,0 +1,104 @@
+/*
+ * Support for CompuLab CM-T3730
+ */
+/dts-v1/;
+
+#include "omap36xx.dtsi"
+#include "omap3-cm-t3x30.dtsi"
+
+/ {
+	model = "CompuLab CM-T3730";
+	compatible = "compulab,omap3-cm-t3730", "ti,omap36xx", "ti,omap3";
+
+	wl12xx_vmmc2: wl12xx_vmmc2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vw1271";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl12xx_gpio>;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		gpio = <&gpio3 9 GPIO_ACTIVE_HIGH>;   /* gpio73 */
+		startup-delay-us = <20000>;
+		enable-active-high;
+	};
+
+	wl12xx_vaux2: wl12xx_vaux2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vwl1271_vaux2";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vaux2>;
+	};
+};
+
+&omap3_pmx_core {
+	mmc1_pins: pinmux_mmc1_pins {
+		pinctrl-single,pins = <
+			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
+			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
+			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
+			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
+			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
+			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
+		>;
+	};
+
+	mmc2_pins: pinmux_mmc2_pins {
+		pinctrl-single,pins = <
+			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
+			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
+			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
+			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
+			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
+			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
+		>;
+	};
+
+	smsc1_pins: pinmux_smsc1_pins {
+		pinctrl-single,pins = <
+			0x88 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs5.gpmc_ncs5 */
+			0x16a (PIN_INPUT_PULLUP | MUX_MODE4)	/* uart3_cts_rctx.gpio_163 */
+		>;
+	};
+
+	uart3_pins: pinmux_uart3_pins {
+		pinctrl-single,pins = <
+			0x16e (PIN_INPUT | MUX_MODE0)		/* uart3_rx_irrx.uart3_rx_irrx */
+			0x170 (PIN_OUTPUT | MUX_MODE0)		/* uart3_tx_irtx.uart3_tx_irtx */
+		>;
+	};
+
+	wl12xx_gpio: pinmux_wl12xx_gpio {
+		pinctrl-single,pins = <
+			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
+			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
+		>;
+	};
+};
+
+&mmc1 {
+	vmmc-supply = <&vmmc1>;
+	bus-width = <4>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+};
+
+&mmc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_pins>;
+	vmmc-supply = <&wl12xx_vmmc2>;
+	vmmc_aux-supply = <&wl12xx_vaux2>;
+	non-removable;
+	bus-width = <4>;
+	cap-power-off-card;
+};
+
+&smsc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&smsc1_pins>;
+};
+
+&uart3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart3_pins>;
+};
diff --git a/arch/arm/boot/dts/omap3-cm-t3x30.dtsi b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
new file mode 100644
index 0000000..3a9f004
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
@@ -0,0 +1,95 @@
+/*
+ * Common support for CompuLab CM-T3530 and  CM-T3730
+ */
+
+/ {
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x10000000>; /* 256 MB */
+	};
+
+	cpus {
+		cpu@0 {
+			cpu0-supply = <&vcc>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		ledb {
+			label = "cm-t35:green";
+			gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>;  /* gpio186 */
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	vddvario: regulator-vddvario {
+		compatible = "regulator-fixed";
+		regulator-name = "vddvario";
+		regulator-always-on;
+	};
+
+	vdd33a: regulator-vdd33a {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd33a";
+		regulator-always-on;
+	};
+};
+
+&gpmc {
+	ranges = <5 0 0x2c000000 0x01000000>;
+
+	smsc1: ethernet@5,0 {
+		compatible = "smsc,lan9221", "smsc,lan9115";
+		interrupt-parent = <&gpio6>;
+		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+		reg = <5 0 0xff>;
+		bank-width = <2>;
+		gpmc,mux-add-data;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <186>;
+		gpmc,cs-wr-off-ns = <186>;
+		gpmc,adv-on-ns = <12>;
+		gpmc,adv-rd-off-ns = <48>;
+		gpmc,adv-wr-off-ns = <48>;
+		gpmc,oe-on-ns = <54>;
+		gpmc,oe-off-ns = <168>;
+		gpmc,we-on-ns = <54>;
+		gpmc,we-off-ns = <168>;
+		gpmc,rd-cycle-ns = <186>;
+		gpmc,wr-cycle-ns = <186>;
+		gpmc,access-ns = <114>;
+		gpmc,page-burst-access-ns = <6>;
+		gpmc,bus-turnaround-ns = <12>;
+		gpmc,cycle2cycle-delay-ns = <18>;
+		gpmc,wr-data-mux-bus-ns = <90>;
+		gpmc,wr-access-ns = <186>;
+		gpmc,cycle2cycle-samecsen;
+		gpmc,cycle2cycle-diffcsen;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
+};
+
+&i2c1 {
+	clock-frequency = <400000>;
+
+	twl: twl@48 {
+		reg = <0x48>;
+		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
+		interrupt-parent = <&intc>;
+	};
+};
+
+#include "twl4030.dtsi"
+#include "twl4030_omap3.dtsi"
+
+&i2c3 {
+	clock-frequency = <400000>;
+};
+
+&twl_gpio {
+	ti,use-leds;
+};
diff --git a/arch/arm/boot/dts/omap3-sb-t35.dtsi b/arch/arm/boot/dts/omap3-sb-t35.dtsi
new file mode 100644
index 0000000..b9a2fed
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sb-t35.dtsi
@@ -0,0 +1,40 @@
+/*
+ * Common support for CompuLab SB-T35 used on SBC-T3530, SBC-T3517 and SBC-T3730
+ */
+
+&gpmc {
+	ranges = <4 0 0x2d000000 0x01000000>;
+
+	smsc2: ethernet@4,0 {
+		compatible = "smsc,lan9221", "smsc,lan9115";
+		interrupt-parent = <&gpio3>;
+		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
+		reg = <4 0 0xff>;
+		bank-width = <2>;
+		gpmc,mux-add-data;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <186>;
+		gpmc,cs-wr-off-ns = <186>;
+		gpmc,adv-on-ns = <12>;
+		gpmc,adv-rd-off-ns = <48>;
+		gpmc,adv-wr-off-ns = <48>;
+		gpmc,oe-on-ns = <54>;
+		gpmc,oe-off-ns = <168>;
+		gpmc,we-on-ns = <54>;
+		gpmc,we-off-ns = <168>;
+		gpmc,rd-cycle-ns = <186>;
+		gpmc,wr-cycle-ns = <186>;
+		gpmc,access-ns = <114>;
+		gpmc,page-burst-access-ns = <6>;
+		gpmc,bus-turnaround-ns = <12>;
+		gpmc,cycle2cycle-delay-ns = <18>;
+		gpmc,wr-data-mux-bus-ns = <90>;
+		gpmc,wr-access-ns = <186>;
+		gpmc,cycle2cycle-samecsen;
+		gpmc,cycle2cycle-diffcsen;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
+};
diff --git a/arch/arm/boot/dts/omap3-sbc-t3730.dts b/arch/arm/boot/dts/omap3-sbc-t3730.dts
new file mode 100644
index 0000000..c119bd5
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sbc-t3730.dts
@@ -0,0 +1,30 @@
+/*
+ * Suppport for CompuLab SBC-T3730 with CM-T3730
+ */
+
+#include "omap3-cm-t3730.dts"
+#include "omap3-sb-t35.dtsi"
+
+/ {
+	model = "CompuLab SBC-T3730 with CM-T3730";
+	compatible = "compulab,omap3-sbc-t3730", "compulab,omap3-cm-t3730", "ti,omap36xx", "ti,omap3";
+};
+
+&gpmc {
+	ranges = <5 0 0x2c000000 0x01000000>,
+		 <4 0 0x2d000000 0x01000000>;
+};
+
+&smsc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&smsc2_pins>;
+};
+
+&omap3_pmx_core {
+	smsc2_pins: pinmux_smsc2_pins {
+		pinctrl-single,pins = <
+			0x86 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs4.gpmc_ncs4 */
+			0xa2 (PIN_INPUT_PULLUP | MUX_MODE4)	/* gpmc_wait3.gpio_65 */
+		>;
+	};
+};
\ No newline at end of file
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 5aaf720..3d5b24d 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -92,6 +92,33 @@ static void __init hsmmc2_internal_input_clk(void)
 	omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
 }
 
+static int omap3_sbc_t3730_twl_callback(struct device *dev,
+					   unsigned gpio,
+					   unsigned ngpio)
+{
+	int res;
+
+	res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
+			       "wlan rst");
+	if (res)
+		return res;
+
+	gpio_export(gpio, 0);
+
+	return 0;
+}
+
+static void __init omap3_sbc_t3730_twl_init(void)
+{
+	twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
+}
+
+static void __init omap3_sbc_t3730_legacy_init(void)
+{
+	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
+	omap_ads7846_init(1, 57, 0, NULL);
+}
+
 static void __init omap3_igep0020_legacy_init(void)
 {
 	omap3_igep2_display_init_of();
@@ -200,6 +227,9 @@ static struct pdata_init auxdata_quirks[] __initdata = {
 	{ "nokia,n810", omap2420_n8x0_legacy_init, },
 	{ "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
 #endif
+#ifdef CONFIG_ARCH_OMAP3
+	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, },
+#endif
 	{ /* sentinel */ },
 };
 
@@ -228,6 +258,7 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
  */
 static struct pdata_init pdata_quirks[] __initdata = {
 #ifdef CONFIG_ARCH_OMAP3
+	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
 	{ "nokia,omap3-n900", hsmmc2_internal_input_clk, },
 	{ "nokia,omap3-n9", hsmmc2_internal_input_clk, },
 	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
@ 2013-12-18 21:16             ` Tony Lindgren
  0 siblings, 0 replies; 18+ messages in thread
From: Tony Lindgren @ 2013-12-18 21:16 UTC (permalink / raw)
  To: linux-arm-kernel

* Igor Grinberg <grinberg@compulab.co.il> [131218 00:47]:
> 
> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
> 
> This one looks great!
> Really minor comments below (we can fix those later)

Updated patch below, then signing it off to you guys :)
 
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/omap3-cm-t3730.dts
> 
> [...]
> 
> > +&mmc1 {
> > +	vmmc-supply = <&vmmc1>;
> > +	vmmc_aux-supply = <&vsim>;
> 
> vsim is not present in TPS65930...
> can be just left empty or set to a fixed voltage regulator.

Oops right if the pins 4 - 8 are not connected, no aux regulator
is needed.
 
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
> 
> [...]
> 
> > +&i2c1 {
> > +	clock-frequency = <2600000>;
> 
> There is also an EEPROM on this bus, although we still don't
> have it registered in the dts, but it can be registered from
> userspace and is also accessible using i2c-tools.
> This should be 400KHz max for the EEPROM to work.

OK updated that too below.

I've kept your Ack as the changes were minor. If no other
comments, I will apply this into omap-for-v3.14/dt probably
on Thursday.

Regards,

Tony

8< ----------------------------
From: Tony Lindgren <tony@atomide.com>
Date: Wed, 18 Dec 2013 13:13:21 -0800
Subject: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730

This adds support for CompuLab SBC-T3530, also known as cm-t3730:

http://compulab.co.il/products/sbcs/sbc-t3530/

It seems that with the sbc-3xxx mainboard is also used on
SBC-T3517 and SBC-T3730 with just a different CPU module:

http://compulab.co.il/products/sbcs/sbc-t3517/
http://compulab.co.il/products/sbcs/sbc-t3730/

So let's add a common omap3-sb-t35.dtsi and then separate SoC
specific omap3-sbc-t3730.dts, omap3-sbc-t3530.dts and
omap3-sbc-t3517.dts.

I've tested this with SBC-T3730 as that's the only one I have.
At least serial, both Ethernet controllers, MMC, and wl12xx WLAN
work.

Note that WLAN seems to be different for SBC-T3530. And SBC-T3517
may need some changes for the EMAC Ethernet if that's used
instead of the smsc911x.

Cc: devicetree at vger.kernel.org
Cc: Mike Rapoport <mike@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index fc37bca..b7af502 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -179,6 +179,8 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
 	omap2420-n810-wimax.dtb \
 	omap3430-sdp.dtb \
 	omap3-beagle.dtb \
+	omap3-cm-t3730.dtb \
+	omap3-sbc-t3730.dtb \
 	omap3-devkit8000.dtb \
 	omap3-beagle-xm.dtb \
 	omap3-evm.dtb \
diff --git a/arch/arm/boot/dts/omap3-cm-t3730.dts b/arch/arm/boot/dts/omap3-cm-t3730.dts
new file mode 100644
index 0000000..486f4d6
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-cm-t3730.dts
@@ -0,0 +1,104 @@
+/*
+ * Support for CompuLab CM-T3730
+ */
+/dts-v1/;
+
+#include "omap36xx.dtsi"
+#include "omap3-cm-t3x30.dtsi"
+
+/ {
+	model = "CompuLab CM-T3730";
+	compatible = "compulab,omap3-cm-t3730", "ti,omap36xx", "ti,omap3";
+
+	wl12xx_vmmc2: wl12xx_vmmc2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vw1271";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl12xx_gpio>;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		gpio = <&gpio3 9 GPIO_ACTIVE_HIGH>;   /* gpio73 */
+		startup-delay-us = <20000>;
+		enable-active-high;
+	};
+
+	wl12xx_vaux2: wl12xx_vaux2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vwl1271_vaux2";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vaux2>;
+	};
+};
+
+&omap3_pmx_core {
+	mmc1_pins: pinmux_mmc1_pins {
+		pinctrl-single,pins = <
+			0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* sdmmc1_clk.sdmmc1_clk */
+			0x116 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc1_cmd.sdmmc1_cmd */
+			0x118 (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat0.sdmmc1_dat0 */
+			0x11a (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat1.sdmmc1_dat1 */
+			0x11c (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat2.sdmmc1_dat2 */
+			0x11e (PIN_INPUT_PULLUP | MUX_MODE0) 	/* sdmmc1_dat3.sdmmc1_dat3 */
+		>;
+	};
+
+	mmc2_pins: pinmux_mmc2_pins {
+		pinctrl-single,pins = <
+			0x128 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_clk.sdmmc2_clk */
+			0x12a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_cmd.sdmmc2_cmd */
+			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat0.sdmmc2_dat0 */
+			0x12e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat1.sdmmc2_dat1 */
+			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat2.sdmmc2_dat2 */
+			0x132 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc2_dat3.sdmmc2_dat3 */
+		>;
+	};
+
+	smsc1_pins: pinmux_smsc1_pins {
+		pinctrl-single,pins = <
+			0x88 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs5.gpmc_ncs5 */
+			0x16a (PIN_INPUT_PULLUP | MUX_MODE4)	/* uart3_cts_rctx.gpio_163 */
+		>;
+	};
+
+	uart3_pins: pinmux_uart3_pins {
+		pinctrl-single,pins = <
+			0x16e (PIN_INPUT | MUX_MODE0)		/* uart3_rx_irrx.uart3_rx_irrx */
+			0x170 (PIN_OUTPUT | MUX_MODE0)		/* uart3_tx_irtx.uart3_tx_irtx */
+		>;
+	};
+
+	wl12xx_gpio: pinmux_wl12xx_gpio {
+		pinctrl-single,pins = <
+			0xb2 (PIN_OUTPUT | MUX_MODE4)		/* dss_data3.gpio_73 */
+			0x134 (PIN_INPUT | MUX_MODE4)		/* sdmmc2_dat4.gpio_136 */
+		>;
+	};
+};
+
+&mmc1 {
+	vmmc-supply = <&vmmc1>;
+	bus-width = <4>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+};
+
+&mmc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_pins>;
+	vmmc-supply = <&wl12xx_vmmc2>;
+	vmmc_aux-supply = <&wl12xx_vaux2>;
+	non-removable;
+	bus-width = <4>;
+	cap-power-off-card;
+};
+
+&smsc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&smsc1_pins>;
+};
+
+&uart3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart3_pins>;
+};
diff --git a/arch/arm/boot/dts/omap3-cm-t3x30.dtsi b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
new file mode 100644
index 0000000..3a9f004
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
@@ -0,0 +1,95 @@
+/*
+ * Common support for CompuLab CM-T3530 and  CM-T3730
+ */
+
+/ {
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x10000000>; /* 256 MB */
+	};
+
+	cpus {
+		cpu at 0 {
+			cpu0-supply = <&vcc>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		ledb {
+			label = "cm-t35:green";
+			gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>;  /* gpio186 */
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	vddvario: regulator-vddvario {
+		compatible = "regulator-fixed";
+		regulator-name = "vddvario";
+		regulator-always-on;
+	};
+
+	vdd33a: regulator-vdd33a {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd33a";
+		regulator-always-on;
+	};
+};
+
+&gpmc {
+	ranges = <5 0 0x2c000000 0x01000000>;
+
+	smsc1: ethernet at 5,0 {
+		compatible = "smsc,lan9221", "smsc,lan9115";
+		interrupt-parent = <&gpio6>;
+		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+		reg = <5 0 0xff>;
+		bank-width = <2>;
+		gpmc,mux-add-data;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <186>;
+		gpmc,cs-wr-off-ns = <186>;
+		gpmc,adv-on-ns = <12>;
+		gpmc,adv-rd-off-ns = <48>;
+		gpmc,adv-wr-off-ns = <48>;
+		gpmc,oe-on-ns = <54>;
+		gpmc,oe-off-ns = <168>;
+		gpmc,we-on-ns = <54>;
+		gpmc,we-off-ns = <168>;
+		gpmc,rd-cycle-ns = <186>;
+		gpmc,wr-cycle-ns = <186>;
+		gpmc,access-ns = <114>;
+		gpmc,page-burst-access-ns = <6>;
+		gpmc,bus-turnaround-ns = <12>;
+		gpmc,cycle2cycle-delay-ns = <18>;
+		gpmc,wr-data-mux-bus-ns = <90>;
+		gpmc,wr-access-ns = <186>;
+		gpmc,cycle2cycle-samecsen;
+		gpmc,cycle2cycle-diffcsen;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
+};
+
+&i2c1 {
+	clock-frequency = <400000>;
+
+	twl: twl at 48 {
+		reg = <0x48>;
+		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
+		interrupt-parent = <&intc>;
+	};
+};
+
+#include "twl4030.dtsi"
+#include "twl4030_omap3.dtsi"
+
+&i2c3 {
+	clock-frequency = <400000>;
+};
+
+&twl_gpio {
+	ti,use-leds;
+};
diff --git a/arch/arm/boot/dts/omap3-sb-t35.dtsi b/arch/arm/boot/dts/omap3-sb-t35.dtsi
new file mode 100644
index 0000000..b9a2fed
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sb-t35.dtsi
@@ -0,0 +1,40 @@
+/*
+ * Common support for CompuLab SB-T35 used on SBC-T3530, SBC-T3517 and SBC-T3730
+ */
+
+&gpmc {
+	ranges = <4 0 0x2d000000 0x01000000>;
+
+	smsc2: ethernet at 4,0 {
+		compatible = "smsc,lan9221", "smsc,lan9115";
+		interrupt-parent = <&gpio3>;
+		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
+		reg = <4 0 0xff>;
+		bank-width = <2>;
+		gpmc,mux-add-data;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <186>;
+		gpmc,cs-wr-off-ns = <186>;
+		gpmc,adv-on-ns = <12>;
+		gpmc,adv-rd-off-ns = <48>;
+		gpmc,adv-wr-off-ns = <48>;
+		gpmc,oe-on-ns = <54>;
+		gpmc,oe-off-ns = <168>;
+		gpmc,we-on-ns = <54>;
+		gpmc,we-off-ns = <168>;
+		gpmc,rd-cycle-ns = <186>;
+		gpmc,wr-cycle-ns = <186>;
+		gpmc,access-ns = <114>;
+		gpmc,page-burst-access-ns = <6>;
+		gpmc,bus-turnaround-ns = <12>;
+		gpmc,cycle2cycle-delay-ns = <18>;
+		gpmc,wr-data-mux-bus-ns = <90>;
+		gpmc,wr-access-ns = <186>;
+		gpmc,cycle2cycle-samecsen;
+		gpmc,cycle2cycle-diffcsen;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
+};
diff --git a/arch/arm/boot/dts/omap3-sbc-t3730.dts b/arch/arm/boot/dts/omap3-sbc-t3730.dts
new file mode 100644
index 0000000..c119bd5
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sbc-t3730.dts
@@ -0,0 +1,30 @@
+/*
+ * Suppport for CompuLab SBC-T3730 with CM-T3730
+ */
+
+#include "omap3-cm-t3730.dts"
+#include "omap3-sb-t35.dtsi"
+
+/ {
+	model = "CompuLab SBC-T3730 with CM-T3730";
+	compatible = "compulab,omap3-sbc-t3730", "compulab,omap3-cm-t3730", "ti,omap36xx", "ti,omap3";
+};
+
+&gpmc {
+	ranges = <5 0 0x2c000000 0x01000000>,
+		 <4 0 0x2d000000 0x01000000>;
+};
+
+&smsc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&smsc2_pins>;
+};
+
+&omap3_pmx_core {
+	smsc2_pins: pinmux_smsc2_pins {
+		pinctrl-single,pins = <
+			0x86 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_ncs4.gpmc_ncs4 */
+			0xa2 (PIN_INPUT_PULLUP | MUX_MODE4)	/* gpmc_wait3.gpio_65 */
+		>;
+	};
+};
\ No newline at end of file
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 5aaf720..3d5b24d 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -92,6 +92,33 @@ static void __init hsmmc2_internal_input_clk(void)
 	omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
 }
 
+static int omap3_sbc_t3730_twl_callback(struct device *dev,
+					   unsigned gpio,
+					   unsigned ngpio)
+{
+	int res;
+
+	res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
+			       "wlan rst");
+	if (res)
+		return res;
+
+	gpio_export(gpio, 0);
+
+	return 0;
+}
+
+static void __init omap3_sbc_t3730_twl_init(void)
+{
+	twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
+}
+
+static void __init omap3_sbc_t3730_legacy_init(void)
+{
+	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
+	omap_ads7846_init(1, 57, 0, NULL);
+}
+
 static void __init omap3_igep0020_legacy_init(void)
 {
 	omap3_igep2_display_init_of();
@@ -200,6 +227,9 @@ static struct pdata_init auxdata_quirks[] __initdata = {
 	{ "nokia,n810", omap2420_n8x0_legacy_init, },
 	{ "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
 #endif
+#ifdef CONFIG_ARCH_OMAP3
+	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, },
+#endif
 	{ /* sentinel */ },
 };
 
@@ -228,6 +258,7 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
  */
 static struct pdata_init pdata_quirks[] __initdata = {
 #ifdef CONFIG_ARCH_OMAP3
+	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
 	{ "nokia,omap3-n900", hsmmc2_internal_input_clk, },
 	{ "nokia,omap3-n9", hsmmc2_internal_input_clk, },
 	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
  2013-12-18 21:16             ` Tony Lindgren
@ 2013-12-19  7:44               ` Igor Grinberg
  -1 siblings, 0 replies; 18+ messages in thread
From: Igor Grinberg @ 2013-12-19  7:44 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-arm-kernel, linux-omap, devicetree, Dmitry Lifshitz,
	Nikita Kiryanov

On 12/18/13 23:16, Tony Lindgren wrote:

[...]

> 
> I've kept your Ack as the changes were minor. If no other
> comments, I will apply this into omap-for-v3.14/dt probably
> on Thursday.

Looks great! Thanks!


-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
@ 2013-12-19  7:44               ` Igor Grinberg
  0 siblings, 0 replies; 18+ messages in thread
From: Igor Grinberg @ 2013-12-19  7:44 UTC (permalink / raw)
  To: linux-arm-kernel

On 12/18/13 23:16, Tony Lindgren wrote:

[...]

> 
> I've kept your Ack as the changes were minor. If no other
> comments, I will apply this into omap-for-v3.14/dt probably
> on Thursday.

Looks great! Thanks!


-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
  2013-12-19  7:44               ` Igor Grinberg
@ 2013-12-19 18:35                 ` Tony Lindgren
  -1 siblings, 0 replies; 18+ messages in thread
From: Tony Lindgren @ 2013-12-19 18:35 UTC (permalink / raw)
  To: Igor Grinberg
  Cc: linux-arm-kernel, linux-omap, devicetree, Dmitry Lifshitz,
	Nikita Kiryanov

* Igor Grinberg <grinberg@compulab.co.il> [131218 23:46]:
> On 12/18/13 23:16, Tony Lindgren wrote:
> 
> [...]
> 
> > 
> > I've kept your Ack as the changes were minor. If no other
> > comments, I will apply this into omap-for-v3.14/dt probably
> > on Thursday.
> 
> Looks great! Thanks!

Thanks for your comments, I've pushed it out to omap-for-v3.14/dt now.

Regards,

Tony

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730
@ 2013-12-19 18:35                 ` Tony Lindgren
  0 siblings, 0 replies; 18+ messages in thread
From: Tony Lindgren @ 2013-12-19 18:35 UTC (permalink / raw)
  To: linux-arm-kernel

* Igor Grinberg <grinberg@compulab.co.il> [131218 23:46]:
> On 12/18/13 23:16, Tony Lindgren wrote:
> 
> [...]
> 
> > 
> > I've kept your Ack as the changes were minor. If no other
> > comments, I will apply this into omap-for-v3.14/dt probably
> > on Thursday.
> 
> Looks great! Thanks!

Thanks for your comments, I've pushed it out to omap-for-v3.14/dt now.

Regards,

Tony

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-12-19 18:35 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-13 19:22 [PATCH] ARM: dts: Add support for sbc-3xxx with cm-t3730 Tony Lindgren
2013-12-13 19:22 ` Tony Lindgren
2013-12-16 13:55 ` Igor Grinberg
2013-12-16 13:55   ` Igor Grinberg
2013-12-16 19:17   ` Tony Lindgren
2013-12-16 19:17     ` Tony Lindgren
2013-12-17  7:14     ` Igor Grinberg
2013-12-17  7:14       ` Igor Grinberg
2013-12-17 19:31       ` Tony Lindgren
2013-12-17 19:31         ` Tony Lindgren
2013-12-18  8:45         ` Igor Grinberg
2013-12-18  8:45           ` Igor Grinberg
2013-12-18 21:16           ` Tony Lindgren
2013-12-18 21:16             ` Tony Lindgren
2013-12-19  7:44             ` Igor Grinberg
2013-12-19  7:44               ` Igor Grinberg
2013-12-19 18:35               ` Tony Lindgren
2013-12-19 18:35                 ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.