Skip to contentSkip to conversation

powerpc: Simple platform for the ISS 4xx simulator

PATCH In review Benjamin Herrenschmidt 3 participants 4 messages Oct 3, 2008

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

PATCH 1/1 powerpc: Simple platform for the ISS 4xx simulator

This is a trivial 4xx plaform that uses the new simple bsp from Josh and is handy to use in simulators such as ISS or even Mambo who don't properly implement most of the actual devices in the SoC but really only the core.

---

 arch/powerpc/boot/Makefile                 |    7 
 arch/powerpc/boot/dts/iss4xx.dts           |  107 +++
 arch/powerpc/boot/treeboot-iss4xx.c        |   54 +
 arch/powerpc/configs/44x/iss4xx_defconfig  |  827 +++++++++++++++++++++++++++++
 arch/powerpc/platforms/44x/Kconfig         |   11 
 arch/powerpc/platforms/44x/ppc44x_simple.c |    3 
 6 files changed, 1006 insertions(+), 3 deletions(-)
arch/powerpc/boot/Makefile +5 -2
@@ -42,6 +42,7 @@ $(obj)/ebony.o: BOOTCFLAGS += -mcpu=405
 $(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=405
 $(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=405
 $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405
+$(obj)/treeboot-iss4xx.o: BOOTCFLAGS += -mcpu=405
 $(obj)/virtex405-head.o: BOOTAFLAGS += -mcpu=405
 
 
@@ -68,7 +69,8 @@ src-plat := of.c cuboot-52xx.c cuboot-82
 		fixed-head.S ep88xc.c ep405.c cuboot-c2k.c \
 		cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
 		cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \
-		virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c
+		virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \
+		treeboot-iss4xx.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -221,7 +223,8 @@ image-$(CONFIG_RAINIER)			+= cuImage.rai
 image-$(CONFIG_TAISHAN)			+= cuImage.taishan
 image-$(CONFIG_KATMAI)			+= cuImage.katmai
 image-$(CONFIG_WARP)			+= cuImage.warp
-image-$(CONFIG_YOSEMITE)		+= cuImage.yosemite
+image-$(CONFIG_YOSEMITE)		+= cuImage.yosemit
+image-$(CONFIG_ISS4xx)			+= treeImage.iss4xx
 
 # Board ports in arch/powerpc/platform/8xx/Kconfig
 image-$(CONFIG_MPC86XADS)		+= cuImage.mpc866ads
arch/powerpc/boot/dts/iss4xx.dts new file +107 -0

107 lines not on this page · raw message

arch/powerpc/platforms/44x/Kconfig +11 -0
Index: linux-work/arch/powerpc/platforms/44x/Kconfig
===================================================================
@@ -113,6 +113,17 @@ config YOSEMITE
 	help
 	  This option enables support for the AMCC PPC440EP evaluation board.
 
+config ISS4xx
+	bool "ISS 4xx Simulator"
+	depends on (44x || 40x)
+	default n
+	select PPC44x_SIMPLE
+	select 405GP if 40x
+	select 440GP if 44x
+	select PPC_FPU
+	help
+	  This option enables support for the IBM ISS simulation environment
+
 #config LUAN
 #	bool "Luan"
 #	depends on 44x
arch/powerpc/configs/44x/iss4xx_defconfig new file +827 -0

827 lines not on this page · raw message

arch/powerpc/boot/treeboot-iss4xx.c new file +54 -0

54 lines not on this page · raw message

arch/powerpc/platforms/44x/ppc44x_simple.c +2 -1
Index: linux-work/arch/powerpc/platforms/44x/ppc44x_simple.c
===================================================================
@@ -58,7 +58,8 @@ static char *board[] __initdata = {
 	"amcc,rainier",
 	"amcc,sequoia",
 	"amcc,taishan",
-	"amcc,yosemite"
+	"amcc,yosemite",
+	"ibm,iss-4xx",
 };
 
 static int __init ppc44x_probe(void)
#1 lore raw

arch/powerpc/boot/Makefile image-$(CONFIG_RAINIER) += cuImage.rai · line 226

Quoted 3 lines · On Fri, 03 Oct 2008 10:07:19 +1000 "Benjamin Herrenschmidt"…

image-$(CONFIG_WARP) += cuImage.warp

arch/powerpc/boot/Makefile +1 -1
-image-$(CONFIG_YOSEMITE)		+= cuImage.yosemite
+image-$(CONFIG_YOSEMITE)		+= cuImage.yosemit

Did you really mean to drop the e from yosemite?

Cheers,
Sean

#2 lore raw
Quoted 8 lines · Sean MacLennan

arch/powerpc/boot/Makefile image-$(CONFIG_RAINIER) += cuImage.rai · line 226

Quoted 3 lines · On Fri, 03 Oct 2008 10:07:19 +1000 "Benjamin Herrenschmidt"…

image-$(CONFIG_WARP) += cuImage.warp

arch/powerpc/boot/Makefile +1 -1
-image-$(CONFIG_YOSEMITE)		+= cuImage.yosemite
+image-$(CONFIG_YOSEMITE)		+= cuImage.yosemit

Did you really mean to drop the e from yosemite?

Nope :-) Thanks for catching this.

Cheers,
Ben.

#3 lore raw
In reply to Benjamin Herrenschmidt

arch/powerpc/boot/dts/iss4xx.dts line 2

Quoted 7 lines · Benjamin Herrenschmidt

Index: linux-work/arch/powerpc/boot/dts/iss4xx.dts
===================================================================

arch/powerpc/boot/dts/iss4xx.dts new file +2 -0
@@ -0,0 +1,107 @@
+/*
+ * Device Tree Source for IBM Ebony

Lazy. ;)

Quoted 28 lines
arch/powerpc/boot/dts/iss4xx.dts new file +28 -0
+ *
+ * Copyright (c) 2006, 2007 IBM Corp.
+ * Josh Boyer <[email protected]>, David Gibson <[email protected]>
+ *
+ * FIXME: Draft only!
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+/dts-v1/;
+
+/ {
+	#address-cells = <2>;
+	#size-cells = <1>;
+	model = "ibm,iss-4xx";
+	compatible = "ibm,iss-4xx";
+	dcr-parent = <&{/cpus/cpu@0}>;
+
+	aliases {
+		serial0 = &UART0;
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+

arch/powerpc/boot/dts/iss4xx.dts line 40

Quoted 10 lines
arch/powerpc/boot/dts/iss4xx.dts new file +10 -0
+		cpu@0 {
+			device_type = "cpu";
+			model = "PowerPC,4xx"; // real CPU changed in sim
+			reg = <0x00000000>;
+			clock-frequency = <100000000>; // 100Mhz :-)
+			timebase-frequency = <100000000>;
+			i-cache-line-size = <32>; // may need fixup in sim
+			d-cache-line-size = <32>; // may need fixup in sim
+			i-cache-size = <32768>; /* may need fixup in sim */
+			d-cache-size = <32768>; /* may need fixup in sim */

Does "fixup in sim" mean that the simulator itself mucks with the device tree? Or is there some wrapper that does this prior to kernel boot?

Quoted 25 lines
arch/powerpc/boot/dts/iss4xx.dts new file +25 -0
+			dcr-controller;
+			dcr-access-method = "native";
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x00000000 0x00000000>; // Filled in by zImage
+	};
+
+	UIC0: interrupt-controller0 {
+		compatible = "ibm,uic-4xx", "ibm,uic";
+		interrupt-controller;
+		cell-index = <0>;
+		dcr-reg = <0x0c0 0x009>;
+		#address-cells = <0>;
+		#size-cells = <0>;
+		#interrupt-cells = <2>;
+
+	};
+
+	UIC1: interrupt-controller1 {
+		compatible = "ibm,uic-4xx", "ibm,uic";
+		interrupt-controller;
+		cell-index = <1>;

arch/powerpc/boot/dts/iss4xx.dts line 75

Quoted 10 lines
arch/powerpc/boot/dts/iss4xx.dts new file +10 -0
+		dcr-reg = <0x0d0 0x009>;
+		#address-cells = <0>;
+		#size-cells = <0>;
+		#interrupt-cells = <2>;
+		interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
+		interrupt-parent = <&UIC0>;
+	};
+
+	plb {
+		compatible = "ibm,plb-4xx", "ibm,plb4"; /* Could be PLB6, doesn't matter */

Why doesn't it matter?

Quoted 40 lines
arch/powerpc/boot/dts/iss4xx.dts new file +32 -0
+		#address-cells = <2>;
+		#size-cells = <1>;
+		ranges;
+		clock-frequency = <0>; // Filled in by zImage
+
+		POB0: opb {
+			compatible = "ibm,opb-4xx", "ibm,opb";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			/* Wish there was a nicer way of specifying a full 32-bit
+			   range */
+			ranges = <0x00000000 0x00000001 0x00000000 0x80000000
+				  0x80000000 0x00000001 0x80000000 0x80000000>;
+			clock-frequency = <0>; // Filled in by zImage
+
+			UART0: serial@40000200 {
+				device_type = "serial";
+				compatible = "ns16550";
+				reg = <0x40000200 0x00000008>;
+				virtual-reg = <0xe0000200>;
+				clock-frequency = <11059200>;
+				current-speed = <115200>;
+				interrupt-parent = <&UIC0>;
+				interrupts = <0x0 0x4>;
+			};
+		};
+	};
+
+	chosen {
+		linux,stdout-path = "/plb/opb/serial@40000200";
+	};
+};

Index: linux-work/arch/powerpc/platforms/44x/Kconfig
===================================================================

arch/powerpc/platforms/44x/Kconfig +0 -0
@@ -113,6 +113,17 @@ config YOSEMITE
 	help
 	  This option enables support for the AMCC PPC440EP evaluation board.
 

arch/powerpc/platforms/44x/Kconfig config YOSEMITE · line 125

Quoted 10 lines
arch/powerpc/platforms/44x/Kconfig +10 -0
+config ISS4xx
+	bool "ISS 4xx Simulator"
+	depends on (44x || 40x)
+	default n
+	select PPC44x_SIMPLE
+	select 405GP if 40x
+	select 440GP if 44x
+	select PPC_FPU
+	help
+	  This option enables support for the IBM ISS simulation environment

So I'm going to assume you tested the 40x case and that it works. But I find it a bit odd to be in the 44x Kconfig.

arch/powerpc/configs/44x/iss4xx_defconfig

Quoted 4 lines

Index: linux-work/arch/powerpc/configs/44x/iss4xx_defconfig
===================================================================

arch/powerpc/configs/44x/iss4xx_defconfig new file +0 -0

So.. I'm not really opposed, but do you need a full defconfig for this? I'm wondering if you could just add the iss4xx platform to the multi-board ppc44x_defconfig and call it good.

josh