Files
eternalwrt-mt798x/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts
T
Zoltan SzalayandJonas Jelonek 2644302c14 ath79: fix u-boot-env nvmem-layout on enterasys,ws-ap3705i
The u-boot-env0 partition on this board stores a redundant U-Boot
environment (4-byte CRC32 + 1-byte flag + data), with the flag byte
differing between the u-boot-env0/u-boot-env1 copies (0x00 vs 0x01).
The actual environment size used by U-Boot for the CRC calculation is
0x1000 bytes, not the full 0x10000 byte partition.

The DTS declared this as the plain, non-redundant "u-boot,env" layout
with no env-size, so the kernel's u-boot-env nvmem-layout driver
miscomputes the CRC and fails to probe:

  u-boot-env-layout ...nvmem-layout: Invalid calculated CRC32: 0xbc490a68 (expected: 0xfae56b95)
  u-boot-env-layout ...nvmem-layout: probe with driver u-boot-env-layout failed with error -22

Because the probe fails, the macaddr_uboot_ethaddr nvmem cell is never
created, so eth0's nvmem-cells reference never resolves and the
ag71xx-legacy platform device is stuck in "deferred probe pending"
forever - the device boots with no functioning Ethernet interface at
all.

Switch to "u-boot,env-redundant-count" (matching the redundant-env
layout already used on other boards from this vendor lineage, e.g.
qca9557_extreme-networks_ws-ap3805i.dts) and set env-size to the
verified 0x1000, which fixes CRC validation and lets eth0 probe
successfully.

Verified on real hardware: before the fix, eth0 never comes up
(confirmed against the official 25.12.5 release, matching CRC values
exactly); after the fix, eth0 links up normally and dmesg is free of
any CRC/nvmem-layout errors.

Signed-off-by: Zoltan Szalay <dealer@ddsweb.hu>
Signed-off-by: Zoltan Szalay <szazo@halycomp.hu>
Link: https://github.com/openwrt/openwrt/pull/24134
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-15 20:13:11 +02:00

250 lines
4.1 KiB
Devicetree

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "ar9344.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
compatible = "enterasys,ws-ap3705i", "qca,ar9344";
model = "Enterasys WS-AP3705i";
chosen {
bootargs = "console=ttyS0,115200n8";
};
aliases {
led-boot = &led_power_green;
led-failsafe = &led_power_red;
led-running = &led_power_green;
led-upgrade = &led_power_red;
label-mac-device = &eth0;
};
mtd-concat {
compatible = "mtd-concat";
devices = <&fwconcat0 &fwconcat1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x0 0x1dd0000>;
};
};
};
leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&enable_gpio_11 &enable_gpio_16>;
led_power_green: power_green {
function = LED_FUNCTION_POWER;
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
};
led_power_red: power_red {
function = LED_FUNCTION_POWER;
color = <LED_COLOR_ID_RED>;
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};
lan_blue {
function = LED_FUNCTION_LAN;
color = <LED_COLOR_ID_BLUE>;
gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
};
lan_green {
function = LED_FUNCTION_LAN;
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
};
};
keys {
compatible = "gpio-keys";
reset {
label = "Reset button";
linux,code = <KEY_RESTART>;
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
};
};
};
&ref {
clock-frequency = <40000000>;
};
&pinmux {
enable_gpio_16: pinmux_enable_gpio_16 {
pinctrl-single,bits = <0x10 0x0 0x000000ff>;
};
enable_gpio_11: pinmux_enable_gpio_11 {
pinctrl-single,bits = <0x8 0x0 0xff000000>;
};
};
&wmac {
status = "okay";
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
led {
led-sources = <11>;
led-active-low;
};
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot-bak";
reg = <0x0 0x80000>;
read-only;
};
partition@80000 {
label = "u-boot-env0";
reg = <0x80000 0x10000>;
read-only;
nvmem-layout {
compatible = "u-boot,env-redundant-count";
env-size = <0x1000>;
macaddr_uboot_ethaddr: ethaddr {
};
};
};
partition@90000 {
label = "u-boot-env1";
reg = <0x90000 0x10000>;
read-only;
};
partition@a0000 {
label = "u-boot";
reg = <0xa0000 0x80000>;
read-only;
};
partition@120000 {
label = "calibrate";
reg = <0x120000 0x10000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
cal_art_5000: calibration@5000 {
reg = <0x5000 0x440>;
};
};
};
partition@130000 {
label = "nvram";
reg = <0x130000 0x100000>;
read-only;
};
fwconcat0: partition@230000 {
label = "fwconcat0";
reg = <0x230000 0xdd0000>;
};
};
};
flash@1 {
compatible = "jedec,spi-nor";
reg = <1>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
fwconcat1: partition@0 {
label = "fwconcat1";
reg = <0x0 0x1000000>;
};
};
};
};
&pcie {
status = "okay";
wifi@0,0 {
compatible = "pci168c,0033";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&cal_art_5000>;
nvmem-cell-names = "calibration";
led {
led-sources = <0>;
led-active-low;
};
};
};
&mdio0 {
status = "okay";
phy0: ethernet-phy@0 {
reg = <0>;
};
};
&eth0 {
status = "okay";
pll-data = <0x1e000000 0x08000101 0x08001313>;
phy-mode = "rgmii";
phy-handle = <&phy0>;
nvmem-cells = <&macaddr_uboot_ethaddr>;
nvmem-cell-names = "mac-address";
gmac-config {
device = <&gmac>;
rgmii-gmac0 = <1>;
rxd-delay = <0>;
rxdv-delay = <0>;
txen-delay = <0>;
txd-delay = <0>;
};
};