Enable OpenWRT to support AMCC Sequoia development board.
Sequoia board has two boot options: either from NOR flash, or from
NAND flash. This patch supports both ways. Enjoy!

Signed-off-by: San Zhang <[email protected]>

Index: target/linux/ppc44x/image/Makefile
===================================================================
--- target/linux/ppc44x/image/Makefile  (revision 20596)
+++ target/linux/ppc44x/image/Makefile  (working copy)
@@ -12,6 +12,7 @@
 define Image/Prepare
        cp $(LINUX_DIR)/arch/powerpc/boot/cuImage.taishan $(KDIR)/uImage
        $(LINUX_DIR)/scripts/dtc/dtc -O dtb -R 4 -S 0x20000
$(LINUX_DIR)/arch/powerpc/boot/dts/canyonlands.dts >
$(KDIR)/openwrt-canyonlands.dtb
+       $(LINUX_DIR)/scripts/dtc/dtc -O dtb -R 4 -S 0x20000
$(LINUX_DIR)/arch/powerpc/boot/dts/sequoia.dts >
$(KDIR)/openwrt-sequoia.dtb
 endef

 define Image/BuildKernel
@@ -40,6 +41,11 @@
                dd if=$(KDIR)/openwrt-canyonlands.dtb bs=128k conv=sync; \
                dd if=$(KDIR)/root.$(1) bs=256k conv=sync; \
        ) > $(BIN_DIR)/openwrt-$(BOARD)-canyonlands-$(1).img
+       ( \
+               dd if=$(LINUX_DIR)/arch/powerpc/boot/uImage bs=1920k conv=sync; 
\
+               dd if=$(KDIR)/openwrt-sequoia.dtb bs=128k conv=sync; \
+               dd if=$(KDIR)/root.$(1) bs=256k conv=sync; \
+       ) > $(BIN_DIR)/openwrt-$(BOARD)-sequoia-$(1).img
 endef

 $(eval $(call BuildImage))
Index: target/linux/ppc44x/patches/110-openwrt_dts_cmdline.patch
===================================================================
--- target/linux/ppc44x/patches/110-openwrt_dts_cmdline.patch   (revision 20596)
+++ target/linux/ppc44x/patches/110-openwrt_dts_cmdline.patch   (working copy)
@@ -7,3 +7,13 @@
 +              bootargs = "console=ttyS1,115200 root=/dev/mtdblock1
rootfstype=squashfs noinitrd";
        };
  };
+--- a/arch/powerpc/boot/dts/sequoia.dts
++++ b/arch/powerpc/boot/dts/sequoia.dts
+@@ -395,6 +391,6 @@
+
+       chosen {
+               linux,stdout-path = "/plb/opb/ser...@ef600300";
+-              bootargs = "console=ttyS0,115200";
++              bootargs = "console=ttyS0,115200 root=/dev/mtdblock1
rootfstype=squashfs noinitrd init=/etc/preinit";
+       };
+ };
Index: target/linux/ppc44x/patches/100-openwrt_flashmap.patch
===================================================================
--- target/linux/ppc44x/patches/100-openwrt_flashmap.patch      (revision 20596)
+++ target/linux/ppc44x/patches/100-openwrt_flashmap.patch      (working copy)
@@ -54,3 +54,51 @@
                                        };
                                        partit...@3f60000 {
                                                label = "env";
+--- a/arch/powerpc/boot/dts/sequoia.dts
++++ b/arch/powerpc/boot/dts/sequoia.dts
+@@ -174,20 +174,12 @@
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+                                       partit...@0 {
+-                                              label = "Kernel";
+-                                              reg = <0x00000000 0x00180000>;
++                                              label = "kernel+dtb";
++                                              reg = <0x00000000 0x00200000>;
+                                       };
+-                                      partit...@180000 {
+-                                              label = "ramdisk";
+-                                              reg = <0x00180000 0x00200000>;
+-                                      };
+-                                      partit...@380000 {
+-                                              label = "file system";
+-                                              reg = <0x00380000 0x03aa0000>;
+-                                      };
+-                                      partit...@3e20000 {
+-                                              label = "kozio";
+-                                              reg = <0x03e20000 0x00140000>;
++                                      partit...@200000 {
++                                              label = "rootfs";
++                                              reg = <0x00200000 0x03d60000>;
+                                       };
+                                       partit...@3f60000 {
+                                               label = "env";
+@@ -213,11 +205,15 @@
+
+                                               partit...@0 {
+                                                       label = "u-boot";
+-                                                      reg = <0x00000000 
0x00084000>;
++                                                      reg = <0x00000000 
0x00100000>;
++                                              };
++                                              partit...@100000 {
++                                                      label = "kernel+dtb";
++                                                      reg = <0x00100000 
0x00200000>;
+                                               };
+-                                              partit...@84000 {
+-                                                      label = "user";
+-                                                      reg = <0x00000000 
0x01f7c000>;
++                                              partit...@300000 {
++                                                      label = "rootfs";
++                                                      reg = <0x00300000 
0x01d00000>;
+                                               };
+                                       };
+                               };
Index: target/linux/ppc44x/config-default
===================================================================
--- target/linux/ppc44x/config-default  (revision 20596)
+++ target/linux/ppc44x/config-default  (working copy)
@@ -1,4 +1,5 @@
 # CONFIG_40x is not set
+CONFIG_440EPX=y
 CONFIG_440GX=y
 CONFIG_44x=y
 CONFIG_460EX=y
@@ -105,6 +106,12 @@
 # CONFIG_MPIC_WEIRD is not set
 CONFIG_MTD_CFI_ADV_OPTIONS=y
 # CONFIG_MTD_CFI_GEOMETRY is not set
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_ECC_SMC=y
+# CONFIG_MTD_NAND_FSL_ELBC is not set
+CONFIG_MTD_NAND_IDS=y
+CONFIG_MTD_NAND_NDFC=y
 CONFIG_MTD_OF_PARTS=y
 CONFIG_MTD_PHYSMAP_OF=y
 CONFIG_NOT_COHERENT_CACHE=y
@@ -160,7 +167,7 @@
 CONFIG_SCHED_HRTICK=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 # CONFIG_SCSI_DMA is not set
-# CONFIG_SEQUOIA is not set
+CONFIG_SEQUOIA=y
 # CONFIG_SERIAL_8250_DETECT_IRQ is not set
 CONFIG_SERIAL_8250_EXTENDED=y
 # CONFIG_SERIAL_8250_MANY_PORTS is not set
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to