All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean MacLennan <smaclennan@pikatech.com>
To: <linuxppc-dev@ozlabs.org>
Subject: [PATCH 1/5] Boot code
Date: Sat, 12 Apr 2008 14:01:40 -0400	[thread overview]
Message-ID: <20080412140140.6c75cee5@lappy.seanm.ca> (raw)
In-Reply-To: <20080412134831.424480cf@lappy.seanm.ca>

Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>

diff --git a/arch/powerpc/boot/cuboot-warp.c
b/arch/powerpc/boot/cuboot-warp.c index eb108a8..43d7ad9 100644
--- a/arch/powerpc/boot/cuboot-warp.c
+++ b/arch/powerpc/boot/cuboot-warp.c
@@ -10,6 +10,7 @@
 #include "ops.h"
 #include "4xx.h"
 #include "cuboot.h"
+#include "stdio.h"
 
 #define TARGET_4xx
 #define TARGET_44x
@@ -17,14 +18,54 @@
 
 static bd_t bd;
 
-static void warp_fixups(void)
+static void warp_fixup_one_nor(u32 from, u32 to)
 {
-	unsigned long sysclk = 66000000;
+	void *devp;
+	char name[40];
+	u32 v[2];
+
+	sprintf(name, "/plb/opb/ebc/nor_flash@0,0/partition@%x", from);
+
+	devp = finddevice(name);
+	if (!devp)
+		return;
+
+	if (getprop(devp, "reg", v, sizeof(v)) == sizeof(v)) {
+		v[0] = to;
+		setprop(devp, "reg", v, sizeof(v));
+
+		printf("NOR 64M fixup %x -> %x\r\n", from, to);
+	}
+}
+
 
-	ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
+static void warp_fixups(void)
+{
+	ibm440ep_fixup_clocks(66000000, 11059200, 50000000);
 	ibm4xx_sdram_fixup_memsize();
 	ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
 	dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
+
+	/* Fixup for 64M flash on Rev A boards. */
+	if (bd.bi_flashsize == 0x4000000) {
+		void *devp;
+		u32 v[3];
+
+		devp = finddevice("/plb/opb/ebc/nor_flash@0,0");
+		if (!devp)
+			return;
+
+		/* Fixup the size */
+		if (getprop(devp, "reg", v, sizeof(v)) == sizeof(v)) {
+			v[2] = bd.bi_flashsize;
+			setprop(devp, "reg", v, sizeof(v));
+		}
+
+		/* Fixup parition offsets */
+		warp_fixup_one_nor(0x300000, 0x3f00000);
+		warp_fixup_one_nor(0x340000, 0x3f40000);
+		warp_fixup_one_nor(0x380000, 0x3f80000);
+	}
 }
 
 
diff --git a/arch/powerpc/boot/dts/warp.dts
b/arch/powerpc/boot/dts/warp.dts index b04a52e..fa070b0 100644
--- a/arch/powerpc/boot/dts/warp.dts
+++ b/arch/powerpc/boot/dts/warp.dts
@@ -132,40 +132,33 @@
 
 				fpga@2,0 {
 					compatible = "pika,fpga";
-			   		reg = <2 0 2200>;
+			   		reg = <2 0 1000>;
 					interrupts = <18 8>;
 					interrupt-parent = <&UIC0>;
 				};
 
+				fpga@2,4000 {
+					compatible = "pika,fpga-sd";
+					reg = <2 4000 A00>;
+				};
+
 				nor_flash@0,0 {
-					compatible = "amd,s29gl512n",
"cfi-flash";
+					compatible = "amd,s29gl032a",
"cfi-flash"; bank-width = <2>;
-					reg = <0 0 4000000>;
+					reg = <0 0 400000>;
 					#address-cells = <1>;
 					#size-cells = <1>;
-					partition@0 {
-						label = "kernel";
-						reg = <0 180000>;
-					};
-					partition@180000 {
-						label = "root";
-						reg = <180000 3480000>;
-					};
-					partition@3600000 {
-						label = "user";
-						reg = <3600000 900000>;
-					};
-					partition@3f00000 {
+					partition@300000 {
 						label = "fpga";
-						reg = <3f00000 40000>;
+						reg = <300000 40000>;
 					};
-					partition@3f40000 {
+					partition@340000 {
 						label = "env";
-						reg = <3f40000 40000>;
+						reg = <340000 40000>;
 					};
-					partition@3f80000 {
+					partition@380000 {
 						label = "u-boot";
-						reg = <3f80000 80000>;
+						reg = <380000 80000>;
 					};
 				};
 			};
@@ -186,6 +179,16 @@
 				reg = <ef600700 14>;
 				interrupt-parent = <&UIC0>;
 				interrupts = <2 4>;
+				index = <0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				ad7414@4a {
+					compatible = "adi,ad7414";
+					reg = <4a>;
+					interrupts = <19 8>;
+					interrupt-parent = <&UIC0>;
+				};
 			};
 
 			GPIO0: gpio@ef600b00 {

  reply	other threads:[~2008-04-12 18:01 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-12 17:48 Warp patches for 2.6.26 Sean MacLennan
2008-04-12 18:01 ` Sean MacLennan [this message]
2008-04-13  0:49   ` [PATCH 1/5] Boot code Josh Boyer
2008-04-13  2:06     ` Sean MacLennan
2008-04-12 18:03 ` PATCH 2/5] Platform code Sean MacLennan
2008-04-13  3:15   ` Sean MacLennan
2008-04-14 16:00   ` David Woodhouse
2008-04-12 18:09 ` [PATCH 3/5] Defconfig Sean MacLennan
2008-04-12 18:10 ` [PATCH 4/5] LED driver Sean MacLennan
2008-04-13  0:41   ` Josh Boyer
2008-04-17 17:32     ` Sean MacLennan
2008-04-13 12:28   ` Peter Korsgaard
2008-04-13 16:51     ` Sean MacLennan
2008-04-13 17:34       ` Peter Korsgaard
2008-04-13 17:51         ` Sean MacLennan
2008-04-12 18:11 ` [PATCH 5/5] WDT driver Sean MacLennan
2008-04-13  0:40   ` Josh Boyer
2008-04-14  8:33   ` Laurent Pinchart
2008-04-14 15:40     ` Sean MacLennan
2008-04-13  0:44 ` Warp patches for 2.6.26 Stephen Rothwell
2008-04-13  0:50   ` Josh Boyer
2008-04-13  1:55   ` Sean MacLennan
2008-04-13  2:09     ` Grant Likely
2008-04-13  2:38       ` Sean MacLennan
2008-04-13  3:13         ` Dale Farnsworth
2008-04-17 15:50           ` Sean MacLennan
2008-04-17 16:08             ` Dale Farnsworth
2008-04-17 17:26               ` Sean MacLennan
2008-04-17 18:11                 ` Dale Farnsworth
2008-04-13  1:11 ` Paul Mackerras
2008-04-13  2:24 ` Josh Boyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080412140140.6c75cee5@lappy.seanm.ca \
    --to=smaclennan@pikatech.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.