diff options
Diffstat (limited to 'target/linux/ramips')
4 files changed, 307 insertions, 0 deletions
diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-x1800gs.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-x1800gs.dts new file mode 100644 index 0000000000..c0bb5e4969 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-x1800gs.dts @@ -0,0 +1,279 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> +#include <dt-bindings/leds/common.h> + +/ { + compatible = "elecom,wrc-x1800gs", "mediatek,mt7621-soc"; + model = "ELECOM WRC-X1800GS"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_green; + label-mac-device = &gmac0; + }; + + chosen { + bootargs-override = "console=ttyS0,115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + /* available on 1st HW rev. */ + led-0 { + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + color = <LED_COLOR_ID_GREEN>; + function = LED_FUNCTION_WLAN_2GHZ; + function-enumerator = <1>; + linux,default-trigger = "phy0tpt"; + }; + + led_power_green: led-1 { + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_GREEN>; + function = LED_FUNCTION_POWER; + }; + + led_power_red: led-2 { + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_RED>; + function = LED_FUNCTION_POWER; + }; + + led-3 { + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_RED>; + function = LED_FUNCTION_WLAN_2GHZ; + }; + + led-4 { + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + color = <LED_COLOR_ID_RED>; + function = LED_FUNCTION_WPS; + }; + + led-5 { + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + color = <LED_COLOR_ID_GREEN>; + function = LED_FUNCTION_WLAN_5GHZ; + linux,default-trigger = "phy1tpt"; + }; + + /* available on 2nd HW rev. */ + led-6 { + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + color = <LED_COLOR_ID_GREEN>; + function = LED_FUNCTION_WLAN_2GHZ; + function-enumerator = <2>; + linux,default-trigger = "phy0tpt"; + }; + + led-7 { + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_RED>; + function = LED_FUNCTION_WLAN_5GHZ; + }; + + }; + + keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,code = <KEY_RESTART>; + }; + + switch-ap { + label = "ap"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + linux,code = <BTN_0>; + }; + + switch-router { + label = "router"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,code = <BTN_1>; + }; + + button-wps { + label = "wps"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = <KEY_WPS_BUTTON>; + }; + }; +}; + +&nand { + status = "okay"; + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x100000>; + label = "u-boot"; + read-only; + }; + + partition@100000 { + reg = <0x100000 0x100000>; + label = "u-boot-env"; + }; + + partition@200000 { + reg = <0x200000 0x1c0000>; + label = "factory"; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + precal_factory_e10: precal@e10 { + reg = <0xe10 0x19c10>; + }; + + macaddr_factory_1fdf4: macaddr@1fdf4 { + reg = <0x1fdf4 0x6>; + }; + + macaddr_factory_1fdfa: macaddr@1fdfa { + reg = <0x1fdfa 0x6>; + }; + }; + }; + + /* "RAS1" on stock fw */ + partition@3c0000 { + compatible = "fixed-partitions"; + reg = <0x3c0000 0x3240000>; + label = "firmware"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x800000>; + label = "kernel"; + }; + + partition@800000 { + reg = <0x800000 0x2a40000>; + label = "ubi"; + }; + }; + + partition@3600000 { + reg = <0x3600000 0x100000>; + label = "Config"; + read-only; + }; + + /* "RAS2" on stock fw */ + partition@3700000 { + reg = <0x3700000 0x3240000>; + label = "firmware2"; + }; + + partition@6940000 { + reg = <0x6940000 0x100000>; + label = "Config_2"; + read-only; + }; + + partition@6a40000 { + reg = <0x6a40000 0x100000>; + label = "persist"; + }; + + partition@6b40000 { + reg = <0x6b40000 0x100000>; + label = "mesh"; + read-only; + }; + + partition@6c40000 { + reg = <0x6c40000 0x1340000>; + label = "backup"; + read-only; + }; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_1fdfa>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + nvmem-cells = <&macaddr_factory_1fdf4>; + nvmem-cell-names = "mac-address"; +}; + +ðphy0 { + /delete-property/ interrupts; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>; + nvmem-cell-names = "eeprom", "precal"; + mediatek,disable-radar-background; + }; +}; + +&pcie2 { + status = "disabled"; +}; + +&switch0 { + ports { + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan1"; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; + +&uartlite { + pinctrl-0 = <&uart1_pins>; + pinctrl-names = "default"; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 1c6cd237d3..ff071213ef 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1120,6 +1120,27 @@ define Device/elecom_wrc-2533gst2 endef TARGET_DEVICES += elecom_wrc-2533gst2 +define Device/elecom_wrc-x1800gs + $(Device/nand) + DEVICE_VENDOR := ELECOM + DEVICE_MODEL := WRC-X1800GS + KERNEL := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \ + znet-header 4.04(XVF.1)b90 COMC 0x68 | elecom-product-header WRC-X1800GS + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + KERNEL_SIZE := 8192k + IMAGE_SIZE := 51456k +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + ARTIFACTS := initramfs-factory.bin + ARTIFACT/initramfs-factory.bin := append-image-stage initramfs-kernel.bin | \ + znet-header 4.04(XVF.1)b90 COMC 0x68 | elecom-product-header WRC-X1800GS | \ + check-size +endif + DEVICE_PACKAGES := kmod-mt7915-firmware +endef +TARGET_DEVICES += elecom_wrc-x1800gs + define Device/etisalat_s3 $(Device/sercomm_dxx) IMAGE_SIZE := 32768k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 2ed8c38732..ea479ddd38 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -71,6 +71,7 @@ ramips_setup_interfaces() asiarf,ap7621-nv1|\ beeline,smartbox-flash|\ beeline,smartbox-giga|\ + elecom,wrc-x1800gs|\ glinet,gl-mt1300|\ iodata,wn-deax1800gr|\ iptime,a3002mesh|\ diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 258bb1fe96..3c8c4b36ee 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -131,6 +131,12 @@ platform_do_upgrade() { zyxel,nwa55axe) nand_do_upgrade "$1" ;; + elecom,wrc-x1800gs) + [ "$(fw_printenv -n bootmenu_delay)" != "0" ] || \ + fw_setenv bootmenu_delay 3 + iodata_mstc_set_flag "bootnum" "persist" "0x4" "1,2" "1" + nand_do_upgrade "$1" + ;; iodata,wn-ax1167gr2|\ iodata,wn-ax2033gr|\ iodata,wn-dx1167r|\ |