arm/airoha: add support for airoha en7523 SoC family
authorMikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Sat, 1 Nov 2025 00:44:46 +0000 (03:44 +0300)
committerTom Rini <trini@konsulko.com>
Fri, 7 Nov 2025 22:00:58 +0000 (16:00 -0600)
Basic support for en7523/en7529/en7562 SoCs. Within a patch
only serial console will be supported.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
arch/arm/dts/en7523-evb-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/en7523-u-boot.dtsi [new file with mode: 0644]
arch/arm/mach-airoha/Kconfig
arch/arm/mach-airoha/Makefile
arch/arm/mach-airoha/en7523/Makefile [new file with mode: 0644]
arch/arm/mach-airoha/en7523/init.c [new file with mode: 0644]
board/airoha/en7523/Makefile [new file with mode: 0644]
board/airoha/en7523/en7523_rfb.c [new file with mode: 0644]
configs/en7523_evb_defconfig [new file with mode: 0644]
include/configs/en7523.h [new file with mode: 0644]

diff --git a/arch/arm/dts/en7523-evb-u-boot.dtsi b/arch/arm/dts/en7523-evb-u-boot.dtsi
new file mode 100644 (file)
index 0000000..c109d67
--- /dev/null
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/ {
+       /* When running as a first-stage bootloader this isn't filled in automatically */
+       memory@80000000 {
+               device_type = "memory";
+               reg = <0x80000000 0x10000000>;
+       };
+};
+
+#include "en7523-u-boot.dtsi"
diff --git a/arch/arm/dts/en7523-u-boot.dtsi b/arch/arm/dts/en7523-u-boot.dtsi
new file mode 100644 (file)
index 0000000..34fa806
--- /dev/null
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/ {
+       reserved-memory {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               atf-reserved-memory@80000000 {
+                       no-map;
+                       reg = <0x80000000 0x40000>;
+               };
+       };
+
+       scu: system-controller@1fa20000 {
+               compatible = "airoha,en7523-scu";
+               reg = <0x1fa20000 0x400>,
+                     <0x1fb00000 0x1000>;
+               #clock-cells = <1>;
+       };
+
+};
+
+&uart1 {
+       bootph-all;
+};
index be3562a..b9cd0a4 100644 (file)
@@ -6,6 +6,17 @@ config SYS_VENDOR
 choice
        prompt "Airoha board select"
 
+config TARGET_EN7523
+       bool "Airoha EN7523 SoC"
+       select CPU_V7A
+       select ARMV7_SET_CORTEX_SMPEN
+       help
+         The Airoha EN7523 family (en7523/en7529/en7562) is an ARM-based
+         SoCs with a dual-core CPU. It comes with Wi-Fi 5/6 support and
+         connectivity to Ethernet PHY, DDR, PCIe, USB, UART and VoIP.
+         With advanced hardware design, EN7523 provides high processing
+         performance and low power consumption.
+
 config TARGET_AN7581
        bool "Airoha AN7581 SoC"
        select ARM64
@@ -20,12 +31,15 @@ config TARGET_AN7581
 endchoice
 
 config SYS_SOC
+       default "en7523" if TARGET_EN7523
        default "an7581" if TARGET_AN7581
 
 config SYS_BOARD
+       default "en7523" if TARGET_EN7523
        default "an7581" if TARGET_AN7581
 
 config SYS_CONFIG_NAME
+       default "en7523" if TARGET_EN7523
        default "an7581" if TARGET_AN7581
 
 endif
index 215a300..91395b8 100644 (file)
@@ -2,4 +2,5 @@
 
 obj-y  += cpu.o
 
+obj-$(CONFIG_TARGET_EN7523) += en7523/
 obj-$(CONFIG_TARGET_AN7581) += an7581/
diff --git a/arch/arm/mach-airoha/en7523/Makefile b/arch/arm/mach-airoha/en7523/Makefile
new file mode 100644 (file)
index 0000000..886ab7e
--- /dev/null
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier:     GPL-2.0
+
+obj-y += init.o
diff --git a/arch/arm/mach-airoha/en7523/init.c b/arch/arm/mach-airoha/en7523/init.c
new file mode 100644 (file)
index 0000000..c1c1eea
--- /dev/null
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Author: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
+ */
+#include <fdtdec.h>
+#include <init.h>
+#include <sysreset.h>
+#include <asm/system.h>
+#include <linux/io.h>
+
+int print_cpuinfo(void)
+{
+       printf("CPU:   Airoha EN7523/EN7529/EN7562\n");
+       return 0;
+}
+
+int dram_init(void)
+{
+       return fdtdec_setup_mem_size_base();
+}
+
+int dram_init_banksize(void)
+{
+       return fdtdec_setup_memory_banksize();
+}
+
+void __noreturn reset_cpu(void)
+{
+       writel(0x80000000, 0x1FB00040);
+       while (1) {
+               /* loop forever */
+       }
+}
diff --git a/board/airoha/en7523/Makefile b/board/airoha/en7523/Makefile
new file mode 100644 (file)
index 0000000..c662948
--- /dev/null
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier:     GPL-2.0
+
+obj-y  += en7523_rfb.o
diff --git a/board/airoha/en7523/en7523_rfb.c b/board/airoha/en7523/en7523_rfb.c
new file mode 100644 (file)
index 0000000..aa73679
--- /dev/null
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Author: Christian Marangi <ansuelsmth@gmail.com>
+ */
+
+#include <asm/global_data.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_init(void)
+{
+       /* address of boot parameters */
+       gd->bd->bi_boot_params = CFG_SYS_SDRAM_BASE + 0x100;
+
+       return 0;
+}
diff --git a/configs/en7523_evb_defconfig b/configs/en7523_evb_defconfig
new file mode 100644 (file)
index 0000000..0730136
--- /dev/null
@@ -0,0 +1,57 @@
+CONFIG_ARM=y
+CONFIG_SYS_ARCH_TIMER=y
+CONFIG_ARCH_AIROHA=y
+CONFIG_TARGET_EN7523=y
+CONFIG_TEXT_BASE=0x81E00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="airoha/en7523-evb"
+CONFIG_SYS_LOAD_ADDR=0x81800000
+CONFIG_BUILD_TARGET="u-boot.bin"
+# CONFIG_EFI_LOADER is not set
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_BOOTDELAY=3
+CONFIG_DEFAULT_FDT_FILE="en7523-evb"
+CONFIG_SYS_PBSIZE=1049
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="U-Boot> "
+CONFIG_SYS_MAXARGS=8
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_BOOTMENU=y
+# CONFIG_CMD_ELF is not set
+# CONFIG_CMD_XIMG is not set
+CONFIG_CMD_BIND=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_MTD=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_PING=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_LOG=y
+CONFIG_OF_UPSTREAM=y
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_NOWHERE=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
+CONFIG_SYS_RX_ETH_BUFFER=8
+CONFIG_REGMAP=y
+CONFIG_DMA=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+# CONFIG_MMC is not set
+CONFIG_MTD=y
+CONFIG_DM_MTD=y
+CONFIG_PINCTRL=y
+CONFIG_PINCONF=y
+CONFIG_RAM=y
+CONFIG_DM_SERIAL=y
+CONFIG_SYS_NS16550=y
+CONFIG_SHA512=y
diff --git a/include/configs/en7523.h b/include/configs/en7523.h
new file mode 100644 (file)
index 0000000..2d27b36
--- /dev/null
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Configuration for Airoha EN7523
+ *
+ * Author: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
+ */
+
+#ifndef __EN7523_H
+#define __EN7523_H
+
+#include <linux/sizes.h>
+
+#define CFG_SYS_UBOOT_BASE             CONFIG_TEXT_BASE
+
+#define CFG_SYS_INIT_RAM_ADDR           CONFIG_TEXT_BASE
+#define CFG_SYS_INIT_RAM_SIZE           SZ_2M
+
+/* DRAM */
+#define CFG_SYS_SDRAM_BASE             0x80000000
+
+#endif