Skip to contentSkip to conversation

ARM: SPEAr600: Add device-tree support to SPEAr600 boards

PATCH Superseded Stefan Roese 4 participants 10 messages Mar 14, 2012 – Mar 15, 2012

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: SPEAr600: Add device-tree support to SPEAr600 boards

This patch adds a generic target for SPEAr600 board that can be configured via the device-tree. Currently the following devices are supported via the devicetree:

- VIC interrupts
- PL011 UART
- PL061 GPIO
- Synopsys DW I2C
- Synopsys DW ethernet

Other peripheral devices (e.g. SMI flash, FSMC NAND flash etc) will follow in later patches.

Only the spear600-evb is currently supported. Other SPEAr600 based boards will follow later.

Additionally the file spear600.c is deleted. It contained only one empty function and is not needed. So lets just remove it.

Cc Viresh Kumar <[email protected]>
Cc Arnd Bergmann <[email protected]>

---
v2:
- Added DT support to spear6xx.c instead of creating board-dt.c
- Removed UART (PL011) and GPIO (PL061) platform data for devicetree board port. This works now via DT probing
- Added OF_DEV_AUXDATA for clock device name matching for some device drivers
- Removed sper600.c file completely
- Added DW I2C and ethernet nodes to the dts files
- Added other DT nodes (SMI, FSMC, ECHI, OHCI), currently disabled since the corresponding device drivers don't support DT probing
- Removed Linaro/FSL copyright notice from SPEAr DT files (copy-paste cruft)
- Many smaller modification to the dts/dtsi files
- Changed Documentation/devicetree/bindings/arm/spear.txt to match the changed bindings

 Documentation/devicetree/bindings/arm/spear.txt |    8 ++
 arch/arm/boot/dts/spear600-evb.dts              |   30 +++++
 arch/arm/boot/dts/spear600.dtsi                 |  162 +++++++++++++++++++++++
 arch/arm/mach-spear6xx/Kconfig                  |    7 +
 arch/arm/mach-spear6xx/Makefile                 |    3 -
 arch/arm/mach-spear6xx/spear600.c               |   25 ----
 arch/arm/mach-spear6xx/spear600_evb.c           |    3 -
 arch/arm/mach-spear6xx/spear6xx.c               |   69 +++++++++-
 8 files changed, 270 insertions(+), 37 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/spear.txt
 create mode 100644 arch/arm/boot/dts/spear600-evb.dts
 create mode 100644 arch/arm/boot/dts/spear600.dtsi
 delete mode 100644 arch/arm/mach-spear6xx/spear600.c
Documentation/devicetree/bindings/arm/spear.txt new file +8 -0
new file mode 100644
index 0000000..f8e54f0
@@ -0,0 +1,8 @@
+ST SPEAr Platforms Device Tree Bindings
+---------------------------------------
+
+Boards with the ST SPEAr600 SoC shall have the following properties:
+
+Required root node property:
+
+compatible = "st,spear600";
arch/arm/boot/dts/spear600-evb.dts new file +30 -0
new file mode 100644
index 0000000..cbfda8d
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2012 Stefan Roese <[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/ "spear600.dtsi"
+
+/ {
+	model = "ST SPEAr600 Evaluation Board";
+	compatible = "st,spear600-evb", "st,spear600";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	soc {
+		gmac0: ethernet at e0800000 {
+			phy-mode = "gmii";
+		};
+
+		i2c at d0200000 {
+			clock-frequency = <400000>;
+		};
+	};
+};
arch/arm/boot/dts/spear600.dtsi new file +162 -0

162 lines not on this page · raw message

arch/arm/mach-spear6xx/Kconfig +7 -0
index ff4ae5b..7777f72 100644
@@ -11,6 +11,13 @@ config BOARD_SPEAR600_EVB
 	help
 	  Supports ST SPEAr600 Evaluation Board
 
+config BOARD_SPEAR600_DT
+	bool "SPEAr600 generic board configured via device-tree"
+	select MACH_SPEAR600
+	select USE_OF
+	help
+	  Supports ST SPEAr600 boards configured via the device-tree
+
 endmenu
 
 config MACH_SPEAR600
arch/arm/mach-spear6xx/Makefile +0 -3
index cc1a4d8..6f87c3a 100644
@@ -5,8 +5,5 @@
 # common files
 obj-y	+= clock.o spear6xx.o
 
-# spear600 specific files
-obj-$(CONFIG_MACH_SPEAR600) += spear600.o
-
 # spear600 boards files
 obj-$(CONFIG_BOARD_SPEAR600_EVB) += spear600_evb.o
arch/arm/mach-spear6xx/spear600.c deleted +0 -25
deleted file mode 100644
index d0e6eea..0000000
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-spear6xx/spear600.c
- *
- * SPEAr600 machine source file
- *
- * Copyright (C) 2009 ST Microelectronics
- * Rajeev Kumar<[email protected]>
- *
- * 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.
- */
-
-#include <linux/ptrace.h>
-#include <asm/irq.h>
-#include <mach/generic.h>
-#include <mach/hardware.h>
-
-/* Add spear600 specific devices here */
-
-void __init spear600_init(void)
-{
-	/* call spear6xx family common init function */
-	spear6xx_init();
-}
arch/arm/mach-spear6xx/spear600_evb.c +0 -3
index c6e4254..c4949aa 100644
@@ -32,9 +32,6 @@ static void __init spear600_evb_init(void)
 {
 	unsigned int i;
 
-	/* call spear600 machine init function */
-	spear600_init();
-
 	/* Add Platform Devices */
 	platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
 
arch/arm/mach-spear6xx/spear6xx.c +63 -6

90 lines not on this page · raw message

Signature · 1 line
1.7.9.2
#1 lore raw

PATCH v2 1/1 ARM: SPEAr600: Add device-tree support to SPEAr600 boards

Quoted 16 lines · Stefan Roese

This patch adds a generic target for SPEAr600 board that can be configured via the device-tree. Currently the following devices are supported via the devicetree:

- VIC interrupts
- PL011 UART
- PL061 GPIO
- Synopsys DW I2C
- Synopsys DW ethernet

Other peripheral devices (e.g. SMI flash, FSMC NAND flash etc) will follow in later patches.

Only the spear600-evb is currently supported. Other SPEAr600 based boards will follow later.

Quoted 6 lines

Additionally the file spear600.c is deleted. It contained only one empty function and is not needed. So lets just remove it.

Cc Viresh Kumar <[email protected]>
Cc Arnd Bergmann <[email protected]>

Looks very good to me.

#2 lore raw

PATCH v2 1/1 ARM: SPEAr600: Add device-tree support to SPEAr600 boards

In reply to Stefan Roese
Quoted 81 lines · Stefan Roese

This patch adds a generic target for SPEAr600 board that can be configured via the device-tree. Currently the following devices are supported via the devicetree:

- VIC interrupts
- PL011 UART
- PL061 GPIO
- Synopsys DW I2C
- Synopsys DW ethernet

Other peripheral devices (e.g. SMI flash, FSMC NAND flash etc) will follow in later patches.

Only the spear600-evb is currently supported. Other SPEAr600 based boards will follow later.

Additionally the file spear600.c is deleted. It contained only one empty function and is not needed. So lets just remove it.

Cc Viresh Kumar <[email protected]>
Cc Arnd Bergmann <[email protected]>

---
v2:
- Added DT support to spear6xx.c instead of creating board-dt.c
- Removed UART (PL011) and GPIO (PL061) platform data for devicetree board port. This works now via DT probing
- Added OF_DEV_AUXDATA for clock device name matching for some device drivers
- Removed sper600.c file completely
- Added DW I2C and ethernet nodes to the dts files
- Added other DT nodes (SMI, FSMC, ECHI, OHCI), currently disabled since the corresponding device drivers don't support DT probing
- Removed Linaro/FSL copyright notice from SPEAr DT files (copy-paste cruft)
- Many smaller modification to the dts/dtsi files
- Changed Documentation/devicetree/bindings/arm/spear.txt to match the changed bindings

 Documentation/devicetree/bindings/arm/spear.txt |    8 ++
 arch/arm/boot/dts/spear600-evb.dts              |   30 +++++
 arch/arm/boot/dts/spear600.dtsi                 |  162 +++++++++++++++++++++++
 arch/arm/mach-spear6xx/Kconfig                  |    7 +
 arch/arm/mach-spear6xx/Makefile                 |    3 -
 arch/arm/mach-spear6xx/spear600.c               |   25 ----
 arch/arm/mach-spear6xx/spear600_evb.c           |    3 -
 arch/arm/mach-spear6xx/spear6xx.c               |   69 +++++++++-
 8 files changed, 270 insertions(+), 37 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/spear.txt
 create mode 100644 arch/arm/boot/dts/spear600-evb.dts
 create mode 100644 arch/arm/boot/dts/spear600.dtsi
 delete mode 100644 arch/arm/mach-spear6xx/spear600.c
Documentation/devicetree/bindings/arm/spear.txt new file +8 -0
new file mode 100644
index 0000000..f8e54f0
@@ -0,0 +1,8 @@
+ST SPEAr Platforms Device Tree Bindings
+---------------------------------------
+
+Boards with the ST SPEAr600 SoC shall have the following properties:
+
+Required root node property:
+
+compatible = "st,spear600";
arch/arm/boot/dts/spear600-evb.dts new file +9 -0
new file mode 100644
index 0000000..cbfda8d
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2012 Stefan Roese <[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

arch/arm/boot/dts/spear600-evb.dts line 19

Quoted 10 lines
arch/arm/boot/dts/spear600-evb.dts new file +10 -0
+ */
+
+/dts-v1/;
+/include/ "spear600.dtsi"
+
+/ {
+	model = "ST SPEAr600 Evaluation Board";
+	compatible = "st,spear600-evb", "st,spear600";
+	#address-cells = <1>;
+	#size-cells = <1>;

please put the mem size here

Quoted 32 lines
arch/arm/boot/dts/spear600-evb.dts new file +11 -0
+
+	soc {
+		gmac0: ethernet at e0800000 {
+			phy-mode = "gmii";
+		};
+
+		i2c at d0200000 {
+			clock-frequency = <400000>;
+		};
+	};
+};
arch/arm/boot/dts/spear600.dtsi new file +15 -0
new file mode 100644
index 0000000..e45e58f
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2012 Stefan Roese <[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
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "st,spear600";

arch/arm/boot/dts/spear600.dtsi line 25

Quoted 10 lines
arch/arm/boot/dts/spear600.dtsi new file +10 -0
+
+	cpus {
+		cpu at 0 {
+			compatible = "arm,arm926ejs";
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0>; /* Filled by U-Boot */

please put the max mem of the SoC here

arch/arm/boot/dts/spear600.dtsi line 28

Quoted 3 lines
arch/arm/boot/dts/spear600.dtsi new file +3 -0
+	};
+
+	soc {

please put the name of the bus not soc

Quoted 122 lines
arch/arm/boot/dts/spear600.dtsi new file +122 -0
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "simple-bus";
+		ranges;
+
+		vic0: interrupt-controller at f1100000 {
+			compatible = "arm,pl190-vic";
+			interrupt-controller;
+			reg = <0xf1100000 0x1000>;
+			#interrupt-cells = <1>;
+		};
+
+		vic1: interrupt-controller at f1000000 {
+			compatible = "arm,pl190-vic";
+			interrupt-controller;
+			reg = <0xf1000000 0x1000>;
+			#interrupt-cells = <1>;
+		};
+
+		serial at d0000000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0xd0000000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <24>;
+		};
+
+		serial at d0080000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0xd0080000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <25>;
+		};
+
+		/* local/cpu GPIO */
+		gpio0: gpio at f0100000 {
+			#gpio-cells = <2>;
+			compatible = "arm,pl061", "arm,primecell";
+			gpio-controller;
+			reg = <0xf0100000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <18>;
+		};
+
+		/* basic GPIO */
+		gpio1: gpio at fc980000 {
+			#gpio-cells = <2>;
+			compatible = "arm,pl061", "arm,primecell";
+			gpio-controller;
+			reg = <0xfc980000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <19>;
+		};
+
+		/* appl GPIO */
+		gpio2: gpio at d8100000 {
+			#gpio-cells = <2>;
+			compatible = "arm,pl061", "arm,primecell";
+			gpio-controller;
+			reg = <0xd8100000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <4>;
+		};
+
+		gmac0: ethernet at e0800000 {
+			compatible = "st,spear600-gmac";
+			reg = <0xe0800000 0x8000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <24 23>;
+			interrupt-names = "macirq", "eth_wake_irq";
+			mac-address = [000000000000]; /* Filled in by U-Boot */
+		};
+
+		i2c at d0200000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0xd0200000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <28>;
+		};
+
+		fsmc0: flash at d1800000 {
+			status = "disabled";
+			compatible = "st,spear600-fsmc-nand";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0xd1800000 0x1000	/* FSMC Register */
+			       0xd2000000 0x4000>;	/* NAND Base */
+			reg-names = "fsmc_regs", "nand_data";
+		};
+
+		smi0: flash at fc000000 {
+			status = "disabled";
+			compatible = "st,spear600-smi";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0xfc000000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <12>;
+		};
+
+		ehci at e1800000 {
+			status = "disabled";
+			compatible = "st,spear600-ehci", "usb-ehci";
+			reg = <0xe1800000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <27>;
+		};
+
+		ehci at e2000000 {
+			status = "disabled";
+			compatible = "st,spear600-ehci", "usb-ehci";
+			reg = <0xe2000000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <29>;
+		};
+
+		ohci at e1900000 {
+			status = "disabled";
+			compatible = "st,spear600-ohci", "usb-ohci";
+			reg = <0xe1900000 0x1000>;
+			interrupt-parent = <&vic1>;

arch/arm/boot/dts/spear600.dtsi line 160

Quoted 10 lines
arch/arm/boot/dts/spear600.dtsi new file +10 -0
+			interrupts = <26>;
+		};
+
+		ohci at e2100000 {
+			status = "disabled";
+			compatible = "st,spear600-ohci", "usb-ohci";
+			reg = <0xe2100000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <28>;
+		};

all of this need a Doc for the ST bindings

Quoted 133 lines
arch/arm/boot/dts/spear600.dtsi new file +2 -0
+	};
+};
arch/arm/mach-spear6xx/Kconfig +7 -0
index ff4ae5b..7777f72 100644
@@ -11,6 +11,13 @@ config BOARD_SPEAR600_EVB
 	help
 	  Supports ST SPEAr600 Evaluation Board
 
+config BOARD_SPEAR600_DT
+	bool "SPEAr600 generic board configured via device-tree"
+	select MACH_SPEAR600
+	select USE_OF
+	help
+	  Supports ST SPEAr600 boards configured via the device-tree
+
 endmenu
 
 config MACH_SPEAR600
arch/arm/mach-spear6xx/Makefile +0 -3
index cc1a4d8..6f87c3a 100644
@@ -5,8 +5,5 @@
 # common files
 obj-y	+= clock.o spear6xx.o
 
-# spear600 specific files
-obj-$(CONFIG_MACH_SPEAR600) += spear600.o
-
 # spear600 boards files
 obj-$(CONFIG_BOARD_SPEAR600_EVB) += spear600_evb.o
arch/arm/mach-spear6xx/spear600.c deleted +0 -25
deleted file mode 100644
index d0e6eea..0000000
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-spear6xx/spear600.c
- *
- * SPEAr600 machine source file
- *
- * Copyright (C) 2009 ST Microelectronics
- * Rajeev Kumar<[email protected]>
- *
- * 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.
- */
-
-#include <linux/ptrace.h>
-#include <asm/irq.h>
-#include <mach/generic.h>
-#include <mach/hardware.h>
-
-/* Add spear600 specific devices here */
-
-void __init spear600_init(void)
-{
-	/* call spear6xx family common init function */
-	spear6xx_init();
-}
arch/arm/mach-spear6xx/spear600_evb.c +0 -3
index c6e4254..c4949aa 100644
@@ -32,9 +32,6 @@ static void __init spear600_evb_init(void)
 {
 	unsigned int i;
 
-	/* call spear600 machine init function */
-	spear600_init();
-
 	/* Add Platform Devices */
 	platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
 
arch/arm/mach-spear6xx/spear6xx.c +20 -6
index e0f6628..aca20f0 100644
@@ -6,6 +6,8 @@
  * Copyright (C) 2009 ST Microelectronics
  * Rajeev Kumar<[email protected]>
  *
+ * Copyright 2012 Stefan Roese <[email protected]>
+ *
  * 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.
@@ -15,6 +17,10 @@
 #include <linux/amba/pl061.h>
 #include <linux/ptrace.h>
 #include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
 #include <asm/hardware/vic.h>
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
@@ -99,12 +105,6 @@ struct amba_device gpio_device[] = {
 	}
 };
 
-/* This will add devices, and do machine specific tasks */
-void __init spear6xx_init(void)
-{
-	/* nothing to do for now */
-}
-
 /* This will initialize vic */
 void __init spear6xx_init_irq(void)
 {
@@ -181,3 +181,60 @@ static void __init spear6xx_timer_init(void)
 struct sys_timer spear6xx_timer = {
 	.init = spear6xx_timer_init,
 };
+
+/*
+ * Devicetree specific init structs/functions:
+ * Once the SPEAr600 devicetree support has matured, we can remove
+ * spear600_evb.c and the non-devicetree support above in this file.
+ */
+
+/*
+ * Add auxdata so that clock name matching doesn't fail in device
+ * drivers
+ */
+struct of_dev_auxdata spear600_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA("arm,pl011", SPEAR6XX_ICM1_UART0_BASE,
+		       "uart0", NULL),

arch/arm/mach-spear6xx/spear6xx.c static void __init spear6xx_timer_init(void) · line 207

Quoted 10 lines
arch/arm/mach-spear6xx/spear6xx.c +10 -0
+	OF_DEV_AUXDATA("arm,pl011", SPEAR6XX_ICM1_UART1_BASE,
+		       "uart1", NULL),
+	OF_DEV_AUXDATA("arm,pl061", SPEAR6XX_CPU_GPIO_BASE,
+		       "gpio0", NULL),
+	OF_DEV_AUXDATA("arm,pl061", SPEAR6XX_ICM3_GPIO_BASE,
+		       "gpio1", NULL),
+	OF_DEV_AUXDATA("arm,pl061", SPEAR6XX_ICM2_GPIO_BASE,
+		       "gpio2", NULL),
+	OF_DEV_AUXDATA("snps,designware-i2c", SPEAR6XX_ICM1_I2C_BASE,
+		       "i2c_designware.0", NULL),

update the clkdev no more OF_DEV_AUXDATA

please keep me in Cc

Best Regards,
J.

#3 lore raw

PATCH v2 1/1 ARM: SPEAr600: Add device-tree support to SPEAr600 boards

Quoted 94 lines · On Wednesday 14 March 2012 17:21:52 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 93 lines · Stefan Roese

This patch adds a generic target for SPEAr600 board that can be configured via the device-tree. Currently the following devices are supported via the devicetree:

- VIC interrupts
- PL011 UART
- PL061 GPIO
- Synopsys DW I2C
- Synopsys DW ethernet

Other peripheral devices (e.g. SMI flash, FSMC NAND flash etc) will follow in later patches.

Only the spear600-evb is currently supported. Other SPEAr600 based boards will follow later.

Additionally the file spear600.c is deleted. It contained only one empty function and is not needed. So lets just remove it.

Cc Viresh Kumar <[email protected]>
Cc Arnd Bergmann <[email protected]>

---
v2:
- Added DT support to spear6xx.c instead of creating board-dt.c
- Removed UART (PL011) and GPIO (PL061) platform data for

devicetree board port. This works now via DT probing

- Added OF_DEV_AUXDATA for clock device name matching for some

device drivers

- Removed sper600.c file completely
- Added DW I2C and ethernet nodes to the dts files
- Added other DT nodes (SMI, FSMC, ECHI, OHCI), currently disabled

since the corresponding device drivers don't support DT probing

- Removed Linaro/FSL copyright notice from SPEAr DT files (copy-paste cruft) - Many smaller modification to the dts/dtsi files
- Changed Documentation/devicetree/bindings/arm/spear.txt to match

the changed bindings

 Documentation/devicetree/bindings/arm/spear.txt |    8 ++
 arch/arm/boot/dts/spear600-evb.dts              |   30 +++++
 arch/arm/boot/dts/spear600.dtsi                 |  162
 +++++++++++++++++++++++ arch/arm/mach-spear6xx/Kconfig                 
 |    7 +
 arch/arm/mach-spear6xx/Makefile                 |    3 -
 arch/arm/mach-spear6xx/spear600.c               |   25 ----
 arch/arm/mach-spear6xx/spear600_evb.c           |    3 -
 arch/arm/mach-spear6xx/spear6xx.c               |   69 +++++++++-
 8 files changed, 270 insertions(+), 37 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/spear.txt
 create mode 100644 arch/arm/boot/dts/spear600-evb.dts
 create mode 100644 arch/arm/boot/dts/spear600.dtsi
 delete mode 100644 arch/arm/mach-spear6xx/spear600.c
(quoted diff) +0 -0

b/Documentation/devicetree/bindings/arm/spear.txt new file mode 100644 index 0000000..f8e54f0

Documentation/devicetree/bindings/arm/spear.txt new file +8 -0
@@ -0,0 +1,8 @@
+ST SPEAr Platforms Device Tree Bindings
+---------------------------------------
+
+Boards with the ST SPEAr600 SoC shall have the following properties:
+
+Required root node property:
+
+compatible = "st,spear600";
(quoted diff) +0 -0

b/arch/arm/boot/dts/spear600-evb.dts new file mode 100644 index 0000000..cbfda8d

arch/arm/boot/dts/spear600-evb.dts new file +13 -0
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2012 Stefan Roese <[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/ "spear600.dtsi"
Quoted 8 lines

arch/arm/boot/dts/spear600-evb.dts line 19

Quoted 6 lines
arch/arm/boot/dts/spear600-evb.dts new file +6 -0
+
+/ {
+	model = "ST SPEAr600 Evaluation Board";
+	compatible = "st,spear600-evb", "st,spear600";
+	#address-cells = <1>;
+	#size-cells = <1>;

please put the mem size here

Might I ask why? Other *.dtsi files don't have it either.

Quoted 36 lines
Quoted 36 lines
arch/arm/boot/dts/spear600-evb.dts new file +11 -0
+
+	soc {
+		gmac0: ethernet at e0800000 {
+			phy-mode = "gmii";
+		};
+
+		i2c at d0200000 {
+			clock-frequency = <400000>;
+		};
+	};
+};
(quoted diff) +0 -0

b/arch/arm/boot/dts/spear600.dtsi new file mode 100644 index 0000000..e45e58f

arch/arm/boot/dts/spear600.dtsi new file +19 -0
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2012 Stefan Roese <[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
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "st,spear600";
+
+	cpus {
+		cpu at 0 {
+			compatible = "arm,arm926ejs";
Quoted 8 lines

arch/arm/boot/dts/spear600.dtsi line 25

Quoted 6 lines
arch/arm/boot/dts/spear600.dtsi new file +6 -0
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0>; /* Filled by U-Boot */

please put the max mem of the SoC here

Why? It's always updated by the bootloader. And a max. mem size (when not updated to the correct mem size by the bootloader) would crash the board if it is equipped with less memory.

Quoted 5 lines

arch/arm/boot/dts/spear600.dtsi line 28

Quoted 3 lines
arch/arm/boot/dts/spear600.dtsi new file +3 -0
+	};
+
+	soc {

please put the name of the bus not soc

Okay.

Quoted 62 lines
Quoted 62 lines
arch/arm/boot/dts/spear600.dtsi new file +62 -0
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "simple-bus";
+		ranges;
+
+		vic0: interrupt-controller at f1100000 {
+			compatible = "arm,pl190-vic";
+			interrupt-controller;
+			reg = <0xf1100000 0x1000>;
+			#interrupt-cells = <1>;
+		};
+
+		vic1: interrupt-controller at f1000000 {
+			compatible = "arm,pl190-vic";
+			interrupt-controller;
+			reg = <0xf1000000 0x1000>;
+			#interrupt-cells = <1>;
+		};
+
+		serial at d0000000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0xd0000000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <24>;
+		};
+
+		serial at d0080000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0xd0080000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <25>;
+		};
+
+		/* local/cpu GPIO */
+		gpio0: gpio at f0100000 {
+			#gpio-cells = <2>;
+			compatible = "arm,pl061", "arm,primecell";
+			gpio-controller;
+			reg = <0xf0100000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <18>;
+		};
+
+		/* basic GPIO */
+		gpio1: gpio at fc980000 {
+			#gpio-cells = <2>;
+			compatible = "arm,pl061", "arm,primecell";
+			gpio-controller;
+			reg = <0xfc980000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <19>;
+		};
+
+		/* appl GPIO */
+		gpio2: gpio at d8100000 {
+			#gpio-cells = <2>;
+			compatible = "arm,pl061", "arm,primecell";
+			gpio-controller;
+			reg = <0xd8100000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <4>;
+		};
Quoted 8 lines

arch/arm/boot/dts/spear600.dtsi

Quoted 8 lines
arch/arm/boot/dts/spear600.dtsi new file +8 -0
+
+		gmac0: ethernet at e0800000 {
+			compatible = "st,spear600-gmac";
+			reg = <0xe0800000 0x8000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <24 23>;
+			interrupt-names = "macirq", "eth_wake_irq";
+			mac-address = [000000000000]; /* Filled in by U-Boot 

*/

Quoted 56 lines
Quoted 56 lines
arch/arm/boot/dts/spear600.dtsi new file +56 -0
+		};
+
+		i2c at d0200000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0xd0200000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <28>;
+		};
+
+		fsmc0: flash at d1800000 {
+			status = "disabled";
+			compatible = "st,spear600-fsmc-nand";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0xd1800000 0x1000	/* FSMC Register */
+			       0xd2000000 0x4000>;	/* NAND Base */
+			reg-names = "fsmc_regs", "nand_data";
+		};
+
+		smi0: flash at fc000000 {
+			status = "disabled";
+			compatible = "st,spear600-smi";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0xfc000000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <12>;
+		};
+
+		ehci at e1800000 {
+			status = "disabled";
+			compatible = "st,spear600-ehci", "usb-ehci";
+			reg = <0xe1800000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <27>;
+		};
+
+		ehci at e2000000 {
+			status = "disabled";
+			compatible = "st,spear600-ehci", "usb-ehci";
+			reg = <0xe2000000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <29>;
+		};
+
+		ohci at e1900000 {
+			status = "disabled";
+			compatible = "st,spear600-ohci", "usb-ohci";
+			reg = <0xe1900000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <26>;
+		};
+
+		ohci at e2100000 {
Quoted 8 lines

arch/arm/boot/dts/spear600.dtsi line 160

Quoted 6 lines
arch/arm/boot/dts/spear600.dtsi new file +6 -0
+			status = "disabled";
+			compatible = "st,spear600-ohci", "usb-ohci";
+			reg = <0xe2100000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <28>;
+		};

all of this need a Doc for the ST bindings

Sure. I only provided those nodes on Arnd's special request. They are currently disabled. And documentation will follow with the DT device driver patches.

Quoted 163 lines
Quoted 163 lines
arch/arm/boot/dts/spear600.dtsi new file +2 -0
+	};
+};
(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/Kconfig index ff4ae5b..7777f72 100644

arch/arm/mach-spear6xx/Kconfig +7 -0
@@ -11,6 +11,13 @@ config BOARD_SPEAR600_EVB
 
 	help
 
 	  Supports ST SPEAr600 Evaluation Board
 
+config BOARD_SPEAR600_DT
+	bool "SPEAr600 generic board configured via device-tree"
+	select MACH_SPEAR600
+	select USE_OF
+	help
+	  Supports ST SPEAr600 boards configured via the device-tree
+
 

endmenu

config MACH_SPEAR600

(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/Makefile index cc1a4d8..6f87c3a 100644

arch/arm/mach-spear6xx/Makefile +0 -3
@@ -5,8 +5,5 @@
 
 # common files
 obj-y	+= clock.o spear6xx.o
 
-# spear600 specific files
-obj-$(CONFIG_MACH_SPEAR600) += spear600.o
-
 
 # spear600 boards files
 obj-$(CONFIG_BOARD_SPEAR600_EVB) += spear600_evb.o
(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/spear600.c deleted file mode 100644 index d0e6eea..0000000

arch/arm/mach-spear6xx/spear600.c deleted +0 -25
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-spear6xx/spear600.c
- *
- * SPEAr600 machine source file
- *
- * Copyright (C) 2009 ST Microelectronics
- * Rajeev Kumar<[email protected]>
- *
- * 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.
- */
-
-#include <linux/ptrace.h>
-#include <asm/irq.h>
-#include <mach/generic.h>
-#include <mach/hardware.h>
-
-/* Add spear600 specific devices here */
-
-void __init spear600_init(void)
-{
-	/* call spear6xx family common init function */
-	spear6xx_init();
-}
(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/spear600_evb.c index c6e4254..c4949aa 100644

arch/arm/mach-spear6xx/spear600_evb.c +0 -3
@@ -32,9 +32,6 @@ static void __init spear600_evb_init(void)
 
 {
 
 	unsigned int i;
 
-	/* call spear600 machine init function */
-	spear600_init();
-
 
arch/arm/mach-spear6xx/spear600_evb.c +0 -0
 	/* Add Platform Devices */
 	platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/spear6xx.c index e0f6628..aca20f0 100644

arch/arm/mach-spear6xx/spear6xx.c +2 -0
@@ -6,6 +6,8 @@
 
  * Copyright (C) 2009 ST Microelectronics
  * Rajeev Kumar<[email protected]>
  *
 
+ * Copyright 2012 Stefan Roese <[email protected]>
+ *
 

* 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.

arch/arm/mach-spear6xx/spear6xx.c +4 -0
@@ -15,6 +17,10 @@
 
 #include <linux/amba/pl061.h>
 #include <linux/ptrace.h>
 #include <linux/io.h>
 
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
 

#include <asm/hardware/vic.h>
#include <asm/irq.h>
#include <asm/mach/arch.h>

arch/arm/mach-spear6xx/spear6xx.c +0 -6
@@ -99,12 +105,6 @@ struct amba_device gpio_device[] = {
 
 	}
 
 };
 
-/* This will add devices, and do machine specific tasks */
-void __init spear6xx_init(void)
-{
-	/* nothing to do for now */
-}
-
 

/* This will initialize vic */
void __init spear6xx_init_irq(void)
{

arch/arm/mach-spear6xx/spear6xx.c +18 -0
@@ -181,3 +181,60 @@ static void __init spear6xx_timer_init(void)
 
 struct sys_timer spear6xx_timer = {
 
 	.init = spear6xx_timer_init,
 
 };
 
+
+/*
+ * Devicetree specific init structs/functions:
+ * Once the SPEAr600 devicetree support has matured, we can remove
+ * spear600_evb.c and the non-devicetree support above in this file.
+ */
+
+/*
+ * Add auxdata so that clock name matching doesn't fail in device
+ * drivers
+ */
+struct of_dev_auxdata spear600_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA("arm,pl011", SPEAR6XX_ICM1_UART0_BASE,
+		       "uart0", NULL),
+	OF_DEV_AUXDATA("arm,pl011", SPEAR6XX_ICM1_UART1_BASE,
+		       "uart1", NULL),
+	OF_DEV_AUXDATA("arm,pl061", SPEAR6XX_CPU_GPIO_BASE,
+		       "gpio0", NULL),
Quoted 8 lines

arch/arm/mach-spear6xx/spear6xx.c static void __init spear6xx_timer_init(void) · line 207

Quoted 6 lines
arch/arm/mach-spear6xx/spear6xx.c +6 -0
+	OF_DEV_AUXDATA("arm,pl061", SPEAR6XX_ICM3_GPIO_BASE,
+		       "gpio1", NULL),
+	OF_DEV_AUXDATA("arm,pl061", SPEAR6XX_ICM2_GPIO_BASE,
+		       "gpio2", NULL),
+	OF_DEV_AUXDATA("snps,designware-i2c", SPEAR6XX_ICM1_I2C_BASE,
+		       "i2c_designware.0", NULL),

update the clkdev no more OF_DEV_AUXDATA

That will break non-DT boards. We can change it in clkdev later, once DT support has stabalized for SPEAr600. And remove all this then.

Quoted 2 lines

please keep me in Cc

Sure.

Cheers,
Stefan

#4 lore raw

PATCH v2 1/1 ARM: SPEAr600: Add device-tree support to SPEAr600 boards

Quoted 104 lines · Stefan Roese
Quoted 94 lines · On Wednesday 14 March 2012 17:21:52 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 93 lines · Stefan Roese

This patch adds a generic target for SPEAr600 board that can be configured via the device-tree. Currently the following devices are supported via the devicetree:

- VIC interrupts
- PL011 UART
- PL061 GPIO
- Synopsys DW I2C
- Synopsys DW ethernet

Other peripheral devices (e.g. SMI flash, FSMC NAND flash etc) will follow in later patches.

Only the spear600-evb is currently supported. Other SPEAr600 based boards will follow later.

Additionally the file spear600.c is deleted. It contained only one empty function and is not needed. So lets just remove it.

Cc Viresh Kumar <[email protected]>
Cc Arnd Bergmann <[email protected]>

---
v2:
- Added DT support to spear6xx.c instead of creating board-dt.c
- Removed UART (PL011) and GPIO (PL061) platform data for

devicetree board port. This works now via DT probing

- Added OF_DEV_AUXDATA for clock device name matching for some

device drivers

- Removed sper600.c file completely
- Added DW I2C and ethernet nodes to the dts files
- Added other DT nodes (SMI, FSMC, ECHI, OHCI), currently disabled

since the corresponding device drivers don't support DT probing

- Removed Linaro/FSL copyright notice from SPEAr DT files (copy-paste cruft) - Many smaller modification to the dts/dtsi files
- Changed Documentation/devicetree/bindings/arm/spear.txt to match

the changed bindings

 Documentation/devicetree/bindings/arm/spear.txt |    8 ++
 arch/arm/boot/dts/spear600-evb.dts              |   30 +++++
 arch/arm/boot/dts/spear600.dtsi                 |  162
 +++++++++++++++++++++++ arch/arm/mach-spear6xx/Kconfig                 
 |    7 +
 arch/arm/mach-spear6xx/Makefile                 |    3 -
 arch/arm/mach-spear6xx/spear600.c               |   25 ----
 arch/arm/mach-spear6xx/spear600_evb.c           |    3 -
 arch/arm/mach-spear6xx/spear6xx.c               |   69 +++++++++-
 8 files changed, 270 insertions(+), 37 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/spear.txt
 create mode 100644 arch/arm/boot/dts/spear600-evb.dts
 create mode 100644 arch/arm/boot/dts/spear600.dtsi
 delete mode 100644 arch/arm/mach-spear6xx/spear600.c
(quoted diff) +0 -0

b/Documentation/devicetree/bindings/arm/spear.txt new file mode 100644 index 0000000..f8e54f0

Documentation/devicetree/bindings/arm/spear.txt new file +8 -0
@@ -0,0 +1,8 @@
+ST SPEAr Platforms Device Tree Bindings
+---------------------------------------
+
+Boards with the ST SPEAr600 SoC shall have the following properties:
+
+Required root node property:
+
+compatible = "st,spear600";
(quoted diff) +0 -0

b/arch/arm/boot/dts/spear600-evb.dts new file mode 100644 index 0000000..cbfda8d

arch/arm/boot/dts/spear600-evb.dts new file +13 -0
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2012 Stefan Roese <[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/ "spear600.dtsi"
Quoted 8 lines

arch/arm/boot/dts/spear600-evb.dts line 19

Quoted 6 lines
arch/arm/boot/dts/spear600-evb.dts new file +6 -0
+
+/ {
+	model = "ST SPEAr600 Evaluation Board";
+	compatible = "st,spear600-evb", "st,spear600";
+	#address-cells = <1>;
+	#size-cells = <1>;

please put the mem size here

Quoted 1 line

Might I ask why? Other *.dtsi files don't have it either.

do not expect the bootloader to put it. I t's not mandatory

Quoted 46 lines
Quoted 37 lines
Quoted 37 lines
arch/arm/boot/dts/spear600-evb.dts new file +11 -0
+
+	soc {
+		gmac0: ethernet at e0800000 {
+			phy-mode = "gmii";
+		};
+
+		i2c at d0200000 {
+			clock-frequency = <400000>;
+		};
+	};
+};
(quoted diff) +0 -0

b/arch/arm/boot/dts/spear600.dtsi new file mode 100644 index 0000000..e45e58f

arch/arm/boot/dts/spear600.dtsi new file +19 -0
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2012 Stefan Roese <[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
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "st,spear600";
+
+	cpus {
+		cpu at 0 {
+			compatible = "arm,arm926ejs";
Quoted 8 lines

arch/arm/boot/dts/spear600.dtsi line 25

Quoted 6 lines
arch/arm/boot/dts/spear600.dtsi new file +6 -0
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0>; /* Filled by U-Boot */

please put the max mem of the SoC here

Quoted 3 lines

Why? It's always updated by the bootloader. And a max. mem size (when not updated to the correct mem size by the bootloader) would crash the board if it is equipped with less memory.

yes but we descripbe the soc here and on the dts you reduce it Never expect the bootloader to update it.

It's a possibility not mandatory

Quoted 72 lines
Quoted 6 lines

arch/arm/boot/dts/spear600.dtsi line 28

Quoted 4 lines
arch/arm/boot/dts/spear600.dtsi new file +3 -0
+	};
+
+	soc {

please put the name of the bus not soc

Okay.

Quoted 63 lines
Quoted 63 lines
arch/arm/boot/dts/spear600.dtsi new file +63 -0
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "simple-bus";
+		ranges;
+
+		vic0: interrupt-controller at f1100000 {
+			compatible = "arm,pl190-vic";
+			interrupt-controller;
+			reg = <0xf1100000 0x1000>;
+			#interrupt-cells = <1>;
+		};
+
+		vic1: interrupt-controller at f1000000 {
+			compatible = "arm,pl190-vic";
+			interrupt-controller;
+			reg = <0xf1000000 0x1000>;
+			#interrupt-cells = <1>;
+		};
+
+		serial at d0000000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0xd0000000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <24>;
+		};
+
+		serial at d0080000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0xd0080000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <25>;
+		};
+
+		/* local/cpu GPIO */
+		gpio0: gpio at f0100000 {
+			#gpio-cells = <2>;
+			compatible = "arm,pl061", "arm,primecell";
+			gpio-controller;
+			reg = <0xf0100000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <18>;
+		};
+
+		/* basic GPIO */
+		gpio1: gpio at fc980000 {
+			#gpio-cells = <2>;
+			compatible = "arm,pl061", "arm,primecell";
+			gpio-controller;
+			reg = <0xfc980000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <19>;
+		};
+
+		/* appl GPIO */
+		gpio2: gpio at d8100000 {
+			#gpio-cells = <2>;
+			compatible = "arm,pl061", "arm,primecell";
+			gpio-controller;
+			reg = <0xd8100000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <4>;
+		};
+
Quoted 8 lines
Quoted 7 lines

arch/arm/boot/dts/spear600.dtsi

Quoted 7 lines
arch/arm/boot/dts/spear600.dtsi new file +7 -0
+		gmac0: ethernet at e0800000 {
+			compatible = "st,spear600-gmac";
+			reg = <0xe0800000 0x8000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <24 23>;
+			interrupt-names = "macirq", "eth_wake_irq";
+			mac-address = [000000000000]; /* Filled in by U-Boot 

*/

drop this no dummy data

Quoted 65 lines
Quoted 56 lines
Quoted 56 lines
arch/arm/boot/dts/spear600.dtsi new file +56 -0
+		};
+
+		i2c at d0200000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0xd0200000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <28>;
+		};
+
+		fsmc0: flash at d1800000 {
+			status = "disabled";
+			compatible = "st,spear600-fsmc-nand";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0xd1800000 0x1000	/* FSMC Register */
+			       0xd2000000 0x4000>;	/* NAND Base */
+			reg-names = "fsmc_regs", "nand_data";
+		};
+
+		smi0: flash at fc000000 {
+			status = "disabled";
+			compatible = "st,spear600-smi";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0xfc000000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <12>;
+		};
+
+		ehci at e1800000 {
+			status = "disabled";
+			compatible = "st,spear600-ehci", "usb-ehci";
+			reg = <0xe1800000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <27>;
+		};
+
+		ehci at e2000000 {
+			status = "disabled";
+			compatible = "st,spear600-ehci", "usb-ehci";
+			reg = <0xe2000000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <29>;
+		};
+
+		ohci at e1900000 {
+			status = "disabled";
+			compatible = "st,spear600-ohci", "usb-ohci";
+			reg = <0xe1900000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <26>;
+		};
+
+		ohci at e2100000 {
Quoted 8 lines

arch/arm/boot/dts/spear600.dtsi line 160

Quoted 6 lines
arch/arm/boot/dts/spear600.dtsi new file +6 -0
+			status = "disabled";
+			compatible = "st,spear600-ohci", "usb-ohci";
+			reg = <0xe2100000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <28>;
+		};

all of this need a Doc for the ST bindings

Quoted 3 lines

Sure. I only provided those nodes on Arnd's special request. They are currently disabled. And documentation will follow with the DT device driver patches.

no update it after

Quoted 173 lines
Quoted 164 lines
Quoted 164 lines
arch/arm/boot/dts/spear600.dtsi new file +2 -0
+	};
+};
(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/Kconfig index ff4ae5b..7777f72 100644

arch/arm/mach-spear6xx/Kconfig +7 -0
@@ -11,6 +11,13 @@ config BOARD_SPEAR600_EVB
 
 	help
 
 	  Supports ST SPEAr600 Evaluation Board
 
+config BOARD_SPEAR600_DT
+	bool "SPEAr600 generic board configured via device-tree"
+	select MACH_SPEAR600
+	select USE_OF
+	help
+	  Supports ST SPEAr600 boards configured via the device-tree
+
 

endmenu

config MACH_SPEAR600

(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/Makefile index cc1a4d8..6f87c3a 100644

arch/arm/mach-spear6xx/Makefile +0 -3
@@ -5,8 +5,5 @@
 
 # common files
 obj-y	+= clock.o spear6xx.o
 
-# spear600 specific files
-obj-$(CONFIG_MACH_SPEAR600) += spear600.o
-
 
 # spear600 boards files
 obj-$(CONFIG_BOARD_SPEAR600_EVB) += spear600_evb.o
(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/spear600.c deleted file mode 100644 index d0e6eea..0000000

arch/arm/mach-spear6xx/spear600.c deleted +0 -25
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-spear6xx/spear600.c
- *
- * SPEAr600 machine source file
- *
- * Copyright (C) 2009 ST Microelectronics
- * Rajeev Kumar<[email protected]>
- *
- * 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.
- */
-
-#include <linux/ptrace.h>
-#include <asm/irq.h>
-#include <mach/generic.h>
-#include <mach/hardware.h>
-
-/* Add spear600 specific devices here */
-
-void __init spear600_init(void)
-{
-	/* call spear6xx family common init function */
-	spear6xx_init();
-}
(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/spear600_evb.c index c6e4254..c4949aa 100644

arch/arm/mach-spear6xx/spear600_evb.c +0 -3
@@ -32,9 +32,6 @@ static void __init spear600_evb_init(void)
 
 {
 
 	unsigned int i;
 
-	/* call spear600 machine init function */
-	spear600_init();
-
 
arch/arm/mach-spear6xx/spear600_evb.c +0 -0
 	/* Add Platform Devices */
 	platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/spear6xx.c index e0f6628..aca20f0 100644

arch/arm/mach-spear6xx/spear6xx.c +2 -0
@@ -6,6 +6,8 @@
 
  * Copyright (C) 2009 ST Microelectronics
  * Rajeev Kumar<[email protected]>
  *
 
+ * Copyright 2012 Stefan Roese <[email protected]>
+ *
 

* 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.

arch/arm/mach-spear6xx/spear6xx.c +4 -0
@@ -15,6 +17,10 @@
 
 #include <linux/amba/pl061.h>
 #include <linux/ptrace.h>
 #include <linux/io.h>
 
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
 

#include <asm/hardware/vic.h>
#include <asm/irq.h>
#include <asm/mach/arch.h>

arch/arm/mach-spear6xx/spear6xx.c +0 -6
@@ -99,12 +105,6 @@ struct amba_device gpio_device[] = {
 
 	}
 
 };
 
-/* This will add devices, and do machine specific tasks */
-void __init spear6xx_init(void)
-{
-	/* nothing to do for now */
-}
-
 

/* This will initialize vic */
void __init spear6xx_init_irq(void)
{

arch/arm/mach-spear6xx/spear6xx.c +18 -0
@@ -181,3 +181,60 @@ static void __init spear6xx_timer_init(void)
 
 struct sys_timer spear6xx_timer = {
 
 	.init = spear6xx_timer_init,
 
 };
 
+
+/*
+ * Devicetree specific init structs/functions:
+ * Once the SPEAr600 devicetree support has matured, we can remove
+ * spear600_evb.c and the non-devicetree support above in this file.
+ */
+
+/*
+ * Add auxdata so that clock name matching doesn't fail in device
+ * drivers
+ */
+struct of_dev_auxdata spear600_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA("arm,pl011", SPEAR6XX_ICM1_UART0_BASE,
+		       "uart0", NULL),
+	OF_DEV_AUXDATA("arm,pl011", SPEAR6XX_ICM1_UART1_BASE,
+		       "uart1", NULL),
+	OF_DEV_AUXDATA("arm,pl061", SPEAR6XX_CPU_GPIO_BASE,
+		       "gpio0", NULL),
Quoted 8 lines

arch/arm/mach-spear6xx/spear6xx.c static void __init spear6xx_timer_init(void) · line 207

Quoted 6 lines
arch/arm/mach-spear6xx/spear6xx.c +6 -0
+	OF_DEV_AUXDATA("arm,pl061", SPEAR6XX_ICM3_GPIO_BASE,
+		       "gpio1", NULL),
+	OF_DEV_AUXDATA("arm,pl061", SPEAR6XX_ICM2_GPIO_BASE,
+		       "gpio2", NULL),
+	OF_DEV_AUXDATA("snps,designware-i2c", SPEAR6XX_ICM1_I2C_BASE,
+		       "i2c_designware.0", NULL),

update the clkdev no more OF_DEV_AUXDATA

Quoted 2 lines

That will break non-DT boards. We can change it in clkdev later, once DT support has stabalized for SPEAr600. And remove all this then.

it will not just add new entry

as done on AT91 as example and requested for imx recently too

Best Regards,
J.

#5 lore raw

PATCH v2 1/1 ARM: SPEAr600: Add device-tree support to SPEAr600 boards

Quoted 28 lines · On Wednesday 14 March 2012 18:24:35 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 28 lines
Quoted 27 lines
Quoted 16 lines
(quoted diff) +0 -0

b/arch/arm/boot/dts/spear600-evb.dts new file mode 100644 index 0000000..cbfda8d

arch/arm/boot/dts/spear600-evb.dts new file +4 -0
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2012 Stefan Roese <[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
+ */

arch/arm/boot/dts/spear600-evb.dts line 19

Quoted 9 lines
arch/arm/boot/dts/spear600-evb.dts new file +9 -0
+
+/dts-v1/;
+/include/ "spear600.dtsi"
+
+/ {
+	model = "ST SPEAr600 Evaluation Board";
+	compatible = "st,spear600-evb", "st,spear600";
+	#address-cells = <1>;
+	#size-cells = <1>;

please put the mem size here

Quoted 3 lines
Quoted 1 line

Might I ask why? Other *.dtsi files don't have it either.

do not expect the bootloader to put it. I t's not mandatory

But the memory node it is already present in spear600.dtsi (see below). Do we really need to duplicate this in the board specific dts file?

Quoted 45 lines
Quoted 45 lines
Quoted 44 lines
Quoted 32 lines
arch/arm/boot/dts/spear600-evb.dts new file +11 -0
+
+	soc {
+		gmac0: ethernet at e0800000 {
+			phy-mode = "gmii";
+		};
+
+		i2c at d0200000 {
+			clock-frequency = <400000>;
+		};
+	};
+};
(quoted diff) +0 -0

b/arch/arm/boot/dts/spear600.dtsi new file mode 100644 index 0000000..e45e58f

arch/arm/boot/dts/spear600.dtsi new file +4 -0
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2012 Stefan Roese <[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
+ */

arch/arm/boot/dts/spear600.dtsi new file +5 -0
+
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "st,spear600";

arch/arm/boot/dts/spear600.dtsi line 25

Quoted 10 lines
arch/arm/boot/dts/spear600.dtsi new file +10 -0
+
+	cpus {
+		cpu at 0 {
+			compatible = "arm,arm926ejs";
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0>; /* Filled by U-Boot */

please put the max mem of the SoC here

Quoted 6 lines
Quoted 3 lines

Why? It's always updated by the bootloader. And a max. mem size (when not updated to the correct mem size by the bootloader) would crash the board if it is equipped with less memory.

yes but we descripbe the soc here and on the dts you reduce it Never expect the bootloader to update it.

Without update to real size we're doomed.

Quoted 1 line

It's a possibility not mandatory

Okay, I'll add the max. size here.

Quoted 70 lines
Quoted 70 lines
Quoted 5 lines

arch/arm/boot/dts/spear600.dtsi line 28

Quoted 3 lines
arch/arm/boot/dts/spear600.dtsi new file +3 -0
+	};
+
+	soc {

please put the name of the bus not soc

Okay.

Quoted 62 lines
Quoted 62 lines
arch/arm/boot/dts/spear600.dtsi new file +62 -0
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "simple-bus";
+		ranges;
+
+		vic0: interrupt-controller at f1100000 {
+			compatible = "arm,pl190-vic";
+			interrupt-controller;
+			reg = <0xf1100000 0x1000>;
+			#interrupt-cells = <1>;
+		};
+
+		vic1: interrupt-controller at f1000000 {
+			compatible = "arm,pl190-vic";
+			interrupt-controller;
+			reg = <0xf1000000 0x1000>;
+			#interrupt-cells = <1>;
+		};
+
+		serial at d0000000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0xd0000000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <24>;
+		};
+
+		serial at d0080000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0xd0080000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <25>;
+		};
+
+		/* local/cpu GPIO */
+		gpio0: gpio at f0100000 {
+			#gpio-cells = <2>;
+			compatible = "arm,pl061", "arm,primecell";
+			gpio-controller;
+			reg = <0xf0100000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <18>;
+		};
+
+		/* basic GPIO */
+		gpio1: gpio at fc980000 {
+			#gpio-cells = <2>;
+			compatible = "arm,pl061", "arm,primecell";
+			gpio-controller;
+			reg = <0xfc980000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <19>;
+		};
+
+		/* appl GPIO */
+		gpio2: gpio at d8100000 {
+			#gpio-cells = <2>;
+			compatible = "arm,pl061", "arm,primecell";
+			gpio-controller;
+			reg = <0xd8100000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <4>;
+		};
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

arch/arm/boot/dts/spear600.dtsi

Quoted 8 lines
arch/arm/boot/dts/spear600.dtsi new file +8 -0
+
+		gmac0: ethernet at e0800000 {
+			compatible = "st,spear600-gmac";
+			reg = <0xe0800000 0x8000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <24 23>;
+			interrupt-names = "macirq", "eth_wake_irq";
+			mac-address = [000000000000]; /* Filled in 

by U-Boot

Quoted 4 lines
Quoted 2 lines

*/

drop this no dummy data

Okay.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
arch/arm/boot/dts/spear600.dtsi new file +9 -0
+		};
+
+		i2c at d0200000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0xd0200000 0x1000>;
+			interrupt-parent = <&vic0>;
+			interrupts = <28>;
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

arch/arm/boot/dts/spear600.dtsi

Quoted 8 lines
arch/arm/boot/dts/spear600.dtsi new file +8 -0
+		};
+
+		fsmc0: flash at d1800000 {
+			status = "disabled";
+			compatible = "st,spear600-fsmc-nand";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0xd1800000 0x1000	/* FSMC 

Register */

Quoted 1 line
Quoted 1 line
Quoted 1 line

arch/arm/boot/dts/spear600.dtsi

Quoted 1 line
arch/arm/boot/dts/spear600.dtsi new file +1 -0
+			       0xd2000000 0x4000>;	/* NAND Base 

*/

Quoted 47 lines
Quoted 47 lines
Quoted 46 lines
Quoted 34 lines
arch/arm/boot/dts/spear600.dtsi new file +34 -0
+			reg-names = "fsmc_regs", "nand_data";
+		};
+
+		smi0: flash at fc000000 {
+			status = "disabled";
+			compatible = "st,spear600-smi";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0xfc000000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <12>;
+		};
+
+		ehci at e1800000 {
+			status = "disabled";
+			compatible = "st,spear600-ehci", "usb-ehci";
+			reg = <0xe1800000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <27>;
+		};
+
+		ehci at e2000000 {
+			status = "disabled";
+			compatible = "st,spear600-ehci", "usb-ehci";
+			reg = <0xe2000000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <29>;
+		};
+
+		ohci at e1900000 {
+			status = "disabled";
+			compatible = "st,spear600-ohci", "usb-ohci";
+			reg = <0xe1900000 0x1000>;
+			interrupt-parent = <&vic1>;

arch/arm/boot/dts/spear600.dtsi line 160

Quoted 10 lines
arch/arm/boot/dts/spear600.dtsi new file +10 -0
+			interrupts = <26>;
+		};
+
+		ohci at e2100000 {
+			status = "disabled";
+			compatible = "st,spear600-ohci", "usb-ohci";
+			reg = <0xe2100000 0x1000>;
+			interrupt-parent = <&vic1>;
+			interrupts = <28>;
+		};

all of this need a Doc for the ST bindings

Quoted 5 lines
Quoted 3 lines

Sure. I only provided those nodes on Arnd's special request. They are currently disabled. And documentation will follow with the DT device driver patches.

no update it after

Hmmm. I'm sorry, but I fail to understand you here. Please explain.

Quoted 172 lines
Quoted 172 lines
Quoted 171 lines
Quoted 159 lines
arch/arm/boot/dts/spear600.dtsi new file +2 -0
+	};
+};
(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/Kconfig index ff4ae5b..7777f72 100644

arch/arm/mach-spear6xx/Kconfig +7 -0
@@ -11,6 +11,13 @@ config BOARD_SPEAR600_EVB
 
 	help
 
 	  Supports ST SPEAr600 Evaluation Board
 
+config BOARD_SPEAR600_DT
+	bool "SPEAr600 generic board configured via device-tree"
+	select MACH_SPEAR600
+	select USE_OF
+	help
+	  Supports ST SPEAr600 boards configured via the device-tree
+
 

endmenu

config MACH_SPEAR600

(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/Makefile index cc1a4d8..6f87c3a 100644

arch/arm/mach-spear6xx/Makefile +0 -3
@@ -5,8 +5,5 @@
 
 # common files
 obj-y	+= clock.o spear6xx.o
 
-# spear600 specific files
-obj-$(CONFIG_MACH_SPEAR600) += spear600.o
-
 
 # spear600 boards files
 obj-$(CONFIG_BOARD_SPEAR600_EVB) += spear600_evb.o
(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/spear600.c deleted file mode 100644 index d0e6eea..0000000

arch/arm/mach-spear6xx/spear600.c deleted +0 -25
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-spear6xx/spear600.c
- *
- * SPEAr600 machine source file
- *
- * Copyright (C) 2009 ST Microelectronics
- * Rajeev Kumar<[email protected]>
- *
- * 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.
- */
-
-#include <linux/ptrace.h>
-#include <asm/irq.h>
-#include <mach/generic.h>
-#include <mach/hardware.h>
-
-/* Add spear600 specific devices here */
-
-void __init spear600_init(void)
-{
-	/* call spear6xx family common init function */
-	spear6xx_init();
-}
(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/spear600_evb.c index c6e4254..c4949aa 100644

arch/arm/mach-spear6xx/spear600_evb.c +0 -3
@@ -32,9 +32,6 @@ static void __init spear600_evb_init(void)
 
 {
 
 	unsigned int i;
 
-	/* call spear600 machine init function */
-	spear600_init();
-
 
arch/arm/mach-spear6xx/spear600_evb.c +0 -0
 	/* Add Platform Devices */
 	platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/spear6xx.c index e0f6628..aca20f0 100644

arch/arm/mach-spear6xx/spear6xx.c +2 -0
@@ -6,6 +6,8 @@
 
  * Copyright (C) 2009 ST Microelectronics
  * Rajeev Kumar<[email protected]>
  *
 
+ * Copyright 2012 Stefan Roese <[email protected]>
+ *
 

* 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.

arch/arm/mach-spear6xx/spear6xx.c +4 -0
@@ -15,6 +17,10 @@
 
 #include <linux/amba/pl061.h>
 #include <linux/ptrace.h>
 #include <linux/io.h>
 
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
 

#include <asm/hardware/vic.h>
#include <asm/irq.h>
#include <asm/mach/arch.h>

arch/arm/mach-spear6xx/spear6xx.c +0 -6
@@ -99,12 +105,6 @@ struct amba_device gpio_device[] = {
 
 	}
 
 };
 
-/* This will add devices, and do machine specific tasks */
-void __init spear6xx_init(void)
-{
-	/* nothing to do for now */
-}
-
 

/* This will initialize vic */
void __init spear6xx_init_irq(void)
{

arch/arm/mach-spear6xx/spear6xx.c +14 -0
@@ -181,3 +181,60 @@ static void __init spear6xx_timer_init(void)
 
 struct sys_timer spear6xx_timer = {
 
 	.init = spear6xx_timer_init,
 
 };
 
+
+/*
+ * Devicetree specific init structs/functions:
+ * Once the SPEAr600 devicetree support has matured, we can remove
+ * spear600_evb.c and the non-devicetree support above in this file.
+ */
+
+/*
+ * Add auxdata so that clock name matching doesn't fail in device
+ * drivers
+ */
+struct of_dev_auxdata spear600_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA("arm,pl011", SPEAR6XX_ICM1_UART0_BASE,
+		       "uart0", NULL),

arch/arm/mach-spear6xx/spear6xx.c static void __init spear6xx_timer_init(void) · line 207

Quoted 10 lines
arch/arm/mach-spear6xx/spear6xx.c +10 -0
+	OF_DEV_AUXDATA("arm,pl011", SPEAR6XX_ICM1_UART1_BASE,
+		       "uart1", NULL),
+	OF_DEV_AUXDATA("arm,pl061", SPEAR6XX_CPU_GPIO_BASE,
+		       "gpio0", NULL),
+	OF_DEV_AUXDATA("arm,pl061", SPEAR6XX_ICM3_GPIO_BASE,
+		       "gpio1", NULL),
+	OF_DEV_AUXDATA("arm,pl061", SPEAR6XX_ICM2_GPIO_BASE,
+		       "gpio2", NULL),
+	OF_DEV_AUXDATA("snps,designware-i2c", SPEAR6XX_ICM1_I2C_BASE,
+		       "i2c_designware.0", NULL),

update the clkdev no more OF_DEV_AUXDATA

Quoted 6 lines
Quoted 2 lines

That will break non-DT boards. We can change it in clkdev later, once DT support has stabalized for SPEAr600. And remove all this then.

it will not just add new entry

as done on AT91 as example and requested for imx recently too

Again, I fail to understand you. Sorry. Please describe in a complete sentence what exactly you mean.

Thanks,
Stefan

#6 lore raw

PATCH v2 1/1 ARM: SPEAr600: Add device-tree support to SPEAr600 boards

Quoted 29 lines · Stefan Roese
Quoted 28 lines · On Wednesday 14 March 2012 18:24:35 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 28 lines
Quoted 27 lines
Quoted 16 lines
(quoted diff) +0 -0

b/arch/arm/boot/dts/spear600-evb.dts new file mode 100644 index 0000000..cbfda8d

arch/arm/boot/dts/spear600-evb.dts new file +4 -0
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2012 Stefan Roese <[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
+ */

arch/arm/boot/dts/spear600-evb.dts line 19

Quoted 9 lines
arch/arm/boot/dts/spear600-evb.dts new file +9 -0
+
+/dts-v1/;
+/include/ "spear600.dtsi"
+
+/ {
+	model = "ST SPEAr600 Evaluation Board";
+	compatible = "st,spear600-evb", "st,spear600";
+	#address-cells = <1>;
+	#size-cells = <1>;

please put the mem size here

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Might I ask why? Other *.dtsi files don't have it either.

do not expect the bootloader to put it. I t's not mandatory

But the memory node it is already present in spear600.dtsi (see below). Do we really need to duplicate this in the board specific dts file?

no if the mem is the same size please drop the commentabout bootloader update it's a common knowlegde on DT for ARM

Quoted 46 lines
Quoted 46 lines
Quoted 46 lines
Quoted 45 lines
Quoted 33 lines
arch/arm/boot/dts/spear600-evb.dts new file +11 -0
+
+	soc {
+		gmac0: ethernet at e0800000 {
+			phy-mode = "gmii";
+		};
+
+		i2c at d0200000 {
+			clock-frequency = <400000>;
+		};
+	};
+};
(quoted diff) +0 -0

b/arch/arm/boot/dts/spear600.dtsi new file mode 100644 index 0000000..e45e58f

arch/arm/boot/dts/spear600.dtsi new file +4 -0
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2012 Stefan Roese <[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
+ */

arch/arm/boot/dts/spear600.dtsi new file +5 -0
+
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "st,spear600";

arch/arm/boot/dts/spear600.dtsi line 25

Quoted 10 lines
arch/arm/boot/dts/spear600.dtsi new file +10 -0
+
+	cpus {
+		cpu at 0 {
+			compatible = "arm,arm926ejs";
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0>; /* Filled by U-Boot */

please put the max mem of the SoC here

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Why? It's always updated by the bootloader. And a max. mem size (when not updated to the correct mem size by the bootloader) would crash the board if it is equipped with less memory.

yes but we descripbe the soc here and on the dts you reduce it Never expect the bootloader to update it.

Without update to real size we're doomed.

yes but the board dts is supposed to udpate it

you put the max in the soc dtsi

and the real mem size in board dts

Best Regards,
J.

#7 lore raw

PATCH v2 1/1 ARM: SPEAr600: Add device-tree support to SPEAr600 boards

In reply to Stefan Roese

Hi Stefan,

Thanks for your patch. :)

I have looked carefully at the patch, regarding addresses and irq numbers, and they look fine. Just few minor comments below:

arch/arm/boot/dts/spear600.dtsi line 92

Quoted 11 lines · Stefan Roese
arch/arm/boot/dts/spear600.dtsi +8 -0
 
+       soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus";
+               ranges;
+
 
+
+               gmac0: ethernet at e0800000 {

There is no gmac1, so can name it gmac only.

arch/arm/boot/dts/spear600.dtsi line 110

Quoted 10 lines
arch/arm/boot/dts/spear600.dtsi +9 -0
+                       compatible = "st,spear600-gmac";
+                       reg = <0xe0800000 0x8000>;
+                       interrupt-parent = <&vic1>;
+                       interrupts = <24 23>;
+                       interrupt-names = "macirq", "eth_wake_irq";
+                       mac-address = [000000000000]; /* Filled in by U-Boot */
+               };
+
 
+               fsmc0: flash at d1800000 {

same.

arch/arm/boot/dts/spear600.dtsi line 120

Quoted 10 lines
arch/arm/boot/dts/spear600.dtsi +10 -0
+                       status = "disabled";
+                       compatible = "st,spear600-fsmc-nand";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0xd1800000 0x1000        /* FSMC Register */
+                              0xd2000000 0x4000>;      /* NAND Base */
+                       reg-names = "fsmc_regs", "nand_data";
+               };
+
+               smi0: flash at fc000000 {

same

Quoted 15 lines
arch/arm/boot/dts/spear600.dtsi +9 -0
+                       status = "disabled";
+                       compatible = "st,spear600-smi";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0xfc000000 0x1000>;
+                       interrupt-parent = <&vic1>;
+                       interrupts = <12>;
+               };
+
arch/arm/mach-spear6xx/spear600_evb.c +0 -0
index c6e4254..c4949aa 100644

arch/arm/mach-spear6xx/spear600_evb.c static void __init spear600_evb_init(void) · line 34

Quoted 3 lines
arch/arm/mach-spear6xx/spear600_evb.c +0 -0
@@ -32,9 +32,6 @@ static void __init spear600_evb_init(void)
 {
        unsigned int i;
 

Why don't we remove the devices from arrays above, which are now supported by DT?

Quoted 8 lines
arch/arm/mach-spear6xx/spear600_evb.c +0 -3
-       /* call spear600 machine init function */
-       spear600_init();
-
        /* Add Platform Devices */
        platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
 
arch/arm/mach-spear6xx/spear6xx.c +0 -0
 

arch/arm/mach-spear6xx/spear6xx.c static void __init spear6xx_timer_init(void) · line 231

Quoted 10 lines
arch/arm/mach-spear6xx/spear6xx.c +10 -0
+static const struct of_device_id vic_of_match[] __initconst = {
+       { .compatible = "arm,pl190-vic", .data = vic_of_init, },
+       { /* Sentinel */ }
+};
+
+static void __init spear6xx_dt_init_irq(void)
+{
+       of_irq_init(vic_of_match);
+}
+

Did you checked this out?

Signature · 1 line
viresh
#8 lore raw

PATCH v2 1/1 ARM: SPEAr600: Add device-tree support to SPEAr600 boards

Hi Viresh,

Quoted 3 lines · On Thursday 15 March 2012 09:19:54 Viresh Kumar wrote:

Hi Stefan,

Thanks for your patch. :)

You are welcome. :)

Quoted 14 lines

I have looked carefully at the patch, regarding addresses and irq numbers, and they look fine. Just few minor comments below:

Quoted 10 lines · Stefan Roese
arch/arm/boot/dts/spear600.dtsi +6 -0
 
+       soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus";
+               ranges;
+
Quoted 4 lines

arch/arm/boot/dts/spear600.dtsi

Quoted 2 lines
arch/arm/boot/dts/spear600.dtsi +2 -0
+
+               gmac0: ethernet at e0800000 {

There is no gmac1, so can name it gmac only.

I have no strong preference here. Not sure, what the common practice is. But I can remove the numbers on those single instance devices.

Quoted 42 lines

arch/arm/boot/dts/spear600.dtsi line 110

Quoted 10 lines
arch/arm/boot/dts/spear600.dtsi +6 -0
+                       compatible = "st,spear600-gmac";
+                       reg = <0xe0800000 0x8000>;
+                       interrupt-parent = <&vic1>;
+                       interrupts = <24 23>;
+                       interrupt-names = "macirq", "eth_wake_irq";
+                       mac-address = [000000000000]; /* Filled in by

U-Boot */ + };

arch/arm/boot/dts/spear600.dtsi +2 -0
+
 
+               fsmc0: flash at d1800000 {

same.

arch/arm/boot/dts/spear600.dtsi line 120

Quoted 10 lines
arch/arm/boot/dts/spear600.dtsi +5 -0
+                       status = "disabled";
+                       compatible = "st,spear600-fsmc-nand";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0xd1800000 0x1000        /* FSMC Register

*/ + 0xd2000000 0x4000>; /* NAND Base
*/ + reg-names = "fsmc_regs", "nand_data";

arch/arm/boot/dts/spear600.dtsi +3 -0
+               };
+
+               smi0: flash at fc000000 {

same

Quoted 16 lines
arch/arm/boot/dts/spear600.dtsi +9 -0
+                       status = "disabled";
+                       compatible = "st,spear600-smi";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0xfc000000 0x1000>;
+                       interrupt-parent = <&vic1>;
+                       interrupts = <12>;
+               };
+
(quoted diff) +0 -0

b/arch/arm/mach-spear6xx/spear600_evb.c index c6e4254..c4949aa 100644

arch/arm/mach-spear6xx/spear600_evb.c +0 -0
@@ -32,9 +32,6 @@ static void __init spear600_evb_init(void)
 
Quoted 6 lines

arch/arm/mach-spear6xx/spear600_evb.c static void __init spear600_evb_init(void) · line 33

Quoted 3 lines
arch/arm/mach-spear6xx/spear600_evb.c +0 -0
 {
 
        unsigned int i;

Why don't we remove the devices from arrays above, which are now supported by DT?

This is the non-DT file (spear600_evb.c). I wanted to preserve it, so that it still can be built. But thinking a bit more about it, the current mainline SPEAr600 port only supports UART and GPIO as peripheral devices. And this SPEAr600 DT patch also supports those and even more devices.

So why don't we make an even bigger "cut", and remove the non-DT SPEAr600 files/data completely now? If you give me your ACK on this, I'll squash this into my patch as well, resulting in a nice diffstat. ;)

Quoted 10 lines
Quoted 10 lines
arch/arm/mach-spear6xx/spear600_evb.c +0 -3
-       /* call spear600 machine init function */
-       spear600_init();
-
 
        /* Add Platform Devices */
        platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
arch/arm/mach-spear6xx/spear6xx.c +0 -0
Quoted 12 lines

arch/arm/mach-spear6xx/spear6xx.c static void __init spear6xx_timer_init(void) · line 231

Quoted 10 lines
arch/arm/mach-spear6xx/spear6xx.c +10 -0
+static const struct of_device_id vic_of_match[] __initconst = {
+       { .compatible = "arm,pl190-vic", .data = vic_of_init, },
+       { /* Sentinel */ }
+};
+
+static void __init spear6xx_dt_init_irq(void)
+{
+       of_irq_init(vic_of_match);
+}
+

Did you checked this out?

Not yet. Sorry, I missed it. Will check now...

Thanks,
Stefan

#9 lore raw

PATCH v2 1/1 ARM: SPEAr600: Add device-tree support to SPEAr600 boards

Quoted 3 lines · Stefan Roese

So why don't we make an even bigger "cut", and remove the non-DT SPEAr600 files/data completely now? If you give me your ACK on this, I'll squash this into my patch as well, resulting in a nice diffstat.

My ack is already with you :)
Just go ahead, float the new version and i will ack it.

Signature · 1 line
viresh