Files
openwrt/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts
Stefan Dösinger e7ed87b83b ramips: fix TP-Link mr600 radio partition offset
This makes 5ghz WiFi work out of the box on these devices, eliminating
the need to flash a magic blob to the radio partition.

This was found by user BulldozerBSG on the OpenWRT Forums:
https://forum.openwrt.org/t/tp-link-archer-mr600-exploration/65489/20
All credit belongs to them. I can confirm the correctness of the
findings. At least one other user (Iggy87100) confirmed them too.

Signed-off-by: Stefan Dösinger <stefandoesinger@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19790
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-23 18:11:24 +02:00

238 lines
4.5 KiB
Plaintext

// SPDX-License-Identifier: GPL-2.0-or-later
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
compatible = "tplink,mr600-v2-eu", "mediatek,mt7621-soc";
model = "TP-Link MR600 v2 (EU)";
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
label-mac-device = &gmac0;
};
chosen {
bootargs = "console=ttyS0,115200";
};
keys {
compatible = "gpio-keys";
wlan {
label = "wlan";
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WLAN>;
};
reset {
label = "reset";
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
leds {
compatible = "gpio-leds";
led_power: power {
function = LED_FUNCTION_POWER;
color = <LED_COLOR_ID_WHITE>;
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
};
wlan {
function = LED_FUNCTION_WLAN;
color = <LED_COLOR_ID_WHITE>;
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
wan {
function = LED_FUNCTION_WAN;
color = <LED_COLOR_ID_WHITE>;
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
};
signal1 {
label = "white:signal1";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
};
signal2 {
label = "white:signal2";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
};
signal3 {
label = "white:signal3";
gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
};
4g {
label = "white:4g";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
};
lan {
function = LED_FUNCTION_LAN;
color = <LED_COLOR_ID_WHITE>;
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
};
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "uboot";
reg = <0x00000 0x20000>;
read-only;
};
partition@20000 {
compatible = "openwrt,uimage";
openwrt,offset = <512>; /* account for the 512-byte long header */
label = "firmware";
reg = <0x20000 0xfa0000>;
};
partition@fc0000 {
label = "romfile";
reg = <0xfc0000 0x10000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
macaddr_romfile_f100: romfile@f100 {
compatible = "mac-base";
reg = <0xf100 0x6>;
#nvmem-cell-cells = <1>;
};
};
};
partition@fd0000 {
label = "config";
reg = <0xfd0000 0x10000>;
read-only;
};
/* The boot log of the stock kernel suggests the radio partition is at
* 0xfe0000, but this is wrong. The U-Boot log lists it at 0xff0000. The
* WiFi driver's log output indicates the calibration data is read from a
* hardcoded 0xff0000, ignoring mtd partitions:
*
* 0x000000fe0000-0x000000ff0000 : "radio" <- WRONG
* ...
* MT7603E--> #### read 2.4G cal from flash !! ####
* spiflash_ioctl_read, Read from 0x00ff0000 length 0x10000, ...
*
* Manual inspection shows 0xfe0000 is empty (0xff) bytes. 0xff0000 contains
* the data we want. */
partition@fe0000 {
label = "filler";
reg = <0xfe0000 0x10000>;
};
partition@ff0000 {
label = "radio";
reg = <0xff0000 0x10000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
eeprom_radio_0: eeprom@0 {
reg = <0x0 0x400>;
};
eeprom_radio_8000: eeprom@8000 {
reg = <0x8000 0x4da8>;
};
};
};
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_radio_0>, <&macaddr_romfile_f100 0>;
nvmem-cell-names = "eeprom", "mac-address";
ieee80211-freq-limit = <2400000 2500000>;
};
};
&pcie1 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
ieee80211-freq-limit = <5000000 6000000>;
nvmem-cells = <&eeprom_radio_8000>, <&macaddr_romfile_f100 (-1)>;
nvmem-cell-names = "eeprom", "mac-address";
};
};
&gmac0 {
nvmem-cells = <&macaddr_romfile_f100 0>;
nvmem-cell-names = "mac-address";
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
nvmem-cells = <&macaddr_romfile_f100 0>;
nvmem-cell-names = "mac-address";
};
&ethphy4 {
/delete-property/ interrupts;
};
&switch0 {
ports {
port@1 {
status = "okay";
label = "lan1";
};
port@2 {
status = "okay";
label = "lan2";
};
port@3 {
status = "okay";
label = "lan3";
};
};
};