The vendor firmware checks for a bmt header in the last 528 erase blocks of flash. The OpenWrt partition table did not respect that requirement, and therefore the vendor and openwrt chainloader fight over those blocks on every boot, potentially corrupting data stored in UBI blocks there. This commit increases the size of the reserved_bmt partition to avoid that fight. Although the vendor bootloader only seems to touch the final 250 erase blocks[1], the original vendor firmware system partition ended at 0x1be00000[2], so to be conservative, the consensus is to use that as the end of mtd2 (ubi) partition and leave the last 528 blocks for mtd3 (reserved_bmt). From https://openwrt.org/toh/gemtek/mxf-w1700k: [1] OEM bootlog: [ 5.324337] bmt pool size: 250 [2] OEM bootlog: [ 5.478927] 0x000008600000-0x00001be00000 : "system" Adds a compat_version to warn users to re-install to accomodate the shrunken mtd2 ubi partition. Fixed two nits suggested by Claude, zero padding a hex value and removed an extra space. Removed the wildcard setting of compat_version for other boards, as suggested by Robert Marko, set compat_version only for the w1700k. Reported-by: Loïc Yhuel <loic.yhuel@gmail.com> Signed-off-by: Russell Senior <russell@personaltelco.net> Link: https://github.com/openwrt/openwrt/pull/23061 Signed-off-by: Robert Marko <robimarko@gmail.com>
409 lines
7.0 KiB
Devicetree
409 lines
7.0 KiB
Devicetree
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
|
|
|
/dts-v1/;
|
|
|
|
#include <dt-bindings/leds/common.h>
|
|
#include <dt-bindings/gpio/gpio.h>
|
|
#include <dt-bindings/input/input.h>
|
|
#include "an7581.dtsi"
|
|
#include "an7581-npu-mt7996.dtsi"
|
|
|
|
/ {
|
|
model = "Gemtek W1700K (OpenWrt U-Boot layout)";
|
|
compatible = "gemtek,w1700k-ubi", "airoha,an7581", "airoha,en7581";
|
|
|
|
aliases {
|
|
serial0 = &uart1;
|
|
led-boot = &led_status_red;
|
|
led-failsafe = &led_status_blue;
|
|
led-upgrade = &led_status_blue;
|
|
led-running = &led_status_green;
|
|
};
|
|
|
|
chosen {
|
|
rootdisk = <&ubi_rootfs>;
|
|
bootargs = "console=ttyS0,115200 earlycon ubi.block=0,fit root=/dev/fit0 rootwait";
|
|
stdout-path = "serial0:115200n8";
|
|
};
|
|
|
|
keys {
|
|
compatible = "gpio-keys";
|
|
|
|
key-restart {
|
|
label = "reset";
|
|
gpios = <&en7581_pinctrl 0 GPIO_ACTIVE_LOW>;
|
|
linux,code = <KEY_RESTART>;
|
|
};
|
|
};
|
|
|
|
leds {
|
|
compatible = "gpio-leds";
|
|
|
|
led_status_green: led-0 {
|
|
color = <LED_COLOR_ID_GREEN>;
|
|
function = LED_FUNCTION_STATUS;
|
|
gpios = <&en7581_pinctrl 17 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led_status_blue: led-1 {
|
|
color = <LED_COLOR_ID_BLUE>;
|
|
function = LED_FUNCTION_STATUS;
|
|
gpios = <&en7581_pinctrl 19 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led_status_red: led-2 {
|
|
color = <LED_COLOR_ID_RED>;
|
|
function = LED_FUNCTION_STATUS;
|
|
gpios = <&en7581_pinctrl 29 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led_status_white: led-3 {
|
|
color = <LED_COLOR_ID_WHITE>;
|
|
function = LED_FUNCTION_STATUS;
|
|
gpios = <&en7581_pinctrl 20 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led-4 {
|
|
color = <LED_COLOR_ID_GREEN>;
|
|
function = LED_FUNCTION_LAN;
|
|
function-enumerator = <3>;
|
|
gpios = <&en7581_pinctrl 9 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led-5 {
|
|
color = <LED_COLOR_ID_YELLOW>;
|
|
function = LED_FUNCTION_LAN;
|
|
function-enumerator = <3>;
|
|
gpios = <&en7581_pinctrl 10 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led-6 {
|
|
color = <LED_COLOR_ID_GREEN>;
|
|
function = LED_FUNCTION_LAN;
|
|
function-enumerator = <4>;
|
|
gpios = <&en7581_pinctrl 27 GPIO_ACTIVE_LOW>;
|
|
};
|
|
|
|
led-7 {
|
|
color = <LED_COLOR_ID_YELLOW>;
|
|
function = LED_FUNCTION_LAN;
|
|
function-enumerator = <4>;
|
|
gpios = <&en7581_pinctrl 28 GPIO_ACTIVE_LOW>;
|
|
};
|
|
};
|
|
};
|
|
|
|
&en7581_pinctrl {
|
|
gpio-ranges = <&en7581_pinctrl 0 13 47>;
|
|
|
|
mdio_pins: mdio-pins {
|
|
mux {
|
|
function = "mdio";
|
|
groups = "mdio";
|
|
};
|
|
|
|
conf {
|
|
pins = "gpio2";
|
|
output-high;
|
|
};
|
|
};
|
|
|
|
pcie0_rst_pins: pcie0-rst-pins {
|
|
conf {
|
|
pins = "pcie_reset0";
|
|
drive-open-drain = <1>;
|
|
};
|
|
};
|
|
|
|
pcie2_rst_pins: pcie2-rst-pins {
|
|
conf {
|
|
pins = "pcie_reset2";
|
|
drive-open-drain = <1>;
|
|
};
|
|
};
|
|
|
|
/* W1700K does not use the built-in LED controller. Instead, it uses GPIO.
|
|
* The driver fails to probe without gswpX_led0_pins defined, so put a dummy
|
|
* here.
|
|
*/
|
|
|
|
gswp1_led0_pins: gswp1-led0-pins {
|
|
mux {
|
|
function = "phy1_led0";
|
|
pins = "gpio33";
|
|
};
|
|
};
|
|
|
|
gswp2_led0_pins: gswp2-led0-pins {
|
|
mux {
|
|
function = "phy2_led0";
|
|
pins = "gpio34";
|
|
};
|
|
};
|
|
|
|
uart2_pins: uart2-pins {
|
|
mux {
|
|
function = "uart";
|
|
groups = "uart2";
|
|
};
|
|
};
|
|
|
|
hsuart_pins: hsuart-pins {
|
|
mux {
|
|
function = "uart";
|
|
groups = "hsuart";
|
|
};
|
|
};
|
|
};
|
|
|
|
&snfi {
|
|
status = "okay";
|
|
};
|
|
|
|
&spi_nand {
|
|
#address-cells = <1>;
|
|
#size-cells = <1>;
|
|
partitions {
|
|
compatible = "fixed-partitions";
|
|
#address-cells = <1>;
|
|
#size-cells = <1>;
|
|
|
|
partition@0 {
|
|
label = "vendor";
|
|
reg = <0x00000000 0x00600000>;
|
|
read-only;
|
|
};
|
|
|
|
partition@600000 {
|
|
label = "chainloader";
|
|
reg = <0x00600000 0x00100000>;
|
|
read-only;
|
|
};
|
|
|
|
partition@700000 {
|
|
label = "ubi";
|
|
reg = <0x00700000 0x1b700000>;
|
|
compatible = "linux,ubi";
|
|
|
|
volumes {
|
|
ubi-volume-ubootenv {
|
|
volname = "ubootenv";
|
|
nvmem-layout {
|
|
compatible = "u-boot,env-redundant-bool";
|
|
};
|
|
};
|
|
|
|
ubi-volume-ubootenv2 {
|
|
volname = "ubootenv2";
|
|
nvmem-layout {
|
|
compatible = "u-boot,env-redundant-bool";
|
|
};
|
|
};
|
|
|
|
ubi_rootfs: ubi-volume-fit {
|
|
volname = "fit";
|
|
};
|
|
|
|
ubi_factory: ubi-volume-factory {
|
|
volname = "factory";
|
|
};
|
|
};
|
|
};
|
|
|
|
/* reserved for bad block table */
|
|
reserved_bmt@1be00000 {
|
|
label = "reserved_bmt";
|
|
reg = <0x1be00000 0x04200000>;
|
|
read-only;
|
|
};
|
|
};
|
|
};
|
|
|
|
&ubi_factory {
|
|
nvmem-layout {
|
|
compatible = "fixed-layout";
|
|
#address-cells = <1>;
|
|
#size-cells = <1>;
|
|
|
|
eeprom: eeprom@0 {
|
|
reg = <0x0 0x1e00>;
|
|
};
|
|
|
|
wan_mac: macaddr@5000 {
|
|
reg = <0x5000 0x6>;
|
|
};
|
|
|
|
lan_mac: macaddr@6000 {
|
|
compatible = "mac-base";
|
|
reg = <0x6000 0x6>;
|
|
#nvmem-cell-cells = <1>;
|
|
};
|
|
};
|
|
};
|
|
|
|
&i2c0 {
|
|
status = "okay";
|
|
|
|
hwmon@2e {
|
|
compatible = "nuvoton,nct7802";
|
|
reg = <0x2e>;
|
|
};
|
|
};
|
|
|
|
&pcie0 {
|
|
status = "okay";
|
|
|
|
airoha,x2-mode;
|
|
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&pcie0_rst_pins>;
|
|
pcie@0,0 {
|
|
reg = <0x0000 0 0 0 0>;
|
|
device_type = "pci";
|
|
#address-cells = <3>;
|
|
#size-cells = <2>;
|
|
|
|
mt7996@0,0 {
|
|
reg = <0x0000 0 0 0 0>;
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
nvmem-cells = <&eeprom>;
|
|
nvmem-cell-names = "eeprom";
|
|
airoha,npu = <&npu>;
|
|
airoha,eth = <ð>;
|
|
|
|
band@0 {
|
|
/* 2.4 GHz */
|
|
reg = <0>;
|
|
nvmem-cells = <&lan_mac 1>;
|
|
nvmem-cell-names = "mac-address";
|
|
};
|
|
|
|
band@1 {
|
|
/* 5 GHz */
|
|
reg = <1>;
|
|
nvmem-cells = <&lan_mac 2>;
|
|
nvmem-cell-names = "mac-address";
|
|
};
|
|
|
|
band@2 {
|
|
/* 6 GHz */
|
|
reg = <2>;
|
|
nvmem-cells = <&lan_mac 3>;
|
|
nvmem-cell-names = "mac-address";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
&pcie2 {
|
|
status = "okay";
|
|
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&pcie2_rst_pins>;
|
|
};
|
|
|
|
&npu {
|
|
status = "okay";
|
|
};
|
|
|
|
ð {
|
|
status = "okay";
|
|
};
|
|
|
|
&gdm1 {
|
|
status = "okay";
|
|
|
|
nvmem-cells = <&lan_mac 0>;
|
|
nvmem-cell-names = "mac-address";
|
|
};
|
|
|
|
&gdm2 {
|
|
status = "okay";
|
|
|
|
phy-handle = <&phy8>;
|
|
phy-mode = "usxgmii";
|
|
|
|
nvmem-cells = <&wan_mac 0>;
|
|
nvmem-cell-names = "mac-address";
|
|
openwrt,netdev-name = "wan";
|
|
};
|
|
|
|
&gdm4 {
|
|
status = "okay";
|
|
|
|
phy-handle = <&phy5>;
|
|
phy-mode = "usxgmii";
|
|
|
|
nvmem-cells = <&lan_mac 0>;
|
|
nvmem-cell-names = "mac-address";
|
|
openwrt,netdev-name = "lan2";
|
|
};
|
|
|
|
&switch {
|
|
status = "okay";
|
|
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&mdio_pins>;
|
|
|
|
mdio {
|
|
phy5: ethernet-phy@5 {
|
|
compatible = "ethernet-phy-ieee802.3-c45";
|
|
reg = <5>;
|
|
reset-gpios = <&en7581_pinctrl 46 GPIO_ACTIVE_LOW>;
|
|
reset-assert-us = <40000>;
|
|
reset-deassert-us = <150000>;
|
|
interrupt-parent = <&en7581_pinctrl>;
|
|
interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
|
|
realtek,pnswap-tx;
|
|
realtek,pnswap-rx;
|
|
};
|
|
|
|
phy8: ethernet-phy@8 {
|
|
compatible = "ethernet-phy-ieee802.3-c45";
|
|
reg = <8>;
|
|
reset-gpios = <&en7581_pinctrl 31 GPIO_ACTIVE_LOW>;
|
|
reset-assert-us = <40000>;
|
|
reset-deassert-us = <150000>;
|
|
interrupt-parent = <&en7581_pinctrl>;
|
|
interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
|
|
realtek,pnswap-tx;
|
|
realtek,pnswap-rx;
|
|
};
|
|
};
|
|
};
|
|
|
|
&gsw_phy1 {
|
|
status = "okay";
|
|
pinctrl-names = "gbe-led";
|
|
pinctrl-0 = <&gswp1_led0_pins>;
|
|
};
|
|
|
|
&gsw_port1 {
|
|
status = "okay";
|
|
label = "lan3";
|
|
};
|
|
|
|
&gsw_phy2 {
|
|
status = "okay";
|
|
pinctrl-names = "gbe-led";
|
|
pinctrl-0 = <&gswp2_led0_pins>;
|
|
};
|
|
|
|
&gsw_port2 {
|
|
status = "okay";
|
|
label = "lan4";
|
|
};
|
|
|
|
&uart2 {
|
|
status = "okay";
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&uart2_pins>;
|
|
};
|
|
|
|
&hsuart3 {
|
|
status = "okay";
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&hsuart_pins>;
|
|
};
|