Skip to contentSkip to conversation

powerpc: Add support for the MPC852 based mgsuvd board from keymile.

PATCH Applied Vitaly Bordug 5 participants 9 messages Jun 12, 2008 – Aug 29, 2008

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

PATCH 1/1 powerpc: Add support for the MPC852 based mgsuvd board from keymile.

From: Heiko Schocher <[email protected]>

Supported SMC1 (serial console), SCC3 Ethernet (10Mbps hdx).

Updated version was posted to ML; http://patchwork.ozlabs.org/linuxppc/patch?id=17398

---

 arch/powerpc/boot/dts/mgsuvd.dts      |  158 ++++++
 arch/powerpc/configs/mgsuvd_defconfig |  872 +++++++++++++++++++++++++++++++++
 arch/powerpc/platforms/8xx/Kconfig    |    7 
 arch/powerpc/platforms/8xx/Makefile   |    1 
 arch/powerpc/platforms/8xx/mgsuvd.c   |   95 ++++
 5 files changed, 1133 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/mgsuvd.dts
 create mode 100644 arch/powerpc/configs/mgsuvd_defconfig
 create mode 100644 arch/powerpc/platforms/8xx/mgsuvd.c
arch/powerpc/boot/dts/mgsuvd.dts new file +158 -0
new file mode 100644
index 0000000..59f9239
@@ -0,0 +1,158 @@
+/*
+ * MGSUVD Device Tree Source
+ *
+ * Copyright 2008 DENX Software Engineering GmbH
+ * Heiko Schocher <[email protected]>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/dts-v1/;
+/ {
+	model = "MGSUVD";
+	compatible = "keymile,mgsuvd";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		PowerPC,852@0 {
+			device_type = "cpu";
+			reg = <0>;
+			d-cache-line-size = <16>;
+			i-cache-line-size = <16>;
+			d-cache-size = <8192>;
+			i-cache-size = <8192>;
+			timebase-frequency = <0>;	/* Filled in by u-boot */
+			bus-frequency = <0>;		/* Filled in by u-boot */
+			clock-frequency = <0>;		/* Filled in by u-boot */
+			interrupts = <0x0f 2>;		/* decrementer interrupt */
+			interrupt-parent = <&PIC>;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <00000000 0x4000000>;  /* Filled in by u-boot */
+	};
+
+	localbus@fff00100 {
+		compatible = "fsl,pq1-localbus";
+		#address-cells = <2>;
+		#size-cells = <1>;
+		reg = <0xfff00100 0x40>;
+
+		ranges = <
+			0 0 0xf0000000 0x01000000
+		>;  /* Filled in by u-boot */
+
+		flash@0,0 {
+			compatible = "cfi-flash";
+			reg = <0 0 0x1000000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			bank-width = <1>;
+			device-width = <1>;
+			partition@0 {
+				label = "u-boot";
+				reg = <0 0x80000>;
+			};
+			partition@80000 {
+				label = "env";
+				reg = <0x80000 0x20000>;
+			};
+			partition@a0000 {
+				label = "user";
+				reg = <0xa0000 0xf60000>;
+			};
+		};
+	};
+
+	soc@fff00000 {
+		compatible = "fsl,mpc885", "fsl,pq1-soc";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		device_type = "soc";
+		ranges = <0 0xfff00000 0x00004000>;
+
+		PIC: interrupt-controller@0 {
+			interrupt-controller;
+			#interrupt-cells = <2>;
+			reg = <0 24>;
+			compatible = "fsl,pq1-pic";
+		};
+
+		cpm@9c0 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,cpm1";
+			command-proc = <0x9c0>;
+			interrupts = <0>;	/* cpm error interrupt */
+			interrupt-parent = <&CPM_PIC>;
+			reg = <0x9c0 10>;
+			ranges;
+
+			muram@2000 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0 0x2000 0x2000>;
+
+				data@0 {
+					compatible = "fsl,cpm-muram-data";
+					reg = <0x800 0x1800>;
+				};
+			};
+
+			brg@9f0 {
+				compatible = "fsl,mpc885-brg",
+				             "fsl,cpm1-brg",
+				             "fsl,cpm-brg";
+				reg = <0x9f0 0x10>;
+				clock-frequency = <0x3ef1480>;
+			};
+
+			CPM_PIC: interrupt-controller@930 {
+				interrupt-controller;
+				#interrupt-cells = <1>;
+				interrupts = <5 2 0 2 0x20 2>;
+				interrupt-parent = <&PIC>;
+				reg = <0x930 0x20>;
+				compatible = "fsl,cpm1-pic";
+			};
+
+			/* MON-1 */
+			serial@a80 {
+				device_type = "serial";
+				compatible = "cpm_uart",
+				             "fsl,cpm1-smc-uart";
+				model = "SMC";
+				device-id = <1>;
+				reg = <0xa80 0x10 0x3fc0 0x40>;
+				interrupts = <4>;
+				interrupt-parent = <&CPM_PIC>;
+				fsl,cpm-brg = <1>;
+				fsl,cpm-command = <0x0090>;
+				current-speed = <0>; /* Filled in by u-boot */
+			};
+
+			ethernet@a40 {
+				device_type = "network";
+				compatible = "fs_enet",
+				             "fsl,cpm1-scc-enet";
+				model = "SCC";
+				device-id = <3>;
+				reg = <0xa40 0x18 0x3e00 0xb0>;
+				mac-address = [ 00 00 00 00 00 00 ];  /* Filled in by u-boot */
+				interrupts = <0x1c>;
+				interrupt-parent = <&CPM_PIC>;
+				fsl,cpm-command = <0x80>;
+				fixed-link = <0 0 0x0a 0 0>;
+			};
+		};
+	};
+};
arch/powerpc/configs/mgsuvd_defconfig new file +872 -0

872 lines not on this page · raw message

arch/powerpc/platforms/8xx/Kconfig +7 -0
index 6fc849e..6fdd840 100644
@@ -49,6 +49,13 @@ config PPC_ADDER875
 	  This enables support for the Analogue & Micro Adder 875
 	  board.
 
+config PPC_MGSUVD
+	bool "MGSUVD"
+	select CPM1
+	select PPC_CPM_NEW_BINDING
+	help
+	  This enables support for the Keymile MGSUVD board.
+
 endchoice
 
 menu "Freescale Ethernet driver platform-specific options"
arch/powerpc/platforms/8xx/Makefile +1 -0
index 7b71d9c..bdbfd74 100644
@@ -6,3 +6,4 @@ obj-$(CONFIG_MPC885ADS)   += mpc885ads_setup.o
 obj-$(CONFIG_MPC86XADS)   += mpc86xads_setup.o
 obj-$(CONFIG_PPC_EP88XC)  += ep88xc.o
 obj-$(CONFIG_PPC_ADDER875) += adder875.o
+obj-$(CONFIG_PPC_MGSUVD) += mgsuvd.o
arch/powerpc/platforms/8xx/mgsuvd.c new file +95 -0

95 lines not on this page · raw message

#1 lore raw

arch/powerpc/boot/dts/mgsuvd.dts line 34

Quoted 1 line · Vitaly Bordug
arch/powerpc/boot/dts/mgsuvd.dts new file +1 -0
+			interrupts = <0x0f 2>;		/* decrementer interrupt */

Interrupts should probably be decimal.

arch/powerpc/boot/dts/mgsuvd.dts line 93

Quoted 1 line
arch/powerpc/boot/dts/mgsuvd.dts new file +1 -0
+			compatible = "fsl,cpm1";

compatible = "fsl,mpc852-cpm", "fsl,cpm1".

arch/powerpc/boot/dts/mgsuvd.dts line 94

Quoted 1 line
arch/powerpc/boot/dts/mgsuvd.dts new file +1 -0
+			command-proc = <0x9c0>;

This is obsolete; there should be no remaining code that refers to it.

arch/powerpc/boot/dts/mgsuvd.dts line 109

Quoted 10 lines
arch/powerpc/boot/dts/mgsuvd.dts new file +10 -0
+			muram@2000 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0 0x2000 0x2000>;
+
+				data@0 {
+					compatible = "fsl,cpm-muram-data";
+					reg = <0x800 0x1800>;
+				};
+			};

The muram node itself should also have a compatible (fsl,cpm-muram).

arch/powerpc/boot/dts/mgsuvd.dts line 116

Quoted 1 line
arch/powerpc/boot/dts/mgsuvd.dts new file +1 -0
+				clock-frequency = <0x3ef1480>;

clock-frequency should be decimal (or better, filled in by u-boot).

arch/powerpc/boot/dts/mgsuvd.dts line 125

Quoted 7 lines
arch/powerpc/boot/dts/mgsuvd.dts new file +7 -0
+			CPM_PIC: interrupt-controller@930 {
+				interrupt-controller;
+				#interrupt-cells = <1>;
+				interrupts = <5 2 0 2 0x20 2>;
+				interrupt-parent = <&PIC>;
+				reg = <0x930 0x20>;
+				compatible = "fsl,cpm1-pic";

"fsl,mpc852-cpm-pic", "fsl,cpm1-pic".
Likewise elsewhere.

Quoted 11 lines
arch/powerpc/boot/dts/mgsuvd.dts new file +11 -0
+			/* MON-1 */
+			serial@a80 {
+				device_type = "serial";
+				compatible = "cpm_uart",
+				             "fsl,cpm1-smc-uart";
+				model = "SMC";
+				device-id = <1>;
+				reg = <0xa80 0x10 0x3fc0 0x40>;
+				interrupts = <4>;
+				interrupt-parent = <&CPM_PIC>;
+				fsl,cpm-brg = <1>;

arch/powerpc/boot/dts/mgsuvd.dts line 148

Quoted 10 lines
arch/powerpc/boot/dts/mgsuvd.dts new file +10 -0
+				fsl,cpm-command = <0x0090>;
+				current-speed = <0>; /* Filled in by u-boot */
+			};
+
+			ethernet@a40 {
+				device_type = "network";
+				compatible = "fs_enet",
+				             "fsl,cpm1-scc-enet";
+				model = "SCC";
+				device-id = <3>;

The "cpm_uart" and "fs_enet" compatible values, as well as the device-id property and this usage of the model property, are obsolete and there should be no code remaining that references it.

arch/powerpc/boot/dts/mgsuvd.dts line 150

Quoted 2 lines
arch/powerpc/boot/dts/mgsuvd.dts new file +2 -0
+				reg = <0xa40 0x18 0x3e00 0xb0>;
+				mac-address = [ 00 00 00 00 00 00 ];  /* Filled in by u-boot */

Should be local-mac-address.

arch/powerpc/boot/dts/mgsuvd.dts line 154

Quoted 1 line
arch/powerpc/boot/dts/mgsuvd.dts new file +1 -0
+				fixed-link = <0 0 0x0a 0 0>;

We should move the documentation for this out of the gianfar-specific section of booting-without-of.txt. Speed should be decimal.

arch/powerpc/platforms/8xx/Kconfig config PPC_ADDER875 · line 55

Quoted 4 lines
arch/powerpc/platforms/8xx/Kconfig +4 -0
+config PPC_MGSUVD
+	bool "MGSUVD"
+	select CPM1
+	select PPC_CPM_NEW_BINDING

No need to explicitly select PPC_CPM_NEW_BINDING any more.

arch/powerpc/platforms/8xx/mgsuvd.c line 29

Quoted 3 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +3 -0
+struct cpm_pin {
+		int port, pin, flags;
+};

Only one tab, please.

arch/powerpc/platforms/8xx/mgsuvd.c line 70

Quoted 6 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +6 -0
+static __initdata struct of_device_id of_bus_ids[] = {
+	{ .name = "soc", },
+	{ .name = "cpm", },
+	{ .name = "localbus", },
+	{},
+};

Replace these with { .compatible = "simple-bus" }, and add simple-bus to the dts where appropriate.

arch/powerpc/platforms/8xx/mgsuvd.c line 83

Quoted 12 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +12 -0
+static int __init declare_of_platform_devices(void)
+{
+	of_platform_bus_probe (NULL, of_bus_ids, NULL);
+	return 0;
+}
+machine_device_initcall(mgsuvd, declare_of_platform_devices);
+
+static int __init mgsuvd_probe(void)
+{
+	unsigned long root = of_get_flat_dt_root ();
+	return of_flat_dt_is_compatible (root, "keymile,mgsuvd");
+}

No space between a function name and the arguments -- this isn't u-boot. :-)

arch/powerpc/platforms/8xx/mgsuvd.c line 95

Quoted 11 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +11 -0
+define_machine(mgsuvd) {
+	.name			= "MGSUVD",
+	.probe			= mgsuvd_probe,
+	.setup_arch		= mgsuvd_setup_arch,
+	.init_IRQ		= mpc8xx_pics_init,
+	.get_irq		= mpc8xx_get_irq,
+	.restart		= mpc8xx_restart,
+	.calibrate_decr		= mpc8xx_calibrate_decr,
+	.set_rtc_time		= mpc8xx_set_rtc_time,
+	.get_rtc_time		= mpc8xx_get_rtc_time,
+};

This tab-alignment will look like hell if viewed with another tab size...

-Scott

#2 lore raw

Hello Scott,

here comes the updated version for the mgsuvd port with your suggested changes:

[powerpc] add support for the MPC852 based mgsuvd board from
keymile to arch/powerpc. Supported SMC1 (serial console), SCC3 Ethernet (10Mbps hdx).

---
 arch/powerpc/boot/dts/mgsuvd.dts      |  163 ++++++
 arch/powerpc/configs/mgsuvd_defconfig |  872 +++++++++++++++++++++++++++++++++
 arch/powerpc/platforms/8xx/Kconfig    |    6 +
 arch/powerpc/platforms/8xx/Makefile   |    1 +
 arch/powerpc/platforms/8xx/mgsuvd.c   |   93 ++++
 5 files changed, 1135 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/mgsuvd.dts
 create mode 100644 arch/powerpc/configs/mgsuvd_defconfig
 create mode 100644 arch/powerpc/platforms/8xx/mgsuvd.c
arch/powerpc/boot/dts/mgsuvd.dts new file +163 -0
new file mode 100644
index 0000000..4b05346
@@ -0,0 +1,163 @@
+/*
+ * MGSUVD Device Tree Source
+ *
+ * Copyright 2008 DENX Software Engineering GmbH
+ * Heiko Schocher <[email protected]>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/dts-v1/;
+/ {
+	model = "MGSUVD";
+	compatible = "keymile,mgsuvd";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		PowerPC,852@0 {
+			device_type = "cpu";
+			reg = <0>;
+			d-cache-line-size = <16>;
+			i-cache-line-size = <16>;
+			d-cache-size = <8192>;
+			i-cache-size = <8192>;
+			timebase-frequency = <0>;	/* Filled in by u-boot */
+			bus-frequency = <0>;		/* Filled in by u-boot */
+			clock-frequency = <0>;		/* Filled in by u-boot */
+			interrupts = <15 2>;		/* decrementer interrupt */
+			interrupt-parent = <&PIC>;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <00000000 0x4000000>;  /* Filled in by u-boot */
+	};
+
+	localbus@fff00100 {
+		compatible = "fsl,pq1-localbus";
+		#address-cells = <2>;
+		#size-cells = <1>;
+		reg = <0xfff00100 0x40>;
+
+		ranges = <0 0 0xf0000000 0x01000000>;  /* Filled in by u-boot */
+
+		flash@0,0 {
+			compatible = "cfi-flash";
+			reg = <0 0 0x1000000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			bank-width = <1>;
+			device-width = <1>;
+			partition@0 {
+				label = "u-boot";
+				reg = <0 0x80000>;
+			};
+			partition@80000 {
+				label = "env";
+				reg = <0x80000 0x20000>;
+			};
+			partition@a0000 {
+				label = "kernel";
+				reg = <0xa0000 0x1e0000>;
+			};
+			partition@280000 {
+				label = "dtb";
+				reg = <0x280000 0x20000>;
+			};
+			partition@2a0000 {
+			        label = "root";
+			        reg = <0x2a0000 0x500000>;
+			};
+			partition@7a0000 {
+			        label = "user";
+			        reg = <0x7a0000 0x860000>;
+			};
+		};
+	};
+
+	soc@fff00000 {
+		compatible = "fsl,mpc852", "simple-bus", "fsl,pq1-soc";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		device_type = "soc";
+		ranges = <0 0xfff00000 0x00004000>;
+
+		PIC: interrupt-controller@0 {
+			interrupt-controller;
+			#interrupt-cells = <2>;
+			reg = <0 24>;
+			compatible = "fsl,pq1-pic";
+		};
+
+		cpm@9c0 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,mpc852-cpm", "simple-bus", "fsl,cpm1";
+			interrupts = <0>;	/* cpm error interrupt */
+			interrupt-parent = <&CPM_PIC>;
+			reg = <0x9c0 10>;
+			ranges;
+
+			muram@2000 {
+				compatible = "fsl,cpm-muram";
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0 0x2000 0x2000>;
+
+				data@0 {
+					compatible = "fsl,cpm-muram-data";
+					reg = <0x800 0x1800>;
+				};
+			};
+
+			brg@9f0 {
+				compatible = "fsl,mpc852-brg",
+				             "fsl,cpm1-brg",
+				             "fsl,cpm-brg";
+				reg = <0x9f0 0x10>;
+				clock-frequency = <0>; /* Filled in by u-boot */
+			};
+
+			CPM_PIC: interrupt-controller@930 {
+				interrupt-controller;
+				#interrupt-cells = <1>;
+				interrupts = <5 2 0 2>;
+				interrupt-parent = <&PIC>;
+				reg = <0x930 0x20>;
+				compatible = "fsl,cpm1-pic";
+			};
+
+			/* MON-1 */
+			serial@a80 {
+				device_type = "serial";
+				compatible = "fsl,cpm1-smc-uart";
+				reg = <0xa80 0x10 0x3fc0 0x40>;
+				interrupts = <4>;
+				interrupt-parent = <&CPM_PIC>;
+				fsl,cpm-brg = <1>;
+				fsl,cpm-command = <0x0090>;
+				current-speed = <0>; /* Filled in by u-boot */
+			};
+
+			ethernet@a40 {
+				device_type = "network";
+				compatible  = "fsl,mpc866-scc-enet",
+				              "fsl,cpm1-scc-enet";
+				reg = <0xa40 0x18 0x3e00 0x100>;
+				local-mac-address = [ 00 00 00 00 00 00 ];  /* Filled in by u-boot */
+				interrupts = <28>;
+				interrupt-parent = <&CPM_PIC>;
+				fsl,cpm-command = <0x80>;
+				fixed-link = <0 0 10 0 0>;
+			};
+		};
+	};
+};
arch/powerpc/configs/mgsuvd_defconfig new file +872 -0

872 lines not on this page · raw message

arch/powerpc/platforms/8xx/Kconfig +6 -0
index 6fc849e..a8f2436 100644
@@ -49,6 +49,12 @@ config PPC_ADDER875
 	  This enables support for the Analogue & Micro Adder 875
 	  board.
 
+config PPC_MGSUVD
+	bool "MGSUVD"
+	select CPM1
+	help
+	  This enables support for the Keymile MGSUVD board.
+
 endchoice
 
 menu "Freescale Ethernet driver platform-specific options"
arch/powerpc/platforms/8xx/Makefile +1 -0
index 7b71d9c..bdbfd74 100644
@@ -6,3 +6,4 @@ obj-$(CONFIG_MPC885ADS)   += mpc885ads_setup.o
 obj-$(CONFIG_MPC86XADS)   += mpc86xads_setup.o
 obj-$(CONFIG_PPC_EP88XC)  += ep88xc.o
 obj-$(CONFIG_PPC_ADDER875) += adder875.o
+obj-$(CONFIG_PPC_MGSUVD) += mgsuvd.o
arch/powerpc/platforms/8xx/mgsuvd.c new file +93 -0

93 lines not on this page · raw message

Signature · 5 lines
1.5.4.2

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#3 lore raw

arch/powerpc/boot/dts/mgsuvd.dts line 45

Quoted 2 lines · Heiko Schocher
arch/powerpc/boot/dts/mgsuvd.dts new file +2 -0
+	localbus@fff00100 {
+		compatible = "fsl,pq1-localbus";

"fsl,mpc852-localbus", "fsl,pq1-localbus", "simple-bus";

arch/powerpc/boot/dts/mgsuvd.dts line 87

Quoted 2 lines
arch/powerpc/boot/dts/mgsuvd.dts new file +2 -0
+	soc@fff00000 {
+		compatible = "fsl,mpc852", "simple-bus", "fsl,pq1-soc";

simple-bus should come last, since it's the most generic.

arch/powerpc/boot/dts/mgsuvd.dts line 97

Quoted 10 lines
arch/powerpc/boot/dts/mgsuvd.dts new file +10 -0
+		#address-cells = <1>;
+		#size-cells = <1>;
+		device_type = "soc";
+		ranges = <0 0xfff00000 0x00004000>;
+
+		PIC: interrupt-controller@0 {
+			interrupt-controller;
+			#interrupt-cells = <2>;
+			reg = <0 24>;
+			compatible = "fsl,pq1-pic";

"fsl,mpc852-pic", "fsl,pq1-pic";

In general, a chip-specific name should be listed first, so the driver can easily apply workarounds if needed. See the existing 8xx device trees for examples.

-Scott

#4 lore raw

Hello Scott,

here the next try for the mgsuvd board:

[powerpc] add support for the MPC852 based mgsuvd board from
keymile to arch/powerpc. Supported SMC1 (serial console), SCC3 Ethernet (10Mbps hdx).

---
 arch/powerpc/boot/dts/mgsuvd.dts      |  163 ++++++
 arch/powerpc/configs/mgsuvd_defconfig |  872 +++++++++++++++++++++++++++++++++
 arch/powerpc/platforms/8xx/Kconfig    |    6 +
 arch/powerpc/platforms/8xx/Makefile   |    1 +
 arch/powerpc/platforms/8xx/mgsuvd.c   |   93 ++++
 5 files changed, 1135 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/mgsuvd.dts
 create mode 100644 arch/powerpc/configs/mgsuvd_defconfig
 create mode 100644 arch/powerpc/platforms/8xx/mgsuvd.c
arch/powerpc/boot/dts/mgsuvd.dts new file +163 -0
new file mode 100644
index 0000000..f78d5de
@@ -0,0 +1,163 @@
+/*
+ * MGSUVD Device Tree Source
+ *
+ * Copyright 2008 DENX Software Engineering GmbH
+ * Heiko Schocher <[email protected]>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/dts-v1/;
+/ {
+	model = "MGSUVD";
+	compatible = "keymile,mgsuvd";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		PowerPC,852@0 {
+			device_type = "cpu";
+			reg = <0>;
+			d-cache-line-size = <16>;
+			i-cache-line-size = <16>;
+			d-cache-size = <8192>;
+			i-cache-size = <8192>;
+			timebase-frequency = <0>;	/* Filled in by u-boot */
+			bus-frequency = <0>;		/* Filled in by u-boot */
+			clock-frequency = <0>;		/* Filled in by u-boot */
+			interrupts = <15 2>;		/* decrementer interrupt */
+			interrupt-parent = <&PIC>;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <00000000 0x4000000>;  /* Filled in by u-boot */
+	};
+
+	localbus@fff00100 {
+		compatible = "fsl,mpc852-localbus", "fsl,pq1-localbus", "simple-bus";
+		#address-cells = <2>;
+		#size-cells = <1>;
+		reg = <0xfff00100 0x40>;
+
+		ranges = <0 0 0xf0000000 0x01000000>;  /* Filled in by u-boot */
+
+		flash@0,0 {
+			compatible = "cfi-flash";
+			reg = <0 0 0x1000000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			bank-width = <1>;
+			device-width = <1>;
+			partition@0 {
+				label = "u-boot";
+				reg = <0 0x80000>;
+			};
+			partition@80000 {
+				label = "env";
+				reg = <0x80000 0x20000>;
+			};
+			partition@a0000 {
+				label = "kernel";
+				reg = <0xa0000 0x1e0000>;
+			};
+			partition@280000 {
+				label = "dtb";
+				reg = <0x280000 0x20000>;
+			};
+			partition@2a0000 {
+			        label = "root";
+			        reg = <0x2a0000 0x500000>;
+			};
+			partition@7a0000 {
+			        label = "user";
+			        reg = <0x7a0000 0x860000>;
+			};
+		};
+	};
+
+	soc@fff00000 {
+		compatible = "fsl,mpc852", "fsl,pq1-soc", "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		device_type = "soc";
+		ranges = <0 0xfff00000 0x00004000>;
+
+		PIC: interrupt-controller@0 {
+			interrupt-controller;
+			#interrupt-cells = <2>;
+			reg = <0 24>;
+			compatible = "fsl,mpc852-pic", "fsl,pq1-pic";
+		};
+
+		cpm@9c0 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,mpc852-cpm", "fsl,cpm1", "simple-bus";
+			interrupts = <0>;	/* cpm error interrupt */
+			interrupt-parent = <&CPM_PIC>;
+			reg = <0x9c0 10>;
+			ranges;
+
+			muram@2000 {
+				compatible = "fsl,cpm-muram";
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0 0x2000 0x2000>;
+
+				data@0 {
+					compatible = "fsl,cpm-muram-data";
+					reg = <0x800 0x1800>;
+				};
+			};
+
+			brg@9f0 {
+				compatible = "fsl,mpc852-brg",
+				             "fsl,cpm1-brg",
+				             "fsl,cpm-brg";
+				reg = <0x9f0 0x10>;
+				clock-frequency = <0>; /* Filled in by u-boot */
+			};
+
+			CPM_PIC: interrupt-controller@930 {
+				interrupt-controller;
+				#interrupt-cells = <1>;
+				interrupts = <5 2 0 2>;
+				interrupt-parent = <&PIC>;
+				reg = <0x930 0x20>;
+				compatible = "fsl,cpm1-pic";
+			};
+
+			/* MON-1 */
+			serial@a80 {
+				device_type = "serial";
+				compatible = "fsl,cpm1-smc-uart";
+				reg = <0xa80 0x10 0x3fc0 0x40>;
+				interrupts = <4>;
+				interrupt-parent = <&CPM_PIC>;
+				fsl,cpm-brg = <1>;
+				fsl,cpm-command = <0x0090>;
+				current-speed = <0>; /* Filled in by u-boot */
+			};
+
+			ethernet@a40 {
+				device_type = "network";
+				compatible  = "fsl,mpc866-scc-enet",
+				              "fsl,cpm1-scc-enet";
+				reg = <0xa40 0x18 0x3e00 0x100>;
+				local-mac-address = [ 00 00 00 00 00 00 ];  /* Filled in by u-boot */
+				interrupts = <28>;
+				interrupt-parent = <&CPM_PIC>;
+				fsl,cpm-command = <0x80>;
+				fixed-link = <0 0 10 0 0>;
+			};
+		};
+	};
+};
arch/powerpc/configs/mgsuvd_defconfig new file +872 -0

872 lines not on this page · raw message

arch/powerpc/platforms/8xx/Kconfig +6 -0
index 6fc849e..a8f2436 100644
@@ -49,6 +49,12 @@ config PPC_ADDER875
 	  This enables support for the Analogue & Micro Adder 875
 	  board.
 
+config PPC_MGSUVD
+	bool "MGSUVD"
+	select CPM1
+	help
+	  This enables support for the Keymile MGSUVD board.
+
 endchoice
 
 menu "Freescale Ethernet driver platform-specific options"
arch/powerpc/platforms/8xx/Makefile +1 -0
index 7b71d9c..bdbfd74 100644
@@ -6,3 +6,4 @@ obj-$(CONFIG_MPC885ADS)   += mpc885ads_setup.o
 obj-$(CONFIG_MPC86XADS)   += mpc86xads_setup.o
 obj-$(CONFIG_PPC_EP88XC)  += ep88xc.o
 obj-$(CONFIG_PPC_ADDER875) += adder875.o
+obj-$(CONFIG_PPC_MGSUVD) += mgsuvd.o
arch/powerpc/platforms/8xx/mgsuvd.c new file +93 -0

93 lines not on this page · raw message

Signature · 5 lines
1.5.4.2

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#5 lore raw

Hi Heiko,

arch/powerpc/platforms/8xx/mgsuvd.c line 1

Quoted 4 lines · On Fri, 13 Jun 2008 21:56:00 +0200 Heiko Schocher <[email protected]> wrote:

+++ b/arch/powerpc/platforms/8xx/mgsuvd.c

arch/powerpc/platforms/8xx/mgsuvd.c new file +1 -0
@@ -0,0 +1,93 @@
+/* arch/powerpc/platforms/8xx/mgsuvd.c

We have stopped putting file names in files.

arch/powerpc/platforms/8xx/mgsuvd.c line 23

Quoted 10 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +10 -0
+#include <linux/ioport.h>
+#include <linux/device.h>
+#include <linux/of_platform.h>
+
+#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/processor.h>
+#include <asm/system.h>
+#include <asm/cpm1.h>
+#include <asm/fs_pd.h>

I am petty sure you don't need to include linux/device.h, but you should include asm/prom.h for the flat device tree accessors.

Also, we don't put a space between a function name and the opening parenthesis.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#6 lore raw

Hello Stephen,

Quoted 21 lines · Stephen Rothwell

Review line 1

Quoted 3 lines · On Fri, 13 Jun 2008 21:56:00 +0200 Heiko Schocher <[email protected]> wrote:

+++ b/arch/powerpc/platforms/8xx/mgsuvd.c

(quoted diff) +1 -0
@@ -0,0 +1,93 @@
+/* arch/powerpc/platforms/8xx/mgsuvd.c

We have stopped putting file names in files.

Review line 11

Quoted 10 lines
(quoted diff) +10 -0
+#include <linux/ioport.h>
+#include <linux/device.h>
+#include <linux/of_platform.h>
+
+#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/processor.h>
+#include <asm/system.h>
+#include <asm/cpm1.h>
+#include <asm/fs_pd.h>

I am petty sure you don't need to include linux/device.h, but you should include asm/prom.h for the flat device tree accessors.

Quoted 2 lines

Also, we don't put a space between a function name and the opening parenthesis.

Argh, you are right!

here the updated patch for the mgsuvd board.

[powerpc] add support for the MPC852 based mgsuvd board from
keymile to arch/powerpc. Supported SMC1 (serial console), SCC3 Ethernet (10Mbps hdx).

---
 arch/powerpc/boot/dts/mgsuvd.dts      |  163 ++++++
 arch/powerpc/configs/mgsuvd_defconfig |  872 +++++++++++++++++++++++++++++++++
 arch/powerpc/platforms/8xx/Kconfig    |    6 +
 arch/powerpc/platforms/8xx/Makefile   |    1 +
 arch/powerpc/platforms/8xx/mgsuvd.c   |   92 ++++
 5 files changed, 1134 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/mgsuvd.dts
 create mode 100644 arch/powerpc/configs/mgsuvd_defconfig
 create mode 100644 arch/powerpc/platforms/8xx/mgsuvd.c
arch/powerpc/boot/dts/mgsuvd.dts new file +163 -0
new file mode 100644
index 0000000..f78d5de
@@ -0,0 +1,163 @@
+/*
+ * MGSUVD Device Tree Source
+ *
+ * Copyright 2008 DENX Software Engineering GmbH
+ * Heiko Schocher <[email protected]>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/dts-v1/;
+/ {
+	model = "MGSUVD";
+	compatible = "keymile,mgsuvd";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		PowerPC,852@0 {
+			device_type = "cpu";
+			reg = <0>;
+			d-cache-line-size = <16>;
+			i-cache-line-size = <16>;
+			d-cache-size = <8192>;
+			i-cache-size = <8192>;
+			timebase-frequency = <0>;	/* Filled in by u-boot */
+			bus-frequency = <0>;		/* Filled in by u-boot */
+			clock-frequency = <0>;		/* Filled in by u-boot */
+			interrupts = <15 2>;		/* decrementer interrupt */
+			interrupt-parent = <&PIC>;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <00000000 0x4000000>;  /* Filled in by u-boot */
+	};
+
+	localbus@fff00100 {
+		compatible = "fsl,mpc852-localbus", "fsl,pq1-localbus", "simple-bus";
+		#address-cells = <2>;
+		#size-cells = <1>;
+		reg = <0xfff00100 0x40>;
+
+		ranges = <0 0 0xf0000000 0x01000000>;  /* Filled in by u-boot */
+
+		flash@0,0 {
+			compatible = "cfi-flash";
+			reg = <0 0 0x1000000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			bank-width = <1>;
+			device-width = <1>;
+			partition@0 {
+				label = "u-boot";
+				reg = <0 0x80000>;
+			};
+			partition@80000 {
+				label = "env";
+				reg = <0x80000 0x20000>;
+			};
+			partition@a0000 {
+				label = "kernel";
+				reg = <0xa0000 0x1e0000>;
+			};
+			partition@280000 {
+				label = "dtb";
+				reg = <0x280000 0x20000>;
+			};
+			partition@2a0000 {
+			        label = "root";
+			        reg = <0x2a0000 0x500000>;
+			};
+			partition@7a0000 {
+			        label = "user";
+			        reg = <0x7a0000 0x860000>;
+			};
+		};
+	};
+
+	soc@fff00000 {
+		compatible = "fsl,mpc852", "fsl,pq1-soc", "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		device_type = "soc";
+		ranges = <0 0xfff00000 0x00004000>;
+
+		PIC: interrupt-controller@0 {
+			interrupt-controller;
+			#interrupt-cells = <2>;
+			reg = <0 24>;
+			compatible = "fsl,mpc852-pic", "fsl,pq1-pic";
+		};
+
+		cpm@9c0 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,mpc852-cpm", "fsl,cpm1", "simple-bus";
+			interrupts = <0>;	/* cpm error interrupt */
+			interrupt-parent = <&CPM_PIC>;
+			reg = <0x9c0 10>;
+			ranges;
+
+			muram@2000 {
+				compatible = "fsl,cpm-muram";
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0 0x2000 0x2000>;
+
+				data@0 {
+					compatible = "fsl,cpm-muram-data";
+					reg = <0x800 0x1800>;
+				};
+			};
+
+			brg@9f0 {
+				compatible = "fsl,mpc852-brg",
+				             "fsl,cpm1-brg",
+				             "fsl,cpm-brg";
+				reg = <0x9f0 0x10>;
+				clock-frequency = <0>; /* Filled in by u-boot */
+			};
+
+			CPM_PIC: interrupt-controller@930 {
+				interrupt-controller;
+				#interrupt-cells = <1>;
+				interrupts = <5 2 0 2>;
+				interrupt-parent = <&PIC>;
+				reg = <0x930 0x20>;
+				compatible = "fsl,cpm1-pic";
+			};
+
+			/* MON-1 */
+			serial@a80 {
+				device_type = "serial";
+				compatible = "fsl,cpm1-smc-uart";
+				reg = <0xa80 0x10 0x3fc0 0x40>;
+				interrupts = <4>;
+				interrupt-parent = <&CPM_PIC>;
+				fsl,cpm-brg = <1>;
+				fsl,cpm-command = <0x0090>;
+				current-speed = <0>; /* Filled in by u-boot */
+			};
+
+			ethernet@a40 {
+				device_type = "network";
+				compatible  = "fsl,mpc866-scc-enet",
+				              "fsl,cpm1-scc-enet";
+				reg = <0xa40 0x18 0x3e00 0x100>;
+				local-mac-address = [ 00 00 00 00 00 00 ];  /* Filled in by u-boot */
+				interrupts = <28>;
+				interrupt-parent = <&CPM_PIC>;
+				fsl,cpm-command = <0x80>;
+				fixed-link = <0 0 10 0 0>;
+			};
+		};
+	};
+};
arch/powerpc/configs/mgsuvd_defconfig new file +872 -0

872 lines not on this page · raw message

arch/powerpc/platforms/8xx/Kconfig +6 -0
index 6fc849e..a8f2436 100644
@@ -49,6 +49,12 @@ config PPC_ADDER875
 	  This enables support for the Analogue & Micro Adder 875
 	  board.
 
+config PPC_MGSUVD
+	bool "MGSUVD"
+	select CPM1
+	help
+	  This enables support for the Keymile MGSUVD board.
+
 endchoice
 
 menu "Freescale Ethernet driver platform-specific options"
arch/powerpc/platforms/8xx/Makefile +1 -0
index 7b71d9c..bdbfd74 100644
@@ -6,3 +6,4 @@ obj-$(CONFIG_MPC885ADS)   += mpc885ads_setup.o
 obj-$(CONFIG_MPC86XADS)   += mpc86xads_setup.o
 obj-$(CONFIG_PPC_EP88XC)  += ep88xc.o
 obj-$(CONFIG_PPC_ADDER875) += adder875.o
+obj-$(CONFIG_PPC_MGSUVD) += mgsuvd.o
arch/powerpc/platforms/8xx/mgsuvd.c new file +92 -0

92 lines not on this page · raw message

Signature · 6 lines
1.5.4.2


-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Reviewed-by
#7 lore raw
Quoted 6 lines · On Sat, 14 Jun 2008 21:02:04 +0200 Heiko Schocher <[email protected]> wrote:

[powerpc] add support for the MPC852 based mgsuvd board from
keymile to arch/powerpc. Supported SMC1 (serial console), SCC3 Ethernet (10Mbps hdx).

Kconfig, Makefile, mgsuvd.c

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
Applied
#8 lore raw
In reply to Heiko Schocher
Quoted 15 lines · Heiko Schocher

here the updated patch for the mgsuvd board.

[powerpc] add support for the MPC852 based mgsuvd board from
keymile to arch/powerpc. Supported SMC1 (serial console), SCC3 Ethernet (10Mbps hdx).

---

arch/powerpc/boot/dts/mgsuvd.dts      |  163 ++++++
arch/powerpc/configs/mgsuvd_defconfig |  872 ++++++++++++++++++++++++ 
+++++++++
arch/powerpc/platforms/8xx/Kconfig    |    6 +
arch/powerpc/platforms/8xx/Makefile   |    1 +
arch/powerpc/platforms/8xx/mgsuvd.c   |   92 ++++
5 files changed, 1134 insertions(+), 0 deletions(-)
Quoted 3 lines

create mode 100644 arch/powerpc/boot/dts/mgsuvd.dts create mode 100644 arch/powerpc/configs/mgsuvd_defconfig create mode 100644 arch/powerpc/platforms/8xx/mgsuvd.c

applied to powerpc-next.

- k