Re: [PATCHv3] powerpc: DBox2 Board Support

2008-01-03 Thread David Gibson
On Thu, Jan 03, 2008 at 12:46:23PM +0100, Jochen Friedrich wrote:
> Hi David,
> 
> >> +/ {
> >> +  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 /

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]
> >> +  label = "Flash without bootloader";
> >> +  reg = <2 7e>;
> >> +  };
> >> +  [EMAIL PROTECTED] {
> >> +  label = "Complete Flash";
> >> +  reg = <0 80>;
> >> +  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).

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

-- 
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
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCHv3] powerpc: DBox2 Board Support

2008-01-03 Thread Jochen Friedrich
Hi David,

>> +/ {
>> +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 /

>> +[EMAIL PROTECTED],0 {
>> +compatible = "cfi-flash";
>> +reg = <0 0 80>;
>> +bank-width = <4>;
>> +device-width = <1>;
>> +#address-cells = <1>;
>> +#size-cells = <1>;
>> +[EMAIL PROTECTED] {
>> +label = "BR bootloader";
>> +reg = <0 2>;
>> +read-only;
>> +};
>> +[EMAIL PROTECTED] {
>> +label = "FLFS (U-Boot)";
>> +reg = <2 2>;
>> +};
>> +[EMAIL PROTECTED] {
>> +label = "rootfs";
>> +reg = <4 7c>;
>> +};
>> +[EMAIL PROTECTED] {
> 
> Uh.. I really don't know what the MTD driver will handle these
> overlapping partitions.  I suspect it will not be pretty...
> 
>> +label = "Flash without bootloader";
>> +reg = <2 7e>;
>> +};
>> +[EMAIL PROTECTED] {
>> +label = "Complete Flash";
>> +reg = <0 80>;
>> +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
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCHv3] powerpc: DBox2 Board Support

2008-01-02 Thread David Gibson
On Fri, Dec 28, 2007 at 05:22:51PM +0100, Jochen Friedrich wrote:
> This patch adds device tree source, default config and setup code for
> DBox2 devices.

[snip]
> +++ b/arch/powerpc/boot/dts/dbox2.dts
> @@ -0,0 +1,251 @@
> +/*
> + * DBOX2 Device Tree Source
> + *
> + * 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]
> + [EMAIL PROTECTED],0 {
> + compatible = "betaresearch,dbox2-cam";
> + reg = <3 0 2 6 0 2>;
> + interrupts = <6 2>;
> + interrupt-parent = <&PIC>;
> + gpios = <1 1c 1 1d 1 1e 1 1f>;
> + gpio-parent = <&CPM1_PIO>;
> + };
> +
> + [EMAIL PROTECTED],0 {

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

> + compatible = "c-cube,avia";
> + reg = <4 0 200>;
> + interrupts = <8 2>;
> + interrupt-parent = <&PIC>;
> + };
> +
> + [EMAIL PROTECTED],0 {

Likewise "mpeg-demultiplexer"

> + compatible = "c-cube,enx";
> + reg = <5 0 3400 7 0 20>;
> + interrupts = <2 2>;
> + interrupt-parent = <&PIC>;
> + };
> +
> + [EMAIL PROTECTED],0 {
> + compatible = "cfi-flash";
> + reg = <0 0 80>;
> + bank-width = <4>;
> + device-width = <1>;
> + #address-cells = <1>;
> + #size-cells = <1>;
> + [EMAIL PROTECTED] {
> + label = "BR bootloader";
> + reg = <0 2>;
> + read-only;
> + };
> + [EMAIL PROTECTED] {
> + label = "FLFS (U-Boot)";
> + reg = <2 2>;
> + };
> + [EMAIL PROTECTED] {
> + label = "rootfs";
> + reg = <4 7c>;
> + };
> + [EMAIL PROTECTED] {

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

> + label = "Flash without bootloader";
> + reg = <2 7e>;
> + };
> + [EMAIL PROTECTED] {
> + label = "Complete Flash";
> + reg = <0 80>;
> + read-only;
> + };
> + };
> + };

[snip]
> + chosen {
> + linux,stdout-path = "/soc/cpm/[EMAIL PROTECTED]";

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

-- 
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
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCHv3] powerpc: DBox2 Board Support

2007-12-28 Thread Jochen Friedrich
This patch adds device tree source, default config and setup code for
DBox2 devices.

Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]>
---
 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

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 18e3271..4c9ec63 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -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
diff --git a/arch/powerpc/boot/cuboot-dbox2.c b/arch/powerpc/boot/cuboot-dbox2.c
new file mode 100644
index 000..e54cef2
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-dbox2.c
@@ -0,0 +1,280 @@
+/*
+ * Old U-boot compatibility for dbox2
+ *
+ * Copyright (c) 2007 Jochen Friedrich <[EMAIL PROTECTED]>
+ *
+ * Based on cuboot-8xx.c.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include "ops.h"
+#include "stdio.h"
+#include "cuboot.h"
+#include "io.h"
+
+#define TARGET_8xx
+#include "ppcboot.h"
+
+static bd_t bd;
+
+#defineMAX_PROP_LEN256 /* What should this be? */
+#define DBOX2_VENDOR_OFFSET(0x1ffe0)
+
+enum dbox2_mid {
+   DBOX2_MID_UNKNOWN = 0,
+   DBOX2_MID_NOKIA   = 1,
+   DBOX2_MID_PHILIPS = 2,
+   DBOX2_MID_SAGEM   = 3,
+};
+
+struct dbox2_board_info {
+   enum dbox2_mid mid;
+   char *model;
+   char *avs;
+   char *demux;
+   char *fp;
+   u32 cs3start;
+   u32 cs3size;
+   u32 cs5start;
+   u32 cs5size;
+   u32 cs6start;
+   u32 cs6size;
+   u32 cs7start;
+   u32 cs7size;
+   u32 demux0cs;
+   u32 demux0start;
+   u32 demux0size;
+   u32 demux1cs;
+   u32 demux1start;
+   u32 demux1size;
+   u32 fp_id;
+};
+
+static struct dbox2_board_info dbox2_board_info[] = {
+   {
+   .mid= DBOX2_MID_NOKIA,
+   .model  = "nokia,dbox2",
+   .avs= "sony,cxa2092",
+   .demux  = "c-cube,gtx", 
+   .fp = "[EMAIL PROTECTED]",
+   .cs3start   = 0x0c00,
+   .cs3size= 0x0004,
+   .cs5start   = 0x0800,
+   .cs5size= 0x0020,
+   .cs6start   = 0x0b00,
+   .cs6size= 0x8000,
+   .cs7start   = 0x0840,
+   .cs7size= 0x8000,
+   .demux0cs   = 7,
+   .demux0start= 0x,
+   .demux0size = 0x3000,
+   .demux1cs   = 5,
+   .demux1start= 0x,
+   .demux1size = 0x0020,
+   .fp_id  = 0x5a,
+   },
+   {
+   .mid= DBOX2_MID_PHILIPS,
+   .model  = "philips,dbox2",
+   .avs= "stm,stv6412",
+   .demux  = "c-cube,enx",
+   .fp = "[EMAIL PROTECTED]",
+   .cs3start   = 0x0c04,
+   .cs3size= 0x0004,
+   .cs5start   = 0x0800,
+   .cs5size= 0x8000,
+   .cs6start   = 0x0b00,
+   .cs6size= 0x8000,
+