From: Luochongjun Date: Wed, 13 Jun 2018 09:53:35 +0000 (+0800) Subject: add X750-4G with nand X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e42fe43b0f985c50b1f1dec25cc6b9f3660e4ac;p=thirdparty%2Fopenwrt.git add X750-4G 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 f0ba468eacb..da35fbbb3eb 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -294,7 +294,6 @@ platform_check_image() { gl-ar300m|\ gl-ar300|\ gl-ar750|\ - gl-x750-4g|\ gl-domino|\ gl-mifi|\ gl-usb150|\ @@ -360,6 +359,7 @@ platform_check_image() { return 0 ;; + gl-x750-4g|\ gl-ar750s) platform_check_image_gl_nand "$1" "$board" "$magic" && return 0 return 1 @@ -776,6 +776,7 @@ platform_pre_upgrade() { # erase firmware if booted from initramfs [ -z "$(rootfs_type)" ] && mtd erase firmware ;; + gl-x750-4g|\ gl-ar750s) platform_pre_upgrade_gl_nand "$1" ;; diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-x750-4g.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-x750-4g.c index b05246863c4..40922e6f261 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-x750-4g.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-x750-4g.c @@ -21,7 +21,7 @@ #include "dev-eth.h" #include "dev-gpio-buttons.h" #include "dev-leds-gpio.h" -#include "dev-m25p80.h" +#include "dev-spi.h" #include "dev-usb.h" #include "dev-wmac.h" #include "machtypes.h" @@ -96,11 +96,33 @@ static struct platform_device gl_x750_4g_i2c_gpio = { }, };*/ +static struct spi_board_info gl_x750_4g_spi_info[] = { + { + .bus_num = 0, + .chip_select = 0, + .max_speed_hz = 25000000, + .modalias = "m25p80", + .platform_data = NULL, + }, + { + .bus_num = 0, + .chip_select = 1, + .max_speed_hz = 25000000, + .modalias = "generic-spinand-controller", + .platform_data = NULL, + } +}; + +static struct ath79_spi_platform_data gl_x750_4g_spi_data = { + .bus_num = 0, + .num_chipselect = 2, +}; + static void __init gl_x750_4g_setup(void) { u8 *art = (u8 *) KSEG1ADDR(0x1f050000); - ath79_register_m25p80(NULL); + ath79_register_spi(&gl_x750_4g_spi_data, gl_x750_4g_spi_info, 2); ath79_register_mdio(0, 0x0); //ath79_register_mdio(1, 0x0); diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index f067f53ac37..987701eab1c 100644 --- a/target/linux/ar71xx/image/legacy.mk +++ b/target/linux/ar71xx/image/legacy.mk @@ -275,6 +275,7 @@ zcn1523h_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6208k(rootfs mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)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) define Image/BuildKernel cp $(KDIR)/vmlinux.elf $(VMLINUX).elf @@ -1050,6 +1051,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)) endif # ifeq ($(SUBTARGET),nand) diff --git a/target/linux/ar71xx/image/nand.mk b/target/linux/ar71xx/image/nand.mk index 89f8dee1bcd..c7797eca59f 100644 --- a/target/linux/ar71xx/image/nand.mk +++ b/target/linux/ar71xx/image/nand.mk @@ -143,3 +143,10 @@ define LegacyDevice/GL-AR750S kmod-usb2 kmod-usb-storage endef LEGACY_DEVICES += GL-AR750S + +define LegacyDevice/GL-X750-4G + DEVICE_TITLE := GL-X750-4G with nand flash + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887 kmod-usb-core \ + kmod-usb2 kmod-usb-storage +endef +LEGACY_DEVICES += GL-X750-4G diff --git a/target/linux/ar71xx/image/ubinize-gl-x750-4g.ini b/target/linux/ar71xx/image/ubinize-gl-x750-4g.ini new file mode 100644 index 00000000000..5bff906ae89 --- /dev/null +++ b/target/linux/ar71xx/image/ubinize-gl-x750-4g.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 c52f7d51f27..3c464ea19b1 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_X750_4G=y CONFIG_ATH79_MACH_Z1=y CONFIG_ATH79_NVRAM=y CONFIG_ATH79_PCI_ATH9K_FIXUP=y