ath79: add initial nand support for gl-ar300m
authorMarty E. Plummer <hanetzer@startmail.com>
Tue, 29 May 2018 08:02:59 +0000 (03:02 -0500)
committerJohn Crispin <john@phrozen.org>
Mon, 18 Jun 2018 18:29:38 +0000 (20:29 +0200)
Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
target/linux/ath79/Makefile
target/linux/ath79/dts/qca9533_glinet_ar300m_nand.dts [new file with mode: 0644]
target/linux/ath79/image/Makefile
target/linux/ath79/image/nand.mk [new file with mode: 0644]
target/linux/ath79/nand/config-default [new file with mode: 0644]
target/linux/ath79/nand/profiles/00-default.mk [new file with mode: 0644]
target/linux/ath79/nand/target.mk [new file with mode: 0644]

index 6add24a..2d8ca7e 100644 (file)
@@ -4,7 +4,7 @@ ARCH:=mips
 BOARD:=ath79
 BOARDNAME:=Atheros ATH79 (DTS)
 CPU_TYPE:=24kc
-SUBTARGETS:=generic tiny
+SUBTARGETS:=generic nand tiny
 
 FEATURES:=ramdisk source-only
 
diff --git a/target/linux/ath79/dts/qca9533_glinet_ar300m_nand.dts b/target/linux/ath79/dts/qca9533_glinet_ar300m_nand.dts
new file mode 100644 (file)
index 0000000..c1c4493
--- /dev/null
@@ -0,0 +1,67 @@
+/dts-v1/;
+
+#include "qca9533_glinet_ar300m.dtsi"
+
+&spi {
+       status = "okay";
+       num-cs = <1>;
+
+       flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "winbond,w25q128", "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <25000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x000000 0x040000>;
+                               read-only;
+                       };
+
+                       partition@1 {
+                               label = "u-boot-env";
+                               reg = <0x040000 0x010000>;
+                       };
+
+                       partition@2 {
+                               label = "reserved";
+                               reg = <0x050000 0xfa0000>;
+                       };
+
+                       art: partition@3 {
+                               label = "art";
+                               reg = <0xff0000 0x010000>;
+                       };
+               };
+       };
+
+       flash@1 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spinand,mt29f";
+               reg = <1>;
+               spi-max-frequency = <25000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "kernel";
+                               reg = <0x000000 0x0200000>;
+                       };
+
+                       partition@1 {
+                               label = "ubi";
+                               reg = <0x200000 0x7e00000>;
+                       };
+               };
+       };
+};
index 34dd819..f4c0c1e 100644 (file)
@@ -71,6 +71,9 @@ include ./generic.mk
 include ./generic-tp-link.mk
 include ./generic-ubnt.mk
 endif
+ifeq ($(SUBTARGET),nand)
+include ./nand.mk
+endif
 ifeq ($(SUBTARGET),tiny)
 include ./tiny-tp-link.mk
 endif
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
new file mode 100644 (file)
index 0000000..979afd2
--- /dev/null
@@ -0,0 +1,13 @@
+define Device/glinet_ar300m_nand
+  ATH_SOC := qca9533
+  DEVICE_TITLE := GL-AR300M (NAND)
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage kmod-usb-ledtrig-usbport
+  KERNEL_SIZE := 2048k
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  VID_HDR_OFFSET := 512
+  IMAGES := factory.ubi sysupgrade.tar
+  IMAGE/sysupgrade.tar := sysupgrade-tar
+  IMAGE/factory.ubi := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
+endef
+TARGET_DEVICES += glinet_ar300m_nand
diff --git a/target/linux/ath79/nand/config-default b/target/linux/ath79/nand/config-default
new file mode 100644 (file)
index 0000000..738c29c
--- /dev/null
@@ -0,0 +1,14 @@
+CONFIG_BCH=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_BCH=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_ECC_BCH=y
+CONFIG_MTD_SPINAND_MT29F=y
+CONFIG_MTD_SPINAND_ONDIEECC=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BEB_LIMIT=20
+# CONFIG_MTD_UBI_BLOCK is not set
+# CONFIG_MTD_UBI_FASTMAP is not set
+# CONFIG_MTD_UBI_GLUEBI is not set
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+# CONFIG_UBIFS_FS is not set
diff --git a/target/linux/ath79/nand/profiles/00-default.mk b/target/linux/ath79/nand/profiles/00-default.mk
new file mode 100644 (file)
index 0000000..06ab790
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2009 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/Default
+       NAME:=Default Profile
+       PACKAGES:= \
+               kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport
+       PRIORITY := 1
+endef
+
+define Profile/Default/Description
+       Default package set compatible with most boards.
+endef
+$(eval $(call Profile,Default))
diff --git a/target/linux/ath79/nand/target.mk b/target/linux/ath79/nand/target.mk
new file mode 100644 (file)
index 0000000..a53603d
--- /dev/null
@@ -0,0 +1,7 @@
+BOARDNAME := Generic devices with NAND flash
+FEATURES += squashfs nand rtc
+
+define Target/Description
+       Build firmware for Atheros AR71xx/AR913x based boards with
+       NAND flash, e.g. Netgear WNDR4300.
+endef