From: Luochongjun Date: Thu, 14 Jun 2018 06:29:26 +0000 (+0800) Subject: add ar300m with nand X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=786a5cdb5c97e8a3c2848ca1524b69340f0865b8;p=thirdparty%2Fopenwrt.git add ar300m with nand --- diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index da35fbbb3eb..03d06e9d506 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -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" diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c index 2a2d2702bcc..2b7b2787628 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c @@ -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, } }; diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index 987701eab1c..cffa08f7c5b 100644 --- a/target/linux/ar71xx/image/legacy.mk +++ b/target/linux/ar71xx/image/legacy.mk @@ -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) diff --git a/target/linux/ar71xx/image/nand.mk b/target/linux/ar71xx/image/nand.mk index c7797eca59f..53d7b92edac 100644 --- a/target/linux/ar71xx/image/nand.mk +++ b/target/linux/ar71xx/image/nand.mk @@ -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 index 00000000000..5bff906ae89 --- /dev/null +++ b/target/linux/ar71xx/image/ubinize-gl-ar300m.ini @@ -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 diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default index 3c464ea19b1..df4b0edd782 100644 --- a/target/linux/ar71xx/nand/config-default +++ b/target/linux/ar71xx/nand/config-default @@ -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