Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2025-11-21 18:24:19 +08:00
commit 7faf147e7a
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
192 changed files with 14757 additions and 1331 deletions

View File

@ -1,23 +1,33 @@
unset FAILSAFE
[ -e /tmp/.failsafe ] && export FAILSAFE=1
[ -f /etc/banner ] && cat /etc/banner
[ -n "$FAILSAFE" ] && cat /etc/banner.failsafe
[ -n "$FAILSAFE" ] && [ -f /etc/banner.failsafe ] && cat /etc/banner.failsafe
grep -Fsq '/ overlay ro,' /proc/mounts && {
echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
echo 'Please try to remove files from /overlay/upper/... and reboot!'
}
if grep -Fsq '/ overlay ro,' /proc/mounts ; then
cat << EOF
=== WARNING! ======================================
Your JFFS2-partition seems full and overlayfs is
mounted as READ-ONLY!
Please try to remove files from /overlay/upper/...
and reboot!
---------------------------------------------------
EOF
fi
export PATH="%PATH%"
export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
export HOME=${HOME:-/root}
HOME=$(grep -E "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
HOME=${HOME:-/root}
export HOME
export PS1='\u@\h:\w\$ '
export ENV=/etc/shinit
case "$TERM" in
xterm*|rxvt*)
export PS1='\[\e]0;\u@\h: \w\a\]'$PS1
;;
export PS1='\[\e]0;\u@\h: \w\a\]'"$PS1"
;;
esac
[ -x /bin/more ] || alias more='less'
@ -33,42 +43,10 @@ alias ls='ls --color=auto'
[ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; }
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
[ -n "$FAILSAFE" ] || {
for FILE in /etc/profile.d/*.sh; do
[ -e "$FILE" ] && . "$FILE"
if [ -z "$FAILSAFE" ] ; then
for FILE in /etc/profile.d/*.sh ; do
[ -f "${FILE%.sh}.hush" ] && continue
[ -f "$FILE" ] && . "$FILE"
done
unset FILE
}
if ( grep -qs '^root::' /etc/shadow && \
[ -z "$FAILSAFE" ] )
then
cat << EOF
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
EOF
fi
if [ -x /usr/bin/apk ]; then
cat << EOF
OpenWrt recently switched to the "apk" package manager!
OPKG Command APK Equivalent Description
------------------------------------------------------------------
opkg install <pkg> apk add <pkg> Install a package
opkg remove <pkg> apk del <pkg> Remove a package
opkg upgrade apk upgrade Upgrade all packages
opkg files <pkg> apk info -L <pkg> List package contents
opkg list-installed apk info List installed packages
opkg update apk update Update package lists
opkg search <pkg> apk search <pkg> Search for packages
------------------------------------------------------------------
For more https://openwrt.org/docs/guide-user/additional-software/opkg-to-apk-cheatsheet
EOF
fi

View File

@ -0,0 +1,11 @@
if grep -Esq '^root::' /etc/shadow ; then
cat << EOF
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
EOF
fi

View File

@ -0,0 +1,21 @@
if [ -x /usr/bin/apk ] ; then
cat << EOF
OpenWrt recently switched to the "apk" package manager!
OPKG Command APK Equivalent Description
------------------------------------------------------------------
opkg install <pkg> apk add <pkg> Install a package
opkg remove <pkg> apk del <pkg> Remove a package
opkg upgrade apk upgrade Upgrade all packages
opkg files <pkg> apk info -L <pkg> List package contents
opkg list-installed apk info List installed packages
opkg update apk update Update package lists
opkg search <pkg> apk search <pkg> Search for packages
------------------------------------------------------------------
For more information visit:
https://openwrt.org/docs/guide-user/additional-software/opkg-to-apk-cheatsheet
EOF
fi

View File

@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_VERSION:=2025.07
PKG_HASH:=0f933f6c5a426895bf306e93e6ac53c60870e4b54cda56d95211bec99e63bec7
PKG_VERSION:=2025.10
PKG_HASH:=b4f032848e56cc8f213ad59f9132c084dbbb632bc29176d024e58220e0efdf4a
PKG_BUILD_DEPENDS:=arm-trusted-firmware-tools/host
UBOOT_USE_INTREE_DTC:=1

View File

@ -1,55 +0,0 @@
From 4f1fcf5281ee4e22b1e89a62bd0417878bcbeca5 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Tue, 3 Jun 2025 10:41:18 +0200
Subject: [PATCH 1/2] linux/bitfield.h: import FIELD_PREP_CONST macro from
Linux Kernel
Import FIELD_PREP_CONST macro from Linux Kernel to permit usage of
FIELD_PREP with scenario where a constant value is needed.
Refer to commit e2192de59e45 ("bitfield: add FIELD_PREP_CONST()") in
Linux kernel for extensive explaination of why this is useful.
This is also to better align with the Linux Kernel for easier porting of
driver.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
include/linux/bitfield.h | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
--- a/include/linux/bitfield.h
+++ b/include/linux/bitfield.h
@@ -90,6 +90,32 @@
((typeof(_mask))(_val) << __bf_shf(_mask)) & (_mask); \
})
+#define __BF_CHECK_POW2(n) BUILD_BUG_ON_ZERO(((n) & ((n) - 1)) != 0)
+
+/**
+ * FIELD_PREP_CONST() - prepare a constant bitfield element
+ * @_mask: shifted mask defining the field's length and position
+ * @_val: value to put in the field
+ *
+ * FIELD_PREP_CONST() masks and shifts up the value. The result should
+ * be combined with other fields of the bitfield using logical OR.
+ *
+ * Unlike FIELD_PREP() this is a constant expression and can therefore
+ * be used in initializers. Error checking is less comfortable for this
+ * version, and non-constant masks cannot be used.
+ */
+#define FIELD_PREP_CONST(_mask, _val) \
+ ( \
+ /* mask must be non-zero */ \
+ BUILD_BUG_ON_ZERO((_mask) == 0) + \
+ /* check if value fits */ \
+ BUILD_BUG_ON_ZERO(~((_mask) >> __bf_shf(_mask)) & (_val)) + \
+ /* check if mask is contiguous */ \
+ __BF_CHECK_POW2((_mask) + (1ULL << __bf_shf(_mask))) + \
+ /* and create the value */ \
+ (((typeof(_mask))(_val) << __bf_shf(_mask)) & (_mask)) \
+ )
+
/**
* FIELD_GET() - extract a bitfield element
* @_mask: shifted mask defining the field's length and position

View File

@ -1,56 +0,0 @@
From 00e8038b8be74d599f7bc8078731cc2505832f57 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Tue, 3 Jun 2025 10:47:15 +0200
Subject: [PATCH 2/2] mtd: spinand: winbond: add Winbond W25N04KV flash support
Add Winbond W25N04KV flash support that use a different value to detect
ECC bitflip.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
drivers/mtd/nand/spi/winbond.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -11,6 +11,7 @@
#include <linux/device.h>
#include <linux/kernel.h>
#endif
+#include <linux/bitfield.h>
#include <linux/bug.h>
#include <linux/mtd/spinand.h>
@@ -18,6 +19,8 @@
#define WINBOND_CFG_BUF_READ BIT(3)
+#define W25N04KV_STATUS_ECC_5_8_BITFLIPS FIELD_PREP_CONST(STATUS_ECC_MASK, 0x3)
+
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
@@ -121,6 +124,7 @@ static int w25n02kv_ecc_get_status(struc
return -EBADMSG;
case STATUS_ECC_HAS_BITFLIPS:
+ case W25N04KV_STATUS_ECC_5_8_BITFLIPS:
/*
* Let's try to retrieve the real maximum number of bitflips
* in order to avoid forcing the wear-leveling layer to move
@@ -169,6 +173,15 @@ static const struct spinand_info winbond
NAND_ECCREQ(8, 512),
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
&write_cache_variants,
+ &update_cache_variants),
+ 0,
+ SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_INFO("W25N04KV",
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x23),
+ NAND_MEMORG(1, 2048, 128, 64, 4096, 40, 2, 1, 1),
+ NAND_ECCREQ(8, 512),
+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+ &write_cache_variants,
&update_cache_variants),
0,
SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),

View File

@ -17,8 +17,6 @@ Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
include/linux/mtd/spinand.h | 7 ++
2 files changed, 95 insertions(+), 97 deletions(-)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index f5ddfbf4b83..ea00cd7dcf0 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -41,21 +41,6 @@ struct spinand_plat {
@ -275,7 +273,7 @@ index f5ddfbf4b83..ea00cd7dcf0 100644
static const struct nand_ops spinand_ops = {
.erase = spinand_erase,
.markbad = spinand_markbad,
@@ -1116,6 +1099,14 @@ static int spinand_init(struct spinand_device *spinand)
@@ -1134,6 +1117,14 @@ static int spinand_init(struct spinand_device *spinand)
goto err_free_bufs;
}
@ -315,6 +313,3 @@ index 6fe6fd520a4..163269313f6 100644
int (*select_target)(struct spinand_device *spinand,
unsigned int target);
unsigned int cur_target;
--
2.51.0

View File

@ -12,8 +12,6 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
drivers/spi/airoha_snfi_spi.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/drivers/spi/airoha_snfi_spi.c b/drivers/spi/airoha_snfi_spi.c
index 3ea25b293d1..4eb01038404 100644
--- a/drivers/spi/airoha_snfi_spi.c
+++ b/drivers/spi/airoha_snfi_spi.c
@@ -525,21 +525,6 @@ static int airoha_snand_nfi_config(struct airoha_snand_priv *priv)
@ -46,6 +44,3 @@ index 3ea25b293d1..4eb01038404 100644
.supports_op = airoha_snand_supports_op,
.exec_op = airoha_snand_exec_op,
};
--
2.51.0

View File

@ -32,8 +32,6 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
drivers/spi/airoha_snfi_spi.c | 143 +++++++++++++++++++++++++++-------
1 file changed, 117 insertions(+), 26 deletions(-)
diff --git a/drivers/spi/airoha_snfi_spi.c b/drivers/spi/airoha_snfi_spi.c
index 4eb01038404..7cd409ba44a 100644
--- a/drivers/spi/airoha_snfi_spi.c
+++ b/drivers/spi/airoha_snfi_spi.c
@@ -186,6 +186,14 @@
@ -257,6 +255,3 @@ index 4eb01038404..7cd409ba44a 100644
if (err)
return err;
}
--
2.51.0

View File

@ -19,8 +19,6 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
drivers/spi/airoha_snfi_spi.c | 309 ++++++++++++++++++++++++++++++++++
1 file changed, 309 insertions(+)
diff --git a/drivers/spi/airoha_snfi_spi.c b/drivers/spi/airoha_snfi_spi.c
index 7cd409ba44a..f72d11f5b19 100644
--- a/drivers/spi/airoha_snfi_spi.c
+++ b/drivers/spi/airoha_snfi_spi.c
@@ -141,12 +141,14 @@
@ -373,6 +371,3 @@ index 7cd409ba44a..f72d11f5b19 100644
};
static const struct dm_spi_ops airoha_snfi_spi_ops = {
--
2.51.0

View File

@ -15,8 +15,6 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
drivers/spi/airoha_snfi_spi.c | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/drivers/spi/airoha_snfi_spi.c b/drivers/spi/airoha_snfi_spi.c
index f72d11f5b19..7cafa900bbc 100644
--- a/drivers/spi/airoha_snfi_spi.c
+++ b/drivers/spi/airoha_snfi_spi.c
@@ -141,6 +141,7 @@
@ -89,6 +87,3 @@ index f72d11f5b19..7cafa900bbc 100644
if (err)
goto error_dma_unmap;
--
2.51.0

View File

@ -13,8 +13,6 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
drivers/spi/airoha_snfi_spi.c | 38 -----------------------------------
1 file changed, 38 deletions(-)
diff --git a/drivers/spi/airoha_snfi_spi.c b/drivers/spi/airoha_snfi_spi.c
index 7cafa900bbc..71e4fc13924 100644
--- a/drivers/spi/airoha_snfi_spi.c
+++ b/drivers/spi/airoha_snfi_spi.c
@@ -514,44 +514,6 @@ static int airoha_snand_nfi_config(struct airoha_snand_priv *priv)
@ -62,6 +60,3 @@ index 7cafa900bbc..71e4fc13924 100644
/* sec num */
val = FIELD_PREP(SPI_NFI_SEC_NUM, priv->nfi_cfg.sec_num);
err = regmap_update_bits(priv->regmap_nfi, REG_SPI_NFI_CON,
--
2.51.0

View File

@ -15,8 +15,6 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
drivers/spi/airoha_snfi_spi.c | 134 +++++++++++++++++++++++++---------
1 file changed, 101 insertions(+), 33 deletions(-)
diff --git a/drivers/spi/airoha_snfi_spi.c b/drivers/spi/airoha_snfi_spi.c
index 71e4fc13924..1fcf5dd89e9 100644
--- a/drivers/spi/airoha_snfi_spi.c
+++ b/drivers/spi/airoha_snfi_spi.c
@@ -641,7 +641,47 @@ static ssize_t airoha_snand_dirmap_read(struct spi_mem_dirmap_desc *desc,
@ -195,6 +193,3 @@ index 71e4fc13924..1fcf5dd89e9 100644
err = regmap_write(priv->regmap_nfi, REG_SPI_NFI_CMD, 0x80);
if (err)
goto error_dma_unmap;
--
2.51.0

View File

@ -16,8 +16,6 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
drivers/spi/airoha_snfi_spi.c | 35 +++++++++++++++++++----------------
1 file changed, 19 insertions(+), 16 deletions(-)
diff --git a/drivers/spi/airoha_snfi_spi.c b/drivers/spi/airoha_snfi_spi.c
index 1fcf5dd89e9..c9feef83f89 100644
--- a/drivers/spi/airoha_snfi_spi.c
+++ b/drivers/spi/airoha_snfi_spi.c
@@ -515,7 +515,7 @@ static int airoha_snand_nfi_config(struct airoha_snand_priv *priv)
@ -135,6 +133,3 @@ index 1fcf5dd89e9..c9feef83f89 100644
if (err)
goto error_dma_unmap;
--
2.51.0

View File

@ -30,8 +30,6 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
drivers/spi/airoha_snfi_spi.c | 94 ++---------------------------------
1 file changed, 4 insertions(+), 90 deletions(-)
diff --git a/drivers/spi/airoha_snfi_spi.c b/drivers/spi/airoha_snfi_spi.c
index c9feef83f89..37fee0c6655 100644
--- a/drivers/spi/airoha_snfi_spi.c
+++ b/drivers/spi/airoha_snfi_spi.c
@@ -218,13 +218,6 @@ struct airoha_snand_priv {
@ -170,6 +168,3 @@ index c9feef83f89..37fee0c6655 100644
};
static const struct udevice_id airoha_snand_ids[] = {
--
2.51.0

View File

@ -19,9 +19,9 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
board/airoha/an7583/MAINTAINERS | 5 +
board/airoha/an7583/Makefile | 3 +
board/airoha/an7583/an7583_rfb.c | 16 ++
configs/an7583_evb_defconfig | 83 ++++++
configs/an7583_evb_defconfig | 81 ++++++
include/configs/an7583.h | 19 ++
11 files changed, 645 insertions(+)
11 files changed, 643 insertions(+)
create mode 100644 arch/arm/dts/an7583-evb.dts
create mode 100644 arch/arm/dts/an7583.dtsi
create mode 100644 arch/arm/mach-airoha/an7583/Makefile
@ -667,7 +667,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+CONFIG_CMD_LOG=y
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_ENV_RELOC_GD_ENV_ADDR=y
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_REGMAP=y

View File

@ -96,7 +96,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
static int airoha_reset_update(struct airoha_reset_priv *priv,
unsigned long id, bool assert)
{
@@ -135,7 +191,7 @@ static int airoha_reset_xlate(struct res
@@ -135,7 +191,7 @@ static int airoha_reset_xlate(struct reset_ctl *reset_ctl,
{
struct airoha_reset_priv *priv = dev_get_priv(reset_ctl->dev);
@ -105,7 +105,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
return -EINVAL;
reset_ctl->id = priv->idx_map[args->args[0]];
@@ -150,7 +206,7 @@ static struct reset_ops airoha_reset_ops
@@ -150,7 +206,7 @@ static struct reset_ops airoha_reset_ops = {
.rst_status = airoha_reset_status,
};
@ -114,15 +114,15 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
{
struct airoha_reset_priv *priv = dev_get_priv(dev);
int ret;
@@ -161,10 +217,44 @@ static int airoha_reset_probe(struct ude
@@ -161,10 +217,44 @@ static int airoha_reset_probe(struct udevice *dev)
priv->bank_ofs = en7581_rst_ofs;
priv->idx_map = en7581_rst_map;
+ priv->num_rsts = ARRAY_SIZE(en7581_rst_map);
return 0;
}
+
+ return 0;
+}
+
+static int an7583_reset_probe(struct udevice *dev)
+{
+ struct airoha_reset_priv *priv = dev_get_priv(dev);
@ -139,10 +139,10 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+ priv->bank_ofs = en7581_rst_ofs;
+ priv->idx_map = an7583_rst_map;
+ priv->num_rsts = ARRAY_SIZE(an7583_rst_map);
+
+ return 0;
+}
+
return 0;
}
+static int airoha_reset_probe(struct udevice *dev)
+{
+ if (ofnode_device_is_compatible(dev_ofnode(dev),
@ -223,3 +223,4 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+#define AN7583_XPON_MAC_RST 47
+
+#endif /* __DT_BINDINGS_RESET_CONTROLLER_AIROHA_AN7583_H_ */

View File

@ -1,7 +1,7 @@
From 289503869e5580658035e82d91b02a43c775f1a1 Mon Sep 17 00:00:00 2001
From dfdc7309ba22f6a6b6c581acfe95a222108bd760 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Mon, 19 May 2025 14:29:53 +0200
Subject: [PATCH 1/4] net: airoha: add support for Airoha AN7583
Subject: [PATCH] net: airoha: add support for Airoha AN7583
Add support for Ethernet controller present in Airoha AN7583. This
follow the same implementation of Airoha AN7581 with the only difference
@ -61,7 +61,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
/* FE */
#define PSE_BASE 0x0100
@@ -311,6 +330,26 @@ struct airoha_eth {
@@ -312,6 +331,26 @@ struct airoha_eth {
struct airoha_gdm_port *ports[AIROHA_MAX_NUM_GDM_PORTS];
};
@ -88,7 +88,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
static u32 airoha_rr(void __iomem *base, u32 offset)
{
return readl(base + offset);
@@ -351,8 +390,12 @@ static u32 airoha_rmw(void __iomem *base
@@ -352,8 +391,12 @@ static u32 airoha_rmw(void __iomem *base, u32 offset, u32 mask, u32 val)
#define airoha_qdma_clear(qdma, offset, val) \
airoha_rmw((qdma)->regs, (offset), (val), 0)
@ -99,9 +99,9 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+#define airoha_switch_rmw(eth, offset, mask, val) \
+ airoha_rmw((eth)->switch_regs, (offset), (mask), (val))
static void airoha_fe_maccr_init(struct airoha_eth *eth)
{
@@ -652,10 +695,12 @@ static int airoha_hw_init(struct udevice
static inline dma_addr_t dma_map_unaligned(void *vaddr, size_t len,
enum dma_data_direction dir)
@@ -682,10 +725,12 @@ static int airoha_hw_init(struct udevice *dev,
static int airoha_switch_init(struct udevice *dev, struct airoha_eth *eth)
{
@ -115,7 +115,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
if (!ofnode_valid(switch_node))
return -EINVAL;
@@ -687,17 +732,71 @@ static int airoha_switch_init(struct ude
@@ -717,17 +762,71 @@ static int airoha_switch_init(struct udevice *dev, struct airoha_eth *eth)
FIELD_PREP(SWITCH_PHY_END_ADDR, 0xc) |
FIELD_PREP(SWITCH_PHY_ST_ADDR, 0x8));
@ -189,7 +189,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
if (!ofnode_valid(scu_node))
return -EINVAL;
@@ -721,11 +820,11 @@ static int airoha_eth_probe(struct udevi
@@ -751,11 +850,11 @@ static int airoha_eth_probe(struct udevice *dev)
return -ENOMEM;
eth->rsts.count = AIROHA_MAX_NUM_RSTS;
@ -203,7 +203,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
ret = reset_get_by_name(dev, "fe", &eth->rsts.resets[0]);
if (ret)
@@ -739,21 +838,12 @@ static int airoha_eth_probe(struct udevi
@@ -769,21 +868,12 @@ static int airoha_eth_probe(struct udevice *dev)
if (ret)
return ret;
@ -231,11 +231,10 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
ret = airoha_hw_init(dev, eth);
if (ret)
@@ -924,8 +1014,44 @@ static int arht_eth_write_hwaddr(struct
@@ -971,8 +1061,43 @@ static int arht_eth_write_hwaddr(struct udevice *dev)
return 0;
}
+
+static ofnode en7581_get_scu_node(struct udevice *dev)
+{
+ return ofnode_by_compatible(ofnode_null(), "airoha,en7581-scu");
@ -274,6 +273,6 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+ { .compatible = "airoha,an7583-eth",
+ .data = (ulong)&an7583_data,
+ },
{ }
};
static const struct eth_ops airoha_eth_ops = {

View File

@ -1,32 +0,0 @@
From a11420dac873fbd5b8a81192571d914f01bee26d Mon Sep 17 00:00:00 2001
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Date: Wed, 9 Jul 2025 12:28:07 +0300
Subject: [PATCH 1/5] drivers/net/airoha_eth: add missing terminator for
compatible devices list
Compatible device list must have a terminator. If terminator is missed
the u-boot driver subsystem will access random data placed after the
list in the memory.
The issue can be observed with the "dm compat" command.
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
---
drivers/net/airoha_eth.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/airoha_eth.c b/drivers/net/airoha_eth.c
index b3fd1ab9064..db34ec48c81 100644
--- a/drivers/net/airoha_eth.c
+++ b/drivers/net/airoha_eth.c
@@ -1052,6 +1052,7 @@ static const struct udevice_id airoha_eth_ids[] = {
{ .compatible = "airoha,an7583-eth",
.data = (ulong)&an7583_data,
},
+ { }
};
static const struct eth_ops airoha_eth_ops = {
--
2.51.0

View File

@ -0,0 +1,93 @@
From e7b7bd119b68fe9106a1c9a45a7eba811fc40ce0 Mon Sep 17 00:00:00 2001
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Date: Fri, 3 Oct 2025 20:12:06 +0300
Subject: [PATCH v2 1/2] net: airoha: simplify rx/free packet logic a bit
The commit 997786bbf473 ("drivers/net/airoha_eth: fix stalling in package
receiving") can be improved. Instead of returning previous descriptor
it's possible:
* do nothing in even descriptor case
* return 2 descriptor to the queue (current and previous) in the odd
descriptor case.
This patch:
* implements above approach
* remove logic not required within new approach
* adds note that PKTBUFSRX must be even and larger than 7
for reliable driver operations
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
---
drivers/net/airoha_eth.c | 40 +++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 19 deletions(-)
--- a/drivers/net/airoha_eth.c
+++ b/drivers/net/airoha_eth.c
@@ -492,14 +492,10 @@ static int airoha_qdma_init_rx_queue(struct airoha_queue *q,
RX_RING_SIZE_MASK,
FIELD_PREP(RX_RING_SIZE_MASK, ndesc));
- /*
- * See arht_eth_free_pkt() for the reasons used to fill
- * REG_RX_CPU_IDX(qid) register.
- */
airoha_qdma_rmw(qdma, REG_RX_RING_SIZE(qid), RX_RING_THR_MASK,
FIELD_PREP(RX_RING_THR_MASK, 0));
airoha_qdma_rmw(qdma, REG_RX_CPU_IDX(qid), RX_RING_CPU_IDX_MASK,
- FIELD_PREP(RX_RING_CPU_IDX_MASK, q->ndesc - 3));
+ FIELD_PREP(RX_RING_CPU_IDX_MASK, q->ndesc - 1));
airoha_qdma_rmw(qdma, REG_RX_DMA_IDX(qid), RX_RING_DMA_IDX_MASK,
FIELD_PREP(RX_RING_DMA_IDX_MASK, q->head));
@@ -1010,7 +1006,6 @@ static int arht_eth_free_pkt(struct udevice *dev, uchar *packet, int length)
struct airoha_qdma *qdma = &eth->qdma[0];
struct airoha_queue *q;
int qid;
- u16 prev, pprev;
if (!packet)
return 0;
@@ -1020,22 +1015,29 @@ static int arht_eth_free_pkt(struct udevice *dev, uchar *packet, int length)
/*
* Due to cpu cache issue the airoha_qdma_reset_rx_desc() function
- * will always touch 2 descriptors:
- * - if current descriptor is even, then the previous and the one
- * before previous descriptors will be touched (previous cacheline)
- * - if current descriptor is odd, then only current and previous
- * descriptors will be touched (current cacheline)
+ * will always touch 2 descriptors placed on the same cacheline:
+ * - if current descriptor is even, then current and next
+ * descriptors will be touched
+ * - if current descriptor is odd, then current and previous
+ * descriptors will be touched
*
- * Thus, to prevent possible destroying of rx queue, only (q->ndesc - 2)
- * descriptors might be used for packet receiving.
+ * Thus, to prevent possible destroying of rx queue, we should:
+ * - do nothing in the even descriptor case,
+ * - utilize 2 descriptors (current and previous one) in the
+ * odd descriptor case.
+ *
+ * WARNING: Observations shows that PKTBUFSRX must be even and
+ * larger than 7 for reliable driver operations.
*/
- prev = (q->head + q->ndesc - 1) % q->ndesc;
- pprev = (q->head + q->ndesc - 2) % q->ndesc;
- q->head = (q->head + 1) % q->ndesc;
+ if (q->head & 0x01) {
+ airoha_qdma_reset_rx_desc(q, q->head - 1);
+ airoha_qdma_reset_rx_desc(q, q->head);
- airoha_qdma_reset_rx_desc(q, prev);
- airoha_qdma_rmw(qdma, REG_RX_CPU_IDX(qid), RX_RING_CPU_IDX_MASK,
- FIELD_PREP(RX_RING_CPU_IDX_MASK, pprev));
+ airoha_qdma_rmw(qdma, REG_RX_CPU_IDX(qid), RX_RING_CPU_IDX_MASK,
+ FIELD_PREP(RX_RING_CPU_IDX_MASK, q->head));
+ }
+
+ q->head = (q->head + 1) % q->ndesc;
return 0;
}

View File

@ -1,107 +0,0 @@
From 8fce1cfe775e1f3b5d7cecb8bdcc8271bf9f799c Mon Sep 17 00:00:00 2001
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Date: Wed, 9 Jul 2025 12:28:08 +0300
Subject: [PATCH 2/5] drivers/net/airoha_eth: fix packet transmission errors
The dma_map_single() function calls one of the functions
* invalidate_dcache_range(),
* flush_dcache_range().
Both of them expect that 'vaddr' is aligned to the ARCH_DMA_MINALIGN
boundary. Unfortunately, RX/TX descriptors are 32-byte long. Thus they
might not be aligned to the ARCH_DMA_MINALIGN boundary. Data flushing
(or invalidating) might do nothing in this case.
The same applies to dma_unmap_single() function.
In the TX path case the issue might prevent package transmission (filled
TX descriptor was not flushed).
To fix an issue a special wrappers for
* dma_map_single(),
* dma_unmap_single()
functions were created. The patch fix flushing/invalidatiog for the
RX path as well.
The bug appears on 32-bit airoha platform, but should be present on
64-bit as well.
The code was tested both on 32-bit and 64-bit airoha boards.
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
---
drivers/net/airoha_eth.c | 33 +++++++++++++++++++++++++++------
1 file changed, 27 insertions(+), 6 deletions(-)
diff --git a/drivers/net/airoha_eth.c b/drivers/net/airoha_eth.c
index db34ec48c81..aae6922f3c7 100644
--- a/drivers/net/airoha_eth.c
+++ b/drivers/net/airoha_eth.c
@@ -397,6 +397,27 @@ static u32 airoha_rmw(void __iomem *base, u32 offset, u32 mask, u32 val)
#define airoha_switch_rmw(eth, offset, mask, val) \
airoha_rmw((eth)->switch_regs, (offset), (mask), (val))
+static inline dma_addr_t dma_map_unaligned(void *vaddr, size_t len,
+ enum dma_data_direction dir)
+{
+ uintptr_t start, end;
+
+ start = ALIGN_DOWN((uintptr_t)vaddr, ARCH_DMA_MINALIGN);
+ end = ALIGN((uintptr_t)(vaddr + len), ARCH_DMA_MINALIGN);
+
+ return dma_map_single((void *)start, end - start, dir);
+}
+
+static inline void dma_unmap_unaligned(dma_addr_t addr, size_t len,
+ enum dma_data_direction dir)
+{
+ uintptr_t start, end;
+
+ start = ALIGN_DOWN((uintptr_t)addr, ARCH_DMA_MINALIGN);
+ end = ALIGN((uintptr_t)(addr + len), ARCH_DMA_MINALIGN);
+ dma_unmap_single(start, end - start, dir);
+}
+
static void airoha_fe_maccr_init(struct airoha_eth *eth)
{
int p;
@@ -434,7 +455,7 @@ static void airoha_qdma_reset_rx_desc(struct airoha_queue *q, int index,
val = FIELD_PREP(QDMA_DESC_LEN_MASK, PKTSIZE_ALIGN);
WRITE_ONCE(desc->ctrl, cpu_to_le32(val));
- dma_map_single(desc, sizeof(*desc), DMA_TO_DEVICE);
+ dma_map_unaligned(desc, sizeof(*desc), DMA_TO_DEVICE);
}
static void airoha_qdma_init_rx_desc(struct airoha_queue *q)
@@ -916,14 +937,14 @@ static int airoha_eth_send(struct udevice *dev, void *packet, int length)
WRITE_ONCE(desc->msg1, cpu_to_le32(msg1));
WRITE_ONCE(desc->msg2, cpu_to_le32(0xffff));
- dma_map_single(desc, sizeof(*desc), DMA_TO_DEVICE);
+ dma_map_unaligned(desc, sizeof(*desc), DMA_TO_DEVICE);
airoha_qdma_rmw(qdma, REG_TX_CPU_IDX(qid), TX_RING_CPU_IDX_MASK,
FIELD_PREP(TX_RING_CPU_IDX_MASK, index));
for (i = 0; i < 100; i++) {
- dma_unmap_single(virt_to_phys(desc), sizeof(*desc),
- DMA_FROM_DEVICE);
+ dma_unmap_unaligned(virt_to_phys(desc), sizeof(*desc),
+ DMA_FROM_DEVICE);
if (desc->ctrl & QDMA_DESC_DONE_MASK)
break;
@@ -954,8 +975,8 @@ static int airoha_eth_recv(struct udevice *dev, int flags, uchar **packetp)
q = &qdma->q_rx[qid];
desc = &q->desc[q->head];
- dma_unmap_single(virt_to_phys(desc), sizeof(*desc),
- DMA_FROM_DEVICE);
+ dma_unmap_unaligned(virt_to_phys(desc), sizeof(*desc),
+ DMA_FROM_DEVICE);
if (!(desc->ctrl & QDMA_DESC_DONE_MASK))
return -EAGAIN;
--
2.51.0

View File

@ -1,135 +0,0 @@
From 352c071bc18855238565cc6417a4c15a4e24bad8 Mon Sep 17 00:00:00 2001
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Date: Wed, 9 Jul 2025 12:28:09 +0300
Subject: [PATCH 3/5] drivers/net/airoha_eth: fix stalling in package
receiving
ARCH_DMA_MINALIGN is 64 for ARMv7a/ARMv8a architectures, but RX/TX
descriptors are 32 bytes long. So they may not be aligned on an
ARCH_DMA_MINALIGN boundary. In case of RX path, this may cause the
following problem
1) Assume that a packet has arrived and the EVEN rx descriptor has been
updated with the incoming data. The driver will invalidate and check
the corresponding rx descriptor.
2) Now suppose the next descriptor (ODD) has not yet completed.
Please note that all even descriptors starts on 64-byte boundary,
and the odd ones are NOT aligned on 64-byte boundary.
Inspecting even descriptor, we will read the entire CPU cache line
(64 bytes). So we read and sore in CPU cache also the next (odd)
descriptor.
3) Now suppose the next packet (for the odd rx descriptor) arrived
while the first packet was being processed. So we have new data
in memory but old data in cache.
4) After packet processing (in arht_eth_free_pkt() function) we will
cleanup the descriptor and put it back to rx queue.
This will call flush_dcache_range() function for the even descriptor,
so the odd one will be flushed as well (it is in the same cache line).
So the old data will be written to the next rx descriptor.
5) We get a freeze. The next descriptor is empty (so the driver is
waiting for packets), but the hardware will continue to receive
packets on other available descriptors. This will continue until
the last available rx descriptor is full. Then the hardware will
also freeze.
The problem will be solved if:
* do nothing in even descriptor case,
* return 2 descriptor to the queue (current and previous) in the odd
descriptor case.
If the current descriptor is even nothing will be done, so no issue
will arrise.
If the current descriptor is odd, then the previous descriptor is on
the same cache line. Both (current and previous) descriptors are not
currently in use, so issue will not arrise as well.
WARNING: The following restrictions on PKTBUFSRX must be held:
* PKTBUFSRX is even,
* PKTBUFSRX >= 4. Observations shows that PKTBUFSRX must be at least 8.
The bug appears on 32-bit airoha platform, but should be present on
64-bit as well.
The code was tested both on 32-bit and 64-bit airoha boards.
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
---
drivers/net/airoha_eth.c | 33 ++++++++++++++++++++++++++-------
1 file changed, 26 insertions(+), 7 deletions(-)
diff --git a/drivers/net/airoha_eth.c b/drivers/net/airoha_eth.c
index aae6922f3c7..44d4773bc5d 100644
--- a/drivers/net/airoha_eth.c
+++ b/drivers/net/airoha_eth.c
@@ -435,13 +435,14 @@ static int airoha_fe_init(struct airoha_eth *eth)
return 0;
}
-static void airoha_qdma_reset_rx_desc(struct airoha_queue *q, int index,
- uchar *rx_packet)
+static void airoha_qdma_reset_rx_desc(struct airoha_queue *q, int index)
{
struct airoha_qdma_desc *desc;
+ uchar *rx_packet;
u32 val;
desc = &q->desc[index];
+ rx_packet = net_rx_packets[index];
index = (index + 1) % q->ndesc;
dma_map_single(rx_packet, PKTSIZE_ALIGN, DMA_TO_DEVICE);
@@ -463,7 +464,7 @@ static void airoha_qdma_init_rx_desc(struct airoha_queue *q)
int i;
for (i = 0; i < q->ndesc; i++)
- airoha_qdma_reset_rx_desc(q, i, net_rx_packets[i]);
+ airoha_qdma_reset_rx_desc(q, i);
}
static int airoha_qdma_init_rx_queue(struct airoha_queue *q,
@@ -1003,12 +1004,30 @@ static int arht_eth_free_pkt(struct udevice *dev, uchar *packet, int length)
qid = 0;
q = &qdma->q_rx[qid];
- dma_map_single(packet, length, DMA_TO_DEVICE);
+ /*
+ * Due to cpu cache issue the airoha_qdma_reset_rx_desc() function
+ * will always touch 2 descriptors placed on the same cacheline:
+ * - if current descriptor is even, then current and next
+ * descriptors will be touched
+ * - if current descriptor is odd, then current and previous
+ * descriptors will be touched
+ *
+ * Thus, to prevent possible destroying of rx queue, we should:
+ * - do nothing in the even descriptor case,
+ * - utilize 2 descriptors (current and previous one) in the
+ * odd descriptor case.
+ *
+ * WARNING: Observations shows that PKTBUFSRX must be even and
+ * larger than 7 for reliable driver operations.
+ */
+ if (q->head & 0x01) {
+ airoha_qdma_reset_rx_desc(q, q->head - 1);
+ airoha_qdma_reset_rx_desc(q, q->head);
- airoha_qdma_reset_rx_desc(q, q->head, packet);
+ airoha_qdma_rmw(qdma, REG_RX_CPU_IDX(qid), RX_RING_CPU_IDX_MASK,
+ FIELD_PREP(RX_RING_CPU_IDX_MASK, q->head));
+ }
- airoha_qdma_rmw(qdma, REG_RX_CPU_IDX(qid), RX_RING_CPU_IDX_MASK,
- FIELD_PREP(RX_RING_CPU_IDX_MASK, q->head));
q->head = (q->head + 1) % q->ndesc;
return 0;
--
2.51.0

View File

@ -1,64 +0,0 @@
From dc0ae3455f4344403e293c9b385653ad3fddb0b1 Mon Sep 17 00:00:00 2001
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Date: Wed, 9 Jul 2025 12:28:10 +0300
Subject: [PATCH 4/5] drivers/net/airoha_eth: enable hw padding of short tx
packets
Transmission of short packets does not work good for XFI (GDM2) and
HSGMII (GDM3) interfaces. The issue can be solved with:
- padding of short packets to 60 bytes
- setting of PAD_EN bit in the corresponding REG_GDM_FWD_CFG(n)
register.
The issue should present for the lan switch (GDM1) as well, but it does
does not appear due to unknown reason.
This patch set PAD_EN bit for the used GDM.
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
---
drivers/net/airoha_eth.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/airoha_eth.c b/drivers/net/airoha_eth.c
index 53c722379c9..b2f73c7dbb7 100644
--- a/drivers/net/airoha_eth.c
+++ b/drivers/net/airoha_eth.c
@@ -116,6 +116,7 @@
(_n) == 2 ? GDM2_BASE : GDM1_BASE)
#define REG_GDM_FWD_CFG(_n) GDM_BASE(_n)
+#define GDM_PAD_EN BIT(28)
#define GDM_DROP_CRC_ERR BIT(23)
#define GDM_IP4_CKSUM BIT(22)
#define GDM_TCP_CKSUM BIT(21)
@@ -423,8 +424,11 @@ static void airoha_fe_maccr_init(struct airoha_eth *eth)
int p;
for (p = 1; p <= ARRAY_SIZE(eth->ports); p++) {
- /* Disable any kind of CRC drop or offload */
- airoha_fe_wr(eth, REG_GDM_FWD_CFG(p), 0);
+ /*
+ * Disable any kind of CRC drop or offload.
+ * Enable padding of short TX packets to 60 bytes.
+ */
+ airoha_fe_wr(eth, REG_GDM_FWD_CFG(p), GDM_PAD_EN);
}
}
@@ -920,6 +924,11 @@ static int airoha_eth_send(struct udevice *dev, void *packet, int length)
u32 val;
int i;
+ /*
+ * There is no need to pad short TX packets to 60 bytes since the
+ * GDM_PAD_EN bit set in the corresponding REG_GDM_FWD_CFG(n) register.
+ */
+
dma_addr = dma_map_single(packet, length, DMA_TO_DEVICE);
qid = 0;
--
2.51.0

View File

@ -13,30 +13,23 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
configs/an7583_evb_defconfig | 1 +
2 files changed, 2 insertions(+)
diff --git a/configs/an7581_evb_defconfig b/configs/an7581_evb_defconfig
index c74247e13db..aa1a30aad6a 100644
--- a/configs/an7581_evb_defconfig
+++ b/configs/an7581_evb_defconfig
@@ -44,6 +44,7 @@ CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
@@ -43,6 +43,7 @@ CONFIG_ENV_IS_IN_MMC=y
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_SYS_RX_ETH_BUFFER=8
CONFIG_REGMAP=y
CONFIG_SYSCON=y
CONFIG_CLK=y
diff --git a/configs/an7583_evb_defconfig b/configs/an7583_evb_defconfig
index 057104b93af..c67444ae8bf 100644
--- a/configs/an7583_evb_defconfig
+++ b/configs/an7583_evb_defconfig
@@ -44,6 +44,7 @@ CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_SYS_RX_ETH_BUFFER=8
CONFIG_REGMAP=y
CONFIG_SYSCON=y
CONFIG_CLK=y
--
2.51.0

View File

@ -38,14 +38,10 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
--- a/arch/arm/dts/an7583-evb.dts
+++ b/arch/arm/dts/an7583-evb.dts
@@ -46,6 +46,28 @@
@@ -46,6 +46,24 @@
};
};
+&snfi {
+ status = "okay";
+};
+
+&spi_nand {
+ partitions {
+ compatible = "fixed-partitions";
@ -69,7 +65,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
pinctrl-0 = <&pcie0_rst_pins>;
--- a/configs/an7581_evb_defconfig
+++ b/configs/an7581_evb_defconfig
@@ -77,3 +77,19 @@ CONFIG_SPI=y
@@ -78,3 +78,19 @@ CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_AIROHA_SNFI_SPI=y
CONFIG_SHA512=y
@ -91,7 +87,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+# CONFIG_UBIFS_SILENCE_DEBUG_DUMP is not set
--- a/configs/an7583_evb_defconfig
+++ b/configs/an7583_evb_defconfig
@@ -79,3 +79,19 @@ CONFIG_SHA512=y
@@ -80,3 +80,19 @@ CONFIG_SHA512=y
CONFIG_AIROHA_ETH=y
CONFIG_MMC_MTK=y
CONFIG_AIROHA_SNFI_SPI=y

View File

@ -7,28 +7,28 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
configs/an7581_evb_defconfig | 2 ++
configs/an7583_evb_defconfig | 2 ++
defenvs/an7581_rfb_env | 3 +++
defenvs/an7583_rfb_env | 3 +++
4 files changed, 10 insertions(+)
defenvs/an7581_rfb_env | 4 ++++
defenvs/an7583_rfb_env | 4 ++++
4 files changed, 12 insertions(+)
create mode 100644 defenvs/an7581_rfb_env
create mode 100644 defenvs/an7583_rfb_env
--- a/configs/an7581_evb_defconfig
+++ b/configs/an7581_evb_defconfig
@@ -93,3 +93,5 @@ CONFIG_MTD_UBI_BEB_LIMIT=20
@@ -94,3 +94,5 @@ CONFIG_MTD_UBI_BEB_LIMIT=20
CONFIG_UBI_BLOCK=y
# CONFIG_UBIFS_SILENCE_MSG is not set
# CONFIG_UBIFS_SILENCE_DEBUG_DUMP is not set
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_DEFAULT_ENV_FILE="defenvs/an7581_rfb_env"
+CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y
+CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/an7581_rfb_env"
--- a/configs/an7583_evb_defconfig
+++ b/configs/an7583_evb_defconfig
@@ -95,3 +95,5 @@ CONFIG_MTD_UBI_BEB_LIMIT=20
@@ -96,3 +96,5 @@ CONFIG_MTD_UBI_BEB_LIMIT=20
CONFIG_UBI_BLOCK=y
# CONFIG_UBIFS_SILENCE_MSG is not set
# CONFIG_UBIFS_SILENCE_DEBUG_DUMP is not set
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_DEFAULT_ENV_FILE="defenvs/an7583_rfb_env"
+CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y
+CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/an7583_rfb_env"
--- /dev/null
+++ b/defenvs/an7581_rfb_env
@@ -0,0 +1,4 @@

View File

@ -0,0 +1,40 @@
From 10bd131a6a365965ce868419933fd7936e91c635 Mon Sep 17 00:00:00 2001
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Date: Mon, 13 Oct 2025 20:48:00 +0300
Subject: [PATCH 2/3] arm: airoha: disable environment inside mtd partition
When booting on en7581_evb board equipped with spinand flash, a u-boot
panic occurs. The panic is caused by the absence any available mtd
partition.
Disable CONFIG_ENV_IS_IN_MTD to avoid an issue. The environment will
be stored in the EMMC or in UBI, so actually CONFIG_ENV_IS_IN_MTD is
not needed.
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
---
configs/an7581_evb_defconfig | 1 +
configs/an7583_evb_defconfig | 1 +
2 files changed, 2 insertions(+)
--- a/configs/an7581_evb_defconfig
+++ b/configs/an7581_evb_defconfig
@@ -40,6 +40,7 @@ CONFIG_CMD_LOG=y
CONFIG_OF_UPSTREAM=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_MMC=y
+# CONFIG_ENV_IS_IN_MTD is not set
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_NET_RANDOM_ETHADDR=y
--- a/configs/an7583_evb_defconfig
+++ b/configs/an7583_evb_defconfig
@@ -41,6 +41,7 @@ CONFIG_CMD_MTDPARTS=y
CONFIG_CMD_LOG=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_MMC=y
+# CONFIG_ENV_IS_IN_MTD is not set
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_NET_RANDOM_ETHADDR=y

View File

@ -0,0 +1,23 @@
From 6c4a07ecf211b56eb28fe2dbd8e324b2fdecb84a Mon Sep 17 00:00:00 2001
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Date: Mon, 13 Oct 2025 20:44:24 +0300
Subject: [PATCH 1/3] arm: airoha: dts: enable spi support for en7581_evb board
spinand flashes are inaccessible without this patch
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
---
arch/arm/dts/en7581-evb-u-boot.dtsi | 4 ++++
1 file changed, 4 insertions(+)
--- a/arch/arm/dts/en7581-evb-u-boot.dtsi
+++ b/arch/arm/dts/en7581-evb-u-boot.dtsi
@@ -9,3 +9,7 @@
};
#include "an7581-u-boot.dtsi"
+
+&snfi {
+ status = "okay";
+};

View File

@ -0,0 +1,32 @@
From bee36b6f42792556e123f331ece80f8d5a40e8cd Mon Sep 17 00:00:00 2001
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Date: Mon, 13 Oct 2025 20:56:31 +0300
Subject: [PATCH 3/3] arm: airoha: enable position independent code
This slightly increase the code, but makes debugging a bit easy
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
---
configs/an7581_evb_defconfig | 1 +
configs/an7583_evb_defconfig | 1 +
2 files changed, 2 insertions(+)
--- a/configs/an7581_evb_defconfig
+++ b/configs/an7581_evb_defconfig
@@ -1,5 +1,6 @@
CONFIG_ARM=y
CONFIG_ARCH_AIROHA=y
+CONFIG_POSITION_INDEPENDENT=y
CONFIG_TEXT_BASE=0x81E00000
CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_NR_DRAM_BANKS=1
--- a/configs/an7583_evb_defconfig
+++ b/configs/an7583_evb_defconfig
@@ -1,5 +1,6 @@
CONFIG_ARM=y
CONFIG_ARCH_AIROHA=y
+CONFIG_POSITION_INDEPENDENT=y
CONFIG_TARGET_AN7583=y
CONFIG_TEXT_BASE=0x81E00000
CONFIG_SYS_MALLOC_F_LEN=0x4000

View File

@ -398,11 +398,11 @@ define U-Boot/mt7981_h3c_magic-nx30-pro
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
endef
define U-Boot/mt7981_imou_lc-hx3001
NAME:=Imou LC-HX3001
define U-Boot/mt7981_imou_hx21
NAME:=Imou HX21
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=imou_lc-hx3001
UBOOT_CONFIG:=mt7981_imou_lc-hx3001
BUILD_DEVICES:=imou_hx21
UBOOT_CONFIG:=mt7981_imou_hx21
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=spim-nand
BL2_SOC:=mt7981
@ -1196,7 +1196,7 @@ UBOOT_TARGETS := \
mt7981_glinet_gl-x3000 \
mt7981_glinet_gl-xe3000 \
mt7981_h3c_magic-nx30-pro \
mt7981_imou_lc-hx3001 \
mt7981_imou_hx21 \
mt7981_jcg_q30-pro \
mt7981_konka_komi-a31 \
mt7981_konka_komi-a31-emmc \

View File

@ -1,5 +1,5 @@
--- /dev/null
+++ b/configs/mt7981_imou_lc-hx3001_defconfig
+++ b/configs/mt7981_imou_hx21_defconfig
@@ -0,0 +1,108 @@
+CONFIG_ARM=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
@ -8,7 +8,7 @@
+CONFIG_TEXT_BASE=0x41e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_DEFAULT_DEVICE_TREE="mt7981-imou-lc-hx3001"
+CONFIG_DEFAULT_DEVICE_TREE="mt7981-imou-hx21"
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_TARGET_MT7981=y
+CONFIG_SYS_LOAD_ADDR=0x46000000
@ -20,7 +20,7 @@
+CONFIG_BOOTDELAY=30
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_MENU_SHOW=y
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-imou-lc-hx3001.dtb"
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-imou-hx21.dtb"
+CONFIG_LOGLEVEL=7
+CONFIG_PRE_CONSOLE_BUFFER=y
+CONFIG_LOG=y
@ -66,7 +66,7 @@
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
+CONFIG_ENV_RELOC_GD_ENV_ADDR=y
+CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y
+CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/imou_lc-hx3001_env"
+CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/imou_hx21_env"
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_NETCONSOLE=y
@ -110,7 +110,7 @@
+CONFIG_ZSTD=y
+CONFIG_HEXDUMP=y
--- /dev/null
+++ b/arch/arm/dts/mt7981-imou-lc-hx3001.dts
+++ b/arch/arm/dts/mt7981-imou-hx21.dts
@@ -0,0 +1,171 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
@ -122,8 +122,8 @@
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "Imou LC-HX3001";
+ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
+ model = "Imou HX21";
+ compatible = "imou,hx21", "mediatek,mt7981", "mediatek,mt7981-rfb";
+
+ chosen {
+ stdout-path = &uart0;
@ -284,7 +284,7 @@
+ status = "disabled";
+};
--- /dev/null
+++ b/defenvs/imou_lc-hx3001_env
+++ b/defenvs/imou_hx21_env
@@ -0,0 +1,54 @@
+ipaddr=192.168.1.1
+serverip=192.168.1.254
@ -293,10 +293,10 @@
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
+bootconf=config-1
+bootdelay=0
+bootfile=immortalwrt-mediatek-filogic-imou_lc-hx3001-initramfs-recovery.itb
+bootfile_bl2=immortalwrt-mediatek-filogic-imou_lc-hx3001-preloader.bin
+bootfile_fip=immortalwrt-mediatek-filogic-imou_lc-hx3001-bl31-uboot.fip
+bootfile_upg=immortalwrt-mediatek-filogic-imou_lc-hx3001-squashfs-sysupgrade.itb
+bootfile=immortalwrt-mediatek-filogic-imou_hx21-initramfs-recovery.itb
+bootfile_bl2=immortalwrt-mediatek-filogic-imou_hx21-preloader.bin
+bootfile_fip=immortalwrt-mediatek-filogic-imou_hx21-bl31-uboot.fip
+bootfile_upg=immortalwrt-mediatek-filogic-imou_hx21-squashfs-sysupgrade.itb
+bootled_pwr=green:power
+bootled_rec=green:power
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60

View File

@ -261,6 +261,13 @@ define U-Boot/bpi-r2-pro-rk3568
sinovoip_bpi-r2-pro
endef
define U-Boot/easepi-r1-rk3568
$(U-Boot/rk3568/Default)
NAME:=LinkEase EasePi R1
BUILD_DEVICES:= \
linkease_easepi-r1
endef
define U-Boot/fastrhino-r66s-rk3568
$(U-Boot/rk3568/Default)
NAME:=FastRhino R66S
@ -275,13 +282,6 @@ define U-Boot/fastrhino-r68s-rk3568
lunzn_fastrhino-r68s
endef
define U-Boot/generic-rk3568
$(U-Boot/rk3568/Default)
NAME:=Generic RK3566/RK3568 board
BUILD_DEVICES:= \
linkease_easepi-r1
endef
define U-Boot/lyt-t68m-rk3568
$(U-Boot/rk3568/Default)
NAME:=LYT T68M
@ -516,9 +516,9 @@ UBOOT_TARGETS := \
rock-3c-rk3566 \
9tripod-x3568-v4-rk3568 \
bpi-r2-pro-rk3568 \
easepi-r1-rk3568 \
fastrhino-r66s-rk3568 \
fastrhino-r68s-rk3568 \
generic-rk3568 \
lyt-t68m-rk3568 \
mmbox-anas3035-rk3568 \
mrkaio-m68s-rk3568 \

View File

@ -0,0 +1,662 @@
From 63d60b21fd4933080ff22bdc21652f7c2a14bc52 Mon Sep 17 00:00:00 2001
From: Liangbin Lian <jjm2473@gmail.com>
Date: Tue, 14 Oct 2025 13:12:26 +0800
Subject: [PATCH 1/2] arm64: dts: rockchip: add LinkEase EasePi R1
LinkEase EasePi R1 [1] is a high-performance mini router.
Specification:
- Rockchip RK3568
- 2GB/4GB LPDDR4 RAM
- 16GB on-board eMMC
- 1x M.2 key for 2280 NVMe (PCIe 3.0)
- 1x USB 3.0 Type-A
- 1x USB 2.0 Type-C (for USB flashing)
- 2x 1000 Base-T (native, RTL8211F)
- 2x 2500 Base-T (PCIe, RTL8125B)
- 1x HDMI 2.0 Output
- 12v DC Jack
- 1x Power key connected to PMIC
- 2x LEDs (one static power supplied, one GPIO controlled)
[1] https://doc.linkease.com/zh/guide/easepi-r1/hardware.html
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
Link: https://patch.msgid.link/20251014051226.64255-4-jjm2473@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: deaefeaf3df433d50935b9a85076041040f06d74 ]
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
---
.../src/arm64/rockchip/rk3568-easepi-r1.dts | 623 ++++++++++++++++++
1 file changed, 623 insertions(+)
create mode 100644 dts/upstream/src/arm64/rockchip/rk3568-easepi-r1.dts
--- /dev/null
+++ b/dts/upstream/src/arm64/rockchip/rk3568-easepi-r1.dts
@@ -0,0 +1,623 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/soc/rockchip,vop2.h>
+#include "rk3568.dtsi"
+
+/ {
+ model = "LinkEase EasePi R1";
+ compatible = "linkease,easepi-r1", "rockchip,rk3568";
+
+ aliases {
+ ethernet0 = &gmac0;
+ ethernet1 = &gmac1;
+ mmc0 = &sdhci;
+ };
+
+ chosen: chosen {
+ stdout-path = "serial2:1500000n8";
+ };
+
+ adc-keys {
+ compatible = "adc-keys";
+ io-channels = <&saradc 0>;
+ io-channel-names = "buttons";
+ keyup-threshold-microvolt = <1800000>;
+
+ button-recovery {
+ label = "Recovery";
+ linux,code = <KEY_VENDOR>;
+ press-threshold-microvolt = <1750>;
+ };
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+ pinctrl-names = "default";
+ pinctrl-0 = <&status_led_pin>;
+
+ status_led: led-status {
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_STATUS;
+ gpios = <&gpio2 RK_PD7 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "heartbeat";
+ };
+ };
+
+ hdmi-con {
+ compatible = "hdmi-connector";
+ type = "a";
+
+ port {
+ hdmi_con_in: endpoint {
+ remote-endpoint = <&hdmi_out_con>;
+ };
+ };
+ };
+
+ dc_12v: regulator-dc-12v {
+ compatible = "regulator-fixed";
+ regulator-name = "dc_12v";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <12000000>;
+ regulator-max-microvolt = <12000000>;
+ };
+
+ vcc5v0_sys: regulator-vcc5v0-sys {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc5v0_sys";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ vin-supply = <&dc_12v>;
+ };
+
+ vcc3v3_sys: regulator-vcc3v3-sys {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc3v3_sys";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <&dc_12v>;
+ };
+
+ pcie30_avdd0v9: regulator-pcie30-avdd0v9 {
+ compatible = "regulator-fixed";
+ regulator-name = "pcie30_avdd0v9";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <900000>;
+ vin-supply = <&vcc3v3_sys>;
+ };
+
+ pcie30_avdd1v8: regulator-pcie30-avdd1v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "pcie30_avdd1v8";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ vin-supply = <&vcc3v3_sys>;
+ };
+
+ regulator-vdd0v95-25glan {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&gpio3 RK_PB1 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&vdd0v95_25glan_en>;
+ regulator-name = "vdd0v95_25glan";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <950000>;
+ vin-supply = <&vcc3v3_sys>;
+ };
+
+ vcc3v3_nvme: regulator-vcc3v3-nvme {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&vcc3v3_nvme_en>;
+ regulator-name = "vcc3v3_nvme";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <&dc_12v>;
+ };
+
+};
+
+&combphy1 {
+ status = "okay";
+};
+
+&combphy2 {
+ status = "okay";
+};
+
+&cpu0 {
+ cpu-supply = <&vdd_cpu>;
+};
+
+&cpu1 {
+ cpu-supply = <&vdd_cpu>;
+};
+
+&cpu2 {
+ cpu-supply = <&vdd_cpu>;
+};
+
+&cpu3 {
+ cpu-supply = <&vdd_cpu>;
+};
+
+&gmac0 {
+ assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
+ assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>;
+ assigned-clock-rates = <0>, <125000000>;
+ phy-handle = <&rgmii_phy0>;
+ phy-mode = "rgmii-id";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gmac0_miim
+ &gmac0_tx_bus2
+ &gmac0_rx_bus2
+ &gmac0_rgmii_clk
+ &gmac0_rgmii_bus>;
+ status = "okay";
+};
+
+&gmac1 {
+ assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
+ assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
+ assigned-clock-rates = <0>, <125000000>;
+ phy-handle = <&rgmii_phy1>;
+ phy-mode = "rgmii-id";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gmac1m1_miim
+ &gmac1m1_tx_bus2
+ &gmac1m1_rx_bus2
+ &gmac1m1_rgmii_clk
+ &gmac1m1_rgmii_bus>;
+ status = "okay";
+};
+
+&gpu {
+ mali-supply = <&vdd_gpu>;
+ status = "okay";
+};
+
+&hdmi {
+ avdd-0v9-supply = <&vdda0v9_image>;
+ avdd-1v8-supply = <&vcca1v8_image>;
+ status = "okay";
+};
+
+&hdmi_in {
+ hdmi_in_vp0: endpoint {
+ remote-endpoint = <&vp0_out_hdmi>;
+ };
+};
+
+&hdmi_out {
+ hdmi_out_con: endpoint {
+ remote-endpoint = <&hdmi_con_in>;
+ };
+};
+
+&hdmi_sound {
+ status = "okay";
+};
+
+&i2c0 {
+ status = "okay";
+
+ vdd_cpu: regulator@1c {
+ compatible = "tcs,tcs4525";
+ reg = <0x1c>;
+ fcs,suspend-voltage-selector = <1>;
+ regulator-name = "vdd_cpu";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <1150000>;
+ regulator-ramp-delay = <2300>;
+ vin-supply = <&vcc5v0_sys>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ rk809: pmic@20 {
+ compatible = "rockchip,rk809";
+ reg = <0x20>;
+ interrupt-parent = <&gpio0>;
+ interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
+ #clock-cells = <1>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pmic_int>;
+ system-power-controller;
+ vcc1-supply = <&vcc3v3_sys>;
+ vcc2-supply = <&vcc3v3_sys>;
+ vcc3-supply = <&vcc3v3_sys>;
+ vcc4-supply = <&vcc3v3_sys>;
+ vcc5-supply = <&vcc3v3_sys>;
+ vcc6-supply = <&vcc3v3_sys>;
+ vcc7-supply = <&vcc3v3_sys>;
+ vcc8-supply = <&vcc3v3_sys>;
+ vcc9-supply = <&vcc3v3_sys>;
+ wakeup-source;
+
+ regulators {
+ vdd_logic: DCDC_REG1 {
+ regulator-name = "vdd_logic";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-initial-mode = <0x2>;
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <1350000>;
+ regulator-ramp-delay = <6001>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vdd_gpu: DCDC_REG2 {
+ regulator-name = "vdd_gpu";
+ regulator-always-on;
+ regulator-initial-mode = <0x2>;
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <1350000>;
+ regulator-ramp-delay = <6001>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vcc_ddr: DCDC_REG3 {
+ regulator-name = "vcc_ddr";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-initial-mode = <0x2>;
+
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ };
+
+ vdd_npu: DCDC_REG4 {
+ regulator-name = "vdd_npu";
+ regulator-initial-mode = <0x2>;
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <1350000>;
+ regulator-ramp-delay = <6001>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vcc_1v8: DCDC_REG5 {
+ regulator-name = "vcc_1v8";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vdda0v9_image: LDO_REG1 {
+ regulator-name = "vdda0v9_image";
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <950000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vdda_0v9: LDO_REG2 {
+ regulator-name = "vdda_0v9";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <900000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vdda0v9_pmu: LDO_REG3 {
+ regulator-name = "vdda0v9_pmu";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <900000>;
+
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ regulator-suspend-microvolt = <900000>;
+ };
+ };
+
+ vccio_acodec: LDO_REG4 {
+ regulator-name = "vccio_acodec";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vccio_sd: LDO_REG5 {
+ regulator-name = "vccio_sd";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vcc3v3_pmu: LDO_REG6 {
+ regulator-name = "vcc3v3_pmu";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ regulator-suspend-microvolt = <3300000>;
+ };
+ };
+
+ vcca_1v8: LDO_REG7 {
+ regulator-name = "vcca_1v8";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vcca1v8_pmu: LDO_REG8 {
+ regulator-name = "vcca1v8_pmu";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ regulator-suspend-microvolt = <1800000>;
+ };
+ };
+
+ vcca1v8_image: LDO_REG9 {
+ regulator-name = "vcca1v8_image";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vcc_3v3: SWITCH_REG1 {
+ regulator-name = "vcc_3v3";
+ regulator-always-on;
+ regulator-boot-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vcc3v3_sd: SWITCH_REG2 {
+ regulator-name = "vcc3v3_sd";
+ regulator-always-on;
+ regulator-boot-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+ };
+ };
+};
+
+&i2s0_8ch {
+ status = "okay";
+};
+
+&mdio0 {
+ rgmii_phy0: ethernet-phy@1 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <0x1>;
+ pinctrl-0 = <&eth_phy0_reset_pin>;
+ pinctrl-names = "default";
+ reset-assert-us = <20000>;
+ reset-deassert-us = <100000>;
+ reset-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>;
+ };
+};
+
+&mdio1 {
+ rgmii_phy1: ethernet-phy@1 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <0x1>;
+ pinctrl-0 = <&eth_phy1_reset_pin>;
+ pinctrl-names = "default";
+ reset-assert-us = <20000>;
+ reset-deassert-us = <100000>;
+ reset-gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_LOW>;
+ };
+};
+
+/* ETH3 */
+&pcie2x1 {
+ reset-gpios = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>;
+ vpcie3v3-supply = <&vcc3v3_sys>;
+ status = "okay";
+};
+
+&pcie30phy {
+ data-lanes = <1 2>;
+ status = "okay";
+};
+
+/* ETH2 */
+&pcie3x1 {
+ num-lanes = <1>;
+ reset-gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>;
+ vpcie3v3-supply = <&vcc3v3_sys>;
+ status = "okay";
+};
+
+/* M.2 Key for 2280 NVMe */
+&pcie3x2 {
+ num-lanes = <1>;
+ reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;
+ vpcie3v3-supply = <&vcc3v3_nvme>;
+ status = "okay";
+};
+
+&pinctrl {
+ gmac0 {
+ eth_phy0_reset_pin: eth-phy0-reset-pin {
+ rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>;
+ };
+ };
+
+ gmac1 {
+ eth_phy1_reset_pin: eth-phy1-reset-pin {
+ rockchip,pins = <2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_up>;
+ };
+ };
+
+ gpio-leds {
+ status_led_pin: status-led-pin {
+ rockchip,pins = <2 RK_PD7 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
+ nvme {
+ vcc3v3_nvme_en: vcc3v3-nvme-en {
+ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
+ pcie-nic {
+ vdd0v95_25glan_en: vdd0v95-25glan-en {
+ rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
+ pmic {
+ pmic_int: pmic-int {
+ rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
+ };
+ };
+
+};
+
+&pmu_io_domains {
+ pmuio1-supply = <&vcc3v3_pmu>;
+ pmuio2-supply = <&vcc3v3_pmu>;
+ vccio1-supply = <&vccio_acodec>;
+ vccio3-supply = <&vccio_sd>;
+ vccio4-supply = <&vcc_1v8>;
+ vccio5-supply = <&vcc_3v3>;
+ vccio6-supply = <&vcc_1v8>;
+ vccio7-supply = <&vcc_3v3>;
+ status = "okay";
+};
+
+&saradc {
+ vref-supply = <&vcca_1v8>;
+ status = "okay";
+};
+
+&sdhci {
+ bus-width = <8>;
+ max-frequency = <200000000>;
+ non-removable;
+ pinctrl-names = "default";
+ pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
+ status = "okay";
+};
+
+&tsadc {
+ rockchip,hw-tshut-mode = <1>;
+ rockchip,hw-tshut-polarity = <0>;
+ status = "okay";
+};
+
+&uart2 {
+ status = "okay";
+};
+
+/* OTG Only USB2.0, Only device mode */
+&usb_host0_xhci {
+ dr_mode = "peripheral";
+ extcon = <&usb2phy0>;
+ maximum-speed = "high-speed";
+ phys = <&usb2phy0_otg>;
+ phy-names = "usb2-phy";
+ status = "okay";
+};
+
+&usb_host1_xhci {
+ status = "okay";
+};
+
+&usb2phy0 {
+ status = "okay";
+};
+
+&usb2phy0_host {
+ phy-supply = <&vcc5v0_sys>;
+ status = "okay";
+};
+
+&usb2phy0_otg {
+ status = "okay";
+};
+
+&vop {
+ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
+ assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
+ status = "okay";
+};
+
+&vop_mmu {
+ status = "okay";
+};
+
+&vp0 {
+ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
+ reg = <ROCKCHIP_VOP2_EP_HDMI0>;
+ remote-endpoint = <&hdmi_in_vp0>;
+ };
+};

View File

@ -0,0 +1,123 @@
From fc0c5ce5cb2fd9dca2cad38996e8535e0bd810ba Mon Sep 17 00:00:00 2001
From: Liangbin Lian <jjm2473@gmail.com>
Date: Thu, 13 Nov 2025 14:51:21 +0800
Subject: [PATCH 2/2] board: rockchip: add LinkEase EasePi R1
LinkEase EasePi R1 [1] is a high-performance mini router.
Specification:
- Rockchip RK3568
- 2GB/4GB LPDDR4 RAM
- 16GB on-board eMMC
- 1x M.2 key for 2280 NVMe (PCIe 3.0)
- 1x USB 3.0 Type-A
- 1x USB 2.0 Type-C (for USB flashing)
- 2x 1000 Base-T (native, RTL8211F)
- 2x 2500 Base-T (PCIe, RTL8125B)
- 1x HDMI 2.0 Output
- 12v DC Jack
- 1x Power key connected to PMIC
- 2x LEDs (one static power supplied, one GPIO controlled)
[1] https://doc.linkease.com/zh/guide/easepi-r1/hardware.html
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
---
arch/arm/dts/rk3568-easepi-r1-u-boot.dtsi | 3 +
configs/easepi-r1-rk3568_defconfig | 83 +++++++++++++++++++++++
2 files changed, 86 insertions(+)
create mode 100644 arch/arm/dts/rk3568-easepi-r1-u-boot.dtsi
create mode 100644 configs/easepi-r1-rk3568_defconfig
--- /dev/null
+++ b/arch/arm/dts/rk3568-easepi-r1-u-boot.dtsi
@@ -0,0 +1,3 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "rk356x-u-boot.dtsi"
--- /dev/null
+++ b/configs/easepi-r1-rk3568_defconfig
@@ -0,0 +1,83 @@
+CONFIG_ARM=y
+CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
+CONFIG_COUNTER_FREQUENCY=24000000
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3568-easepi-r1"
+CONFIG_ROCKCHIP_RK3568=y
+CONFIG_SPL_SERIAL=y
+CONFIG_SYS_LOAD_ADDR=0xc00800
+CONFIG_DEBUG_UART_BASE=0xFE660000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_PCI=y
+CONFIG_DEBUG_UART=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_LEGACY_IMAGE_FORMAT=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-easepi-r1.dtb"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_SPL_MAX_SIZE=0x40000
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_SPL_ATF=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_PCI=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_ROCKUSB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
+# CONFIG_SPL_DOS_PARTITION is not set
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_LIVE=y
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SPL_SYSCON=y
+CONFIG_SPL_CLK=y
+# CONFIG_USB_FUNCTION_FASTBOOT is not set
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_SYS_I2C_ROCKCHIP=y
+CONFIG_MISC=y
+CONFIG_SUPPORT_EMMC_RPMB=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_SDMA=y
+CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_PHY_REALTEK=y
+CONFIG_DWC_ETH_QOS=y
+CONFIG_DWC_ETH_QOS_ROCKCHIP=y
+CONFIG_RTL8169=y
+CONFIG_NVME_PCI=y
+CONFIG_PCIE_DW_ROCKCHIP=y
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
+CONFIG_SPL_PINCTRL=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_RK8XX=y
+CONFIG_REGULATOR_RK8XX=y
+CONFIG_PWM_ROCKCHIP=y
+CONFIG_SPL_RAM=y
+CONFIG_BAUDRATE=1500000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
+CONFIG_SYSRESET=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_GENERIC=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_SPL_USB_DWC3_GENERIC=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_USB_FUNCTION_ROCKUSB=y
+CONFIG_ERRNO_STR=y

View File

@ -30,7 +30,7 @@ cmcc,a10-ubootmod|\
comfast,cf-wr632ax-ubootmod|\
cudy,tr3000-v1-ubootmod|\
h3c,magic-nx30-pro|\
imou,lc-hx3001|\
imou,hx21|\
jcg,q30-pro|\
livinet,zr-3020-ubootmod|\
mercusys,mr90x-v1-ubi|\

View File

@ -81,6 +81,7 @@ elecom,wrc-x1800gs|\
h3c,tx1800-plus|\
h3c,tx1801-plus|\
h3c,tx1806|\
iptime,ax2002m|\
iptime,ax2004m|\
jcg,q20|\
linksys,e7350|\

View File

@ -4,11 +4,10 @@
list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
if (!wdev->netdev)
continue;
- wdev->netdev->netns_immutable = false;
+#if LINUX_VERSION_IS_GEQ(6,15,0)
+ wdev->netdev->netns_immutable = true;
wdev->netdev->netns_immutable = false;
+#elif LINUX_VERSION_IS_GEQ(6,12,0)
+ wdev->netdev->netns_local = true;
+ wdev->netdev->netns_local = false;
+#endif
err = dev_change_net_namespace(wdev->netdev, net, "wlan%d");
if (err)

View File

@ -916,7 +916,7 @@
"type": "number",
"minimum": 1000,
"maximum": 65535,
"default": 1000
"default": 20000
},
"request_cui": {
"type": "alias",

View File

@ -922,7 +922,7 @@ hostapd_set_bss_options() {
set_default mobility_domain "$(echo "$ssid" | md5sum | head -c 4)"
set_default ft_over_ds 0
set_default reassociation_deadline 1000
set_default reassociation_deadline 20000
case "$auth_type" in
psk)

View File

@ -5,6 +5,9 @@ CPU_TYPE:=cortex-a53
KERNELNAME:=Image dtbs
FEATURES+=pwm source-only
DEFAULT_PACKAGES += \
airoha-en7581-npu-firmware
define Target/Description
Build firmware images for Airoha an7581 ARM based boards.
endef

View File

@ -832,7 +832,6 @@
<&npu_txbufid>;
memory-region-names = "binary", "pkt", "tx-pkt",
"tx-bufid";
status = "disabled";
};
eth: ethernet@1fb50000 {

View File

@ -204,8 +204,8 @@
};
};
spi_ctrl: spi_controller@1fa10000 {
compatible = "airoha,en7523-snand";
spi_ctrl: spi@1fa10000 {
compatible = "airoha,en7523-snand", "airoha,en7581-snand";
reg = <0x1fa10000 0x140>,
<0x1fa11000 0x160>;

View File

@ -1,8 +1,8 @@
From 0299de52cbb2274345e12518298a8014adb56411 Mon Sep 17 00:00:00 2001
From 86f88e604305186aec1fb6eebbf8f0a42c2435d3 Mon Sep 17 00:00:00 2001
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Date: Thu, 9 Oct 2025 19:33:23 +0300
Subject: [PATCH 2/2] spi: airoha-snfi: en7523: workaround flash damaging if
UART_TXD was short to GND
Subject: [PATCH] spi: airoha-snfi: en7523: workaround flash damaging
if UART_TXD was short to GND
We found that some serial console may pull TX line to GROUND during board
boot time. Airoha uses TX line as one of it's BOOT pins. This will lead
@ -27,8 +27,8 @@ fat warning.
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
---
drivers/spi/spi-airoha-snfi.c | 38 ++++++++++++++++++++++++++++++++---
1 file changed, 35 insertions(+), 3 deletions(-)
drivers/spi/spi-airoha-snfi.c | 40 ++++++++++++++++++++++++++++++-----
1 file changed, 35 insertions(+), 5 deletions(-)
--- a/drivers/spi/spi-airoha-snfi.c
+++ b/drivers/spi/spi-airoha-snfi.c
@ -44,49 +44,49 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
static int airoha_snand_setup(struct spi_device *spi)
{
struct airoha_snand_ctrl *as_ctrl;
@@ -1059,7 +1064,10 @@ static int airoha_snand_probe(struct pla
@@ -1058,7 +1063,8 @@ static int airoha_snand_probe(struct pla
struct device *dev = &pdev->dev;
struct spi_controller *ctrl;
void __iomem *base;
- int err;
+ int err, dma_enabled;
+#if defined(CONFIG_ARM)
+ u32 sfc_strap;
+#endif
ctrl = devm_spi_alloc_host(dev, sizeof(*as_ctrl));
if (!ctrl)
@@ -1093,12 +1101,36 @@ static int airoha_snand_probe(struct pla
@@ -1092,12 +1098,36 @@ static int airoha_snand_probe(struct pla
return dev_err_probe(dev, PTR_ERR(as_ctrl->spi_clk),
"unable to get spi clk\n");
- err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
- if (err)
- return err;
+ dma_enabled = 1;
+#if defined(CONFIG_ARM)
+ err = regmap_read(as_ctrl->regmap_ctrl,
+ REG_SPI_CTRL_SFC_STRAP, &sfc_strap);
if (err)
return err;
+ if (!(sfc_strap & 0x04)) {
+ dma_enabled = 0;
+ printk(KERN_WARNING "\n"
+ "=== WARNING ======================================================\n"
+ "Detected booting in RESERVED mode (UART_TXD was short to GND).\n"
+ "This mode is known for incorrect DMA reading of some flashes.\n"
+ "Usage of DMA for flash operations will be disabled to prevent data\n"
+ "damage. Unplug your serial console and power cycle the board\n"
+ "to boot with full performance.\n"
+ "==================================================================\n\n");
+ if (device_is_compatible(dev, "airoha,en7523-snand")) {
+ err = regmap_read(as_ctrl->regmap_ctrl,
+ REG_SPI_CTRL_SFC_STRAP, &sfc_strap);
+ if (err)
+ return err;
+
+ if (!(sfc_strap & 0x04)) {
+ dma_enabled = 0;
+ printk(KERN_WARNING "\n"
+ "=== WARNING ======================================================\n"
+ "Detected booting in RESERVED mode (UART_TXD was short to GND).\n"
+ "This mode is known for incorrect DMA reading of some flashes.\n"
+ "Usage of DMA for flash operations will be disabled to prevent data\n"
+ "damage. Unplug your serial console and power cycle the board\n"
+ "to boot with full performance.\n"
+ "==================================================================\n\n");
+ }
+ }
+#endif
+
+ if (dma_enabled) {
+ err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
+ if (err)
+ return err;
+ }
+
ctrl->num_chipselect = 2;
- ctrl->mem_ops = &airoha_snand_mem_ops;
+ ctrl->mem_ops = dma_enabled ?

View File

@ -1,27 +0,0 @@
From 12664d09a94bd0f50f31a3811447f70275ea9bb8 Mon Sep 17 00:00:00 2001
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Date: Thu, 9 Oct 2025 19:49:18 +0300
Subject: [PATCH 1/2] spi: airoha-snfi: make compatible with EN7523 SoC
The driver is fully compatible with EN7523 based SoCs, so add
corresponding compatible string.
This driver is better than en7523-spi because it supports DMA.
Measurements shows that DMA based flash reading is 4 times faster
than non-dma one.
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
---
drivers/spi/spi-airoha-snfi.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/spi/spi-airoha-snfi.c
+++ b/drivers/spi/spi-airoha-snfi.c
@@ -1047,6 +1047,7 @@ static const struct regmap_config spi_nf
};
static const struct of_device_id airoha_snand_ids[] = {
+ { .compatible = "airoha,en7523-snand" },
{ .compatible = "airoha,en7581-snand" },
{ /* sentinel */ }
};

View File

@ -0,0 +1,66 @@
From 17d4f2a9e6cb224012d85fed52e9794a84fa501d Mon Sep 17 00:00:00 2001
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Date: Tue, 2 Sep 2025 13:59:13 +0200
Subject: [PATCH 1/1] pinctrl: airoha: replace struct function_desc with struct
pinfunction
struct function_desc is a wrapper around struct pinfunction with an
additional void *data pointer. This driver doesn't use the data pointer.
We're also working towards reducing the usage of struct function_desc in
pinctrl drivers - they should only be created by pinmux core and
accessed by drivers using pinmux_generic_get_function(). Replace the
struct function_desc objects in this driver with smaller struct
pinfunction instances.
Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/mediatek/pinctrl-airoha.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
@@ -35,13 +35,8 @@
#define PINCTRL_FUNC_DESC(id) \
{ \
- .desc = { \
- .func = { \
- .name = #id, \
- .groups = id##_groups, \
- .ngroups = ARRAY_SIZE(id##_groups), \
- } \
- }, \
+ .desc = PINCTRL_PINFUNCTION(#id, id##_groups, \
+ ARRAY_SIZE(id##_groups)), \
.groups = id##_func_group, \
.group_size = ARRAY_SIZE(id##_func_group), \
}
@@ -334,7 +329,7 @@ struct airoha_pinctrl_func_group {
};
struct airoha_pinctrl_func {
- const struct function_desc desc;
+ const struct pinfunction desc;
const struct airoha_pinctrl_func_group *groups;
u8 group_size;
};
@@ -2911,13 +2906,13 @@ static int airoha_pinctrl_probe(struct p
func = &airoha_pinctrl_funcs[i];
err = pinmux_generic_add_function(pinctrl->ctrl,
- func->desc.func.name,
- func->desc.func.groups,
- func->desc.func.ngroups,
+ func->desc.name,
+ func->desc.groups,
+ func->desc.ngroups,
(void *)func);
if (err < 0) {
dev_err(dev, "Failed to register function %s\n",
- func->desc.func.name);
+ func->desc.name);
return err;
}
}

View File

@ -22,7 +22,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
@@ -1752,8 +1752,8 @@ static const struct airoha_pinctrl_func_
@@ -1747,8 +1747,8 @@ static const struct airoha_pinctrl_func_
.regmap[0] = {
AIROHA_FUNC_MUX,
REG_GPIO_2ND_I2C_MODE,
@ -33,7 +33,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
},
.regmap[1] = {
AIROHA_FUNC_MUX,
@@ -1816,8 +1816,8 @@ static const struct airoha_pinctrl_func_
@@ -1811,8 +1811,8 @@ static const struct airoha_pinctrl_func_
.regmap[0] = {
AIROHA_FUNC_MUX,
REG_GPIO_2ND_I2C_MODE,
@ -44,7 +44,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
},
.regmap[1] = {
AIROHA_FUNC_MUX,
@@ -1880,8 +1880,8 @@ static const struct airoha_pinctrl_func_
@@ -1875,8 +1875,8 @@ static const struct airoha_pinctrl_func_
.regmap[0] = {
AIROHA_FUNC_MUX,
REG_GPIO_2ND_I2C_MODE,
@ -55,7 +55,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
},
.regmap[1] = {
AIROHA_FUNC_MUX,
@@ -1944,8 +1944,8 @@ static const struct airoha_pinctrl_func_
@@ -1939,8 +1939,8 @@ static const struct airoha_pinctrl_func_
.regmap[0] = {
AIROHA_FUNC_MUX,
REG_GPIO_2ND_I2C_MODE,

View File

@ -23,7 +23,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
@@ -108,6 +108,9 @@
@@ -103,6 +103,9 @@
#define JTAG_UDI_EN_MASK BIT(4)
#define JTAG_DFD_EN_MASK BIT(3)
@ -33,7 +33,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
/* LED MAP */
#define REG_LAN_LED0_MAPPING 0x027c
#define REG_LAN_LED1_MAPPING 0x0280
@@ -719,16 +722,16 @@ static const struct airoha_pinctrl_func_
@@ -714,16 +717,16 @@ static const struct airoha_pinctrl_func_
.name = "mdio",
.regmap[0] = {
AIROHA_FUNC_MUX,

View File

@ -19,7 +19,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
@@ -30,20 +30,20 @@
@@ -30,15 +30,15 @@
#include "../pinconf.h"
#include "../pinmux.h"
@ -31,23 +31,18 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-#define PINCTRL_FUNC_DESC(id) \
+#define PINCTRL_FUNC_DESC(id, table) \
{ \
.desc = { \
.func = { \
.name = #id, \
- .groups = id##_groups, \
- .ngroups = ARRAY_SIZE(id##_groups), \
+ .groups = table##_groups, \
+ .ngroups = ARRAY_SIZE(table##_groups), \
} \
}, \
- .desc = PINCTRL_PINFUNCTION(#id, id##_groups, \
- ARRAY_SIZE(id##_groups)), \
- .groups = id##_func_group, \
- .group_size = ARRAY_SIZE(id##_func_group), \
+ .desc = PINCTRL_PINFUNCTION(#id, table##_groups, \
+ ARRAY_SIZE(table##_groups)),\
+ .groups = table##_func_group, \
+ .group_size = ARRAY_SIZE(table##_func_group), \
}
#define PINCTRL_CONF_DESC(p, offset, mask) \
@@ -362,16 +362,46 @@ struct airoha_pinctrl_gpiochip {
@@ -357,16 +357,46 @@ struct airoha_pinctrl_gpiochip {
u32 irq_type[AIROHA_NUM_PINS];
};
@ -95,7 +90,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
PINCTRL_PIN(0, "uart1_txd"),
PINCTRL_PIN(1, "uart1_rxd"),
PINCTRL_PIN(2, "i2c_scl"),
@@ -432,172 +462,172 @@ static struct pinctrl_pin_desc airoha_pi
@@ -427,172 +457,172 @@ static struct pinctrl_pin_desc airoha_pi
PINCTRL_PIN(63, "pcie_reset2"),
};
@ -434,7 +429,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
};
static const char *const pon_groups[] = { "pon" };
@@ -1960,33 +1990,33 @@ static const struct airoha_pinctrl_func_
@@ -1955,33 +1985,33 @@ static const struct airoha_pinctrl_func_
},
};
@ -493,7 +488,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
PINCTRL_CONF_DESC(0, REG_I2C_SDA_PU, UART1_TXD_PU_MASK),
PINCTRL_CONF_DESC(1, REG_I2C_SDA_PU, UART1_RXD_PU_MASK),
PINCTRL_CONF_DESC(2, REG_I2C_SDA_PU, I2C_SDA_PU_MASK),
@@ -2047,7 +2077,7 @@ static const struct airoha_pinctrl_conf
@@ -2042,7 +2072,7 @@ static const struct airoha_pinctrl_conf
PINCTRL_CONF_DESC(63, REG_I2C_SDA_PU, PCIE2_RESET_PU_MASK),
};
@ -502,7 +497,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
PINCTRL_CONF_DESC(0, REG_I2C_SDA_PD, UART1_TXD_PD_MASK),
PINCTRL_CONF_DESC(1, REG_I2C_SDA_PD, UART1_RXD_PD_MASK),
PINCTRL_CONF_DESC(2, REG_I2C_SDA_PD, I2C_SDA_PD_MASK),
@@ -2108,7 +2138,7 @@ static const struct airoha_pinctrl_conf
@@ -2103,7 +2133,7 @@ static const struct airoha_pinctrl_conf
PINCTRL_CONF_DESC(63, REG_I2C_SDA_PD, PCIE2_RESET_PD_MASK),
};
@ -511,7 +506,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
PINCTRL_CONF_DESC(0, REG_I2C_SDA_E2, UART1_TXD_E2_MASK),
PINCTRL_CONF_DESC(1, REG_I2C_SDA_E2, UART1_RXD_E2_MASK),
PINCTRL_CONF_DESC(2, REG_I2C_SDA_E2, I2C_SDA_E2_MASK),
@@ -2169,7 +2199,7 @@ static const struct airoha_pinctrl_conf
@@ -2164,7 +2194,7 @@ static const struct airoha_pinctrl_conf
PINCTRL_CONF_DESC(63, REG_I2C_SDA_E2, PCIE2_RESET_E2_MASK),
};
@ -520,7 +515,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
PINCTRL_CONF_DESC(0, REG_I2C_SDA_E4, UART1_TXD_E4_MASK),
PINCTRL_CONF_DESC(1, REG_I2C_SDA_E4, UART1_RXD_E4_MASK),
PINCTRL_CONF_DESC(2, REG_I2C_SDA_E4, I2C_SDA_E4_MASK),
@@ -2230,7 +2260,7 @@ static const struct airoha_pinctrl_conf
@@ -2225,7 +2255,7 @@ static const struct airoha_pinctrl_conf
PINCTRL_CONF_DESC(63, REG_I2C_SDA_E4, PCIE2_RESET_E4_MASK),
};
@ -529,7 +524,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
PINCTRL_CONF_DESC(61, REG_PCIE_RESET_OD, PCIE0_RESET_OD_MASK),
PINCTRL_CONF_DESC(62, REG_PCIE_RESET_OD, PCIE1_RESET_OD_MASK),
PINCTRL_CONF_DESC(63, REG_PCIE_RESET_OD, PCIE2_RESET_OD_MASK),
@@ -2552,12 +2582,17 @@ airoha_pinctrl_get_conf_reg(const struct
@@ -2547,12 +2577,17 @@ airoha_pinctrl_get_conf_reg(const struct
}
static int airoha_pinctrl_get_conf(struct airoha_pinctrl *pinctrl,
@ -550,7 +545,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
if (!reg)
return -EINVAL;
@@ -2570,12 +2605,17 @@ static int airoha_pinctrl_get_conf(struc
@@ -2565,12 +2600,17 @@ static int airoha_pinctrl_get_conf(struc
}
static int airoha_pinctrl_set_conf(struct airoha_pinctrl *pinctrl,
@ -571,7 +566,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
if (!reg)
return -EINVAL;
@@ -2588,44 +2628,34 @@ static int airoha_pinctrl_set_conf(struc
@@ -2583,44 +2623,34 @@ static int airoha_pinctrl_set_conf(struc
}
#define airoha_pinctrl_get_pullup_conf(pinctrl, pin, val) \
@ -626,7 +621,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(pin), (val))
static int airoha_pinconf_get_direction(struct pinctrl_dev *pctrl_dev, u32 p)
@@ -2804,12 +2834,13 @@ static int airoha_pinconf_set(struct pin
@@ -2799,12 +2829,13 @@ static int airoha_pinconf_set(struct pin
static int airoha_pinconf_group_get(struct pinctrl_dev *pctrl_dev,
unsigned int group, unsigned long *config)
{
@ -642,7 +637,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
config))
return -ENOTSUPP;
@@ -2826,13 +2857,14 @@ static int airoha_pinconf_group_set(stru
@@ -2821,13 +2852,14 @@ static int airoha_pinconf_group_set(stru
unsigned int group, unsigned long *configs,
unsigned int num_configs)
{
@ -659,7 +654,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
configs, num_configs);
if (err)
return err;
@@ -2858,23 +2890,16 @@ static const struct pinctrl_ops airoha_p
@@ -2853,23 +2885,16 @@ static const struct pinctrl_ops airoha_p
.dt_free_map = pinconf_generic_dt_free_map,
};
@ -686,7 +681,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
pinctrl = devm_kzalloc(dev, sizeof(*pinctrl), GFP_KERNEL);
if (!pinctrl)
return -ENOMEM;
@@ -2889,14 +2914,23 @@ static int airoha_pinctrl_probe(struct p
@@ -2884,14 +2909,23 @@ static int airoha_pinctrl_probe(struct p
pinctrl->chip_scu = map;
@ -713,7 +708,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
err = pinctrl_generic_add_group(pinctrl->ctrl, grp->name,
grp->pins, grp->npins,
@@ -2909,10 +2943,10 @@ static int airoha_pinctrl_probe(struct p
@@ -2904,10 +2938,10 @@ static int airoha_pinctrl_probe(struct p
}
/* build functions */
@ -724,9 +719,9 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
- func = &airoha_pinctrl_funcs[i];
+ func = &data->funcs[i];
err = pinmux_generic_add_function(pinctrl->ctrl,
func->desc.func.name,
func->desc.func.groups,
@@ -2925,6 +2959,10 @@ static int airoha_pinctrl_probe(struct p
func->desc.name,
func->desc.groups,
@@ -2920,6 +2954,10 @@ static int airoha_pinctrl_probe(struct p
}
}
@ -737,7 +732,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
err = pinctrl_enable(pinctrl->ctrl);
if (err)
return err;
@@ -2933,8 +2971,39 @@ static int airoha_pinctrl_probe(struct p
@@ -2928,8 +2966,39 @@ static int airoha_pinctrl_probe(struct p
return airoha_pinctrl_add_gpiochip(pinctrl, pdev);
}

View File

@ -16,7 +16,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
@@ -1478,516 +1478,128 @@ static const struct airoha_pinctrl_func_
@@ -1473,516 +1473,128 @@ static const struct airoha_pinctrl_func_
},
};

View File

@ -17,7 +17,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
@@ -1078,404 +1078,75 @@ static const struct airoha_pinctrl_func_
@@ -1073,404 +1073,75 @@ static const struct airoha_pinctrl_func_
};
/* PWM */

View File

@ -16,7 +16,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
@@ -75,6 +75,7 @@
@@ -70,6 +70,7 @@
#define GPIO_PCM_SPI_CS3_MODE_MASK BIT(20)
#define GPIO_PCM_SPI_CS2_MODE_P156_MASK BIT(19)
#define GPIO_PCM_SPI_CS2_MODE_P128_MASK BIT(18)
@ -24,7 +24,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
#define GPIO_PCM_SPI_CS1_MODE_MASK BIT(17)
#define GPIO_PCM_SPI_MODE_MASK BIT(16)
#define GPIO_PCM2_MODE_MASK BIT(13)
@@ -132,6 +133,8 @@
@@ -127,6 +128,8 @@
/* CONF */
#define REG_I2C_SDA_E2 0x001c
@ -33,7 +33,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
#define SPI_MISO_E2_MASK BIT(14)
#define SPI_MOSI_E2_MASK BIT(13)
#define SPI_CLK_E2_MASK BIT(12)
@@ -139,12 +142,16 @@
@@ -134,12 +137,16 @@
#define PCIE2_RESET_E2_MASK BIT(10)
#define PCIE1_RESET_E2_MASK BIT(9)
#define PCIE0_RESET_E2_MASK BIT(8)
@ -50,7 +50,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
#define SPI_MISO_E4_MASK BIT(14)
#define SPI_MOSI_E4_MASK BIT(13)
#define SPI_CLK_E4_MASK BIT(12)
@@ -152,6 +159,8 @@
@@ -147,6 +154,8 @@
#define PCIE2_RESET_E4_MASK BIT(10)
#define PCIE1_RESET_E4_MASK BIT(9)
#define PCIE0_RESET_E4_MASK BIT(8)
@ -59,7 +59,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
#define UART1_RXD_E4_MASK BIT(3)
#define UART1_TXD_E4_MASK BIT(2)
#define I2C_SCL_E4_MASK BIT(1)
@@ -163,6 +172,8 @@
@@ -158,6 +167,8 @@
#define REG_GPIO_H_E4 0x0030
#define REG_I2C_SDA_PU 0x0044
@ -68,7 +68,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
#define SPI_MISO_PU_MASK BIT(14)
#define SPI_MOSI_PU_MASK BIT(13)
#define SPI_CLK_PU_MASK BIT(12)
@@ -170,12 +181,16 @@
@@ -165,12 +176,16 @@
#define PCIE2_RESET_PU_MASK BIT(10)
#define PCIE1_RESET_PU_MASK BIT(9)
#define PCIE0_RESET_PU_MASK BIT(8)
@ -85,7 +85,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
#define SPI_MISO_PD_MASK BIT(14)
#define SPI_MOSI_PD_MASK BIT(13)
#define SPI_CLK_PD_MASK BIT(12)
@@ -183,6 +198,8 @@
@@ -178,6 +193,8 @@
#define PCIE2_RESET_PD_MASK BIT(10)
#define PCIE1_RESET_PD_MASK BIT(9)
#define PCIE0_RESET_PD_MASK BIT(8)
@ -94,7 +94,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
#define UART1_RXD_PD_MASK BIT(3)
#define UART1_TXD_PD_MASK BIT(2)
#define I2C_SCL_PD_MASK BIT(1)
@@ -630,10 +647,223 @@ static const struct pingroup en7581_pinc
@@ -625,10 +642,223 @@ static const struct pingroup en7581_pinc
PINCTRL_PIN_GROUP("pcie_reset2", en7581_pcie_reset2),
};
@ -318,7 +318,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
static const char *const uart_groups[] = { "uart2", "uart2_cts_rts", "hsuart",
"hsuart_cts_rts", "uart4",
"uart5" };
@@ -646,11 +876,16 @@ static const char *const pcm_spi_groups[
@@ -641,11 +871,16 @@ static const char *const pcm_spi_groups[
"pcm_spi_cs2_p156",
"pcm_spi_cs2_p128",
"pcm_spi_cs3", "pcm_spi_cs4" };
@ -335,7 +335,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
static const char *const pwm_groups[] = { "gpio0", "gpio1",
"gpio2", "gpio3",
"gpio4", "gpio5",
@@ -689,6 +924,22 @@ static const char *const phy3_led1_group
@@ -684,6 +919,22 @@ static const char *const phy3_led1_group
"gpio45", "gpio46" };
static const char *const phy4_led1_groups[] = { "gpio43", "gpio44",
"gpio45", "gpio46" };
@ -358,7 +358,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
static const struct airoha_pinctrl_func_group pon_func_group[] = {
{
@@ -766,6 +1017,25 @@ static const struct airoha_pinctrl_func_
@@ -761,6 +1012,25 @@ static const struct airoha_pinctrl_func_
},
};
@ -384,7 +384,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
static const struct airoha_pinctrl_func_group uart_func_group[] = {
{
.name = "uart2",
@@ -1007,6 +1277,73 @@ static const struct airoha_pinctrl_func_
@@ -1002,6 +1272,73 @@ static const struct airoha_pinctrl_func_
},
};
@ -458,7 +458,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
static const struct airoha_pinctrl_func_group i2s_func_group[] = {
{
.name = "i2s",
@@ -1077,6 +1414,28 @@ static const struct airoha_pinctrl_func_
@@ -1072,6 +1409,28 @@ static const struct airoha_pinctrl_func_
},
};
@ -487,7 +487,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
/* PWM */
#define AIROHA_PINCTRL_PWM(gpio, mux_val) \
{ \
@@ -1273,6 +1632,94 @@ static const struct airoha_pinctrl_func_
@@ -1268,6 +1627,94 @@ static const struct airoha_pinctrl_func_
LAN3_LED_MAPPING_MASK, LAN3_PHY_LED_MAP(2)),
};
@ -582,7 +582,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
static const struct airoha_pinctrl_func en7581_pinctrl_funcs[] = {
PINCTRL_FUNC_DESC("pon", pon),
PINCTRL_FUNC_DESC("tod_1pps", tod_1pps),
@@ -1299,6 +1746,31 @@ static const struct airoha_pinctrl_func
@@ -1294,6 +1741,31 @@ static const struct airoha_pinctrl_func
PINCTRL_FUNC_DESC("phy4_led1", phy4_led1),
};
@ -614,7 +614,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
static const struct airoha_pinctrl_conf en7581_pinctrl_pullup_conf[] = {
PINCTRL_CONF_DESC(0, REG_I2C_SDA_PU, UART1_TXD_PU_MASK),
PINCTRL_CONF_DESC(1, REG_I2C_SDA_PU, UART1_RXD_PU_MASK),
@@ -1360,6 +1832,62 @@ static const struct airoha_pinctrl_conf
@@ -1355,6 +1827,62 @@ static const struct airoha_pinctrl_conf
PINCTRL_CONF_DESC(63, REG_I2C_SDA_PU, PCIE2_RESET_PU_MASK),
};
@ -677,7 +677,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
static const struct airoha_pinctrl_conf en7581_pinctrl_pulldown_conf[] = {
PINCTRL_CONF_DESC(0, REG_I2C_SDA_PD, UART1_TXD_PD_MASK),
PINCTRL_CONF_DESC(1, REG_I2C_SDA_PD, UART1_RXD_PD_MASK),
@@ -1421,6 +1949,62 @@ static const struct airoha_pinctrl_conf
@@ -1416,6 +1944,62 @@ static const struct airoha_pinctrl_conf
PINCTRL_CONF_DESC(63, REG_I2C_SDA_PD, PCIE2_RESET_PD_MASK),
};
@ -740,7 +740,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
static const struct airoha_pinctrl_conf en7581_pinctrl_drive_e2_conf[] = {
PINCTRL_CONF_DESC(0, REG_I2C_SDA_E2, UART1_TXD_E2_MASK),
PINCTRL_CONF_DESC(1, REG_I2C_SDA_E2, UART1_RXD_E2_MASK),
@@ -1482,6 +2066,62 @@ static const struct airoha_pinctrl_conf
@@ -1477,6 +2061,62 @@ static const struct airoha_pinctrl_conf
PINCTRL_CONF_DESC(63, REG_I2C_SDA_E2, PCIE2_RESET_E2_MASK),
};
@ -803,7 +803,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
static const struct airoha_pinctrl_conf en7581_pinctrl_drive_e4_conf[] = {
PINCTRL_CONF_DESC(0, REG_I2C_SDA_E4, UART1_TXD_E4_MASK),
PINCTRL_CONF_DESC(1, REG_I2C_SDA_E4, UART1_RXD_E4_MASK),
@@ -1543,12 +2183,73 @@ static const struct airoha_pinctrl_conf
@@ -1538,12 +2178,73 @@ static const struct airoha_pinctrl_conf
PINCTRL_CONF_DESC(63, REG_I2C_SDA_E4, PCIE2_RESET_E4_MASK),
};
@ -877,7 +877,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
static int airoha_convert_pin_to_reg_offset(struct pinctrl_dev *pctrl_dev,
struct pinctrl_gpio_range *range,
int pin)
@@ -1714,7 +2415,7 @@ static const struct irq_chip airoha_gpio
@@ -1709,7 +2410,7 @@ static const struct irq_chip airoha_gpio
};
static int airoha_pinctrl_add_gpiochip(struct airoha_pinctrl *pinctrl,
@ -886,7 +886,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
{
struct airoha_pinctrl_gpiochip *chip = &pinctrl->gpiochip;
struct gpio_chip *gc = &chip->chip;
@@ -1749,7 +2450,7 @@ static int airoha_pinctrl_add_gpiochip(s
@@ -1744,7 +2445,7 @@ static int airoha_pinctrl_add_gpiochip(s
return irq;
err = devm_request_irq(dev, irq, airoha_irq_handler, IRQF_SHARED,
@ -895,7 +895,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
if (err) {
dev_err(dev, "error requesting irq %d: %d\n", irq, err);
return err;
@@ -1813,8 +2514,8 @@ static int airoha_pinmux_set_mux(struct
@@ -1808,8 +2509,8 @@ static int airoha_pinmux_set_mux(struct
}
static int airoha_pinmux_set_direction(struct pinctrl_dev *pctrl_dev,
@ -906,7 +906,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
{
struct airoha_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctrl_dev);
u32 mask, index;
@@ -1904,7 +2605,7 @@ static int airoha_pinctrl_set_conf(struc
@@ -1899,7 +2600,7 @@ static int airoha_pinctrl_set_conf(struc
if (regmap_update_bits(pinctrl->chip_scu, reg->offset, reg->mask,
@ -915,7 +915,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
return -EINVAL;
return 0;
@@ -2123,8 +2824,8 @@ static int airoha_pinconf_group_get(stru
@@ -2118,8 +2819,8 @@ static int airoha_pinconf_group_get(stru
for (i = 0; i < pinctrl->grps[group].npins; i++) {
if (airoha_pinconf_get(pctrl_dev,
@ -926,7 +926,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
return -ENOTSUPP;
if (i && cur_config != *config)
@@ -2285,8 +2986,40 @@ static const struct airoha_pinctrl_match
@@ -2280,8 +2981,40 @@ static const struct airoha_pinctrl_match
},
};

View File

@ -0,0 +1,38 @@
From f2bd5a0f59d052d16749bccf637690e51947a5d6 Mon Sep 17 00:00:00 2001
From: Chukun Pan <amadeus@jmu.edu.cn>
Date: Sat, 15 Nov 2025 18:00:00 +0800
Subject: [PATCH] pinctrl: airoha: fix pinctrl function mismatch issue
The blamed commit made the following changes:
-#define PINCTRL_FUNC_DESC(id)...
- .desc = PINCTRL_PINFUNCTION(#id, ...
+#define PINCTRL_FUNC_DESC(id, table)...
+ .desc = PINCTRL_PINFUNCTION(#id, ...
- PINCTRL_FUNC_DESC(pon)...
+ PINCTRL_FUNC_DESC("pon", pon)...
It's clear that the id of funcs doesn't match the definition.
Remove redundant #string from the definition to fix this issue:
pinctrl-airoha ...: invalid function mdio in map table
Fixes: 4043b0c45f85 ("pinctrl: airoha: generalize pins/group/function/confs handling")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Acked-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/mediatek/pinctrl-airoha.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
@@ -35,7 +35,7 @@
#define PINCTRL_FUNC_DESC(id, table) \
{ \
- .desc = PINCTRL_PINFUNCTION(#id, table##_groups, \
+ .desc = PINCTRL_PINFUNCTION(id, table##_groups, \
ARRAY_SIZE(table##_groups)),\
.groups = table##_func_group, \
.group_size = ARRAY_SIZE(table##_func_group), \

View File

@ -0,0 +1,40 @@
From 0341d1b1ebf10bcbb9f35e174e83dbb21068387d Mon Sep 17 00:00:00 2001
From: Nathan Chancellor <nathan@kernel.org>
Date: Wed, 12 Nov 2025 11:44:30 -0700
Subject: [PATCH] pinctrl: airoha: Fix AIROHA_PINCTRL_CONFS_DRIVE_E2 in
an7583_pinctrl_match_data
Clang warns (or errors with CONFIG_WERROR=y / W=e):
pinctrl/mediatek/pinctrl-airoha.c:2064:41: error: variable 'an7583_pinctrl_drive_e2_conf' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
2064 | static const struct airoha_pinctrl_conf an7583_pinctrl_drive_e2_conf[] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Due to a typo, an7583_pinctrl_drive_e2_conf is only used within
ARRAY_SIZE() (hence no instance of -Wunused-variable), which is
evaluated at compile time, so it will not be needed in the final object
file.
Fix the .confs assignment for AIROHA_PINCTRL_CONFS_DRIVE_E2 in
an7583_pinctrl_match_data to clear up the warning.
Closes: https://github.com/ClangBuiltLinux/linux/issues/2142
Fixes: 3ffeb17a9a27 ("pinctrl: airoha: add support for Airoha AN7583 PINs")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/mediatek/pinctrl-airoha.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
@@ -2998,7 +2998,7 @@ static const struct airoha_pinctrl_match
.num_confs = ARRAY_SIZE(an7583_pinctrl_pulldown_conf),
},
[AIROHA_PINCTRL_CONFS_DRIVE_E2] = {
- .confs = en7581_pinctrl_drive_e2_conf,
+ .confs = an7583_pinctrl_drive_e2_conf,
.num_confs = ARRAY_SIZE(an7583_pinctrl_drive_e2_conf),
},
[AIROHA_PINCTRL_CONFS_DRIVE_E4] = {

View File

@ -112,7 +112,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
/* Assert the reset signal */
- phy_device_reset(phydev, 1);
+ if (!(phydev->drv->flags & PHY_DETACH_NO_HW_RESET))
+ if (!phydev->drv || !(phydev->drv->flags & PHY_DETACH_NO_HW_RESET))
+ phy_device_reset(phydev, 1);
/*

View File

@ -98,6 +98,21 @@
reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
};
};
virtual_flash {
compatible = "mtd-concat";
devices = <&fwconcat0>, <&fwconcat1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
compatible = "tplink,firmware";
label = "firmware";
reg = <0x0 0x0>;
};
};
};
};
&pcie0 {
@ -130,9 +145,8 @@
read-only;
};
partition@20000 {
compatible = "tplink,firmware";
label = "firmware";
fwconcat0: partition@20000 {
label = "fwconcat0";
reg = <0x020000 0x5e0000>;
};
@ -162,10 +176,15 @@
partition@630000 {
label = "config";
reg = <0x630000 0x1c0000>;
reg = <0x630000 0x020000>;
read-only;
};
fwconcat1: partition@650000 {
label = "fwconcat1";
reg = <0x650000 0x1a0000>;
};
partition@7f0000 {
label = "art";
reg = <0x7f0000 0x010000>;

View File

@ -9,6 +9,21 @@
aliases {
label-mac-device = &eth0;
};
virtual_flash {
compatible = "mtd-concat";
devices = <&fwconcat0>, <&fwconcat1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
compatible = "tplink,firmware";
label = "firmware";
reg = <0x0 0x0>;
};
};
};
};
&partitions {
@ -18,9 +33,8 @@
read-only;
};
partition@20000 {
compatible = "tplink,firmware";
label = "firmware";
fwconcat0: partition@20000 {
compatible = "fwconcat0";
reg = <0x020000 0x5e0000>;
};
@ -54,6 +68,11 @@
read-only;
};
fwconcat1: partition@650000 {
label = "fwconcat1";
reg = <0x650000 0x1a0000>;
};
partition@7f0000 {
label = "art";
reg = <0x7f0000 0x010000>;

View File

@ -3,9 +3,12 @@ include ./common-tp-link.mk
define Device/tplink_rex5x-v1
$(Device/tplink-safeloader)
SOC := qca9558
IMAGE_SIZE := 6016k
IMAGE_SIZE := 7680k
KERNEL_SIZE := 6016k
DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
DEFAULT := n
DEVICE_COMPAT_VERSION := 2.0
DEVICE_COMPAT_MESSAGE := Partition layout has changed compared to older versions by utilizing unused flash. \
Upgrade via sysupgrade mechanism (-F) will only work if flashed image still fits to the size of old partition (6016 KiB).
endef
define Device/tplink_re355-v1
@ -29,13 +32,16 @@ TARGET_DEVICES += tplink_re450-v1
define Device/tplink_re450-v2
$(Device/tplink-safeloader)
SOC := qca9563
IMAGE_SIZE := 6016k
IMAGE_SIZE := 7680k
KERNEL_SIZE := 6016k
DEVICE_MODEL := RE450
DEVICE_VARIANT := v2
DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
DEVICE_COMPAT_VERSION := 2.0
DEVICE_COMPAT_MESSAGE := Partition layout has changed compared to older versions by utilizing unused flash. \
Upgrade via sysupgrade mechanism (-F) will only work if flashed image still fits to the size of old partition (6016 KiB).
TPLINK_BOARD_ID := RE450-V2
LOADER_TYPE := elf
DEFAULT := n
endef
TARGET_DEVICES += tplink_re450-v2

View File

@ -13,6 +13,11 @@ case "$(board_name)" in
tplink,tl-wpa8630p-v2.1-eu)
ucidef_set_compat_version "2.0"
;;
tplink,re355-v1|\
tplink,re450-v1|\
tplink,re450-v2)
ucidef_set_compat_version "2.0"
;;
esac
board_config_flush

View File

@ -16,7 +16,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -1362,6 +1362,7 @@ static const struct adv7180_chip_info ad
@@ -1352,6 +1352,7 @@ static const struct adv7180_chip_info ad
static int init_device(struct adv7180_state *state)
{
int ret;
@ -24,7 +24,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
mutex_lock(&state->mutex);
@@ -1409,6 +1410,18 @@ static int init_device(struct adv7180_st
@@ -1399,6 +1400,18 @@ static int init_device(struct adv7180_st
goto out_unlock;
}

View File

@ -14,7 +14,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -1351,6 +1351,7 @@ static const struct adv7180_chip_info ad
@@ -1341,6 +1341,7 @@ static const struct adv7180_chip_info ad
BIT(ADV7182_INPUT_SVIDEO_AIN1_AIN2) |
BIT(ADV7182_INPUT_SVIDEO_AIN3_AIN4) |
BIT(ADV7182_INPUT_SVIDEO_AIN7_AIN8) |

View File

@ -30,7 +30,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
struct adv7180_state;
#define ADV7180_FLAG_RESET_POWERED BIT(0)
@@ -408,10 +412,24 @@ out:
@@ -403,10 +407,24 @@ out:
return ret;
}
@ -56,7 +56,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (ret)
return ret;
@@ -437,7 +455,11 @@ static int adv7180_program_std(struct ad
@@ -432,7 +450,11 @@ static int adv7180_program_std(struct ad
static int adv7180_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
{
struct adv7180_state *state = to_state(sd);
@ -69,7 +69,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (ret)
return ret;
@@ -459,6 +481,8 @@ static int adv7180_g_std(struct v4l2_sub
@@ -454,6 +476,8 @@ static int adv7180_g_std(struct v4l2_sub
{
struct adv7180_state *state = to_state(sd);
@ -78,7 +78,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
*norm = state->curr_norm;
return 0;
@@ -900,6 +924,8 @@ static int adv7180_s_stream(struct v4l2_
@@ -890,6 +914,8 @@ static int adv7180_s_stream(struct v4l2_
return 0;
}

View File

@ -20,7 +20,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4930,6 +4930,7 @@ static const struct {
@@ -4935,6 +4935,7 @@ static const struct {
*/
static int hci_dev_setup_sync(struct hci_dev *hdev)
{
@ -28,7 +28,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
int ret = 0;
bool invalid_bdaddr;
size_t i;
@@ -4958,7 +4959,8 @@ static int hci_dev_setup_sync(struct hci
@@ -4963,7 +4964,8 @@ static int hci_dev_setup_sync(struct hci
test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
if (!ret) {
if (test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks) &&

View File

@ -55,7 +55,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
#ifdef CONFIG_GUMSTIX_AM200EPD
{
@@ -506,6 +509,12 @@ static void do_unregister_framebuffer(st
@@ -507,6 +510,12 @@ static void do_unregister_framebuffer(st
put_fb_info(fb_info);
}

View File

@ -36,7 +36,7 @@ Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
--- a/drivers/thermal/gov_step_wise.c
+++ b/drivers/thermal/gov_step_wise.c
@@ -17,11 +17,11 @@
@@ -17,13 +17,13 @@
#include "thermal_core.h"
/*
@ -44,13 +44,15 @@ Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
+ * If the temperature is higher than a hysteresis temperature,
* a. if the trend is THERMAL_TREND_RAISING, use higher cooling
* state for this trip point
* b. if the trend is THERMAL_TREND_DROPPING, do nothing
* b. if the trend is THERMAL_TREND_DROPPING, use a lower cooling state
* for this trip point, but keep the cooling state above the applicable
* minimum
- * If the temperature is lower than a trip point,
+ * If the temperature is lower than a hysteresis temperature,
* a. if the trend is THERMAL_TREND_RAISING, do nothing
* b. if the trend is THERMAL_TREND_DROPPING, use lower cooling
* state for this trip point, if the cooling state already
@@ -74,19 +74,35 @@ static void thermal_zone_trip_update(str
@@ -87,19 +87,35 @@ static void thermal_zone_trip_update(str
int trip_id = thermal_zone_trip_id(tz, trip);
struct thermal_instance *instance;
bool throttle = false;

View File

@ -17,7 +17,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -737,10 +737,15 @@ static int adv7180_enum_mbus_code(struct
@@ -732,10 +732,15 @@ static int adv7180_enum_mbus_code(struct
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{
@ -34,7 +34,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
return 0;
}
@@ -750,7 +755,10 @@ static int adv7180_mbus_fmt(struct v4l2_
@@ -745,7 +750,10 @@ static int adv7180_mbus_fmt(struct v4l2_
{
struct adv7180_state *state = to_state(sd);

View File

@ -1,18 +1,14 @@
From 7e58b9c99676d641ef76edd9c097f1c3c4e6c464 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Thu, 21 Dec 2023 18:03:34 +0000
Subject: [PATCH] media: i2c: adv7180: Add support for V4L2_CID_LINK_FREQ
For CSI2 receivers that need to know the link frequency,
add it as a control to the driver.
Interlaced modes are 216Mbp/s or 108MHz, whilst going through
the I2P to deinterlace gives 432Mb/s or 216MHz.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/media/i2c/adv7180.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
From 954129f16c200e41a00ebebe2e22efc01b243538 Mon Sep 17 00:00:00 2001
From: Dom Cobley <popcornmix@gmail.com>
Date: Fri, 14 Nov 2025 14:08:18 +0000
Subject: [PATCH] Revert "Revert "media: i2c: adv7180: Add support for
V4L2_CID_LINK_FREQ""
This reverts commit 00ecb85c58501f8f7ae75fcb069bbbad5542e853.
---
drivers/media/i2c/adv7180.c | 39 +++++++++++++++++++++++++++++++++++--
1 file changed, 37 insertions(+), 2 deletions(-)
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -189,6 +189,16 @@
@ -40,7 +36,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
};
#define to_adv7180_sd(_ctrl) (&container_of(_ctrl->handler, \
struct adv7180_state, \
@@ -630,6 +641,9 @@ static int adv7180_s_ctrl(struct v4l2_ct
@@ -625,6 +636,9 @@ static int adv7180_s_ctrl(struct v4l2_ct
if (ret)
return ret;
@ -50,7 +46,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
val = ctrl->val;
switch (ctrl->id) {
case V4L2_CID_BRIGHTNESS:
@@ -671,6 +685,7 @@ static int adv7180_s_ctrl(struct v4l2_ct
@@ -666,6 +680,7 @@ static int adv7180_s_ctrl(struct v4l2_ct
ret = -EINVAL;
}
@ -58,7 +54,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
mutex_unlock(&state->mutex);
return ret;
}
@@ -691,7 +706,7 @@ static const struct v4l2_ctrl_config adv
@@ -686,7 +701,7 @@ static const struct v4l2_ctrl_config adv
static int adv7180_init_controls(struct adv7180_state *state)
{
@ -67,7 +63,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
v4l2_ctrl_new_std(&state->ctrl_hdl, &adv7180_ctrl_ops,
V4L2_CID_BRIGHTNESS, ADV7180_BRI_MIN,
@@ -717,6 +732,17 @@ static int adv7180_init_controls(struct
@@ -712,6 +727,17 @@ static int adv7180_init_controls(struct
test_pattern_menu);
}
@ -85,14 +81,21 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
state->sd.ctrl_handler = &state->ctrl_hdl;
if (state->ctrl_hdl.error) {
int err = state->ctrl_hdl.error;
@@ -849,6 +875,10 @@ static int adv7180_set_pad_format(struct
adv7180_set_power(state, false);
adv7180_set_field_mode(state);
adv7180_set_power(state, true);
@@ -839,7 +865,16 @@ static int adv7180_set_pad_format(struct
ret = adv7180_mbus_fmt(sd, &format->format);
if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
- state->field = format->format.field;
+ if (state->field != format->format.field) {
+ state->field = format->format.field;
+ adv7180_set_power(state, false);
+ adv7180_set_field_mode(state);
+ adv7180_set_power(state, true);
+ if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
+ __v4l2_ctrl_s_ctrl(state->link_freq,
+ (state->field == V4L2_FIELD_NONE) ?
+ I2P_IDX : INTERLACED_IDX);
}
+ }
} else {
framefmt = v4l2_subdev_state_get_format(sd_state, 0);
*framefmt = format->format;

View File

@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4930,7 +4930,8 @@ static const struct {
@@ -4935,7 +4935,8 @@ static const struct {
*/
static int hci_dev_setup_sync(struct hci_dev *hdev)
{

View File

@ -17,7 +17,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -6916,6 +6916,39 @@ static int __init cgroup_disable(char *s
@@ -6932,6 +6932,39 @@ static int __init cgroup_disable(char *s
}
__setup("cgroup_disable=", cgroup_disable);

View File

@ -18,7 +18,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -6255,6 +6255,22 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
@@ -6256,6 +6256,22 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x56b1, aspm_l1_acceptable_latency);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x56c0, aspm_l1_acceptable_latency);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x56c1, aspm_l1_acceptable_latency);

View File

@ -58,7 +58,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
+ the phy interface, but actually requires internal delays enabled.
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1426,6 +1426,16 @@ static void b53_adjust_531x5_rgmii(struc
@@ -1435,6 +1435,16 @@ static void b53_adjust_531x5_rgmii(struc
else
off = B53_RGMII_CTRL_P(port);
@ -75,7 +75,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
/* Configure the port RGMII clock delay by DLL disabled and
* tx_clk aligned timing (restoring to reset defaults)
*/
@@ -1437,19 +1447,24 @@ static void b53_adjust_531x5_rgmii(struc
@@ -1446,19 +1456,24 @@ static void b53_adjust_531x5_rgmii(struc
* account for this internal delay that is inserted, otherwise
* the switch won't be able to receive correctly.
*

View File

@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static int m88e1111_config_aneg(struct phy_device *phydev)
{
int extsr = phy_read(phydev, MII_M1111_PHY_EXT_SR);
@@ -3667,6 +3681,7 @@ static struct phy_driver marvell_drivers
@@ -3704,6 +3718,7 @@ static struct phy_driver marvell_drivers
.name = "Marvell 88E1112",
/* PHY_GBIT_FEATURES */
.probe = marvell_probe,
@ -45,7 +45,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
.config_init = m88e1112_config_init,
.config_aneg = marvell_config_aneg,
.config_intr = marvell_config_intr,
@@ -3688,6 +3703,7 @@ static struct phy_driver marvell_drivers
@@ -3725,6 +3740,7 @@ static struct phy_driver marvell_drivers
/* PHY_GBIT_FEATURES */
.flags = PHY_POLL_CABLE_TEST,
.probe = marvell_probe,
@ -53,7 +53,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
.config_init = m88e1111gbe_config_init,
.config_aneg = m88e1111_config_aneg,
.read_status = marvell_read_status,
@@ -3711,6 +3727,7 @@ static struct phy_driver marvell_drivers
@@ -3748,6 +3764,7 @@ static struct phy_driver marvell_drivers
.name = "Marvell 88E1111 (Finisar)",
/* PHY_GBIT_FEATURES */
.probe = marvell_probe,

View File

@ -51,7 +51,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static int m88e1111_config_aneg(struct phy_device *phydev)
{
int extsr = phy_read(phydev, MII_M1111_PHY_EXT_SR);
@@ -3682,6 +3710,7 @@ static struct phy_driver marvell_drivers
@@ -3719,6 +3747,7 @@ static struct phy_driver marvell_drivers
/* PHY_GBIT_FEATURES */
.probe = marvell_probe,
.inband_caps = m88e1111_inband_caps,
@ -59,7 +59,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
.config_init = m88e1112_config_init,
.config_aneg = marvell_config_aneg,
.config_intr = marvell_config_intr,
@@ -3704,6 +3733,7 @@ static struct phy_driver marvell_drivers
@@ -3741,6 +3770,7 @@ static struct phy_driver marvell_drivers
.flags = PHY_POLL_CABLE_TEST,
.probe = marvell_probe,
.inband_caps = m88e1111_inband_caps,
@ -67,7 +67,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
.config_init = m88e1111gbe_config_init,
.config_aneg = m88e1111_config_aneg,
.read_status = marvell_read_status,
@@ -3728,6 +3758,7 @@ static struct phy_driver marvell_drivers
@@ -3765,6 +3795,7 @@ static struct phy_driver marvell_drivers
/* PHY_GBIT_FEATURES */
.probe = marvell_probe,
.inband_caps = m88e1111_inband_caps,

View File

@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -2584,6 +2584,19 @@ static const struct b53_chip_data b53_sw
@@ -2603,6 +2603,19 @@ static const struct b53_chip_data b53_sw
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
},
{
@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
.chip_id = BCM53115_DEVICE_ID,
.dev_name = "BCM53115",
.vlans = 4096,
@@ -2964,6 +2977,7 @@ int b53_switch_detect(struct b53_device
@@ -2983,6 +2996,7 @@ int b53_switch_detect(struct b53_device
return ret;
switch (id32) {

View File

@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
ret = b53_reset_switch(dev);
if (ret) {
dev_err(ds->dev, "failed to reset switch\n");
@@ -2444,6 +2449,28 @@ static int b53_get_max_mtu(struct dsa_sw
@@ -2463,6 +2468,28 @@ static int b53_get_max_mtu(struct dsa_sw
return B53_MAX_MTU;
}
@ -69,7 +69,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static const struct phylink_mac_ops b53_phylink_mac_ops = {
.mac_select_pcs = b53_phylink_mac_select_pcs,
.mac_config = b53_phylink_mac_config,
@@ -2468,6 +2495,7 @@ static const struct dsa_switch_ops b53_s
@@ -2487,6 +2514,7 @@ static const struct dsa_switch_ops b53_s
.support_eee = b53_support_eee,
.get_mac_eee = b53_get_mac_eee,
.set_mac_eee = b53_set_mac_eee,
@ -89,7 +89,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
void b53_br_leave(struct dsa_switch *ds, int port, struct dsa_bridge bridge);
--- a/drivers/net/dsa/b53/b53_regs.h
+++ b/drivers/net/dsa/b53/b53_regs.h
@@ -225,6 +225,13 @@
@@ -224,6 +224,13 @@
#define BRCM_HDR_P5_EN BIT(1) /* Enable tagging on port 5 */
#define BRCM_HDR_P7_EN BIT(2) /* Enable tagging on port 7 */

View File

@ -28,7 +28,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
#include <linux/module.h>
#include <linux/platform_data/b53.h>
#include <linux/phy.h>
@@ -1360,24 +1361,17 @@ static void b53_adjust_63xx_rgmii(struct
@@ -1369,24 +1370,17 @@ static void b53_adjust_63xx_rgmii(struct
phy_interface_t interface)
{
struct b53_device *dev = ds->priv;
@ -59,7 +59,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
dev_dbg(ds->dev, "Configured port %d for %s\n", port,
phy_modes(interface));
@@ -1528,7 +1522,7 @@ static void b53_phylink_mac_config(struc
@@ -1537,7 +1531,7 @@ static void b53_phylink_mac_config(struc
struct b53_device *dev = ds->priv;
int port = dp->index;

View File

@ -1,99 +0,0 @@
From a4daaf063f8269a5881154c5b77c5ef6639d65d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Sat, 14 Jun 2025 09:59:47 +0200
Subject: [PATCH] net: dsa: tag_brcm: legacy: reorganize functions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Move brcm_leg_tag_rcv() definition to top.
This function is going to be shared between two different tags.
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Link: https://patch.msgid.link/20250614080000.1884236-2-noltari@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
net/dsa/tag_brcm.c | 64 +++++++++++++++++++++++-----------------------
1 file changed, 32 insertions(+), 32 deletions(-)
--- a/net/dsa/tag_brcm.c
+++ b/net/dsa/tag_brcm.c
@@ -213,6 +213,38 @@ MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROT
#endif
#if IS_ENABLED(CONFIG_NET_DSA_TAG_BRCM_LEGACY)
+static struct sk_buff *brcm_leg_tag_rcv(struct sk_buff *skb,
+ struct net_device *dev)
+{
+ int len = BRCM_LEG_TAG_LEN;
+ int source_port;
+ u8 *brcm_tag;
+
+ if (unlikely(!pskb_may_pull(skb, BRCM_LEG_TAG_LEN + VLAN_HLEN)))
+ return NULL;
+
+ brcm_tag = dsa_etype_header_pos_rx(skb);
+
+ source_port = brcm_tag[5] & BRCM_LEG_PORT_ID;
+
+ skb->dev = dsa_conduit_find_user(dev, 0, source_port);
+ if (!skb->dev)
+ return NULL;
+
+ /* VLAN tag is added by BCM63xx internal switch */
+ if (netdev_uses_dsa(skb->dev))
+ len += VLAN_HLEN;
+
+ /* Remove Broadcom tag and update checksum */
+ skb_pull_rcsum(skb, len);
+
+ dsa_default_offload_fwd_mark(skb);
+
+ dsa_strip_etype_header(skb, len);
+
+ return skb;
+}
+
static struct sk_buff *brcm_leg_tag_xmit(struct sk_buff *skb,
struct net_device *dev)
{
@@ -249,38 +281,6 @@ static struct sk_buff *brcm_leg_tag_xmit
return skb;
}
-
-static struct sk_buff *brcm_leg_tag_rcv(struct sk_buff *skb,
- struct net_device *dev)
-{
- int len = BRCM_LEG_TAG_LEN;
- int source_port;
- u8 *brcm_tag;
-
- if (unlikely(!pskb_may_pull(skb, BRCM_LEG_TAG_LEN + VLAN_HLEN)))
- return NULL;
-
- brcm_tag = dsa_etype_header_pos_rx(skb);
-
- source_port = brcm_tag[5] & BRCM_LEG_PORT_ID;
-
- skb->dev = dsa_conduit_find_user(dev, 0, source_port);
- if (!skb->dev)
- return NULL;
-
- /* VLAN tag is added by BCM63xx internal switch */
- if (netdev_uses_dsa(skb->dev))
- len += VLAN_HLEN;
-
- /* Remove Broadcom tag and update checksum */
- skb_pull_rcsum(skb, len);
-
- dsa_default_offload_fwd_mark(skb);
-
- dsa_strip_etype_header(skb, len);
-
- return skb;
-}
static const struct dsa_device_ops brcm_legacy_netdev_ops = {
.name = BRCM_LEGACY_NAME,

View File

@ -99,7 +99,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static struct sk_buff *brcm_leg_tag_rcv(struct sk_buff *skb,
struct net_device *dev)
{
@@ -244,7 +250,9 @@ static struct sk_buff *brcm_leg_tag_rcv(
@@ -250,7 +256,9 @@ static struct sk_buff *brcm_leg_tag_rcv(
return skb;
}
@ -109,7 +109,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static struct sk_buff *brcm_leg_tag_xmit(struct sk_buff *skb,
struct net_device *dev)
{
@@ -294,6 +302,66 @@ DSA_TAG_DRIVER(brcm_legacy_netdev_ops);
@@ -300,6 +308,66 @@ DSA_TAG_DRIVER(brcm_legacy_netdev_ops);
MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_BRCM_LEGACY, BRCM_LEGACY_NAME);
#endif /* CONFIG_NET_DSA_TAG_BRCM_LEGACY */
@ -176,7 +176,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
#if IS_ENABLED(CONFIG_NET_DSA_TAG_BRCM_PREPEND)
static struct sk_buff *brcm_tag_xmit_prepend(struct sk_buff *skb,
struct net_device *dev)
@@ -328,6 +396,9 @@ static struct dsa_tag_driver *dsa_tag_dr
@@ -334,6 +402,9 @@ static struct dsa_tag_driver *dsa_tag_dr
#if IS_ENABLED(CONFIG_NET_DSA_TAG_BRCM_LEGACY)
&DSA_TAG_DRIVER_NAME(brcm_legacy_netdev_ops),
#endif

View File

@ -32,7 +32,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This driver adds support for Broadcom managed switch chips. It supports
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -2285,8 +2285,11 @@ enum dsa_tag_protocol b53_get_tag_protoc
@@ -2304,8 +2304,11 @@ enum dsa_tag_protocol b53_get_tag_protoc
goto out;
}

View File

@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1816,7 +1816,8 @@ static int b53_arl_op(struct b53_device
@@ -1835,7 +1835,8 @@ static int b53_arl_op(struct b53_device
/* Perform a read for the given MAC and VID */
b53_write48(dev, B53_ARLIO_PAGE, B53_MAC_ADDR_IDX, mac);
@ -31,7 +31,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Issue a read operation for this MAC */
ret = b53_arl_rw_op(dev, 1);
@@ -2884,6 +2885,9 @@ static int b53_switch_init(struct b53_de
@@ -2903,6 +2904,9 @@ static int b53_switch_init(struct b53_de
}
}
@ -41,7 +41,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
dev->num_ports = fls(dev->enabled_ports);
dev->ds->num_ports = min_t(unsigned int, dev->num_ports, DSA_MAX_PORTS);
@@ -2985,10 +2989,24 @@ int b53_switch_detect(struct b53_device
@@ -3004,10 +3008,24 @@ int b53_switch_detect(struct b53_device
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_TABLE_ACCESS_25, 0xf);
b53_read16(dev, B53_VLAN_PAGE, B53_VLAN_TABLE_ACCESS_25, &tmp);

View File

@ -24,7 +24,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1802,6 +1802,45 @@ static int b53_arl_read(struct b53_devic
@@ -1821,6 +1821,45 @@ static int b53_arl_read(struct b53_devic
return *idx >= dev->num_arl_bins ? -ENOSPC : -ENOENT;
}
@ -70,7 +70,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static int b53_arl_op(struct b53_device *dev, int op, int port,
const unsigned char *addr, u16 vid, bool is_valid)
{
@@ -1824,7 +1863,10 @@ static int b53_arl_op(struct b53_device
@@ -1843,7 +1882,10 @@ static int b53_arl_op(struct b53_device
if (ret)
return ret;
@ -82,7 +82,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* If this is a read, just finish now */
if (op)
@@ -1868,12 +1910,17 @@ static int b53_arl_op(struct b53_device
@@ -1887,12 +1929,17 @@ static int b53_arl_op(struct b53_device
ent.is_static = true;
ent.is_age = false;
memcpy(ent.mac, addr, ETH_ALEN);
@ -103,7 +103,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
return b53_arl_rw_op(dev, 0);
}
@@ -1885,12 +1932,6 @@ int b53_fdb_add(struct dsa_switch *ds, i
@@ -1904,12 +1951,6 @@ int b53_fdb_add(struct dsa_switch *ds, i
struct b53_device *priv = ds->priv;
int ret;
@ -116,7 +116,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
mutex_lock(&priv->arl_mutex);
ret = b53_arl_op(priv, 0, port, addr, vid, true);
mutex_unlock(&priv->arl_mutex);
@@ -1917,10 +1958,15 @@ EXPORT_SYMBOL(b53_fdb_del);
@@ -1936,10 +1977,15 @@ EXPORT_SYMBOL(b53_fdb_del);
static int b53_arl_search_wait(struct b53_device *dev)
{
unsigned int timeout = 1000;
@ -132,9 +132,9 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
- b53_read8(dev, B53_ARLIO_PAGE, B53_ARL_SRCH_CTL, &reg);
+ b53_read8(dev, B53_ARLIO_PAGE, offset, &reg);
if (!(reg & ARL_SRCH_STDN))
return 0;
return -ENOENT;
@@ -1937,13 +1983,24 @@ static void b53_arl_search_rd(struct b53
@@ -1956,13 +2002,24 @@ static void b53_arl_search_rd(struct b53
struct b53_arl_entry *ent)
{
u64 mac_vid;
@ -165,7 +165,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
static int b53_fdb_copy(int port, const struct b53_arl_entry *ent,
@@ -1964,14 +2021,20 @@ int b53_fdb_dump(struct dsa_switch *ds,
@@ -1983,14 +2040,20 @@ int b53_fdb_dump(struct dsa_switch *ds,
struct b53_device *priv = ds->priv;
struct b53_arl_entry results[2];
unsigned int count = 0;
@ -234,7 +234,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
#include <linux/bcm47xx_nvram.h>
--- a/drivers/net/dsa/b53/b53_regs.h
+++ b/drivers/net/dsa/b53/b53_regs.h
@@ -329,9 +329,10 @@
@@ -328,9 +328,10 @@
#define ARLTBL_VID_MASK 0xfff
#define ARLTBL_DATA_PORT_ID_S_25 48
#define ARLTBL_DATA_PORT_ID_MASK_25 0xf

View File

@ -107,7 +107,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* PHY Registers */
#define B53_PORT_MII_PAGE(i) (0x10 + (i)) /* Port i MII Registers */
@@ -372,6 +373,18 @@
@@ -371,6 +372,18 @@
#define B53_ARL_SRCH_RSTL(x) (B53_ARL_SRCH_RSTL_0 + ((x) * 0x10))
/*************************************************************************

View File

@ -403,7 +403,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
};
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -4181,7 +4181,7 @@ static struct phy_driver marvell_drivers
@@ -4218,7 +4218,7 @@ static struct phy_driver marvell_drivers
module_phy_driver(marvell_drivers);

View File

@ -183,7 +183,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
else if (tp->mac_version == RTL_GIGA_MAC_VER_63)
r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0200);
@@ -3742,8 +3742,8 @@ static void rtl_hw_start_8125_common(str
r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0030);
r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0000);
r8168_mac_ocp_modify(tp, 0xe040, 0x1000, 0x0000);
r8168_mac_ocp_modify(tp, 0xea1c, 0x0003, 0x0001);
- if (tp->mac_version == RTL_GIGA_MAC_VER_65 ||

View File

@ -69,7 +69,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
else if (tp->mac_version == RTL_GIGA_MAC_VER_63)
r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0200);
@@ -3714,8 +3710,7 @@ static void rtl_hw_start_8125_common(str
r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0030);
r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0000);
r8168_mac_ocp_modify(tp, 0xe040, 0x1000, 0x0000);
r8168_mac_ocp_modify(tp, 0xea1c, 0x0003, 0x0001);
- if (tp->mac_version == RTL_GIGA_MAC_VER_70 ||

View File

@ -97,7 +97,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
else if (tp->mac_version == RTL_GIGA_MAC_VER_63)
r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0200);
@@ -3708,7 +3720,8 @@ static void rtl_hw_start_8125_common(str
r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0030);
r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0000);
r8168_mac_ocp_modify(tp, 0xe040, 0x1000, 0x0000);
r8168_mac_ocp_modify(tp, 0xea1c, 0x0003, 0x0001);
- if (tp->mac_version == RTL_GIGA_MAC_VER_70)

View File

@ -98,11 +98,10 @@ static int mtdsplit_h3c_vfs_parse(struct mtd_info *mtd,
if (retlen != sizeof(format_flag))
return -EIO;
if (format_flag != FORMAT_FLAG) {
pr_info("mtdsplit_h3c_vfs: unexpected format flag %08x\n",
format_flag);
return 0;
}
if (format_flag != FORMAT_FLAG)
pr_debug("mtdsplit_h3c_vfs: unexpected format flag %08x\n",
format_flag);
return -ENOENT;
/* Check file entry */
err = mtd_read(mtd, FILE_ENTRY_OFFSET, sizeof(file_entry), &retlen,
@ -113,14 +112,20 @@ static int mtdsplit_h3c_vfs_parse(struct mtd_info *mtd,
if (retlen != sizeof(file_entry))
return -EIO;
if (file_entry.flags != FILE_ENTRY_FLAGS ||
file_entry.parent_block != FILE_ENTRY_PARENT_BLOCK ||
file_entry.parent_index != FILE_ENTRY_PARENT_INDEX ||
file_entry.data_block != FILE_ENTRY_DATA_BLOCK ||
strncmp(file_entry.name, FILE_ENTRY_NAME, sizeof(file_entry.name)) != 0) {
pr_info("mtdsplit_h3c_vfs: unexpected file entry - OpenWrt probably not installed\n");
return 0;
}
if (file_entry.flags != FILE_ENTRY_FLAGS)
return -ENOENT;
if (file_entry.parent_block != FILE_ENTRY_PARENT_BLOCK)
return -ENOENT;
if (file_entry.parent_index != FILE_ENTRY_PARENT_INDEX)
return -ENOENT;
if (file_entry.data_block != FILE_ENTRY_DATA_BLOCK)
return -ENOENT;
if (strncmp(file_entry.name, FILE_ENTRY_NAME, sizeof(file_entry.name)) != 0)
return -ENOENT;
/* Find rootfs offset */
kernel_size = block_offset(file_entry.data_block +

View File

@ -63,44 +63,30 @@ static int mtdsplit_parse_minor(struct mtd_info *master,
hdr_len = sizeof(hdr);
err = mtd_read(master, 0, hdr_len, &retlen, (void *) &hdr);
if (err) {
pr_err("MiNOR mtd_read error: %d\n", err);
if (err)
return err;
}
if (retlen != hdr_len) {
pr_err("MiNOR mtd_read too short\n");
if (retlen != hdr_len)
return -EIO;
}
/* match header */
if (hdr.yaffs_type != YAFFS_OBJECT_TYPE_FILE) {
pr_info("MiNOR YAFFS first type not matched\n");
return 0;
}
if (hdr.yaffs_type != YAFFS_OBJECT_TYPE_FILE)
return -ENOENT;
if (hdr.yaffs_obj_id != YAFFS_OBJECTID_ROOT) {
pr_info("MiNOR YAFFS first objectid not matched\n");
return 0;
}
if (hdr.yaffs_obj_id != YAFFS_OBJECTID_ROOT)
return -ENOENT;
if (hdr.yaffs_sum_unused != YAFFS_SUM_UNUSED) {
pr_info("MiNOR YAFFS first sum not matched\n");
return 0;
}
if (hdr.yaffs_sum_unused != YAFFS_SUM_UNUSED)
return -ENOENT;
if ((memcmp(hdr.yaffs_name, YAFFS_NAME_KERNEL, sizeof(YAFFS_NAME_KERNEL))) &&
(memcmp(hdr.yaffs_name, YAFFS_NAME_BOOTIMAGE, sizeof(YAFFS_NAME_BOOTIMAGE)))) {
pr_info("MiNOR YAFFS first name not matched\n");
return 0;
}
(memcmp(hdr.yaffs_name, YAFFS_NAME_BOOTIMAGE, sizeof(YAFFS_NAME_BOOTIMAGE))))
return -ENOENT;
err = mtd_find_rootfs_from(master, master->erasesize, master->size,
&rootfs_offset, NULL);
if (err) {
pr_info("MiNOR mtd_find_rootfs_from error: %d\n", err);
return 0;
}
if (err)
return err;
parts = kzalloc(MINOR_NR_PARTS * sizeof(*parts), GFP_KERNEL);
if (!parts)

View File

@ -112,7 +112,7 @@ static int mtdsplit_parse_seil_fw(struct mtd_info *master,
u64 id;
if (!seil_bootdev_is_active(np))
return 0;
return -ENOENT;
ret = of_property_read_u64(np, "iij,seil-id", &id);
if (ret) {
@ -137,7 +137,7 @@ static int mtdsplit_parse_seil_fw(struct mtd_info *master,
if (be64_to_cpu(header.id) != id ||
be32_to_cpu(header.vfmt) != SEIL_VFMT) {
pr_debug("no valid seil image found in \"%s\"\n", master->name);
ret = 0;
ret = -ENOENT;
goto err_free_parts;
}
@ -154,7 +154,7 @@ static int mtdsplit_parse_seil_fw(struct mtd_info *master,
if (ret || (master->size - rootfs_offset) == 0) {
pr_debug("no rootfs after seil image in \"%s\"\n",
master->name);
ret = 0;
ret = -ENOENT;
goto err_free_parts;
}

View File

@ -201,8 +201,8 @@ static int __mtdsplit_parse_uimage(struct mtd_info *master,
ret = mtd_find_rootfs_from(master, uimage_offset + uimage_size,
master->size, &rootfs_offset, &type);
if (ret) {
pr_info("no rootfs after uImage in \"%s\"\n", master->name);
ret = 0;
pr_debug("no rootfs after uImage in \"%s\"\n",
master->name);
goto err_free_buf;
}
@ -215,8 +215,9 @@ static int __mtdsplit_parse_uimage(struct mtd_info *master,
/* check rootfs presence at offset 0 */
ret = mtd_check_rootfs_magic(master, 0, &type);
if (ret) {
pr_info("no rootfs before uImage in \"%s\"\n", master->name);
ret = 0;
pr_debug("no rootfs before uImage in \"%s\"\n",
master->name);
ret = -ENOENT;
goto err_free_buf;
}

View File

@ -0,0 +1,36 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andy Chiang <AndyChiang_git@outlook.com>
Date: Thu, 20 Nov 2025 20:37:53 +0700
Subject: [PATCH] kernel: fix build of kmod-udptunnel4 and kmod-udptunnel6
This fixes the following errors:
```
make[4]: Entering directory '/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/linux-6.12.57'
MODPOST /home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/Module.symvers
ERROR: modpost: "udp_tunnel6_xmit_skb" [/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
ERROR: modpost: "setup_udp_tunnel_sock" [/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
ERROR: modpost: "udp_tunnel_xmit_skb" [/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
make[6]: *** [scripts/Makefile.modpost:145: /home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/Module.symvers] Error 1
make[5]: *** [/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/linux-6.12.57/Makefile:1897: modpost] Error 2
make[4]: *** [Makefile:224: __sub-make] Error 2
```
ref https://github.com/openwrt/openwrt/commit/1d15a96b29dcd0947690951a7c36aead79a27129
fixes: https://github.com/openwrt/packages/issues/22998
Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
---
net/ipv4/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -315,7 +315,7 @@ config NET_IPVTI
on top.
config NET_UDP_TUNNEL
- tristate
+ tristate "IP: UDP tunneling support"
select NET_IP_TUNNEL
default n

View File

@ -16,7 +16,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -1153,8 +1153,9 @@ static void page_pool_release_retry(stru
@@ -1155,8 +1155,9 @@ static void page_pool_release_retry(stru
{
struct delayed_work *dwq = to_delayed_work(wq);
struct page_pool *pool = container_of(dwq, typeof(*pool), release_dw);
@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
inflight = page_pool_release(pool);
/* In rare cases, a driver bug may cause inflight to go negative.
@@ -1166,6 +1167,21 @@ static void page_pool_release_retry(stru
@@ -1168,6 +1169,21 @@ static void page_pool_release_retry(stru
if (inflight <= 0)
return;

View File

@ -10,7 +10,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1076,6 +1076,11 @@ static const struct usb_device_id produc
@@ -1082,6 +1082,11 @@ static const struct usb_device_id produc
USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7),
.driver_info = (unsigned long)&qmi_wwan_info,
},
@ -22,7 +22,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0122)}, /* Quectel RG650V */
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */
@@ -1083,6 +1088,7 @@ static const struct usb_device_id produc
@@ -1089,6 +1094,7 @@ static const struct usb_device_id produc
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */
{QMI_MATCH_FF_FF_FF(0x2c7c, 0x0801)}, /* Quectel RM520N */

View File

@ -331,7 +331,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -4277,6 +4277,8 @@ static __net_initdata struct pernet_oper
@@ -4280,6 +4280,8 @@ static __net_initdata struct pernet_oper
static int __init proto_init(void)
{

View File

@ -0,0 +1,36 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andy Chiang <AndyChiang_git@outlook.com>
Date: Thu, 20 Nov 2025 20:37:53 +0700
Subject: [PATCH] kernel: fix build of kmod-udptunnel4 and kmod-udptunnel6
This fixes the following errors:
```
make[4]: Entering directory '/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/linux-6.12.57'
MODPOST /home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/Module.symvers
ERROR: modpost: "udp_tunnel6_xmit_skb" [/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
ERROR: modpost: "setup_udp_tunnel_sock" [/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
ERROR: modpost: "udp_tunnel_xmit_skb" [/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined!
make[6]: *** [scripts/Makefile.modpost:145: /home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/Module.symvers] Error 1
make[5]: *** [/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/linux-6.12.57/Makefile:1897: modpost] Error 2
make[4]: *** [Makefile:224: __sub-make] Error 2
```
ref https://github.com/openwrt/openwrt/commit/1d15a96b29dcd0947690951a7c36aead79a27129
fixes: https://github.com/openwrt/packages/issues/22998
Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
---
net/ipv4/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -315,7 +315,7 @@ config NET_IPVTI
on top.
config NET_UDP_TUNNEL
- tristate
+ tristate "IP: UDP tunneling support"
select NET_IP_TUNNEL
default n

View File

@ -1,2 +1,2 @@
LINUX_VERSION-6.12 = .57
LINUX_KERNEL_HASH-6.12.57 = 165ca1c37c4607b90e731996b7c1e3311285167d13deeedf08f3f1f0b9d2541a
LINUX_VERSION-6.12 = .58
LINUX_KERNEL_HASH-6.12.58 = 5f1c4c546660a6a81046fdfa6195306bad2c8d17c0d69876dc100a85ad4613ac

View File

@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (sk_can_gso(sk)) {
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2021,7 +2021,7 @@ void ieee80211_color_collision_detection
@@ -2023,7 +2023,7 @@ void ieee80211_color_collision_detection
/* interface handling */
#define MAC80211_SUPPORTED_FEATURES_TX (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \
NETIF_F_HW_CSUM | NETIF_F_SG | \

View File

@ -24,7 +24,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -201,6 +201,7 @@ void br_flood(struct net_bridge *br, str
@@ -202,6 +202,7 @@ void br_flood(struct net_bridge *br, str
enum br_pkt_type pkt_type, bool local_rcv, bool local_orig,
u16 vid)
{
@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
struct net_bridge_port *prev = NULL;
struct net_bridge_port *p;
@@ -218,6 +219,10 @@ void br_flood(struct net_bridge *br, str
@@ -219,6 +220,10 @@ void br_flood(struct net_bridge *br, str
case BR_PKT_MULTICAST:
if (!(p->flags & BR_MCAST_FLOOD) && skb->dev != br->dev)
continue;

Some files were not shown because too many files have changed in this diff Show More