Skip to contentSkip to conversation

Convert mxs board files to device tree

PATCH New Shawn Guo 5 participants 43 messages Jul 9, 2012 – Jul 19, 2012

Subsystems (5)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

cover Convert mxs board files to device tree

With imx23-evk and imx28-evk converted to device tree, it's time to start looking at other mxs boards.

Marek, Lauri and Lothar,

Please do me the favor to test the series on your boards to see if it provides the same functionality as the board file. You can just use the branch below.

git://git.linaro.org/people/shawnguo/linux-2.6.git mxs/dt/others

Thanks,
Shawn

Marek Vasut (1):
ARM: mxs: convert m28evk board to device tree

Shawn Guo (6):
ARM: dts: imx28: move extra gpmi-nand pins into board dts
ARM: dts: imx28: move lcdif control pins into board dts
ARM: mxs: convert apx4devkit board to device tree
ARM: mxs: convert tx28 board to device tree
ARM: mxs: convert stmp378x_devb board to device tree
ARM: mxs: add dtb-y target into Makefile.boot

 arch/arm/boot/dts/apx4devkit.dts    |  143 +++++++++++++++++++++
 arch/arm/boot/dts/imx28-evk.dts     |   30 ++++-
 arch/arm/boot/dts/imx28.dtsi        |   96 +++++++++++++-
 arch/arm/boot/dts/m28evk.dts        |  241 +++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/stmp378x_devb.dts |   78 +++++++++++
 arch/arm/boot/dts/tx28.dts          |  112 ++++++++++++++++
 arch/arm/mach-mxs/Makefile.boot     |    9 ++
 arch/arm/mach-mxs/mach-mxs.c        |  102 +++++++++++++++-
 8 files changed, 802 insertions(+), 9 deletions(-)
 create mode 100644 arch/arm/boot/dts/apx4devkit.dts
 create mode 100644 arch/arm/boot/dts/m28evk.dts
 create mode 100644 arch/arm/boot/dts/stmp378x_devb.dts
 create mode 100644 arch/arm/boot/dts/tx28.dts
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 1/7 ARM: dts: imx28: move extra gpmi-nand pins into board dts

Only pins GPMI_CE0N and GPMI_READY0 are generally used by other boards. Move GPMI_CE1N and GPMI_READY1 into imx28-evk.dts to make gpmi_pins_a more general, and can be used by other boards.

---
 arch/arm/boot/dts/imx28-evk.dts |   14 +++++++++++++-
 arch/arm/boot/dts/imx28.dtsi    |    2 --
 2 files changed, 13 insertions(+), 3 deletions(-)
arch/arm/boot/dts/imx28-evk.dts +13 -1
index 0d8739d..0444964 100644
@@ -24,7 +24,8 @@
 		apbh at 80000000 {
 			gpmi-nand at 8000c000 {
 				pinctrl-names = "default";
-				pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
+				pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg
+					     &gpmi_pins_evk>;
 				status = "okay";
 			};
 
@@ -64,6 +65,17 @@
 					fsl,voltage = <1>;
 					fsl,pull-up = <0>;
 				};
+
+				gpmi_pins_evk: gpmi-nand-evk at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x0110 /* MX28_PAD_GPMI_CE1N__GPMI_CE1N */
+						0x0150 /* MX28_PAD_GPMI_RDY1__GPMI_READY1 */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
 			};
 
 			lcdif at 80030000 {
arch/arm/boot/dts/imx28.dtsi +0 -2
index adb5ffc..2874adc 100644
@@ -198,9 +198,7 @@
 						0x0060 /* MX28_PAD_GPMI_D06__GPMI_D6 */
 						0x0070 /* MX28_PAD_GPMI_D07__GPMI_D7 */
 						0x0100 /* MX28_PAD_GPMI_CE0N__GPMI_CE0N */
-						0x0110 /* MX28_PAD_GPMI_CE1N__GPMI_CE1N */
 						0x0140 /* MX28_PAD_GPMI_RDY0__GPMI_READY0 */
-						0x0150 /* MX28_PAD_GPMI_RDY1__GPMI_READY1 */
 						0x0180 /* MX28_PAD_GPMI_RDN__GPMI_RDN */
 						0x0190 /* MX28_PAD_GPMI_WRN__GPMI_WRN */
 						0x01a0 /* MX28_PAD_GPMI_ALE__GPMI_ALE */
Signature · 1 line
1.7.5.4
author
#2 lore raw

PATCH 2/7 ARM: dts: imx28: move lcdif control pins into board dts

In reply to Shawn Guo

The presence and muxing of lcdif control pins can vary much on different boards. Move them into imx28-evk.dts to make lcdif_24bit_pins_a only about data pins, so that it can be reused by other boards.

---
 arch/arm/boot/dts/imx28-evk.dts |   16 +++++++++++++++-
 arch/arm/boot/dts/imx28.dtsi    |    4 ----
 2 files changed, 15 insertions(+), 5 deletions(-)
arch/arm/boot/dts/imx28-evk.dts +15 -1
index 0444964..0fcc7ea 100644
@@ -76,11 +76,25 @@
 					fsl,voltage = <1>;
 					fsl,pull-up = <0>;
 				};
+
+				lcdif_pins_evk: lcdif-evk at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x1181 /* MX28_PAD_LCD_RD_E__LCD_VSYNC */
+						0x1191 /* MX28_PAD_LCD_WR_RWN__LCD_HSYNC */
+						0x11a1 /* MX28_PAD_LCD_RS__LCD_DOTCLK */
+						0x11b1 /* MX28_PAD_LCD_CS__LCD_ENABLE */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
 			};
 
 			lcdif at 80030000 {
 				pinctrl-names = "default";
-				pinctrl-0 = <&lcdif_24bit_pins_a>;
+				pinctrl-0 = <&lcdif_24bit_pins_a
+					     &lcdif_pins_evk>;
 				panel-enable-gpios = <&gpio3 30 0>;
 				status = "okay";
 			};
arch/arm/boot/dts/imx28.dtsi +0 -4
index 2874adc..02e778b 100644
@@ -400,10 +400,6 @@
 						0x1150 /* MX28_PAD_LCD_D21__LCD_D21 */
 						0x1160 /* MX28_PAD_LCD_D22__LCD_D22 */
 						0x1170 /* MX28_PAD_LCD_D23__LCD_D23 */
-						0x1181 /* MX28_PAD_LCD_RD_E__LCD_VSYNC */
-						0x1191 /* MX28_PAD_LCD_WR_RWN__LCD_HSYNC */
-						0x11a1 /* MX28_PAD_LCD_RS__LCD_DOTCLK */
-						0x11b1 /* MX28_PAD_LCD_CS__LCD_ENABLE */
 					>;
 					fsl,drive-strength = <0>;
 					fsl,voltage = <1>;
Signature · 1 line
1.7.5.4
author
#3 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

In reply to Shawn Guo

From: Marek Vasut <[email protected]>

---
 arch/arm/boot/dts/imx28.dtsi |   21 ++++
 arch/arm/boot/dts/m28evk.dts |  241 ++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-mxs/mach-mxs.c |   30 +++++
 3 files changed, 292 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/m28evk.dts
arch/arm/boot/dts/imx28.dtsi +21 -0
index 02e778b..3390607 100644
@@ -232,6 +232,17 @@
 					fsl,pull-up = <0>;
 				};
 
+				auart0_2pins_a: auart0-2pins at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x3000 /* MX28_PAD_AUART0_RX__AUART0_RX */
+						0x3010 /* MX28_PAD_AUART0_TX__AUART0_TX */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
 				auart3_pins_a: auart3 at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <
@@ -373,6 +384,16 @@
 					fsl,pull-up = <0>;
 				};
 
+				pwm3_pins_a: pwm3 at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x31c0 /* MX28_PAD_PWM3__PWM_3 */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
 				lcdif_24bit_pins_a: lcdif-24bit at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <
arch/arm/boot/dts/m28evk.dts new file +241 -0

241 lines not on this page · raw message

arch/arm/mach-mxs/mach-mxs.c +30 -0
index 7bbb961..6bb6db8 100644
@@ -59,6 +59,23 @@ static struct fb_videomode mx28evk_video_modes[] = {
 	},
 };
 
+static struct fb_videomode m28evk_video_modes[] = {
+	{
+		.name		= "Ampire AM-800480R2TMQW-T01H",
+		.refresh	= 60,
+		.xres		= 800,
+		.yres		= 480,
+		.pixclock	= 30066, /* picosecond (33.26 MHz) */
+		.left_margin	= 0,
+		.right_margin	= 256,
+		.upper_margin	= 0,
+		.lower_margin	= 45,
+		.hsync_len	= 1,
+		.vsync_len	= 1,
+		.sync		= FB_SYNC_DATA_ENABLE_HIGH_ACT,
+	},
+};
+
 static struct mxsfb_platform_data mxsfb_pdata __initdata;
 
 static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
@@ -203,12 +220,24 @@ static void __init imx28_evk_init(void)
 	mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
 }
 
+static void __init m28evk_init(void)
+{
+	update_fec_mac_prop(OUI_DENX);
+
+	mxsfb_pdata.mode_list = m28evk_video_modes;
+	mxsfb_pdata.mode_count = ARRAY_SIZE(m28evk_video_modes);
+	mxsfb_pdata.default_bpp = 16;
+	mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
+}
+
 static void __init mxs_machine_init(void)
 {
 	if (of_machine_is_compatible("fsl,imx28-evk"))
 		imx28_evk_init();
 	else if (of_machine_is_compatible("fsl,imx23-evk"))
 		imx23_evk_init();
+	else if (of_machine_is_compatible("denx,m28evk"))
+		m28evk_init();
 
 	of_platform_populate(NULL, of_default_bus_match_table,
 			     mxs_auxdata_lookup, NULL);
@@ -223,6 +252,7 @@ static const char *imx23_dt_compat[] __initdata = {
 
 static const char *imx28_dt_compat[] __initdata = {
 	"crystalfontz,cfa10036",
+	"denx,m28evk",
 	"fsl,imx28-evk",
 	"fsl,imx28",
 	NULL,
Signature · 1 line
1.7.5.4
#4 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

Dear Shawn Guo,

Quoted 11 lines

From: Marek Vasut <[email protected]>

---
 arch/arm/boot/dts/imx28.dtsi |   21 ++++
 arch/arm/boot/dts/m28evk.dts |  241
++++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-mxs/mach-mxs.c | 
 30 +++++
 3 files changed, 292 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/m28evk.dts

[...]

arch/arm/mach-mxs/mach-mxs.c static void __init imx28_evk_init(void) · line 225

Quoted 3 lines
arch/arm/mach-mxs/mach-mxs.c +3 -0
+static void __init m28evk_init(void)
+{
+	update_fec_mac_prop(OUI_DENX);

You need to start the FEC clock here too, otherwise ethernet won't work. Same thing as on mx28evk. And I noticed that on other platforms too, so maybe that should be somehow the other way around -- turn on the ethernet clock by default.

The rest seems OK. I'll update the .dts file once we get the rest of the stuff in (SPI and i2c).

btw. is someone converting the mxs-lcd ?

Quoted 25 lines
arch/arm/mach-mxs/mach-mxs.c +9 -0
+	mxsfb_pdata.mode_list = m28evk_video_modes;
+	mxsfb_pdata.mode_count = ARRAY_SIZE(m28evk_video_modes);
+	mxsfb_pdata.default_bpp = 16;
+	mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
+}
+
 static void __init mxs_machine_init(void)
 {
 	if (of_machine_is_compatible("fsl,imx28-evk"))
 		imx28_evk_init();
 	else if (of_machine_is_compatible("fsl,imx23-evk"))
 		imx23_evk_init();
+	else if (of_machine_is_compatible("denx,m28evk"))
+		m28evk_init();
 
 	of_platform_populate(NULL, of_default_bus_match_table,
 			     mxs_auxdata_lookup, NULL);
@@ -223,6 +252,7 @@ static const char *imx23_dt_compat[] __initdata = {
 
 static const char *imx28_dt_compat[] __initdata = {
 	"crystalfontz,cfa10036",
+	"denx,m28evk",
 	"fsl,imx28-evk",
 	"fsl,imx28",
 	NULL,
author
#5 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

Quoted 13 lines · Marek Vasut

Dear Shawn Guo,

Quoted 11 lines

From: Marek Vasut <[email protected]>

---
 arch/arm/boot/dts/imx28.dtsi |   21 ++++
 arch/arm/boot/dts/m28evk.dts |  241
++++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-mxs/mach-mxs.c | 
 30 +++++
 3 files changed, 292 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/m28evk.dts
Quoted 7 lines

[...]

arch/arm/mach-mxs/mach-mxs.c static void __init imx28_evk_init(void) · line 225

Quoted 3 lines
arch/arm/mach-mxs/mach-mxs.c +3 -0
+static void __init m28evk_init(void)
+{
+	update_fec_mac_prop(OUI_DENX);

You need to start the FEC clock here too, otherwise ethernet won't work. Same

Which clock? "enet_out"? We enabled it for imx28-evk, but I do not know m28evk also needs it, as I haven't seen mach-m28evk.c enabling any fec clock. Instead, I saw the following in the old clock code.

        /*
         * Extra fec clock setting
         * The DENX M28 uses an external clock source
         * and the clock output must not be enabled
         */
        if (!machine_is_m28evk()) {
                reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_ENET);
                reg &= ~BM_CLKCTRL_ENET_SLEEP;
                reg |= BM_CLKCTRL_ENET_CLK_OUT_EN;
                __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_ENET);
        }

Or you meant other fec clock?

Quoted 8 lines

thing as on mx28evk. And I noticed that on other platforms too, so maybe that should be somehow the other way around -- turn on the ethernet clock by default.

The rest seems OK. I'll update the .dts file once we get the rest of the stuff in (SPI and i2c).

btw. is someone converting the mxs-lcd ?

The lcd should be working right now, with the auxdata used.

Signature · 2 lines
Regards,
Shawn
#6 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

Dear Shawn Guo,

Quoted 28 lines · Marek Vasut
Quoted 18 lines

Dear Shawn Guo,

Quoted 9 lines

From: Marek Vasut <[email protected]>

---

 arch/arm/boot/dts/imx28.dtsi |   21 ++++
 arch/arm/boot/dts/m28evk.dts |  241
Quoted 6 lines

++++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-mxs/mach-mxs.c |

30 +++++

 3 files changed, 292 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/m28evk.dts
Quoted 8 lines

[...]

arch/arm/mach-mxs/mach-mxs.c static void __init imx28_evk_init(void) · line 225

Quoted 3 lines
arch/arm/mach-mxs/mach-mxs.c +3 -0
+static void __init m28evk_init(void)
+{
+	update_fec_mac_prop(OUI_DENX);

You need to start the FEC clock here too, otherwise ethernet won't work. Same

Quoted 4 lines

Which clock? "enet_out"? We enabled it for imx28-evk, but I do not know m28evk also needs it, as I haven't seen mach-m28evk.c enabling any fec clock. Instead, I saw the following in the old clock code.

Well, this for the old revision of the board.

Quoted 12 lines
        /*
         * Extra fec clock setting
         * The DENX M28 uses an external clock source
         * and the clock output must not be enabled
         */
        if (!machine_is_m28evk()) {
                reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_ENET);
                reg &= ~BM_CLKCTRL_ENET_SLEEP;
                reg |= BM_CLKCTRL_ENET_CLK_OUT_EN;
                __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_ENET);
        }
Quoted 1 line

Or you meant other fec clock?

I mean these enet_out clock, they need to be enabled.

Quoted 10 lines
Quoted 8 lines

thing as on mx28evk. And I noticed that on other platforms too, so maybe that should be somehow the other way around -- turn on the ethernet clock by default.

The rest seems OK. I'll update the .dts file once we get the rest of the stuff in (SPI and i2c).

btw. is someone converting the mxs-lcd ?

The lcd should be working right now, with the auxdata used.

Sure, but is someone working on the DT variant?

Best regards,
Marek Vasut

author
#7 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

Quoted 2 lines · Marek Vasut

I mean these enet_out clock, they need to be enabled.

Okay.

Quoted 2 lines

Sure, but is someone working on the DT variant?

With this series, you can try mxsfb with DT on m28evk board. Let me know if it's not working.

Signature · 2 lines
Regards,
Shawn
author
#8 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

In reply to Shawn Guo

From: Marek Vasut <[email protected]>

---
 arch/arm/boot/dts/imx28.dtsi |   21 ++++
 arch/arm/boot/dts/m28evk.dts |  241 ++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-mxs/mach-mxs.c |   30 +++++
 3 files changed, 292 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/m28evk.dts
arch/arm/boot/dts/imx28.dtsi +21 -0
index 02e778b..3390607 100644
@@ -232,6 +232,17 @@
 					fsl,pull-up = <0>;
 				};
 
+				auart0_2pins_a: auart0-2pins at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x3000 /* MX28_PAD_AUART0_RX__AUART0_RX */
+						0x3010 /* MX28_PAD_AUART0_TX__AUART0_TX */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
 				auart3_pins_a: auart3 at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <
@@ -373,6 +384,16 @@
 					fsl,pull-up = <0>;
 				};
 
+				pwm3_pins_a: pwm3 at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x31c0 /* MX28_PAD_PWM3__PWM_3 */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
 				lcdif_24bit_pins_a: lcdif-24bit at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <
arch/arm/boot/dts/m28evk.dts new file +241 -0

241 lines not on this page · raw message

arch/arm/mach-mxs/mach-mxs.c +30 -0
index 7bbb961..6bb6db8 100644
@@ -59,6 +59,23 @@ static struct fb_videomode mx28evk_video_modes[] = {
 	},
 };
 
+static struct fb_videomode m28evk_video_modes[] = {
+	{
+		.name		= "Ampire AM-800480R2TMQW-T01H",
+		.refresh	= 60,
+		.xres		= 800,
+		.yres		= 480,
+		.pixclock	= 30066, /* picosecond (33.26 MHz) */
+		.left_margin	= 0,
+		.right_margin	= 256,
+		.upper_margin	= 0,
+		.lower_margin	= 45,
+		.hsync_len	= 1,
+		.vsync_len	= 1,
+		.sync		= FB_SYNC_DATA_ENABLE_HIGH_ACT,
+	},
+};
+
 static struct mxsfb_platform_data mxsfb_pdata __initdata;
 
 static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
@@ -203,12 +220,24 @@ static void __init imx28_evk_init(void)
 	mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
 }
 
+static void __init m28evk_init(void)
+{
+	update_fec_mac_prop(OUI_DENX);
+
+	mxsfb_pdata.mode_list = m28evk_video_modes;
+	mxsfb_pdata.mode_count = ARRAY_SIZE(m28evk_video_modes);
+	mxsfb_pdata.default_bpp = 16;
+	mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
+}
+
 static void __init mxs_machine_init(void)
 {
 	if (of_machine_is_compatible("fsl,imx28-evk"))
 		imx28_evk_init();
 	else if (of_machine_is_compatible("fsl,imx23-evk"))
 		imx23_evk_init();
+	else if (of_machine_is_compatible("denx,m28evk"))
+		m28evk_init();
 
 	of_platform_populate(NULL, of_default_bus_match_table,
 			     mxs_auxdata_lookup, NULL);
@@ -223,6 +252,7 @@ static const char *imx23_dt_compat[] __initdata = {
 
 static const char *imx28_dt_compat[] __initdata = {
 	"crystalfontz,cfa10036",
+	"denx,m28evk",
 	"fsl,imx28-evk",
 	"fsl,imx28",
 	NULL,
Signature · 1 line
1.7.5.4
#9 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

Dear Shawn Guo,

Quoted 17 lines

From: Marek Vasut <[email protected]>

---
 arch/arm/boot/dts/imx28.dtsi |   21 ++++
 arch/arm/boot/dts/m28evk.dts |  241
++++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-mxs/mach-mxs.c | 
 30 +++++
 3 files changed, 292 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/m28evk.dts
arch/arm/boot/dts/imx28.dtsi +0 -0
index 02e778b..3390607 100644

arch/arm/boot/dts/imx28.dtsi line 238

Quoted 7 lines
arch/arm/boot/dts/imx28.dtsi +4 -0
@@ -232,6 +232,17 @@
 					fsl,pull-up = <0>;
 				};
 
+				auart0_2pins_a: auart0-2pins at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x3000 /* 

MX28_PAD_AUART0_RX__AUART0_RX */

arch/arm/boot/dts/imx28.dtsi line 239

Quoted 1 line
arch/arm/boot/dts/imx28.dtsi +1 -0
+						0x3010 /* 

MX28_PAD_AUART0_TX__AUART0_TX */

Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi +6 -0
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
 				auart3_pins_a: auart3 at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <

arch/arm/boot/dts/imx28.dtsi line 390

Quoted 7 lines
arch/arm/boot/dts/imx28.dtsi +4 -0
@@ -373,6 +384,16 @@
 					fsl,pull-up = <0>;
 				};
 
+				pwm3_pins_a: pwm3 at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x31c0 /* MX28_PAD_PWM3__PWM_3 

*/

arch/arm/boot/dts/imx28.dtsi line 244

Quoted 5 lines
arch/arm/boot/dts/imx28.dtsi +5 -0
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};

Drop the pwm3 stuff, it's not used.

Quoted 75 lines
arch/arm/boot/dts/imx28.dtsi +1 -0
+
 				lcdif_24bit_pins_a: lcdif-24bit at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <
arch/arm/boot/dts/m28evk.dts new file +65 -0
new file mode 100644
index 0000000..0c22792
@@ -0,0 +1,241 @@
+/*
+ * Copyright (C) 2012 Marek Vasut <[email protected]>
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "imx28.dtsi"
+
+/ {
+	model = "DENX M28EVK";
+	compatible = "denx,m28evk", "fsl,imx28";
+
+	memory {
+		reg = <0x40000000 0x08000000>;
+	};
+
+	apb at 80000000 {
+		apbh at 80000000 {
+			gpmi-nand at 8000c000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
+				status = "okay";
+
+				partition at 0 {
+					label = "bootloader";
+					reg = <0x00000000 0x00300000>;
+					read-only;
+				};
+
+				partition at 1 {
+					label = "environment";
+					reg = <0x00300000 0x00080000>;
+				};
+
+				partition at 2 {
+					label = "redundant-environment";
+					reg = <0x00380000 0x00080000>;
+				};
+
+				partition at 3 {
+					label = "kernel";
+					reg = <0x00400000 0x00400000>;
+				};
+
+				partition at 4 {
+					label = "filesystem";
+					reg = <0x00800000 0x0f800000>;
+				};
+			};
+
+			ssp0: ssp at 80010000 {
+				compatible = "fsl,imx28-mmc";
+				pinctrl-names = "default";
+				pinctrl-0 = <&mmc0_8bit_pins_a
+					     &mmc0_cd_cfg
+					     &mmc0_sck_cfg>;
+				bus-width = <8>;
+				wp-gpios = <&gpio3 10 1>;
+				status = "okay";

arch/arm/boot/dts/m28evk.dts line 75

Quoted 10 lines
arch/arm/boot/dts/m28evk.dts new file +10 -0
+			};
+
+			pinctrl at 80018000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&hog_pins_a>;
+
+				hog_pins_a: hog-gpios at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x30a3 /* 

MX28_PAD_AUART2_CTS__GPIO_3_10 */

arch/arm/boot/dts/m28evk.dts line 76

Quoted 1 line
arch/arm/boot/dts/m28evk.dts new file +1 -0
+						0x30b3 /* 

MX28_PAD_AUART2_RTS__GPIO_3_11 */

arch/arm/boot/dts/m28evk.dts line 77

Quoted 1 line
arch/arm/boot/dts/m28evk.dts new file +1 -0
+						0x3103 /* 

MX28_PAD_PWM0__GPIO_3_16 */

arch/arm/boot/dts/m28evk.dts line 78

Quoted 1 line
arch/arm/boot/dts/m28evk.dts new file +1 -0
+						0x3113 /* 

MX28_PAD_PWM1__GPIO_3_17 */

What's this part for ?

arch/arm/boot/dts/m28evk.dts

Quoted 10 lines
arch/arm/boot/dts/m28evk.dts new file +10 -0
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
+				lcdif_pins_m28: lcdif-m28 at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x11e0 /* 

MX28_PAD_LCD_DOTCLK__LCD_DOTCLK */

arch/arm/boot/dts/m28evk.dts line 89

Quoted 1 line
arch/arm/boot/dts/m28evk.dts new file +1 -0
+						0x11f0 /* 

MX28_PAD_LCD_ENABLE__LCD_ENABLE */

Quoted 120 lines
arch/arm/boot/dts/m28evk.dts new file +120 -0
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+			};
+
+			lcdif at 80030000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&lcdif_24bit_pins_a
+					     &lcdif_pins_m28>;
+				status = "okay";
+			};
+
+			can0: can at 80032000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&can0_pins_a>;
+				status = "okay";
+			};
+
+			can1: can at 80034000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&can1_pins_a>;
+				status = "okay";
+			};
+		};
+
+		apbx at 80040000 {
+			saif0: saif at 80042000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&saif0_pins_a>;
+				status = "okay";
+			};
+
+			saif1: saif at 80046000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&saif1_pins_a>;
+				fsl,saif-master = <&saif0>;
+				status = "okay";
+			};
+
+			i2c0: i2c at 80058000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&i2c0_pins_a>;
+				status = "okay";
+
+				sgtl5000: codec at 0a {
+					compatible = "fsl,sgtl5000";
+					reg = <0x0a>;
+					VDDA-supply = <&reg_3p3v>;
+					VDDIO-supply = <&reg_3p3v>;
+
+				};
+
+				eeprom: eeprom at 51 {
+					compatible = "atmel,24c128";
+					reg = <0x51>;
+					pagesize = <32>;
+				};
+
+				rtc: rtc at 68 {
+					compatible = "stm,mt41t62";
+					reg = <0x68>;
+				};
+			};
+
+			pwm: pwm at 80064000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pwm3_pins_a>;
+				status = "okay";
+			};
+
+			duart: serial at 80074000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&duart_pins_a>;
+				status = "okay";
+			};
+
+			auart0: serial at 8006a000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&auart0_2pins_a>;
+				status = "okay";
+			};
+
+			auart3: serial at 80070000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&auart3_pins_a>;
+				status = "okay";
+			};
+		};
+	};
+
+	ahb at 80080000 {
+		mac0: ethernet at 800f0000 {
+			phy-mode = "rmii";
+			pinctrl-names = "default";
+			pinctrl-0 = <&mac0_pins_a>;
+			phy-reset-gpios = <&gpio3 11 0>;
+			status = "okay";
+		};
+
+		mac1: ethernet at 800f4000 {
+			phy-mode = "rmii";
+			pinctrl-names = "default";
+			pinctrl-0 = <&mac1_pins_a>;
+			status = "okay";
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+
+		reg_3p3v: 3p3v {
+			compatible = "regulator-fixed";
+			regulator-name = "3P3V";
+			regulator-min-microvolt = <3300000>;
+			regulator-max-microvolt = <3300000>;
+			regulator-always-on;
+		};
+	};

arch/arm/boot/dts/m28evk.dts line 219

Quoted 10 lines
arch/arm/boot/dts/m28evk.dts new file +10 -0
+
+	sound {
+		compatible = "fsl,imx28-evk-sgtl5000",
+			     "fsl,mxs-audio-sgtl5000";
+		model = "imx28-evk-sgtl5000";
+		saif-controllers = <&saif0 &saif1>;
+		audio-codec = <&sgtl5000>;
+	};
+
+	leds {

Drop the led section, it's some ancient nonsense from who-knows-where :-(

Quoted 6 lines
arch/arm/boot/dts/m28evk.dts new file +6 -0
+		compatible = "gpio-leds";
+
+		user1 {
+			label = "Heartbeat1";
+			gpios = <&gpio3 16 0>;
+			linux,default-trigger = "heartbeat";

arch/arm/boot/dts/m28evk.dts line 235

Quoted 10 lines
arch/arm/boot/dts/m28evk.dts new file +10 -0
+		};
+
+		user2 {
+			label = "Heartbeat2";
+			gpios = <&gpio3 17 0>;
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	backlight {

Drop this backlight too please.

Quoted 46 lines
arch/arm/boot/dts/m28evk.dts new file +6 -0
+		compatible = "pwm-backlight";
+		pwms = <&pwm 3 5000000>;
+		brightness-levels = <0 4 8 16 32 64 128 255>;
+		default-brightness-level = <6>;
+	};
+};
arch/arm/mach-mxs/mach-mxs.c +25 -0
index 7bbb961..6bb6db8 100644
@@ -59,6 +59,23 @@ static struct fb_videomode mx28evk_video_modes[] = {
 	},
 };
 
+static struct fb_videomode m28evk_video_modes[] = {
+	{
+		.name		= "Ampire AM-800480R2TMQW-T01H",
+		.refresh	= 60,
+		.xres		= 800,
+		.yres		= 480,
+		.pixclock	= 30066, /* picosecond (33.26 MHz) */
+		.left_margin	= 0,
+		.right_margin	= 256,
+		.upper_margin	= 0,
+		.lower_margin	= 45,
+		.hsync_len	= 1,
+		.vsync_len	= 1,
+		.sync		= FB_SYNC_DATA_ENABLE_HIGH_ACT,
+	},
+};
+
 static struct mxsfb_platform_data mxsfb_pdata __initdata;
 
 static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
@@ -203,12 +220,24 @@ static void __init imx28_evk_init(void)
 	mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
 }
 
+static void __init m28evk_init(void)
+{
+	update_fec_mac_prop(OUI_DENX);
+
+	mxsfb_pdata.mode_list = m28evk_video_modes;
+	mxsfb_pdata.mode_count = ARRAY_SIZE(m28evk_video_modes);
+	mxsfb_pdata.default_bpp = 16;
+	mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;

arch/arm/mach-mxs/mach-mxs.c static void __init imx28_evk_init(void) · line 240

Quoted 10 lines
arch/arm/mach-mxs/mach-mxs.c +4 -0
+}
+
 static void __init mxs_machine_init(void)
 {
 	if (of_machine_is_compatible("fsl,imx28-evk"))
 		imx28_evk_init();
 	else if (of_machine_is_compatible("fsl,imx23-evk"))
 		imx23_evk_init();
+	else if (of_machine_is_compatible("denx,m28evk"))
+		m28evk_init();

I think you need to call imx28_evk_init() here ?

Quoted 11 lines
arch/arm/mach-mxs/mach-mxs.c +1 -0
 	of_platform_populate(NULL, of_default_bus_match_table,
 			     mxs_auxdata_lookup, NULL);
@@ -223,6 +252,7 @@ static const char *imx23_dt_compat[] __initdata = {
 
 static const char *imx28_dt_compat[] __initdata = {
 	"crystalfontz,cfa10036",
+	"denx,m28evk",
 	"fsl,imx28-evk",
 	"fsl,imx28",
 	NULL,
author
#10 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

Quoted 5 lines · Marek Vasut

arch/arm/boot/dts/imx28.dtsi

Quoted 4 lines
arch/arm/boot/dts/imx28.dtsi +4 -0
+				pwm3_pins_a: pwm3 at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x31c0 /* MX28_PAD_PWM3__PWM_3 

*/

Quoted 8 lines

arch/arm/boot/dts/imx28.dtsi line 244

Quoted 5 lines
arch/arm/boot/dts/imx28.dtsi +5 -0
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};

Drop the pwm3 stuff, it's not used.

Okay. I saw the following in mach-m28evk.c, and thought it's being used by backlight. But you knows it better than me.

static const iomux_cfg_t m28evk_pads[] __initconst = {
	...
        /* Backlight */
        MX28_PAD_PWM3__GPIO_3_28 | MXS_PAD_CTRL,
};
Quoted 11 lines

arch/arm/boot/dts/m28evk.dts

Quoted 8 lines
arch/arm/boot/dts/m28evk.dts new file +8 -0
+			pinctrl at 80018000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&hog_pins_a>;
+
+				hog_pins_a: hog-gpios at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x30a3 /* 

MX28_PAD_AUART2_CTS__GPIO_3_10 */

Review

Quoted 1 line
(quoted diff) +1 -0
+						0x30b3 /* 

MX28_PAD_AUART2_RTS__GPIO_3_11 */

These two were copied from your initial m28evk DTS file, which says GPIO_3_10 is used as wp-gpios of mmc0 and GPIO_3_11 is used as phy-reset-gpios of fec.

Quoted 9 lines

Review

Quoted 1 line
(quoted diff) +1 -0
+						0x3103 /* 

MX28_PAD_PWM0__GPIO_3_16 */

Review

Quoted 1 line
(quoted diff) +1 -0
+						0x3113 /* 

MX28_PAD_PWM1__GPIO_3_17 */

From what mach-m28evk.c tells, they are used as m28evk_leds.

What's this part for ?

See above.

Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/imx28.dtsi +5 -0
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};

<snip>

Quoted 4 lines

arch/arm/boot/dts/m28evk.dts line 219

Quoted 1 line
arch/arm/boot/dts/m28evk.dts new file +1 -0
+	leds {

Drop the led section, it's some ancient nonsense from who-knows-where :-(

Okay. Now I know why you have above comment.

Quoted 10 lines
Quoted 10 lines
arch/arm/boot/dts/m28evk.dts new file +10 -0
+		compatible = "gpio-leds";
+
+		user1 {
+			label = "Heartbeat1";
+			gpios = <&gpio3 16 0>;
+			linux,default-trigger = "heartbeat";
+		};
+
+		user2 {
+			label = "Heartbeat2";
Quoted 9 lines

arch/arm/boot/dts/m28evk.dts line 235

Quoted 6 lines
arch/arm/boot/dts/m28evk.dts new file +6 -0
+			gpios = <&gpio3 17 0>;
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	backlight {

Drop this backlight too please.

Okay.

Quoted 6 lines
Quoted 6 lines
arch/arm/boot/dts/m28evk.dts new file +6 -0
+		compatible = "pwm-backlight";
+		pwms = <&pwm 3 5000000>;
+		brightness-levels = <0 4 8 16 32 64 128 255>;
+		default-brightness-level = <6>;
+	};
+};

<snip>

Quoted 12 lines
Quoted 12 lines
arch/arm/mach-mxs/mach-mxs.c +10 -0
+static void __init m28evk_init(void)
+{
+	update_fec_mac_prop(OUI_DENX);
+
+	mxsfb_pdata.mode_list = m28evk_video_modes;
+	mxsfb_pdata.mode_count = ARRAY_SIZE(m28evk_video_modes);
+	mxsfb_pdata.default_bpp = 16;
+	mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
+}
+
 static void __init mxs_machine_init(void)
 {
Quoted 9 lines

arch/arm/mach-mxs/mach-mxs.c static void __init imx28_evk_init(void) · line 240

Quoted 6 lines
arch/arm/mach-mxs/mach-mxs.c +2 -0
 	if (of_machine_is_compatible("fsl,imx28-evk"))
 		imx28_evk_init();
 	else if (of_machine_is_compatible("fsl,imx23-evk"))
 		imx23_evk_init();
+	else if (of_machine_is_compatible("denx,m28evk"))
+		m28evk_init();

I think you need to call imx28_evk_init() here ?

Eh, why?

Quoted 11 lines
Quoted 11 lines
arch/arm/mach-mxs/mach-mxs.c +1 -0
 	of_platform_populate(NULL, of_default_bus_match_table,
 			     mxs_auxdata_lookup, NULL);
@@ -223,6 +252,7 @@ static const char *imx23_dt_compat[] __initdata = {
 
 static const char *imx28_dt_compat[] __initdata = {
 	"crystalfontz,cfa10036",
+	"denx,m28evk",
 	"fsl,imx28-evk",
 	"fsl,imx28",
 	NULL,
Signature · 2 lines
Regards,
Shawn
#11 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

Dear Shawn Guo,

[...]

Quoted 4 lines
Quoted 1 line

Drop the pwm3 stuff, it's not used.

Okay. I saw the following in mach-m28evk.c, and thought it's being used by backlight. But you knows it better than me.

Well ... the support for that board that's in current mainline is pretty deprecated. And I wasn't really able to update it due to all the DT hype, you know the rest of the story more then well etc. etc.

Quoted 17 lines
static const iomux_cfg_t m28evk_pads[] __initconst = {
	...
        /* Backlight */
        MX28_PAD_PWM3__GPIO_3_28 | MXS_PAD_CTRL,
};
Quoted 11 lines

arch/arm/boot/dts/m28evk.dts

Quoted 8 lines
arch/arm/boot/dts/m28evk.dts new file +8 -0
+			pinctrl at 80018000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&hog_pins_a>;
+
+				hog_pins_a: hog-gpios at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x30a3 /*

MX28_PAD_AUART2_CTS__GPIO_3_10 */

Quoted 7 lines
Quoted 3 lines

Review

Quoted 1 line
(quoted diff) +1 -0
+						0x30b3 /*

MX28_PAD_AUART2_RTS__GPIO_3_11 */

These two were copied from your initial m28evk DTS file, which says GPIO_3_10 is used as wp-gpios of mmc0 and GPIO_3_11 is used as phy-reset-gpios of fec.

Ah. Leave them there then. Just checked, they're correct.

Quoted 9 lines
Quoted 7 lines

Review

Quoted 1 line
(quoted diff) +1 -0
+						0x3103 /*

MX28_PAD_PWM0__GPIO_3_16 */

Review

Quoted 1 line
(quoted diff) +1 -0
+						0x3113 /*

MX28_PAD_PWM1__GPIO_3_17 */

From what mach-m28evk.c tells, they are used as m28evk_leds.

There're no leds on the thing that are controlled by GPIOs.

[...]

Quoted 6 lines
Quoted 4 lines

arch/arm/mach-mxs/mach-mxs.c static void __init imx28_evk_init(void) · line 240

Quoted 2 lines
arch/arm/mach-mxs/mach-mxs.c +2 -0
+	else if (of_machine_is_compatible("denx,m28evk"))
+		m28evk_init();

I think you need to call imx28_evk_init() here ?

Eh, why?

To start the enet_out clock.

[...]

Best regards,
Marek Vasut

author
#12 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

Quoted 4 lines · Marek Vasut

Well ... the support for that board that's in current mainline is pretty deprecated. And I wasn't really able to update it due to all the DT hype, you know the rest of the story more then well etc. etc.

Let's remove it then :)

Quoted 2 lines

To start the enet_out clock.

Will take care of it in m28evk_init().

Signature · 2 lines
Regards,
Shawn
#13 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

Dear Shawn Guo,

Quoted 6 lines · Marek Vasut
Quoted 3 lines

Well ... the support for that board that's in current mainline is pretty deprecated. And I wasn't really able to update it due to all the DT hype, you know the rest of the story more then well etc. etc.

Let's remove it then :)

Yea.

Quoted 3 lines
Quoted 1 line

To start the enet_out clock.

Will take care of it in m28evk_init().

But almost every board needs that hack ... won't it be easier to make it into default behavior? Or can we not somehow configure this via DT itself?

Best regards,
Marek Vasut

author
#14 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

Quoted 3 lines · Marek Vasut

But almost every board needs that hack ... won't it be easier to make it into default behavior? Or can we not somehow configure this via DT itself?

Yeah, after adopting clock DT bindings, we can make it via DT.

Signature · 2 lines
Regards,
Shawn
#15 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

In reply to Shawn Guo

Dear Shawn Guo,

[...]

Shouldn't MACH_MXS_DT now select MXS_OCOTP ? It kinda doesn't compile without it.

Best regards,
Marek Vasut

author
#16 lore raw

PATCH 3/7 ARM: mxs: convert m28evk board to device tree

Quoted 7 lines · Marek Vasut

Dear Shawn Guo,

[...]

Shouldn't MACH_MXS_DT now select MXS_OCOTP ? It kinda doesn't compile without it.

Yes, you are right. However, I'm considering to remove both MXS_OCOTP and MACH_MXS_DT and have them always compiled. When we convert all those board files to DT, mach-mxs.c will be always built and all those MACH_* will no longer exist.

Signature · 2 lines
Regards,
Shawn
author
#17 lore raw

PATCH 4/7 ARM: mxs: convert apx4devkit board to device tree

In reply to Shawn Guo
Cc Lauri Hintsala <[email protected]>
---
 arch/arm/boot/dts/apx4devkit.dts |  143 ++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx28.dtsi     |   33 +++++++++
 arch/arm/mach-mxs/mach-mxs.c     |   23 ++++++
 3 files changed, 199 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/apx4devkit.dts
arch/arm/boot/dts/apx4devkit.dts new file +143 -0
new file mode 100644
index 0000000..a670a90
@@ -0,0 +1,143 @@
+/dts-v1/;
+/include/ "imx28.dtsi"
+
+/ {
+	model = "Bluegiga APX4 Development Kit";
+	compatible = "bluegiga,apx4devkit", "fsl,imx28";
+
+	memory {
+		reg = <0x40000000 0x04000000>;
+	};
+
+	apb at 80000000 {
+		apbh at 80000000 {
+			ssp0: ssp at 80010000 {
+				compatible = "fsl,imx28-mmc";
+				pinctrl-names = "default";
+				pinctrl-0 = <&mmc0_8bit_pins_a
+					     &mmc0_cd_cfg
+					     &mmc0_sck_cfg>;
+				bus-width = <8>;
+				status = "okay";
+			};
+
+			pinctrl at 80018000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&hog_pins_a>;
+
+				hog_pins_a: hog-gpios at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x31c3 /* MX28_PAD_PWM3__GPIO_3_28 */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+			};
+		};
+
+		apbx at 80040000 {
+			saif0: saif at 80042000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&saif0_pins_a>;
+				status = "okay";
+			};
+
+			saif1: saif at 80046000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&saif1_pins_a>;
+				fsl,saif-master = <&saif0>;
+				status = "okay";
+			};
+
+			i2c0: i2c at 80058000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&i2c0_pins_a>;
+				status = "okay";
+
+				sgtl5000: codec at 0a {
+					compatible = "fsl,sgtl5000";
+					reg = <0x0a>;
+					VDDA-supply = <&reg_3p3v>;
+					VDDIO-supply = <&reg_3p3v>;
+
+				};
+
+				pcf8563: rtc at 51 {
+					compatible = "phg,pcf8563";
+					reg = <0x51>;
+				};
+			};
+
+			duart: serial at 80074000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&duart_pins_a>;
+				status = "okay";
+			};
+
+			auart0: serial at 8006a000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&auart0_pins_a>;
+				status = "okay";
+			};
+
+			auart1: serial at 8006c000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&auart1_2pins_a>;
+				status = "okay";
+			};
+
+			auart2: serial at 8006e000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&auart2_2pins_a>;
+				status = "okay";
+			};
+
+			auart3: serial at 80070000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&auart3_2pins_a>;
+				status = "okay";
+			};
+		};
+	};
+
+	ahb at 80080000 {
+		mac0: ethernet at 800f0000 {
+			phy-mode = "rmii";
+			pinctrl-names = "default";
+			pinctrl-0 = <&mac0_pins_a>;
+			status = "okay";
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+
+		reg_3p3v: 3p3v {
+			compatible = "regulator-fixed";
+			regulator-name = "3P3V";
+			regulator-min-microvolt = <3300000>;
+			regulator-max-microvolt = <3300000>;
+			regulator-always-on;
+		};
+	};
+
+	sound {
+		compatible = "fsl,imx28-evk-sgtl5000",
+			     "fsl,mxs-audio-sgtl5000";
+		model = "imx28-evk-sgtl5000";
+		saif-controllers = <&saif0 &saif1>;
+		audio-codec = <&sgtl5000>;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		user {
+			label = "Heartbeat";
+			gpios = <&gpio3 28 0>;
+			linux,default-trigger = "heartbeat";
+		};
+	};
+};
arch/arm/boot/dts/imx28.dtsi +33 -0
index 3390607..73578cb 100644
@@ -243,6 +243,28 @@
 					fsl,pull-up = <0>;
 				};
 
+				auart1_2pins_a: auart1-2pins at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x3040 /* MX28_PAD_AUART1_RX__AUART1_RX */
+						0x3050 /* MX28_PAD_AUART1_TX__AUART1_TX */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
+				auart2_2pins_a: auart2-2pins at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x2101 /* MX28_PAD_SSP2_SCK__AUART2_RX */
+						0x2111 /* MX28_PAD_SSP2_MOSI__AUART2_TX */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
 				auart3_pins_a: auart3 at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <
@@ -256,6 +278,17 @@
 					fsl,pull-up = <0>;
 				};
 
+				auart3_2pins_a: auart3-2pins at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x2121 /* MX28_PAD_SSP2_MISO__AUART3_RX */
+						0x2131 /* MX28_PAD_SSP2_SS0__AUART3_TX */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
 				mac0_pins_a: mac0 at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <
arch/arm/mach-mxs/mach-mxs.c +23 -0
index 6bb6db8..646bac5 100644
@@ -16,9 +16,11 @@
 #include <linux/init.h>
 #include <linux/init.h>
 #include <linux/irqdomain.h>
+#include <linux/micrel_phy.h>
 #include <linux/mxsfb.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
+#include <linux/phy.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 #include <mach/common.h>
@@ -230,6 +232,24 @@ static void __init m28evk_init(void)
 	mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
 }
 
+static int apx4devkit_phy_fixup(struct phy_device *phy)
+{
+	phy->dev_flags |= MICREL_PHY_50MHZ_CLK;
+	return 0;
+}
+
+static void __init apx4devkit_init(void)
+{
+	struct clk *clk = clk_get_sys("enet_out", NULL);
+
+	if (!IS_ERR(clk))
+		clk_prepare_enable(clk);
+
+	if (IS_BUILTIN(CONFIG_PHYLIB))
+		phy_register_fixup_for_uid(PHY_ID_KS8051, MICREL_PHY_ID_MASK,
+					   apx4devkit_phy_fixup);
+}
+
 static void __init mxs_machine_init(void)
 {
 	if (of_machine_is_compatible("fsl,imx28-evk"))
@@ -238,6 +258,8 @@ static void __init mxs_machine_init(void)
 		imx23_evk_init();
 	else if (of_machine_is_compatible("denx,m28evk"))
 		m28evk_init();
+	else if (of_machine_is_compatible("bluegiga,apx4devkit"))
+		apx4devkit_init();
 
 	of_platform_populate(NULL, of_default_bus_match_table,
 			     mxs_auxdata_lookup, NULL);
@@ -251,6 +273,7 @@ static const char *imx23_dt_compat[] __initdata = {
 };
 
 static const char *imx28_dt_compat[] __initdata = {
+	"bluegiga,apx4devkit",
 	"crystalfontz,cfa10036",
 	"denx,m28evk",
 	"fsl,imx28-evk",
Signature · 1 line
1.7.5.4
#18 lore raw

PATCH 4/7 ARM: mxs: convert apx4devkit board to device tree

Quoted 8 lines · Shawn Guo
Cc Lauri Hintsala <[email protected]>
---
  arch/arm/boot/dts/apx4devkit.dts |  143 ++++++++++++++++++++++++++++++++++++++
  arch/arm/boot/dts/imx28.dtsi     |   33 +++++++++
  arch/arm/mach-mxs/mach-mxs.c     |   23 ++++++
  3 files changed, 199 insertions(+), 0 deletions(-)

create mode 100644 arch/arm/boot/dts/apx4devkit.dts

Apx4devkit boots up and works fine with DT. I would like to add support for NAND, display, SSP2, etc... I'll send patches tomorrow.

Thanks!

Lauri

author
#19 lore raw

PATCH 4/7 ARM: mxs: convert apx4devkit board to device tree

Quoted 10 lines · Lauri Hintsala
Quoted 8 lines · Shawn Guo
Cc Lauri Hintsala <[email protected]>
---
 arch/arm/boot/dts/apx4devkit.dts |  143 ++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx28.dtsi     |   33 +++++++++
 arch/arm/mach-mxs/mach-mxs.c     |   23 ++++++
 3 files changed, 199 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/apx4devkit.dts
Quoted 3 lines

Apx4devkit boots up and works fine with DT. I would like to add support for NAND, display, SSP2, etc... I'll send patches tomorrow.

Thanks, Lauri. Can I add your Tested-by?

Signature · 2 lines
Regards,
Shawn
#20 lore raw

PATCH 4/7 ARM: mxs: convert apx4devkit board to device tree

Quoted 4 lines · Shawn Guo
Quoted 3 lines

Apx4devkit boots up and works fine with DT. I would like to add support for NAND, display, SSP2, etc... I'll send patches tomorrow.

Thanks, Lauri. Can I add your Tested-by?

Yes, you can.

Lauri

author
#21 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

In reply to Shawn Guo

The function tx28_init is basically a rewriting of tx28_add_fec0. All those TX28_FEC_* gpio definitions are meant to be used as a temporary solution before we get a generic way to set up board specific gpio pins when booting from device tree.

Cc Lothar Wa?mann <[email protected]>
---
 arch/arm/boot/dts/imx28.dtsi |   36 +++++++++++++
 arch/arm/boot/dts/tx28.dts   |  112 ++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-mxs/mach-mxs.c |   48 +++++++++++++++++-
 3 files changed, 195 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/boot/dts/tx28.dts
arch/arm/boot/dts/imx28.dtsi +36 -0
index 73578cb..518236b 100644
@@ -186,6 +186,19 @@
 					fsl,pull-up = <0>;
 				};
 
+				duart_4pins_a: duart-4pins at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x3022 /* MX28_PAD_AUART0_CTS__DUART_RX */
+						0x3032 /* MX28_PAD_AUART0_RTS__DUART_TX */
+						0x3002 /* MX28_PAD_AUART0_RX__DUART_CTS */
+						0x3012 /* MX28_PAD_AUART0_TX__DUART_RTS */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
 				gpmi_pins_a: gpmi-nand at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <
@@ -243,6 +256,19 @@
 					fsl,pull-up = <0>;
 				};
 
+				auart1_pins_a: auart1 at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x3040 /* MX28_PAD_AUART1_RX__AUART1_RX */
+						0x3050 /* MX28_PAD_AUART1_TX__AUART1_TX */
+						0x3060 /* MX28_PAD_AUART1_CTS__AUART1_CTS */
+						0x3070 /* MX28_PAD_AUART1_RTS__AUART1_RTS */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
 				auart1_2pins_a: auart1-2pins at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <
@@ -407,6 +433,16 @@
 					fsl,pull-up = <1>;
 				};
 
+				pwm0_pins_a: pwm0 at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x3100 /* MX28_PAD_PWM0__PWM_0 */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
 				pwm2_pins_a: pwm2 at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <
arch/arm/boot/dts/tx28.dts new file +112 -0

112 lines not on this page · raw message

arch/arm/mach-mxs/mach-mxs.c +47 -1

79 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#22 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

Hi Shawn,

Quoted 5 lines · Shawn Guo

The function tx28_init is basically a rewriting of tx28_add_fec0. All those TX28_FEC_* gpio definitions are meant to be used as a temporary solution before we get a generic way to set up board specific gpio pins when booting from device tree.

This doesn't work at least because the pins that are used for PHY strap options need to be reconfigured for their FEC functionality after releasing the PHY reset. But even after adding the missing reconfiguration the ethernet PHY does not work.

Since I currently don't have time to delve deeper into this, you may drop the TX28 board support until I get time to do the conversion to DT myself.

Lothar Wa?mann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
author
#23 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

Quoted 3 lines · Lothar Wa?mann

This doesn't work at least because the pins that are used for PHY strap options need to be reconfigured for their FEC functionality after releasing the PHY reset.

Ah, right. I missed that the pins used for PHY strap options are actually FEC pins.

Quoted 3 lines

But even after adding the missing
reconfiguration the ethernet PHY does not work.

How did you do that? Since the pins will be switched between GPIO and FEC functionality, they should not be defined in "hog" node any more. It becomes difficult.

Quoted 4 lines

Since I currently don't have time to delve deeper into this, you may drop the TX28 board support until I get time to do the conversion to DT myself.

I plan to convert all the board files to DT and make the whole mach-mxs DT only, and then more cleanup works can be proceeded. It's much preferred you can work on it yourself, if you can get to this soon. Otherwise, I can remotely work it out with your help on testing? ;)

Signature · 2 lines
Regards,
Shawn
author
#24 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

In reply to Lothar Waßmann

Hi Lothar,

Quoted 5 lines · Lothar Wa?mann

This doesn't work at least because the pins that are used for PHY strap options need to be reconfigured for their FEC functionality after releasing the PHY reset. But even after adding the missing reconfiguration the ethernet PHY does not work.

Can you please test the branch below to see if ethernet PHY works?

git://git.linaro.org/people/shawnguo/linux-2.6.git mxs/dt/tx28

I hope I have addressed the issue with pin configuration there. But I'm not sure if "enet_out" clock needs to be enabled on tx28. I have enabled it in the code above. You need to remove enable_clk_enet_out call from tx28_init, if it's not needed.

Signature · 2 lines
Regards,
Shawn
#25 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

Quoted 10 lines · Shawn Guo

Hi Lothar,

Quoted 5 lines · Lothar Wa?mann

This doesn't work at least because the pins that are used for PHY strap options need to be reconfigured for their FEC functionality after releasing the PHY reset. But even after adding the missing reconfiguration the ethernet PHY does not work.

Can you please test the branch below to see if ethernet PHY works?

No. See bootlog below.

The following patch is required for the kernel to build:

arch/arm/mach-mxs/Kconfig +1 -0
@@ -82,6 +82,7 @@ config MODULE_TX28
 	select MXS_HAVE_PLATFORM_MXS_MMC
 	select MXS_HAVE_PLATFORM_MXS_PWM
 	select MXS_HAVE_PLATFORM_RTC_STMP3XXX
+	select MXS_OCOTP
 
 config MODULE_M28
 	bool
Quoted 7 lines

git://git.linaro.org/people/shawnguo/linux-2.6.git mxs/dt/tx28

I hope I have addressed the issue with pin configuration there. But I'm not sure if "enet_out" clock needs to be enabled on tx28. I have enabled it in the code above. You need to remove enable_clk_enet_out call from tx28_init, if it's not needed.

ENET_CLK is required on the module.

## Booting kernel from Legacy Image at 40100000 ...

   Image Name:   Linux-3.5.0-rc6-next-20120712-ka
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2277008 Bytes = 2.2 MiB

Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.5.0-rc6-next-20120712-karo+ (lothar at ipc1) (gcc version 4.5.3 (GCC) ) #5 PREEMPT Fri Jul 13 11:06
:19 CEST 2012
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Ka-Ro electronics TX28 module
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 32768
free_area_init_node: node 0, pgdat c046db28, node_mem_map c04a8000
Normal zone: 256 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 32512 pages, LIFO batch:7
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: init=/linuxrc mtdparts=gpmi-nand:128k at 0x20000(env),1m(u-boot),4m(linux),16m(rootfs),-(userfs) root=/dev/nfs nfsroot=192.168.1.225:/tftpboot/KARO/imx28-new,nolock ip=bootp debug panic=1 console=ttyAMA0,115200 ro PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 125136k/125136k available, 5936k reserved, 0K highmem
Virtual kernel memory layout:

    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
    lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc0419d40   (4168 kB)
      .init : 0xc041a000 - 0xc043be28   ( 136 kB)
      .data : 0xc043c000 - 0xc046e540   ( 202 kB)
       .bss : 0xc046e564 - 0xc04a7020   ( 227 kB)

SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 NR_IRQS:304
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
Console: colour dummy device 80x30
Calibrating delay loop... 226.09 BogoMIPS (lpj=1130496)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x402fc958 - 0x402fc9b0

------------[ cut here ]------------
WARNING: at /usr/local/src/arm/projects/imx28/linux-tx28-dt/kernel/workqueue.c:1217 worker_enter_idle+0x114/0x13
0()
Modules linked in:
[<c001381c>] (unwind_backtrace+0x0/0xe4) from [<c001adf8>] (warn_slowpath_common+0x4c/0x64)
[<c001adf8>] (warn_slowpath_common+0x4c/0x64) from [<c001ae28>] (warn_slowpath_null+0x18/0x1c)
[<c001ae28>] (warn_slowpath_null+0x18/0x1c) from [<c0030304>] (worker_enter_idle+0x114/0x130)
[<c0030304>] (worker_enter_idle+0x114/0x130) from [<c0030348>] (start_worker+0x28/0x34)
[<c0030348>] (start_worker+0x28/0x34) from [<c0420954>] (init_workqueues+0x144/0x2bc)
[<c0420954>] (init_workqueues+0x144/0x2bc) from [<c00088e4>] (do_one_initcall+0x9c/0x174)
[<c00088e4>] (do_one_initcall+0x9c/0x174) from [<c041a7b0>] (kernel_init+0x50/0x1b4)
[<c041a7b0>] (kernel_init+0x50/0x1b4) from [<c000f464>] (kernel_thread_exit+0x0/0x8)
---[ end trace 84ec6457efae102a ]---

devtmpfs: initialized
pinctrl core: initialized pinctrl subsystem
dummy:
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
gpiochip_add: registered GPIOs 0 to 31 on device: imx28-gpio.0
gpiochip_add: registered GPIOs 32 to 63 on device: imx28-gpio.1
gpiochip_add: registered GPIOs 64 to 95 on device: imx28-gpio.2
gpiochip_add: registered GPIOs 96 to 127 on device: imx28-gpio.3
gpiochip_add: registered GPIOs 128 to 159 on device: imx28-gpio.4
Serial: AMBA PL011 UART driver
duart: ttyAMA0 at MMIO 0x80074000 (irq = 47) is a PL011 rev2 console [ttyAMA0] enabled
bio: create slab <bio-0> at 0
mxs-dma imx28-dma-apbh: initialized
mxs-dma imx28-dma-apbx: initialized
Switching to clocksource mxs_timer
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes) TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module. NetWinder Floating Point Emulator V0.97 (double precision)
NFS: Registering the id_resolver key type
Key type id_resolver registered
jffs2: version 2.2. (NAND) (SUMMARY) ?? 2001-2006 Red Hat, Inc. msgmni has been set to 244
alg: No test for stdrng (krng)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252) io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
uart-pl011 duart: no DMA platform data
mxs-auart.1: ttyAPP1 at MMIO 0x8006c000 (irq = 113) is a mxs-auart.1 mxs-auart mxs-auart.1: Found APPUART 3.1.0
brd: module loaded
loop: module loaded
GPMI NAND driver registered. (IMX)
libphy: fec_enet_mii_bus: probed
mousedev: PS/2 mouse device common for all mice
rtc-ds1307 0-0068: SET TIME!
rtc-ds1307 0-0068: rtc core: registered ds1339 as rtc0 stmp3xxx-rtc stmp3xxx-rtc.0: rtc core: registered stmp3xxx-rtc as rtc1 Registered led device: GPIO-LED
TCP: cubic registered
NET: Registered protocol family 17
Key type dns_resolver registered
rtc-ds1307 0-0068: setting system clock to 2000-01-01 00:00:33 UTC (946684833)
eth0: no PHY, assuming direct connection to switch
libphy: PHY fixed-0:00 not found
eth0: could not attach to PHY
IP-Config: Failed to open eth0
IP-Config: No network devices available
script "uboot": global timeout
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6 Please append a correct "root=" boot option; here are the available partitions:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[<c001381c>] (unwind_backtrace+0x0/0xe4) from [<c02fa1e0>] (panic+0x90/0x1e8)
[<c02fa1e0>] (panic+0x90/0x1e8) from [<c041ac94>] (mount_block_root+0x1d4/0x230)
[<c041ac94>] (mount_block_root+0x1d4/0x230) from [<c041aee4>] (mount_root+0xd0/0xf0)
[<c041aee4>] (mount_root+0xd0/0xf0) from [<c041b054>] (prepare_namespace+0x150/0x1b0)
[<c041b054>] (prepare_namespace+0x150/0x1b0) from [<c041a8cc>] (kernel_init+0x16c/0x1b4)
[<c041a8cc>] (kernel_init+0x16c/0x1b4) from [<c000f464>] (kernel_thread_exit+0x0/0x8)

Rebooting in 1 seconds..

Lothar Wa?mann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
#26 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

Quoted 4 lines · Lothar Wa?mann
Quoted 3 lines · Shawn Guo

Hi Lothar,

On Mon, Jul 09, 2012 at 03:04:53PM +0200, Lothar Wa?mann wrote:

Quoted 9 lines
Quoted 7 lines
Quoted 5 lines

This doesn't work at least because the pins that are used for PHY strap options need to be reconfigured for their FEC functionality after releasing the PHY reset. But even after adding the missing reconfiguration the ethernet PHY does not work.

Can you please test the branch below to see if ethernet PHY works?

No. See bootlog below.

Thanks for testing, Lothar. But from the boot log below, the kernel did a non-DT boot rather than a boot from device tree. More on this below. But does that mean ethernet PHY does not work even on non-DT kernel right now?

Quoted 1 line

The following patch is required for the kernel to build:

Yes, Marek has reported that. But I'm not so fond of fixing it right away like that, since mxs_defconfig has it enabled with board file support and does not expose the problem.

Instead, I would really like to remove those board files with equivalent device tree support, and build in mach-mxs.c and ocotp.c all the time.

Quoted 11 lines
arch/arm/mach-mxs/Kconfig +1 -0
@@ -82,6 +82,7 @@ config MODULE_TX28
 	select MXS_HAVE_PLATFORM_MXS_MMC
 	select MXS_HAVE_PLATFORM_MXS_PWM
 	select MXS_HAVE_PLATFORM_RTC_STMP3XXX
+	select MXS_OCOTP
 
 config MODULE_M28
 	bool
Quoted 9 lines
Quoted 7 lines

git://git.linaro.org/people/shawnguo/linux-2.6.git mxs/dt/tx28

I hope I have addressed the issue with pin configuration there. But I'm not sure if "enet_out" clock needs to be enabled on tx28. I have enabled it in the code above. You need to remove enable_clk_enet_out call from tx28_init, if it's not needed.

ENET_CLK is required on the module.

Ok, got it.

Quoted 13 lines

## Booting kernel from Legacy Image at 40100000 ...

   Image Name:   Linux-3.5.0-rc6-next-20120712-ka
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2277008 Bytes = 2.2 MiB

Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Quoted 7 lines

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.5.0-rc6-next-20120712-karo+ (lothar at ipc1) (gcc version 4.5.3 (GCC) ) #5 PREEMPT Fri Jul 13 11:06 :19 CEST 2012
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Ka-Ro electronics TX28 module

This line tells that the kernel is doing a traditional non-DT boot. If the kernel boots from device tree, you should see the following line instead.

Machine: Freescale i.MX28 (Device Tree), model: Ka-Ro electronics TX28 module

I'm not sure if you have your bootloader passes dtb to kernel or use append-dtb approach. In the later case, here are the brief instructions.

- Enable CONFIG_ARM_APPENDED_DTB and CONFIG_ARM_ATAG_DTB_COMPAT
- Build kernel
- make ARCH=arm imx28-tx28.dtb
- cat arch/arm/boot/zImage arch/arm/boot/imx28-tx28.dtb > arch/arm/boot/zImage_dtb
- Boot zImage_dtb like you boot zImage as usual

Signature · 2 lines
Regards,
Shawn
#27 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

Quoted 3 lines · Shawn Guo

below. But does that mean ethernet PHY does not work even on non-DT kernel right now?

So I guess you need something like c46d291 (ARM: apx4devkit: fix FEC enabling PHY clock) for TX28 too.

Signature · 2 lines
Regards,
Shawn
#28 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

Hi,

Quoted 7 lines · Shawn Guo
Quoted 3 lines · Shawn Guo

below. But does that mean ethernet PHY does not work even on non-DT kernel right now?

So I guess you need something like c46d291 (ARM: apx4devkit: fix FEC enabling PHY clock) for TX28 too.

That's already in place.

Lothar Wa?mann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
author
#29 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

Quoted 12 lines · Lothar Wa?mann

Hi,

Quoted 7 lines · Shawn Guo
Quoted 3 lines · Shawn Guo

below. But does that mean ethernet PHY does not work even on non-DT kernel right now?

So I guess you need something like c46d291 (ARM: apx4devkit: fix FEC enabling PHY clock) for TX28 too.

That's already in place.

Are you using and talking about the branch I prepared for you? I haven't seen it there.

Shawn

#30 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

Hi,

Quoted 8 lines · Lothar Wa?mann
Quoted 7 lines

Hi,

Quoted 4 lines · Shawn Guo
Quoted 3 lines · Shawn Guo

below. But does that mean ethernet PHY does not work even on non-DT kernel right now?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

So I guess you need something like c46d291 (ARM: apx4devkit: fix FEC enabling PHY clock) for TX28 too.

That's already in place.

Are you using and talking about the branch I prepared for you? I haven't seen it there.

I'm using:
git-remote -v

|origin  git://git.linaro.org/people/shawnguo/linux-2.6.git (fetch)
|origin  git://git.linaro.org/people/shawnguo/linux-2.6.git (push)

git-branch -a

|  mxs/dt/others
|* tx28
|  remotes/origin/HEAD -> origin/master
|  remotes/origin/clk/mxs-for-3.6
|  remotes/origin/imx/cleanup-for-3.6
|  remotes/origin/imx/dt-for-3.6
|  remotes/origin/imx/irqdomain
|  remotes/origin/imx/sparse-irq
|  remotes/origin/master
|  remotes/origin/mxs/defconfig-for-3.6
|  remotes/origin/mxs/dt-for-3.6
|  remotes/origin/mxs/dt/others
|  remotes/origin/mxs/dt/tx28
|  remotes/origin/mxs/fixes-for-3.5
|  remotes/origin/mxs/fixes-for-3.6
|  remotes/origin/mxs/test

where 'tx28' is checked out from remotes/origin/mxs/dt/tx28.

git-show c46d291
commit c46d2916f6c03d3c8a2c38148af2e45cdadaf61f

Author: Lauri Hintsala <[email protected]>
Date:   Thu Jul 5 10:31:36 2012 +0300

ARM: apx4devkit: fix FEC enabling PHY clock

Ethernet stopped to work after mxs clk framework change.

arch/arm/mach-mxs/mach-apx4devkit.c +11 -0
index 5e90b9d..f5f0617 100644
@@ -205,6 +205,16 @@ static int apx4devkit_phy_fixup(struct phy_device *phy)
        return 0;
 }
 
+static void __init apx4devkit_fec_phy_clk_enable(void)
+{
+       struct clk *clk;
+
+       /* Enable fec phy clock */
+       clk = clk_get_sys("enet_out", NULL);
+       if (!IS_ERR(clk))
+               clk_prepare_enable(clk);
+}
+
 static void __init apx4devkit_init(void)
 {
        mx28_soc_init();
@@ -225,6 +235,7 @@ static void __init apx4devkit_init(void)
        phy_register_fixup_for_uid(PHY_ID_KS8051, MICREL_PHY_ID_MASK,
                        apx4devkit_phy_fixup);
 
+       apx4devkit_fec_phy_clk_enable();
        mx28_add_fec(0, &mx28_fec_pdata);
 
        mx28_add_mxs_mmc(0, &apx4devkit_mmc_pdata);

Lothar Wa?mann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
author
#31 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

Quoted 2 lines · Lothar Wa?mann

where 'tx28' is checked out from remotes/origin/mxs/dt/tx28.

Yes, the branch is right. But the following patch only fixes board apx4devkit. What I meant is we probably need to apply the same change for TX28 board.

Regards,
Shawn

Quoted 54 lines

git-show c46d291
commit c46d2916f6c03d3c8a2c38148af2e45cdadaf61f

Author: Lauri Hintsala <[email protected]>
Date:   Thu Jul 5 10:31:36 2012 +0300

ARM: apx4devkit: fix FEC enabling PHY clock

Ethernet stopped to work after mxs clk framework change.

arch/arm/mach-mxs/mach-apx4devkit.c +11 -0
index 5e90b9d..f5f0617 100644
@@ -205,6 +205,16 @@ static int apx4devkit_phy_fixup(struct phy_device *phy)
        return 0;
 }
 
+static void __init apx4devkit_fec_phy_clk_enable(void)
+{
+       struct clk *clk;
+
+       /* Enable fec phy clock */
+       clk = clk_get_sys("enet_out", NULL);
+       if (!IS_ERR(clk))
+               clk_prepare_enable(clk);
+}
+
 static void __init apx4devkit_init(void)
 {
        mx28_soc_init();
@@ -225,6 +235,7 @@ static void __init apx4devkit_init(void)
        phy_register_fixup_for_uid(PHY_ID_KS8051, MICREL_PHY_ID_MASK,
                        apx4devkit_phy_fixup);
 
+       apx4devkit_fec_phy_clk_enable();
        mx28_add_fec(0, &mx28_fec_pdata);
 
        mx28_add_mxs_mmc(0, &apx4devkit_mmc_pdata);

Lothar Wa?mann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
#32 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

In reply to Shawn Guo

Hi,

Quoted 10 lines · Shawn Guo
Quoted 9 lines · Lothar Wa?mann
Quoted 8 lines · Shawn Guo

Hi Lothar,

Quoted 5 lines · Lothar Wa?mann

This doesn't work at least because the pins that are used for PHY strap options need to be reconfigured for their FEC functionality after releasing the PHY reset. But even after adding the missing reconfiguration the ethernet PHY does not work.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Can you please test the branch below to see if ethernet PHY works?

No. See bootlog below.

Thanks for testing, Lothar. But from the boot log below, the kernel did a non-DT boot rather than a boot from device tree. More on this

I compiled the kernel with DT support, but just the TX28 board selected. When selecting an additional i.MX28 board, the kernel doesn't boot at all any more. Does this mean in order to get a kernel with DT support one has to select at least two different platforms? Is this behaviour intended?

Quoted 3 lines

below. But does that mean ethernet PHY does not work even on non-DT kernel right now?

Seems so.

Quoted 9 lines
Quoted 1 line

The following patch is required for the kernel to build:

Yes, Marek has reported that. But I'm not so fond of fixing it right away like that, since mxs_defconfig has it enabled with board file support and does not expose the problem.

Instead, I would really like to remove those board files with equivalent device tree support, and build in mach-mxs.c and ocotp.c all the time.

OK.

Quoted 10 lines

This line tells that the kernel is doing a traditional non-DT boot. If the kernel boots from device tree, you should see the following line instead.

Machine: Freescale i.MX28 (Device Tree), model: Ka-Ro electronics TX28 module

I'm not sure if you have your bootloader passes dtb to kernel or use append-dtb approach. In the later case, here are the brief instructions.

Quoted 6 lines

- Enable CONFIG_ARM_APPENDED_DTB and CONFIG_ARM_ATAG_DTB_COMPAT
- Build kernel
- make ARCH=arm imx28-tx28.dtb
- cat arch/arm/boot/zImage arch/arm/boot/imx28-tx28.dtb > arch/arm/boot/zImage_dtb
- Boot zImage_dtb like you boot zImage as usual

I'm using the appended DTB approach, and have done exactly this except for using uImage rather than zImage.

Lothar Wa?mann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
author
#33 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

Quoted 5 lines · Lothar Wa?mann
Quoted 3 lines

below. But does that mean ethernet PHY does not work even on non-DT kernel right now?

Seems so.

Have you got the chance to figure it out why it does not work on non-DT kernel?

Quoted 4 lines
Quoted 4 lines

I'm not sure if you have your bootloader passes dtb to kernel or use append-dtb approach. In the later case, here are the brief instructions.

Quoted 9 lines
Quoted 6 lines

- Enable CONFIG_ARM_APPENDED_DTB and CONFIG_ARM_ATAG_DTB_COMPAT
- Build kernel
- make ARCH=arm imx28-tx28.dtb
- cat arch/arm/boot/zImage arch/arm/boot/imx28-tx28.dtb > arch/arm/boot/zImage_dtb
- Boot zImage_dtb like you boot zImage as usual

I'm using the appended DTB approach, and have done exactly this except for using uImage rather than zImage.

So, got a chance to wrap the zImage_dtb into uImage and have the DT kernel actually running?

Shawn

#34 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

Hi,

Quoted 9 lines · Shawn Guo
Quoted 5 lines · Lothar Wa?mann
Quoted 3 lines

below. But does that mean ethernet PHY does not work even on non-DT kernel right now?

Seems so.

Have you got the chance to figure it out why it does not work on non-DT kernel?

No.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

I'm not sure if you have your bootloader passes dtb to kernel or use append-dtb approach. In the later case, here are the brief instructions.

- Enable CONFIG_ARM_APPENDED_DTB and CONFIG_ARM_ATAG_DTB_COMPAT
- Build kernel
- make ARCH=arm imx28-tx28.dtb
- cat arch/arm/boot/zImage arch/arm/boot/imx28-tx28.dtb > arch/arm/boot/zImage_dtb
- Boot zImage_dtb like you boot zImage as usual

Quoted 6 lines
Quoted 3 lines

I'm using the appended DTB approach, and have done exactly this except for using uImage rather than zImage.

So, got a chance to wrap the zImage_dtb into uImage and have the DT kernel actually running?

Yes, that actually works:
--------

|Linux version 3.5.0-rc6-next-20120712-karo+ (lothar at ipc1) (gcc version 4.5.3 (GCC) ) #11 PREEMPT Mon Jul 16 09:08:40 CEST 2012
|CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
|CPU: VIVT data cache, VIVT instruction cache
|Machine: Freescale i.MX28 (Device Tree), model: Ka-Ro electronics TX28 module
|bootconsole [earlycon0] enabled
|Memory policy: ECC disabled, Data cache writeback
|On node 0 totalpages: 32768
|free_area_init_node: node 0, pgdat c0471ce8, node_mem_map c04ac000
|  Normal zone: 256 pages used for memmap
|  Normal zone: 0 pages reserved
|  Normal zone: 32512 pages, LIFO batch:7
|pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
|pcpu-alloc: [0] 0 
|Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
|Kernel command line: init=/linuxrc kmemleak=on tx28_base=stkv3 tx28_otg_mode=device mtdparts=gpmi-nand:128k at 0x20000(env|),1m(u-boot),4m(linux),16m(rootfs),-(userfs) root=/dev/nfs nfsroot=192.168.1.225:/tftpboot/KARO/imx28-new,nolock ip=boo|tp mxsfb.mode=ETV570 debug earlyprintk panic=1 console=ttyAMA0,115200 ro
|PID hash table entries: 512 (order: -1, 2048 bytes)
|Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
|Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
|Memory: 128MB = 128MB total
|Memory: 125080k/125080k available, 5992k reserved, 0K highmem
|Virtual kernel memory layout:
|    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
|    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
|    vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
|    lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
|    modules : 0xbf000000 - 0xc0000000   (  16 MB)
|      .text : 0xc0008000 - 0xc041bd90   (4176 kB)
|      .init : 0xc041c000 - 0xc043e294   ( 137 kB)
|      .data : 0xc0440000 - 0xc0472700   ( 202 kB)
|       .bss : 0xc0472724 - 0xc04ab1e0   ( 227 kB)
|SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
|NR_IRQS:304
|sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
|Console: colour dummy device 80x30
|Calibrating delay loop... 226.09 BogoMIPS (lpj=1130496)
|pid_max: default: 32768 minimum: 301
|Mount-cache hash table entries: 512
|CPU: Testing write buffer coherency: ok
|Setting up static identity map for 0x402fcd58 - 0x402fcdb0
|------------[ cut here ]------------
|WARNING: at /usr/local/src/arm/projects/imx28/linux-tx28-dt/kernel/workqueue.c:1217 worker_enter_idle+0x114/0x130()
|Modules linked in:
|[<c001381c>] (unwind_backtrace+0x0/0xe4) from [<c001b20c>] (warn_slowpath_common+0x4c/0x64)
|[<c001b20c>] (warn_slowpath_common+0x4c/0x64) from [<c001b23c>] (warn_slowpath_null+0x18/0x1c)
|[<c001b23c>] (warn_slowpath_null+0x18/0x1c) from [<c0030718>] (worker_enter_idle+0x114/0x130)
|[<c0030718>] (worker_enter_idle+0x114/0x130) from [<c003075c>] (start_worker+0x28/0x34)
|[<c003075c>] (start_worker+0x28/0x34) from [<c0422bc4>] (init_workqueues+0x144/0x2bc)
|[<c0422bc4>] (init_workqueues+0x144/0x2bc) from [<c00088e4>] (do_one_initcall+0x9c/0x174)
|[<c00088e4>] (do_one_initcall+0x9c/0x174) from [<c041c7b0>] (kernel_init+0x50/0x1b4)
|[<c041c7b0>] (kernel_init+0x50/0x1b4) from [<c000f464>] (kernel_thread_exit+0x0/0x8)
|---[ end trace f60ac847315b779a ]---
|devtmpfs: initialized
|pinctrl core: initialized pinctrl subsystem
|dummy: 
|NET: Registered protocol family 16
|DMA: preallocated 256 KiB pool for atomic coherent allocations
|gpiochip_add: registered GPIOs 0 to 31 on device: gpio.0
|gpiochip_add: registered GPIOs 32 to 63 on device: gpio.1
|gpiochip_add: registered GPIOs 64 to 95 on device: gpio.2
|gpiochip_add: registered GPIOs 96 to 127 on device: gpio.3
|gpiochip_add: registered GPIOs 128 to 159 on device: gpio.4
|Serial: AMBA PL011 UART driver
|80074000.serial: ttyAMA0 at MMIO 0x80074000 (irq = 47) is a PL011 rev2
|console [ttyAMA0] enabled, bootconsole disabled
|console [ttyAMA0] enabled, bootconsole disabled
|bio: create slab <bio-0> at 0
|mxs-dma 80004000.dma-apbh: initialized
|mxs-dma 80024000.dma-apbx: initialized
|Switching to clocksource mxs_timer
|NET: Registered protocol family 2
|IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
|TCP established hash table entries: 4096 (order: 3, 32768 bytes)
|TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
|TCP: Hash tables configured (established 4096 bind 4096)
|TCP: reno registered
|UDP hash table entries: 256 (order: 0, 4096 bytes)
|UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
|NET: Registered protocol family 1
|RPC: Registered named UNIX socket transport module.
|RPC: Registered udp transport module.
|RPC: Registered tcp transport module.
|RPC: Registered tcp NFSv4.1 backchannel transport module.
|NetWinder Floating Point Emulator V0.97 (double precision)
|NFS: Registering the id_resolver key type
|Key type id_resolver registered
|jffs2: version 2.2. (NAND) (SUMMARY)  ?? 2001-2006 Red Hat, Inc.
|msgmni has been set to 244
|alg: No test for stdrng (krng)
|Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
|io scheduler noop registered
|io scheduler deadline registered
|io scheduler cfq registered (default)
|uart-pl011 80074000.serial: no DMA platform data
|8006c000.serial: ttyAPP1 at MMIO 0x8006c000 (irq = 113) is a 8006c000.serial
|mxs-auart 8006c000.serial: Found APPUART 3.1.0
|brd: module loaded
|loop: module loaded
|GPMI NAND driver registered. (IMX)
|of_get_named_gpio_flags: can't parse gpios property
|gpio_request: gpio--2 (phy-reset) status -22
|libphy: fec_enet_mii_bus: probed
|mousedev: PS/2 mouse device common for all mice
|rtc-ds1307 0-0068: SET TIME!
|rtc-ds1307 0-0068: rtc core: registered ds1339 as rtc0
|stmp3xxx-rtc 80056000.rtc: rtc core: registered 80056000.rtc as rtc1
|of_get_named_gpio_flags exited with status 0
|Registered led device: Heartbeat
|TCP: cubic registered
|NET: Registered protocol family 17
|Key type dns_resolver registered
|rtc-ds1307 0-0068: setting system clock to 2000-01-01 00:01:07 UTC (946684867)
|eth0: Freescale FEC PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=800f0000.etherne:00, irq=-1)
|libphy: 800f0000.etherne:00 - Link is Up - 100/Full
|Sending BOOTP requests . OK
|IP-Config: Got BOOTP answer from 192.168.100.1, my address is 192.168.100.73
|IP-Config: Complete:
|     device=eth0, addr=192.168.100.73, mask=255.255.254.0, gw=192.168.100.1
|     host=192.168.100.73, domain=ka-ro, nis-domain=(none)
|     bootserver=192.168.100.1, rootserver=192.168.1.225, rootpath=
|VFS: Mounted root (nfs filesystem) readonly on device 0:12.
|devtmpfs: mounted
|Freeing init memory: 136K
|Executing /sbin/init 
|INIT: version 2.88 booting
|Activating swap...done.
|Initializing /var... Done.
|Setting the system clock.
|Loading kernel modules...done.
|Activating lvm and md swap...done.
|Checking file systems...fsck from util-linux-ng 2.16
|done.
|Mounting local filesystems...done.
|Activating swapfile swap...done.
|Cleaning up temporary files....
|Cleaning up temporary files....
|Setting the system clock.
|ERROR: cannot update random seed file '/var/lib/urandom/random-seed'
|INIT: Entering runlevel: 2
|Starting internet superserver: inetd done.
|Configuring network interfaces: done.
|Starting telnetd...
|Setting sysfs variables....
|
|GNU/Linux 3.5.0-rc6-next-20120712-karo+ on triton1(armv5tejl) ttyAMA0:

--------

So you can have my

for the patch to convert tx28 to DT.
Thank you very much for your work!

Lothar Wa?mann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
author
#35 lore raw

PATCH 5/7 ARM: mxs: convert tx28 board to device tree

Quoted 5 lines · Lothar Wa?mann
Quoted 3 lines

Have you got the chance to figure it out why it does not work on non-DT kernel?

No.

Does not matter then, since you are saying it works with DT, and we can start replacing those board files with DT support.

Quoted 4 lines

So you can have my

for the patch to convert tx28 to DT.

Great. Thanks.

Signature · 2 lines
Regards,
Shawn
author
#36 lore raw

PATCH 6/7 ARM: mxs: convert stmp378x_devb board to device tree

In reply to Shawn Guo

The enc28j60 spi device does not get converted to dts file, because there is no mxs spi driver on mainline so far. The enc28j60 spi in mach-stmp378x_devb.c does not work anyway.

---
 arch/arm/boot/dts/stmp378x_devb.dts |   78 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-mxs/mach-mxs.c        |    1 +
 2 files changed, 79 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/stmp378x_devb.dts
arch/arm/boot/dts/stmp378x_devb.dts new file +78 -0
new file mode 100644
index 0000000..757a327
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "imx23.dtsi"
+
+/ {
+	model = "Freescale STMP378x Development Board";
+	compatible = "fsl,stmp378x-devb", "fsl,imx23";
+
+	memory {
+		reg = <0x40000000 0x04000000>;
+	};
+
+	apb at 80000000 {
+		apbh at 80000000 {
+			ssp0: ssp at 80010000 {
+				compatible = "fsl,imx23-mmc";
+				pinctrl-names = "default";
+				pinctrl-0 = <&mmc0_4bit_pins_a &mmc0_pins_fixup>;
+				bus-width = <4>;
+				wp-gpios = <&gpio1 30 0>;
+				vmmc-supply = <&reg_vddio_sd0>;
+				status = "okay";
+			};
+
+			pinctrl at 80018000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&hog_pins_a>;
+
+				hog_pins_a: hog-gpios at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x11d3 /* MX23_PAD_PWM3__GPIO_1_29 */
+						0x11e3 /* MX23_PAD_PWM4__GPIO_1_30 */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+			};
+		};
+
+		apbx at 80040000 {
+			auart0: serial at 8006c000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&auart0_pins_a>;
+				status = "okay";
+			};
+
+			duart: serial at 80070000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&duart_pins_a>;
+				status = "okay";
+			};
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+
+		reg_vddio_sd0: vddio-sd0 {
+			compatible = "regulator-fixed";
+			regulator-name = "vddio-sd0";
+			regulator-min-microvolt = <3300000>;
+			regulator-max-microvolt = <3300000>;
+			gpio = <&gpio1 29 0>;
+		};
+	};
+};
arch/arm/mach-mxs/mach-mxs.c +1 -0
index e081666..f7300fc 100644
@@ -312,6 +312,7 @@ static void __init mxs_machine_init(void)
 
 static const char *imx23_dt_compat[] __initdata = {
 	"fsl,imx23-evk",
+	"fsl,stmp378x_devb"
 	"olimex,imx23-olinuxino",
 	"fsl,imx23",
 	NULL,
Signature · 1 line
1.7.5.4
#37 lore raw

cover Convert mxs board files to device tree

In reply to Shawn Guo

Dear Shawn Guo,

Quoted 8 lines

With imx23-evk and imx28-evk converted to device tree, it's time to start looking at other mxs boards.

Marek, Lauri and Lothar,

Please do me the favor to test the series on your boards to see if it provides the same functionality as the board file. You can just use the branch below.

I can send you updated file, but it contains some additional cruft -- especially the SPI and i2c stuff. But then, I guess it just won't be probed, right ?

Quoted 16 lines

git://git.linaro.org/people/shawnguo/linux-2.6.git mxs/dt/others

Thanks,
Shawn

Marek Vasut (1):
ARM: mxs: convert m28evk board to device tree

Shawn Guo (6):
ARM: dts: imx28: move extra gpmi-nand pins into board dts
ARM: dts: imx28: move lcdif control pins into board dts
ARM: mxs: convert apx4devkit board to device tree
ARM: mxs: convert tx28 board to device tree
ARM: mxs: convert stmp378x_devb board to device tree
ARM: mxs: add dtb-y target into Makefile.boot

Quoted 14 lines
 arch/arm/boot/dts/apx4devkit.dts    |  143 +++++++++++++++++++++
 arch/arm/boot/dts/imx28-evk.dts     |   30 ++++-
 arch/arm/boot/dts/imx28.dtsi        |   96 +++++++++++++-
 arch/arm/boot/dts/m28evk.dts        |  241
+++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/stmp378x_devb.dts | 
 78 +++++++++++
 arch/arm/boot/dts/tx28.dts          |  112 ++++++++++++++++
 arch/arm/mach-mxs/Makefile.boot     |    9 ++
 arch/arm/mach-mxs/mach-mxs.c        |  102 +++++++++++++++-
 8 files changed, 802 insertions(+), 9 deletions(-)
 create mode 100644 arch/arm/boot/dts/apx4devkit.dts
 create mode 100644 arch/arm/boot/dts/m28evk.dts
 create mode 100644 arch/arm/boot/dts/stmp378x_devb.dts
 create mode 100644 arch/arm/boot/dts/tx28.dts

Best regards,
Marek Vasut

author
#38 lore raw

cover Convert mxs board files to device tree

Quoted 3 lines · Marek Vasut

I can send you updated file, but it contains some additional cruft -- especially the SPI and i2c stuff. But then, I guess it just won't be probed, right ?

Yes. That should not be a problem. But we need to make sure the bindings will stay unchanged till hitting the mainline.

Signature · 2 lines
Regards,
Shawn
#39 lore raw

cover Convert mxs board files to device tree

Dear Shawn Guo,

Quoted 7 lines · Marek Vasut
Quoted 3 lines

I can send you updated file, but it contains some additional cruft -- especially the SPI and i2c stuff. But then, I guess it just won't be probed, right ?

Yes. That should not be a problem. But we need to make sure the bindings will stay unchanged till hitting the mainline.

Correct, so merge this and I'll update it when it's in place.

Best regards,
Marek Vasut

#40 lore raw

cover Convert mxs board files to device tree

Dear Marek Vasut,

Quoted 11 lines

Dear Shawn Guo,

Quoted 7 lines · Marek Vasut
Quoted 3 lines

I can send you updated file, but it contains some additional cruft -- especially the SPI and i2c stuff. But then, I guess it just won't be probed, right ?

Yes. That should not be a problem. But we need to make sure the bindings will stay unchanged till hitting the mainline.

Correct, so merge this and I'll update it when it's in place.

And enable enet_out

Quoted 2 lines

Best regards,
Marek Vasut

Best regards,
Marek Vasut

author
#41 lore raw

PATCH 6/7 ARM: mxs: convert stmp378x_devb board to device tree

In reply to Shawn Guo

The enc28j60 spi device does not get converted to dts file, because there is no mxs spi driver on mainline so far. The enc28j60 spi in mach-stmp378x_devb.c does not work anyway.

---
 arch/arm/boot/dts/stmp378x_devb.dts |   78 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-mxs/mach-mxs.c        |    1 +
 2 files changed, 79 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/stmp378x_devb.dts
arch/arm/boot/dts/stmp378x_devb.dts new file +78 -0
new file mode 100644
index 0000000..757a327
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "imx23.dtsi"
+
+/ {
+	model = "Freescale STMP378x Development Board";
+	compatible = "fsl,stmp378x-devb", "fsl,imx23";
+
+	memory {
+		reg = <0x40000000 0x04000000>;
+	};
+
+	apb at 80000000 {
+		apbh at 80000000 {
+			ssp0: ssp at 80010000 {
+				compatible = "fsl,imx23-mmc";
+				pinctrl-names = "default";
+				pinctrl-0 = <&mmc0_4bit_pins_a &mmc0_pins_fixup>;
+				bus-width = <4>;
+				wp-gpios = <&gpio1 30 0>;
+				vmmc-supply = <&reg_vddio_sd0>;
+				status = "okay";
+			};
+
+			pinctrl at 80018000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&hog_pins_a>;
+
+				hog_pins_a: hog-gpios at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x11d3 /* MX23_PAD_PWM3__GPIO_1_29 */
+						0x11e3 /* MX23_PAD_PWM4__GPIO_1_30 */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+			};
+		};
+
+		apbx at 80040000 {
+			auart0: serial at 8006c000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&auart0_pins_a>;
+				status = "okay";
+			};
+
+			duart: serial at 80070000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&duart_pins_a>;
+				status = "okay";
+			};
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+
+		reg_vddio_sd0: vddio-sd0 {
+			compatible = "regulator-fixed";
+			regulator-name = "vddio-sd0";
+			regulator-min-microvolt = <3300000>;
+			regulator-max-microvolt = <3300000>;
+			gpio = <&gpio1 29 0>;
+		};
+	};
+};
arch/arm/mach-mxs/mach-mxs.c +1 -0
index e081666..f7300fc 100644
@@ -312,6 +312,7 @@ static void __init mxs_machine_init(void)
 
 static const char *imx23_dt_compat[] __initdata = {
 	"fsl,imx23-evk",
+	"fsl,stmp378x_devb"
 	"olimex,imx23-olinuxino",
 	"fsl,imx23",
 	NULL,
Signature · 1 line
1.7.5.4
author
#42 lore raw

PATCH 7/7 ARM: mxs: add dtb-y target into Makefile.boot

In reply to Shawn Guo

Add dtb-y target into Makefile.boot, so that "make ARCH=arm dtbs" can build out all the dtbs listed there. It's very useful for build-testing all the <board>.dts when imx28.dtsi changes.

---
 arch/arm/mach-mxs/Makefile.boot |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-mxs/Makefile.boot +9 -0
index 07b11fe..58733cc 100644
@@ -1 +1,10 @@
 zreladdr-y += 0x40008000
+
+dtb-y += apx4devkit.dtb \
+	 cfa10036.dtb \
+	 imx23-evk.dtb \
+	 imx23-olinuxino.dtb \
+	 imx28-evk.dtb \
+	 m28evk.dtb \
+	 stmp378x_devb.dtb \
+	 tx28.dtb \
Signature · 1 line
1.7.5.4