ath79: sync official source code

This commit is contained in:
AmadeusGhost 2021-01-30 12:20:16 +08:00
parent 50d57a982c
commit 99ffe186a1
34 changed files with 1330 additions and 933 deletions

View File

@ -52,7 +52,7 @@
virtual_flash {
compatible = "mtd-concat";
devices = <&firmware1 &firmware2>;
devices = <&fwconcat0 &fwconcat1>;
partitions {
compatible = "fixed-partitions";
@ -109,8 +109,8 @@
read-only;
};
firmware2: partition@b0000 {
label = "firmware2";
fwconcat1: partition@b0000 {
label = "fwconcat1";
reg = <0xb0000 0xf0000>;
};
@ -120,8 +120,8 @@
read-only;
};
firmware1: partition@1b0000 {
label = "firmware1";
fwconcat0: partition@1b0000 {
label = "fwconcat0";
reg = <0x1b0000 0x4c0000>;
};

View File

@ -52,7 +52,7 @@
virtual_flash {
compatible = "mtd-concat";
devices = <&firmware1 &firmware2>;
devices = <&fwconcat0 &fwconcat1>;
partitions {
compatible = "fixed-partitions";
@ -109,8 +109,8 @@
read-only;
};
firmware2: partition@b0000 {
label = "firmware2";
fwconcat1: partition@b0000 {
label = "fwconcat1";
reg = <0xb0000 0xf0000>;
};
@ -120,8 +120,8 @@
read-only;
};
firmware1: partition@1b0000 {
label = "firmware1";
fwconcat0: partition@1b0000 {
label = "fwconcat0";
reg = <0x1b0000 0x4c0000>;
};

View File

@ -1,35 +1,11 @@
// 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/mtd/partitions/uimage.h>
#include "ar9344_engenius_exx600.dtsi"
/ {
model = "EnGenius ECB600";
compatible = "engenius,ecb600", "qca,ar9344";
aliases {
label-mac-device = &eth0;
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
serial0 = &uart;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
linux,code = <KEY_RESTART>;
};
};
leds {
compatible = "gpio-leds";
@ -45,161 +21,20 @@
linux,default-trigger = "phy0tpt";
};
};
ath9k-leds {
compatible = "gpio-leds";
wifi2g {
label = "blue:wifi2g";
gpios = <&ath9k 0 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
};
virtual_flash {
compatible = "mtd-concat";
devices = <&firmware1 &firmware2>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
compatible = "openwrt,uimage", "denx,uimage";
openwrt,ih-magic = <IH_MAGIC_OKLI>;
label = "firmware";
reg = <0x0 0x0>;
};
};
};
};
&ref {
clock-frequency = <40000000>;
};
&uart {
status = "okay";
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <40000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
partition@50000 {
label = "custom";
reg = <0x050000 0x050000>;
read-only;
};
partition@a0000 {
label = "loader";
reg = <0x0a0000 0x010000>;
read-only;
};
firmware2: partition@b0000 {
label = "firmware2";
reg = <0x0b0000 0x170000>;
};
partition@220000 {
label = "fakeroot";
reg = <0x220000 0x010000>;
read-only;
};
firmware1: partition@230000 {
label = "firmware1";
reg = <0x230000 0xbc0000>;
};
partition@df0000 {
label = "failsafe";
reg = <0xdf0000 0x200000>;
read-only;
};
art: partition@ff0000 {
label = "art";
reg = <0xff0000 0x010000>;
read-only;
};
};
};
};
&mdio0 {
status = "okay";
phy0: ethernet-phy@0 {
reg = <0>;
eee-broken-100tx;
eee-broken-1000t;
};
};
&eth0 {
status = "okay";
mtd-mac-address = <&art 0x0>;
phy-handle = <&phy0>;
phy-mode = "rgmii-id";
pll-data = <0x02000000 0x00000101 0x00001313>;
gmac-config {
device = <&gmac>;
rgmii-gmac0 = <1>;
rxdv-delay = <3>;
rxd-delay = <3>;
};
};
&pcie {
status = "okay";
ath9k: wifi@0,0,0 {
compatible = "pci168c,0030";
reg = <0x0 0 0 0 0>;
qca,no-eeprom;
qca,disable-5ghz;
wifi@0,0,0 {
mtd-mac-address = <&art 0x0>;
mtd-mac-address-increment = <(-2)>;
#gpio-cells = <2>;
gpio-controller;
};
};
&wmac {
status = "okay";
qca,disable-2ghz;
mtd-cal-data = <&art 0x1000>;
mtd-mac-address = <&art 0x0>;
mtd-mac-address-increment = <(-1)>;
};

View File

@ -0,0 +1,180 @@
// 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/mtd/partitions/uimage.h>
/ {
aliases {
label-mac-device = &eth0;
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
serial0 = &uart;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
linux,code = <KEY_RESTART>;
};
};
ath9k-leds {
compatible = "gpio-leds";
wifi2g {
label = "blue:wifi2g";
gpios = <&ath9k 0 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
};
virtual_flash {
compatible = "mtd-concat";
devices = <&fwconcat0 &fwconcat1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
compatible = "openwrt,uimage", "denx,uimage";
openwrt,ih-magic = <IH_MAGIC_OKLI>;
label = "firmware";
reg = <0x0 0x0>;
};
};
};
};
&ref {
clock-frequency = <40000000>;
};
&uart {
status = "okay";
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <40000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
partition@50000 {
label = "custom";
reg = <0x050000 0x050000>;
read-only;
};
partition@a0000 {
label = "loader";
reg = <0x0a0000 0x010000>;
read-only;
};
fwconcat1: partition@b0000 {
label = "fwconcat1";
reg = <0x0b0000 0x170000>;
};
partition@220000 {
label = "fakeroot";
reg = <0x220000 0x010000>;
read-only;
};
fwconcat0: partition@230000 {
label = "fwconcat0";
reg = <0x230000 0xbc0000>;
};
partition@df0000 {
label = "failsafe";
reg = <0xdf0000 0x200000>;
read-only;
};
art: partition@ff0000 {
label = "art";
reg = <0xff0000 0x010000>;
read-only;
};
};
};
};
&mdio0 {
status = "okay";
phy0: ethernet-phy@0 {
reg = <0>;
eee-broken-100tx;
eee-broken-1000t;
};
};
&eth0 {
status = "okay";
phy-handle = <&phy0>;
phy-mode = "rgmii-id";
pll-data = <0x02000000 0x00000101 0x00001313>;
gmac-config {
device = <&gmac>;
rgmii-gmac0 = <1>;
rxdv-delay = <3>;
rxd-delay = <3>;
};
};
&pcie {
status = "okay";
ath9k: wifi@0,0,0 {
compatible = "pci168c,0030";
reg = <0x0 0 0 0 0>;
qca,disable-5ghz;
qca,no-eeprom;
#gpio-cells = <2>;
gpio-controller;
};
};
&wmac {
status = "okay";
qca,disable-2ghz;
mtd-cal-data = <&art 0x1000>;
};

View File

@ -0,0 +1,46 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "ar9344_openmesh_mr600.dtsi"
/ {
compatible = "openmesh,mr600-v1", "qca,ar9344";
model = "OpenMesh MR600 v1";
aliases {
led-boot = &led_power_orange;
led-failsafe = &led_power_orange;
led-running = &led_power_orange;
led-upgrade = &led_power_orange;
};
leds {
compatible = "gpio-leds";
wifi5g_green {
label = "green:wifi5g";
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
wps_blue {
label = "blue:wps";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
};
led_power_orange: power_orange {
label = "orange:power";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
default-state = "on";
};
};
leds-ath9k {
compatible = "gpio-leds";
wifi2g {
label = "blue:wifi2g";
gpios = <&ath9k 0 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
};
};

View File

@ -0,0 +1,71 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "ar9344_openmesh_mr600.dtsi"
/ {
compatible = "openmesh,mr600-v2", "qca,ar9344";
model = "OpenMesh MR600 v2";
aliases {
led-boot = &led_power_blue;
led-failsafe = &led_power_blue;
led-running = &led_power_blue;
led-upgrade = &led_power_blue;
};
leds {
compatible = "gpio-leds";
wifi5g_red {
label = "red:wifi5g";
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
};
wps_blue {
label = "blue:wps";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
};
led_power_blue: power_blue {
label = "blue:power";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
default-state = "on";
};
wifi2g_green {
label = "green:wifi2g";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
wifi2g_yellow {
label = "yellow:wifi2g";
gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
};
wifi2g_red {
label = "red:wifi2g";
gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
};
wifi5g_green {
label = "green:wifi5g";
gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
wifi5g_yellow {
label = "yellow:wifi5g";
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
};
};
watchdog {
compatible = "linux,wdt-gpio";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
hw_algo = "toggle";
/* hw_margin_ms is actually 300s but driver limits it to 60s */
hw_margin_ms = <60000>;
always-running;
};
};

View File

@ -0,0 +1,135 @@
// 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>
/ {
chosen {
/delete-property/ bootargs;
};
aliases {
serial0 = &uart;
label-mac-device = &eth0;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
};
};
};
&ref {
clock-frequency = <40000000>;
};
&uart {
status = "okay";
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <40000000>;
/* partitions are passed via bootloader */
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
partition@50000 {
label = "custom";
reg = <0x050000 0x060000>;
read-only;
};
partition@b0000 {
label = "inactive";
reg = <0x0b0000 0x7a0000>;
};
partition@850000 {
label = "inactive2";
reg = <0x850000 0x7a0000>;
};
art: partition@ff0000 {
label = "ART";
reg = <0xff0000 0x010000>;
read-only;
};
};
};
};
&mdio0 {
status = "okay";
phy-mask = <0x1>;
phy0: ethernet-phy@0 {
reg = <0>;
eee-broken-100tx;
eee-broken-1000t;
};
};
&eth0 {
status = "okay";
pll-data = <0x02000000 0x00000101 0x00001313>;
mtd-mac-address = <&art 0x0>;
phy-mode = "rgmii-id";
phy-handle = <&phy0>;
gmac-config {
device = <&gmac>;
rgmii-gmac0 = <1>;
rxdv-delay = <3>;
rxd-delay = <3>;
};
};
&wmac {
status = "okay";
mtd-cal-data = <&art 0x1000>;
mtd-mac-address = <&art 0x0>;
mtd-mac-address-increment = <1>;
};
&pcie {
status = "okay";
ath9k: wifi@0,0 {
compatible = "pci168c,0030";
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
mtd-mac-address = <&art 0x0>;
mtd-mac-address-increment = <8>;
};
};

View File

@ -44,7 +44,7 @@
virtual_flash {
compatible = "mtd-concat";
devices = <&concat0 &concat1>;
devices = <&fwconcat0 &fwconcat1>;
partitions {
compatible = "fixed-partitions";
@ -135,8 +135,8 @@
read-only;
};
concat0: partition@60000 {
label = "reserved1";
fwconcat0: partition@60000 {
label = "fwconcat0";
reg = <0x060000 0xf90000>;
};
@ -158,8 +158,8 @@
#address-cells = <1>;
#size-cells = <1>;
concat1: partition@0 {
label = "reserved2";
fwconcat1: partition@0 {
label = "fwconcat1";
reg = <0x0 0x1000000>;
};
};

View File

@ -0,0 +1,187 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/mtd/partitions/uimage.h>
/ {
compatible = "engenius,eap1200h", "qca,qca9557";
model = "EnGenius EAP1200H";
aliases {
label-mac-device = &eth0;
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
linux,code = <KEY_RESTART>;
};
};
leds {
compatible = "gpio-leds";
led_power: power {
label = "amber:power";
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
default-state = "on";
};
wifi2g {
label = "blue:wifi2g";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
wifi5g {
label = "green:wifi5g";
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
wps {
label = "blue:wps";
gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
};
};
virtual_flash {
compatible = "mtd-concat";
devices = <&fwconcat0 &fwconcat1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
compatible = "openwrt,uimage", "denx,uimage";
openwrt,ih-magic = <IH_MAGIC_OKLI>;
label = "firmware";
reg = <0x0 0x0>;
};
};
};
};
&uart {
status = "okay";
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <40000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
partition@50000 {
label = "custom";
reg = <0x050000 0x050000>;
read-only;
};
partition@a0000 {
label = "loader";
reg = <0x0a0000 0x010000>;
read-only;
};
fwconcat1: partition@b0000 {
label = "fwconcat1";
reg = <0x0b0000 0x170000>;
};
partition@220000 {
label = "fakeroot";
reg = <0x220000 0x010000>;
read-only;
};
fwconcat0: partition@230000 {
label = "fwconcat0";
reg = <0x230000 0xb40000>;
};
partition@d70000 {
label = "failsafe";
reg = <0xd70000 0x280000>;
read-only;
};
art: partition@ff0000 {
label = "art";
reg = <0xff0000 0x010000>;
read-only;
};
};
};
};
&mdio0 {
status = "okay";
phy5: ethernet-phy@5 {
reg = <5>;
eee-broken-100tx;
eee-broken-1000t;
};
};
&eth0 {
status = "okay";
mtd-mac-address = <&art 0x0>;
phy-handle = <&phy5>;
phy-mode = "rgmii-id";
pll-data = <0x82000000 0x80000101 0x80001313>;
};
&pcie0 {
status = "okay";
wifi@0,0,0 {
compatible = "qcom,ath10k";
reg = <0x0 0 0 0 0>;
qca,no-eeprom;
};
};
&wmac {
status = "okay";
mtd-cal-data = <&art 0x1000>;
mtd-mac-address = <&art 0x0>;
mtd-mac-address-increment = <1>;
};

View File

@ -1,140 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "qca955x_engenius_ecb1xxx.dtsi"
/ {
compatible = "engenius,ecb1200", "qca,qca9557";
model = "EnGenius ECB1200";
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
debounce-interval = <60>;
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
leds {
compatible = "gpio-leds";
led_power: power {
label = "amber:power";
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
default-state = "on";
};
wifi2g {
label = "blue:wifi2g";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
wifi5g {
label = "blue:wifi5g";
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
};
};
&uart {
status = "okay";
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <40000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x050000 0xf50000>;
};
partition@fa0000 {
label = "userconfig";
reg = <0xfa0000 0x050000>;
read-only;
};
partition@ff0000 {
label = "art";
reg = <0xff0000 0x010000>;
read-only;
};
};
};
};
&mdio0 {
status = "okay";
phy5: ethernet-phy@5 {
reg = <5>;
eee-broken-100tx;
eee-broken-1000t;
};
};
&eth0 {
status = "okay";
phy-handle = <&phy5>;
phy-mode = "rgmii-id";
pll-data = <0x82000000 0x80000101 0x80001313>;
gmac-config {
device = <&gmac>;
rgmii-enabled = <1>;
};
};
&pcie0 {
status = "okay";
wifi@0,0,0 {
compatible = "qcom,ath10k";
reg = <0x0 0 0 0 0>;
qca,no-eeprom;
};
};
&wmac {
status = "okay";
qca,no-eeprom;
};

View File

@ -78,7 +78,7 @@
virtual_flash {
compatible = "mtd-concat";
devices = <&fwpart1 &fwpart2>;
devices = <&fwconcat0 &fwconcat1>;
partitions {
compatible = "fixed-partitions";
@ -143,8 +143,8 @@
reg = <0x040000 0x010000>;
};
fwpart1: partition@50000 {
label = "fwpart1";
fwconcat0: partition@50000 {
label = "fwconcat0";
reg = <0x050000 0xe20000>;
};
@ -154,8 +154,8 @@
read-only;
};
fwpart2: partition@e80000 {
label = "fwpart2";
fwconcat1: partition@e80000 {
label = "fwconcat1";
reg = <0xe80000 0x170000>;
};

View File

@ -1,139 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "qca955x_engenius_ecb1xxx.dtsi"
/ {
compatible = "engenius,ecb1750", "qca,qca9558";
model = "EnGenius ECB1750";
aliases {
led-boot = &led_power_orange;
led-failsafe = &led_power_orange;
led-running = &led_power_orange;
led-upgrade = &led_power_orange;
};
leds {
compatible = "gpio-leds";
led_power_orange: power_orange {
label = "orange:power";
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
default-state = "on";
};
wlan2g {
label = "blue:wlan2g";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
wlan5g {
label = "blue:wlan5g";
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
lan {
label = "blue:lan";
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
};
};
};
&pcie0 {
status = "okay";
};
&uart {
status = "okay";
};
&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>;
uboot: partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x050000 0xf50000>;
};
partition@fa0000 {
label = "userconfig";
reg = <0xfa0000 0x050000>;
read-only;
};
art: partition@ff0000 {
label = "art";
reg = <0xff0000 0x010000>;
read-only;
};
};
};
};
&wmac {
status = "okay";
qca,no-eeprom;
};
&mdio0 {
status = "okay";
phy5: ethernet-phy@5 {
reg = <5>;
eee-broken-100tx;
eee-broken-1000t;
};
};
&eth0 {
status = "okay";
pll-data = <0x9a000000 0x80000101 0x80001313>;
phy-handle = <&phy5>;
gmac-config {
device = <&gmac>;
rgmii-gmac0 = <1>;
rxd-delay = <3>;
rxdv-delay = <3>;
};
};

View File

@ -0,0 +1,169 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
chosen {
/delete-property/ bootargs;
};
aliases {
serial0 = &uart;
led-boot = &led_power_blue;
led-failsafe = &led_power_blue;
led-running = &led_power_blue;
led-upgrade = &led_power_blue;
label-mac-device = &eth0;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
};
};
leds {
compatible = "gpio-leds";
lan_blue {
label = "blue:lan";
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
};
led_wifi2g: wifi2g {
label = "blue:wifi2g";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
};
status_green {
label = "green:status";
gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
};
status_red {
label = "red:status";
gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
};
led_power_blue: power_blue {
label = "blue:power";
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
default-state = "on";
};
led_wifi5g: wifi5g {
label = "blue:wifi5g";
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
};
};
watchdog {
compatible = "linux,wdt-gpio";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
hw_algo = "toggle";
/* hw_margin_ms is actually 300s but driver limits it to 60s */
hw_margin_ms = <60000>;
always-running;
};
};
&uart {
status = "okay";
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <40000000>;
/* partitions are passed via bootloader */
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
partition@50000 {
label = "custom";
reg = <0x050000 0x060000>;
read-only;
};
partition@b0000 {
label = "inactive";
reg = <0x0b0000 0x7a0000>;
};
partition@850000 {
label = "inactive2";
reg = <0x850000 0x7a0000>;
};
art: partition@ff0000 {
label = "ART";
reg = <0xff0000 0x010000>;
read-only;
};
};
};
};
&mdio0 {
status = "okay";
phy-mask = <0x20>;
phy5: ethernet-phy@5 {
reg = <5>;
eee-broken-100tx;
eee-broken-1000t;
};
};
&eth0 {
status = "okay";
pll-data = <0x82000000 0x80000101 0x80001313>;
mtd-mac-address = <&art 0x0>;
phy-mode = "rgmii-id";
phy-handle = <&phy5>;
gmac-config {
device = <&gmac>;
rgmii-enabled = <1>;
};
};
&wmac {
status = "okay";
mtd-cal-data = <&art 0x1000>;
mtd-mac-address = <&art 0x0>;
mtd-mac-address-increment = <1>;
};
&pcie0 {
status = "okay";
};

View File

@ -0,0 +1,16 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca9558_openmesh_mr.dtsi"
/ {
compatible = "openmesh,mr1750-v1", "qca,qca9558";
model = "OpenMesh MR1750 v1";
};
&led_wifi2g {
linux,default-trigger = "phy1tpt";
};
&led_wifi5g {
linux,default-trigger = "phy0tpt";
};

View File

@ -0,0 +1,16 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca9558_openmesh_mr.dtsi"
/ {
compatible = "openmesh,mr1750-v2", "qca,qca9558";
model = "OpenMesh MR1750 v2";
};
&led_wifi2g {
linux,default-trigger = "phy1tpt";
};
&led_wifi5g {
linux,default-trigger = "phy0tpt";
};

View File

@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca9558_openmesh_mr.dtsi"
/ {
compatible = "openmesh,mr900-v1", "qca,qca9558";
model = "OpenMesh MR900 v1";
};
&led_wifi2g {
linux,default-trigger = "phy0tpt";
};
&led_wifi5g {
linux,default-trigger = "phy1tpt";
};
&pcie0 {
wifi@0,0 {
compatible = "pci168c,0033";
reg = <0x0000 0 0 0 0>;
mtd-mac-address = <&art 0x0>;
mtd-mac-address-increment = <16>;
};
};

View File

@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca9558_openmesh_mr.dtsi"
/ {
compatible = "openmesh,mr900-v2", "qca,qca9558";
model = "OpenMesh MR900 v2";
};
&led_wifi2g {
linux,default-trigger = "phy0tpt";
};
&led_wifi5g {
linux,default-trigger = "phy1tpt";
};
&pcie0 {
wifi@0,0 {
compatible = "pci168c,0033";
reg = <0x0000 0 0 0 0>;
mtd-mac-address = <&art 0x0>;
mtd-mac-address-increment = <16>;
};
};

View File

@ -0,0 +1,137 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
debounce-interval = <60>;
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
leds {
compatible = "gpio-leds";
led_power: power {
label = "amber:power";
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
default-state = "on";
};
wifi2g {
label = "blue:wifi2g";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
wifi5g {
label = "blue:wifi5g";
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
};
};
&uart {
status = "okay";
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <40000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x050000 0xf50000>;
};
partition@fa0000 {
label = "userconfig";
reg = <0xfa0000 0x050000>;
read-only;
};
partition@ff0000 {
label = "art";
reg = <0xff0000 0x010000>;
read-only;
};
};
};
};
&mdio0 {
status = "okay";
phy5: ethernet-phy@5 {
reg = <5>;
eee-broken-100tx;
eee-broken-1000t;
};
};
&eth0 {
status = "okay";
phy-handle = <&phy5>;
phy-mode = "rgmii-id";
pll-data = <0x82000000 0x80000101 0x80001313>;
gmac-config {
device = <&gmac>;
rgmii-enabled = <1>;
};
};
&pcie0 {
status = "okay";
wifi@0,0,0 {
compatible = "qcom,ath10k";
reg = <0x0 0 0 0 0>;
qca,no-eeprom;
};
};
&wmac {
status = "okay";
qca,no-eeprom;
};

View File

@ -157,7 +157,11 @@ telco,t1)
;;
comfast,cf-wr752ac-v1|\
engenius,eap300-v2|\
enterasys,ws-ap3705i)
enterasys,ws-ap3705i|\
openmesh,mr900-v1|\
openmesh,mr900-v2|\
openmesh,mr1750-v1|\
openmesh,mr1750-v2)
ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0"
;;
compex,wpj344-16m|\

View File

@ -32,6 +32,7 @@ ath79_setup_interfaces()
dlink,dap-2680-a1|\
dlink,dap-3320-a1|\
dlink,dir-505|\
engenius,eap1200h|\
engenius,eap300-v2|\
engenius,eap600|\
engenius,ecb1200|\
@ -46,6 +47,12 @@ ath79_setup_interfaces()
netgear,ex7300|\
ocedo,koala|\
ocedo,raccoon|\
openmesh,mr600-v1|\
openmesh,mr600-v2|\
openmesh,mr900-v1|\
openmesh,mr900-v2|\
openmesh,mr1750-v1|\
openmesh,mr1750-v2|\
pcs,cap324|\
pisen,ts-d084|\
pisen,wmb001n|\
@ -632,7 +639,7 @@ ath79_setup_macs()
lan_mac=$(nvram get et0macaddr)
;;
xwrt,csac)
wan_mac=$(mtd_get_mac_binary art 0)
wan_mac=$(mtd_get_mac_binary art 0x0)
lan_mac=$(macaddr_add "$wan_mac" 1)
label_mac=$wan_mac
;;

View File

@ -2,80 +2,7 @@
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions.sh
. /lib/functions/system.sh
ath9k_eeprom_die() {
echo "ath9k eeprom: " "$*"
exit 1
}
ath9k_eeprom_extract() {
local part=$1
local offset=$(($2))
local count=$(($3))
local mtd
mtd=$(find_mtd_chardev $part)
[ -n "$mtd" ] || \
ath9k_eeprom_die "no mtd device found for partition $part"
dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
ath9k_eeprom_die "failed to extract from $mtd"
}
ath9k_eeprom_extract_reverse() {
local part=$1
local offset=$2
local count=$(($3))
local mtd
local reversed
local caldata
mtd=$(find_mtd_chardev "$part")
reversed=$(hexdump -v -s $offset -n $count -e '/1 "%02x "' $mtd)
for byte in $reversed; do
caldata="\x${byte}${caldata}"
done
printf "%b" "$caldata" > /lib/firmware/$FIRMWARE
}
ath9k_patch_fw_mac() {
local mac=$1
local mac_offset=$(($2))
local chksum_offset=$3
local xor_mac
local xor_fw_mac
local xor_fw_chksum
[ -z "$mac" -o -z "$mac_offset" ] && return
[ -n "$chksum_offset" ] && {
xor_mac=${mac//:/}
xor_mac="${xor_mac:0:4} ${xor_mac:4:4} ${xor_mac:8:4}"
xor_fw_mac=$(hexdump -v -n 6 -s $mac_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
xor_fw_mac="${xor_fw_mac:0:4} ${xor_fw_mac:4:4} ${xor_fw_mac:8:4}"
xor_fw_chksum=$(hexdump -v -n 2 -s $chksum_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
xor_fw_chksum=$(xor $xor_fw_chksum $xor_fw_mac $xor_mac)
printf "%b" "\x${xor_fw_chksum:0:2}\x${xor_fw_chksum:2:2}" | \
dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=$(($chksum_offset)) count=2
}
macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc oflag=seek_bytes bs=6 seek=$mac_offset count=1
}
ath9k_patch_fw_mac_crc() {
local mac=$1
local mac_offset=$2
local chksum_offset=$((mac_offset - 10))
ath9k_patch_fw_mac "${mac}" "${mac_offset}" "${chksum_offset}"
}
. /lib/functions/caldata.sh
board=$(board_name)
@ -83,23 +10,23 @@ case "$FIRMWARE" in
"ath9k-eeprom-ahb-18100000.wmac.bin")
case $board in
8dev,lima)
ath9k_eeprom_extract "art" 0x1000 0x800
caldata_extract "art" 0x1000 0x800
;;
avm,fritz1750e|\
avm,fritz4020|\
avm,fritz450e|\
avm,fritzdvbc)
ath9k_eeprom_extract_reverse "urlader" 0x1541 0x440
caldata_extract_reverse "urlader" 0x1541 0x440
;;
dlink,dap-2695-a1)
ath9k_eeprom_extract "art" 0x1000 0x440
ath9k_patch_fw_mac $(mtd_get_mac_ascii bdcfg "wlanmac") 0x2
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii bdcfg "wlanmac")
;;
dlink,dir-505|\
dlink,dir-825-c1|\
dlink,dir-835-a1)
ath9k_eeprom_extract "art" 0x1000 0x440
ath9k_patch_fw_mac $(mtd_get_mac_text "mac" 0x4) 0x2
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_text "mac" 0x4)
;;
dlink,dir-842-c1|\
dlink,dir-842-c2|\
@ -107,13 +34,13 @@ case "$FIRMWARE" in
dlink,dir-859-a1|\
nec,wg1200cr|\
wd,mynet-n750)
ath9k_eeprom_extract "art" 0x1000 0x440
ath9k_patch_fw_mac $(mtd_get_mac_ascii devdata "wlan24mac") 0x2
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")
;;
engenius,ecb1200|\
engenius,ecb1750)
ath9k_eeprom_extract "art" 0x1000 0x440
ath9k_patch_fw_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) +1) 0x2
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) +1)
;;
engenius,epg5000|\
iodata,wn-ac1167dgr|\
@ -122,42 +49,42 @@ case "$FIRMWARE" in
iodata,wn-ag300dgr|\
sitecom,wlr-7100|\
sitecom,wlr-8100)
ath9k_eeprom_extract "art" 0x1000 0x440
ath9k_patch_fw_mac $(mtd_get_mac_ascii u-boot-env ethaddr) 0x2
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr)
;;
enterasys,ws-ap3705i)
ath9k_eeprom_extract "calibrate" 0x1000 0x440
ath9k_patch_fw_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR1) 0x2
caldata_extract "calibrate" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR1)
;;
nec,wg800hp)
ath9k_eeprom_extract "art" 0x1000 0x440
ath9k_patch_fw_mac $(mtd_get_mac_text board_data 0x680) 0x2
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_text board_data 0x680)
;;
qihoo,c301)
ath9k_eeprom_extract "radiocfg" 0x1000 0x440
ath9k_patch_fw_mac $(mtd_get_mac_ascii devdata "wlan24mac")
caldata_extract "radiocfg" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")
;;
*)
ath9k_eeprom_die "board $board is not supported yet"
caldata_die "board $board is not supported yet"
;;
esac
;;
"ath9k-eeprom-pci-0000:00:00.0.bin")
case $board in
avm,fritz300e)
ath9k_eeprom_extract_reverse "urloader" 0x1541 0x440
caldata_extract_reverse "urloader" 0x1541 0x440
;;
buffalo,wzr-hp-g302h-a1a0)
ath9k_eeprom_extract "art" 0x1000 0xeb8
caldata_extract "art" 0x1000 0xeb8
;;
buffalo,wzr-hp-g450h|\
ubnt,unifi)
ath9k_eeprom_extract "art" 0x1000 0x440
caldata_extract "art" 0x1000 0x440
;;
dlink,dir-825-c1|\
dlink,dir-835-a1)
ath9k_eeprom_extract "art" 0x5000 0x440
ath9k_patch_fw_mac $(macaddr_add $(mtd_get_mac_text "mac" 0x18) 1) 0x2
caldata_extract "art" 0x5000 0x440
ath9k_patch_mac $(macaddr_add $(mtd_get_mac_text "mac" 0x18) 1)
;;
engenius,eap600|\
engenius,ecb600|\
@ -171,11 +98,11 @@ case "$FIRMWARE" in
tplink,tl-wdr4900-v2|\
ubnt,unifi-ap-pro|\
winchannel,wb2000)
ath9k_eeprom_extract "art" 0x5000 0x440
caldata_extract "art" 0x5000 0x440
;;
enterasys,ws-ap3705i)
ath9k_eeprom_extract "calibrate" 0x5000 0x440
ath9k_patch_fw_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR0) 0x2
caldata_extract "calibrate" 0x5000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR0)
;;
netgear,wnr2200-8m|\
netgear,wnr2200-16m|\
@ -191,18 +118,22 @@ case "$FIRMWARE" in
ubnt,picostation-m|\
ubnt,powerbridge-m|\
ubnt,rocket-m)
ath9k_eeprom_extract "art" 0x1000 0x1000
caldata_extract "art" 0x1000 0x1000
;;
openmesh,mr600-v1|\
openmesh,mr600-v2)
caldata_extract "ART" 0x5000 0x440
;;
wd,mynet-n750)
ath9k_eeprom_extract "art" 0x5000 0x440
ath9k_patch_fw_mac $(mtd_get_mac_ascii devdata "wlan5mac") 0x2
caldata_extract "art" 0x5000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
;;
wd,mynet-wifi-rangeextender)
ath9k_eeprom_extract "art" 0x1000 0x1000
ath9k_patch_fw_mac $(nvram get wl0_hwaddr) "$mac" 0x2
caldata_extract "art" 0x1000 0x1000
ath9k_patch_mac $(nvram get wl0_hwaddr)
;;
*)
ath9k_eeprom_die "board $board is not supported yet"
caldata_die "board $board is not supported yet"
;;
esac
;;
@ -216,17 +147,17 @@ case "$FIRMWARE" in
netgear,wndr3800ch|\
netgear,wndrmac-v1|\
netgear,wndrmac-v2)
ath9k_eeprom_extract "art" 0x1000 0xeb8
caldata_extract "art" 0x1000 0xeb8
;;
dlink,dir-825-b1)
ath9k_eeprom_extract "caldata" 0x1000 0xeb8
ath9k_patch_fw_mac_crc $(mtd_get_mac_text "caldata" 0xffa0) 0x20c
caldata_extract "caldata" 0x1000 0xeb8
ath9k_patch_mac_crc $(mtd_get_mac_text "caldata" 0xffa0) 0x20c
;;
meraki,mr16)
ath9k_eeprom_extract "art" 0x11000 0xeb8
caldata_extract "art" 0x11000 0xeb8
;;
*)
ath9k_eeprom_die "board $board is not supported yet"
caldata_die "board $board is not supported yet"
;;
esac
;;
@ -240,17 +171,17 @@ case "$FIRMWARE" in
netgear,wndr3800ch|\
netgear,wndrmac-v1|\
netgear,wndrmac-v2)
ath9k_eeprom_extract "art" 0x5000 0xeb8
caldata_extract "art" 0x5000 0xeb8
;;
dlink,dir-825-b1)
ath9k_eeprom_extract "caldata" 0x5000 0xeb8
ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 0xffb4) 1) 0x20c
caldata_extract "caldata" 0x5000 0xeb8
ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 0xffb4) 1) 0x20c
;;
meraki,mr16)
ath9k_eeprom_extract "art" 0x15000 0xeb8
caldata_extract "art" 0x15000 0xeb8
;;
*)
ath9k_eeprom_die "board $board is not supported yet"
caldata_die "board $board is not supported yet"
;;
esac
;;

View File

@ -1,70 +1,9 @@
#!/bin/sh
. /lib/functions.sh
. /lib/functions/k2t.sh
ath10kcal_die() {
echo "ath10cal: " "$*"
exit 1
}
ath10kcal_from_file() {
local source=$1
local offset=$(($2))
local count=$(($3))
dd if=$source of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
ath10kcal_die "failed to extract calibration data from $source"
}
ath10kcal_extract() {
local part=$1
local offset=$(($2))
local count=$(($3))
local mtd
mtd=$(find_mtd_chardev $part)
[ -n "$mtd" ] || \
ath10kcal_die "no mtd device found for partition $part"
dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
ath10kcal_die "failed to extract calibration data from $mtd"
}
ath10kcal_patch_mac() {
local mac=$1
[ -z "$mac" ] && return
macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc oflag=seek_bytes bs=6 seek=6 count=1
}
ath10kcal_patch_mac_crc() {
local mac=$1
local mac_offset=6
local chksum_offset=2
local xor_mac
local xor_fw_mac
local xor_fw_chksum
xor_fw_mac=$(hexdump -v -n 6 -s $mac_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
xor_fw_mac="${xor_fw_mac:0:4} ${xor_fw_mac:4:4} ${xor_fw_mac:8:4}"
ath10kcal_patch_mac "$mac" && {
xor_mac=${mac//:/}
xor_mac="${xor_mac:0:4} ${xor_mac:4:4} ${xor_mac:8:4}"
xor_fw_chksum=$(hexdump -v -n 2 -s $chksum_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
xor_fw_chksum=$(xor $xor_fw_chksum $xor_fw_mac $xor_mac)
printf "%b" "\x${xor_fw_chksum:0:2}\x${xor_fw_chksum:2:2}" | \
dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=$chksum_offset count=2
}
}
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/system.sh
. /lib/functions/caldata.sh
. /lib/functions/k2t.sh
board=$(board_name)
@ -72,13 +11,15 @@ case "$FIRMWARE" in
"ath10k/cal-pci-0000:00:00.0.bin")
case $board in
allnet,all-wap02860ac|\
engenius,eap1200h|\
engenius,enstationac-v1|\
glinet,gl-x750)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
;;
avm,fritz1750e|\
avm,fritzdvbc)
ath10kcal_extract "urlader" 0x198a 0x844
caldata_extract "urlader" 0x198a 0x844
;;
comfast,cf-wr650ac-v1|\
comfast,cf-wr650ac-v2|\
@ -103,7 +44,7 @@ case "$FIRMWARE" in
ubnt,powerbeam-5ac-gen2|\
ubnt,unifiac-pro|\
yuncore,a770)
ath10kcal_extract "art" 0x5000 0x844
caldata_extract "art" 0x5000 0x844
;;
devolo,dvl1200e|\
devolo,dvl1200i|\
@ -111,57 +52,63 @@ case "$FIRMWARE" in
devolo,dvl1750e|\
devolo,dvl1750i|\
devolo,dvl1750x)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0x0) -1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) -1)
;;
dlink,dap-2660-a1|\
dlink,dap-2695-a1)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a)
;;
dlink,dir-859-a1)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
;;
elecom,wrc-1750ghbk2-i)
ath10kcal_extract "art" 0x5000 0x844
caldata_extract "art" 0x5000 0x844
;;
engenius,ecb1200|\
engenius,ecb1750)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(mtd_get_mac_ascii u-boot-env athaddr)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(mtd_get_mac_ascii u-boot-env athaddr)
;;
engenius,epg5000|\
iodata,wn-ac1167dgr|\
iodata,wn-ac1600dgr2|\
sitecom,wlr-7100|\
zyxel,nbg6616)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
;;
engenius,ews511ap)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
;;
glinet,gl-ar750)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1)
;;
nec,wg800hp)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac_crc $(mtd_get_mac_text board_data 0x880)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(mtd_get_mac_text board_data 0x880)
;;
ocedo,koala|\
ocedo,ursus)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(mtd_get_mac_binary art 0xc)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(mtd_get_mac_binary art 0xc)
;;
openmesh,mr1750-v1|\
openmesh,mr1750-v2)
caldata_extract "ART" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
;;
openmesh,om5p-ac-v2)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
;;
qihoo,c301)
ath10kcal_extract "radiocfg" 0x5000 0x844
ath10kcal_patch_mac_crc $(mtd_get_mac_ascii devdata wlan5mac)
caldata_extract "radiocfg" 0x5000 0x844
ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
;;
tplink,archer-a7-v5|\
tplink,archer-c2-v3|\
@ -169,54 +116,58 @@ case "$FIRMWARE" in
tplink,archer-c7-v5|\
tplink,archer-c25-v1|\
tplink,tl-wr902ac-v1)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) -1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) -1)
;;
tplink,archer-c5-v1|\
tplink,archer-c7-v2|\
tplink,tl-wdr7500-v3)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x1fc00) -1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x1fc00) -1)
;;
tplink,archer-d50-v1)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary romfile 0xf100) +2)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfile 0xf100) +2)
;;
tplink,archer-d7-v1|\
tplink,archer-d7b-v1)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary romfs 0xf100) +2)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfs 0xf100) +2)
;;
tplink,eap245-v1|\
tplink,re450-v2|\
tplink,re450-v3)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
;;
tplink,re350k-v1)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +2)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +2)
;;
tplink,re355-v1|\
tplink,re450-v1)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -2)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -2)
;;
tplink,tl-wpa8630-v1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x0fc00) +1)
;;
esac
;;
"ath10k/cal-pci-0000:01:00.0.bin")
case $board in
sitecom,wlr-8100)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
;;
esac
;;
"ath10k/pre-cal-pci-0000:00:00.0.bin")
case $board in
comfast,cf-e313ac)
ath10kcal_extract "art" 0x5000 0x2f20
ath10kcal_patch_mac_crc $(mtd_get_mac_binary art 0x6)
caldata_extract "art" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary art 0x6)
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
rm /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
@ -224,8 +175,8 @@ case "$FIRMWARE" in
comfast,cf-e560ac|\
comfast,cf-ew72|\
comfast,cf-wr752ac-v1)
ath10kcal_extract "art" 0x5000 0x2f20
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
caldata_extract "art" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
rm /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
@ -239,26 +190,26 @@ case "$FIRMWARE" in
dlink,dir-842-c1|\
dlink,dir-842-c2|\
dlink,dir-842-c3)
ath10kcal_extract "art" 0x5000 0x2f20
ath10kcal_is_caldata_valid "202f" || ath10kcal_extract "reserved" 0x15000 0x2f20
ath10kcal_patch_mac_crc $(mtd_get_mac_ascii devdata wlan5mac)
caldata_extract "art" 0x5000 0x2f20
caldata_valid "202f" || caldata_extract "reserved" 0x15000 0x2f20
ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;
nec,wg1200cr)
ath10kcal_extract "art" 0x5000 0x2f20
ath10kcal_patch_mac_crc $(mtd_get_mac_ascii devdata wlan5mac)
caldata_extract "art" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;
netgear,ex6400|\
netgear,ex7300)
ath10kcal_extract "caldata" 0x5000 0x2f20
ath10kcal_patch_mac $(mtd_get_mac_binary caldata 0xc)
caldata_extract "caldata" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary caldata 0xc)
;;
phicomm,k2t)
ath10kcal_extract "art" 0x5000 0x2f20
ath10kcal_patch_mac_crc $(k2t_get_mac "5g_mac")
caldata_extract "art" 0x5000 0x2f20
ath10k_patch_mac $(k2t_get_mac "5g_mac")
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;
@ -270,8 +221,8 @@ case "$FIRMWARE" in
tplink,archer-c60-v3|\
tplink,archer-c6-v2|\
tplink,archer-c6-v2-us)
ath10kcal_extract "art" 0x5000 0x2f20
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary info 0x8) -1)
caldata_extract "art" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) -1)
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;
@ -281,19 +232,19 @@ case "$FIRMWARE" in
tplink,tl-wpa8630p-v2-int|\
tplink,tl-wpa8630p-v2.0-eu|\
tplink,tl-wpa8630p-v2.1-eu)
ath10kcal_extract "art" 0x5000 0x2f20
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
caldata_extract "art" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;
tplink,eap245-v3)
ath10kcal_extract "art" 0x5000 0x2f20
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
caldata_extract "art" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
;;
xwrt,csac|\
yuncore,a782|\
yuncore,xd4200)
ath10kcal_extract "art" 0x5000 0x2f20
caldata_extract "art" 0x5000 0x2f20
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;

View File

@ -17,6 +17,18 @@ engenius,epg5000)
glinet,gl-mifi)
migrate_leds ":net=:3g4g"
;;
openmesh,mr600-v1)
migrate_leds ":wlan58=:wifi5g"
;;
openmesh,mr600-v2)
migrate_leds ":wlan24=:wifi2g" ":wlan58=:wifi5g"
;;
openmesh,mr900-v1|\
openmesh,mr900-v2|\
openmesh,mr1750-v1|\
openmesh,mr1750-v2)
migrate_leds ":wlan24=:wifi2g" ":wlan58=:wifi5g" ":wan=:lan"
;;
pcs,cap324)
migrate_leds "lan:amber=amber:lan" "lan:green=green:lan"
;;

View File

@ -1,6 +1,6 @@
BOARDNAME:=Generic
DEFAULT_PACKAGES += wpad-openssl
DEFAULT_PACKAGES += wpad-basic-wolfssl
define Target/Description
Build firmware images for generic Atheros AR71xx/AR913x/AR934x based boards.

View File

@ -335,7 +335,7 @@ endef
TARGET_DEVICES += ubnt_rocket-m
define Device/ubnt_routerstation_common
DEVICE_PACKAGES := -kmod-ath9k -wpad-openssl -uboot-envtools kmod-usb-ohci \
DEVICE_PACKAGES := -kmod-ath9k -wpad-basic-wolfssl -uboot-envtools kmod-usb-ohci \
kmod-usb2 fconfig
DEVICE_VENDOR := Ubiquiti
SOC := ar7161

View File

@ -8,6 +8,7 @@ DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION
DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK
DEVICE_VARS += KERNEL_INITRAMFS_PREFIX DAP_SIGNATURE
DEVICE_VARS += EDIMAX_HEADER_MAGIC EDIMAX_HEADER_MODEL
DEVICE_VARS += OPENMESH_CE_TYPE
define Build/add-elecom-factory-initramfs
$(eval edimax_model=$(word 1,$(1)))
@ -983,6 +984,17 @@ define Device/embeddedwireless_dorin
endef
TARGET_DEVICES += embeddedwireless_dorin
define Device/engenius_eap1200h
$(Device/engenius_loader_okli)
SOC := qca9557
DEVICE_MODEL := EAP1200H
DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct
IMAGE_SIZE := 11520k
LOADER_FLASH_OFFS := 0x230000
ENGENIUS_IMGNAME := ar71xx-generic-eap1200h
endef
TARGET_DEVICES += engenius_eap1200h
define Device/engenius_eap300-v2
$(Device/engenius_loader_okli)
SOC := ar9341
@ -1546,94 +1558,166 @@ define Device/ocedo_ursus
endef
TARGET_DEVICES += ocedo_ursus
define Device/openmesh_om2p-common
define Device/openmesh_common_64k
DEVICE_VENDOR := OpenMesh
DEVICE_PACKAGES := uboot-envtools
IMAGE_SIZE := 7808k
BLOCKSIZE := 64k
OPENMESH_CE_TYPE :=
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \
pad-to $$(BLOCKSIZE)
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \
openmesh-image ce_type=$$$$(OPENMESH_CE_TYPE) | append-metadata
endef
define Device/openmesh_common_256k
DEVICE_VENDOR := OpenMesh
DEVICE_PACKAGES := uboot-envtools
IMAGE_SIZE := 7168k
BLOCKSIZE := 256k
OPENMESH_CE_TYPE :=
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \
pad-to $$(BLOCKSIZE)
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \
openmesh-image ce_type=OM2P | append-metadata
openmesh-image ce_type=$$$$(OPENMESH_CE_TYPE) | append-metadata
endef
define Device/openmesh_mr600-v1
$(Device/openmesh_common_64k)
SOC := ar9344
DEVICE_MODEL := MR600
DEVICE_VARIANT := v1
OPENMESH_CE_TYPE := MR600
SUPPORTED_DEVICES += mr600
endef
TARGET_DEVICES += openmesh_mr600-v1
define Device/openmesh_mr600-v2
$(Device/openmesh_common_64k)
SOC := ar9344
DEVICE_MODEL := MR600
DEVICE_VARIANT := v2
OPENMESH_CE_TYPE := MR600
SUPPORTED_DEVICES += mr600v2
endef
TARGET_DEVICES += openmesh_mr600-v2
define Device/openmesh_mr900-v1
$(Device/openmesh_common_64k)
SOC := qca9558
DEVICE_MODEL := MR900
DEVICE_VARIANT := v1
OPENMESH_CE_TYPE := MR900
SUPPORTED_DEVICES += mr900
endef
TARGET_DEVICES += openmesh_mr900-v1
define Device/openmesh_mr900-v2
$(Device/openmesh_common_64k)
SOC := qca9558
DEVICE_MODEL := MR900
DEVICE_VARIANT := v2
OPENMESH_CE_TYPE := MR900
SUPPORTED_DEVICES += mr900v2
endef
TARGET_DEVICES += openmesh_mr900-v2
define Device/openmesh_mr1750-v1
$(Device/openmesh_common_64k)
SOC := qca9558
DEVICE_MODEL := MR1750
DEVICE_VARIANT := v1
DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct
OPENMESH_CE_TYPE := MR1750
SUPPORTED_DEVICES += mr1750
endef
TARGET_DEVICES += openmesh_mr1750-v1
define Device/openmesh_mr1750-v2
$(Device/openmesh_common_64k)
SOC := qca9558
DEVICE_MODEL := MR1750
DEVICE_VARIANT := v2
DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct
OPENMESH_CE_TYPE := MR1750
SUPPORTED_DEVICES += mr1750v2
endef
TARGET_DEVICES += openmesh_mr1750-v2
define Device/openmesh_om2p-v2
$(Device/openmesh_om2p-common)
$(Device/openmesh_common_256k)
SOC := ar9330
DEVICE_MODEL := OM2P
DEVICE_VARIANT := v2
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2pv2
endef
TARGET_DEVICES += openmesh_om2p-v2
define Device/openmesh_om2p-v4
$(Device/openmesh_om2p-common)
$(Device/openmesh_common_256k)
SOC := qca9533
DEVICE_MODEL := OM2P
DEVICE_VARIANT := v4
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2pv4
endef
TARGET_DEVICES += openmesh_om2p-v4
define Device/openmesh_om2p-hs-v1
$(Device/openmesh_om2p-common)
$(Device/openmesh_common_256k)
SOC := ar9341
DEVICE_MODEL := OM2P-HS
DEVICE_VARIANT := v1
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2p-hs
endef
TARGET_DEVICES += openmesh_om2p-hs-v1
define Device/openmesh_om2p-hs-v2
$(Device/openmesh_om2p-common)
$(Device/openmesh_common_256k)
SOC := ar9341
DEVICE_MODEL := OM2P-HS
DEVICE_VARIANT := v2
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2p-hsv2
endef
TARGET_DEVICES += openmesh_om2p-hs-v2
define Device/openmesh_om2p-hs-v3
$(Device/openmesh_om2p-common)
$(Device/openmesh_common_256k)
SOC := ar9341
DEVICE_MODEL := OM2P-HS
DEVICE_VARIANT := v3
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2p-hsv3
endef
TARGET_DEVICES += openmesh_om2p-hs-v3
define Device/openmesh_om2p-hs-v4
$(Device/openmesh_om2p-common)
$(Device/openmesh_common_256k)
SOC := qca9533
DEVICE_MODEL := OM2P-HS
DEVICE_VARIANT := v4
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2p-hsv4
endef
TARGET_DEVICES += openmesh_om2p-hs-v4
define Device/openmesh_om2p-lc
$(Device/openmesh_om2p-common)
$(Device/openmesh_common_256k)
SOC := ar9330
DEVICE_MODEL := OM2P-LC
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2p-lc
endef
TARGET_DEVICES += openmesh_om2p-lc
define Device/openmesh_om5p-common
SOC := ar9344
DEVICE_VENDOR := OpenMesh
DEVICE_PACKAGES := uboot-envtools
IMAGE_SIZE := 7808k
BLOCKSIZE := 64k
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \
pad-to $$(BLOCKSIZE)
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \
openmesh-image ce_type=OM5P | append-metadata
endef
define Device/openmesh_om5p
$(Device/openmesh_om5p-common)
$(Device/openmesh_common_64k)
SOC := ar9344
DEVICE_MODEL := OM5P
OPENMESH_CE_TYPE := OM5P
SUPPORTED_DEVICES += om5p
endef
TARGET_DEVICES += openmesh_om5p

View File

@ -3,39 +3,20 @@
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
. /lib/functions/mikrotik-caldata.sh
ath9k_eeprom_die() {
echo "ath9k eeprom: " "$*"
exit 1
caldata_mikrotik_ath9k() {
local offset=$(($1))
local count=$(($2))
local macaddr=$3
caldata_from_file $wlan_data $offset $count /tmp/$FIRMWARE
ath9k_patch_mac "$macaddr" /tmp/$FIRMWARE
caldata_sysfsload_from_file /tmp/$FIRMWARE 0x0 $count
rm -f /tmp/$FIRMWARE
}
ath9k_patch_fw_mac() {
local mac=$1
local mac_offset=$(($2))
local chksum_offset=$3
local xor_mac
local xor_fw_mac
local xor_fw_chksum
[ -z "$mac" -o -z "$mac_offset" ] && return
[ -n "$chksum_offset" ] && {
xor_mac=${mac//:/}
xor_mac="${xor_mac:0:4} ${xor_mac:4:4} ${xor_mac:8:4}"
xor_fw_mac=$(hexdump -v -n 6 -s $mac_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
xor_fw_mac="${xor_fw_mac:0:4} ${xor_fw_mac:4:4} ${xor_fw_mac:8:4}"
xor_fw_chksum=$(hexdump -v -n 2 -s $chksum_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
xor_fw_chksum=$(xor $xor_fw_chksum $xor_fw_mac $xor_mac)
printf "%b" "\x${xor_fw_chksum:0:2}\x${xor_fw_chksum:2:2}" | \
dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=$(($chksum_offset)) count=2
}
macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc oflag=seek_bytes bs=6 seek=$mac_offset count=1
}
wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data"
mac_base="$(cat /sys/firmware/mikrotik/hard_config/mac_base)"
board=$(board_name)
@ -45,15 +26,13 @@ case "$FIRMWARE" in
mikrotik,routerboard-lhg-2nd|\
mikrotik,routerboard-sxt-5nd-r2|\
mikrotik,routerboard-wapr-2nd)
mikrotik_caldata_extract "art" 0x1000 0x440
ath9k_patch_fw_mac $(macaddr_add "$mac_base" +1)
caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" +1)
;;
mikrotik,routerboard-wap-g-5hact2hnd)
mikrotik_caldata_extract "art" 0x1000 0x440
ath9k_patch_fw_mac $(macaddr_add $(mtd_get_mac_binary art 0x10) +2)
caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" +2)
;;
*)
ath9k_eeprom_die "board $board is not supported yet"
caldata_die "board $board is not supported yet"
;;
esac
;;

View File

@ -3,7 +3,8 @@
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
. /lib/functions/mikrotik-caldata.sh
wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data"
board=$(board_name)
@ -12,14 +13,14 @@ case "$FIRMWARE" in
case $board in
mikrotik,routerboard-921gs-5hpacd-15s|\
mikrotik,routerboard-wap-g-5hact2hnd)
mikrotik_caldata_extract "hard_config" 0x5000 0x844
caldata_sysfsload_from_file $wlan_data 0x5000 0x844
;;
esac
;;
"ath10k/cal-pci-0000:01:00.0.bin")
case $board in
mikrotik,routerboard-922uags-5hpacd)
mikrotik_caldata_extract "hard_config" 0x5000 0x844
caldata_sysfsload_from_file $wlan_data 0x5000 0x844
;;
esac
;;

View File

@ -1,26 +0,0 @@
# Copyright (C) 2019 Robert Marko <robimarko@gmail.com>
# Copyright (C) 2019 Roger Pueyo Centelles <roger.pueyo@guifi.net>
#
# Helper function to extract MAC addresses and calibration data for MikroTik
#
mikrotik_caldata_extract() {
local part=$1
local offset=$(($2))
local count=$(($3))
local mtd
local erdfile="/tmp/erd.bin"
local fwfile="/lib/firmware/${FIRMWARE}"
[ -e $fwfile ] && exit 0
mtd=$(find_mtd_chardev $part)
[ -n "$mtd" ] || caldata_die "no mtd device found for partition $part"
rbextract -e $mtd $erdfile
dd if=$erdfile of=$fwfile iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
caldata_die "failed to extract calibration data from $mtd"
rm -f $erdfile
}

View File

@ -3,7 +3,7 @@ FEATURES += minor nand
KERNELNAME := vmlinux vmlinuz
IMAGES_DIR := ../../..
DEFAULT_PACKAGES += wpad-openssl
DEFAULT_PACKAGES += wpad-basic-wolfssl
define Target/Description
Build firmware images for MikroTik devices based on Qualcomm Atheros

View File

@ -2,54 +2,7 @@
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions.sh
. /lib/functions/system.sh
ath9k_eeprom_die() {
echo "ath9k eeprom: " "$*"
exit 1
}
ath9k_eeprom_extract() {
local part=$1
local offset=$(($2))
local count=$(($3))
local mtd
mtd=$(find_mtd_chardev $part)
[ -n "$mtd" ] || \
ath9k_eeprom_die "no mtd device found for partition $part"
dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
ath9k_eeprom_die "failed to extract from $mtd"
}
ath9k_patch_fw_mac() {
local mac=$1
local mac_offset=$(($2))
local chksum_offset=$3
local xor_mac
local xor_fw_mac
local xor_fw_chksum
[ -z "$mac" -o -z "$mac_offset" ] && return
[ -n "$chksum_offset" ] && {
xor_mac=${mac//:/}
xor_mac="${xor_mac:0:4} ${xor_mac:4:4} ${xor_mac:8:4}"
xor_fw_mac=$(hexdump -v -n 6 -s $mac_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
xor_fw_mac="${xor_fw_mac:0:4} ${xor_fw_mac:4:4} ${xor_fw_mac:8:4}"
xor_fw_chksum=$(hexdump -v -n 2 -s $chksum_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
xor_fw_chksum=$(xor $xor_fw_chksum $xor_fw_mac $xor_mac)
printf "%b" "\x${xor_fw_chksum:0:2}\x${xor_fw_chksum:2:2}" | \
dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=$(($chksum_offset)) count=2
}
macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc oflag=seek_bytes bs=6 seek=$mac_offset count=1
}
. /lib/functions/caldata.sh
board=$(board_name)
@ -57,7 +10,7 @@ case "$FIRMWARE" in
"ath9k-eeprom-ahb-18100000.wmac.bin")
case $board in
8dev,rambutan)
ath9k_eeprom_extract "caldata" 0x1000 0x800
caldata_extract "caldata" 0x1000 0x800
;;
netgear,wndr3700-v4|\
netgear,wndr4300|\
@ -65,10 +18,10 @@ case "$FIRMWARE" in
netgear,wndr4300tn|\
netgear,wndr4300-v2|\
netgear,wndr4500-v3)
ath9k_eeprom_extract "caldata" 0x1000 0x440
caldata_extract "caldata" 0x1000 0x440
;;
*)
ath9k_eeprom_die "board $board is not supported yet"
caldata_die "board $board is not supported yet"
;;
esac
;;
@ -80,10 +33,10 @@ case "$FIRMWARE" in
netgear,wndr4300tn|\
netgear,wndr4300-v2|\
netgear,wndr4500-v3)
ath9k_eeprom_extract "caldata" 0x5000 0x440
caldata_extract "caldata" 0x5000 0x440
;;
*)
ath9k_eeprom_die "board $board is not supported yet"
caldata_die "board $board is not supported yet"
;;
esac
;;

View File

@ -1,32 +1,9 @@
#!/bin/sh
. /lib/functions.sh
. /lib/functions/system.sh
ath10kcal_extract() {
local part=$1
local offset=$(($2))
local count=$(($3))
local mtd
mtd=$(find_mtd_chardev $part)
[ -n "$mtd" ] || \
ath10kcal_die "no mtd device found for partition $part"
dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
ath10kcal_die "failed to extract calibration data from $mtd"
}
ath10kcal_patch_mac() {
local mac=$1
[ -z "$mac" ] && return
macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc oflag=seek_bytes bs=6 seek=6 count=1
}
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
board=$(board_name)
case "$FIRMWARE" in
@ -34,17 +11,17 @@ case "$FIRMWARE" in
case $board in
domywifi,dw33d|\
domywifi,dw33d-nor)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(mtd_get_mac_binary art 0x12)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(mtd_get_mac_binary art 0x12)
;;
glinet,gl-ar750s-nor|\
glinet,gl-ar750s-nor-nand)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1)
;;
zyxel,nbg6716)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
;;
esac
;;

View File

@ -2,7 +2,7 @@ BOARDNAME := Generic devices with NAND flash
FEATURES += nand
DEFAULT_PACKAGES += wpad-openssl
DEFAULT_PACKAGES += wpad-basic-wolfssl
define Target/Description
Firmware for boards using Qualcomm Atheros, MIPS-based SoCs

View File

@ -2,62 +2,7 @@
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions.sh
. /lib/functions/system.sh
ath9k_eeprom_die() {
echo "ath9k eeprom: " "$*"
exit 1
}
ath9k_eeprom_extract() {
local part=$1
local offset=$(($2))
local count=$(($3))
local mtd
mtd=$(find_mtd_chardev $part)
[ -n "$mtd" ] || \
ath9k_eeprom_die "no mtd device found for partition $part"
dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
ath9k_eeprom_die "failed to extract from $mtd"
}
ath9k_patch_fw_mac() {
local mac=$1
local mac_offset=$(($2))
local chksum_offset=$3
local xor_mac
local xor_fw_mac
local xor_fw_chksum
[ -z "$mac" -o -z "$mac_offset" ] && return
[ -n "$chksum_offset" ] && {
xor_mac=${mac//:/}
xor_mac="${xor_mac:0:4} ${xor_mac:4:4} ${xor_mac:8:4}"
xor_fw_mac=$(hexdump -v -n 6 -s $mac_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
xor_fw_mac="${xor_fw_mac:0:4} ${xor_fw_mac:4:4} ${xor_fw_mac:8:4}"
xor_fw_chksum=$(hexdump -v -n 2 -s $chksum_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
xor_fw_chksum=$(xor $xor_fw_chksum $xor_fw_mac $xor_mac)
printf "%b" "\x${xor_fw_chksum:0:2}\x${xor_fw_chksum:2:2}" | \
dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=$(($chksum_offset)) count=2
}
macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc oflag=seek_bytes bs=6 seek=$mac_offset count=1
}
ath9k_patch_fw_mac_crc() {
local mac=$1
local mac_offset=$2
local chksum_offset=$((mac_offset - 10))
ath9k_patch_fw_mac "${mac}" "${mac_offset}" "${chksum_offset}"
}
. /lib/functions/caldata.sh
board=$(board_name)
@ -75,11 +20,11 @@ case "$FIRMWARE" in
tplink,tl-wa901nd-v1|\
tplink,tl-wr841-v5|\
tplink,tl-wr941-v4)
ath9k_eeprom_extract "art" 0x1000 0xeb8
caldata_extract "art" 0x1000 0xeb8
;;
dlink,dir-615-e4)
ath9k_eeprom_extract "art" 0x1000 0x1000
ath9k_patch_fw_mac_crc $(mtd_get_mac_ascii "nvram" "lan_mac") 0x10c
caldata_extract "art" 0x1000 0x1000
ath9k_patch_mac_crc $(mtd_get_mac_ascii "nvram" "lan_mac") 0x10c
;;
netgear,wnr1000-v2|\
netgear,wnr2000-v3|\
@ -92,13 +37,13 @@ case "$FIRMWARE" in
tplink,tl-wr741-v1|\
tplink,tl-wr743nd-v1|\
tplink,tl-wr841-v7)
ath9k_eeprom_extract "art" 0x1000 0x1000
caldata_extract "art" 0x1000 0x1000
;;
pqi,air-pen)
ath9k_eeprom_extract "art" 0x1000 0x7d2
caldata_extract "art" 0x1000 0x7d2
;;
*)
ath9k_eeprom_die "board $board is not supported yet"
caldata_die "board $board is not supported yet"
;;
esac
;;