]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
add ar300m with nand
authorLuochongjun <luochongjun@gl-inet.com>
Thu, 14 Jun 2018 06:29:26 +0000 (14:29 +0800)
committerLuochongjun <luochongjun@gl-inet.com>
Thu, 14 Jun 2018 06:29:26 +0000 (14:29 +0800)
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
target/linux/ar71xx/image/legacy.mk
target/linux/ar71xx/image/nand.mk
target/linux/ar71xx/image/ubinize-gl-ar300m.ini [new file with mode: 0644]
target/linux/ar71xx/nand/config-default

index da35fbbb3eb363c01dc83568144e9a91d31c3e16..03d06e9d506ddd262b0bf700731a4f450e7a1183 100755 (executable)
@@ -291,7 +291,6 @@ platform_check_image() {
        ew-dorin|\
        ew-dorin-router|\
        gl-ar150|\
-       gl-ar300m|\
        gl-ar300|\
        gl-ar750|\
        gl-domino|\
@@ -359,6 +358,7 @@ platform_check_image() {
 
                return 0
                ;;
+       gl-ar300m|\
        gl-x750-4g|\
         gl-ar750s)
                 platform_check_image_gl_nand "$1" "$board" "$magic" && return 0
@@ -776,6 +776,7 @@ platform_pre_upgrade() {
                # erase firmware if booted from initramfs
                [ -z "$(rootfs_type)" ] && mtd erase firmware
                ;;
+       gl-ar300m|\
        gl-x750-4g|\
        gl-ar750s)
                platform_pre_upgrade_gl_nand "$1"
index 2a2d2702bcc699f481d1e3595f29349a70fc8d6d..2b7b278762827bfea795e8749c5e6cb257b6aa32 100644 (file)
@@ -22,7 +22,6 @@
 #include "dev-eth.h"
 #include "dev-gpio-buttons.h"
 #include "dev-leds-gpio.h"
-#include "dev-m25p80.h"
 #include "dev-usb.h"
 #include "dev-spi.h"
 #include "dev-wmac.h"
@@ -109,7 +108,7 @@ static struct spi_board_info gl_ar300m_spi_info[] = {
                .bus_num        = 0,
                .chip_select    = 1,
                .max_speed_hz   = 25000000,
-               .modalias       = "ath79-spinand",
+               .modalias       = "generic-spinand-controller",
                .platform_data  = NULL,
        }
 };
index 987701eab1c59f19f1cd83e88a37bae83f62ddf0..cffa08f7c5b70f483c542c894594b4b25cde2073 100644 (file)
@@ -276,6 +276,7 @@ mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro
 zyx_nbg6716_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(env)ro,64k(RFdata)ro,-(nbu);ar934x-nfc:2048k(zyxel_rfsd),2048k(romd),1024k(header),2048k(kernel),-(ubi)
 gl-ar750s_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(art)ro,2048k(kernel),13052k(reserved);spi0.1:-(ubi)
 gl-x750-4g_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(art)ro,2048k(kernel),13052k(reserved);spi0.1:-(ubi)
+gl-ar300m_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(reserved),64k(art)ro;spi0.1:2048k(kernel),-(ubi)
 
 define Image/BuildKernel
        cp $(KDIR)/vmlinux.elf $(VMLINUX).elf
@@ -1052,6 +1053,7 @@ $(eval $(call SingleProfile,NetgearNAND,64k,R6100,r6100,R6100,ttyS0,115200,$$(r6
 $(eval $(call SingleProfile,ZyXELNAND,128k,NBG6716,nbg6716,NBG6716,ttyS0,115200,NBG6716,$$(zyx_nbg6716_mtdlayout),mem=256M))
 $(eval $(call SingleProfile,GLNAND,64k,GL-AR750S,gl-ar750s,GL-AR750S,ttyS0,115200,$$(gl-ar750s_mtdlayout),gl-ar750s))
 $(eval $(call SingleProfile,GLNAND,64k,GL-X750-4G,gl-x750-4g,GL-X750-4G,ttyS0,115200,$$(gl-x750-4g_mtdlayout),gl-x750-4g))
+$(eval $(call SingleProfile,GLNAND,64k,GL-AR300M,gl-ar300m,GL-AR300M,ttyS0,115200,$$(gl-ar300m_mtdlayout),gl-ar300m))
 
 endif # ifeq ($(SUBTARGET),nand)
 
index c7797eca59f1ab487bfd928bb17fd6de731f1262..53d7b92edac9bbda0f7ce75a842cf8937ea84b79 100644 (file)
@@ -150,3 +150,9 @@ define LegacyDevice/GL-X750-4G
              kmod-usb2 kmod-usb-storage
 endef
 LEGACY_DEVICES += GL-X750-4G
+
+define LegacyDevice/GL-AR300M
+       DEVICE_TITLE := GL-AR300M with nand flash
+       DEVICE_PACKAGES :=  kmod-usb-core kmod-usb2 kmod-usb-storage
+endef
+LEGACY_DEVICES += GL-AR300M
diff --git a/target/linux/ar71xx/image/ubinize-gl-ar300m.ini b/target/linux/ar71xx/image/ubinize-gl-ar300m.ini
new file mode 100644 (file)
index 0000000..5bff906
--- /dev/null
@@ -0,0 +1,26 @@
+[rootfs]
+# Volume mode (other option is static)
+mode=ubi
+# Source image
+image=root.squashfs
+# Volume ID in UBI image
+vol_id=0
+# Allow for dynamic resize
+vol_type=dynamic
+# Volume name
+vol_name=rootfs
+# Autoresize volume at first mount
+# vol_flags=autoresize
+
+[rootfs_data]
+# Volume mode (other option is static)
+mode=ubi
+# Volume ID in UBI image
+vol_id=1
+# Allow for dynamic resize
+vol_type=dynamic
+# Volume name
+vol_name=rootfs_data
+# Autoresize volume at first mount
+vol_flags=autoresize
+vol_size=1MiB
index 3c464ea19b1d13a9f6e8c5134072966af43c319a..df4b0edd7821911130894e981bde628b37d15243 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_ATH79_MACH_RAMBUTAN=y
 CONFIG_ATH79_MACH_WI2A_AC200I=y
 CONFIG_ATH79_MACH_WNDR4300=y
 CONFIG_ATH79_MACH_GL_AR750S=y
+CONFIG_ATH79_MACH_GL_AR300M=y
 CONFIG_ATH79_MACH_GL_X750_4G=y
 CONFIG_ATH79_MACH_Z1=y
 CONFIG_ATH79_NVRAM=y