uboot-airoha: update to v2026.07
Changes: * removed upstreamed patches, * refresh patches, * add en7523/an7581/an7583 pinctrl support * add basic PCS support for an7583 * add an7583 specific mdio bus support Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Link: https://github.com/openwrt/openwrt/pull/24165 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
parent
2a73f02e56
commit
baeacca598
44 changed files with 9117 additions and 729 deletions
|
|
@ -1,8 +1,8 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_VERSION:=2026.01
|
||||
PKG_HASH:=b60d5865cefdbc75da8da4156c56c458e00de75a49b80c1a2e58a96e30ad0d54
|
||||
PKG_VERSION:=2026.07
|
||||
PKG_HASH:=78e8bfc382fe388f9b55aa1daf8c563522a037779b5d4c349d1415e381f1243e
|
||||
PKG_BUILD_DEPENDS:=arm-trusted-firmware-tools/host
|
||||
|
||||
UBOOT_USE_INTREE_DTC:=1
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
From abfc83fc16f570d25212c0a8a5e2694dd2383b9d Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Sat, 9 May 2026 11:24:10 +0300
|
||||
Subject: [PATCH 01/29] bitops: import BITS_PER_TYPE() macro from linux
|
||||
|
||||
This macro will be used by include/linux/bitfield.h header.
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Reviewed-by: David Lechner <dlechner@baylibre.com>
|
||||
Reviewed-by: Simon Glass <sjg@chromium.org>
|
||||
---
|
||||
include/linux/bitops.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
|
||||
index 29e0da48de8..52eea4f8380 100644
|
||||
--- a/include/linux/bitops.h
|
||||
+++ b/include/linux/bitops.h
|
||||
@@ -15,6 +15,7 @@
|
||||
#define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG))
|
||||
#define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG)
|
||||
#define BITS_PER_BYTE 8
|
||||
+#define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE)
|
||||
#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
|
||||
#endif
|
||||
|
||||
--
|
||||
2.53.0
|
||||
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
From fd4dadc9d17bfd624bef9f1292d31e56e99f5344 Mon Sep 17 00:00:00 2001
|
||||
From: Geert Uytterhoeven <geert+renesas@glider.be>
|
||||
Date: Thu, 6 Nov 2025 14:34:00 +0100
|
||||
Subject: [PATCH 02/29] bitfield: Add less-checking __FIELD_{GET,PREP}()
|
||||
|
||||
The BUILD_BUG_ON_MSG() check against "~0ull" works only with "unsigned
|
||||
(long) long" _mask types. For constant masks, that condition is usually
|
||||
met, as GENMASK() yields an UL value. The few places where the
|
||||
constant mask is stored in an intermediate variable were fixed by
|
||||
changing the variable type to u64.
|
||||
|
||||
However, for non-constant masks, smaller unsigned types should be valid,
|
||||
too, but currently lead to "result of comparison of constant
|
||||
18446744073709551615 with expression of type ... is always
|
||||
false"-warnings with clang and W=1.
|
||||
|
||||
Hence refactor the __BF_FIELD_CHECK() helper, and factor out
|
||||
__FIELD_{GET,PREP}(). The later lack the single problematic check, but
|
||||
are otherwise identical to FIELD_{GET,PREP}(), and are intended to be
|
||||
used in the fully non-const variants later.
|
||||
|
||||
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
|
||||
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
|
||||
[Linux commit: 2a6c045640c38a407a39cd40c3c4d8dd2fd89aa8]
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Reviewed-by: David Lechner <dlechner@baylibre.com>
|
||||
Reviewed-by: Simon Glass <sjg@chromium.org>
|
||||
---
|
||||
include/linux/bitfield.h | 36 ++++++++++++++++++++++++++++--------
|
||||
1 file changed, 28 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h
|
||||
index 63928f17322..ef81901bc41 100644
|
||||
--- a/include/linux/bitfield.h
|
||||
+++ b/include/linux/bitfield.h
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
#define __bf_cast_unsigned(type, x) ((__unsigned_scalar_typeof(type))(x))
|
||||
|
||||
-#define __BF_FIELD_CHECK(_mask, _reg, _val, _pfx) \
|
||||
+#define __BF_FIELD_CHECK_MASK(_mask, _val, _pfx) \
|
||||
({ \
|
||||
BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \
|
||||
_pfx "mask is not constant"); \
|
||||
@@ -69,13 +69,33 @@
|
||||
~((_mask) >> __bf_shf(_mask)) & \
|
||||
(0 + (_val)) : 0, \
|
||||
_pfx "value too large for the field"); \
|
||||
- BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > \
|
||||
- __bf_cast_unsigned(_reg, ~0ull), \
|
||||
- _pfx "type of reg too small for mask"); \
|
||||
__BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
|
||||
(1ULL << __bf_shf(_mask))); \
|
||||
})
|
||||
|
||||
+#define __BF_FIELD_CHECK_REG(mask, reg, pfx) \
|
||||
+ BUILD_BUG_ON_MSG(__bf_cast_unsigned(mask, mask) > \
|
||||
+ __bf_cast_unsigned(reg, ~0ull), \
|
||||
+ pfx "type of reg too small for mask")
|
||||
+
|
||||
+#define __BF_FIELD_CHECK(mask, reg, val, pfx) \
|
||||
+ ({ \
|
||||
+ __BF_FIELD_CHECK_MASK(mask, val, pfx); \
|
||||
+ __BF_FIELD_CHECK_REG(mask, reg, pfx); \
|
||||
+ })
|
||||
+
|
||||
+#define __FIELD_PREP(mask, val, pfx) \
|
||||
+ ({ \
|
||||
+ __BF_FIELD_CHECK_MASK(mask, val, pfx); \
|
||||
+ ((typeof(mask))(val) << __bf_shf(mask)) & (mask); \
|
||||
+ })
|
||||
+
|
||||
+#define __FIELD_GET(mask, reg, pfx) \
|
||||
+ ({ \
|
||||
+ __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
|
||||
+ (typeof(mask))(((reg) & (mask)) >> __bf_shf(mask)); \
|
||||
+ })
|
||||
+
|
||||
/**
|
||||
* FIELD_MAX() - produce the maximum value representable by a field
|
||||
* @_mask: shifted mask defining the field's length and position
|
||||
@@ -112,8 +132,8 @@
|
||||
*/
|
||||
#define FIELD_PREP(_mask, _val) \
|
||||
({ \
|
||||
- __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
|
||||
- ((typeof(_mask))(_val) << __bf_shf(_mask)) & (_mask); \
|
||||
+ __BF_FIELD_CHECK_REG(_mask, 0ULL, "FIELD_PREP: "); \
|
||||
+ __FIELD_PREP(_mask, _val, "FIELD_PREP: "); \
|
||||
})
|
||||
|
||||
#define __BF_CHECK_POW2(n) BUILD_BUG_ON_ZERO(((n) & ((n) - 1)) != 0)
|
||||
@@ -152,8 +172,8 @@
|
||||
*/
|
||||
#define FIELD_GET(_mask, _reg) \
|
||||
({ \
|
||||
- __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
|
||||
- (typeof(_mask))(((_reg) & (_mask)) >> __bf_shf(_mask)); \
|
||||
+ __BF_FIELD_CHECK_REG(_mask, _reg, "FIELD_GET: "); \
|
||||
+ __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
|
||||
})
|
||||
|
||||
extern void __compiletime_error("value doesn't fit into mask")
|
||||
--
|
||||
2.53.0
|
||||
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
From bb8df4be357e61cd8e97d2109395e6dd4d7c51ab Mon Sep 17 00:00:00 2001
|
||||
From: Geert Uytterhoeven <geert+renesas@glider.be>
|
||||
Date: Thu, 6 Nov 2025 14:34:01 +0100
|
||||
Subject: [PATCH 03/29] bitfield: Add non-constant field_{prep,get}() helpers
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The existing FIELD_{GET,PREP}() macros are limited to compile-time
|
||||
constants. However, it is very common to prepare or extract bitfield
|
||||
elements where the bitfield mask is not a compile-time constant.
|
||||
|
||||
To avoid this limitation, the AT91 clock driver and several other
|
||||
drivers already have their own non-const field_{prep,get}() macros.
|
||||
Make them available for general use by adding them to
|
||||
<linux/bitfield.h>, and improve them slightly:
|
||||
1. Avoid evaluating macro parameters more than once,
|
||||
2. Replace "ffs() - 1" by "__ffs()",
|
||||
3. Support 64-bit use on 32-bit architectures,
|
||||
4. Wire field_{get,prep}() to FIELD_{GET,PREP}() when mask is
|
||||
actually constant.
|
||||
|
||||
This is deliberately not merged into the existing FIELD_{GET,PREP}()
|
||||
macros, as people expressed the desire to keep stricter variants for
|
||||
increased safety, or for performance critical paths.
|
||||
|
||||
Yury: use __mask within new macros.
|
||||
|
||||
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
|
||||
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
|
||||
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
||||
Acked-by: Crt Mori <cmo@melexis.com>
|
||||
Acked-by: Nuno Sá <nuno.sa@analog.com>
|
||||
Acked-by: Richard Genoud <richard.genoud@bootlin.com>
|
||||
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
|
||||
Reviewed-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
|
||||
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
|
||||
[Linux commit c1c6ab80b25c8db1e2ef5ae3ac8075d2c242ae13]
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Reviewed-by: David Lechner <dlechner@baylibre.com>
|
||||
Reviewed-by: Simon Glass <sjg@chromium.org>
|
||||
---
|
||||
include/linux/bitfield.h | 59 ++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 59 insertions(+)
|
||||
|
||||
diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h
|
||||
index ef81901bc41..18cf57aeb2c 100644
|
||||
--- a/include/linux/bitfield.h
|
||||
+++ b/include/linux/bitfield.h
|
||||
@@ -16,6 +16,7 @@
|
||||
* FIELD_{GET,PREP} macros take as first parameter shifted mask
|
||||
* from which they extract the base mask and shift amount.
|
||||
* Mask must be a compilation time constant.
|
||||
+ * field_{get,prep} are variants that take a non-const mask.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
@@ -223,4 +224,62 @@ __MAKE_OP(64)
|
||||
#undef __MAKE_OP
|
||||
#undef ____MAKE_OP
|
||||
|
||||
+#define __field_prep(mask, val) \
|
||||
+ ({ \
|
||||
+ __auto_type __mask = (mask); \
|
||||
+ typeof(__mask) __val = (val); \
|
||||
+ unsigned int __shift = BITS_PER_TYPE(__mask) <= 32 ? \
|
||||
+ __ffs(__mask) : __ffs64(__mask); \
|
||||
+ (__val << __shift) & __mask; \
|
||||
+ })
|
||||
+
|
||||
+#define __field_get(mask, reg) \
|
||||
+ ({ \
|
||||
+ __auto_type __mask = (mask); \
|
||||
+ typeof(__mask) __reg = (reg); \
|
||||
+ unsigned int __shift = BITS_PER_TYPE(__mask) <= 32 ? \
|
||||
+ __ffs(__mask) : __ffs64(__mask); \
|
||||
+ (__reg & __mask) >> __shift; \
|
||||
+ })
|
||||
+
|
||||
+/**
|
||||
+ * field_prep() - prepare a bitfield element
|
||||
+ * @mask: shifted mask defining the field's length and position, must be
|
||||
+ * non-zero
|
||||
+ * @val: value to put in the field
|
||||
+ *
|
||||
+ * Return: field value masked and shifted to its final destination
|
||||
+ *
|
||||
+ * field_prep() masks and shifts up the value. The result should be
|
||||
+ * combined with other fields of the bitfield using logical OR.
|
||||
+ * Unlike FIELD_PREP(), @mask is not limited to a compile-time constant.
|
||||
+ * Typical usage patterns are a value stored in a table, or calculated by
|
||||
+ * shifting a constant by a variable number of bits.
|
||||
+ * If you want to ensure that @mask is a compile-time constant, please use
|
||||
+ * FIELD_PREP() directly instead.
|
||||
+ */
|
||||
+#define field_prep(mask, val) \
|
||||
+ (__builtin_constant_p(mask) ? __FIELD_PREP(mask, val, "field_prep: ") \
|
||||
+ : __field_prep(mask, val))
|
||||
+
|
||||
+/**
|
||||
+ * field_get() - extract a bitfield element
|
||||
+ * @mask: shifted mask defining the field's length and position, must be
|
||||
+ * non-zero
|
||||
+ * @reg: value of entire bitfield
|
||||
+ *
|
||||
+ * Return: extracted field value
|
||||
+ *
|
||||
+ * field_get() extracts the field specified by @mask from the
|
||||
+ * bitfield passed in as @reg by masking and shifting it down.
|
||||
+ * Unlike FIELD_GET(), @mask is not limited to a compile-time constant.
|
||||
+ * Typical usage patterns are a value stored in a table, or calculated by
|
||||
+ * shifting a constant by a variable number of bits.
|
||||
+ * If you want to ensure that @mask is a compile-time constant, please use
|
||||
+ * FIELD_GET() directly instead.
|
||||
+ */
|
||||
+#define field_get(mask, reg) \
|
||||
+ (__builtin_constant_p(mask) ? __FIELD_GET(mask, reg, "field_get: ") \
|
||||
+ : __field_get(mask, reg))
|
||||
+
|
||||
#endif
|
||||
--
|
||||
2.53.0
|
||||
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
From 7fd55b7f471fc5b87a1cb3bf347d7e95b776dfc8 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Sun, 26 Apr 2026 23:18:25 +0300
|
||||
Subject: [PATCH 04/29] pinctrl: add more pinconf/pinctrl definitions
|
||||
|
||||
These pinconf/pinctrl definitions will be used by the next patches.
|
||||
|
||||
The definitions was taken from public headers of linux-7.0. It's used
|
||||
by several linux pinctrl drivers, so it might be helpful for U-Boot as
|
||||
well.
|
||||
|
||||
Pinconf definitions are placed near the corresponding U-Boot definitions
|
||||
in file include/dm/pinctrl.h. Pin/group/function definitions stored within
|
||||
the same path as in linux (include/linux/pinctrl/pinctrl.h).
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Reviewed-by: David Lechner <dlechner@baylibre.com>
|
||||
---
|
||||
include/dm/pinctrl.h | 28 +++++++++++++
|
||||
include/linux/pinctrl/pinctrl.h | 74 +++++++++++++++++++++++++++++++++
|
||||
2 files changed, 102 insertions(+)
|
||||
create mode 100644 include/linux/pinctrl/pinctrl.h
|
||||
|
||||
diff --git a/include/dm/pinctrl.h b/include/dm/pinctrl.h
|
||||
index e41baea6200..36db47802c7 100644
|
||||
--- a/include/dm/pinctrl.h
|
||||
+++ b/include/dm/pinctrl.h
|
||||
@@ -481,6 +481,34 @@ enum pin_config_param {
|
||||
PIN_CONFIG_MAX = 255, /* 0xFF */
|
||||
};
|
||||
|
||||
+/*
|
||||
+ * Helpful configuration macro to be used in tables etc.
|
||||
+ */
|
||||
+#define PIN_CONF_PACKED(p, a) ((a << 8) | ((unsigned long) p & 0xffUL))
|
||||
+
|
||||
+/*
|
||||
+ * The following inlines stuffs a configuration parameter and data value
|
||||
+ * into and out of an unsigned long argument, as used by the generic pin config
|
||||
+ * system. We put the parameter in the lower 8 bits and the argument in the
|
||||
+ * upper 24 bits.
|
||||
+ */
|
||||
+
|
||||
+static inline enum pin_config_param pinconf_to_config_param(unsigned long config)
|
||||
+{
|
||||
+ return (enum pin_config_param) (config & 0xffUL);
|
||||
+}
|
||||
+
|
||||
+static inline u32 pinconf_to_config_argument(unsigned long config)
|
||||
+{
|
||||
+ return (u32) ((config >> 8) & 0xffffffUL);
|
||||
+}
|
||||
+
|
||||
+static inline unsigned long pinconf_to_config_packed(enum pin_config_param param,
|
||||
+ u32 argument)
|
||||
+{
|
||||
+ return PIN_CONF_PACKED(param, argument);
|
||||
+}
|
||||
+
|
||||
#if CONFIG_IS_ENABLED(PINCTRL_GENERIC)
|
||||
/**
|
||||
* pinctrl_generic_set_state() - Generic set_state operation
|
||||
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
|
||||
new file mode 100644
|
||||
index 00000000000..32b56e0ab18
|
||||
--- /dev/null
|
||||
+++ b/include/linux/pinctrl/pinctrl.h
|
||||
@@ -0,0 +1,74 @@
|
||||
+/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
+
|
||||
+#ifndef __LINUX_PINCTRL_PINCTRL_H
|
||||
+#define __LINUX_PINCTRL_PINCTRL_H
|
||||
+
|
||||
+#include <linux/types.h>
|
||||
+
|
||||
+/**
|
||||
+ * struct pingroup - provides information on pingroup
|
||||
+ * @name: a name for pingroup
|
||||
+ * @pins: an array of pins in the pingroup
|
||||
+ * @npins: number of pins in the pingroup
|
||||
+ */
|
||||
+struct pingroup {
|
||||
+ const char *name;
|
||||
+ const unsigned int *pins;
|
||||
+ size_t npins;
|
||||
+};
|
||||
+
|
||||
+/* Convenience macro to define a single named or anonymous pingroup */
|
||||
+#define PINCTRL_PINGROUP(_name, _pins, _npins) \
|
||||
+(struct pingroup) { \
|
||||
+ .name = _name, \
|
||||
+ .pins = _pins, \
|
||||
+ .npins = _npins, \
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * struct pinctrl_pin_desc - boards/machines provide information on their
|
||||
+ * pins, pads or other muxable units in this struct
|
||||
+ * @number: unique pin number from the global pin number space
|
||||
+ * @name: a name for this pin
|
||||
+ * @drv_data: driver-defined per-pin data. pinctrl core does not touch this
|
||||
+ */
|
||||
+struct pinctrl_pin_desc {
|
||||
+ unsigned int number;
|
||||
+ const char *name;
|
||||
+ void *drv_data;
|
||||
+};
|
||||
+
|
||||
+/* Convenience macro to define a single named or anonymous pin descriptor */
|
||||
+#define PINCTRL_PIN(_number, _name) \
|
||||
+(struct pinctrl_pin_desc) { \
|
||||
+ .number = _number, \
|
||||
+ .name = _name, \
|
||||
+}
|
||||
+
|
||||
+#define PINCTRL_PIN_ANON(_number) \
|
||||
+(struct pinctrl_pin_desc) { \
|
||||
+ .number = _number, \
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * struct pinfunction - Description about a function
|
||||
+ * @name: Name of the function
|
||||
+ * @groups: An array of groups for this function
|
||||
+ * @ngroups: Number of groups in @groups
|
||||
+ * @flags: Additional pin function flags
|
||||
+ */
|
||||
+struct pinfunction {
|
||||
+ const char *name;
|
||||
+ const char * const *groups;
|
||||
+ size_t ngroups;
|
||||
+};
|
||||
+
|
||||
+/* Convenience macro to define a single named pinfunction */
|
||||
+#define PINCTRL_PINFUNCTION(_name, _groups, _ngroups) \
|
||||
+(struct pinfunction) { \
|
||||
+ .name = (_name), \
|
||||
+ .groups = (_groups), \
|
||||
+ .ngroups = (_ngroups), \
|
||||
+}
|
||||
+
|
||||
+#endif /* __LINUX_PINCTRL_PINCTRL_H */
|
||||
--
|
||||
2.53.0
|
||||
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,30 @@
|
|||
From c721a0c1076d30958ab96f3dd209f7d92c10f750 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Mon, 27 Apr 2026 15:30:41 +0300
|
||||
Subject: [PATCH 09/29] configs: airoha: an7581: enable pinctrl/gpio support
|
||||
|
||||
This enables AN7581 pin controller and gpio driver.
|
||||
Defconfig was minimized with 'make savedefconfig'.
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Reviewed-by: David Lechner <dlechner@baylibre.com>
|
||||
---
|
||||
configs/an7581_evb_defconfig | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configs/an7581_evb_defconfig b/configs/an7581_evb_defconfig
|
||||
index 07569fa0a4e..a615994cc76 100644
|
||||
--- a/configs/an7581_evb_defconfig
|
||||
+++ b/configs/an7581_evb_defconfig
|
||||
@@ -72,7 +72,7 @@ CONFIG_PCS_AIROHA_AN7581=y
|
||||
CONFIG_AIROHA_ETH=y
|
||||
CONFIG_PHY=y
|
||||
CONFIG_PINCTRL=y
|
||||
-CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_AIROHA_AN7581=y
|
||||
CONFIG_POWER_DOMAIN=y
|
||||
CONFIG_DM_REGULATOR=y
|
||||
CONFIG_DM_REGULATOR_FIXED=y
|
||||
--
|
||||
2.53.0
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
From 2fe4ab7941f5213304c2fdcda022dd013ea81f4c Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Mon, 27 Apr 2026 16:01:13 +0300
|
||||
Subject: [PATCH 10/29] configs: airoha: en7523: enable pinctrl/gpio support
|
||||
|
||||
This enables EN7523 pin controller and gpio driver.
|
||||
Defconfig was minimized with 'make savedefconfig'.
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Reviewed-by: David Lechner <dlechner@baylibre.com>
|
||||
---
|
||||
configs/en7523_evb_defconfig | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configs/en7523_evb_defconfig b/configs/en7523_evb_defconfig
|
||||
index d3137a0ae44..8b1f3c71e9b 100644
|
||||
--- a/configs/en7523_evb_defconfig
|
||||
+++ b/configs/en7523_evb_defconfig
|
||||
@@ -54,7 +54,7 @@ CONFIG_DM_MDIO=y
|
||||
CONFIG_AIROHA_ETH=y
|
||||
CONFIG_PHY=y
|
||||
CONFIG_PINCTRL=y
|
||||
-CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_AIROHA_EN7523=y
|
||||
CONFIG_RAM=y
|
||||
CONFIG_DM_SERIAL=y
|
||||
CONFIG_SYS_NS16550=y
|
||||
--
|
||||
2.53.0
|
||||
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
From 683bc456ef47c0d63686a60bc496ab2a1122d550 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Mon, 27 Apr 2026 16:01:13 +0300
|
||||
Subject: [PATCH 11/29] arm: dts: en7523: add pinctrl/gpio support, drop legacy
|
||||
gpio support
|
||||
|
||||
This patch adds pinctrl/gpio dts nodes for airoha pinctrl driver.
|
||||
It also removes legacy gpio nodes.
|
||||
|
||||
It should not be very dangerous, because:
|
||||
* No official EN7523 gpio support present in U-Boot
|
||||
* The same driver is planned for upstream linux/openwrt
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Reviewed-by: David Lechner <dlechner@baylibre.com>
|
||||
---
|
||||
arch/arm/dts/en7523-u-boot.dtsi | 23 +++++++++++++++++++++++
|
||||
1 file changed, 23 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/dts/en7523-u-boot.dtsi b/arch/arm/dts/en7523-u-boot.dtsi
|
||||
index 62d1a724678..7866a3552e6 100644
|
||||
--- a/arch/arm/dts/en7523-u-boot.dtsi
|
||||
+++ b/arch/arm/dts/en7523-u-boot.dtsi
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
#include <dt-bindings/reset/airoha,en7523-reset.h>
|
||||
|
||||
+/delete-node/ &gpio0;
|
||||
+/delete-node/ &gpio1;
|
||||
+
|
||||
/ {
|
||||
reserved-memory {
|
||||
#address-cells = <1>;
|
||||
@@ -22,6 +25,26 @@
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
|
||||
+ system-controller@1fbf0200 {
|
||||
+ compatible = "syscon", "simple-mfd";
|
||||
+ reg = <0x1fbf0200 0xc0>;
|
||||
+
|
||||
+ en7523_pinctrl: pinctrl {
|
||||
+ compatible = "airoha,en7523-pinctrl";
|
||||
+
|
||||
+ interrupt-parent = <&gic>;
|
||||
+ interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+
|
||||
+ gpio-controller;
|
||||
+ #gpio-cells = <2>;
|
||||
+
|
||||
+ interrupt-controller;
|
||||
+ #interrupt-cells = <2>;
|
||||
+
|
||||
+ gpio-ranges = <&en7523_pinctrl 0 12 30>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
eth: ethernet@1fb50000 {
|
||||
compatible = "airoha,en7523-eth";
|
||||
reg = <0x1fb50000 0x2600>,
|
||||
--
|
||||
2.53.0
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
From 4791e708e2976c3e8bf4e69c92ccd6f1103e8f1f Mon Sep 17 00:00:00 2001
|
||||
From 8f8f6a330755301d247768af13cb53c5c325579c Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Tue, 29 Apr 2025 13:06:59 +0200
|
||||
Subject: [PATCH 01/24] airoha: add support for Airoha AN7583 SoC
|
||||
Subject: [PATCH 12/29] airoha: add support for Airoha AN7583 SoC
|
||||
|
||||
Add support for Airoha AN7583 SoC. This adds the Kconfig and Makefile
|
||||
entry for the SoC, DTSI and initial config for it. Also add the code for
|
||||
|
|
@ -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 | 80 ++++++
|
||||
configs/an7583_evb_defconfig | 79 ++++++
|
||||
include/configs/an7583.h | 19 ++
|
||||
11 files changed, 642 insertions(+)
|
||||
11 files changed, 641 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
|
||||
|
|
@ -499,10 +499,10 @@ index 00000000000..e1fda15ba37
|
|||
+ };
|
||||
+};
|
||||
diff --git a/arch/arm/mach-airoha/Kconfig b/arch/arm/mach-airoha/Kconfig
|
||||
index b9cd0a413e1..2d74e3ce902 100644
|
||||
index 4b0374001d0..72cd1454208 100644
|
||||
--- a/arch/arm/mach-airoha/Kconfig
|
||||
+++ b/arch/arm/mach-airoha/Kconfig
|
||||
@@ -28,19 +28,33 @@ config TARGET_AN7581
|
||||
@@ -29,19 +29,33 @@ config TARGET_AN7581
|
||||
Peripherals include Gigabit Ethernet, switch, USB3.0 and OTG, PCIe,
|
||||
I2S, PCM, S/PDIF, UART, SPI, I2C, IR TX/RX, and PWM.
|
||||
|
||||
|
|
@ -651,10 +651,10 @@ index 00000000000..aa73679d929
|
|||
+}
|
||||
diff --git a/configs/an7583_evb_defconfig b/configs/an7583_evb_defconfig
|
||||
new file mode 100644
|
||||
index 00000000000..d1893fff398
|
||||
index 00000000000..16466be51b2
|
||||
--- /dev/null
|
||||
+++ b/configs/an7583_evb_defconfig
|
||||
@@ -0,0 +1,80 @@
|
||||
@@ -0,0 +1,79 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_ARCH_AIROHA=y
|
||||
+CONFIG_TARGET_AN7583=y
|
||||
|
|
@ -701,7 +701,6 @@ index 00000000000..d1893fff398
|
|||
+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
|
||||
+CONFIG_DMA=y
|
||||
|
|
@ -724,7 +723,7 @@ index 00000000000..d1893fff398
|
|||
+CONFIG_AIROHA_ETH=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_AIROHA_AN7583=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
|
|
@ -761,5 +760,5 @@ index 00000000000..c865afea1a2
|
|||
+
|
||||
+#endif
|
||||
--
|
||||
2.51.0
|
||||
2.53.0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
From 2ed022130bb42e3c419a4943115144259fa3b4b6 Mon Sep 17 00:00:00 2001
|
||||
From c1a853581a4045c0ce9c51d038981c459e02a32d Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Fri, 17 Oct 2025 02:53:28 +0300
|
||||
Subject: [PATCH 02/24] arm/an7583: sync init code with an7581
|
||||
Subject: [PATCH 13/29] arm/an7583: sync init code with an7581
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
---
|
||||
|
|
@ -79,5 +79,5 @@ index 77c29290331..4cf7f8caf85 100644
|
|||
};
|
||||
struct mm_region *mem_map = an7583_mem_map;
|
||||
--
|
||||
2.51.0
|
||||
2.53.0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
From 59e3fa0d74fd36ba61a2b4e63eb6faf31b4e2396 Mon Sep 17 00:00:00 2001
|
||||
From a4e98508a271287ca3b9425916ad0aa92896bc66 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Fri, 31 Oct 2025 00:42:08 +0300
|
||||
Subject: [PATCH 03/24] arm: airoha: introduce AN7583 helpers to get SCU and
|
||||
Subject: [PATCH 14/29] arm: airoha: introduce AN7583 helpers to get SCU and
|
||||
CHIP_SCU regmaps
|
||||
|
||||
We need access SCU and CHIP_SCU regmaps in several places (clk-airoha,
|
||||
|
|
@ -79,5 +79,5 @@ index 00000000000..96f3564eec0
|
|||
+ return syscon_node_to_regmap(node);
|
||||
+}
|
||||
--
|
||||
2.51.0
|
||||
2.53.0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
From 0faf0f239a145129063a1a2c798fc97c362cc98d Mon Sep 17 00:00:00 2001
|
||||
From 42ffd5ad8caf672035084c054a707fff9fbc83cd Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Tue, 30 Sep 2025 22:15:15 +0200
|
||||
Subject: [PATCH 04/24] dt-bindings: clock: airoha: Document support for AN7583
|
||||
Subject: [PATCH 15/29] dt-bindings: clock: airoha: Document support for AN7583
|
||||
clock
|
||||
|
||||
Document support for Airoha AN7583 clock. This is based on the EN7523
|
||||
|
|
@ -28,5 +28,5 @@ index edfa64045f5..0fbbcb7b1b2 100644
|
|||
+
|
||||
#endif /* _DT_BINDINGS_CLOCK_AIROHA_EN7523_H_ */
|
||||
--
|
||||
2.51.0
|
||||
2.53.0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
From c2bc25eaebdaf865c52418ff89ece3eb6aded616 Mon Sep 17 00:00:00 2001
|
||||
From 01976be0b8fb4fd5d5f2bb28ef20f6cebded1772 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Tue, 29 Apr 2025 13:19:11 +0200
|
||||
Subject: [PATCH 05/24] clk: airoha: add support for Airoha AN7583 SoC clock
|
||||
Subject: [PATCH 16/29] clk: airoha: add support for Airoha AN7583 SoC clock
|
||||
|
||||
Add support for Airoha AN7583 SoC clock that implement more base values
|
||||
for clocks compared to AN7581.
|
||||
|
|
@ -12,7 +12,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
|||
1 file changed, 158 insertions(+)
|
||||
|
||||
diff --git a/drivers/clk/airoha/clk-airoha.c b/drivers/clk/airoha/clk-airoha.c
|
||||
index 49dbca82135..68dca6ab202 100644
|
||||
index 49dbca82135..f5c2d9f1461 100644
|
||||
--- a/drivers/clk/airoha/clk-airoha.c
|
||||
+++ b/drivers/clk/airoha/clk-airoha.c
|
||||
@@ -36,6 +36,7 @@
|
||||
|
|
@ -209,5 +209,5 @@ index 49dbca82135..68dca6ab202 100644
|
|||
};
|
||||
|
||||
--
|
||||
2.51.0
|
||||
2.53.0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
From 6b54d65d6b247d06d94c28c6df92ed5b45d7468a Mon Sep 17 00:00:00 2001
|
||||
From 62c3c0d6f4094768089a3bb50351fd0576a0c51f Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Tue, 29 Apr 2025 13:33:35 +0200
|
||||
Subject: [PATCH 06/24] reset: airoha: Add support for Airoha AN7583 reset
|
||||
Subject: [PATCH 17/29] reset: airoha: Add support for Airoha AN7583 reset
|
||||
|
||||
Adapt the Airoha reset driver to support Airoha AN7583 node structure.
|
||||
In AN7583 the register is exposed by the parent syscon hence a different
|
||||
|
|
@ -169,5 +169,5 @@ index 00000000000..be80d0e0bf5
|
|||
+
|
||||
+#endif /* __DT_BINDINGS_RESET_CONTROLLER_AIROHA_AN7583_H_ */
|
||||
--
|
||||
2.51.0
|
||||
2.53.0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
From fca7240fd0ea0b30d8b6eda68eec67d84d48f15d Mon Sep 17 00:00:00 2001
|
||||
From 8e7a468d4e3e55d64cbfe5576092f7ecb3eaa0f1 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Mon, 19 May 2025 14:29:53 +0200
|
||||
Subject: [PATCH 07/24] net: airoha: add support for Airoha AN7583
|
||||
Subject: [PATCH 18/29] 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
|
||||
|
|
@ -20,18 +20,18 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
|||
1 file changed, 91 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/airoha_eth.c b/drivers/net/airoha_eth.c
|
||||
index 3234d875887..75af93f182d 100644
|
||||
index e5d39b95cc5..863c35647b6 100644
|
||||
--- a/drivers/net/airoha_eth.c
|
||||
+++ b/drivers/net/airoha_eth.c
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <linux/dma-mapping.h>
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <linux/ethtool.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/iopoll.h>
|
||||
+#include <linux/mii.h>
|
||||
#include <linux/time.h>
|
||||
#include <asm/arch/scu-regmap.h>
|
||||
|
||||
@@ -28,6 +29,11 @@
|
||||
@@ -34,6 +35,11 @@
|
||||
#define AIROHA_MAX_NUM_RSTS 3
|
||||
#define AIROHA_MAX_NUM_XSI_RSTS 4
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ index 3234d875887..75af93f182d 100644
|
|||
#define AIROHA_MAX_PACKET_SIZE 2048
|
||||
#define AIROHA_NUM_TX_RING 1
|
||||
#define AIROHA_NUM_RX_RING 1
|
||||
@@ -78,6 +84,19 @@
|
||||
@@ -86,6 +92,19 @@
|
||||
#define SWITCH_PHY_PRE_EN BIT(15)
|
||||
#define SWITCH_PHY_END_ADDR GENMASK(12, 8)
|
||||
#define SWITCH_PHY_ST_ADDR GENMASK(4, 0)
|
||||
|
|
@ -63,7 +63,7 @@ index 3234d875887..75af93f182d 100644
|
|||
|
||||
/* FE */
|
||||
#define PSE_BASE 0x0100
|
||||
@@ -332,6 +351,12 @@ static const char * const en7581_xsi_rsts_names[] = {
|
||||
@@ -365,6 +384,12 @@ static const char * const en7581_xsi_rsts_names[] = {
|
||||
"xfp-mac",
|
||||
};
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ index 3234d875887..75af93f182d 100644
|
|||
static u32 airoha_rr(void __iomem *base, u32 offset)
|
||||
{
|
||||
return readl(base + offset);
|
||||
@@ -372,8 +397,12 @@ static u32 airoha_rmw(void __iomem *base, u32 offset, u32 mask, u32 val)
|
||||
@@ -405,8 +430,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)
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ index 3234d875887..75af93f182d 100644
|
|||
|
||||
static inline dma_addr_t dma_map_unaligned(void *vaddr, size_t len,
|
||||
enum dma_data_direction dir)
|
||||
@@ -735,6 +764,59 @@ static int airoha_switch_init(struct udevice *dev, struct airoha_eth *eth)
|
||||
@@ -809,6 +838,59 @@ 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));
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ index 3234d875887..75af93f182d 100644
|
|||
return 0;
|
||||
}
|
||||
|
||||
@@ -994,6 +1076,12 @@ static const struct airoha_eth_soc_data en7581_data = {
|
||||
@@ -1269,6 +1351,12 @@ static const struct airoha_eth_soc_data en7581_data = {
|
||||
.switch_compatible = "airoha,en7581-switch",
|
||||
};
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ index 3234d875887..75af93f182d 100644
|
|||
static const struct udevice_id airoha_eth_ids[] = {
|
||||
{ .compatible = "airoha,en7523-eth",
|
||||
.data = (ulong)&en7523_data,
|
||||
@@ -1001,6 +1089,9 @@ static const struct udevice_id airoha_eth_ids[] = {
|
||||
@@ -1276,6 +1364,9 @@ static const struct udevice_id airoha_eth_ids[] = {
|
||||
{ .compatible = "airoha,en7581-eth",
|
||||
.data = (ulong)&en7581_data,
|
||||
},
|
||||
|
|
@ -173,5 +173,5 @@ index 3234d875887..75af93f182d 100644
|
|||
};
|
||||
|
||||
--
|
||||
2.51.0
|
||||
2.53.0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
From e3acb9cf6e3e08e72e3549788a4cb35eb88ce206 Mon Sep 17 00:00:00 2001
|
||||
From e4ebf563b9917884af3b708a6a06bf2de0134273 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Mon, 19 May 2025 14:31:59 +0200
|
||||
Subject: [PATCH 08/24] airoha: add Ethernet node in AN7583 dtsi
|
||||
Subject: [PATCH 19/29] airoha: add Ethernet node in AN7583 dtsi
|
||||
|
||||
Add Ethernet node in AN7583 dtsi to add support for the integrated
|
||||
Ethernet Controller.
|
||||
|
|
@ -46,5 +46,5 @@ index e1fda15ba37..daf9886af64 100644
|
|||
compatible = "airoha,en7581-pbus-csr", "syscon";
|
||||
reg = <0x0 0x1fbe3400 0x0 0xff>;
|
||||
--
|
||||
2.51.0
|
||||
2.53.0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
From a982b2b81c8c73213915ff7ff655461fe2fe0cef Mon Sep 17 00:00:00 2001
|
||||
From 9acf80067946f14d21238fb614cee3eb20bfa664 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Mon, 19 May 2025 14:52:26 +0200
|
||||
Subject: [PATCH 09/24] airoha: add MMC node for Airoha AN7583
|
||||
Subject: [PATCH 20/29] airoha: add MMC node for Airoha AN7583
|
||||
|
||||
Add MMC node for Airoha AN7583. These follow the same node of Airoha
|
||||
AN7581.
|
||||
|
|
@ -66,5 +66,5 @@ index daf9886af64..95c9d9a9507 100644
|
|||
compatible = "ns16550";
|
||||
reg = <0x0 0x1fbf0000 0x0 0x30>;
|
||||
--
|
||||
2.51.0
|
||||
2.53.0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,89 +0,0 @@
|
|||
From 1357636b826cadf15e410b64f1c98bde930dfb4e Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 23 Oct 2025 19:07:45 +0200
|
||||
Subject: [PATCH 10/24] net: airoha: bind MDIO controller on Ethernet load
|
||||
|
||||
Bind MDIO controller on Ethernet Controller load. The Airoha AN7581 SoC
|
||||
have an integrated Switch based on MT7531 (or more saying MT7988).
|
||||
|
||||
Attach it to the mdio node in the switch node to support scanning for
|
||||
MDIO devices on the BUS with DM API.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
drivers/net/Kconfig | 1 +
|
||||
drivers/net/airoha_eth.c | 32 ++++++++++++++++++++++++++++++++
|
||||
2 files changed, 33 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
|
||||
index 544e302d600..f382a7752d5 100644
|
||||
--- a/drivers/net/Kconfig
|
||||
+++ b/drivers/net/Kconfig
|
||||
@@ -126,6 +126,7 @@ config AIROHA_ETH
|
||||
depends on ARCH_AIROHA
|
||||
select PHYLIB
|
||||
select DM_RESET
|
||||
+ select MDIO_MT7531
|
||||
help
|
||||
This Driver support Airoha Ethernet QDMA Driver
|
||||
Say Y to enable support for the Airoha Ethernet QDMA.
|
||||
diff --git a/drivers/net/airoha_eth.c b/drivers/net/airoha_eth.c
|
||||
index 75af93f182d..661b6ac19f0 100644
|
||||
--- a/drivers/net/airoha_eth.c
|
||||
+++ b/drivers/net/airoha_eth.c
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <dm.h>
|
||||
#include <dm/devres.h>
|
||||
+#include <dm/lists.h>
|
||||
#include <mapmem.h>
|
||||
#include <net.h>
|
||||
#include <regmap.h>
|
||||
@@ -1064,6 +1065,36 @@ static int arht_eth_write_hwaddr(struct udevice *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int airoha_eth_bind(struct udevice *dev)
|
||||
+{
|
||||
+ ofnode switch_node, mdio_node;
|
||||
+ struct udevice *mdio_dev;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ if (!CONFIG_IS_ENABLED(MDIO_MT7531))
|
||||
+ return 0;
|
||||
+
|
||||
+ switch_node = ofnode_by_compatible(ofnode_null(),
|
||||
+ "airoha,en7581-switch");
|
||||
+ if (!ofnode_valid(switch_node)) {
|
||||
+ debug("Warning: missing switch node\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ mdio_node = ofnode_find_subnode(switch_node, "mdio");
|
||||
+ if (!ofnode_valid(mdio_node)) {
|
||||
+ debug("Warning: missing mdio node\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ ret = device_bind_driver_to_node(dev, "mt7531-mdio", "mdio",
|
||||
+ mdio_node, &mdio_dev);
|
||||
+ if (ret)
|
||||
+ debug("Warning: failed to bind mdio controller\n");
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static const struct airoha_eth_soc_data en7523_data = {
|
||||
.xsi_rsts_names = en7523_xsi_rsts_names,
|
||||
.num_xsi_rsts = ARRAY_SIZE(en7523_xsi_rsts_names),
|
||||
@@ -1109,6 +1140,7 @@ U_BOOT_DRIVER(airoha_eth) = {
|
||||
.id = UCLASS_ETH,
|
||||
.of_match = airoha_eth_ids,
|
||||
.probe = airoha_eth_probe,
|
||||
+ .bind = airoha_eth_bind,
|
||||
.ops = &airoha_eth_ops,
|
||||
.priv_auto = sizeof(struct airoha_eth),
|
||||
.plat_auto = sizeof(struct eth_pdata),
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
From 967084a19cf6aef3a5f2a43d758e93ae1fadebbf Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Sat, 31 Jan 2026 01:06:23 +0300
|
||||
Subject: [PATCH 11/24] net: airoha_eth: fix mdio binding to switch device
|
||||
|
||||
Commit d2145a89bcf6 ("net: airoha: bind MDIO controller on Ethernet load")
|
||||
refers to non-present CONFIG_MDIO_MT7531 and non-present "mt7531-mdio"
|
||||
driver. It should use CONFIG_MDIO_MT7531_MMIO and "mt7531-mdio-mmio"
|
||||
instead.
|
||||
|
||||
Fixes: d2145a89bcf6 ("net: airoha: bind MDIO controller on Ethernet load")
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
---
|
||||
drivers/net/Kconfig | 2 +-
|
||||
drivers/net/airoha_eth.c | 4 ++--
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
|
||||
index f382a7752d5..51663580bdc 100644
|
||||
--- a/drivers/net/Kconfig
|
||||
+++ b/drivers/net/Kconfig
|
||||
@@ -126,7 +126,7 @@ config AIROHA_ETH
|
||||
depends on ARCH_AIROHA
|
||||
select PHYLIB
|
||||
select DM_RESET
|
||||
- select MDIO_MT7531
|
||||
+ select MDIO_MT7531_MMIO
|
||||
help
|
||||
This Driver support Airoha Ethernet QDMA Driver
|
||||
Say Y to enable support for the Airoha Ethernet QDMA.
|
||||
diff --git a/drivers/net/airoha_eth.c b/drivers/net/airoha_eth.c
|
||||
index 661b6ac19f0..7be4f3c074f 100644
|
||||
--- a/drivers/net/airoha_eth.c
|
||||
+++ b/drivers/net/airoha_eth.c
|
||||
@@ -1071,7 +1071,7 @@ static int airoha_eth_bind(struct udevice *dev)
|
||||
struct udevice *mdio_dev;
|
||||
int ret = 0;
|
||||
|
||||
- if (!CONFIG_IS_ENABLED(MDIO_MT7531))
|
||||
+ if (!CONFIG_IS_ENABLED(MDIO_MT7531_MMIO))
|
||||
return 0;
|
||||
|
||||
switch_node = ofnode_by_compatible(ofnode_null(),
|
||||
@@ -1087,7 +1087,7 @@ static int airoha_eth_bind(struct udevice *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
- ret = device_bind_driver_to_node(dev, "mt7531-mdio", "mdio",
|
||||
+ ret = device_bind_driver_to_node(dev, "mt7531-mdio-mmio", "mdio",
|
||||
mdio_node, &mdio_dev);
|
||||
if (ret)
|
||||
debug("Warning: failed to bind mdio controller\n");
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
From 54e56dd99f1c00eae7be5ca8c37149b8671f25d8 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Sat, 31 Jan 2026 01:06:24 +0300
|
||||
Subject: [PATCH 12/24] net: airoha_eth: use proper switch node for en7523 case
|
||||
|
||||
Commit d2145a89bcf6 ("net: airoha: bind MDIO controller on Ethernet load")
|
||||
uses "airoha,en7581-switch" dts node for finding MDIO childs. This is wrong
|
||||
for EN7523 SoC. The correct node name should be used instead.
|
||||
|
||||
Fixes: d2145a89bcf6 ("net: airoha: bind MDIO controller on Ethernet load")
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
---
|
||||
drivers/net/airoha_eth.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/airoha_eth.c b/drivers/net/airoha_eth.c
|
||||
index 7be4f3c074f..f8d7235146d 100644
|
||||
--- a/drivers/net/airoha_eth.c
|
||||
+++ b/drivers/net/airoha_eth.c
|
||||
@@ -1067,6 +1067,7 @@ static int arht_eth_write_hwaddr(struct udevice *dev)
|
||||
|
||||
static int airoha_eth_bind(struct udevice *dev)
|
||||
{
|
||||
+ struct airoha_eth_soc_data *data = (void *)dev_get_driver_data(dev);
|
||||
ofnode switch_node, mdio_node;
|
||||
struct udevice *mdio_dev;
|
||||
int ret = 0;
|
||||
@@ -1075,7 +1076,7 @@ static int airoha_eth_bind(struct udevice *dev)
|
||||
return 0;
|
||||
|
||||
switch_node = ofnode_by_compatible(ofnode_null(),
|
||||
- "airoha,en7581-switch");
|
||||
+ data->switch_compatible);
|
||||
if (!ofnode_valid(switch_node)) {
|
||||
debug("Warning: missing switch node\n");
|
||||
return 0;
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
From 9317668aa6e37152d799d7cbaf8b3ce7926b526a Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Sat, 31 Jan 2026 01:06:25 +0300
|
||||
Subject: [PATCH 13/24] net: mdio-mt7531-mmio: fix switch regs initialization
|
||||
|
||||
mdio is a child node of the switch, so to get switch base address
|
||||
we need to lookup for a parent node
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
---
|
||||
drivers/net/mdio-mt7531-mmio.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/mdio-mt7531-mmio.c b/drivers/net/mdio-mt7531-mmio.c
|
||||
index 3e325ca58da..5a0725010f2 100644
|
||||
--- a/drivers/net/mdio-mt7531-mmio.c
|
||||
+++ b/drivers/net/mdio-mt7531-mmio.c
|
||||
@@ -151,8 +151,13 @@ static const struct mdio_ops mt7531_mdio_ops = {
|
||||
static int mt7531_mdio_probe(struct udevice *dev)
|
||||
{
|
||||
struct mt7531_mdio_priv *priv = dev_get_priv(dev);
|
||||
+ ofnode switch_node;
|
||||
|
||||
- priv->switch_regs = dev_read_addr(dev);
|
||||
+ switch_node = ofnode_get_parent(dev_ofnode(dev));
|
||||
+ if (!ofnode_valid(switch_node))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ priv->switch_regs = ofnode_get_addr(switch_node);
|
||||
if (priv->switch_regs == FDT_ADDR_T_NONE)
|
||||
return -EINVAL;
|
||||
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
|
@ -1,114 +0,0 @@
|
|||
From 1a853053a3e44cae45f16b1b30da70da2629c590 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Mon, 9 Feb 2026 12:20:33 +0100
|
||||
Subject: [PATCH 14/24] net: mdio-mt7531-mmio: use common header priv struct
|
||||
|
||||
Instead of having duplicate priv struct for mdio-mt7531-mmio driver in
|
||||
both driver and header, use the one exposed by the header directly.
|
||||
|
||||
This make sure we have consistent priv struct if the driver will be
|
||||
updated in the future.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
drivers/net/mdio-mt7531-mmio.c | 24 +++++++++++-------------
|
||||
1 file changed, 11 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/mdio-mt7531-mmio.c b/drivers/net/mdio-mt7531-mmio.c
|
||||
index 5a0725010f2..930454a9b0e 100644
|
||||
--- a/drivers/net/mdio-mt7531-mmio.c
|
||||
+++ b/drivers/net/mdio-mt7531-mmio.c
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <linux/iopoll.h>
|
||||
#include <miiphy.h>
|
||||
|
||||
+#include "mdio-mt7531-mmio.h"
|
||||
+
|
||||
#define MT7531_PHY_IAC 0x701c
|
||||
#define MT7531_PHY_ACS_ST BIT(31)
|
||||
#define MT7531_MDIO_REG_ADDR_CL22 GENMASK(29, 25)
|
||||
@@ -25,11 +27,7 @@
|
||||
#define MT7531_MDIO_TIMEOUT 100000
|
||||
#define MT7531_MDIO_SLEEP 20
|
||||
|
||||
-struct mt7531_mdio_priv {
|
||||
- phys_addr_t switch_regs;
|
||||
-};
|
||||
-
|
||||
-static int mt7531_mdio_wait_busy(struct mt7531_mdio_priv *priv)
|
||||
+static int mt7531_mdio_wait_busy(struct mt7531_mdio_mmio_priv *priv)
|
||||
{
|
||||
unsigned int busy;
|
||||
|
||||
@@ -38,7 +36,7 @@ static int mt7531_mdio_wait_busy(struct mt7531_mdio_priv *priv)
|
||||
MT7531_MDIO_SLEEP, MT7531_MDIO_TIMEOUT);
|
||||
}
|
||||
|
||||
-static int mt7531_mdio_read(struct mt7531_mdio_priv *priv, int addr, int devad, int reg)
|
||||
+static int mt7531_mdio_read(struct mt7531_mdio_mmio_priv *priv, int addr, int devad, int reg)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
@@ -75,7 +73,7 @@ static int mt7531_mdio_read(struct mt7531_mdio_priv *priv, int addr, int devad,
|
||||
return val & MT7531_MDIO_RW_DATA;
|
||||
}
|
||||
|
||||
-static int mt7531_mdio_write(struct mt7531_mdio_priv *priv, int addr, int devad,
|
||||
+static int mt7531_mdio_write(struct mt7531_mdio_mmio_priv *priv, int addr, int devad,
|
||||
int reg, u16 value)
|
||||
{
|
||||
u32 val;
|
||||
@@ -115,7 +113,7 @@ static int mt7531_mdio_write(struct mt7531_mdio_priv *priv, int addr, int devad,
|
||||
|
||||
int mt7531_mdio_mmio_read(struct mii_dev *bus, int addr, int devad, int reg)
|
||||
{
|
||||
- struct mt7531_mdio_priv *priv = bus->priv;
|
||||
+ struct mt7531_mdio_mmio_priv *priv = bus->priv;
|
||||
|
||||
return mt7531_mdio_read(priv, addr, devad, reg);
|
||||
}
|
||||
@@ -123,14 +121,14 @@ int mt7531_mdio_mmio_read(struct mii_dev *bus, int addr, int devad, int reg)
|
||||
int mt7531_mdio_mmio_write(struct mii_dev *bus, int addr, int devad,
|
||||
int reg, u16 value)
|
||||
{
|
||||
- struct mt7531_mdio_priv *priv = bus->priv;
|
||||
+ struct mt7531_mdio_mmio_priv *priv = bus->priv;
|
||||
|
||||
return mt7531_mdio_write(priv, addr, devad, reg, value);
|
||||
}
|
||||
|
||||
static int dm_mt7531_mdio_read(struct udevice *dev, int addr, int devad, int reg)
|
||||
{
|
||||
- struct mt7531_mdio_priv *priv = dev_get_priv(dev);
|
||||
+ struct mt7531_mdio_mmio_priv *priv = dev_get_priv(dev);
|
||||
|
||||
return mt7531_mdio_read(priv, addr, devad, reg);
|
||||
}
|
||||
@@ -138,7 +136,7 @@ static int dm_mt7531_mdio_read(struct udevice *dev, int addr, int devad, int reg
|
||||
static int dm_mt7531_mdio_write(struct udevice *dev, int addr, int devad,
|
||||
int reg, u16 value)
|
||||
{
|
||||
- struct mt7531_mdio_priv *priv = dev_get_priv(dev);
|
||||
+ struct mt7531_mdio_mmio_priv *priv = dev_get_priv(dev);
|
||||
|
||||
return mt7531_mdio_write(priv, addr, devad, reg, value);
|
||||
}
|
||||
@@ -150,7 +148,7 @@ static const struct mdio_ops mt7531_mdio_ops = {
|
||||
|
||||
static int mt7531_mdio_probe(struct udevice *dev)
|
||||
{
|
||||
- struct mt7531_mdio_priv *priv = dev_get_priv(dev);
|
||||
+ struct mt7531_mdio_mmio_priv *priv = dev_get_priv(dev);
|
||||
ofnode switch_node;
|
||||
|
||||
switch_node = ofnode_get_parent(dev_ofnode(dev));
|
||||
@@ -169,5 +167,5 @@ U_BOOT_DRIVER(mt7531_mdio) = {
|
||||
.id = UCLASS_MDIO,
|
||||
.probe = mt7531_mdio_probe,
|
||||
.ops = &mt7531_mdio_ops,
|
||||
- .priv_auto = sizeof(struct mt7531_mdio_priv),
|
||||
+ .priv_auto = sizeof(struct mt7531_mdio_mmio_priv),
|
||||
};
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
From 25125e98275aa43023c1d311433e0dca1c12e069 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Sat, 31 Jan 2026 01:06:26 +0300
|
||||
Subject: [PATCH 15/24] configs: an7581: add mii/mdio support
|
||||
|
||||
This enables mdio/mii command support.
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
---
|
||||
configs/an7581_evb_defconfig | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/configs/an7581_evb_defconfig b/configs/an7581_evb_defconfig
|
||||
index 73af30cd693..8e2c694dbbb 100644
|
||||
--- a/configs/an7581_evb_defconfig
|
||||
+++ b/configs/an7581_evb_defconfig
|
||||
@@ -66,6 +66,9 @@ CONFIG_SPI_FLASH_STMICRO=y
|
||||
CONFIG_SPI_FLASH_WINBOND=y
|
||||
CONFIG_SPI_FLASH_MTD=y
|
||||
CONFIG_AIROHA_ETH=y
|
||||
+CONFIG_DM_MDIO=y
|
||||
+CONFIG_CMD_MII=y
|
||||
+CONFIG_CMD_MDIO=y
|
||||
CONFIG_PHY=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCONF=y
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
From 3236c124261ca9da41632762c36b86aface13b05 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Sat, 31 Jan 2026 01:06:27 +0300
|
||||
Subject: [PATCH 16/24] arm: dts: an7581: add mdio child node to switch node
|
||||
|
||||
add mdio node to be able see switch port states
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
---
|
||||
arch/arm/dts/an7581-u-boot.dtsi | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/dts/an7581-u-boot.dtsi b/arch/arm/dts/an7581-u-boot.dtsi
|
||||
index a9297ca6503..c5e24c76457 100644
|
||||
--- a/arch/arm/dts/an7581-u-boot.dtsi
|
||||
+++ b/arch/arm/dts/an7581-u-boot.dtsi
|
||||
@@ -57,6 +57,11 @@
|
||||
switch: switch@1fb58000 {
|
||||
compatible = "airoha,en7581-switch";
|
||||
reg = <0 0x1fb58000 0 0x8000>;
|
||||
+
|
||||
+ mdio: mdio {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ };
|
||||
};
|
||||
|
||||
snfi: spi@1fa10000 {
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
From 6efbdacd79d253507e62ae93358953fff6fb3173 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Sat, 31 Jan 2026 01:06:28 +0300
|
||||
Subject: [PATCH 17/24] configs: en7523: add mii/mdio support
|
||||
|
||||
This enables mdio/mii command support.
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
---
|
||||
configs/en7523_evb_defconfig | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/configs/en7523_evb_defconfig b/configs/en7523_evb_defconfig
|
||||
index 113ddb46a7f..ebd99d133c9 100644
|
||||
--- a/configs/en7523_evb_defconfig
|
||||
+++ b/configs/en7523_evb_defconfig
|
||||
@@ -51,6 +51,9 @@ CONFIG_MTD=y
|
||||
CONFIG_DM_MTD=y
|
||||
CONFIG_MTD_SPI_NAND=y
|
||||
CONFIG_AIROHA_ETH=y
|
||||
+CONFIG_DM_MDIO=y
|
||||
+CONFIG_CMD_MII=y
|
||||
+CONFIG_CMD_MDIO=y
|
||||
CONFIG_PHY=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCONF=y
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
From 3ad8d165ce15559d5cab0df0cad9559e81c995f4 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Sat, 31 Jan 2026 01:06:29 +0300
|
||||
Subject: [PATCH 18/24] arm: dts: en7523: add mdio child node to switch node
|
||||
|
||||
add mdio node to be able see switch port states
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
---
|
||||
arch/arm/dts/en7523-u-boot.dtsi | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/dts/en7523-u-boot.dtsi b/arch/arm/dts/en7523-u-boot.dtsi
|
||||
index f031f81515a..9eadaccc500 100644
|
||||
--- a/arch/arm/dts/en7523-u-boot.dtsi
|
||||
+++ b/arch/arm/dts/en7523-u-boot.dtsi
|
||||
@@ -42,6 +42,11 @@
|
||||
switch: switch@1fb58000 {
|
||||
compatible = "airoha,en7523-switch";
|
||||
reg = <0x1fb58000 0x8000>;
|
||||
+
|
||||
+ mdio: mdio {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ };
|
||||
};
|
||||
|
||||
snfi: spi@1fa10000 {
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
|
@ -1,29 +1,35 @@
|
|||
From c8d2c4c3beb5fd27a041744f0f9a6b6d5c4e1ebe Mon Sep 17 00:00:00 2001
|
||||
From 71d25a3ea404f14405df175da6e4ba257f1ad289 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Wed, 11 Feb 2026 03:26:13 +0300
|
||||
Subject: [PATCH 19/24] configs: an7583: add mii/mdio support
|
||||
Subject: [PATCH 21/29] configs: an7583: add mii/mdio support
|
||||
|
||||
This enables mdio/mii command support.
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu
|
||||
---
|
||||
configs/an7583_evb_defconfig | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
configs/an7583_evb_defconfig | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/configs/an7583_evb_defconfig b/configs/an7583_evb_defconfig
|
||||
index d1893fff398..41d98bab5de 100644
|
||||
index 16466be51b2..7178f45e3f8 100644
|
||||
--- a/configs/an7583_evb_defconfig
|
||||
+++ b/configs/an7583_evb_defconfig
|
||||
@@ -65,6 +65,9 @@ CONFIG_SPI_FLASH_STMICRO=y
|
||||
@@ -32,6 +32,7 @@ CONFIG_CMD_MTD=y
|
||||
CONFIG_CMD_SF_TEST=y
|
||||
CONFIG_CMD_SPI=y
|
||||
# CONFIG_CMD_SETEXPR is not set
|
||||
+CONFIG_CMD_MII=y
|
||||
CONFIG_CMD_PING=y
|
||||
CONFIG_CMD_EXT4=y
|
||||
CONFIG_CMD_FAT=y
|
||||
@@ -63,6 +64,7 @@ CONFIG_SPI_FLASH_SPANSION=y
|
||||
CONFIG_SPI_FLASH_STMICRO=y
|
||||
CONFIG_SPI_FLASH_WINBOND=y
|
||||
CONFIG_SPI_FLASH_MTD=y
|
||||
CONFIG_AIROHA_ETH=y
|
||||
+CONFIG_DM_MDIO=y
|
||||
+CONFIG_CMD_MII=y
|
||||
+CONFIG_CMD_MDIO=y
|
||||
CONFIG_AIROHA_ETH=y
|
||||
CONFIG_PHY=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCONF=y
|
||||
--
|
||||
2.51.0
|
||||
2.53.0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
From 7f9bbd9ed8d2e3b7dae0fbc7d2bd2b0c08a115d0 Mon Sep 17 00:00:00 2001
|
||||
From da94257c7177f860bd70c39f1c2e3a51fb391068 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Wed, 11 Feb 2026 03:29:23 +0300
|
||||
Subject: [PATCH 20/24] arm: dts: an7583: add mdio child node to switch node
|
||||
Subject: [PATCH 22/29] arm: dts: an7583: add mdio child node to switch node
|
||||
|
||||
add mdio node to be able see switch port states
|
||||
|
||||
|
|
@ -27,5 +27,5 @@ index 95c9d9a9507..d84ccf27f2c 100644
|
|||
|
||||
syscon@1fbe3400 {
|
||||
--
|
||||
2.51.0
|
||||
2.53.0
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,133 @@
|
|||
From 010279f19e681753494fc156031aed7bd663bd6a Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Tue, 30 Sep 2025 23:00:29 +0200
|
||||
Subject: [PATCH 28/38] airoha: add PCS node for AN7583
|
||||
|
||||
Add PCS node for Airoha AN7583 SoC to enable support for Serdes Ethernet
|
||||
and PON port.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
arch/arm/dts/an7583-evb.dts | 18 ++++++++++
|
||||
arch/arm/dts/an7583.dtsi | 72 +++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 90 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/dts/an7583-evb.dts b/arch/arm/dts/an7583-evb.dts
|
||||
index d02cd194e8a..714c90eadfe 100644
|
||||
--- a/arch/arm/dts/an7583-evb.dts
|
||||
+++ b/arch/arm/dts/an7583-evb.dts
|
||||
@@ -65,3 +65,21 @@
|
||||
&snfi {
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&gdm1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&gdm2 {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ managed = "in-band-status";
|
||||
+ phy-mode = "usxgmii";
|
||||
+};
|
||||
+
|
||||
+&gdm3 {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ managed = "in-band-status";
|
||||
+ phy-mode = "2500base-x";
|
||||
+};
|
||||
diff --git a/arch/arm/dts/an7583.dtsi b/arch/arm/dts/an7583.dtsi
|
||||
index d84ccf27f2c..c6c5083ee7c 100644
|
||||
--- a/arch/arm/dts/an7583.dtsi
|
||||
+++ b/arch/arm/dts/an7583.dtsi
|
||||
@@ -145,6 +145,49 @@
|
||||
reg = <0x0 0x1fa20000 0x0 0x388>;
|
||||
};
|
||||
|
||||
+ pon_pcs: pcs@1fa08000 {
|
||||
+ compatible = "airoha,an7583-pcs-pon";
|
||||
+ reg = <0x0 0x1fa08000 0x0 0x1000>,
|
||||
+ <0x0 0x1fa80000 0x0 0x60>,
|
||||
+ <0x0 0x1fa80a00 0x0 0x164>,
|
||||
+ <0x0 0x1fa84000 0x0 0x450>,
|
||||
+ <0x0 0x1fa85900 0x0 0x338>,
|
||||
+ <0x0 0x1fa86000 0x0 0x300>,
|
||||
+ <0x0 0x1fa8f000 0x0 0x1000>,
|
||||
+ <0x0 0x1fa8e000 0x0 0x1000>;
|
||||
+ reg-names = "xfi_mac", "hsgmii_an", "hsgmii_pcs",
|
||||
+ "multi_sgmii", "usxgmii",
|
||||
+ "hsgmii_rate_adp", "xfi_ana", "xfi_pma";
|
||||
+
|
||||
+ resets = <&scuclk AN7583_XPON_MAC_RST>,
|
||||
+ <&scuclk AN7583_XPON_PHY_RST>,
|
||||
+ <&scuclk AN7583_XPON_XFI_RST>;
|
||||
+ reset-names = "mac", "phy", "xfi";
|
||||
+
|
||||
+ airoha,scu = <&scuclk>;
|
||||
+ };
|
||||
+
|
||||
+ eth_pcs: pcs@1fa09000 {
|
||||
+ compatible = "airoha,an7583-pcs-eth";
|
||||
+ reg = <0x0 0x1fa09000 0x0 0x1000>,
|
||||
+ <0x0 0x1fa70000 0x0 0x60>,
|
||||
+ <0x0 0x1fa70a00 0x0 0x164>,
|
||||
+ <0x0 0x1fa74000 0x0 0x450>,
|
||||
+ <0x0 0x1fa75900 0x0 0x338>,
|
||||
+ <0x0 0x1fa76000 0x0 0x300>,
|
||||
+ <0x0 0x1fa7f000 0x0 0x1000>,
|
||||
+ <0x0 0x1fa7e000 0x0 0x1000>;
|
||||
+ reg-names = "xfi_mac", "hsgmii_an", "hsgmii_pcs",
|
||||
+ "multi_sgmii", "usxgmii",
|
||||
+ "hsgmii_rate_adp", "xfi_ana", "xfi_pma";
|
||||
+
|
||||
+ resets = <&scuclk AN7583_XSI_MAC_RST>,
|
||||
+ <&scuclk AN7583_XSI_PHY_RST>;
|
||||
+ reset-names = "mac", "phy";
|
||||
+
|
||||
+ airoha,scu = <&scuclk>;
|
||||
+ };
|
||||
+
|
||||
eth: ethernet@1fb50000 {
|
||||
compatible = "airoha,an7583-eth";
|
||||
reg = <0 0x1fb50000 0 0x2600>,
|
||||
@@ -161,6 +204,35 @@
|
||||
reset-names = "fe", "pdma", "qdma",
|
||||
"hsi0-mac", "hsi1-mac",
|
||||
"xfp-mac";
|
||||
+
|
||||
+ gdm1: ethernet@1 {
|
||||
+ compatible = "airoha,eth-mac";
|
||||
+ reg = <1>;
|
||||
+ phy-mode = "internal";
|
||||
+ status = "disabled";
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <10000>;
|
||||
+ full-duplex;
|
||||
+ pause;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gdm2: ethernet@2 {
|
||||
+ compatible = "airoha,eth-mac";
|
||||
+ reg = <2>;
|
||||
+ pcs = <&pon_pcs>;
|
||||
+
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
+ gdm3: ethernet@3 {
|
||||
+ compatible = "airoha,eth-mac";
|
||||
+ reg = <3>;
|
||||
+ pcs = <ð_pcs>;
|
||||
+
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
};
|
||||
|
||||
switch: switch@1fb58000 {
|
||||
--
|
||||
2.53.0
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
From 9382e01855870a8b54a22539b26095b54c3a9b7d Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Tue, 30 Sep 2025 23:04:15 +0200
|
||||
Subject: [PATCH 29/38] configs: enable PCS for Airoha AN7583
|
||||
|
||||
Enable PCS config for Airoha AN7583 SoC by default to enable
|
||||
support fo External PHY.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
configs/an7583_evb_defconfig | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/configs/an7583_evb_defconfig b/configs/an7583_evb_defconfig
|
||||
index 7178f45e3f8..8b076c1cfe5 100644
|
||||
--- a/configs/an7583_evb_defconfig
|
||||
+++ b/configs/an7583_evb_defconfig
|
||||
@@ -65,6 +65,7 @@ CONFIG_SPI_FLASH_STMICRO=y
|
||||
CONFIG_SPI_FLASH_WINBOND=y
|
||||
CONFIG_SPI_FLASH_MTD=y
|
||||
CONFIG_DM_MDIO=y
|
||||
+CONFIG_PCS_AIROHA_AN7583=y
|
||||
CONFIG_AIROHA_ETH=y
|
||||
CONFIG_PHY=y
|
||||
CONFIG_PINCTRL=y
|
||||
--
|
||||
2.53.0
|
||||
|
||||
|
|
@ -0,0 +1,276 @@
|
|||
From deef0e91119270603748690416f1977a8b4cc035 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Tue, 30 Sep 2025 22:20:13 +0200
|
||||
Subject: [PATCH 30/38] net: Add support for Airoha AN7583 MDIO Controller
|
||||
|
||||
The Airoha AN7583 SoC have 2 dedicated MDIO controller in the SCU
|
||||
register map. Add a dedicated driver for it ported from linux kernel.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
drivers/net/Kconfig | 7 ++
|
||||
drivers/net/Makefile | 1 +
|
||||
drivers/net/mdio-airoha.c | 221 ++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 229 insertions(+)
|
||||
create mode 100644 drivers/net/mdio-airoha.c
|
||||
|
||||
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
|
||||
index 666618681df..40b1e74a30f 100644
|
||||
--- a/drivers/net/Kconfig
|
||||
+++ b/drivers/net/Kconfig
|
||||
@@ -118,6 +118,13 @@ config AG7XXX
|
||||
This driver supports the Atheros AG7xxx Ethernet MAC. This MAC is
|
||||
present in the Atheros AR7xxx, AR9xxx and QCA9xxx MIPS chips.
|
||||
|
||||
+config MDIO_AIROHA
|
||||
+ bool "Airoha AN7583 MDIO interface support"
|
||||
+ depends on DM_MDIO
|
||||
+ help
|
||||
+ This driver supports the MDIO interface found in Airoha
|
||||
+ AN7583 SoC.
|
||||
+
|
||||
source "drivers/net/airoha/Kconfig"
|
||||
|
||||
config AIROHA_ETH
|
||||
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
|
||||
index 5e90183d090..b9dfadaf2e9 100644
|
||||
--- a/drivers/net/Makefile
|
||||
+++ b/drivers/net/Makefile
|
||||
@@ -62,6 +62,7 @@ obj-$(CONFIG_KSZ9477) += ksz9477.o
|
||||
obj-$(CONFIG_LITEETH) += liteeth.o
|
||||
obj-$(CONFIG_MACB) += macb.o
|
||||
obj-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
|
||||
+obj-$(CONFIG_MDIO_AIROHA) += mdio-airoha.o
|
||||
obj-$(CONFIG_MDIO_IPQ4019) += mdio-ipq4019.o
|
||||
obj-$(CONFIG_MDIO_MSCC_MIIM) += mdio-mscc-miim.o
|
||||
obj-$(CONFIG_MDIO_GPIO_BITBANG) += mdio_gpio.o
|
||||
diff --git a/drivers/net/mdio-airoha.c b/drivers/net/mdio-airoha.c
|
||||
new file mode 100644
|
||||
index 00000000000..ac1fb13622e
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/mdio-airoha.c
|
||||
@@ -0,0 +1,221 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/* Airoha AN7583 MDIO interface driver
|
||||
+ *
|
||||
+ * Copyright (C) 2025 Christian Marangi <ansuelsmth@gmail.com>
|
||||
+ */
|
||||
+
|
||||
+#include <clk.h>
|
||||
+#include <dm.h>
|
||||
+#include <dm/ofnode.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/bitfield.h>
|
||||
+#include <linux/time.h>
|
||||
+#include <miiphy.h>
|
||||
+#include <syscon.h>
|
||||
+#include <regmap.h>
|
||||
+#include <reset.h>
|
||||
+
|
||||
+/* MII address register definitions */
|
||||
+#define AN7583_MII_BUSY BIT(31)
|
||||
+#define AN7583_MII_RDY BIT(30) /* RO signal BUS is ready */
|
||||
+#define AN7583_MII_CL22_REG_ADDR GENMASK(29, 25)
|
||||
+#define AN7583_MII_CL45_DEV_ADDR AN7583_MII_CL22_REG_ADDR
|
||||
+#define AN7583_MII_PHY_ADDR GENMASK(24, 20)
|
||||
+#define AN7583_MII_CMD GENMASK(19, 18)
|
||||
+#define AN7583_MII_CMD_CL22_WRITE FIELD_PREP_CONST(AN7583_MII_CMD, 0x1)
|
||||
+#define AN7583_MII_CMD_CL22_READ FIELD_PREP_CONST(AN7583_MII_CMD, 0x2)
|
||||
+#define AN7583_MII_CMD_CL45_ADDR FIELD_PREP_CONST(AN7583_MII_CMD, 0x0)
|
||||
+#define AN7583_MII_CMD_CL45_WRITE FIELD_PREP_CONST(AN7583_MII_CMD, 0x1)
|
||||
+#define AN7583_MII_CMD_CL45_POSTREAD_INCADDR FIELD_PREP_CONST(AN7583_MII_CMD, 0x2)
|
||||
+#define AN7583_MII_CMD_CL45_READ FIELD_PREP_CONST(AN7583_MII_CMD, 0x3)
|
||||
+#define AN7583_MII_ST GENMASK(17, 16)
|
||||
+#define AN7583_MII_ST_CL45 FIELD_PREP_CONST(AN7583_MII_ST, 0x0)
|
||||
+#define AN7583_MII_ST_CL22 FIELD_PREP_CONST(AN7583_MII_ST, 0x1)
|
||||
+#define AN7583_MII_RWDATA GENMASK(15, 0)
|
||||
+#define AN7583_MII_CL45_REG_ADDR AN7583_MII_RWDATA
|
||||
+
|
||||
+#define AN7583_MII_MDIO_DELAY_USEC 100
|
||||
+#define AN7583_MII_MDIO_RETRY_MSEC 100
|
||||
+
|
||||
+struct airoha_mdio_data {
|
||||
+ u32 base_addr;
|
||||
+ struct regmap *regmap;
|
||||
+ struct clk *clk;
|
||||
+ struct reset_ctl *reset;
|
||||
+};
|
||||
+
|
||||
+static int airoha_mdio_wait_busy(struct airoha_mdio_data *priv)
|
||||
+{
|
||||
+ u32 busy;
|
||||
+
|
||||
+ return regmap_read_poll_timeout(priv->regmap, priv->base_addr, busy,
|
||||
+ !(busy & AN7583_MII_BUSY),
|
||||
+ AN7583_MII_MDIO_DELAY_USEC,
|
||||
+ AN7583_MII_MDIO_RETRY_MSEC * USEC_PER_MSEC);
|
||||
+}
|
||||
+
|
||||
+static void airoha_mdio_reset(struct airoha_mdio_data *priv)
|
||||
+{
|
||||
+ /* There seems to be Hardware bug where AN7583_MII_RWDATA
|
||||
+ * is not wiped in the context of unconnected PHY and the
|
||||
+ * previous read value is returned.
|
||||
+ *
|
||||
+ * Example: (only one PHY on the BUS at 0x1f)
|
||||
+ * - read at 0x1f report at 0x2 0x7500
|
||||
+ * - read at 0x0 report 0x7500 on every address
|
||||
+ *
|
||||
+ * To workaround this, we reset the Mdio BUS at every read
|
||||
+ * to have consistent values on read operation.
|
||||
+ */
|
||||
+ reset_assert(priv->reset);
|
||||
+ reset_deassert(priv->reset);
|
||||
+}
|
||||
+
|
||||
+static int airoha_mdio_read(struct udevice *dev, int addr, int devnum,
|
||||
+ int regnum)
|
||||
+{
|
||||
+ struct airoha_mdio_data *priv = dev_get_priv(dev);
|
||||
+ u32 val;
|
||||
+ int ret;
|
||||
+
|
||||
+ airoha_mdio_reset(priv);
|
||||
+
|
||||
+ if (devnum != MDIO_DEVAD_NONE) {
|
||||
+ val = AN7583_MII_BUSY | AN7583_MII_ST_CL45 |
|
||||
+ AN7583_MII_CMD_CL45_ADDR;
|
||||
+ val |= FIELD_PREP(AN7583_MII_PHY_ADDR, addr);
|
||||
+ val |= FIELD_PREP(AN7583_MII_CL45_DEV_ADDR, devnum);
|
||||
+ val |= FIELD_PREP(AN7583_MII_CL45_REG_ADDR, regnum);
|
||||
+
|
||||
+ ret = regmap_write(priv->regmap, priv->base_addr, val);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = airoha_mdio_wait_busy(priv);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ val = AN7583_MII_BUSY | FIELD_PREP(AN7583_MII_PHY_ADDR, addr);
|
||||
+ if (devnum != MDIO_DEVAD_NONE) {
|
||||
+ val |= AN7583_MII_ST_CL45 | AN7583_MII_CMD_CL45_READ;
|
||||
+ val |= FIELD_PREP(AN7583_MII_CL45_DEV_ADDR, devnum);
|
||||
+ } else {
|
||||
+ val |= AN7583_MII_ST_CL22 | AN7583_MII_CMD_CL22_READ;
|
||||
+ val |= FIELD_PREP(AN7583_MII_CL22_REG_ADDR, regnum);
|
||||
+ }
|
||||
+
|
||||
+ ret = regmap_write(priv->regmap, priv->base_addr, val);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = airoha_mdio_wait_busy(priv);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = regmap_read(priv->regmap, priv->base_addr, &val);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ return FIELD_GET(AN7583_MII_RWDATA, val);
|
||||
+}
|
||||
+
|
||||
+static int airoha_mdio_write(struct udevice *dev, int addr, int devnum,
|
||||
+ int regnum, u16 value)
|
||||
+{
|
||||
+ struct airoha_mdio_data *priv = dev_get_priv(dev);
|
||||
+ u32 val;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (devnum != MDIO_DEVAD_NONE) {
|
||||
+ val = AN7583_MII_BUSY | AN7583_MII_ST_CL45 |
|
||||
+ AN7583_MII_CMD_CL45_ADDR;
|
||||
+ val |= FIELD_PREP(AN7583_MII_PHY_ADDR, addr);
|
||||
+ val |= FIELD_PREP(AN7583_MII_CL45_DEV_ADDR, devnum);
|
||||
+ val |= FIELD_PREP(AN7583_MII_CL45_REG_ADDR, regnum);
|
||||
+
|
||||
+ ret = regmap_write(priv->regmap, priv->base_addr, val);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = airoha_mdio_wait_busy(priv);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ val = AN7583_MII_BUSY | FIELD_PREP(AN7583_MII_PHY_ADDR, addr) |
|
||||
+ FIELD_PREP(AN7583_MII_RWDATA, value);
|
||||
+ if (devnum != MDIO_DEVAD_NONE) {
|
||||
+ val |= AN7583_MII_ST_CL45 | AN7583_MII_CMD_CL45_WRITE;
|
||||
+ val |= FIELD_PREP(AN7583_MII_CL45_DEV_ADDR, devnum);
|
||||
+ } else {
|
||||
+ val |= AN7583_MII_ST_CL22 | AN7583_MII_CMD_CL22_WRITE;
|
||||
+ val |= FIELD_PREP(AN7583_MII_CL22_REG_ADDR, regnum);
|
||||
+ }
|
||||
+
|
||||
+ ret = regmap_write(priv->regmap, priv->base_addr, val);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = airoha_mdio_wait_busy(priv);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static const struct mdio_ops airoha_mdio_ops = {
|
||||
+ .read = airoha_mdio_read,
|
||||
+ .write = airoha_mdio_write,
|
||||
+};
|
||||
+
|
||||
+static int airoha_mdio_probe(struct udevice *dev)
|
||||
+{
|
||||
+ struct airoha_mdio_data *priv = dev_get_priv(dev);
|
||||
+ ofnode ofnode = dev_ofnode(dev);
|
||||
+ u32 addr, freq;
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = dev_read_u32(dev, "reg", &addr);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ priv->base_addr = addr;
|
||||
+ priv->regmap = syscon_node_to_regmap(ofnode_get_parent(ofnode));
|
||||
+
|
||||
+ priv->clk = devm_clk_get(dev, NULL);
|
||||
+ if (IS_ERR(priv->clk))
|
||||
+ return PTR_ERR(priv->clk);
|
||||
+
|
||||
+ priv->reset = devm_reset_control_get(dev, NULL);
|
||||
+ if (IS_ERR(priv->reset))
|
||||
+ return PTR_ERR(priv->reset);
|
||||
+
|
||||
+ reset_deassert(priv->reset);
|
||||
+
|
||||
+ /* Check if a custom frequency is defined in DT or default to 2.5 MHz */
|
||||
+ if (dev_read_u32(dev, "clock-frequency", &freq))
|
||||
+ freq = 2500000;
|
||||
+
|
||||
+ ret = clk_enable(priv->clk);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = clk_set_rate(priv->clk, freq);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct udevice_id airoha_mdio_dt_ids[] = {
|
||||
+ { .compatible = "airoha,an7583-mdio" },
|
||||
+ { }
|
||||
+};
|
||||
+
|
||||
+U_BOOT_DRIVER(airoha_mdio) = {
|
||||
+ .name = "airoha-mdio",
|
||||
+ .id = UCLASS_MDIO,
|
||||
+ .of_match = airoha_mdio_dt_ids,
|
||||
+ .probe = airoha_mdio_probe,
|
||||
+ .ops = &airoha_mdio_ops,
|
||||
+ .priv_auto = sizeof(struct airoha_mdio_data),
|
||||
+};
|
||||
--
|
||||
2.53.0
|
||||
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
From e4faff574f7652c1508d788d9a3fb6f6d3d07321 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Sat, 14 Feb 2026 02:55:19 +0300
|
||||
Subject: [PATCH 31/38] an7583: fix system controller mdio nodes
|
||||
|
||||
The properties 'reg' and 'clocks' should exist for the proper driver initialization.
|
||||
This patch adds missed properties and renames a bit mdio bus nodes.
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
---
|
||||
arch/arm/dts/an7583.dtsi | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/dts/an7583.dtsi b/arch/arm/dts/an7583.dtsi
|
||||
index c6c5083ee7c..2229d48ef9c 100644
|
||||
--- a/arch/arm/dts/an7583.dtsi
|
||||
+++ b/arch/arm/dts/an7583.dtsi
|
||||
@@ -260,18 +260,20 @@
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
|
||||
- mdio_0: mdio-0 {
|
||||
+ mdio_0: mdio-bus@c8 {
|
||||
compatible = "airoha,an7583-mdio";
|
||||
- resets = <&scuclk AN7583_MDIO0>;
|
||||
+ reg = <0xc8>;
|
||||
|
||||
- airoha,bus-id = <0>;
|
||||
+ clocks = <&scuclk AN7583_CLK_MDIO0>;
|
||||
+ resets = <&scuclk AN7583_MDIO0>;
|
||||
};
|
||||
|
||||
- mdio_1: mdio-1 {
|
||||
+ mdio_1: mdio-bus@cc {
|
||||
compatible = "airoha,an7583-mdio";
|
||||
- resets = <&scuclk AN7583_MDIO1>;
|
||||
+ reg = <0xcc>;
|
||||
|
||||
- airoha,bus-id = <1>;
|
||||
+ clocks = <&scuclk AN7583_CLK_MDIO1>;
|
||||
+ resets = <&scuclk AN7583_MDIO1>;
|
||||
};
|
||||
};
|
||||
|
||||
--
|
||||
2.53.0
|
||||
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
From b1a6af17ceb35295cf96e512407aacdf3daccf92 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Fri, 22 Aug 2025 15:43:56 +0200
|
||||
Subject: [PATCH 32/38] an7583: enable MDIO_AIROHA by default
|
||||
|
||||
Enable MDIO_AIROHA in the default config.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
configs/an7583_evb_defconfig | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/configs/an7583_evb_defconfig b/configs/an7583_evb_defconfig
|
||||
index 8b076c1cfe5..08bcbd52c99 100644
|
||||
--- a/configs/an7583_evb_defconfig
|
||||
+++ b/configs/an7583_evb_defconfig
|
||||
@@ -65,6 +65,7 @@ CONFIG_SPI_FLASH_STMICRO=y
|
||||
CONFIG_SPI_FLASH_WINBOND=y
|
||||
CONFIG_SPI_FLASH_MTD=y
|
||||
CONFIG_DM_MDIO=y
|
||||
+CONFIG_MDIO_AIROHA=y
|
||||
CONFIG_PCS_AIROHA_AN7583=y
|
||||
CONFIG_AIROHA_ETH=y
|
||||
CONFIG_PHY=y
|
||||
--
|
||||
2.53.0
|
||||
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
From 06a44c562647bedd0705cac8bec862877371ff1f Mon Sep 17 00:00:00 2001
|
||||
From 54483fd54b42ee7ddb23e0d69f5b59fcaec74dee Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Wed, 28 May 2025 03:10:53 +0200
|
||||
Subject: [PATCH 21/24] airoha: enable UBI support and define default partition
|
||||
Subject: [PATCH 23/29] airoha: enable UBI support and define default partition
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
arch/arm/dts/an7583-evb.dts | 22 ++++++++++++++++++++++
|
||||
arch/arm/dts/en7523-evb-u-boot.dtsi | 22 ++++++++++++++++++++++
|
||||
arch/arm/dts/en7581-evb-u-boot.dtsi | 22 ++++++++++++++++++++++
|
||||
configs/an7581_evb_defconfig | 17 +++++++++++++++++
|
||||
configs/an7583_evb_defconfig | 17 +++++++++++++++++
|
||||
configs/en7523_evb_defconfig | 20 ++++++++++++++++++--
|
||||
6 files changed, 118 insertions(+), 2 deletions(-)
|
||||
configs/an7581_evb_defconfig | 8 ++++++++
|
||||
configs/an7583_evb_defconfig | 8 ++++++++
|
||||
configs/en7523_evb_defconfig | 8 ++++++++
|
||||
6 files changed, 90 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/dts/an7583-evb.dts b/arch/arm/dts/an7583-evb.dts
|
||||
index d02cd194e8a..b3045e6e7d0 100644
|
||||
|
|
@ -47,13 +47,13 @@ index d02cd194e8a..b3045e6e7d0 100644
|
|||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pcie0_rst_pins>;
|
||||
diff --git a/arch/arm/dts/en7523-evb-u-boot.dtsi b/arch/arm/dts/en7523-evb-u-boot.dtsi
|
||||
index c109d6794fb..b74bfe2d707 100644
|
||||
index d6ab621d590..7c688b1fd97 100644
|
||||
--- a/arch/arm/dts/en7523-evb-u-boot.dtsi
|
||||
+++ b/arch/arm/dts/en7523-evb-u-boot.dtsi
|
||||
@@ -9,3 +9,25 @@
|
||||
@@ -13,3 +13,25 @@
|
||||
&gdm1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
#include "en7523-u-boot.dtsi"
|
||||
+
|
||||
+&snfi {
|
||||
+ status = "okay";
|
||||
|
|
@ -77,13 +77,13 @@ index c109d6794fb..b74bfe2d707 100644
|
|||
+ };
|
||||
+};
|
||||
diff --git a/arch/arm/dts/en7581-evb-u-boot.dtsi b/arch/arm/dts/en7581-evb-u-boot.dtsi
|
||||
index ebd3b8b4958..b9a9382e254 100644
|
||||
index 9a02122fbfa..23331b7703d 100644
|
||||
--- a/arch/arm/dts/en7581-evb-u-boot.dtsi
|
||||
+++ b/arch/arm/dts/en7581-evb-u-boot.dtsi
|
||||
@@ -9,3 +9,25 @@
|
||||
@@ -27,3 +27,25 @@
|
||||
managed = "in-band-status";
|
||||
phy-mode = "usxgmii";
|
||||
};
|
||||
|
||||
#include "an7581-u-boot.dtsi"
|
||||
+
|
||||
+&snfi {
|
||||
+ status = "okay";
|
||||
|
|
@ -107,101 +107,106 @@ index ebd3b8b4958..b9a9382e254 100644
|
|||
+ };
|
||||
+};
|
||||
diff --git a/configs/an7581_evb_defconfig b/configs/an7581_evb_defconfig
|
||||
index 8e2c694dbbb..05e37d04681 100644
|
||||
index a615994cc76..bd7440ddc76 100644
|
||||
--- a/configs/an7581_evb_defconfig
|
||||
+++ b/configs/an7581_evb_defconfig
|
||||
@@ -81,4 +81,21 @@ CONFIG_SYS_NS16550=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_DM_SPI=y
|
||||
CONFIG_AIROHA_SNFI_SPI=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
+# CONFIG_CMD_UBI_RENAME is not set
|
||||
+CONFIG_CMD_UBIFS=y
|
||||
+CONFIG_ENV_IS_IN_UBI=y
|
||||
+CONFIG_ENV_REDUNDANT=y
|
||||
+CONFIG_ENV_UBI_PART="ubi"
|
||||
+CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
+CONFIG_ENV_UBI_VID_OFFSET=0
|
||||
+CONFIG_MTD_UBI=y
|
||||
+CONFIG_MTD_UBI_MODULE=y
|
||||
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
+CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
+# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
+CONFIG_UBI_BLOCK=y
|
||||
+# CONFIG_UBIFS_SILENCE_MSG is not set
|
||||
+# CONFIG_UBIFS_SILENCE_DEBUG_DUMP is not set
|
||||
CONFIG_SHA512=y
|
||||
diff --git a/configs/an7583_evb_defconfig b/configs/an7583_evb_defconfig
|
||||
index 41d98bab5de..663d1ec52ae 100644
|
||||
--- a/configs/an7583_evb_defconfig
|
||||
+++ b/configs/an7583_evb_defconfig
|
||||
@@ -80,4 +80,21 @@ CONFIG_SYS_NS16550=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_DM_SPI=y
|
||||
CONFIG_AIROHA_SNFI_SPI=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
+# CONFIG_CMD_UBI_RENAME is not set
|
||||
+CONFIG_CMD_UBIFS=y
|
||||
+CONFIG_ENV_IS_IN_UBI=y
|
||||
+CONFIG_ENV_REDUNDANT=y
|
||||
+CONFIG_ENV_UBI_PART="ubi"
|
||||
+CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
+CONFIG_ENV_UBI_VID_OFFSET=0
|
||||
+CONFIG_MTD_UBI=y
|
||||
+CONFIG_MTD_UBI_MODULE=y
|
||||
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
+CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
+# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
+CONFIG_UBI_BLOCK=y
|
||||
+# CONFIG_UBIFS_SILENCE_MSG is not set
|
||||
+# CONFIG_UBIFS_SILENCE_DEBUG_DUMP is not set
|
||||
CONFIG_SHA512=y
|
||||
diff --git a/configs/en7523_evb_defconfig b/configs/en7523_evb_defconfig
|
||||
index ebd99d133c9..4d01e3f54fe 100644
|
||||
--- a/configs/en7523_evb_defconfig
|
||||
+++ b/configs/en7523_evb_defconfig
|
||||
@@ -5,7 +5,6 @@ CONFIG_TEXT_BASE=0x81E00000
|
||||
CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
CONFIG_NR_DRAM_BANKS=1
|
||||
CONFIG_ENV_SIZE=0x4000
|
||||
-CONFIG_ENV_OFFSET=0x7c000
|
||||
CONFIG_DM_GPIO=y
|
||||
CONFIG_DEFAULT_DEVICE_TREE="airoha/en7523-evb"
|
||||
CONFIG_SYS_LOAD_ADDR=0x81800000
|
||||
@@ -36,8 +35,8 @@ CONFIG_CMD_MTDPARTS=y
|
||||
@@ -40,10 +40,16 @@ CONFIG_CMD_FAT=y
|
||||
CONFIG_CMD_FS_GENERIC=y
|
||||
CONFIG_CMD_MTDPARTS=y
|
||||
CONFIG_CMD_LOG=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
CONFIG_OF_UPSTREAM=y
|
||||
CONFIG_ENV_OVERWRITE=y
|
||||
+# CONFIG_ENV_IS_IN_MTD is not set
|
||||
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
|
||||
-CONFIG_ENV_MTD_DEV="spi-nand0"
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_NET_RANDOM_ETHADDR=y
|
||||
CONFIG_SYS_RX_ETH_BUFFER=8
|
||||
@@ -63,4 +62,21 @@ CONFIG_SYS_NS16550=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_DM_SPI=y
|
||||
CONFIG_AIROHA_SNFI_SPI=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
+# CONFIG_CMD_UBI_RENAME is not set
|
||||
+CONFIG_CMD_UBIFS=y
|
||||
CONFIG_ENV_IS_IN_MMC=y
|
||||
# CONFIG_ENV_IS_IN_MTD is not set
|
||||
+CONFIG_ENV_IS_IN_UBI=y
|
||||
+CONFIG_ENV_REDUNDANT=y
|
||||
+CONFIG_ENV_UBI_PART="ubi"
|
||||
+CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
+CONFIG_ENV_UBI_VID_OFFSET=0
|
||||
+CONFIG_MTD_UBI=y
|
||||
+CONFIG_MTD_UBI_MODULE=y
|
||||
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
+CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
+# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_NET_RANDOM_ETHADDR=y
|
||||
@@ -67,6 +73,7 @@ CONFIG_SPI_FLASH_SPANSION=y
|
||||
CONFIG_SPI_FLASH_STMICRO=y
|
||||
CONFIG_SPI_FLASH_WINBOND=y
|
||||
CONFIG_SPI_FLASH_MTD=y
|
||||
+CONFIG_UBI_BLOCK=y
|
||||
CONFIG_DM_MDIO=y
|
||||
CONFIG_PCS_AIROHA_AN7581=y
|
||||
CONFIG_AIROHA_ETH=y
|
||||
@@ -82,4 +89,5 @@ CONFIG_SYS_NS16550=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_DM_SPI=y
|
||||
CONFIG_AIROHA_SNFI_SPI=y
|
||||
+# CONFIG_UBIFS_SILENCE_MSG is not set
|
||||
CONFIG_SHA512=y
|
||||
diff --git a/configs/an7583_evb_defconfig b/configs/an7583_evb_defconfig
|
||||
index 7178f45e3f8..7517b1a6fb3 100644
|
||||
--- a/configs/an7583_evb_defconfig
|
||||
+++ b/configs/an7583_evb_defconfig
|
||||
@@ -39,8 +39,14 @@ CONFIG_CMD_FAT=y
|
||||
CONFIG_CMD_FS_GENERIC=y
|
||||
CONFIG_CMD_MTDPARTS=y
|
||||
CONFIG_CMD_LOG=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
CONFIG_ENV_OVERWRITE=y
|
||||
CONFIG_ENV_IS_IN_MMC=y
|
||||
+CONFIG_ENV_IS_IN_UBI=y
|
||||
+CONFIG_ENV_REDUNDANT=y
|
||||
+CONFIG_ENV_UBI_PART="ubi"
|
||||
+CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_NET_RANDOM_ETHADDR=y
|
||||
@@ -64,6 +70,7 @@ CONFIG_SPI_FLASH_SPANSION=y
|
||||
CONFIG_SPI_FLASH_STMICRO=y
|
||||
CONFIG_SPI_FLASH_WINBOND=y
|
||||
CONFIG_SPI_FLASH_MTD=y
|
||||
+CONFIG_UBI_BLOCK=y
|
||||
CONFIG_DM_MDIO=y
|
||||
CONFIG_AIROHA_ETH=y
|
||||
CONFIG_PHY=y
|
||||
@@ -78,4 +85,5 @@ CONFIG_SYS_NS16550=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_DM_SPI=y
|
||||
CONFIG_AIROHA_SNFI_SPI=y
|
||||
+# CONFIG_UBIFS_SILENCE_MSG is not set
|
||||
CONFIG_SHA512=y
|
||||
diff --git a/configs/en7523_evb_defconfig b/configs/en7523_evb_defconfig
|
||||
index 8b1f3c71e9b..7f05cb63a28 100644
|
||||
--- a/configs/en7523_evb_defconfig
|
||||
+++ b/configs/en7523_evb_defconfig
|
||||
@@ -35,8 +35,14 @@ CONFIG_CMD_FAT=y
|
||||
CONFIG_CMD_FS_GENERIC=y
|
||||
CONFIG_CMD_MTDPARTS=y
|
||||
CONFIG_CMD_LOG=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
CONFIG_OF_UPSTREAM=y
|
||||
CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_UBI=y
|
||||
+CONFIG_ENV_REDUNDANT=y
|
||||
+CONFIG_ENV_UBI_PART="ubi"
|
||||
+CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
|
||||
CONFIG_ENV_MTD_DEV="spi-nand0"
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
@@ -50,6 +56,7 @@ CONFIG_LED_GPIO=y
|
||||
CONFIG_MTD=y
|
||||
CONFIG_DM_MTD=y
|
||||
CONFIG_MTD_SPI_NAND=y
|
||||
+CONFIG_UBI_BLOCK=y
|
||||
CONFIG_DM_MDIO=y
|
||||
CONFIG_AIROHA_ETH=y
|
||||
CONFIG_PHY=y
|
||||
@@ -61,4 +68,5 @@ CONFIG_SYS_NS16550=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_DM_SPI=y
|
||||
CONFIG_AIROHA_SNFI_SPI=y
|
||||
+# CONFIG_UBIFS_SILENCE_MSG is not set
|
||||
+# CONFIG_UBIFS_SILENCE_DEBUG_DUMP is not set
|
||||
CONFIG_SHA512=y
|
||||
--
|
||||
2.51.0
|
||||
2.53.0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
From 2bd435e8b2da2047ea0c5bb9b9af96bc6af2f8cd Mon Sep 17 00:00:00 2001
|
||||
From 7c6978fa5518ee3709afcee10183ae2771ad255d Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Wed, 28 May 2025 03:18:32 +0200
|
||||
Subject: [PATCH 22/24] airoha: add default configuration
|
||||
Subject: [PATCH 24/29] airoha: add default configuration
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
|
|
@ -17,38 +17,44 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
|||
create mode 100644 defenvs/en7523_rfb_env
|
||||
|
||||
diff --git a/configs/an7581_evb_defconfig b/configs/an7581_evb_defconfig
|
||||
index 05e37d04681..7633cb7ac96 100644
|
||||
index bd7440ddc76..b39ebac8f40 100644
|
||||
--- a/configs/an7581_evb_defconfig
|
||||
+++ b/configs/an7581_evb_defconfig
|
||||
@@ -98,4 +98,6 @@ 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
|
||||
@@ -51,6 +51,8 @@ CONFIG_ENV_UBI_PART="ubi"
|
||||
CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
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/an7581_rfb_env"
|
||||
CONFIG_SHA512=y
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_NET_RANDOM_ETHADDR=y
|
||||
CONFIG_SYS_RX_ETH_BUFFER=8
|
||||
diff --git a/configs/an7583_evb_defconfig b/configs/an7583_evb_defconfig
|
||||
index 663d1ec52ae..c69cf353ffa 100644
|
||||
index 7517b1a6fb3..e1d3c3b428a 100644
|
||||
--- a/configs/an7583_evb_defconfig
|
||||
+++ b/configs/an7583_evb_defconfig
|
||||
@@ -97,4 +97,6 @@ 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
|
||||
@@ -48,6 +48,8 @@ CONFIG_ENV_UBI_PART="ubi"
|
||||
CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
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/an7583_rfb_env"
|
||||
CONFIG_SHA512=y
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_NET_RANDOM_ETHADDR=y
|
||||
CONFIG_SYS_RX_ETH_BUFFER=8
|
||||
diff --git a/configs/en7523_evb_defconfig b/configs/en7523_evb_defconfig
|
||||
index 4d01e3f54fe..8febb6cabdd 100644
|
||||
index 7f05cb63a28..dd809c5f949 100644
|
||||
--- a/configs/en7523_evb_defconfig
|
||||
+++ b/configs/en7523_evb_defconfig
|
||||
@@ -79,4 +79,6 @@ 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
|
||||
@@ -45,6 +45,8 @@ CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
|
||||
CONFIG_ENV_MTD_DEV="spi-nand0"
|
||||
+CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y
|
||||
+CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/en7523_rfb_env"
|
||||
CONFIG_SHA512=y
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_NET_RANDOM_ETHADDR=y
|
||||
CONFIG_SYS_RX_ETH_BUFFER=8
|
||||
diff --git a/defenvs/an7581_rfb_env b/defenvs/an7581_rfb_env
|
||||
new file mode 100644
|
||||
index 00000000000..716ddc321e2
|
||||
|
|
@ -80,5 +86,5 @@ index 00000000000..716ddc321e2
|
|||
+serverip=192.168.1.10
|
||||
+bootargs=ubi.mtd=ubi root=/dev/ubiblock0_5 rootwait
|
||||
--
|
||||
2.51.0
|
||||
2.53.0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
From c89b8f1baa9bf4e32b9f146f5fece6f2151e2dd0 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 23/24] 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(+)
|
||||
|
||||
diff --git a/configs/an7581_evb_defconfig b/configs/an7581_evb_defconfig
|
||||
index 7633cb7ac96..afdb0cd8586 100644
|
||||
--- a/configs/an7581_evb_defconfig
|
||||
+++ b/configs/an7581_evb_defconfig
|
||||
@@ -41,6 +41,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
|
||||
diff --git a/configs/an7583_evb_defconfig b/configs/an7583_evb_defconfig
|
||||
index c69cf353ffa..c3d47c411ba 100644
|
||||
--- a/configs/an7583_evb_defconfig
|
||||
+++ b/configs/an7583_evb_defconfig
|
||||
@@ -40,6 +40,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
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
From b90921faa3ba5ef8608667c3afb61fdbd21a2fe4 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Mon, 27 Apr 2026 15:20:15 +0300
|
||||
Subject: [PATCH 25/29] configs: airoha: disable ENV_IS_IN_MTD to avoid boot panic
|
||||
|
||||
Booting image generated with
|
||||
|
||||
make an7581_evb_defconfig
|
||||
|
||||
will results in
|
||||
|
||||
U-Boot 2026.04-00924-gfb815bd8793b (Apr 27 2026 - 15:08:30 +0300)
|
||||
|
||||
CPU: Airoha AN7581
|
||||
DRAM: 512 MiB
|
||||
Core: 35 devices, 19 uclasses, devicetree: separate
|
||||
MMC: mmc@1fa0e000: 0
|
||||
Loading Environment from MMC... *** Warning - No block device, using default environment
|
||||
|
||||
Loading Environment from MTD... *** Warning - get_mtd_device_nm() failed, using default environment
|
||||
|
||||
BUG at drivers/mtd/mtdcore.c:898/__put_mtd_device()!
|
||||
BUG!
|
||||
resetting ...
|
||||
|
||||
This happens because no any mtd partition defined in dts/mtdparts.
|
||||
Disabling of ENV_IS_IN_MTD fixes an issue.
|
||||
|
||||
Fix the same for en7523 & an7583 as well.
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
---
|
||||
configs/an7583_evb_defconfig | 1 +
|
||||
configs/en7523_evb_defconfig | 3 +--
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configs/an7583_evb_defconfig b/configs/an7583_evb_defconfig
|
||||
index e1d3c3b428a..ca0422abcdb 100644
|
||||
--- a/configs/an7583_evb_defconfig
|
||||
+++ b/configs/an7583_evb_defconfig
|
||||
@@ -42,6 +42,7 @@ CONFIG_CMD_LOG=y
|
||||
CONFIG_CMD_UBI=y
|
||||
CONFIG_ENV_OVERWRITE=y
|
||||
CONFIG_ENV_IS_IN_MMC=y
|
||||
+# CONFIG_ENV_IS_IN_MTD is not set
|
||||
CONFIG_ENV_IS_IN_UBI=y
|
||||
CONFIG_ENV_REDUNDANT=y
|
||||
CONFIG_ENV_UBI_PART="ubi"
|
||||
diff --git a/configs/en7523_evb_defconfig b/configs/en7523_evb_defconfig
|
||||
index dd809c5f949..c539ba71994 100644
|
||||
--- a/configs/en7523_evb_defconfig
|
||||
+++ b/configs/en7523_evb_defconfig
|
||||
@@ -5,7 +5,6 @@ CONFIG_TEXT_BASE=0x81E00000
|
||||
CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
CONFIG_NR_DRAM_BANKS=1
|
||||
CONFIG_ENV_SIZE=0x4000
|
||||
-CONFIG_ENV_OFFSET=0x7c000
|
||||
CONFIG_DM_GPIO=y
|
||||
CONFIG_DEFAULT_DEVICE_TREE="airoha/en7523-evb"
|
||||
CONFIG_SYS_LOAD_ADDR=0x81800000
|
||||
@@ -38,13 +37,13 @@ CONFIG_CMD_LOG=y
|
||||
CONFIG_CMD_UBI=y
|
||||
CONFIG_OF_UPSTREAM=y
|
||||
CONFIG_ENV_OVERWRITE=y
|
||||
+# CONFIG_ENV_IS_IN_MTD is not set
|
||||
CONFIG_ENV_IS_IN_UBI=y
|
||||
CONFIG_ENV_REDUNDANT=y
|
||||
CONFIG_ENV_UBI_PART="ubi"
|
||||
CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
|
||||
-CONFIG_ENV_MTD_DEV="spi-nand0"
|
||||
CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y
|
||||
CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/en7523_rfb_env"
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
--
|
||||
2.53.0
|
||||
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
From 78a01bfa242139ae6b7ac487c0e857457d8ff416 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 24/24] 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 +
|
||||
configs/en7523_evb_defconfig | 1 +
|
||||
3 files changed, 3 insertions(+)
|
||||
|
||||
diff --git a/configs/an7581_evb_defconfig b/configs/an7581_evb_defconfig
|
||||
index afdb0cd8586..be076ec7723 100644
|
||||
--- 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_TARGET_AN7581=y
|
||||
CONFIG_TEXT_BASE=0x81E00000
|
||||
CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
diff --git a/configs/an7583_evb_defconfig b/configs/an7583_evb_defconfig
|
||||
index c3d47c411ba..7ef2d6feeba 100644
|
||||
--- 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
|
||||
diff --git a/configs/en7523_evb_defconfig b/configs/en7523_evb_defconfig
|
||||
index 8febb6cabdd..53011e47f55 100644
|
||||
--- a/configs/en7523_evb_defconfig
|
||||
+++ b/configs/en7523_evb_defconfig
|
||||
@@ -1,6 +1,7 @@
|
||||
CONFIG_ARM=y
|
||||
CONFIG_SYS_ARCH_TIMER=y
|
||||
CONFIG_ARCH_AIROHA=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
CONFIG_TEXT_BASE=0x81E00000
|
||||
CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
CONFIG_NR_DRAM_BANKS=1
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
From 12fa74667740e51317366c4c86b78ccf215d3421 Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
Date: Mon, 27 Apr 2026 15:18:48 +0300
|
||||
Subject: [PATCH 26/29] configs: airoha: enable position independent code
|
||||
|
||||
This enables U-Boot loading from any 4K aligned address.
|
||||
It makes U-Boot debugging a bit simpler.
|
||||
|
||||
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
|
||||
---
|
||||
configs/an7583_evb_defconfig | 1 +
|
||||
configs/en7523_evb_defconfig | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/configs/an7583_evb_defconfig b/configs/an7583_evb_defconfig
|
||||
index ca0422abcdb..1c4739d0d39 100644
|
||||
--- a/configs/an7583_evb_defconfig
|
||||
+++ b/configs/an7583_evb_defconfig
|
||||
@@ -1,4 +1,5 @@
|
||||
CONFIG_ARM=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
CONFIG_ARCH_AIROHA=y
|
||||
CONFIG_TARGET_AN7583=y
|
||||
CONFIG_TEXT_BASE=0x81E00000
|
||||
diff --git a/configs/en7523_evb_defconfig b/configs/en7523_evb_defconfig
|
||||
index c539ba71994..c85c12d438d 100644
|
||||
--- a/configs/en7523_evb_defconfig
|
||||
+++ b/configs/en7523_evb_defconfig
|
||||
@@ -1,4 +1,5 @@
|
||||
CONFIG_ARM=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
CONFIG_SYS_ARCH_TIMER=y
|
||||
CONFIG_ARCH_AIROHA=y
|
||||
CONFIG_TEXT_BASE=0x81E00000
|
||||
--
|
||||
2.53.0
|
||||
|
||||
Loading…
Reference in a new issue