Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
b44e7421d6
@ -47,6 +47,7 @@ apk = \
|
||||
IPKG_INSTROOT=$(1) \
|
||||
$(FAKEROOT) $(STAGING_DIR_HOST)/bin/apk \
|
||||
--root $(1) \
|
||||
--repositories-file /dev/zero \
|
||||
--keys-dir $(TOPDIR) \
|
||||
--no-cache \
|
||||
--no-logfile \
|
||||
@ -111,7 +112,6 @@ define prepare_rootfs
|
||||
)
|
||||
|
||||
@-find $(1) -name CVS -o -name .svn -o -name .git -o -name '.#*' | $(XARGS) rm -rf
|
||||
@-find $(1)/usr/cache/apk/ -name '*.apk' -delete
|
||||
rm -rf \
|
||||
$(1)/boot \
|
||||
$(1)/tmp/* \
|
||||
|
@ -160,6 +160,14 @@ define Trusted-Firmware-A/mt7981-ram-ddr3
|
||||
DEFAULT:=TARGET_mediatek_filogic
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7981-nor-ddr4
|
||||
NAME:=MediaTek MT7981 (SPI-NOR, DDR4)
|
||||
BOOT_DEVICE:=nor
|
||||
BUILD_SUBTARGET:=filogic
|
||||
PLAT:=mt7981
|
||||
DDR_TYPE:=ddr4
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7981-emmc-ddr3
|
||||
NAME:=MediaTek MT7981 (eMMC, DDR3)
|
||||
BOOT_DEVICE:=emmc
|
||||
@ -203,6 +211,15 @@ define Trusted-Firmware-A/mt7986-ram-ddr4
|
||||
DEFAULT:=TARGET_mediatek_filogic
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7981-spim-nand-ubi-ddr4
|
||||
NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR4)
|
||||
BOOT_DEVICE:=spim-nand
|
||||
BUILD_SUBTARGET:=filogic
|
||||
PLAT:=mt7981
|
||||
DDR_TYPE:=ddr4
|
||||
USE_UBI:=1
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7986-nor-ddr4
|
||||
NAME:=MediaTek MT7986 (SPI-NOR, DDR4)
|
||||
BOOT_DEVICE:=nor
|
||||
@ -477,9 +494,11 @@ TFA_TARGETS:= \
|
||||
mt7981-ram-ddr3 \
|
||||
mt7981-emmc-ddr3 \
|
||||
mt7981-nor-ddr3 \
|
||||
mt7981-nor-ddr4 \
|
||||
mt7981-sdmmc-ddr3 \
|
||||
mt7981-snand-ddr3 \
|
||||
mt7981-spim-nand-ddr3 \
|
||||
mt7981-spim-nand-ubi-ddr4 \
|
||||
mt7981-ram-ddr4 \
|
||||
mt7981-emmc-ddr4 \
|
||||
mt7981-spim-nand-ddr4 \
|
||||
@ -527,6 +546,7 @@ TFA_MAKE_FLAGS += \
|
||||
$(if $(DRAM_USE_COMB),DRAM_USE_COMB=1) \
|
||||
$(if $(RAM_BOOT_UART_DL),RAM_BOOT_UART_DL=1) \
|
||||
$(if $(USE_UBI),UBI=1 $(if $(findstring mt7622,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x80000)) \
|
||||
$(if $(USE_UBI),UBI=1 $(if $(findstring mt7981,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x100000)) \
|
||||
all
|
||||
|
||||
define Package/trusted-firmware-a-ram/install
|
||||
|
@ -279,6 +279,31 @@ define U-Boot/mt7981_nokia_ea0326gmp
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_openwrt_one-snand
|
||||
NAME:=OpenWrt One NAND
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=openwrt_one
|
||||
UBOOT_CONFIG:=mt7981_openwrt-one-spi-nand
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=spim-nand-ubi
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr4
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ubi-ddr4
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_openwrt_one-nor
|
||||
NAME:=OpenWrt One NOR
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=openwrt_one
|
||||
UBOOT_CONFIG:=mt7981_openwrt-one-nor
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=nor
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr4
|
||||
FIP_COMPRESS:=1
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-nor-ddr4
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_rfb-spim-nand
|
||||
NAME:=MT7981 Reference Board
|
||||
BUILD_SUBTARGET:=filogic
|
||||
@ -714,6 +739,8 @@ UBOOT_TARGETS := \
|
||||
mt7981_h3c_magic-nx30-pro \
|
||||
mt7981_jcg_q30-pro \
|
||||
mt7981_nokia_ea0326gmp \
|
||||
mt7981_openwrt_one-snand \
|
||||
mt7981_openwrt_one-nor \
|
||||
mt7981_rfb-spim-nand \
|
||||
mt7981_rfb-emmc \
|
||||
mt7981_rfb-nor \
|
||||
|
@ -0,0 +1,76 @@
|
||||
From cca5775031e4890f195246772e00f7f4ae7438f6 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Mon, 19 Feb 2024 05:52:24 +0100
|
||||
Subject: [PATCH 1/2] mt7981.dtsi: add USB nodes
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
arch/arm/dts/mt7981.dtsi | 47 ++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 47 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/dts/mt7981.dtsi b/arch/arm/dts/mt7981.dtsi
|
||||
index bda80ac9..6f4e5b9f 100644
|
||||
--- a/arch/arm/dts/mt7981.dtsi
|
||||
+++ b/arch/arm/dts/mt7981.dtsi
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
+#include <dt-bindings/phy/phy.h>
|
||||
#include <dt-bindings/clock/mt7981-clk.h>
|
||||
#include <dt-bindings/reset/mt7629-reset.h>
|
||||
#include <dt-bindings/pinctrl/mt65xx.h>
|
||||
@@ -342,4 +343,50 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
+ xhci: xhci@11200000 {
|
||||
+ compatible = "mediatek,mt7981-xhci",
|
||||
+ "mediatek,mtk-xhci";
|
||||
+ reg = <0x11200000 0x2e00>,
|
||||
+ <0x11203e00 0x0100>;
|
||||
+ reg-names = "mac", "ippc";
|
||||
+ interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ phys = <&u2port0 PHY_TYPE_USB2>,
|
||||
+ <&u3port0 PHY_TYPE_USB3>;
|
||||
+ clocks = <&infracfg_ao CK_INFRA_IUSB_SYS_CK>,
|
||||
+ <&infracfg_ao CK_INFRA_IUSB_CK>,
|
||||
+ <&infracfg_ao CK_INFRA_IUSB_133_CK>,
|
||||
+ <&infracfg_ao CK_INFRA_IUSB_66M_CK>,
|
||||
+ <&topckgen CK_TOP_U2U3_XHCI_SEL>;
|
||||
+ clock-names = "sys_ck",
|
||||
+ "ref_ck",
|
||||
+ "mcu_ck",
|
||||
+ "dma_ck",
|
||||
+ "xhci_ck";
|
||||
+ mediatek,u3p-dis-msk = <0x1>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ usbtphy: usb-phy@11e10000 {
|
||||
+ compatible = "mediatek,mt7981",
|
||||
+ "mediatek,generic-tphy-v2";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ u2port0: usb-phy@11e10000 {
|
||||
+ reg = <0x11e10000 0x700>;
|
||||
+ clocks = <&topckgen CK_TOP_USB_FRMCNT_SEL>;
|
||||
+ clock-names = "ref";
|
||||
+ #phy-cells = <1>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ u3port0: usb-phy@11e10700 {
|
||||
+ reg = <0x11e10700 0x900>;
|
||||
+ clocks = <&topckgen CK_TOP_USB3_PHY_SEL>;
|
||||
+ clock-names = "ref";
|
||||
+ #phy-cells = <1>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
--
|
||||
2.34.1
|
||||
|
3949
package/boot/uboot-mediatek/patches/453-add-openwrt-one.patch
Normal file
3949
package/boot/uboot-mediatek/patches/453-add-openwrt-one.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -136,7 +136,7 @@ $(eval $(call BuildPackage,rtl8761bu-firmware))
|
||||
Package/rtl8821ae-firmware = $(call Package/firmware-default,RealTek RTL8821AE firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8821ae-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8821aefw.bin $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8821aefw_29.bin $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8821aefw_wowlan.bin $(1)/lib/firmware/rtlwifi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8821ae-firmware))
|
||||
|
@ -1,14 +1,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wireless-regdb
|
||||
PKG_VERSION:=2024.01.23
|
||||
PKG_VERSION:=2024.05.08
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=ISC
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/
|
||||
PKG_HASH:=c8a61c9acf76fa7eb4239e89f640dee3e87098d9f69b4d3518c9c60fc6d20c55
|
||||
PKG_HASH:=9aee1d86ebebb363b714bec941b2820f31e3b7f1a485ddc9fcbd9985c7d3e7c4
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
|
@ -411,7 +411,7 @@ define KernelPackage/crypto-hw-ixp4xx
|
||||
KCONFIG:= \
|
||||
CONFIG_CRYPTO_HW=y \
|
||||
CONFIG_CRYPTO_DEV_IXP4XX
|
||||
FILES:=$(LINUX_DIR)/drivers/crypto/ixp4xx_crypto.ko
|
||||
FILES:=$(LINUX_DIR)/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ixp4xx_crypto)
|
||||
$(call AddDepends/crypto)
|
||||
endef
|
||||
|
@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2024-04-03
|
||||
PKG_SOURCE_VERSION:=1e336a8582dce2ef32ddd440d423e9afef961e71
|
||||
PKG_MIRROR_HASH:=276613540603dc6ece9d2474ae1899b6aaa6ca93bd27824056c9689c725f5890
|
||||
PKG_SOURCE_DATE:=2024-05-17
|
||||
PKG_SOURCE_VERSION:=513c131c6309712a51502870b041f45b4bd6a6d4
|
||||
PKG_MIRROR_HASH:=3e5d8ee6b8b122cc4e32668fdde0552a9fa23819b7ebdc758ecb63b5f761683a
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_USE_NINJA:=0
|
||||
@ -635,6 +635,11 @@ define Package/mt76-test/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/mt76-test $(1)/usr/sbin
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
mkdir -p $(STAGING_DIR_IMAGE)
|
||||
$(CP) $(PKG_BUILD_DIR)/firmware/mt7981_eeprom_mt7976_dbdc.bin $(STAGING_DIR_IMAGE)/
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,mt76-core))
|
||||
$(eval $(call KernelPackage,mt76-usb))
|
||||
$(eval $(call KernelPackage,mt76x02-usb))
|
||||
|
@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbpf
|
||||
PKG_VERSION:=1.4.1
|
||||
PKG_VERSION:=1.4.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/libbpf/libbpf
|
||||
PKG_MIRROR_HASH:=46469f720ed246529e46d84a6444ae1c1a1eaf2a717a5a055c9973bb52159ec3
|
||||
PKG_MIRROR_HASH:=eaf56a8d4297a1dfb477d91b4fb7c7c5ad6b6df73e0f7ac3c8fd93f2664c2e85
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=v1.4.1
|
||||
PKG_SOURCE_VERSION:=v1.4.2
|
||||
PKG_ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
|
||||
|
||||
PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
|
||||
|
@ -9,9 +9,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall4.git
|
||||
PKG_SOURCE_DATE:=2023-11-03
|
||||
PKG_SOURCE_VERSION:=698a53354fd280aae097efe08803c0c9a10c14c2
|
||||
PKG_MIRROR_HASH:=736b3d03cf0db1170242de20776b0095cc37d260108e4313f84eafb46b1be711
|
||||
PKG_SOURCE_DATE:=2024-05-21
|
||||
PKG_SOURCE_VERSION:=4c01d1ebf99e8ecfa69758a9b4f450ecef7b93cd
|
||||
PKG_MIRROR_HASH:=bbc5622bc03e3b43116fcc86e3fa2d2372bfc07b3a00d2b3a6efac4f7454a403
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=ISC
|
||||
|
||||
|
@ -5,9 +5,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL=https://gitlab.alpinelinux.org/alpine/apk-tools.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2024-05-18
|
||||
PKG_SOURCE_VERSION:=a6ce0a1be1a42a5cf4136eb0db5ea95168ee73fe
|
||||
PKG_MIRROR_HASH:=a5f59907cd742ec12f31f42910ea9a6ecfaf91e18218a7888836a01cfa272a72
|
||||
PKG_SOURCE_DATE:=2024-05-19
|
||||
PKG_SOURCE_VERSION:=825681118d05ca5801c6b3852a70a42499e57def
|
||||
PKG_MIRROR_HASH:=adc07e3320e8d780bbbd3d95d3c6c6ce259f3dbf97ab0a4ff9dc4853af21e04f
|
||||
|
||||
PKG_VERSION=3.0.0_pre$(subst -,,$(PKG_SOURCE_DATE))
|
||||
|
||||
|
@ -159,7 +159,11 @@ _call_manifest: FORCE
|
||||
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR)
|
||||
$(MAKE) package_reload >/dev/null
|
||||
$(MAKE) package_install >/dev/null
|
||||
ifeq ($(CONFIG_USE_APK),)
|
||||
$(OPKG) list-installed $(if $(STRIP_ABI),--strip-abi)
|
||||
else
|
||||
$(APK) list --quiet --manifest --no-network
|
||||
endif
|
||||
|
||||
package_index: FORCE
|
||||
@echo >&2
|
||||
@ -202,7 +206,11 @@ endif
|
||||
|
||||
package_list: FORCE
|
||||
@$(MAKE) -s package_reload
|
||||
ifeq ($(CONFIG_USE_APK),)
|
||||
@$(OPKG) list --size 2>/dev/null
|
||||
else
|
||||
@$(APK) list --size 2>/dev/null
|
||||
endif
|
||||
|
||||
package_install: FORCE
|
||||
@echo
|
||||
@ -277,8 +285,6 @@ endif
|
||||
|
||||
_check_keys: FORCE
|
||||
ifeq ($(CONFIG_USE_APK),)
|
||||
# TODO
|
||||
else
|
||||
ifneq ($(CONFIG_SIGNATURE_CHECK),)
|
||||
@if [ ! -s $(BUILD_KEY) -o ! -s $(BUILD_KEY).pub ]; then \
|
||||
echo Generate local signing keys... >&2; \
|
||||
@ -294,6 +300,8 @@ ifneq ($(CONFIG_SIGNATURE_CHECK),)
|
||||
-s $(BUILD_KEY); \
|
||||
fi
|
||||
endif
|
||||
else
|
||||
# TODO
|
||||
endif
|
||||
|
||||
image:
|
||||
|
@ -0,0 +1,73 @@
|
||||
From 81889eb2b37bc21df4ff259441e8fc12d4f27cd9 Mon Sep 17 00:00:00 2001
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Thu, 9 May 2024 08:48:31 +0200
|
||||
Subject: [PATCH] net: ethernet: cortina: Locking fixes
|
||||
|
||||
This fixes a probably long standing problem in the Cortina
|
||||
Gemini ethernet driver: there are some paths in the code
|
||||
where the IRQ registers are written without taking the proper
|
||||
locks.
|
||||
|
||||
Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet")
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
drivers/net/ethernet/cortina/gemini.c | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/cortina/gemini.c
|
||||
+++ b/drivers/net/ethernet/cortina/gemini.c
|
||||
@@ -1107,10 +1107,13 @@ static void gmac_tx_irq_enable(struct ne
|
||||
{
|
||||
struct gemini_ethernet_port *port = netdev_priv(netdev);
|
||||
struct gemini_ethernet *geth = port->geth;
|
||||
+ unsigned long flags;
|
||||
u32 val, mask;
|
||||
|
||||
netdev_dbg(netdev, "%s device %d\n", __func__, netdev->dev_id);
|
||||
|
||||
+ spin_lock_irqsave(&geth->irq_lock, flags);
|
||||
+
|
||||
mask = GMAC0_IRQ0_TXQ0_INTS << (6 * netdev->dev_id + txq);
|
||||
|
||||
if (en)
|
||||
@@ -1119,6 +1122,8 @@ static void gmac_tx_irq_enable(struct ne
|
||||
val = readl(geth->base + GLOBAL_INTERRUPT_ENABLE_0_REG);
|
||||
val = en ? val | mask : val & ~mask;
|
||||
writel(val, geth->base + GLOBAL_INTERRUPT_ENABLE_0_REG);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&geth->irq_lock, flags);
|
||||
}
|
||||
|
||||
static void gmac_tx_irq(struct net_device *netdev, unsigned int txq_num)
|
||||
@@ -1415,15 +1420,19 @@ static unsigned int gmac_rx(struct net_d
|
||||
union gmac_rxdesc_3 word3;
|
||||
struct page *page = NULL;
|
||||
unsigned int page_offs;
|
||||
+ unsigned long flags;
|
||||
unsigned short r, w;
|
||||
union dma_rwptr rw;
|
||||
dma_addr_t mapping;
|
||||
int frag_nr = 0;
|
||||
|
||||
+ spin_lock_irqsave(&geth->irq_lock, flags);
|
||||
rw.bits32 = readl(ptr_reg);
|
||||
/* Reset interrupt as all packages until here are taken into account */
|
||||
writel(DEFAULT_Q0_INT_BIT << netdev->dev_id,
|
||||
geth->base + GLOBAL_INTERRUPT_STATUS_1_REG);
|
||||
+ spin_unlock_irqrestore(&geth->irq_lock, flags);
|
||||
+
|
||||
r = rw.bits.rptr;
|
||||
w = rw.bits.wptr;
|
||||
|
||||
@@ -1726,10 +1735,9 @@ static irqreturn_t gmac_irq(int irq, voi
|
||||
gmac_update_hw_stats(netdev);
|
||||
|
||||
if (val & (GMAC0_RX_OVERRUN_INT_BIT << (netdev->dev_id * 8))) {
|
||||
+ spin_lock(&geth->irq_lock);
|
||||
writel(GMAC0_RXDERR_INT_BIT << (netdev->dev_id * 8),
|
||||
geth->base + GLOBAL_INTERRUPT_STATUS_4_REG);
|
||||
-
|
||||
- spin_lock(&geth->irq_lock);
|
||||
u64_stats_update_begin(&port->ir_stats_syncp);
|
||||
++port->stats.rx_fifo_errors;
|
||||
u64_stats_update_end(&port->ir_stats_syncp);
|
@ -0,0 +1,124 @@
|
||||
From 30fcba19ed88997a2909e4a68b4d39ff371357c3 Mon Sep 17 00:00:00 2001
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Wed, 1 May 2024 21:46:31 +0200
|
||||
Subject: [PATCH 1/5] net: ethernet: cortina: Restore TSO support
|
||||
|
||||
An earlier commit deleted the TSO support in the Cortina Gemini
|
||||
driver because the driver was confusing gso_size and MTU,
|
||||
probably because what the Linux kernel calls "gso_size" was
|
||||
called "MTU" in the datasheet.
|
||||
|
||||
Restore the functionality properly reading the gso_size from
|
||||
the skbuff.
|
||||
|
||||
Tested with iperf3, running a server on a different machine
|
||||
and client on the device with the cortina gemini ethernet:
|
||||
|
||||
Connecting to host 192.168.1.2, port 5201
|
||||
60008000.ethernet-port eth0: segment offloading mss = 05ea len=1c8a
|
||||
60008000.ethernet-port eth0: segment offloading mss = 05ea len=1c8a
|
||||
60008000.ethernet-port eth0: segment offloading mss = 05ea len=27da
|
||||
60008000.ethernet-port eth0: segment offloading mss = 05ea len=0b92
|
||||
60008000.ethernet-port eth0: segment offloading mss = 05ea len=2bda
|
||||
(...)
|
||||
|
||||
(The hardware MSS 0x05ea here includes the ethernet headers.)
|
||||
|
||||
If I disable all segment offloading on the receiving host and
|
||||
dump packets using tcpdump -xx like this:
|
||||
|
||||
ethtool -K enp2s0 gro off gso off tso off
|
||||
tcpdump -xx -i enp2s0 host 192.168.1.136
|
||||
|
||||
I get segmented packages such as this when running iperf3:
|
||||
|
||||
23:16:54.024139 IP OpenWrt.lan.59168 > Fecusia.targus-getdata1:
|
||||
Flags [.], seq 1486:2934, ack 1, win 4198,
|
||||
options [nop,nop,TS val 3886192908 ecr 3601341877], length 1448
|
||||
0x0000: fc34 9701 a0c6 14d6 4da8 3c4f 0800 4500
|
||||
0x0010: 05dc 16a0 4000 4006 9aa1 c0a8 0188 c0a8
|
||||
0x0020: 0102 e720 1451 ff25 9822 4c52 29cf 8010
|
||||
0x0030: 1066 ac8c 0000 0101 080a e7a2 990c d6a8
|
||||
(...)
|
||||
0x05c0: 5e49 e109 fe8c 4617 5e18 7a82 7eae d647
|
||||
0x05d0: e8ee ae64 dc88 c897 3f8a 07a4 3a33 6b1b
|
||||
0x05e0: 3501 a30f 2758 cc44 4b4a
|
||||
|
||||
Several such packets often follow after each other verifying
|
||||
the segmentation into 0x05a8 (1448) byte packages also on the
|
||||
reveiving end. As can be seen, the ethernet frames are
|
||||
0x05ea (1514) in size.
|
||||
|
||||
Performance with iperf3 before this patch: ~15.5 Mbit/s
|
||||
Performance with iperf3 after this patch: ~175 Mbit/s
|
||||
|
||||
This was running a 60 second test (twice) the best measurement
|
||||
was 179 Mbit/s.
|
||||
|
||||
For comparison if I run iperf3 with UDP I get around 1.05 Mbit/s
|
||||
both before and after this patch.
|
||||
|
||||
While this is a gigabit ethernet interface, the CPU is a cheap
|
||||
D-Link DIR-685 router (based on the ARMv5 Faraday FA526 at
|
||||
~50 MHz), and the software is not supposed to drive traffic,
|
||||
as the device has a DSA chip, so this kind of numbers can be
|
||||
expected.
|
||||
|
||||
Fixes: ac631873c9e7 ("net: ethernet: cortina: Drop TSO support")
|
||||
Reviewed-by: Eric Dumazet <edumazet@google.com>
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
drivers/net/ethernet/cortina/gemini.c | 23 +++++++++++++++++++----
|
||||
1 file changed, 19 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/cortina/gemini.c
|
||||
+++ b/drivers/net/ethernet/cortina/gemini.c
|
||||
@@ -79,7 +79,8 @@ MODULE_PARM_DESC(debug, "Debug level (0=
|
||||
#define GMAC0_IRQ4_8 (GMAC0_MIB_INT_BIT | GMAC0_RX_OVERRUN_INT_BIT)
|
||||
|
||||
#define GMAC_OFFLOAD_FEATURES (NETIF_F_SG | NETIF_F_IP_CSUM | \
|
||||
- NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM)
|
||||
+ NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM | \
|
||||
+ NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6)
|
||||
|
||||
/**
|
||||
* struct gmac_queue_page - page buffer per-page info
|
||||
@@ -1148,13 +1149,25 @@ static int gmac_map_tx_bufs(struct net_d
|
||||
skb_frag_t *skb_frag;
|
||||
dma_addr_t mapping;
|
||||
void *buffer;
|
||||
+ u16 mss;
|
||||
int ret;
|
||||
|
||||
- /* TODO: implement proper TSO using MTU in word3 */
|
||||
word1 = skb->len;
|
||||
word3 = SOF_BIT;
|
||||
|
||||
- if (skb->len >= ETH_FRAME_LEN) {
|
||||
+ mss = skb_shinfo(skb)->gso_size;
|
||||
+ if (mss) {
|
||||
+ /* This means we are dealing with TCP and skb->len is the
|
||||
+ * sum total of all the segments. The TSO will deal with
|
||||
+ * chopping this up for us.
|
||||
+ */
|
||||
+ /* The accelerator needs the full frame size here */
|
||||
+ mss += skb_tcp_all_headers(skb);
|
||||
+ netdev_dbg(netdev, "segment offloading mss = %04x len=%04x\n",
|
||||
+ mss, skb->len);
|
||||
+ word1 |= TSS_MTU_ENABLE_BIT;
|
||||
+ word3 |= mss;
|
||||
+ } else if (skb->len >= ETH_FRAME_LEN) {
|
||||
/* Hardware offloaded checksumming isn't working on frames
|
||||
* bigger than 1514 bytes. A hypothesis about this is that the
|
||||
* checksum buffer is only 1518 bytes, so when the frames get
|
||||
@@ -1169,7 +1182,9 @@ static int gmac_map_tx_bufs(struct net_d
|
||||
return ret;
|
||||
}
|
||||
word1 |= TSS_BYPASS_BIT;
|
||||
- } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
+ }
|
||||
+
|
||||
+ if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
int tcp = 0;
|
||||
|
||||
/* We do not switch off the checksumming on non TCP/UDP
|
@ -0,0 +1,95 @@
|
||||
From 91fb8a7328dda827bc6c0da240a1eb17028416cd Mon Sep 17 00:00:00 2001
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Thu, 9 May 2024 23:59:28 +0200
|
||||
Subject: [PATCH 2/5] net: ethernet: cortina: Use TSO also on common TCP
|
||||
|
||||
It is possible to push the segment offloader to also
|
||||
process non-segmented frames: just pass the skb->len
|
||||
or desired MSS to the offloader and it will handle them.
|
||||
|
||||
This is especially good if the user sets up the MTU
|
||||
and the frames get big, because the checksumming engine
|
||||
cannot handle any frames bigger than 1518 bytes, so
|
||||
segmenting them all to be at max that will be helpful
|
||||
for the hardware, which only need to quirk odd frames
|
||||
such as big UDP ping packets.
|
||||
|
||||
The vendor driver always uses the TSO like this, and
|
||||
the driver seems more stable after this, so apparently
|
||||
the hardware may have been engineered to always use
|
||||
the TSO on anything it can handle.
|
||||
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
drivers/net/ethernet/cortina/gemini.c | 31 +++++++++++++++++++++------
|
||||
1 file changed, 24 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/cortina/gemini.c
|
||||
+++ b/drivers/net/ethernet/cortina/gemini.c
|
||||
@@ -1148,6 +1148,7 @@ static int gmac_map_tx_bufs(struct net_d
|
||||
struct gmac_txdesc *txd;
|
||||
skb_frag_t *skb_frag;
|
||||
dma_addr_t mapping;
|
||||
+ bool tcp = false;
|
||||
void *buffer;
|
||||
u16 mss;
|
||||
int ret;
|
||||
@@ -1155,6 +1156,13 @@ static int gmac_map_tx_bufs(struct net_d
|
||||
word1 = skb->len;
|
||||
word3 = SOF_BIT;
|
||||
|
||||
+ /* Determine if we are doing TCP */
|
||||
+ if (skb->protocol == htons(ETH_P_IP))
|
||||
+ tcp = (ip_hdr(skb)->protocol == IPPROTO_TCP);
|
||||
+ else
|
||||
+ /* IPv6 */
|
||||
+ tcp = (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP);
|
||||
+
|
||||
mss = skb_shinfo(skb)->gso_size;
|
||||
if (mss) {
|
||||
/* This means we are dealing with TCP and skb->len is the
|
||||
@@ -1167,6 +1175,20 @@ static int gmac_map_tx_bufs(struct net_d
|
||||
mss, skb->len);
|
||||
word1 |= TSS_MTU_ENABLE_BIT;
|
||||
word3 |= mss;
|
||||
+ } else if (tcp) {
|
||||
+ /* Even if we are not using TSO, use the segment offloader
|
||||
+ * for transferring the TCP frame: the TSO engine will deal
|
||||
+ * with chopping up frames that exceed ETH_DATA_LEN which
|
||||
+ * the checksumming engine cannot handle (see below) into
|
||||
+ * manageable chunks. It flawlessly deals with quite big
|
||||
+ * frames and frames containing custom DSA EtherTypes.
|
||||
+ */
|
||||
+ mss = netdev->mtu + skb_tcp_all_headers(skb);
|
||||
+ mss = min(mss, skb->len);
|
||||
+ netdev_dbg(netdev, "botched TSO len %04x mtu %04x mss %04x\n",
|
||||
+ skb->len, netdev->mtu, mss);
|
||||
+ word1 |= TSS_MTU_ENABLE_BIT;
|
||||
+ word3 |= mss;
|
||||
} else if (skb->len >= ETH_FRAME_LEN) {
|
||||
/* Hardware offloaded checksumming isn't working on frames
|
||||
* bigger than 1514 bytes. A hypothesis about this is that the
|
||||
@@ -1185,21 +1207,16 @@ static int gmac_map_tx_bufs(struct net_d
|
||||
}
|
||||
|
||||
if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
- int tcp = 0;
|
||||
-
|
||||
/* We do not switch off the checksumming on non TCP/UDP
|
||||
* frames: as is shown from tests, the checksumming engine
|
||||
* is smart enough to see that a frame is not actually TCP
|
||||
* or UDP and then just pass it through without any changes
|
||||
* to the frame.
|
||||
*/
|
||||
- if (skb->protocol == htons(ETH_P_IP)) {
|
||||
+ if (skb->protocol == htons(ETH_P_IP))
|
||||
word1 |= TSS_IP_CHKSUM_BIT;
|
||||
- tcp = ip_hdr(skb)->protocol == IPPROTO_TCP;
|
||||
- } else { /* IPv6 */
|
||||
+ else
|
||||
word1 |= TSS_IPV6_ENABLE_BIT;
|
||||
- tcp = ipv6_hdr(skb)->nexthdr == IPPROTO_TCP;
|
||||
- }
|
||||
|
||||
word1 |= tcp ? TSS_TCP_CHKSUM_BIT : TSS_UDP_CHKSUM_BIT;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
From fa01c904b844e6033445f75b0b4d46a8e83b6086 Mon Sep 17 00:00:00 2001
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Fri, 10 May 2024 19:48:27 +0200
|
||||
Subject: [PATCH 3/5] net: ethernet: cortina: Rename adjust link callback
|
||||
|
||||
The callback passed to of_phy_get_and_connect() in the
|
||||
Cortina Gemini driver is called "gmac_speed_set" which is
|
||||
archaic, rename it to "gmac_adjust_link" following the
|
||||
pattern of most other drivers.
|
||||
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
drivers/net/ethernet/cortina/gemini.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/cortina/gemini.c
|
||||
+++ b/drivers/net/ethernet/cortina/gemini.c
|
||||
@@ -288,7 +288,7 @@ static void gmac_set_flow_control(struct
|
||||
spin_unlock_irqrestore(&port->config_lock, flags);
|
||||
}
|
||||
|
||||
-static void gmac_speed_set(struct net_device *netdev)
|
||||
+static void gmac_adjust_link(struct net_device *netdev)
|
||||
{
|
||||
struct gemini_ethernet_port *port = netdev_priv(netdev);
|
||||
struct phy_device *phydev = netdev->phydev;
|
||||
@@ -367,7 +367,7 @@ static int gmac_setup_phy(struct net_dev
|
||||
|
||||
phy = of_phy_get_and_connect(netdev,
|
||||
dev->of_node,
|
||||
- gmac_speed_set);
|
||||
+ gmac_adjust_link);
|
||||
if (!phy)
|
||||
return -ENODEV;
|
||||
netdev->phydev = phy;
|
@ -0,0 +1,46 @@
|
||||
From 50ac9765c674bac803719c6b8294670edc6df31d Mon Sep 17 00:00:00 2001
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Fri, 10 May 2024 19:44:39 +0200
|
||||
Subject: [PATCH 4/5] net: ethernet: cortina: Use negotiated TX/RX pause
|
||||
|
||||
Instead of directly poking into registers of the PHY, use
|
||||
the existing function to query phylib about this directly.
|
||||
|
||||
Suggested-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
drivers/net/ethernet/cortina/gemini.c | 15 +++++----------
|
||||
1 file changed, 5 insertions(+), 10 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/cortina/gemini.c
|
||||
+++ b/drivers/net/ethernet/cortina/gemini.c
|
||||
@@ -293,8 +293,8 @@ static void gmac_adjust_link(struct net_
|
||||
struct gemini_ethernet_port *port = netdev_priv(netdev);
|
||||
struct phy_device *phydev = netdev->phydev;
|
||||
union gmac_status status, old_status;
|
||||
- int pause_tx = 0;
|
||||
- int pause_rx = 0;
|
||||
+ bool pause_tx = false;
|
||||
+ bool pause_rx = false;
|
||||
|
||||
status.bits32 = readl(port->gmac_base + GMAC_STATUS);
|
||||
old_status.bits32 = status.bits32;
|
||||
@@ -329,14 +329,9 @@ static void gmac_adjust_link(struct net_
|
||||
}
|
||||
|
||||
if (phydev->duplex == DUPLEX_FULL) {
|
||||
- u16 lcladv = phy_read(phydev, MII_ADVERTISE);
|
||||
- u16 rmtadv = phy_read(phydev, MII_LPA);
|
||||
- u8 cap = mii_resolve_flowctrl_fdx(lcladv, rmtadv);
|
||||
-
|
||||
- if (cap & FLOW_CTRL_RX)
|
||||
- pause_rx = 1;
|
||||
- if (cap & FLOW_CTRL_TX)
|
||||
- pause_tx = 1;
|
||||
+ phy_get_pause(phydev, &pause_tx, &pause_rx);
|
||||
+ netdev_dbg(netdev, "set negotiated pause params pause TX = %s, pause RX = %s\n",
|
||||
+ pause_tx ? "ON" : "OFF", pause_rx ? "ON" : "OFF");
|
||||
}
|
||||
|
||||
gmac_set_flow_control(netdev, pause_tx, pause_rx);
|
@ -0,0 +1,46 @@
|
||||
From 4eed4b87f17d10b7586349c13c3a30f9c24c9ba4 Mon Sep 17 00:00:00 2001
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Wed, 8 May 2024 23:21:17 +0200
|
||||
Subject: [PATCH 5/5] net: ethernet: cortina: Implement .set_pauseparam()
|
||||
|
||||
The Cortina Gemini ethernet can very well set up TX or RX
|
||||
pausing, so add this functionality to the driver in a
|
||||
.set_pauseparam() callback. Essentially just call down to
|
||||
phylib and let phylib deal with this, .adjust_link()
|
||||
will respect the setting from phylib.
|
||||
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
drivers/net/ethernet/cortina/gemini.c | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
--- a/drivers/net/ethernet/cortina/gemini.c
|
||||
+++ b/drivers/net/ethernet/cortina/gemini.c
|
||||
@@ -2143,6 +2143,19 @@ static void gmac_get_pauseparam(struct n
|
||||
pparam->autoneg = true;
|
||||
}
|
||||
|
||||
+static int gmac_set_pauseparam(struct net_device *netdev,
|
||||
+ struct ethtool_pauseparam *pparam)
|
||||
+{
|
||||
+ struct phy_device *phydev = netdev->phydev;
|
||||
+
|
||||
+ if (!pparam->autoneg)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ phy_set_asym_pause(phydev, pparam->rx_pause, pparam->tx_pause);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void gmac_get_ringparam(struct net_device *netdev,
|
||||
struct ethtool_ringparam *rp,
|
||||
struct kernel_ethtool_ringparam *kernel_rp,
|
||||
@@ -2263,6 +2276,7 @@ static const struct ethtool_ops gmac_351
|
||||
.set_link_ksettings = gmac_set_ksettings,
|
||||
.nway_reset = gmac_nway_reset,
|
||||
.get_pauseparam = gmac_get_pauseparam,
|
||||
+ .set_pauseparam = gmac_set_pauseparam,
|
||||
.get_ringparam = gmac_get_ringparam,
|
||||
.set_ringparam = gmac_set_ringparam,
|
||||
.get_coalesce = gmac_get_coalesce,
|
@ -11,7 +11,7 @@ FEATURES:=dt squashfs gpio
|
||||
CPU_TYPE:=xscale
|
||||
SUBTARGETS:=generic
|
||||
|
||||
KERNEL_PATCHVER:=6.1
|
||||
KERNEL_PATCHVER:=6.6
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for the IXP4xx XScale CPU
|
||||
|
@ -11,10 +11,10 @@ CONFIG_ARCH_MULTI_CPU_AUTO=y
|
||||
# CONFIG_ARCH_MULTI_V4T is not set
|
||||
CONFIG_ARCH_MULTI_V4_V5=y
|
||||
CONFIG_ARCH_MULTI_V5=y
|
||||
CONFIG_ARCH_NR_GPIO=0
|
||||
CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
|
||||
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARM=y
|
||||
CONFIG_ARM_APPENDED_DTB=y
|
||||
@ -30,6 +30,7 @@ CONFIG_AUTO_ZRELADDR=y
|
||||
CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_BLK_MQ_PCI=y
|
||||
CONFIG_BUFFER_HEAD=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y
|
||||
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
|
||||
CONFIG_CC_NO_ARRAY_BOUNDS=y
|
||||
@ -45,6 +46,7 @@ CONFIG_CPU_CACHE_VIVT=y
|
||||
CONFIG_CPU_CP15=y
|
||||
CONFIG_CPU_CP15_MMU=y
|
||||
CONFIG_CPU_ENDIAN_BE32=y
|
||||
CONFIG_CPU_MITIGATIONS=y
|
||||
CONFIG_CPU_PABRT_LEGACY=y
|
||||
CONFIG_CPU_THUMB_CAPABLE=y
|
||||
CONFIG_CPU_TLB_V4WBI=y
|
||||
@ -60,9 +62,9 @@ CONFIG_CRYPTO_ECB=m
|
||||
CONFIG_CRYPTO_HW=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_DES=m
|
||||
CONFIG_CRYPTO_LIB_GF128MUL=y
|
||||
CONFIG_CRYPTO_LIB_SHA1=y
|
||||
CONFIG_CRYPTO_LIB_UTILS=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_DEBUG_BUGVERBOSE=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
|
||||
@ -82,10 +84,12 @@ CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FORCE_PCI=y
|
||||
CONFIG_FS_IOMAP=y
|
||||
CONFIG_FS_MBCACHE=y
|
||||
CONFIG_FUNCTION_ALIGNMENT=0
|
||||
CONFIG_FWNODE_MDIO=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_FW_LOADER_SYSFS=y
|
||||
CONFIG_GCC11_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_GCC10_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ATOMIC64=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
@ -108,13 +112,14 @@ CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GW_PLD=y
|
||||
CONFIG_GPIO_IXP4XX=y
|
||||
CONFIG_GRO_CELLS=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HDLC=y
|
||||
CONFIG_HWMON=y
|
||||
CONFIG_HWMON_VID=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HW_RANDOM_IXP4XX=y
|
||||
CONFIG_HZ_FIXED=0
|
||||
@ -150,9 +155,9 @@ CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MMU_LAZY_TLB_REFCOUNT=y
|
||||
CONFIG_MODULES_USE_ELF_REL=y
|
||||
CONFIG_MTD_CFI_ADV_OPTIONS=y
|
||||
# CONFIG_MTD_CFI_GEOMETRY is not set
|
||||
@ -165,13 +170,20 @@ CONFIG_MTD_SPLIT_FIRMWARE_NAME="linux"
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_KUSER_HELPERS=y
|
||||
CONFIG_NEED_PER_CPU_KM=y
|
||||
CONFIG_NET_DEVLINK=y
|
||||
CONFIG_NET_DSA=y
|
||||
CONFIG_NET_DSA_MV88E6060=y
|
||||
CONFIG_NET_DSA_TAG_TRAILER=y
|
||||
CONFIG_NET_EGRESS=y
|
||||
CONFIG_NET_INGRESS=y
|
||||
CONFIG_NET_PTP_CLASSIFY=y
|
||||
CONFIG_NET_SELFTESTS=y
|
||||
CONFIG_NET_SWITCHDEV=y
|
||||
CONFIG_NET_VENDOR_XSCALE=y
|
||||
CONFIG_NET_XGRESS=y
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_NVMEM_LAYOUTS=y
|
||||
CONFIG_NVMEM_SYSFS=y
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
@ -181,12 +193,13 @@ CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_KOBJ=y
|
||||
CONFIG_OF_MDIO=y
|
||||
# CONFIG_OLD_SIGACTION is not set
|
||||
# CONFIG_OLD_SIGSUSPEND3 is not set
|
||||
CONFIG_OLD_SIGACTION=y
|
||||
CONFIG_OLD_SIGSUSPEND3=y
|
||||
CONFIG_PAGE_OFFSET=0xC0000000
|
||||
CONFIG_PAGE_POOL=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
|
||||
CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y
|
||||
CONFIG_PATA_IXP4XX_CF=y
|
||||
CONFIG_PCI=y
|
||||
CONFIG_PCI_DOMAINS=y
|
||||
@ -195,6 +208,8 @@ CONFIG_PCI_IXP4XX=y
|
||||
CONFIG_PERF_USE_VMALLOC=y
|
||||
CONFIG_PGTABLE_LEVELS=2
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHYLIB_LEDS=y
|
||||
CONFIG_PHYLINK=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_RESET_GPIO=y
|
||||
CONFIG_PREEMPT_NONE_BUILD=y
|
||||
@ -203,22 +218,17 @@ CONFIG_RANDSTRUCT_NONE=y
|
||||
CONFIG_RATIONAL=y
|
||||
CONFIG_REALTEK_PHY=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_REGMAP_I2C=y
|
||||
CONFIG_REGMAP_MMIO=y
|
||||
CONFIG_RUST_IS_AVAILABLE=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_SCSI_COMMON=y
|
||||
# CONFIG_SERIAL_8250_EXAR is not set
|
||||
# CONFIG_SERIAL_8250_FSL is not set
|
||||
# CONFIG_SERIAL_8250_PCI is not set
|
||||
# CONFIG_SERIAL_8250_PERICOM is not set
|
||||
CONFIG_SERIAL_8250_FSL=y
|
||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_SG_POOL=y
|
||||
CONFIG_SOFTIRQ_ON_OWN_STACK=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SPLIT_PTLOCK_CPUS=999999
|
||||
CONFIG_SRCU=y
|
||||
CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
@ -29,6 +29,7 @@ endef
|
||||
|
||||
define Device/Default
|
||||
PROFILES := Default
|
||||
DEVICE_DTS_DIR = $$(DTS_DIR)/intel/ixp
|
||||
KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
|
||||
KERNEL_NAME := zImage
|
||||
KERNEL := kernel-bin | append-dtb
|
||||
|
@ -40,7 +40,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
/**
|
||||
* struct ixp4xx_gpio - IXP4 GPIO state container
|
||||
* @dev: containing device for this instance
|
||||
@@ -203,6 +215,8 @@ static int ixp4xx_gpio_probe(struct plat
|
||||
@@ -202,6 +214,8 @@ static int ixp4xx_gpio_probe(struct plat
|
||||
struct ixp4xx_gpio *g;
|
||||
struct gpio_irq_chip *girq;
|
||||
struct device_node *irq_parent;
|
||||
@ -49,7 +49,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
int ret;
|
||||
|
||||
g = devm_kzalloc(dev, sizeof(*g), GFP_KERNEL);
|
||||
@@ -233,7 +247,40 @@ static int ixp4xx_gpio_probe(struct plat
|
||||
@@ -231,7 +245,40 @@ static int ixp4xx_gpio_probe(struct plat
|
||||
*/
|
||||
if (of_machine_is_compatible("dlink,dsm-g600-a") ||
|
||||
of_machine_is_compatible("iom,nas-100d"))
|
@ -1,33 +1,33 @@
|
||||
From 02693ffdb93bffcbe772bd91a399dabd123b8c19 Mon Sep 17 00:00:00 2001
|
||||
From a1490c1e8a12a8286c6a34c3d277a519066fc51e Mon Sep 17 00:00:00 2001
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Tue, 19 Sep 2023 16:02:15 +0200
|
||||
Subject: [PATCH 4/4] ARM: dts: ixp4xx: Add USRobotics USR8200 device tree
|
||||
Date: Sat, 7 Oct 2023 14:32:40 +0200
|
||||
Subject: [PATCH] ARM: dts: ixp4xx: Add USRobotics USR8200 device tree
|
||||
|
||||
This is a USRobotics NAS/Firewall/router that has been supported
|
||||
by OpenWrt in the past. It had dedicated users so let's get it
|
||||
properly supported.
|
||||
|
||||
Some debugging and fixing was provided by Howard Harte.
|
||||
|
||||
Link: https://lore.kernel.org/r/20231007-ixp4xx-usr8200-v1-1-aded3d6ff6f1@linaro.org
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
arch/arm/boot/dts/Makefile | 3 +-
|
||||
.../dts/intel-ixp42x-usrobotics-usr8200.dts | 229 ++++++++++++++++++
|
||||
arch/arm/boot/dts/intel/ixp/Makefile | 3 +-
|
||||
.../ixp/intel-ixp42x-usrobotics-usr8200.dts | 229 ++++++++++++++++++
|
||||
2 files changed, 231 insertions(+), 1 deletion(-)
|
||||
create mode 100644 arch/arm/boot/dts/intel-ixp42x-usrobotics-usr8200.dts
|
||||
create mode 100644 arch/arm/boot/dts/intel/ixp/intel-ixp42x-usrobotics-usr8200.dts
|
||||
|
||||
--- a/arch/arm/boot/dts/Makefile
|
||||
+++ b/arch/arm/boot/dts/Makefile
|
||||
@@ -292,7 +292,8 @@ dtb-$(CONFIG_ARCH_IXP4XX) += \
|
||||
--- a/arch/arm/boot/dts/intel/ixp/Makefile
|
||||
+++ b/arch/arm/boot/dts/intel/ixp/Makefile
|
||||
@@ -16,4 +16,5 @@ dtb-$(CONFIG_ARCH_IXP4XX) += \
|
||||
intel-ixp43x-gateworks-gw2358.dtb \
|
||||
intel-ixp42x-netgear-wg302v1.dtb \
|
||||
intel-ixp42x-arcom-vulcan.dtb \
|
||||
- intel-ixp42x-gateway-7001.dtb
|
||||
+ intel-ixp42x-gateway-7001.dtb \
|
||||
+ intel-ixp42x-usrobotics-usr8200.dtb
|
||||
dtb-$(CONFIG_ARCH_KEYSTONE) += \
|
||||
keystone-k2hk-evm.dtb \
|
||||
keystone-k2l-evm.dtb \
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/intel-ixp42x-usrobotics-usr8200.dts
|
||||
+++ b/arch/arm/boot/dts/intel/ixp/intel-ixp42x-usrobotics-usr8200.dts
|
||||
@@ -0,0 +1,229 @@
|
||||
+// SPDX-License-Identifier: ISC
|
||||
+/*
|
@ -1,6 +1,6 @@
|
||||
From a1ab45966e5a21841af58742adf27725e523d303 Mon Sep 17 00:00:00 2001
|
||||
From 98f3b5f44b9ae86c4a80185b57149867472a2570 Mon Sep 17 00:00:00 2001
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Sat, 14 Oct 2023 19:53:24 +0200
|
||||
Date: Fri, 20 Oct 2023 15:11:41 +0200
|
||||
Subject: [PATCH] ARM: dts: usr8200: Fix phy registers
|
||||
|
||||
The MV88E6060 switch has internal PHY registers at MDIO
|
||||
@ -8,12 +8,14 @@ addresses 0x00..0x04. Tie each port to the corresponding
|
||||
PHY.
|
||||
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20231020-ixp4xx-usr8200-dtsfix-v1-1-3a8591dea259@linaro.org
|
||||
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
||||
---
|
||||
.../dts/intel-ixp42x-usrobotics-usr8200.dts | 22 +++++++++++++++++++
|
||||
.../ixp/intel-ixp42x-usrobotics-usr8200.dts | 22 +++++++++++++++++++
|
||||
1 file changed, 22 insertions(+)
|
||||
|
||||
--- a/arch/arm/boot/dts/intel-ixp42x-usrobotics-usr8200.dts
|
||||
+++ b/arch/arm/boot/dts/intel-ixp42x-usrobotics-usr8200.dts
|
||||
--- a/arch/arm/boot/dts/intel/ixp/intel-ixp42x-usrobotics-usr8200.dts
|
||||
+++ b/arch/arm/boot/dts/intel/ixp/intel-ixp42x-usrobotics-usr8200.dts
|
||||
@@ -165,6 +165,24 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
@ -0,0 +1,25 @@
|
||||
From 89eccb6726d93c9c78997e91bd641b0e46bc3c5f Mon Sep 17 00:00:00 2001
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Fri, 8 Sep 2023 12:49:48 +0200
|
||||
Subject: [PATCH] ARM: dts: ixp4xx-nslu2: Enable write on flash
|
||||
|
||||
To upgrade the firmware and similar, the flash needs write
|
||||
access.
|
||||
|
||||
Link: https://lore.kernel.org/r/20230908-ixp4xx-dts-v1-1-98d36264ed6d@linaro.org
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
arch/arm/boot/dts/intel/ixp/intel-ixp42x-linksys-nslu2.dts | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/arch/arm/boot/dts/intel/ixp/intel-ixp42x-linksys-nslu2.dts
|
||||
+++ b/arch/arm/boot/dts/intel/ixp/intel-ixp42x-linksys-nslu2.dts
|
||||
@@ -101,6 +101,8 @@
|
||||
flash@0,0 {
|
||||
compatible = "intel,ixp4xx-flash", "cfi-flash";
|
||||
bank-width = <2>;
|
||||
+ /* Enable writes on the expansion bus */
|
||||
+ intel,ixp4xx-eb-write-enable = <1>;
|
||||
/*
|
||||
* 8 MB of Flash in 0x20000 byte blocks
|
||||
* mapped in at CS0.
|
@ -0,0 +1,62 @@
|
||||
From deb93908958e74dffbef1ce6a1cc2f82ac4f96ed Mon Sep 17 00:00:00 2001
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Fri, 8 Sep 2023 12:49:49 +0200
|
||||
Subject: [PATCH] ARM: dts: ixp4xx: Use right restart keycode
|
||||
|
||||
The "reset" key on a few IXP4xx routers were sending KEY_ESC
|
||||
but what we want to send is KEY_RESTART which will make
|
||||
OpenWrt and similar userspace do a controlled reboot.
|
||||
|
||||
Link: https://lore.kernel.org/r/20230908-ixp4xx-dts-v1-2-98d36264ed6d@linaro.org
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
arch/arm/boot/dts/intel/ixp/intel-ixp42x-dlink-dsm-g600.dts | 2 +-
|
||||
arch/arm/boot/dts/intel/ixp/intel-ixp42x-freecom-fsg-3.dts | 2 +-
|
||||
arch/arm/boot/dts/intel/ixp/intel-ixp42x-iomega-nas100d.dts | 2 +-
|
||||
arch/arm/boot/dts/intel/ixp/intel-ixp42x-linksys-nslu2.dts | 2 +-
|
||||
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/arch/arm/boot/dts/intel/ixp/intel-ixp42x-dlink-dsm-g600.dts
|
||||
+++ b/arch/arm/boot/dts/intel/ixp/intel-ixp42x-dlink-dsm-g600.dts
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
button-reset {
|
||||
wakeup-source;
|
||||
- linux,code = <KEY_ESC>;
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
label = "reset";
|
||||
gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
--- a/arch/arm/boot/dts/intel/ixp/intel-ixp42x-freecom-fsg-3.dts
|
||||
+++ b/arch/arm/boot/dts/intel/ixp/intel-ixp42x-freecom-fsg-3.dts
|
||||
@@ -44,7 +44,7 @@
|
||||
};
|
||||
button-reset {
|
||||
wakeup-source;
|
||||
- linux,code = <KEY_ESC>;
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
label = "reset";
|
||||
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
--- a/arch/arm/boot/dts/intel/ixp/intel-ixp42x-iomega-nas100d.dts
|
||||
+++ b/arch/arm/boot/dts/intel/ixp/intel-ixp42x-iomega-nas100d.dts
|
||||
@@ -63,7 +63,7 @@
|
||||
};
|
||||
button-reset {
|
||||
wakeup-source;
|
||||
- linux,code = <KEY_ESC>;
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
label = "reset";
|
||||
gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
--- a/arch/arm/boot/dts/intel/ixp/intel-ixp42x-linksys-nslu2.dts
|
||||
+++ b/arch/arm/boot/dts/intel/ixp/intel-ixp42x-linksys-nslu2.dts
|
||||
@@ -65,7 +65,7 @@
|
||||
};
|
||||
button-reset {
|
||||
wakeup-source;
|
||||
- linux,code = <KEY_ESC>;
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
label = "reset";
|
||||
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
|
||||
};
|
@ -1,4 +1,4 @@
|
||||
From 2792791a19f90b0141ed2e781599ba0a42a8cfd5 Mon Sep 17 00:00:00 2001
|
||||
From 6484f966af53447deefcd4b805c201d8624981cb Mon Sep 17 00:00:00 2001
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Mon, 29 May 2023 23:32:44 +0200
|
||||
Subject: [PATCH] ARM: dts: ixp4xx: Boot NSLU2 from harddrive
|
||||
@ -8,11 +8,11 @@ to hold any rootfs these days.
|
||||
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts | 2 +-
|
||||
arch/arm/boot/dts/intel/ixp/intel-ixp42x-linksys-nslu2.dts | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts
|
||||
+++ b/arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts
|
||||
--- a/arch/arm/boot/dts/intel/ixp/intel-ixp42x-linksys-nslu2.dts
|
||||
+++ b/arch/arm/boot/dts/intel/ixp/intel-ixp42x-linksys-nslu2.dts
|
||||
@@ -21,7 +21,7 @@
|
||||
};
|
||||
|
457
target/linux/mediatek/dts/mt7981b-openwrt-one.dts
Normal file
457
target/linux/mediatek/dts/mt7981b-openwrt-one.dts
Normal file
@ -0,0 +1,457 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
|
||||
|
||||
/dts-v1/;
|
||||
#include "mt7981.dtsi"
|
||||
|
||||
/ {
|
||||
model = "OpenWrt One";
|
||||
compatible = "openwrt,one", "mediatek,mt7981";
|
||||
|
||||
aliases {
|
||||
ethernet0 = &gmac0;
|
||||
ethernet1 = &gmac1;
|
||||
serial0 = &uart0;
|
||||
led-boot = &led_status_white;
|
||||
led-failsafe = &led_status_red;
|
||||
led-running = &led_status_green;
|
||||
led-upgrade = &led_status_green;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
rootdisk = <&ubi_fit_volume>;
|
||||
};
|
||||
|
||||
memory {
|
||||
reg = <0 0x40000000 0 0x40000000>;
|
||||
};
|
||||
|
||||
reg_3p3v: regulator-3p3v {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "fixed-3.3V";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
reg_5v: regulator-5v {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "fixed-5V";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
user {
|
||||
label = "user";
|
||||
linux,code = <BTN_0>;
|
||||
gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
pwm-leds {
|
||||
compatible = "pwm-leds";
|
||||
|
||||
led_status_white: led-0 {
|
||||
color = <LED_COLOR_ID_WHITE>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
pwms = <&pwm 0 10000>;
|
||||
linux,default-trigger = "pattern";
|
||||
led-pattern = <0 500 25 500>;
|
||||
};
|
||||
|
||||
led_status_green: led-1 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
pwms = <&pwm 1 10000>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio-leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_status_red: led-0 {
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
gpios = <&pio 9 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led-1 {
|
||||
function = LED_FUNCTION_LAN;
|
||||
color = <LED_COLOR_ID_AMBER>;
|
||||
gpios = <&pio 34 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-2 {
|
||||
function = LED_FUNCTION_LAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&pio 35 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio-export {
|
||||
compatible = "gpio-export";
|
||||
|
||||
gpio-0 {
|
||||
gpio-export,name = "mikrobus-reset";
|
||||
gpio-export,output = <1>;
|
||||
gpios = <&pio 2 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
gpio-1 {
|
||||
gpio-export,name = "watchdog-enable";
|
||||
gpio-export,output = <1>;
|
||||
gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
gpio-2 {
|
||||
gpio-export,name = "usb-enable";
|
||||
gpio-export,output = <1>;
|
||||
gpios = <&pio 14 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio-watchdog {
|
||||
compatible = "linux,wdt-gpio";
|
||||
gpios = <&pio 8 GPIO_ACTIVE_LOW>;
|
||||
hw_algo = "toggle";
|
||||
hw_margin_ms = <25000>;
|
||||
always-running;
|
||||
};
|
||||
};
|
||||
|
||||
ð {
|
||||
status = "okay";
|
||||
|
||||
gmac0: mac@0 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <0>;
|
||||
phy-handle = <&phy15>;
|
||||
phy-mode = "2500base-x";
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_factory_4>;
|
||||
};
|
||||
|
||||
gmac1: mac@1 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <1>;
|
||||
phy-mode = "gmii";
|
||||
phy-handle = <&int_gbe_phy>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_factory_a>;
|
||||
};
|
||||
};
|
||||
|
||||
&mdio_bus {
|
||||
phy15: phy@f {
|
||||
reg = <0xf>;
|
||||
|
||||
airoha,pnswap-rx;
|
||||
|
||||
interrupt-parent = <&pio>;
|
||||
interrupts = <38 IRQ_TYPE_EDGE_FALLING>;
|
||||
reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>;
|
||||
reset-assert-us = <10000>;
|
||||
reset-deassert-us = <20000>;
|
||||
|
||||
phy-mode = "2500base-x";
|
||||
full-duplex;
|
||||
pause;
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
led@0 {
|
||||
reg = <0>;
|
||||
function = LED_FUNCTION_WAN;
|
||||
color = <LED_COLOR_ID_AMBER>;
|
||||
};
|
||||
|
||||
led@1 {
|
||||
reg = <1>;
|
||||
function = LED_FUNCTION_WAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&crypto {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&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>;
|
||||
};
|
||||
};
|
||||
|
||||
spi1_flash_pins: spi1-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi1_1";
|
||||
};
|
||||
|
||||
conf-pu {
|
||||
pins = "SPI1_CS";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
|
||||
conf-pd {
|
||||
pins = "SPI1_CLK", "SPI1_MOSI", "SPI1_MISO";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
};
|
||||
|
||||
spi2_flash_pins: spi2-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi2";
|
||||
};
|
||||
|
||||
conf-pu {
|
||||
pins = "SPI2_CS", "SPI2_WP";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
|
||||
conf-pd {
|
||||
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins: i2c-pins {
|
||||
mux {
|
||||
function = "i2c";
|
||||
groups = "i2c0_0";
|
||||
};
|
||||
};
|
||||
|
||||
uart2_pins: uart2-pins {
|
||||
mux {
|
||||
function = "uart";
|
||||
groups = "uart2_0_tx_rx";
|
||||
};
|
||||
};
|
||||
|
||||
pwm_pins: pwm-pins {
|
||||
mux {
|
||||
function = "pwm";
|
||||
groups = "pwm0_0", "pwm1_1";
|
||||
};
|
||||
};
|
||||
|
||||
pcie_pins: pcie-pins {
|
||||
mux {
|
||||
function = "pcie";
|
||||
groups = "pcie_pereset";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pwm {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pwm_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
status = "okay";
|
||||
|
||||
rtc@51 {
|
||||
compatible = "nxp,pcf8563";
|
||||
reg = <0x51>;
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi0_flash_pins>;
|
||||
cs-gpios = <0>, <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "spi-nand";
|
||||
reg = <1>;
|
||||
spi-max-frequency = <52000000>;
|
||||
|
||||
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>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "bl2";
|
||||
reg = <0x0 0x100000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@580000 {
|
||||
label = "ubi";
|
||||
reg = <0x100000 0x7F00000>;
|
||||
compatible = "linux,ubi";
|
||||
|
||||
volumes {
|
||||
ubi_fit_volume: ubi-volume-fit {
|
||||
volname = "fit";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi1_flash_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi2_flash_pins>;
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
|
||||
spi-max-frequency = <52000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "bl2-nor";
|
||||
reg = <0x00000 0x40000>;
|
||||
};
|
||||
|
||||
partition@40000 {
|
||||
label = "factory";
|
||||
reg = <0x40000 0xc0000>;
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
eeprom_factory_0: eeprom@0 {
|
||||
reg = <0x0 0x1000>;
|
||||
};
|
||||
|
||||
macaddr_factory_4: macaddr@4 {
|
||||
compatible = "mac-base";
|
||||
reg = <0x24 0x6>;
|
||||
#nvmem-cell-cells = <1>;
|
||||
};
|
||||
|
||||
macaddr_factory_a: macaddr@a {
|
||||
compatible = "mac-base";
|
||||
reg = <0x2a 0x6>;
|
||||
#nvmem-cell-cells = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
partition@100000 {
|
||||
label = "fip-nor";
|
||||
reg = <0x100000 0x80000>;
|
||||
};
|
||||
|
||||
partition@180000 {
|
||||
label = "recovery";
|
||||
reg = <0x180000 0xc80000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&xhci {
|
||||
phys = <&u2port0 PHY_TYPE_USB2>;
|
||||
vusb33-supply = <®_3p3v>;
|
||||
vbus-supply = <®_5v>;
|
||||
mediatek,u3p-dis-msk = <0x01>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart2_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_phy {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&watchdog {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&wifi {
|
||||
nvmem-cells = <&eeprom_factory_0>;
|
||||
nvmem-cell-names = "eeprom";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pcie_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sgmiisys0 {
|
||||
/delete-node/ mediatek,pnswap;
|
||||
};
|
@ -416,7 +416,7 @@
|
||||
|
||||
pcie: pcie@11280000 {
|
||||
compatible = "mediatek,mt7981-pcie",
|
||||
"mediatek,mt7986-pcie";
|
||||
"mediatek,mt8192-pcie";
|
||||
reg = <0 0x11280000 0 0x4000>;
|
||||
reg-names = "pcie-mac";
|
||||
ranges = <0x82000000 0 0x20000000
|
||||
|
@ -76,6 +76,12 @@ openembed,som7981)
|
||||
ucidef_set_led_netdev "lanact" "LANACT" "green:lan" "eth1" "rx tx"
|
||||
ucidef_set_led_netdev "lanlink" "LANLINK" "amber:lan" "eth1" "link"
|
||||
;;
|
||||
openwrt,one)
|
||||
ucidef_set_led_netdev "wanact" "WANACT" "mdio-bus:0f:green:wan" "eth0" "rx tx"
|
||||
ucidef_set_led_netdev "wanlink" "WANLINK" "mdio-bus:0f:amber:wan" "eth0" "link"
|
||||
ucidef_set_led_netdev "lanact" "LANACT" "green:lan" "eth1" "rx tx"
|
||||
ucidef_set_led_netdev "lanlink" "LANLINK" "amber:lan" "eth1" "link"
|
||||
;;
|
||||
routerich,ax3000)
|
||||
ucidef_set_led_netdev "lan-1" "lan-1" "blue:lan-1" "lan1" "link tx rx"
|
||||
ucidef_set_led_netdev "lan-2" "lan-2" "blue:lan-2" "lan2" "link tx rx"
|
||||
|
@ -69,7 +69,8 @@ mediatek_setup_interfaces()
|
||||
glinet,gl-mt3000|\
|
||||
glinet,gl-x3000|\
|
||||
glinet,gl-xe3000|\
|
||||
openembed,som7981)
|
||||
openembed,som7981|\
|
||||
openwrt,one)
|
||||
ucidef_set_interfaces_lan_wan eth1 eth0
|
||||
;;
|
||||
dlink,aquila-pro-ai-m30-a1)
|
||||
|
@ -31,6 +31,9 @@ case "$FIRMWARE" in
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
openwrt,one)
|
||||
caldata_extract "factory" 0x0 0x1000
|
||||
;;
|
||||
ubnt,unifi-6-plus)
|
||||
caldata_extract_mmc "factory" 0x0 0x1000
|
||||
;;
|
||||
|
@ -85,7 +85,8 @@ platform_do_upgrade() {
|
||||
bananapi,bpi-r4|\
|
||||
bananapi,bpi-r4-poe|\
|
||||
jdcloud,re-cp-03|\
|
||||
mediatek,mt7988a-rfb)
|
||||
mediatek,mt7988a-rfb|\
|
||||
openwrt,one)
|
||||
[ -e /dev/fit0 ] && fitblk /dev/fit0
|
||||
[ -e /dev/fitrw ] && fitblk /dev/fitrw
|
||||
bootdev="$(fitblk_get_bootdev)"
|
||||
|
@ -228,6 +228,7 @@ CONFIG_IRQ_TIME_ACCOUNTING=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_JBD2=y
|
||||
CONFIG_JUMP_LABEL=y
|
||||
CONFIG_LEDS_PWM=y
|
||||
CONFIG_LEDS_SMARTRG_LED=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
|
@ -1134,6 +1134,54 @@ define Device/openembed_som7981
|
||||
endef
|
||||
TARGET_DEVICES += openembed_som7981
|
||||
|
||||
define Build/append-openwrt-one-eeprom
|
||||
dd if=$(STAGING_DIR_IMAGE)/mt7981_eeprom_mt7976_dbdc.bin >> $@
|
||||
endef
|
||||
|
||||
define Device/openwrt_one
|
||||
DEVICE_VENDOR := OpenWrt
|
||||
DEVICE_MODEL := One
|
||||
DEVICE_DTS := mt7981b-openwrt-one
|
||||
DEVICE_DTS_DIR := ../dts
|
||||
DEVICE_DTC_FLAGS := --pad 4096
|
||||
DEVICE_DTS_LOADADDR := 0x43f00000
|
||||
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-rtc-pcf8563 kmod-usb3 kmod-nvme kmod-phy-airoha-en8811h
|
||||
KERNEL_LOADADDR := 0x44000000
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
KERNEL_INITRAMFS_SUFFIX := .itb
|
||||
KERNEL_IN_UBI := 1
|
||||
UBOOTENV_IN_UBI := 1
|
||||
IMAGES := sysupgrade.itb
|
||||
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
|
||||
IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata
|
||||
ARTIFACTS := \
|
||||
nor-preloader.bin nor-bl31-uboot.fip \
|
||||
snand-preloader.bin snand-bl31-uboot.fip \
|
||||
factory.ubi snand-factory.bin nor-factory.bin
|
||||
ARTIFACT/nor-preloader.bin := mt7981-bl2 nor-ddr4
|
||||
ARTIFACT/nor-bl31-uboot.fip := mt7981-bl31-uboot openwrt_one-nor
|
||||
ARTIFACT/snand-preloader.bin := mt7981-bl2 spim-nand-ubi-ddr4
|
||||
ARTIFACT/snand-bl31-uboot.fip := mt7981-bl31-uboot openwrt_one-snand
|
||||
ARTIFACT/factory.ubi := ubinize-image fit squashfs-sysupgrade.itb
|
||||
ARTIFACT/snand-factory.bin := mt7981-bl2 spim-nand-ubi-ddr4 | pad-to 256k | \
|
||||
mt7981-bl2 spim-nand-ubi-ddr4 | pad-to 512k | \
|
||||
mt7981-bl2 spim-nand-ubi-ddr4 | pad-to 768k | \
|
||||
mt7981-bl2 spim-nand-ubi-ddr4 | pad-to 1024k | \
|
||||
ubinize-image fit squashfs-sysupgrade.itb
|
||||
ARTIFACT/nor-factory.bin := mt7981-bl2 nor-ddr4 | pad-to 256k | \
|
||||
append-openwrt-one-eeprom | pad-to 1024k | \
|
||||
mt7981-bl31-uboot openwrt_one-nor | pad-to 512k | \
|
||||
append-image-stage initramfs.itb
|
||||
UBINIZE_OPTS := -E 5
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
UBINIZE_PARTS := fip=:$(STAGING_DIR_IMAGE)/mt7981_openwrt_one-snand-u-boot.fip recovery=:$(KDIR)/tmp/openwrt-mediatek-filogic-openwrt_one-initramfs.itb \
|
||||
$(if $(wildcard $(TOPDIR)/openwrt-mediatek-filogic-openwrt_one-calibration.itb), calibration=:$(TOPDIR)/openwrt-mediatek-filogic-openwrt_one-calibration.itb)
|
||||
endef
|
||||
TARGET_DEVICES += openwrt_one
|
||||
|
||||
define Device/qihoo_360t7
|
||||
DEVICE_VENDOR := Qihoo
|
||||
DEVICE_MODEL := 360T7
|
||||
|
Loading…
x
Reference in New Issue
Block a user