Skip to contentSkip to conversation

8xx: MGSUVD support

PATCH In review Heiko Schocher 4 participants 8 messages Mar 9, 2008 – Mar 18, 2008

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

PATCH 1/1 8xx: MGSUVD support

Hello,

the following patch adds support for the MPC852 based mgsuvd board from keymile.

---
 arch/powerpc/boot/dts/mgsuvd.dts      |  158 +++++++
 arch/powerpc/configs/mgsuvd_defconfig |  827 +++++++++++++++++++++++++++++++++
 arch/powerpc/platforms/8xx/Kconfig    |    7 +
 arch/powerpc/platforms/8xx/Makefile   |    1 +
 arch/powerpc/platforms/8xx/mgsuvd.c   |  138 ++++++
 5 files changed, 1131 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..629cb6d
@@ -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.
+ */
+
+
+/ {
+	model = "MGSUVD";
+	compatible = "keymile,mgsuvd";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		PowerPC,866@0 {
+			device_type = "cpu";
+			reg = <0>;
+			d-cache-line-size = <d#16>;
+			i-cache-line-size = <d#16>;
+			d-cache-size = <d#8192>;
+			i-cache-size = <d#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 = <f 2>;	// decrementer interrupt
+			interrupt-parent = <&PIC>;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <00000000 4000000>;  /* Filled in by u-boot */
+	};
+
+	localbus@fff00100 {
+		compatible = "fsl,pq1-localbus";
+		#address-cells = <2>;
+		#size-cells = <1>;
+		reg = <fff00100 40>;
+
+		ranges = <
+			0 0 f0000000 01000000
+		>;  /* Filled in by u-boot */
+
+		flash@0,0 {
+			compatible = "cfi-flash";
+			reg = <0 0 1000000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			bank-width = <1>;
+			device-width = <1>;
+			partition@0 {
+				label = "u-boot";
+				reg = <0 80000>;
+			};
+			partition@40000 {
+				label = "env";
+				reg = <80000 20000>;
+			};
+			partition@80000 {
+				label = "user";
+				reg = <a0000 f60000>;
+			};
+		};
+	};
+
+	soc@fff00000 {
+		compatible = "fsl,mpc885", "fsl,pq1-soc";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		device_type = "soc";
+		ranges = <0 fff00000 00004000>;
+
+		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 = <9c0>;
+			interrupts = <0>;	// cpm error interrupt
+			interrupt-parent = <&CPM_PIC>;
+			reg = <9c0 10>;
+			ranges;
+
+			muram@2000 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0 2000 2000>;
+
+				data@0 {
+					compatible = "fsl,cpm-muram-data";
+					reg = <800 1800>;
+				};
+			};
+
+			brg@9f0 {
+				compatible = "fsl,mpc885-brg",
+				             "fsl,cpm1-brg",
+				             "fsl,cpm-brg";
+				reg = <9f0 10>;
+				clock-frequency = <3ef1480>;
+			};
+
+			CPM_PIC: interrupt-controller@930 {
+				interrupt-controller;
+				#interrupt-cells = <1>;
+				interrupts = <5 2 0 2 20 2>;
+				interrupt-parent = <&PIC>;
+				reg = <930 20>;
+				compatible = "fsl,cpm1-pic";
+			};
+
+			// MON-1
+			serial@a80 {
+				device_type = "serial";
+				compatible = "cpm_uart",
+				             "fsl,cpm1-smc-uart";
+				model = "SMC";
+				device-id = <1>;
+				reg = <a80 10 3fc0 40>;
+				interrupts = <4>;
+				interrupt-parent = <&CPM_PIC>;
+				fsl,cpm-brg = <1>;
+				fsl,cpm-command = <0090>;
+				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 = <a40 18 3e00 b0>;
+				mac-address = [ 00 00 00 00 00 00 ];  /* Filled in by u-boot */
+				interrupts = <1c>;
+				interrupt-parent = <&CPM_PIC>;
+				fsl,cpm-command = <80>;
+				fixed-link = <0 0 a 0 0>;
+			};
+		};
+	};
+};
arch/powerpc/configs/mgsuvd_defconfig new file +827 -0

827 lines not on this page · raw message

arch/powerpc/platforms/8xx/Kconfig +7 -0
index 7fd224c..4d14b8a 100644
@@ -53,6 +53,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 +138 -0

138 lines not on this page · raw message

Signature · 8 lines
1.5.4.2


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

Heiko,

Quoted 4 lines · On Sun, 09 Mar 2008 10:56:29 +0100 Heiko Schocher wrote:

Hello,

the following patch adds support for the MPC852 based mgsuvd board from keymile.

Looks good overall. Please add supported/working/not working etc SoC devices state along with the patch description. Also a few really small comments below...

Quoted 37 lines
---
 arch/powerpc/boot/dts/mgsuvd.dts      |  158 +++++++
 arch/powerpc/configs/mgsuvd_defconfig |  827
+++++++++++++++++++++++++++++++++
arch/powerpc/platforms/8xx/Kconfig    |    7 +
arch/powerpc/platforms/8xx/Makefile   |    1 +
arch/powerpc/platforms/8xx/mgsuvd.c   |  138 ++++++ 5 files changed,

1131 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

(quoted diff) +0 -0

b/arch/powerpc/boot/dts/mgsuvd.dts new file mode 100644 index 0000000..629cb6d

arch/powerpc/boot/dts/mgsuvd.dts new file +7 -0
@@ -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.
+ */

arch/powerpc/boot/dts/mgsuvd.dts new file +3 -0
+
+
+/ {

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

Quoted 10 lines
arch/powerpc/boot/dts/mgsuvd.dts new file +10 -0
+	model = "MGSUVD";
+	compatible = "keymile,mgsuvd";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		PowerPC,866@0 {

But it's mpc852, isn't it?

Quoted 13 lines
arch/powerpc/boot/dts/mgsuvd.dts new file +7 -0
+			device_type = "cpu";
+			reg = <0>;
+			d-cache-line-size = <d#16>;
+			i-cache-line-size = <d#16>;
+			d-cache-size = <d#8192>;
+			i-cache-size = <d#8192>;
+			timebase-frequency = <0>;  /* Filled in by

u-boot */

arch/powerpc/boot/dts/mgsuvd.dts new file +1 -0
+			bus-frequency = <0>;  /* Filled in by u-boot

*/

arch/powerpc/boot/dts/mgsuvd.dts new file +1 -0
+			clock-frequency = <0>; /* Filled in by

u-boot */

arch/powerpc/boot/dts/mgsuvd.dts new file +1 -0
+			interrupts = <f 2>;	// decrementer
Quoted 1 line

interrupt

I would like all the comments to be consistent C style (because that's it for the most other dts'es).

[....]

Signature · 1 line
Sincerely, Vitaly
#5 lore raw
In reply to Heiko Schocher

Hi Heiko,

Just a few small comments.

Quoted 4 lines · On Sun, 09 Mar 2008 10:56:29 +0100 Heiko Schocher <[email protected]> wrote:

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

+#include <asm/of_platform.h>

You should include linux/of_platform.h (not asm/)

Quoted 1 line

+static struct cpm_pin mgsuvd_pins[] = {

Make this __initdata, please.

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

Quoted 1 line
arch/powerpc/platforms/8xx/mgsuvd.c new file +1 -0
+	ROOT_DEV = Root_NFS;

I am not sue we do this explicitly any more ... hopefully someone else will comment.

Quoted 1 line

+static struct of_device_id __initdata of_bus_ids[] = {

Make this __initdata, please.

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

Quoted 10 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +10 -0
+static int __init declare_of_platform_devices(void)
+{
+	if (!machine_is(mgsuvd))
+		return 0;
+
+	of_platform_bus_probe(NULL, of_bus_ids, NULL);
+
+	return 0;
+}
+device_initcall(declare_of_platform_devices);

This should be "machine_device_initcall(mgsuvd, declare_of_platform_devices);" then you don't need the machine_is() check above.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#2 lore raw
In reply to Vitaly Bordug

Hello Vitaly,

Quoted 5 lines · Vitaly Bordug
Quoted 2 lines · Heiko Schocher

the following patch adds support for the MPC852 based mgsuvd board from keymile.

Looks good overall. Please add supported/working/not working etc SoC devices state along with the patch description. Also a few really small comments below...

OK.

Quoted 2 lines
Quoted 2 lines

---

[...]

Quoted 3 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+		PowerPC,866@0 {

But it's mpc852, isn't it?

Yes your are right.

Quoted 7 lines
Quoted 7 lines
arch/powerpc/boot/dts/mgsuvd.dts new file +7 -0
+			device_type = "cpu";
+			reg = <0>;
+			d-cache-line-size = <d#16>;
+			i-cache-line-size = <d#16>;
+			d-cache-size = <d#8192>;
+			i-cache-size = <d#8192>;
+			timebase-frequency = <0>;  /* Filled in by
Quoted 8 lines
Quoted 7 lines

u-boot */

(quoted diff) +1 -0
+			bus-frequency = <0>;  /* Filled in by u-boot

*/

(quoted diff) +1 -0
+			clock-frequency = <0>; /* Filled in by

u-boot */

(quoted diff) +1 -0
+			interrupts = <f 2>;	// decrementer

interrupt

I would like all the comments to be consistent C style (because that's it for the most other dts'es).

Okay, I fix this, and send a new patch.

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#6 lore raw
In reply to Stephen Rothwell

Hello Stephen,

Quoted 6 lines · Stephen Rothwell
Quoted 3 lines · On Sun, 09 Mar 2008 10:56:29 +0100 Heiko Schocher <[email protected]> wrote:

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

+#include <asm/of_platform.h>

You should include linux/of_platform.h (not asm/)

Ok.

Quoted 3 lines
Quoted 1 line

+static struct cpm_pin mgsuvd_pins[] = {

Make this __initdata, please.

Argh... forgot this.

[...]

Quoted 3 lines
Quoted 1 line

+static struct of_device_id __initdata of_bus_ids[] = {

Make this __initdata, please.

Hmm.. it is __initdata, or? But I fix it to:

static __initdata struct of_device_id of_bus_ids[]

Quoted 6 lines
Quoted 6 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +6 -0
+static int __init declare_of_platform_devices(void)
+{
+	if (!machine_is(mgsuvd))
+		return 0;
+
+	of_platform_bus_probe(NULL, of_bus_ids, NULL);
Quoted 8 lines

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

Quoted 4 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +4 -0
+
+	return 0;
+}
+device_initcall(declare_of_platform_devices);

This should be "machine_device_initcall(mgsuvd, declare_of_platform_devices);" then you don't need the machine_is() check above.

Ok

I will send a overworked patch.

bye,
Heiko

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

Hi,

Quoted 6 lines · On Mon, 10 Mar 2008 07:34:46 +0100 Heiko Schocher <[email protected]> wrote:
Quoted 4 lines
Quoted 2 lines

+static struct of_device_id __initdata of_bus_ids[] = {

Make this __initdata, please.

Hmm.. it is __initdata, or? But I fix it to:

OOPS, brain not working again after break :-)

sorry.

Quoted 1 line

static __initdata struct of_device_id of_bus_ids[]

It is right either way. But linux/init.h says it should go just before the '=' sign.

Quoted 1 line

I will send a overworked patch.

Nice :-) ("overworked" means "having too much work to do" - I think you meant "reworked")

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#3 lore raw
In reply to Vitaly Bordug
Quoted 2 lines · Vitaly Bordug

I would like all the comments to be consistent C style (because that's it for the most other dts'es).

$ fgrep -rI // arch/powerpc/boot/dts/ | wc -l
539

-Scott

#4 lore raw
Quoted 7 lines · On Mon, 17 Mar 2008 17:38:21 -0500 Scott Wood wrote:
Quoted 2 lines · Vitaly Bordug

I would like all the comments to be consistent C style (because that's it for the most other dts'es).

$ fgrep -rI // arch/powerpc/boot/dts/ | wc -l
539

So, we should go ahead and add a bit more hassle :) ?

By consistent C style I mean:

+ clock-frequency = <0>; /* Filled in by u-boot */ */
+ interrupts = <f 2>; // decrementer interrupt

using either one or other way for same-type comments.

-Vitaly