Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2025-02-28 21:09:43 +08:00
commit 9c37def39a
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
18 changed files with 762 additions and 43 deletions

View File

@ -739,6 +739,10 @@ define Build/zip
rm -rf $@.tmp
endef
define Build/zyimage
$(STAGING_DIR_HOST)/bin/zyimage $(1) $@
endef
define Build/zyxel-ras-image
let \
newsize="$(call exp_units,$(RAS_ROOTFS_SIZE))"; \

View File

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=r8125
PKG_VERSION:=9.014.01
PKG_VERSION:=9.015.00
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/openwrt/rtl8125/releases/download/$(PKG_VERSION)
PKG_HASH:=f006aa95501738ca55c522812c9d1b473ac781675f3ad88ce341a09316b8aa13
PKG_HASH:=7d6906336c3ad960c3e7c0299ad655659d7110bdc933c5b568b7f2536cb8ffc3
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPLv2

View File

@ -18,11 +18,12 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
--- a/src/r8125.h
+++ b/src/r8125.h
@@ -1672,6 +1672,8 @@ enum RTL8125_register_content {
@@ -1687,6 +1687,9 @@ enum RTL8125_register_content {
LinkStatus = 0x02,
FullDup = 0x01,
+#define RTL8125_FULL_DUPLEX_MASK (_2500bpsF | _1000bpsF | FullDup)
+#define RTL8125_SPEED_1000_MASK (_1000bpsF | _1000bpsL | _2500bpsL)
+
/* DBG_reg */
Fix_Nak_1 = (1 << 4),
@ -37,11 +38,11 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
@@ -5116,6 +5117,38 @@ rtl8125_link_down_patch(struct net_devic
@@ -5023,6 +5024,38 @@ rtl8125_link_down_patch(struct net_devic
#endif
}
+static unsigned int rtl8125_phy_duplex(u16 status)
+static unsigned int rtl8125_phy_duplex(u32 status)
+{
+ unsigned int duplex = DUPLEX_UNKNOWN;
+
@ -55,14 +56,14 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+ return duplex;
+}
+
+static int rtl8125_phy_speed(u16 status)
+static int rtl8125_phy_speed(u32 status)
+{
+ int speed = SPEED_UNKNOWN;
+
+ if (status & LinkStatus) {
+ if (status & _2500bpsF)
+ speed = SPEED_2500;
+ else if (status & _1000bpsF)
+ else if (status & RTL8125_SPEED_1000_MASK)
+ speed = SPEED_1000;
+ else if (status & _100bps)
+ speed = SPEED_100;
@ -76,14 +77,14 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
static void
_rtl8125_check_link_status(struct net_device *dev, unsigned int link_state)
{
@@ -5128,11 +5161,18 @@ _rtl8125_check_link_status(struct net_de
@@ -5035,11 +5068,18 @@ _rtl8125_check_link_status(struct net_de
if (link_state == R8125_LINK_STATE_ON) {
rtl8125_link_on_patch(dev);
- if (netif_msg_ifup(tp))
- printk(KERN_INFO PFX "%s: link up\n", dev->name);
+ if (netif_msg_ifup(tp)) {
+ const u16 phy_status = RTL_R16(tp, PHYstatus);
+ const u32 phy_status = RTL_R32(tp, PHYstatus);
+ const unsigned int phy_duplex = rtl8125_phy_duplex(phy_status);
+ const int phy_speed = rtl8125_phy_speed(phy_status);
+ printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n",

View File

@ -8,7 +8,7 @@
#include <linux/if_vlan.h>
#include <linux/crc32.h>
#include <linux/interrupt.h>
@@ -14755,6 +14756,25 @@ rtl8125_setup_mqs_reg(struct rtl8125_pri
@@ -14221,6 +14222,25 @@ rtl8125_setup_mqs_reg(struct rtl8125_pri
tp->imr_reg[i] = (u16)(IMR1_8125 + (i - 1) * 4);
}
@ -34,7 +34,7 @@
static void
rtl8125_init_software_variable(struct net_device *dev)
{
@@ -15358,6 +15378,8 @@ rtl8125_init_software_variable(struct ne
@@ -14677,6 +14697,8 @@ rtl8125_init_software_variable(struct ne
else if (tp->InitRxDescType == RX_DESC_RING_TYPE_4)
tp->rtl8125_rx_config &= ~EnableRxDescV4_1;

View File

@ -1,6 +1,6 @@
--- a/src/r8125_n.c
+++ b/src/r8125_n.c
@@ -16423,6 +16423,7 @@ rtl8125_init_board(struct pci_dev *pdev,
@@ -15723,6 +15723,7 @@ rtl8125_init_board(struct pci_dev *pdev,
void __iomem *ioaddr;
struct net_device *dev;
struct rtl8125_private *tp;
@ -8,7 +8,7 @@
int rc = -ENOMEM, i, pm_cap;
assert(ioaddr_out != NULL);
@@ -16437,6 +16438,9 @@ rtl8125_init_board(struct pci_dev *pdev,
@@ -15737,6 +15738,9 @@ rtl8125_init_board(struct pci_dev *pdev,
goto err_out;
}

View File

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=r8126
PKG_VERSION:=10.014.01
PKG_VERSION:=10.015.00
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/openwrt/rtl8126/releases/download/$(PKG_VERSION)
PKG_HASH:=dbb10a7abd0972e4abd1b89ea4eb22fc55d6c1dc2f711b5acf4a3bc376275e21
PKG_HASH:=fac513aa925264a95b053e7532fcda56022d29db288f6625fafee2759a8a6124
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPLv2

View File

@ -18,11 +18,13 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
--- a/src/r8126.h
+++ b/src/r8126.h
@@ -1740,6 +1740,8 @@ enum RTL8126_register_content {
@@ -1756,6 +1756,10 @@ enum RTL8126_register_content {
LinkStatus = 0x02,
FullDup = 0x01,
+#define RTL8126_FULL_DUPLEX_MASK (_5000bpsF | _2500bpsF | _1000bpsF | FullDup)
+#define RTL8126_SPEED_1000_MASK (_1000bpsF | _1000bpsL | _2500bpsL)
+#define RTL8126_SPEED_2500_MASK (_2500bpsF | _5000bpsL)
+
/* DBG_reg */
Fix_Nak_1 = (1 << 4),
@ -37,11 +39,11 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
@@ -4744,6 +4745,40 @@ rtl8126_link_down_patch(struct net_devic
@@ -4661,6 +4662,40 @@ rtl8126_link_down_patch(struct net_devic
#endif
}
+static unsigned int rtl8126_phy_duplex(u16 status)
+static unsigned int rtl8126_phy_duplex(u32 status)
+{
+ unsigned int duplex = DUPLEX_UNKNOWN;
+
@ -55,16 +57,16 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+ return duplex;
+}
+
+static int rtl8126_phy_speed(u16 status)
+static int rtl8126_phy_speed(u32 status)
+{
+ int speed = SPEED_UNKNOWN;
+
+ if (status & LinkStatus) {
+ if (status & _5000bpsF)
+ speed = SPEED_5000;
+ else if (status & _2500bpsF)
+ else if (status & RTL8126_SPEED_2500_MASK)
+ speed = SPEED_2500;
+ else if (status & _1000bpsF)
+ else if (status & RTL8126_SPEED_1000_MASK)
+ speed = SPEED_1000;
+ else if (status & _100bps)
+ speed = SPEED_100;
@ -78,14 +80,14 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
static void
_rtl8126_check_link_status(struct net_device *dev, unsigned int link_state)
{
@@ -4756,11 +4791,18 @@ _rtl8126_check_link_status(struct net_de
@@ -4673,11 +4708,18 @@ _rtl8126_check_link_status(struct net_de
if (link_state == R8126_LINK_STATE_ON) {
rtl8126_link_on_patch(dev);
- if (netif_msg_ifup(tp))
- printk(KERN_INFO PFX "%s: link up\n", dev->name);
+ if (netif_msg_ifup(tp)) {
+ const u16 phy_status = RTL_R16(tp, PHYstatus);
+ const u32 phy_status = RTL_R32(tp, PHYstatus);
+ const unsigned int phy_duplex = rtl8126_phy_duplex(phy_status);
+ const int phy_speed = rtl8126_phy_speed(phy_status);
+ printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n",

View File

@ -8,7 +8,7 @@
#include <linux/if_vlan.h>
#include <linux/crc32.h>
#include <linux/interrupt.h>
@@ -12282,6 +12283,25 @@ rtl8126_setup_mqs_reg(struct rtl8126_pri
@@ -11910,6 +11911,25 @@ rtl8126_setup_mqs_reg(struct rtl8126_pri
tp->imr_reg[i] = (u16)(IMR1_8125 + (i - 1) * 4);
}
@ -34,7 +34,7 @@
static void
rtl8126_init_software_variable(struct net_device *dev)
{
@@ -12688,6 +12708,8 @@ rtl8126_init_software_variable(struct ne
@@ -12188,6 +12208,8 @@ rtl8126_init_software_variable(struct ne
else if (tp->InitRxDescType == RX_DESC_RING_TYPE_4)
tp->rtl8126_rx_config &= ~EnableRxDescV4_1;

View File

@ -1,6 +1,6 @@
--- a/src/r8126_n.c
+++ b/src/r8126_n.c
@@ -13740,6 +13740,7 @@ rtl8126_init_board(struct pci_dev *pdev,
@@ -13226,6 +13226,7 @@ rtl8126_init_board(struct pci_dev *pdev,
void __iomem *ioaddr;
struct net_device *dev;
struct rtl8126_private *tp;
@ -8,7 +8,7 @@
int rc = -ENOMEM, i, pm_cap;
assert(ioaddr_out != NULL);
@@ -13754,6 +13755,9 @@ rtl8126_init_board(struct pci_dev *pdev,
@@ -13240,6 +13241,9 @@ rtl8126_init_board(struct pci_dev *pdev,
goto err_out;
}

View File

@ -8,7 +8,7 @@
#include <linux/if_vlan.h>
#include <linux/crc32.h>
#include <linux/interrupt.h>
@@ -26097,6 +26098,22 @@ rtl8168_setup_mqs_reg(struct rtl8168_pri
@@ -26135,6 +26136,22 @@ rtl8168_setup_mqs_reg(struct rtl8168_pri
tp->imr_reg[3] = IntrMask3;
}
@ -31,7 +31,7 @@
static void
rtl8168_init_software_variable(struct net_device *dev)
{
@@ -26792,6 +26809,8 @@ err1:
@@ -26852,6 +26869,8 @@ err1:
if (tp->InitRxDescType == RX_DESC_RING_TYPE_2)
tp->RxDescLength = RX_DESC_LEN_TYPE_2;

View File

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=omcproxy
PKG_RELEASE:=9
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/omcproxy.git
PKG_MIRROR_HASH:=61f03d76b14149e417360b6aaa630e920b75a31a6a497353b7160b3a374b20b2
PKG_SOURCE_DATE:=2021-11-04
PKG_SOURCE_VERSION:=bfba2aa75802ff1a70ef2fd3eba53409a8c6e93a
PKG_MIRROR_HASH:=b18c6dcc323dc35cfeb3503562dd3d8b9fb27fcf6ddd98690a64bd709920ff3d
PKG_SOURCE_DATE:=2025-02-27
PKG_SOURCE_VERSION:=582cd8d3ae7e6af0073ce1d9198387af48affd60
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_LICENSE:=Apache-2.0

View File

@ -0,0 +1,368 @@
// SPDX-License-Identifier: GPL-2.0-only OR MIT
/dts-v1/;
#include "mt7981.dtsi"
/ {
model = "Keenetic KN-3811";
compatible = "keenetic,kn-3811", "mediatek,mt7981";
aliases {
label-mac-device = &gmac0;
led-boot = &power_led;
led-failsafe = &power_led;
led-running = &power_led;
led-upgrade = &power_led;
serial0 = &uart0;
};
chosen {
stdout-path = "serial0:115200n8";
};
gpio-keys {
compatible = "gpio-keys";
button-fn {
label = "fn";
linux,code = <BTN_0>;
gpios = <&pio 5 GPIO_ACTIVE_LOW>;
};
button-reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&pio 24 GPIO_ACTIVE_LOW>;
};
button-wps {
label = "wps";
linux,code = <KEY_WPS_BUTTON>;
gpios = <&pio 29 GPIO_ACTIVE_LOW>;
};
};
gpio-leds {
compatible = "gpio-leds";
/* fn led reassigned to wlan 2.4 */
led-0 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WLAN_2GHZ;
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
power_led: led-1 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_POWER;
gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
};
led-2 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WAN;
gpios = <&pio 12 GPIO_ACTIVE_LOW>;
};
led-3 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WLAN_5GHZ;
gpios = <&pio 34 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
};
usb_vbus: regulator-usb-vbus {
compatible = "regulator-fixed";
regulator-name = "usb_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpios = <&pio 6 GPIO_ACTIVE_HIGH>;
enable-active-high;
regulator-boot-on;
};
virtual_flash {
compatible = "mtd-concat";
devices = <&firmware1 &storage1 &firmware2 &storage2>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "kernel";
reg = <0x0 0x600000>;
};
partition@400000 {
label = "ubi";
reg = <0x600000 0x0>;
};
};
};
};
&uart0 {
status = "okay";
};
&watchdog {
status = "okay";
};
&eth {
status = "okay";
gmac0: mac@0 {
compatible = "mediatek,eth-mac";
reg = <0>;
phy-mode = "2500base-x";
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_factory_4 0>;
fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};
gmac1: mac@1 {
compatible = "mediatek,eth-mac";
reg = <1>;
phy-mode = "gmii";
phy-handle = <&int_gbe_phy>;
label = "wan";
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_factory_a 0>;
};
};
&mdio_bus {
switch: switch@1f {
compatible = "mediatek,mt7531";
reg = <0x1f>;
reset-gpios = <&pio 22 GPIO_ACTIVE_HIGH>;
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&pio>;
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
};
};
&switch {
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
label = "lan1";
};
port@1 {
reg = <1>;
label = "lan2";
};
port@2 {
reg = <2>;
label = "lan3";
};
port@6 {
reg = <6>;
ethernet = <&gmac0>;
phy-mode = "2500base-x";
fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};
};
};
&pio {
spi0_flash_pins: spi0-pins {
mux {
function = "spi";
groups = "spi0", "spi0_wp_hold";
};
conf-pu {
pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
};
conf-pd {
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
};
};
};
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_flash_pins>;
status = "okay";
/* Winbond W25N02KV (256M) */
spi_nand@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <52000000>;
spi-tx-buswidth = <4>;
spi-rx-buswidth = <4>;
spi-cal-enable;
spi-cal-mode = "read-data";
spi-cal-datalen = <7>;
spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4e 0x41 0x4e 0x44>;
spi-cal-addrlen = <5>;
spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
mediatek,nmbm;
mediatek,bmt-max-ratio = <1>;
mediatek,bmt-max-reserved-blocks = <64>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* bl2 */
partition@0 {
label = "preloader";
reg = <0x0 0x80000>;
read-only;
};
/* fip */
partition@80000 {
label = "u-boot";
reg = <0x80000 0x200000>;
read-only;
};
partition@280000 {
label = "u-config";
reg = <0x280000 0x80000>;
read-only;
};
partition@300000 {
label = "rf-eeprom";
reg = <0x300000 0x200000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
eeprom_factory_0: eeprom@0 {
reg = <0x0 0x1000>;
};
/* lan mac */
macaddr_factory_4: macaddr@4 {
compatible = "mac-base";
reg = <0x4 0x6>;
#nvmem-cell-cells = <1>;
};
/* wan mac */
macaddr_factory_a: macaddr@a {
compatible = "mac-base";
reg = <0xa 0x6>;
#nvmem-cell-cells = <1>;
};
};
};
firmware1: partition@500000 {
label = "firmware_1";
reg = <0x500000 0x3a00000>;
};
partition@3f00000 {
label = "config_1";
reg = <0x3f00000 0x80000>;
read-only;
};
partition@3f80000 {
label = "dump";
reg = <0x3f80000 0x80000>;
read-only;
};
storage1: partition@4000000 {
label = "storage_a";
reg = <0x4000000 0x3800000>;
};
partition@7800000 {
label = "u-state";
reg = <0x7800000 0x20000>;
read-only;
};
partition@7a80000 {
label = "u-config_res";
reg = <0x7a80000 0x80000>;
read-only;
};
partition@7b00000 {
label = "rf-eeprom_res";
reg = <0x7b00000 0x200000>;
read-only;
};
firmware2: partition@7d00000 {
label = "firmware_2";
reg = <0x7d00000 0x3a00000>;
};
partition@b700000 {
label = "config_2";
reg = <0xb700000 0x80000>;
read-only;
};
storage2: partition@b780000 {
label = "storage_b";
reg = <0xb780000 0x3880000>;
};
};
};
};
&wifi {
nvmem-cell-names = "eeprom";
nvmem-cells = <&eeprom_factory_0>;
status = "okay";
};
&usb_phy {
status = "okay";
};
&xhci {
status = "okay";
vbus-supply = <&usb_vbus>;
};

View File

@ -0,0 +1,300 @@
// SPDX-License-Identifier: GPL-2.0-only OR MIT
/dts-v1/;
#include "mt7981.dtsi"
/ {
model = "Keenetic KN-3911";
compatible = "keenetic,kn-3911", "mediatek,mt7981";
aliases {
label-mac-device = &gmac0;
led-boot = &status_led;
led-failsafe = &status_led;
led-running = &status_led;
led-upgrade = &status_led;
serial0 = &uart0;
};
chosen {
stdout-path = "serial0:115200n8";
};
gpio-keys {
compatible = "gpio-keys";
button-fn {
label = "fn";
linux,code = <BTN_0>;
gpios = <&pio 0 GPIO_ACTIVE_LOW>;
};
button-reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&pio 24 GPIO_ACTIVE_LOW>;
};
button-wps {
label = "wps";
linux,code = <KEY_WPS_BUTTON>;
gpios = <&pio 29 GPIO_ACTIVE_LOW>;
};
};
gpio-leds {
compatible = "gpio-leds";
status_led: led-0 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
};
led-1 {
color = <LED_COLOR_ID_ORANGE>;
function = LED_FUNCTION_WPS;
gpios = <&pio 12 GPIO_ACTIVE_LOW>;
};
};
virtual_flash {
compatible = "mtd-concat";
devices = <&firmware1 &firmware2>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "kernel";
reg = <0x0 0x600000>;
};
partition@400000 {
label = "ubi";
reg = <0x600000 0x0>;
};
};
};
};
&uart0 {
status = "okay";
};
&watchdog {
status = "okay";
};
&eth {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&mdio_pins>;
gmac0: mac@0 {
compatible = "mediatek,eth-mac";
reg = <0>;
phy-mode = "2500base-x";
phy-handle = <&phy10>;
label = "lan";
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_factory_4 0>;
};
gmac1: mac@1 {
compatible = "mediatek,eth-mac";
reg = <1>;
phy-mode = "2500base-x";
phy-handle = <&phy11>;
label = "wan";
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_factory_a 0>;
};
};
&mdio_bus {
phy10: ethernet-phy@a {
reg = <0xa>;
interrupt-parent = <&pio>;
interrupts = <38 IRQ_TYPE_EDGE_FALLING>;
reset-gpios = <&pio 22 GPIO_ACTIVE_LOW>;
reset-assert-us = <10000>;
reset-deassert-us = <20000>;
};
phy11: ethernet-phy@b {
reg = <0xb>;
interrupt-parent = <&pio>;
interrupts = <23 IRQ_TYPE_EDGE_FALLING>;
reset-gpios = <&pio 27 GPIO_ACTIVE_LOW>;
reset-assert-us = <10000>;
reset-deassert-us = <20000>;
};
};
&pio {
spi0_flash_pins: spi0-pins {
mux {
function = "spi";
groups = "spi0", "spi0_wp_hold";
};
conf-pu {
pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
};
conf-pd {
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
};
};
};
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_flash_pins>;
status = "okay";
/* Winbond W25N01GVZEIG (128M) */
spi_nand@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <52000000>;
spi-tx-buswidth = <4>;
spi-rx-buswidth = <4>;
spi-cal-enable;
spi-cal-mode = "read-data";
spi-cal-datalen = <7>;
spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4e 0x41 0x4e 0x44>;
spi-cal-addrlen = <5>;
spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
mediatek,nmbm;
mediatek,bmt-max-ratio = <1>;
mediatek,bmt-max-reserved-blocks = <64>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* bl2 */
partition@0 {
label = "preloader";
reg = <0x0 0x80000>;
read-only;
};
/* fip */
partition@80000 {
label = "u-boot";
reg = <0x80000 0x200000>;
read-only;
};
partition@280000 {
label = "u-config";
reg = <0x280000 0x80000>;
read-only;
};
partition@300000 {
label = "rf-eeprom";
reg = <0x300000 0x200000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
eeprom_factory_0: eeprom@0 {
reg = <0x0 0x1000>;
};
/* lan mac */
macaddr_factory_4: macaddr@4 {
compatible = "mac-base";
reg = <0x4 0x6>;
#nvmem-cell-cells = <1>;
};
/* wan mac */
macaddr_factory_a: macaddr@a {
compatible = "mac-base";
reg = <0xa 0x6>;
#nvmem-cell-cells = <1>;
};
};
};
firmware1: partition@500000 {
label = "firmware_1";
reg = <0x500000 0x3500000>;
};
partition@3a00000 {
label = "config_1";
reg = <0x3a00000 0x80000>;
read-only;
};
partition@3a80000 {
label = "dump";
reg = <0x3a80000 0x80000>;
read-only;
};
partition@3c00000 {
label = "u-state";
reg = <0x3c00000 0x20000>;
read-only;
};
partition@3e80000 {
label = "u-config_res";
reg = <0x3e80000 0x80000>;
read-only;
};
partition@3f00000 {
label = "rf-eeprom_res";
reg = <0x3f00000 0x200000>;
read-only;
};
firmware2: partition@4100000 {
label = "firmware_2";
reg = <0x4140000 0x3500000>;
};
partition@7600000 {
label = "config_2";
reg = <0x7600000 0x80000>;
read-only;
};
};
};
};
&wifi {
nvmem-cell-names = "eeprom";
nvmem-cells = <&eeprom_factory_0>;
status = "okay";
};
&sgmiisys0 {
/delete-node/ mediatek,pnswap;
};

View File

@ -39,6 +39,7 @@ mediatek_setup_interfaces()
confiabits,mt7981|\
cudy,wr3000-v1|\
jcg,q30-pro|\
keenetic,kn3811|\
livinet,zr-3020|\
livinet,zr-3020-ubootmod|\
qihoo,360t7|\
@ -102,6 +103,13 @@ mediatek_setup_interfaces()
dlink,aquila-pro-ai-m60-a1)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" internet
;;
keenetic,kn-3911|\
smartrg,sdg-8622|\
smartrg,sdg-8632|\
smartrg,sdg-8733a|\
yuncore,ax835)
ucidef_set_interfaces_lan_wan lan wan
;;
mediatek,mt7986a-rfb)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan6" "eth1 wan"
;;
@ -115,12 +123,6 @@ mediatek_setup_interfaces()
mercusys,mr90x-v1-ubi)
ucidef_set_interfaces_lan_wan "lan0 lan1 lan2" eth1
;;
smartrg,sdg-8622|\
smartrg,sdg-8632|\
smartrg,sdg-8733a|\
yuncore,ax835)
ucidef_set_interfaces_lan_wan lan wan
;;
tplink,tl-xdr6086|\
wavlink,wl-wn586x3)
ucidef_set_interfaces_lan_wan "lan1 lan2" eth1

View File

@ -109,6 +109,11 @@ case "$board" in
jdcloud,re-cp-03)
[ "$PHYNBR" = "1" ] && mmc_get_mac_binary factory 0xa > /sys${DEVPATH}/macaddress
;;
keenetic,kn-3811|\
keenetic,kn-3911)
[ "$PHYNBR" = "1" ] && \
macaddr_setbit_la "$(mtd_get_mac_binary rf-eeprom 0x4)" > /sys${DEVPATH}/macaddress
;;
mercusys,mr90x-v1|\
tplink,re6000xd)
addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0)

View File

@ -272,6 +272,7 @@ CONFIG_MTD_UBI_BLOCK=y
CONFIG_MTD_UBI_FASTMAP=y
CONFIG_MTD_UBI_NVMEM=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_VIRT_CONCAT=y
# CONFIG_MTK_CMDQ is not set
CONFIG_MTK_CPUX_TIMER=y
# CONFIG_MTK_CQDMA is not set

View File

@ -1112,6 +1112,46 @@ define Device/jdcloud_re-cp-03
endef
TARGET_DEVICES += jdcloud_re-cp-03
define Device/keenetic_kn-3811
DEVICE_VENDOR := Keenetic
DEVICE_MODEL := KN-3811
DEVICE_DTS := mt7981b-keenetic-kn-3811
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 6144k
IMAGE_SIZE := 233984k
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \
append-squashfs4-fakeroot
IMAGES += factory.bin
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | \
append-ubi | check-size | zyimage -d 0x803811 -v "KN-3811"
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += keenetic_kn-3811
define Device/keenetic_kn-3911
DEVICE_VENDOR := Keenetic
DEVICE_MODEL := KN-3911
DEVICE_DTS := mt7981b-keenetic-kn-3911
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-phy-airoha-en8811h
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 6144k
IMAGE_SIZE := 108544k
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \
append-squashfs4-fakeroot
IMAGES += factory.bin
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | \
append-ubi | check-size | zyimage -d 0x803911 -v "KN-3911"
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += keenetic_kn-3911
define Device/konka_komi-a31
DEVICE_VENDOR := Konka
DEVICE_MODEL := KOMI A31

View File

@ -167,10 +167,6 @@ define Build/wrg-header
mv $@.new $@
endef
define Build/zyimage
$(STAGING_DIR_HOST)/bin/zyimage $(1) $@
endef
define Device/Default
PROFILES = Default
BLOCKSIZE := 64k