Skip to contentSkip to conversation

ARM: shmobile: marzen: Switch to DT_MACHINE_START

PATCH New Simon Horman 3 participants 8 messages Jul 26, 2013 – Jul 30, 2013

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v3 cover ARM: shmobile: marzen: Switch to DT_MACHINE_START

A short series to use DT_MACHINE_START on the marzen board.

Changes since v2
* Break dtb changes out of "ARM: shmobile: marzen: Switch to DT_MACHINE_START" and into their own patch "ARM: shmobile: marzen: Add r8a7779-marzen.dtb"
* Correct typo in changelog of "ARM: shmobile: marzen: Enable ARM_APPENDED_DTB in defconfig"

Changes since v1
* Add "ARM: shmobile: marzen: Enable ARM_APPENDED_DTB in defconfig" patch
* Add "ARM: shmobile: r8a7779: Rely on DT for SMP CPU info" patch
* Enhance "ARM: shmobile: marzen: Switch to DT_MACHINE_START" to:
- Select USE_OF in Kconfig
- Provide dt_compat in DT_MACHINE_START
- Provide r8a7779-marzen dts

Magnus Damm (1):
ARM: shmobile: marzen: Switch to DT_MACHINE_START

Simon Horman (3):
ARM: shmobile: marzen: Add r8a7779-marzen.dtb
ARM: shmobile: r8a7779: Rely on DT for SMP CPU info
ARM: shmobile: marzen: Enable ARM_APPENDED_DTB in defconfig

 arch/arm/boot/dts/Makefile            |  1 +
 arch/arm/boot/dts/r8a7779-marzen.dts  | 27 +++++++++++++++++++++++++++
 arch/arm/configs/marzen_defconfig     |  1 +
 arch/arm/mach-shmobile/Kconfig        |  1 +
 arch/arm/mach-shmobile/board-marzen.c |  8 +++++++-
 arch/arm/mach-shmobile/smp-r8a7779.c  | 12 +++---------
 6 files changed, 40 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/boot/dts/r8a7779-marzen.dts
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH v3 1/4 ARM: shmobile: marzen: Add r8a7779-marzen.dtb

This is in preparation for converting the marzen board to use DT_MACHINE_START.

---

v3
* First post
* Broke out of "ARM: shmobile: marzen: Switch to DT_MACHINE_START"

---
 arch/arm/boot/dts/Makefile           |  1 +
 arch/arm/boot/dts/r8a7779-marzen.dts | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 arch/arm/boot/dts/r8a7779-marzen.dts
arch/arm/boot/dts/Makefile +1 -0
index ae98d8f..ec4196d 100644
@@ -188,6 +188,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
 	r8a7778-bockw.dtb \
 	r8a7778-bockw-reference.dtb \
 	r8a7740-armadillo800eva-reference.dtb \
+	r8a7779-marzen.dtb \
 	r8a7779-marzen-reference.dtb \
 	r8a7790-lager.dtb \
 	r8a7790-lager-reference.dtb \
arch/arm/boot/dts/r8a7779-marzen.dts new file +27 -0
new file mode 100644
index 0000000..f3f7f79
@@ -0,0 +1,27 @@
+/*
+ * Device Tree Source for the Marzen board
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ * Copyright (C) 2013 Simon Horman
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+/include/ "r8a7779.dtsi"
+
+/ {
+	model = "marzen";
+	compatible = "renesas,marzen", "renesas,r8a7779";
+
+	chosen {
+		bootargs = "console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x60000000 0x40000000>;
+	};
+};
Signature · 1 line
1.8.2.1
#2 lore raw

PATCH v3 2/4 ARM: shmobile: marzen: Switch to DT_MACHINE_START

In reply to Simon Horman

From: Magnus Damm <[email protected]>

Convert the marzen board to use DT_MACHINE_START. With this in place all mach-shmobile boards use DT_MACHINE_START. Also, this makes it possible for the r8a7779 SMP code to use DT for CPUs.

[horms+renesas at verge.net.au: Select USE_OF in Kconfig]
[horms+renesas at verge.net.au: Provide dt_compat in DT_MACHINE_START]

---

v3 [Simon Horman]
* Move r8a7779-marzen dts into a separate patch

v2 [Simon Horman]
* Select USE_OF in Kconfig
* Provide dt_compat in DT_MACHINE_START
* Provide r8a7779-marzen dts

v1 [Magnus Damm]

---
 arch/arm/mach-shmobile/Kconfig        | 1 +
 arch/arm/mach-shmobile/board-marzen.c | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/Kconfig +1 -0
index 0130805..1f94c31 100644
@@ -182,6 +182,7 @@ config MACH_MARZEN
 	depends on ARCH_R8A7779
 	select ARCH_REQUIRE_GPIOLIB
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
+	select USE_OF
 
 config MACH_MARZEN_REFERENCE
 	bool "MARZEN board - Reference Device Tree Implementation"
arch/arm/mach-shmobile/board-marzen.c +7 -1
index 1f57865..91f8751 100644
@@ -237,7 +237,12 @@ static void __init marzen_init(void)
 	platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
 }
 
-MACHINE_START(MARZEN, "marzen")
+static const char *marzen_boards_compat_dt[] __initdata = {
+        "renesas,marzen",
+        NULL,
+};
+
+DT_MACHINE_START(MARZEN, "marzen")
 	.smp		= smp_ops(r8a7779_smp_ops),
 	.map_io		= r8a7779_map_io,
 	.init_early	= r8a7779_add_early_devices,
@@ -245,5 +250,6 @@ MACHINE_START(MARZEN, "marzen")
 	.init_irq	= r8a7779_init_irq,
 	.init_machine	= marzen_init,
 	.init_late	= r8a7779_init_late,
+	.dt_compat	= marzen_boards_compat_dt,
 	.init_time	= r8a7779_earlytimer_init,
 MACHINE_END
Signature · 1 line
1.8.2.1
#3 lore raw

PATCH v3 3/4 ARM: shmobile: r8a7779: Rely on DT for SMP CPU info

In reply to Simon Horman

Remove r8a7779 specific ->smp_init_cpus() callback and instead of relying on shmobile_smp_init_cpus() simply use DT for CPU core information.

Based on work for the sh73a0 by Magnus Damm.

---

v2
* First post

---
 arch/arm/mach-shmobile/smp-r8a7779.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
arch/arm/mach-shmobile/smp-r8a7779.c +3 -9
index 9bdf810..42170af 100644
@@ -99,6 +99,9 @@ static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle)
 
 static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus)
 {
+
+	/* setup r8a7779 specific SCU base */
+	shmobile_scu_base = IOMEM(R8A7779_SCU_BASE);
 	scu_enable(shmobile_scu_base);
 
 	/* Map the reset vector (in headsmp-scu.S, headsmp.S) */
@@ -117,14 +120,6 @@ static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus)
 	r8a7779_platform_cpu_kill(3);
 }
 
-static void __init r8a7779_smp_init_cpus(void)
-{
-	/* setup r8a7779 specific SCU base */
-	shmobile_scu_base = IOMEM(R8A7779_SCU_BASE);
-
-	shmobile_smp_init_cpus(scu_get_core_count(shmobile_scu_base));
-}
-
 #ifdef CONFIG_HOTPLUG_CPU
 static int r8a7779_scu_psr_core_disabled(int cpu)
 {
@@ -175,7 +170,6 @@ static int r8a7779_cpu_disable(unsigned int cpu)
 #endif /* CONFIG_HOTPLUG_CPU */
 
 struct smp_operations r8a7779_smp_ops  __initdata = {
-	.smp_init_cpus		= r8a7779_smp_init_cpus,
 	.smp_prepare_cpus	= r8a7779_smp_prepare_cpus,
 	.smp_boot_secondary	= r8a7779_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
Signature · 1 line
1.8.2.1
#4 lore raw

PATCH v3 4/4 ARM: shmobile: marzen: Enable ARM_APPENDED_DTB in defconfig

In reply to Simon Horman

"ARM: shmobile: marzen: Switch to DT_MACHINE_START" moves marzen over to use DT_MACHINE_START, however, the prevalent boot loader does not support booting with a separate dtb. Thus, it makes sense to use ARM_APPENDED_DTB by default.

This is consistent with other shmobile defconfigs.

---

v3
* Corrected typo in changelog

v2
* First post

---
 arch/arm/configs/marzen_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/marzen_defconfig +1 -0
index 494e70a..82e4040 100644
@@ -29,6 +29,7 @@ CONFIG_AEABI=y
 CONFIG_HIGHMEM=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_ARM_APPENDED_DTB=y
 CONFIG_CMDLINE="console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on"
 CONFIG_CMDLINE_FORCE=y
 CONFIG_KEXEC=y
Signature · 1 line
1.8.2.1
#5 lore raw

v3 cover ARM: shmobile: marzen: Switch to DT_MACHINE_START

In reply to Simon Horman
Quoted 1 line · Simon Horman

A short series to use DT_MACHINE_START on the marzen board.

Magnus, could you find a few moments to review this series?

Quoted 36 lines

Changes since v2
* Break dtb changes out of "ARM: shmobile: marzen: Switch to DT_MACHINE_START" and into their own patch "ARM: shmobile: marzen: Add r8a7779-marzen.dtb"
* Correct typo in changelog of "ARM: shmobile: marzen: Enable ARM_APPENDED_DTB in defconfig"

Changes since v1
* Add "ARM: shmobile: marzen: Enable ARM_APPENDED_DTB in defconfig" patch
* Add "ARM: shmobile: r8a7779: Rely on DT for SMP CPU info" patch
* Enhance "ARM: shmobile: marzen: Switch to DT_MACHINE_START" to:
- Select USE_OF in Kconfig
- Provide dt_compat in DT_MACHINE_START
- Provide r8a7779-marzen dts

Magnus Damm (1):
ARM: shmobile: marzen: Switch to DT_MACHINE_START

Simon Horman (3):
ARM: shmobile: marzen: Add r8a7779-marzen.dtb
ARM: shmobile: r8a7779: Rely on DT for SMP CPU info
ARM: shmobile: marzen: Enable ARM_APPENDED_DTB in defconfig

 arch/arm/boot/dts/Makefile            |  1 +
 arch/arm/boot/dts/r8a7779-marzen.dts  | 27 +++++++++++++++++++++++++++
 arch/arm/configs/marzen_defconfig     |  1 +
 arch/arm/mach-shmobile/Kconfig        |  1 +
 arch/arm/mach-shmobile/board-marzen.c |  8 +++++++-
 arch/arm/mach-shmobile/smp-r8a7779.c  | 12 +++---------
 6 files changed, 40 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/boot/dts/r8a7779-marzen.dts
Signature · 1 line
1.8.2.1
maintainer
#6 lore raw

v3 cover ARM: shmobile: marzen: Switch to DT_MACHINE_START

Hi Simon,

Quoted 4 lines · Simon Horman
Quoted 1 line · Simon Horman

A short series to use DT_MACHINE_START on the marzen board.

Magnus, could you find a few moments to review this series?

These are fine with me, thanks for your help!

#7 lore raw

v3 cover ARM: shmobile: marzen: Switch to DT_MACHINE_START

Quoted 11 lines · Magnus Damm

Hi Simon,

Quoted 4 lines · Simon Horman
Quoted 1 line · Simon Horman

A short series to use DT_MACHINE_START on the marzen board.

Magnus, could you find a few moments to review this series?

These are fine with me, thanks for your help!

Thanks, I have queued them up for v3.12.