From f5b93f4a65039a7c18b395dde83f5b7cff15d772 Mon Sep 17 00:00:00 2001 From: NYNEX Date: Thu, 28 Mar 2019 12:52:47 -0400 Subject: [PATCH] Add initial support for the TPE-R1200 Mini Wireless Router --- .../ar71xx/base-files/etc/board.d/01_leds | 1 + .../ar71xx/base-files/etc/board.d/02_network | 1 + target/linux/ar71xx/base-files/etc/diag.sh | 1 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 +++ .../ar71xx/base-files/lib/upgrade/platform.sh | 7 +++++ target/linux/ar71xx/config-4.4 | 1 + .../files/arch/mips/ath79/Kconfig.openwrt | 10 +++++++ .../files/arch/mips/ath79/mach-gl-ar300m.c | 3 +++ .../ar71xx/files/arch/mips/ath79/machtypes.h | 1 + target/linux/ar71xx/image/generic.mk | 10 ++++++- target/linux/ar71xx/image/legacy.mk | 3 +++ target/linux/ar71xx/image/nand.mk | 7 ++++- .../linux/ar71xx/image/ubinize-tpe-r1200.ini | 26 +++++++++++++++++++ 13 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 target/linux/ar71xx/image/ubinize-tpe-r1200.ini diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index e28fcf83df..57c9491aee 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -286,6 +286,7 @@ gl-ar150|\ gl-usb150|\ gl-ar300|\ gl-ar300m|\ +tpe-r1200|\ gl-ar750) ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:white:wlan2g" "phy0tpt" ;; diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index 36a5a33024..d9451c82ff 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -126,6 +126,7 @@ ar71xx_setup_interfaces() dr344|\ gl-ar150|\ gl-ar300m|\ + tpe-r1200|\ gl-domino|\ gl-inet|\ gl-mifi|\ diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 32a6e129f1..87ebfd7ddc 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -481,6 +481,7 @@ set_state() { status_led_on case $(ar71xx_board_name) in gl-ar300m|\ + tpe-r1200|\ gl-ar750) fw_printenv lc >/dev/null 2>&1 && fw_setenv "bootcount" 0 ;; diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index cd5797e5e7..eda918b7c0 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -935,6 +935,9 @@ ar71xx_board_detect() { *TEW-823DRU) name="tew-823dru" ;; + *"TPE-R1200 Think Penguin Mini Router") + name="tpe-r1200" + ;; *"TL-WR1041N v2") name="tl-wr1041n-v2" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 642b27ea39..0d49297f6d 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -274,6 +274,10 @@ platform_check_image() { platform_check_image_gl_ar300m "$1" "$board" "$magic" && return 0 return 1 ;; + tpe-r1200) + platform_check_image_gl_ar300m "$1" "$board" "$magic" && return 0 + return 1 + ;; gl-ar300|\ gl-ar750|\ gl-domino|\ @@ -655,6 +659,9 @@ platform_pre_upgrade() { gl-ar300m) platform_pre_upgrade_gl_ar300m "$1" ;; + tpe-r1200) + platform_pre_upgrade_gl_ar300m "$1" + ;; rb-941-2nd) ;; rb*|\ diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 26f0986769..bd14388f75 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -161,6 +161,7 @@ CONFIG_ATH79_MACH_TEW_673GRU=y CONFIG_ATH79_MACH_TEW_712BR=y CONFIG_ATH79_MACH_TEW_732BR=y CONFIG_ATH79_MACH_TEW_823DRU=y +CONFIG_ATH79_MACH_TPE_R1200=y CONFIG_ATH79_MACH_TL_MR11U=y CONFIG_ATH79_MACH_TL_MR13U=y CONFIG_ATH79_MACH_TL_MR3020=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index ac7d4a70fa..ef23fa3ddc 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -1254,6 +1254,16 @@ config ATH79_MACH_BSB select ATH79_DEV_USB select ATH79_DEV_WMAC +config ATH79_MACH_TPE_R1200 + bool "TPE-R1200 Support" + select SOC_QCA953X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + select ATH79_DEV_WMAC + config ATH79_MACH_ARCHER_C7 bool "TP-LINK Archer C5/C7/TL-WDR4900 v2 board support" select SOC_QCA955X 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 62906a1922..03a370a496 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 @@ -164,3 +164,6 @@ static void __init gl_ar300m_setup(void) MIPS_MACHINE(ATH79_MACH_GL_AR300M, "GL-AR300M", "GL-AR300M", gl_ar300m_setup); + +MIPS_MACHINE(ATH79_MACH_TPE_R1200, "TPE-R1200", "TPE-R1200 Think Penguin Mini Router", + gl_ar300m_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 93692144c7..68e28535d6 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -185,6 +185,7 @@ enum ath79_mach_type { ATH79_MACH_TEW_712BR, /* TRENDnet TEW-712BR */ ATH79_MACH_TEW_732BR, /* TRENDnet TEW-732BR */ ATH79_MACH_TEW_823DRU, /* TRENDnet TEW-823DRU */ + ATH79_MACH_TPE_R1200, /* ThinkPenguin TPE-R1200 */ ATH79_MACH_TL_MR10U, /* TP-LINK TL-MR10U */ ATH79_MACH_TL_MR11U, /* TP-LINK TL-MR11U */ ATH79_MACH_TL_MR13U, /* TP-LINK TL-MR13U */ diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index ee7cf84a01..8243648955 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -169,7 +169,15 @@ define Device/gl-ar300m CONSOLE = ttyS0,115200 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro endef -TARGET_DEVICES += gl-ar300m + +define Device/tpe-r1200 + $(Device/gl-ar300m) + DEVICE_TITLE := TPE-R1200 Think Penguin Mini Router + BOARDNAME = TPE-R1200 +endef + +TARGET_DEVICES += gl-ar300m tpe-r1200 + define Device/gl-ar750 DEVICE_TITLE := GL.iNet GL-AR750 diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index 8942b71b23..8ee0b11d1f 100644 --- a/target/linux/ar71xx/image/legacy.mk +++ b/target/linux/ar71xx/image/legacy.mk @@ -283,6 +283,7 @@ r6100_mtdlayout=mtdparts=ar934x-nfc:128k(u-boot)ro,256k(caldata)ro,256k(caldata- tew823dru_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata)ro,512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),23552k(ubi),25600k@0x6c0000(firmware),256k(caldata_backup),-(reserved) gl-ar300md_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(reserved),64k(art);spi0.1:2048k(kernel),-(ubi) +tpe-r1200d_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(reserved),64k(art);spi0.1:2048k(kernel),-(ubi) zcn1523h_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6208k(rootfs),1472k(kernel),64k(configure)ro,64k(mfg)ro,64k(art)ro,7680k@0x50000(firmware) mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro @@ -1066,6 +1067,8 @@ $(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-AR300MD,gl-ar300m,GL-AR300M,ttyS0,115200,$$(gl-ar300md_mtdlayout),gl-ar300m)) +$(eval $(call SingleProfile,GLNAND,64k,TPE-R1200D,tpe-r1200,TPE-R1200,ttyS0,115200,$$(tpe-r1200d_mtdlayout),tpe-r1200)) + endif # ifeq ($(SUBTARGET),nand) define Image/Build/squashfs diff --git a/target/linux/ar71xx/image/nand.mk b/target/linux/ar71xx/image/nand.mk index 0590ad16a0..cdccce5223 100644 --- a/target/linux/ar71xx/image/nand.mk +++ b/target/linux/ar71xx/image/nand.mk @@ -25,7 +25,12 @@ define LegacyDevice/GL-AR300MD DEVICE_TITLE := GL-AR300M with nand flash DEVICE_PACKAGES := kmod-usb-core kmod-usb2 uboot-envtools endef -LEGACY_DEVICES += GL-AR300MD + +define LegacyDevice/TPE-R1200D + DEVICE_TITLE := TPE-R1200 Think Penguin Mini Router + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 uboot-envtools +endef +LEGACY_DEVICES += GL-AR300MD TPE-R1200D define Device/mr18 DEVICE_TITLE := Meraki MR18 diff --git a/target/linux/ar71xx/image/ubinize-tpe-r1200.ini b/target/linux/ar71xx/image/ubinize-tpe-r1200.ini new file mode 100644 index 0000000000..5bff906ae8 --- /dev/null +++ b/target/linux/ar71xx/image/ubinize-tpe-r1200.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 -- 2.25.1