Skip to contentSkip to conversation

powerpc: DBox2 Board Support

PATCH In review Jochen Friedrich 2 participants 4 messages Dec 28, 2007 – Jan 3, 2008

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

PATCH v3 1/1 powerpc: DBox2 Board Support

This patch adds device tree source, default config and setup code for DBox2 devices.

---

arch/powerpc/boot/Makefile               |    4 +-
arch/powerpc/boot/cuboot-dbox2.c         |  280 ++++++++
arch/powerpc/boot/dts/dbox2.dts          |  251 ++++++++
arch/powerpc/configs/dbox2_defconfig     | 1034 ++++++++++++++++++++++++++++++
arch/powerpc/platforms/8xx/Kconfig       |    7 +
arch/powerpc/platforms/8xx/Makefile      |    1 +
arch/powerpc/platforms/8xx/dbox2_setup.c |  173 +++++
7 files changed, 1749 insertions(+), 1 deletions(-)

create mode 100644 arch/powerpc/boot/cuboot-dbox2.c create mode 100644 arch/powerpc/boot/dts/dbox2.dts create mode 100644 arch/powerpc/configs/dbox2_defconfig create mode 100644 arch/powerpc/platforms/8xx/dbox2_setup.c

arch/powerpc/boot/Makefile +0 -0
index 18e3271..4c9ec63 100644
@@ -55,7 +55,8 @@ src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \
		cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
		ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \

- cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \
+ cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c \
+ cuboot-bamboo.c cuboot-dbox2.c \
fixed-head.S ep88xc.c cuboot-hpc2.c
src-boot := $(src-wlib) $(src-plat) empty.c

@@ -159,6 +160,7 @@ image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo
image-$(CONFIG_SEQUOIA) += cuImage.sequoia
image-$(CONFIG_WALNUT) += treeImage.walnut
+image-$(CONFIG_DBOX2) += cuImage.dbox2
endif

# For 32-bit powermacs, build the COFF and miboot images

arch/powerpc/boot/cuboot-dbox2.c new file +280 -0

280 lines not on this page · raw message

arch/powerpc/boot/dts/dbox2.dts new file +251 -0

251 lines not on this page · raw message

arch/powerpc/configs/dbox2_defconfig new file +1034 -0

1,034 lines not on this page · raw message

arch/powerpc/platforms/8xx/Kconfig +0 -0
index bd28655..bcd3c40 100644
@@ -43,6 +43,13 @@ config PPC_EP88XC

This board is also resold by Freescale as the QUICCStart MPC885 Evaluation System and/or the CWH-PPC-885XN-VE.

+config DBOX2
+ bool "DBOX2"
+ select CPM1
+ select PPC_CPM_NEW_BINDING
+ help
+ This enables support for the Betaresearch DBOX2.
+
endchoice

menu "Freescale Ethernet driver platform-specific options"

arch/powerpc/platforms/8xx/Makefile +0 -0
index 8b70980..306df8a 100644
@@ -5,3 +5,4 @@ obj-$(CONFIG_PPC_8xx)	  += m8xx_setup.o
obj-$(CONFIG_MPC885ADS)   += mpc885ads_setup.o
obj-$(CONFIG_MPC86XADS)   += mpc86xads_setup.o
obj-$(CONFIG_PPC_EP88XC)  += ep88xc.o

+obj-$(CONFIG_DBOX2) += dbox2_setup.o

arch/powerpc/platforms/8xx/dbox2_setup.c new file +173 -0

173 lines not on this page · raw message

Signature · 1 line
1.5.3.7
#1 lore raw
Quoted 2 lines · Jochen Friedrich

This patch adds device tree source, default config and setup code for DBox2 devices.

[snip]

Quoted 5 lines

+++ b/arch/powerpc/boot/dts/dbox2.dts

arch/powerpc/boot/dts/dbox2.dts new file +3 -0
@@ -0,0 +1,251 @@
+/*
+ * DBOX2 Device Tree Source
+ *

arch/powerpc/boot/dts/dbox2.dts line 13

Quoted 10 lines
arch/powerpc/boot/dts/dbox2.dts new file +10 -0
+ * Copyright 2007 Jochen Friedrich <[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 = "unknown,dbox2"; // boot wrapper fills in correct manufacturer

Probably better just to leave model out of the dts and let the bootwrapper add it.

[snip]

arch/powerpc/boot/dts/dbox2.dts line 69

Quoted 10 lines
arch/powerpc/boot/dts/dbox2.dts new file +10 -0
+		cam@3,0 {
+			compatible = "betaresearch,dbox2-cam";
+			reg = <3 0 20000 6 0 20000>;
+			interrupts = <6 2>;
+			interrupt-parent = <&PIC>;
+			gpios = <1 1c 1 1d 1 1e 1 1f>;
+			gpio-parent = <&CPM1_PIO>;
+		};
+
+		mpegdec@4,0 {

The established generic names don't generally use abbreviations. So I would suggest "mpeg-decoder" here instead.

arch/powerpc/boot/dts/dbox2.dts line 76

Quoted 7 lines
arch/powerpc/boot/dts/dbox2.dts new file +7 -0
+			compatible = "c-cube,avia";
+			reg = <4 0 200>;
+			interrupts = <8 2>;
+			interrupt-parent = <&PIC>;
+		};
+
+		mpegdemux@5,0 {

Likewise "mpeg-demultiplexer"

Quoted 17 lines
arch/powerpc/boot/dts/dbox2.dts new file +17 -0
+			compatible = "c-cube,enx";
+			reg = <5 0 3400 7 0 200000>;
+			interrupts = <2 2>;
+			interrupt-parent = <&PIC>;
+		};
+
+		flash@0,0 {
+			compatible = "cfi-flash";
+			reg = <0 0 800000>;
+			bank-width = <4>;
+			device-width = <1>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			partition@0 {
+				label = "BR bootloader";
+				reg = <0 20000>;
+				read-only;

arch/powerpc/boot/dts/dbox2.dts line 103

Quoted 10 lines
arch/powerpc/boot/dts/dbox2.dts new file +10 -0
+			};
+			partition@20000 {
+				label = "FLFS (U-Boot)";
+				reg = <20000 20000>;
+			};
+			partition@40000 {
+				label = "rootfs";
+				reg = <40000 7c0000>;
+			};
+			ovpartition@20000 {

Uh.. I really don't know what the MTD driver will handle these overlapping partitions. I suspect it will not be pretty...

Quoted 10 lines
arch/powerpc/boot/dts/dbox2.dts new file +10 -0
+				label = "Flash without bootloader";
+				reg = <20000 7e0000>;
+			};
+			ovpartition@0 {
+				label = "Complete Flash";
+				reg = <0 800000>;
+				read-only;
+			};
+		};
+	};

[snip]

arch/powerpc/boot/dts/dbox2.dts line 249

Quoted 2 lines
arch/powerpc/boot/dts/dbox2.dts new file +2 -0
+	chosen {
+		linux,stdout-path = "/soc/cpm/serial@a80";

Probably worth using a path reference here, now they're implemented.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#2 lore raw

Hi David,

Quoted 5 lines

arch/powerpc/boot/dts/dbox2.dts line 13

Quoted 2 lines
arch/powerpc/boot/dts/dbox2.dts new file +2 -0
+/ {
+	model = "unknown,dbox2"; // boot wrapper fills in correct manufacturer

Probably better just to leave model out of the dts and let the bootwrapper add it.

Unfortunately, dtc requires a model:

$ dtc arch/powerpc/boot/dts/dbox2.dts
DTC: dts->dts  on file "arch/powerpc/boot/dts/dbox2.dts"
ERROR: Missing "model" property in /
Quoted 25 lines
Quoted 11 lines
arch/powerpc/boot/dts/dbox2.dts new file +11 -0
+		flash@0,0 {
+			compatible = "cfi-flash";
+			reg = <0 0 800000>;
+			bank-width = <4>;
+			device-width = <1>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			partition@0 {
+				label = "BR bootloader";
+				reg = <0 20000>;
+				read-only;

arch/powerpc/boot/dts/dbox2.dts line 103

Quoted 10 lines
arch/powerpc/boot/dts/dbox2.dts new file +10 -0
+			};
+			partition@20000 {
+				label = "FLFS (U-Boot)";
+				reg = <20000 20000>;
+			};
+			partition@40000 {
+				label = "rootfs";
+				reg = <40000 7c0000>;
+			};
+			ovpartition@20000 {

Uh.. I really don't know what the MTD driver will handle these overlapping partitions. I suspect it will not be pretty...

Quoted 10 lines

arch/powerpc/boot/dts/dbox2.dts line 113

Quoted 10 lines
arch/powerpc/boot/dts/dbox2.dts new file +10 -0
+				label = "Flash without bootloader";
+				reg = <20000 7e0000>;
+			};
+			ovpartition@0 {
+				label = "Complete Flash";
+				reg = <0 800000>;
+				read-only;
+			};
+		};
+	};

MTD handles this correctly. dbox2 uses "Flash without bootloader" for flashing image updates and "Complete Flash" for creating a backup of everything. OpenWRT also uses overlapping partitions BTW (and also for flashing updates).

Thanks,
Jochen

#3 lore raw
Quoted 8 lines · Jochen Friedrich

Hi David,

Quoted 5 lines

arch/powerpc/boot/dts/dbox2.dts line 13

Quoted 2 lines
arch/powerpc/boot/dts/dbox2.dts new file +2 -0
+/ {
+	model = "unknown,dbox2"; // boot wrapper fills in correct manufacturer

Probably better just to leave model out of the dts and let the bootwrapper add it.

Quoted 5 lines

Unfortunately, dtc requires a model:

$ dtc arch/powerpc/boot/dts/dbox2.dts
DTC: dts->dts  on file "arch/powerpc/boot/dts/dbox2.dts"
ERROR: Missing "model" property in /

Ah. That should be gone in newer dtc versions. I'm pretty sure I got rid of all checks that enforced the presence of particular properties, precisely because they give frequent spurious errors when things are supposed to be filled in by the bootloader.

[snip]

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
arch/powerpc/boot/dts/dbox2.dts new file +7 -0
+				label = "Flash without bootloader";
+				reg = <20000 7e0000>;
+			};
+			ovpartition@0 {
+				label = "Complete Flash";
+				reg = <0 800000>;
+				read-only;
Quoted 8 lines
Quoted 3 lines

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

Quoted 3 lines
arch/powerpc/boot/dts/dbox2.dts new file +3 -0
+			};
+		};
+	};

MTD handles this correctly. dbox2 uses "Flash without bootloader" for flashing image updates and "Complete Flash" for creating a backup of everything. OpenWRT also uses overlapping partitions BTW (and also for flashing updates).

Heh. Wow. Safely? i.e. if you access one partition then later an overlapping partition, is mtd guaranteed to get the necessary synchronization right?

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson