Skip to contentSkip to conversation

Minimal dts support for LogicPD Torpedo SOM devkit

PATCH New Tony Lindgren 1 participant 5 messages May 2, 2015 – May 18, 2015

Subsystems (5)
lore
Share & tools
lore

Tony Lindgren

author maintainer
#0 lore raw

cover Minimal dts support for LogicPD Torpedo SOM devkit

Hi all,

This seems to be the last missing omap3 dts file, so far we've only had minimal board-*.c legacy support for it.

Here's some more info about this board:

http://www.logicpd.com/products/system-on-modules/dm3730-torpedo-wireless-som/
http://www.logicpd.com/products/system-on-modules/zoom-dm3730-torpedo/

Regards,

Tony

Tony Lindgren (2):
ARM: OMAP3: Add support for configuring MMC pins as GPIO pins
ARM: dts: Add minimal support for LogicPD Torpedo DM3730 devkit

 arch/arm/boot/dts/Makefile                        |   1 +
 arch/arm/boot/dts/logicpd-torpedo-37xx-devkit.dts | 157 +++++++++++++++++++++
 arch/arm/boot/dts/logicpd-torpedo-som.dtsi        | 162 ++++++++++++++++++++++
 arch/arm/mach-omap2/control.c                     |   3 +
 arch/arm/mach-omap2/control.h                     |   3 +
 arch/arm/mach-omap2/pdata-quirks.c                |  22 +++
 6 files changed, 348 insertions(+)
 create mode 100644 arch/arm/boot/dts/logicpd-torpedo-37xx-devkit.dts
 create mode 100644 arch/arm/boot/dts/logicpd-torpedo-som.dtsi
Signature · 1 line
2.1.4
author maintainer
#1 lore raw

PATCH 1/2 ARM: OMAP3: Add support for configuring MMC pins as GPIO pins

Some devices are using the MMC1 pins 4..8 as GPIO pins, and in this case they need to be configured for 1.8V IO voltage if not done by the bootloader as otherwise some devices like smsc911x won't work properly.

Let's also make sure this register is saved and restored for idle.

---
 arch/arm/mach-omap2/control.c      |  3 +++
 arch/arm/mach-omap2/control.h      |  3 +++
 arch/arm/mach-omap2/pdata-quirks.c | 22 ++++++++++++++++++++++
 3 files changed, 28 insertions(+)
arch/arm/mach-omap2/control.c +3 -0
index af95a62..f008930 100644
@@ -112,6 +112,7 @@ struct omap3_control_regs {
 	u32 csirxfe;
 	u32 iva2_bootaddr;
 	u32 iva2_bootmod;
+	u32 wkup_ctrl;
 	u32 debobs_0;
 	u32 debobs_1;
 	u32 debobs_2;
@@ -455,6 +456,7 @@ void omap3_control_save_context(void)
 			omap_ctrl_readl(OMAP343X_CONTROL_IVA2_BOOTADDR);
 	control_context.iva2_bootmod =
 			omap_ctrl_readl(OMAP343X_CONTROL_IVA2_BOOTMOD);
+	control_context.wkup_ctrl = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL);
 	control_context.debobs_0 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(0));
 	control_context.debobs_1 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(1));
 	control_context.debobs_2 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(2));
@@ -512,6 +514,7 @@ void omap3_control_restore_context(void)
 					OMAP343X_CONTROL_IVA2_BOOTADDR);
 	omap_ctrl_writel(control_context.iva2_bootmod,
 					OMAP343X_CONTROL_IVA2_BOOTMOD);
+	omap_ctrl_writel(control_context.wkup_ctrl, OMAP34XX_CONTROL_WKUP_CTRL);
 	omap_ctrl_writel(control_context.debobs_0, OMAP343X_CONTROL_DEBOBS(0));
 	omap_ctrl_writel(control_context.debobs_1, OMAP343X_CONTROL_DEBOBS(1));
 	omap_ctrl_writel(control_context.debobs_2, OMAP343X_CONTROL_DEBOBS(2));
arch/arm/mach-omap2/control.h +3 -0
index 80d2b7d..ec406bc 100644
@@ -231,6 +231,9 @@
 #define OMAP343X_PADCONF_ETK_D15	OMAP343X_PADCONF_ETK(17)
 
 /* 34xx GENERAL_WKUP register offsets */
+#define OMAP34XX_CONTROL_WKUP_CTRL	(OMAP343X_CONTROL_GENERAL_WKUP - 0x4)
+#define OMAP36XX_GPIO_IO_PWRDNZ		BIT(6)
+
 #define OMAP343X_CONTROL_WKUP_DEBOBSMUX(i) (OMAP343X_CONTROL_GENERAL_WKUP + \
 						0x008 + (i))
 #define OMAP343X_CONTROL_WKUP_DEBOBS0 (OMAP343X_CONTROL_GENERAL_WKUP + 0x008)
arch/arm/mach-omap2/pdata-quirks.c +22 -0
index af11511..a74612b 100644
@@ -44,6 +44,27 @@ static void __init omap2420_n8x0_legacy_init(void)
 #endif
 
 #ifdef CONFIG_ARCH_OMAP3
+/*
+ * Configures GPIOs 126 to 129 to 1.8V mode instead of 3.0V
+ * mode for MMC1 in case bootloader did not configure things.
+ * Note that if the pins are used for MMC1, pbias-regulator
+ * manages the IO voltage.
+ */
+static void __init omap3_gpio126_129(void)
+{
+	u32 reg;
+
+	reg = omap_ctrl_readl(OMAP343X_CONTROL_PBIAS_LITE);
+	reg &= ~OMAP343X_PBIASLITEVMODE1;
+	reg |= OMAP343X_PBIASLITEPWRDNZ1;
+	omap_ctrl_writel(reg, OMAP343X_CONTROL_PBIAS_LITE);
+	if (cpu_is_omap3630()) {
+		reg = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL);
+		reg |= OMAP36XX_GPIO_IO_PWRDNZ;
+		omap_ctrl_writel(reg, OMAP34XX_CONTROL_WKUP_CTRL);
+	}
+}
+
 static void __init hsmmc2_internal_input_clk(void)
 {
 	u32 reg;
@@ -356,6 +377,7 @@ static struct pdata_init pdata_quirks[] __initdata = {
 	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },
 	{ "isee,omap3-igep0020-rev-f", omap3_igep0020_rev_f_legacy_init, },
 	{ "isee,omap3-igep0030-rev-g", omap3_igep0030_rev_g_legacy_init, },
+	{ "logicpd,dm3730-torpedo-devkit", omap3_gpio126_129, },
 	{ "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
 	{ "ti,am3517-evm", am3517_evm_legacy_init, },
 	{ "technexion,omap3-tao3530", omap3_tao3530_legacy_init, },
Signature · 1 line
2.1.4
author maintainer
#2 lore raw

PATCH 1/2 ARM: OMAP3: Add support for configuring MMC pins as GPIO pins

Quoted 11 lines · Tony Lindgren
(quoted diff) +11 -0
+/*
+ * Configures GPIOs 126 to 129 to 1.8V mode instead of 3.0V
+ * mode for MMC1 in case bootloader did not configure things.
+ * Note that if the pins are used for MMC1, pbias-regulator
+ * manages the IO voltage.
+ */
+static void __init omap3_gpio126_129(void)
+{
+	u32 reg;
+
+	reg = omap_ctrl_readl(OMAP343X_CONTROL_PBIAS_LITE);

Review

Quoted 10 lines
(quoted diff) +10 -0
+	reg &= ~OMAP343X_PBIASLITEVMODE1;
+	reg |= OMAP343X_PBIASLITEPWRDNZ1;
+	omap_ctrl_writel(reg, OMAP343X_CONTROL_PBIAS_LITE);
+	if (cpu_is_omap3630()) {
+		reg = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL);
+		reg |= OMAP36XX_GPIO_IO_PWRDNZ;
+		omap_ctrl_writel(reg, OMAP34XX_CONTROL_WKUP_CTRL);
+	}
+}
+

This seems to not include GPIO 128 as pointed out by Tim Nordell, so patch with updated naming below.

Regards,

Tony

8< ------------------
From: Tony Lindgren <[email protected]>
Date: Wed, 13 May 2015 11:42:59 -0700
Subject: [PATCH] ARM: OMAP3: Add support for configuring MMC pins as GPIO pins

Some devices are using the MMC1 pins 4..8 as GPIO pins, and in this case they need to be configured for 1.8V IO voltage if not done by the bootloader as otherwise some devices like smsc911x won't work properly.

Let's also make sure this register is saved and restored for idle.

arch/arm/mach-omap2/control.c +3 -0
@@ -112,6 +112,7 @@ struct omap3_control_regs {
 	u32 csirxfe;
 	u32 iva2_bootaddr;
 	u32 iva2_bootmod;
+	u32 wkup_ctrl;
 	u32 debobs_0;
 	u32 debobs_1;
 	u32 debobs_2;
@@ -455,6 +456,7 @@ void omap3_control_save_context(void)
 			omap_ctrl_readl(OMAP343X_CONTROL_IVA2_BOOTADDR);
 	control_context.iva2_bootmod =
 			omap_ctrl_readl(OMAP343X_CONTROL_IVA2_BOOTMOD);
+	control_context.wkup_ctrl = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL);
 	control_context.debobs_0 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(0));
 	control_context.debobs_1 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(1));
 	control_context.debobs_2 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(2));
@@ -512,6 +514,7 @@ void omap3_control_restore_context(void)
 					OMAP343X_CONTROL_IVA2_BOOTADDR);
 	omap_ctrl_writel(control_context.iva2_bootmod,
 					OMAP343X_CONTROL_IVA2_BOOTMOD);
+	omap_ctrl_writel(control_context.wkup_ctrl, OMAP34XX_CONTROL_WKUP_CTRL);
 	omap_ctrl_writel(control_context.debobs_0, OMAP343X_CONTROL_DEBOBS(0));
 	omap_ctrl_writel(control_context.debobs_1, OMAP343X_CONTROL_DEBOBS(1));
 	omap_ctrl_writel(control_context.debobs_2, OMAP343X_CONTROL_DEBOBS(2));
arch/arm/mach-omap2/control.h +3 -0
@@ -231,6 +231,9 @@
 #define OMAP343X_PADCONF_ETK_D15	OMAP343X_PADCONF_ETK(17)
 
 /* 34xx GENERAL_WKUP register offsets */
+#define OMAP34XX_CONTROL_WKUP_CTRL	(OMAP343X_CONTROL_GENERAL_WKUP - 0x4)
+#define OMAP36XX_GPIO_IO_PWRDNZ		BIT(6)
+
 #define OMAP343X_CONTROL_WKUP_DEBOBSMUX(i) (OMAP343X_CONTROL_GENERAL_WKUP + \
 						0x008 + (i))
 #define OMAP343X_CONTROL_WKUP_DEBOBS0 (OMAP343X_CONTROL_GENERAL_WKUP + 0x008)
arch/arm/mach-omap2/pdata-quirks.c +22 -0
@@ -44,6 +44,27 @@ static void __init omap2420_n8x0_legacy_init(void)
 #endif
 
 #ifdef CONFIG_ARCH_OMAP3
+/*
+ * Configures GPIOs 126, 127 and 129 to 1.8V mode instead of 3.0V
+ * mode for MMC1 in case bootloader did not configure things.
+ * Note that if the pins are used for MMC1, pbias-regulator
+ * manages the IO voltage.
+ */
+static void __init omap3_gpio126_127_129(void)
+{
+	u32 reg;
+
+	reg = omap_ctrl_readl(OMAP343X_CONTROL_PBIAS_LITE);
+	reg &= ~OMAP343X_PBIASLITEVMODE1;
+	reg |= OMAP343X_PBIASLITEPWRDNZ1;
+	omap_ctrl_writel(reg, OMAP343X_CONTROL_PBIAS_LITE);
+	if (cpu_is_omap3630()) {
+		reg = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL);
+		reg |= OMAP36XX_GPIO_IO_PWRDNZ;
+		omap_ctrl_writel(reg, OMAP34XX_CONTROL_WKUP_CTRL);
+	}
+}
+
 static void __init hsmmc2_internal_input_clk(void)
 {
 	u32 reg;
@@ -356,6 +377,7 @@ static struct pdata_init pdata_quirks[] __initdata = {
 	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },
 	{ "isee,omap3-igep0020-rev-f", omap3_igep0020_rev_f_legacy_init, },
 	{ "isee,omap3-igep0030-rev-g", omap3_igep0030_rev_g_legacy_init, },
+	{ "logicpd,dm3730-torpedo-devkit", omap3_gpio126_127_129, },
 	{ "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
 	{ "ti,am3517-evm", am3517_evm_legacy_init, },
 	{ "technexion,omap3-tao3530", omap3_tao3530_legacy_init, },
author maintainer
#3 lore raw

PATCH 2/2 ARM: dts: Add minimal support for LogicPD Torpedo DM3730 devkit

In reply to Tony Lindgren

The LogicPD Torpedo DM3730 devkit consists of a base board and two processor boards. One of the processor boards has a WLAN and the other one does not.

Let's set up basic dts file so we can move to device tree only based booting over next few merge windows. So far I've tested that UARTs, MMC1, USB OTG, smsc911x, and basic PM support works.

Note that the wireless support in kernel for wl1283 seems to be broken, it tries to load wl127x-nvs.bin instead of wl128x-nvs.bin with firmware.

---
 arch/arm/boot/dts/Makefile                        |   1 +
 arch/arm/boot/dts/logicpd-torpedo-37xx-devkit.dts | 157 +++++++++++++++++++++
 arch/arm/boot/dts/logicpd-torpedo-som.dtsi        | 162 ++++++++++++++++++++++
 3 files changed, 320 insertions(+)
 create mode 100644 arch/arm/boot/dts/logicpd-torpedo-37xx-devkit.dts
 create mode 100644 arch/arm/boot/dts/logicpd-torpedo-som.dtsi
arch/arm/boot/dts/Makefile +1 -0
index 86217db..ceec61c 100644
@@ -360,6 +360,7 @@ dtb-$(CONFIG_ARCH_OMAP3) += \
 	am3517-craneboard.dtb \
 	am3517-evm.dtb \
 	am3517_mt_ventoux.dtb \
+	logicpd-torpedo-37xx-devkit.dtb \
 	omap3430-sdp.dtb \
 	omap3-beagle.dtb \
 	omap3-beagle-xm.dtb \
arch/arm/boot/dts/logicpd-torpedo-37xx-devkit.dts new file +157 -0

157 lines not on this page · raw message

arch/arm/boot/dts/logicpd-torpedo-som.dtsi new file +162 -0

162 lines not on this page · raw message

Signature · 1 line
2.1.4
author maintainer
#4 lore raw

PATCH 2/2 ARM: dts: Add minimal support for LogicPD Torpedo DM3730 devkit

Quoted 11 lines · Tony Lindgren

+&gpmc {

(quoted diff) +10 -0
+	ranges = <1 0 0x08000000 0x1000000>;	/* CS1: 16MB for LAN9221 */
+
+	ethernet at gpmc {
+		pinctrl-names = "default";
+		pinctrl-0 = <&lan9221_pins>;
+		interrupt-parent = <&gpio5>;
+		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
+		reg = <1 0 0xff>;
+	};
+};

Review

Quoted 10 lines
(quoted diff) +10 -0
+
+&mmc1 {
+	interrupts-extended = <&intc 83 &omap3_pmx_core 0x11a>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins &mmc1_cd>;
+	cd-gpios = <&gpio4 31 IRQ_TYPE_LEVEL_LOW>;
+	vmmc-supply = <&vmmc1>;
+	bus-width = <4>;
+	cap-power-off-card;
+};

And these were missing the comments for the GPIO line numbers as done for the other GPIOs in the dts file. Updated patch below.

Regards,

Tony

8< ----------------------
From: Tony Lindgren <[email protected]>
Date: Wed, 13 May 2015 11:42:59 -0700
Subject: [PATCH] ARM: dts: Add minimal support for LogicPD Torpedo DM3730
devkit

The LogicPD Torpedo DM3730 devkit consists of a base board and two processor boards. One of the processor boards has a WLAN and the other one does not.

Let's set up basic dts file so we can move to device tree only based booting over next few merge windows. So far I've tested that UARTs, MMC1, USB OTG, smsc911x, and basic PM support works.

Note that the wireless support in kernel for wl1283 seems to be broken, it tries to load wl127x-nvs.bin instead of wl128x-nvs.bin with firmware.

arch/arm/boot/dts/Makefile +1 -0
@@ -360,6 +360,7 @@ dtb-$(CONFIG_ARCH_OMAP3) += \
 	am3517-craneboard.dtb \
 	am3517-evm.dtb \
 	am3517_mt_ventoux.dtb \
+	logicpd-torpedo-37xx-devkit.dtb \
 	omap3430-sdp.dtb \
 	omap3-beagle.dtb \
 	omap3-beagle-xm.dtb \
arch/arm/boot/dts/logicpd-torpedo-37xx-devkit.dts new file +157 -0

157 lines not on this page · raw message

arch/arm/boot/dts/logicpd-torpedo-som.dtsi new file +162 -0

162 lines not on this page · raw message