]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
add X750-4G with nand
authorLuochongjun <luochongjun@gl-inet.com>
Wed, 13 Jun 2018 09:53:35 +0000 (17:53 +0800)
committerLuochongjun <luochongjun@gl-inet.com>
Wed, 13 Jun 2018 09:53:35 +0000 (17:53 +0800)
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
target/linux/ar71xx/files/arch/mips/ath79/mach-gl-x750-4g.c
target/linux/ar71xx/image/legacy.mk
target/linux/ar71xx/image/nand.mk
target/linux/ar71xx/image/ubinize-gl-x750-4g.ini [new file with mode: 0644]
target/linux/ar71xx/nand/config-default

index f0ba468eacbd4ab368940d3b3e7f7951f7cc7566..da35fbbb3eb363c01dc83568144e9a91d31c3e16 100755 (executable)
@@ -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"
                ;;
index b05246863c4c7bde5fd0940b484e9e64e4e669f3..40922e6f2619dc17123522b6f7995ab20ab0e629 100644 (file)
@@ -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);
index f067f53ac37b9ce45bfcddb203fda95cf2a525ec..987701eab1c59f19f1cd83e88a37bae83f62ddf0 100644 (file)
@@ -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)
 
index 89f8dee1bcddfb91e8d6b306d9379b104b9a4407..c7797eca59f1ab487bfd928bb17fd6de731f1262 100644 (file)
@@ -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 (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 c52f7d51f27df12b6e86603d9b110819bdcb6f14..3c464ea19b1d13a9f6e8c5134072966af43c319a 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_X750_4G=y
 CONFIG_ATH79_MACH_Z1=y
 CONFIG_ATH79_NVRAM=y
 CONFIG_ATH79_PCI_ATH9K_FIXUP=y