[openwrt/openwrt] mediatek: filogic: prepare for ubootmod build of ASUS ZenWiFi BT8
LEDE Commits
lede-commits at lists.infradead.org
Sat Mar 29 18:03:56 PDT 2025
dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6f59e969e20d0c062d1678c2646762c86c237989
commit 6f59e969e20d0c062d1678c2646762c86c237989
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Thu Mar 13 22:10:40 2025 +0000
mediatek: filogic: prepare for ubootmod build of ASUS ZenWiFi BT8
Break out all flash-layout dependent parts from device tree into separate
dtsi file to be used by both, stock layout and upcoming ubootmod variant.
Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
.../mediatek/dts/mt7988d-asus-zenwifi-bt8.dts | 412 ++-------------------
...nwifi-bt8.dts => mt7988d-asus-zenwifi-bt8.dtsi} | 211 ++++-------
2 files changed, 100 insertions(+), 523 deletions(-)
diff --git a/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts b/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts
index ad12001c4e..b2cb1ceb72 100644
--- a/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts
+++ b/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts
@@ -1,296 +1,15 @@
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
-/dts-v1/;
-
-#include "mt7988a.dtsi"
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/leds/common.h>
-#include <dt-bindings/pinctrl/mt65xx.h>
-#include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
+#include "mt7988d-asus-zenwifi-bt8.dtsi"
/ {
model = "ASUS ZenWiFi BT8";
compatible = "asus,zenwifi-bt8", "mediatek,mt7988a";
- aliases {
- serial0 = &uart0;
- label-mac-device = &gmac0;
- led-boot = &led_status_green;
- led-failsafe = &led_status_red;
- led-running = &led_status_green;
- led-upgrade = &led_status_blue;
- };
-
chosen {
bootargs-override = "earlycon=uart8250,mmio32,0x11000000 console=ttyS0,115200n8";
stdout-path = "serial0:115200n8";
};
-
- memory {
- reg = <0x0 0x40000000 0x0 0x40000000>;
- };
-
- cpus {
- /delete-node/ cpu at 3;
- };
-
- reg_1p8v: regulator-1p8v {
- compatible = "regulator-fixed";
- regulator-name = "fixed-1.8V";
- regulator-min-microvolt = <1800000>;
- regulator-max-microvolt = <1800000>;
- regulator-boot-on;
- regulator-always-on;
- };
-
- reg_3p3v: regulator-3p3v {
- compatible = "regulator-fixed";
- regulator-name = "fixed-3.3V";
- regulator-min-microvolt = <3300000>;
- regulator-max-microvolt = <3300000>;
- regulator-boot-on;
- regulator-always-on;
- };
-
- gpio-keys {
- compatible = "gpio-keys";
- pinctrl-names = "default";
- pinctrl-0 = <&button_pins>;
-
- factory {
- label = "reset";
- linux,code = <KEY_RESTART>;
- gpios = <&pio 13 GPIO_ACTIVE_LOW>;
- };
-
- wps {
- label = "sync";
- linux,code = <KEY_WPS_BUTTON>;
- gpios = <&pio 14 GPIO_ACTIVE_LOW>;
- };
- };
-
- pwm-leds {
- compatible = "pwm-leds";
-
- led_status_red: led-0 {
- color = <LED_COLOR_ID_RED>;
- function = LED_FUNCTION_STATUS;
- pwms = <&pwm 0 10000>;
- };
-
- led_status_green: led-1 {
- color = <LED_COLOR_ID_GREEN>;
- function = LED_FUNCTION_STATUS;
- pwms = <&pwm 1 10000>;
- };
-
- led_status_blue: led-2 {
- color = <LED_COLOR_ID_BLUE>;
- function = LED_FUNCTION_STATUS;
- pwms = <&pwm 3 10000>;
- };
- };
-};
-
-&cpu0 {
- proc-supply = <&rt5190_buck3>;
-};
-
-&cpu1 {
- proc-supply = <&rt5190_buck3>;
-};
-
-&cpu2 {
- proc-supply = <&rt5190_buck3>;
-};
-
-&cci {
- proc-supply = <&rt5190_buck3>;
-};
-
-ð {
- pinctrl-names = "default";
- pinctrl-0 = <&mdio0_pins>;
- status = "okay";
-};
-
-&gmac0 {
- nvmem-cells = <&macaddr_factory_4>;
- nvmem-cell-names = "mac-address";
-
- status = "okay";
-};
-
-&gmac1 {
- phy-mode = "internal";
- phy-connection-type = "internal";
- phy = <&int_2p5g_phy>;
-
- nvmem-cells = <&macaddr_factory_a>;
- nvmem-cell-names = "mac-address";
-
- openwrt,netdev-name = "wan";
-
- status = "okay";
-};
-
-&int_2p5g_phy {
- pinctrl-names = "i2p5gbe-led";
- pinctrl-0 = <&i2p5gbe_led0_pins>;
-};
-
-&gmac2 {
- phy-mode = "2500base-x";
- phy = <&phy5>;
-
- nvmem-cells = <&macaddr_factory_4>;
- nvmem-cell-names = "mac-address";
-
- openwrt,netdev-name = "lan3";
-
- status = "okay";
-};
-
-&gsw_phy0 {
- status = "disabled";
-};
-
-&i2c0 {
- pinctrl-names = "default";
- pinctrl-0 = <&i2c0_pins>;
- status = "okay";
-
- rt5190a_64: rt5190a at 64 {
- compatible = "richtek,rt5190a";
- reg = <0x64>;
- /*interrupts-extended = <&gpio26 0 IRQ_TYPE_LEVEL_LOW>;*/
- vin2-supply = <&rt5190_buck1>;
- vin3-supply = <&rt5190_buck1>;
- vin4-supply = <&rt5190_buck1>;
-
- regulators {
- rt5190_buck1: buck1 {
- regulator-name = "rt5190a-buck1";
- regulator-min-microvolt = <5090000>;
- regulator-max-microvolt = <5090000>;
- regulator-allowed-modes =
- <RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>;
- regulator-boot-on;
- regulator-always-on;
- };
-
- buck2 {
- regulator-name = "vcore";
- regulator-min-microvolt = <600000>;
- regulator-max-microvolt = <1400000>;
- regulator-boot-on;
- regulator-always-on;
- };
-
- rt5190_buck3: buck3 {
- regulator-name = "vproc";
- regulator-min-microvolt = <600000>;
- regulator-max-microvolt = <1400000>;
- regulator-boot-on;
- };
-
- buck4 {
- regulator-name = "rt5190a-buck4";
- regulator-min-microvolt = <850000>;
- regulator-max-microvolt = <850000>;
- regulator-allowed-modes =
- <RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>;
- regulator-boot-on;
- regulator-always-on;
- };
-
- ldo {
- regulator-name = "rt5190a-ldo";
- regulator-min-microvolt = <1200000>;
- regulator-max-microvolt = <1200000>;
- regulator-boot-on;
- regulator-always-on;
- };
- };
- };
-};
-
-&mdio_bus {
- phy5: ethernet-phy at 5 {
- compatible = "ethernet-phy-ieee802.3-c45";
- reg = <5>;
-
- reset-gpios = <&pio 0 GPIO_ACTIVE_LOW>;
- reset-assert-us = <200000>;
- reset-deassert-us = <2000000>;
- };
-};
-
-&pcie0 {
- pinctrl-names = "default";
- pinctrl-0 = <&pcie0_1_pins>;
- reset-gpios = <&pio 7 GPIO_ACTIVE_LOW>;
- status = "okay";
-
- pcie at 0,0 {
- reg = <0x0000 0 0 0 0>;
-
- mt7996 at 0,0 {
- reg = <0x0000 0 0 0 0>;
- nvmem-cells = <&eeprom_factory_0>;
- nvmem-cell-names = "eeprom";
-
- band at 0 {
- /* 2.4 GHz */
- reg = <0>;
- nvmem-cells = <&macaddr_factory_fffee>;
- nvmem-cell-names = "mac-address";
- };
-
- band at 1 {
- /* 5 GHz */
- reg = <1>;
- nvmem-cells = <&macaddr_factory_ffff4>;
- nvmem-cell-names = "mac-address";
- };
-
- band at 2 {
- /* 6 GHz */
- reg = <2>;
- nvmem-cells = <&macaddr_factory_ffffa>;
- nvmem-cell-names = "mac-address";
- };
- };
- };
-};
-
-&pcie3 {
- pinctrl-names = "default";
- pinctrl-0 = <&pcie3_pins>;
- status = "okay";
-};
-
-&pio {
- button_pins: button-pins {
- pins = "GPIO_RESET", "GPIO_WPS";
- mediatek,pull-down-adv = <0>; /* bias-disable */
- };
-
- pcie0_1_pins: pcie0-pins-g1 {
- mux {
- function = "pcie";
- groups = "pcie_2l_0_pereset", "pcie_clk_req_n0_0";
- };
- };
-
- pwm_pins: pwm-pins {
- mux {
- function = "pwm";
- groups = "pwm0", "pwm1", "pwm3_0";
- };
- };
};
&spi0 {
@@ -332,113 +51,46 @@
};
&ubi_factory {
- nvmem-layout {
- compatible = "fixed-layout";
- #address-cells = <1>;
- #size-cells = <1>;
-
- macaddr_factory_4: macaddr at 4 {
- reg = <0x4 0x6>;
- };
-
- macaddr_factory_a: macaddr at a {
- reg = <0xa 0x6>;
- };
-
- macaddr_factory_fffee: macaddr at fffee {
- reg = <0xfffee 0x6>;
- };
-
- macaddr_factory_ffff4: macaddr at ffff4 {
- reg = <0xffff4 0x6>;
- };
-
- macaddr_factory_ffffa: macaddr at ffffa {
- reg = <0xffffa 0x6>;
- };
-
- pin at 101180 {
- reg = <0x101180 0x8>;
- };
-
- hwid at 110e00 {
- reg = <0x110e00 0x1>;
- };
-
- hwrev at 110e04 {
- reg = <0x110e04 0x4>;
- };
-
- board at 110e0c {
- reg = <0x110e0c 0x20>;
- };
-
- mfgdate at 110e3e {
- reg = <0x110e3e 0x8>;
- };
-
- market at 110f90 {
- reg = <0x110f90 0x5>;
- };
-
- model at 110fb0 {
- reg = <0x110fb0 0x10>;
- };
-
- serial at 110ff0 {
- reg = <0x110ff0 0x10>;
- };
-
- eeprom-version at 15480f {
- reg = <0x15480f 0x1>;
- };
- };
+ ASUS_BT8_NVMEM_LAYOUT;
};
-&ssusb1 {
- status = "okay";
+&gmac0 {
+ nvmem-cells = <&macaddr_factory_4>;
+ nvmem-cell-names = "mac-address";
};
-&switch {
- status = "okay";
-
- ports {
- port at 0 {
- status = "disabled";
- };
-
- port at 1 {
- label = "lan2";
- };
-
- port at 2 {
- label = "lan1";
- };
-
- port at 3 {
- status = "disabled";
- };
- };
+&gmac1 {
+ nvmem-cells = <&macaddr_factory_a>;
+ nvmem-cell-names = "mac-address";
};
-&tphy {
- status = "okay";
+&gmac2 {
+ nvmem-cells = <&macaddr_factory_4>;
+ nvmem-cell-names = "mac-address";
};
-&uart0 {
- status = "okay";
-};
+&mt7996_wifi {
+ nvmem-cells = <&eeprom_factory_0>;
+ nvmem-cell-names = "eeprom";
-&watchdog {
- status = "okay";
-};
+ band at 0 {
+ /* 2.4 GHz */
+ reg = <0>;
+ nvmem-cells = <&macaddr_factory_fffee>;
+ nvmem-cell-names = "mac-address";
+ };
-&xphy {
- status = "okay";
-};
+ band at 1 {
+ /* 5 GHz */
+ reg = <1>;
+ nvmem-cells = <&macaddr_factory_ffff4>;
+ nvmem-cell-names = "mac-address";
+ };
-&pwm {
- pinctrl-names = "default";
- pinctrl-0 = <&pwm_pins>;
- status = "okay";
+ band at 2 {
+ /* 6 GHz */
+ reg = <2>;
+ nvmem-cells = <&macaddr_factory_ffffa>;
+ nvmem-cell-names = "mac-address";
+ };
};
diff --git a/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts b/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dtsi
similarity index 67%
copy from target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts
copy to target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dtsi
index ad12001c4e..a8de1ee99a 100644
--- a/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts
+++ b/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dtsi
@@ -9,10 +9,74 @@
#include <dt-bindings/pinctrl/mt65xx.h>
#include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
-/ {
- model = "ASUS ZenWiFi BT8";
- compatible = "asus,zenwifi-bt8", "mediatek,mt7988a";
+#define ASUS_BT8_NVMEM_LAYOUT \
+ nvmem-layout { \
+ compatible = "fixed-layout"; \
+ #address-cells = <1>; \
+ #size-cells = <1>; \
+ \
+ eeprom_factory_0: eeprom at 0 { \
+ reg = <0x0 0x1e00>; \
+ }; \
+ \
+ macaddr_factory_4: macaddr at 4 { \
+ reg = <0x4 0x6>; \
+ }; \
+ \
+ macaddr_factory_a: macaddr at a { \
+ reg = <0xa 0x6>; \
+ }; \
+ \
+ macaddr_factory_fffee: macaddr at fffee { \
+ reg = <0xfffee 0x6>; \
+ }; \
+ \
+ macaddr_factory_ffff4: macaddr at ffff4 { \
+ reg = <0xffff4 0x6>; \
+ }; \
+ \
+ macaddr_factory_ffffa: macaddr at ffffa { \
+ reg = <0xffffa 0x6>; \
+ }; \
+ \
+ pin at 101180 { \
+ reg = <0x101180 0x8>; \
+ }; \
+ \
+ hwid at 110e00 { \
+ reg = <0x110e00 0x1>; \
+ }; \
+ \
+ hwrev at 110e04 { \
+ reg = <0x110e04 0x4>; \
+ }; \
+ \
+ board at 110e0c { \
+ reg = <0x110e0c 0x20>; \
+ }; \
+ \
+ mfgdate at 110e3e { \
+ reg = <0x110e3e 0x8>; \
+ }; \
+ \
+ market at 110f90 { \
+ reg = <0x110f90 0x5>; \
+ }; \
+ \
+ model at 110fb0 { \
+ reg = <0x110fb0 0x10>; \
+ }; \
+ \
+ serial at 110ff0 { \
+ reg = <0x110ff0 0x10>; \
+ }; \
+ \
+ eeprom-version at 15480f { \
+ reg = <0x15480f 0x1>; \
+ }; \
+ }
+/ {
aliases {
serial0 = &uart0;
label-mac-device = &gmac0;
@@ -22,11 +86,6 @@
led-upgrade = &led_status_blue;
};
- chosen {
- bootargs-override = "earlycon=uart8250,mmio32,0x11000000 console=ttyS0,115200n8";
- stdout-path = "serial0:115200n8";
- };
-
memory {
reg = <0x0 0x40000000 0x0 0x40000000>;
};
@@ -117,9 +176,6 @@
};
&gmac0 {
- nvmem-cells = <&macaddr_factory_4>;
- nvmem-cell-names = "mac-address";
-
status = "okay";
};
@@ -128,9 +184,6 @@
phy-connection-type = "internal";
phy = <&int_2p5g_phy>;
- nvmem-cells = <&macaddr_factory_a>;
- nvmem-cell-names = "mac-address";
-
openwrt,netdev-name = "wan";
status = "okay";
@@ -145,9 +198,6 @@
phy-mode = "2500base-x";
phy = <&phy5>;
- nvmem-cells = <&macaddr_factory_4>;
- nvmem-cell-names = "mac-address";
-
openwrt,netdev-name = "lan3";
status = "okay";
@@ -237,31 +287,8 @@
pcie at 0,0 {
reg = <0x0000 0 0 0 0>;
- mt7996 at 0,0 {
+ mt7996_wifi: mt7996 at 0,0 {
reg = <0x0000 0 0 0 0>;
- nvmem-cells = <&eeprom_factory_0>;
- nvmem-cell-names = "eeprom";
-
- band at 0 {
- /* 2.4 GHz */
- reg = <0>;
- nvmem-cells = <&macaddr_factory_fffee>;
- nvmem-cell-names = "mac-address";
- };
-
- band at 1 {
- /* 5 GHz */
- reg = <1>;
- nvmem-cells = <&macaddr_factory_ffff4>;
- nvmem-cell-names = "mac-address";
- };
-
- band at 2 {
- /* 6 GHz */
- reg = <2>;
- nvmem-cells = <&macaddr_factory_ffffa>;
- nvmem-cell-names = "mac-address";
- };
};
};
};
@@ -293,108 +320,6 @@
};
};
-&spi0 {
- pinctrl-names = "default";
- pinctrl-0 = <&spi0_flash_pins>;
- status = "okay";
-
- spi_nand: spi_nand at 0 {
- compatible = "u-boot-dont-touch-spi-nand";
- reg = <0>;
- spi-max-frequency = <52000000>;
- spi-tx-buswidth = <4>;
- spi-rx-buswidth = <4>;
-
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
-
- partition at 0 {
- reg = <0x0 0x400000>;
- label = "Bootloader";
- read-only;
- };
-
- partition at 400000 {
- reg = <0x400000 0x7c00000>;
- compatible = "linux,ubi";
- label = "UBI_DEV";
-
- volumes {
- ubi_factory: ubi-volume-factory {
- volname = "Factory";
- };
- };
- };
- };
- };
-};
-
-&ubi_factory {
- nvmem-layout {
- compatible = "fixed-layout";
- #address-cells = <1>;
- #size-cells = <1>;
-
- macaddr_factory_4: macaddr at 4 {
- reg = <0x4 0x6>;
- };
-
- macaddr_factory_a: macaddr at a {
- reg = <0xa 0x6>;
- };
-
- macaddr_factory_fffee: macaddr at fffee {
- reg = <0xfffee 0x6>;
- };
-
- macaddr_factory_ffff4: macaddr at ffff4 {
- reg = <0xffff4 0x6>;
- };
-
- macaddr_factory_ffffa: macaddr at ffffa {
- reg = <0xffffa 0x6>;
- };
-
- pin at 101180 {
- reg = <0x101180 0x8>;
- };
-
- hwid at 110e00 {
- reg = <0x110e00 0x1>;
- };
-
- hwrev at 110e04 {
- reg = <0x110e04 0x4>;
- };
-
- board at 110e0c {
- reg = <0x110e0c 0x20>;
- };
-
- mfgdate at 110e3e {
- reg = <0x110e3e 0x8>;
- };
-
- market at 110f90 {
- reg = <0x110f90 0x5>;
- };
-
- model at 110fb0 {
- reg = <0x110fb0 0x10>;
- };
-
- serial at 110ff0 {
- reg = <0x110ff0 0x10>;
- };
-
- eeprom-version at 15480f {
- reg = <0x15480f 0x1>;
- };
- };
-};
-
&ssusb1 {
status = "okay";
};
More information about the lede-commits
mailing list