Skip to contentSkip to conversation

ARM: shmobile: sh73a0/kzm9g: Complete multiplatform support

PATCH New Geert Uytterhoeven 2 participants 7 messages Feb 17, 2015 – Feb 18, 2015

Subsystems (6)
lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

v4 cover ARM: shmobile: sh73a0/kzm9g: Complete multiplatform support

Hi Simon, Magnus,

This patch series completes the migration from kzm9g-reference (legacy DT based) to kzm9g-multiplatform (ARM multiplatform DT based with common clock framework).

It depends on Simon's branch simple-pm-bus-for-v3.21.

- The first two patches fix Ethernet on kzm9g, by adding a Bus State Controller node, and moving the Ethernet node to it, and thus depends on Simon's branch simple-pm-bus-for-v3.21,
- The third patch removes all kzm9g-reference support, now the sh73a0 generic multiplatform case has the same feature set (better, it provides 16 MiB more RAM!),
- The fourth patch fixes CONFIG_CPU_IDLE=y by adding a node for the TWD, which could not be done before, as the TWD driver doesn't support DT without CCF,
- The fifth path is new, and removes the now unused function

    sh73a0_add_standard_devices_dt().

Thanks for applying!

Geert Uytterhoeven (5):
ARM: shmobile: sh73a0 dtsi: Add Bus State Controller node
ARM: shmobile: kzm9g dts: Move Ethernet node to BSC
ARM: shmobile: kzm9g-reference: Remove board C code and DT file
ARM: shmobile: sh73a0 dtsi: Add Cortex-A9 TWD node
ARM: shmobile: sh73a0: Remove unused sh73a0_add_standard_devices_dt()

 Documentation/devicetree/bindings/arm/shmobile.txt |   2 -
 arch/arm/boot/dts/Makefile                         |   3 +-
 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts       | 398 ---------------------
 arch/arm/boot/dts/sh73a0-kzm9g.dts                 |  28 +-
 arch/arm/boot/dts/sh73a0.dtsi                      |  19 +
 arch/arm/mach-shmobile/Kconfig                     |  14 -
 arch/arm/mach-shmobile/Makefile                    |   1 -
 arch/arm/mach-shmobile/Makefile.boot               |   1 -
 arch/arm/mach-shmobile/board-kzm9g-reference.c     |  62 ----
 arch/arm/mach-shmobile/include/mach/zboot.h        |   2 +-
 arch/arm/mach-shmobile/setup-sh73a0.c              |   9 -
 arch/arm/mach-shmobile/sh73a0.h                    |   1 -
 12 files changed, 36 insertions(+), 504 deletions(-)
 delete mode 100644 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
 delete mode 100644 arch/arm/mach-shmobile/board-kzm9g-reference.c
Signature · 12 lines
1.9.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
author maintainer
#1 lore raw

PATCH v4 1/5 ARM: shmobile: sh73a0 dtsi: Add Bus State Controller node

Add a node for the Bus State Controller (BSC) on sh73a0, to which multiple external devices can be connected.

The BSC is driven by the ZB clock, and located in PM domain A4S. A reference to the latter will be added later.

---
v4:
- Claim compatiblity with "simple-pm-bus" instead of "simple-bus",

v3:
- Move "ranges" before "reg",

v2:
- Postpone power-domains.

---
 arch/arm/boot/dts/sh73a0.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm/boot/dts/sh73a0.dtsi +11 -0
index ab319b73e282d8b6..70b694f09fd5ef9e 100644
@@ -376,6 +376,17 @@
 		status = "disabled";
 	};
 
+	bsc: bus at fec10000 {
+		compatible = "renesas,bsc-sh73a0", "renesas,bsc",
+			     "simple-pm-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0 0 0x20000000>;
+		reg = <0xfec10000 0x400>;
+		interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&zb_clk>;
+	};
+
 	clocks {
 		#address-cells = <1>;
 		#size-cells = <1>;
Signature · 1 line
1.9.1
author maintainer
#2 lore raw

PATCH v4 2/5 ARM: shmobile: kzm9g dts: Move Ethernet node to BSC

In reply to Geert Uytterhoeven

Move the Ethernet node from the root of the device tree to the BSC node, as it's connected to the Bus State Controller. This allows the system to know the right position of the Ethernet node in the clock and PM domain hierarchy, and manage the clock and PM domain appropriately.

Also rename the node's name from "lan9220" to "ethernet", to conform to ePAPR generic name recomendations.

---
v4:
- No changes,

v3:
- No changes,

v2:
- s/confirm/conform/,
- Moved from kzm9g-reference to kzm9g.

---
 arch/arm/boot/dts/sh73a0-kzm9g.dts | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)
arch/arm/boot/dts/sh73a0-kzm9g.dts +15 -13
index 6f00e6b680e8e0fa..022ba505f57339a9 100644
@@ -84,19 +84,6 @@
 		enable-active-high;
 	};
 
-	lan9220 at 10000000 {
-		compatible = "smsc,lan9220", "smsc,lan9115";
-		reg = <0x10000000 0x100>;
-		phy-mode = "mii";
-		interrupt-parent = <&irqpin0>;
-		interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
-		reg-io-width = <4>;
-		smsc,irq-push-pull;
-		smsc,save-mac-address;
-		vddvario-supply = <&reg_1p8v>;
-		vdd33a-supply = <&reg_3p3v>;
-	};
-
 	leds {
 		compatible = "gpio-leds";
 		led1 {
@@ -178,6 +165,21 @@
 	};
 };
 
+&bsc {
+	ethernet at 10000000 {
+		compatible = "smsc,lan9220", "smsc,lan9115";
+		reg = <0x10000000 0x100>;
+		phy-mode = "mii";
+		interrupt-parent = <&irqpin0>;
+		interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
+		reg-io-width = <4>;
+		smsc,irq-push-pull;
+		smsc,save-mac-address;
+		vddvario-supply = <&reg_1p8v>;
+		vdd33a-supply = <&reg_3p3v>;
+	};
+};
+
 &cmt1 {
 	status = "okay";
 };
Signature · 1 line
1.9.1
author maintainer
#3 lore raw

PATCH v4 3/5 ARM: shmobile: kzm9g-reference: Remove board C code and DT file

In reply to Geert Uytterhoeven

Now that the sh73a0 generic multiplatform case has the same feature set as the kzm9g DT reference board code, we get rid of the latter. DT reference code in the future shall make use of the sh73a0 multiplatform support code with the generic SoC machine vector.

---
v4:
- No changes,

v3:
- New

---
 Documentation/devicetree/bindings/arm/shmobile.txt |   2 -
 arch/arm/boot/dts/Makefile                         |   3 +-
 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts       | 398 ---------------------
 arch/arm/mach-shmobile/Kconfig                     |  14 -
 arch/arm/mach-shmobile/Makefile                    |   1 -
 arch/arm/mach-shmobile/Makefile.boot               |   1 -
 arch/arm/mach-shmobile/board-kzm9g-reference.c     |  62 ----
 arch/arm/mach-shmobile/include/mach/zboot.h        |   2 +-
 8 files changed, 2 insertions(+), 481 deletions(-)
 delete mode 100644 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
 delete mode 100644 arch/arm/mach-shmobile/board-kzm9g-reference.c
Documentation/devicetree/bindings/arm/shmobile.txt +0 -2
index 668ed9528fa3d123..e37849e75318b738 100644
@@ -55,8 +55,6 @@ Boards:
     compatible = "renesas,kzm9d", "renesas,emev2"
   - Kyoto Microcomputer Co. KZM-A9-GT
     compatible = "renesas,kzm9g", "renesas,sh73a0"
-  - Kyoto Microcomputer Co. KZM-A9-GT - Reference Device Tree Implementation
-    compatible = "renesas,kzm9g-reference", "renesas,sh73a0"
   - Lager (RTP0RC7790SEB00010S)
     compatible = "renesas,lager", "renesas,r8a7790"
   - Marzen
arch/arm/boot/dts/Makefile +1 -2
index f610c16dc0612580..5450d4fa6b77402c 100644
@@ -470,8 +470,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += \
 	r8a7778-bockw.dtb \
 	r8a7778-bockw-reference.dtb \
 	r8a7779-marzen.dtb \
-	sh73a0-kzm9g.dtb \
-	sh73a0-kzm9g-reference.dtb
+	sh73a0-kzm9g.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += \
 	emev2-kzm9d.dtb \
 	r7s72100-genmai.dtb \
arch/arm/boot/dts/sh73a0-kzm9g-reference.dts deleted +0 -398

398 lines not on this page · raw message

arch/arm/mach-shmobile/Kconfig +0 -14
index a5c216e665e57cc3..087d4d1e7461caf7 100644
@@ -199,20 +199,6 @@ config MACH_KZM9G
 	select SND_SOC_AK4642 if SND_SIMPLE_CARD
 	select USE_OF
 
-config MACH_KZM9G_REFERENCE
-	bool "KZM-A9-GT board - Reference Device Tree Implementation"
-	depends on ARCH_SH73A0
-	select ARCH_REQUIRE_GPIOLIB
-	select REGULATOR_FIXED_VOLTAGE if REGULATOR
-	select SND_SOC_AK4642 if SND_SIMPLE_CARD
-	select USE_OF
-	---help---
-	   Use reference implementation of KZM-A9-GT board support
-	   which makes as greater use of device tree at the expense
-	   of not supporting a number of devices.
-
-	   This is intended to aid developers
-
 comment "Renesas ARM SoCs System Configuration"
 
 config CPU_HAS_INTEVT
arch/arm/mach-shmobile/Makefile +0 -1
index 4ad01d48b5fdaf3d..016bbb6dcb3cc7b4 100644
@@ -60,7 +60,6 @@ obj-$(CONFIG_MACH_BOCKW_REFERENCE)	+= board-bockw-reference.o
 obj-$(CONFIG_MACH_MARZEN)	+= board-marzen.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
 obj-$(CONFIG_MACH_KZM9G)	+= board-kzm9g.o intc-sh73a0.o
-obj-$(CONFIG_MACH_KZM9G_REFERENCE)	+= board-kzm9g-reference.o
 endif
 
 # Framework support
arch/arm/mach-shmobile/Makefile.boot +0 -1
index c496af795a6e11d4..5c2117d06f0d3fea 100644
@@ -6,7 +6,6 @@ loadaddr-$(CONFIG_MACH_ARMADILLO800EVA) += 0x40008000
 loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000
 loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000
 loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000
-loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000
 loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000
 
 __ZRELADDR	:= $(sort $(loadaddr-y))
arch/arm/mach-shmobile/board-kzm9g-reference.c deleted +0 -62

62 lines not on this page · raw message

arch/arm/mach-shmobile/include/mach/zboot.h +1 -1
index 9d9cb09c93368b78..175ee05465da19eb 100644
@@ -9,7 +9,7 @@
  *
  **************************************************/
 
-#if defined(CONFIG_MACH_KZM9G) || defined(CONFIG_MACH_KZM9G_REFERENCE)
+#ifdef CONFIG_MACH_KZM9G
 #define MEMORY_START	0x43000000
 #include "mach/head-kzm9g.txt"
 #else
Signature · 1 line
1.9.1
author maintainer
#4 lore raw

PATCH v4 4/5 ARM: shmobile: sh73a0 dtsi: Add Cortex-A9 TWD node

In reply to Geert Uytterhoeven

Add a node for the Private Timer and Watchdog, as found in the Cortex-A9 MPCore.

Without this, there's no clocksource available during early kernel initialization, before cmt1 is initialized, leading to a lock-up if CONFIG_CPU_IDLE=y.

---
v4:
- New, but this patch has been sent before as a separate patch.

---
 arch/arm/boot/dts/sh73a0.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/sh73a0.dtsi +8 -0
index 70b694f09fd5ef9e..0b933e254d19faa4 100644
@@ -11,6 +11,7 @@
 /include/ "skeleton.dtsi"
 
 #include <dt-bindings/clock/sh73a0-clock.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 
 / {
@@ -35,6 +36,13 @@
 		};
 	};
 
+	timer at f0000600 {
+		compatible = "arm,cortex-a9-twd-timer";
+		reg = <0xf0000600 0x20>;
+		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>;
+		clocks = <&twd_clk>;
+	};
+
 	gic: interrupt-controller at f0001000 {
 		compatible = "arm,cortex-a9-gic";
 		#interrupt-cells = <3>;
Signature · 1 line
1.9.1
author maintainer
#5 lore raw

PATCH v4 5/5 ARM: shmobile: sh73a0: Remove unused sh73a0_add_standard_devices_dt()

In reply to Geert Uytterhoeven

"ARM: shmobile: kzm9g-reference: Remove board C code and DT file" removed the last user of sh73a0_add_standard_devices_dt(). Hence remove this function.

---
v4:
- New.

---
 arch/arm/mach-shmobile/setup-sh73a0.c | 9 ---------
 arch/arm/mach-shmobile/sh73a0.h       | 1 -
 2 files changed, 10 deletions(-)
arch/arm/mach-shmobile/setup-sh73a0.c +0 -9
index 48f2447ab01f6e60..2f68459e78114323 100644
@@ -783,15 +783,6 @@ void __init sh73a0_add_early_devices(void)
 	shmobile_setup_console();
 }
 
-void __init sh73a0_add_standard_devices_dt(void)
-{
-	/* clocks are setup late during boot in the case of DT */
-#ifndef CONFIG_COMMON_CLK
-	sh73a0_clock_init();
-#endif
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
 #define RESCNT2 IOMEM(0xe6188020)
 static void sh73a0_restart(enum reboot_mode mode, const char *cmd)
 {
arch/arm/mach-shmobile/sh73a0.h +0 -1
index f037c64b14fc0767..5a80f18b4fa0665f 100644
@@ -77,7 +77,6 @@ extern void sh73a0_map_io(void);
 extern void sh73a0_earlytimer_init(void);
 extern void sh73a0_add_early_devices(void);
 extern void sh73a0_add_standard_devices(void);
-extern void sh73a0_add_standard_devices_dt(void);
 extern void sh73a0_clock_init(void);
 extern void sh73a0_pinmux_init(void);
 extern void sh73a0_pm_init(void);
Signature · 1 line
1.9.1
#6 lore raw

v4 cover ARM: shmobile: sh73a0/kzm9g: Complete multiplatform support

In reply to Geert Uytterhoeven
Quoted 18 lines · Geert Uytterhoeven

Hi Simon, Magnus,

This patch series completes the migration from kzm9g-reference (legacy DT based) to kzm9g-multiplatform (ARM multiplatform DT based with common clock framework).

It depends on Simon's branch simple-pm-bus-for-v3.21.

- The first two patches fix Ethernet on kzm9g, by adding a Bus State Controller node, and moving the Ethernet node to it, and thus depends on Simon's branch simple-pm-bus-for-v3.21,
- The third patch removes all kzm9g-reference support, now the sh73a0 generic multiplatform case has the same feature set (better, it provides 16 MiB more RAM!),
- The fourth patch fixes CONFIG_CPU_IDLE=y by adding a node for the TWD, which could not be done before, as the TWD driver doesn't support DT without CCF,
- The fifth path is new, and removes the now unused function

Quoted 3 lines
    sh73a0_add_standard_devices_dt().

Thanks for applying!

Thanks, done.

With this patchset applied I am able to use NFS root with multiplatform using shmobile_defconfig.