Skip to contentSkip to conversation

airoha: add support for Airoha AN7583 SoC

PATCH In review Christian Marangi 3 participants 4 messages Aug 21 – Sep 2

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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 CPU and RAM initialization. Everything is mostly based on AN7581 that share lots of common piece.

---
Changes v2:
- Rebase on top of next

 arch/arm/dts/an7583-evb.dts          |  67 +++++
 arch/arm/dts/an7583.dtsi             | 387 +++++++++++++++++++++++++++
 arch/arm/mach-airoha/Kconfig         |  14 +
 arch/arm/mach-airoha/Makefile        |   1 +
 arch/arm/mach-airoha/an7583/Makefile |   3 +
 arch/arm/mach-airoha/an7583/init.c   |  66 +++++
 board/airoha/an7583/MAINTAINERS      |   5 +
 board/airoha/an7583/Makefile         |   3 +
 board/airoha/an7583/an7583_rfb.c     |  16 ++
 configs/an7583_evb_defconfig         |  79 ++++++
 include/configs/an7583.h             |  19 ++
 11 files changed, 660 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
 create mode 100644 arch/arm/mach-airoha/an7583/init.c
 create mode 100644 board/airoha/an7583/MAINTAINERS
 create mode 100644 board/airoha/an7583/Makefile
 create mode 100644 board/airoha/an7583/an7583_rfb.c
 create mode 100644 configs/an7583_evb_defconfig
 create mode 100644 include/configs/an7583.h
arch/arm/dts/an7583-evb.dts new file +67 -0
new file mode 100644
index 000000000000..d02cd194e8a3
@@ -0,0 +1,67 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/dts-v1/;
+
+/* Bootloader installs ATF here */
+/memreserve/ 0x80000000 0x200000;
+
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include "an7583.dtsi"
+
+/ {
+	model = "Airoha AN7583 Evaluation Board";
+	compatible = "airoha,an7583-evb", "airoha,an7583", "airoha,en7583";
+
+	aliases {
+		serial0 = &uart1;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200 earlycon";
+		stdout-path = "serial0:115200n8";
+		linux,usable-memory-range = <0x0 0x80200000 0x0 0x1fe00000>;
+	};
+
+	/* When running as a first-stage bootloader this isn't filled in automatically */
+	memory@80000000 {
+		device_type = "memory";
+		reg = <0x0 0x80000000 0x0 0x20000000>;
+	};
+};
+
+&an7583_pinctrl {
+	pcie0_rst_pins: pcie0-rst-pins {
+		conf {
+			pins = "pcie_reset0";
+			drive-open-drain = <1>;
+		};
+	};
+
+	pcie1_rst_pins: pcie1-rst-pins {
+		conf {
+			pins = "pcie_reset1";
+			drive-open-drain = <1>;
+		};
+	};
+};
+
+&pcie0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie0_rst_pins>;
+	status = "okay";
+};
+
+&pcie1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie1_rst_pins>;
+	status = "okay";
+};
+
+&i2c0 {
+	status = "okay";
+};
+
+&snfi {
+	status = "okay";
+};
arch/arm/dts/an7583.dtsi new file +387 -0

387 lines not on this page · raw message

arch/arm/mach-airoha/Kconfig +14 -0
index 4b0374001d0c..72cd14542086 100644
@@ -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.
 
+config TARGET_AN7583
+	bool "Airoha AN7583 SoC"
+	select ARM64
+	help
+	  The Airoha AN7583 is a ARM-based SoC with a quad-core Cortex-A7
+	  including NEON and GPU, Mali-450 graphics, several DDR3 options,
+	  crypto engine, built-in Wi-Fi / Bluetooth combo chip, JPEG decoder,
+	  video interfaces supporting HDMI and MIPI, and video codec support.
+	  Peripherals include Gigabit Ethernet, switch, USB3.0 and OTG, PCIe,
+	  I2S, PCM, S/PDIF, UART, SPI, I2C, IR TX/RX, and PWM.
+
 endchoice
 
 config SYS_SOC
 	default "en7523" if TARGET_EN7523
 	default "an7581" if TARGET_AN7581
+	default "an7583" if TARGET_AN7583
 
 config SYS_BOARD
 	default "en7523" if TARGET_EN7523
 	default "an7581" if TARGET_AN7581
+	default "an7583" if TARGET_AN7583
 
 config SYS_CONFIG_NAME
 	default "en7523" if TARGET_EN7523
 	default "an7581" if TARGET_AN7581
+	default "an7583" if TARGET_AN7583
 
 endif
 
arch/arm/mach-airoha/Makefile +1 -0
index 91395b8a8503..51d82ea3e217 100644
@@ -4,3 +4,4 @@ obj-y	+= cpu.o
 
 obj-$(CONFIG_TARGET_EN7523) += en7523/
 obj-$(CONFIG_TARGET_AN7581) += an7581/
+obj-$(CONFIG_TARGET_AN7583) += an7583/
arch/arm/mach-airoha/an7583/Makefile new file +3 -0
new file mode 100644
index 000000000000..886ab7e4eb9f
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier:	GPL-2.0
+
+obj-y += init.o
arch/arm/mach-airoha/an7583/init.c new file +66 -0

66 lines not on this page · raw message

board/airoha/an7583/MAINTAINERS new file +5 -0
new file mode 100644
index 000000000000..71ee542a8bcb
@@ -0,0 +1,5 @@
+AN7581
+M:	Christian Marangi <[email protected]>
+S:	Maintained
+N:      airoha
+N:      an7583
board/airoha/an7583/Makefile new file +3 -0
new file mode 100644
index 000000000000..d582684d1f7f
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier:	GPL-2.0
+
+obj-y	+= an7583_rfb.o
board/airoha/an7583/an7583_rfb.c new file +16 -0
new file mode 100644
index 000000000000..aa73679d929e
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Author: Christian Marangi <[email protected]>
+ */
+
+#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;
+}
configs/an7583_evb_defconfig new file +79 -0

79 lines not on this page · raw message

include/configs/an7583.h new file +19 -0
new file mode 100644
index 000000000000..c865afea1a2a
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Configuration for Airoha AN7583
+ */
+
+#ifndef __AN7583_H
+#define __AN7583_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
Signature · 1 line
2.53.0
#1 lore raw
Quoted 10 lines · Christian Marangi

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 CPU and RAM initialization. Everything is mostly based on AN7581 that share lots of common piece.

---
Changes v2:
- Rebase on top of next

I see:
aarch64: + an7583_evb
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c: In function 'dram_init_banksize':
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c:26:15: error: 'struct bd_info' has no member named 'bi_dram'
+(an7583_evb) 26 | gd->bd->bi_dram[0].start = gd->ram_base;
+(an7583_evb) | ^~
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c:27:15: error: 'struct bd_info' has no member named 'bi_dram'
+(an7583_evb) 27 | gd->bd->bi_dram[0].size = get_effective_memsize();
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c:30:23: error: 'struct bd_info' has no member named 'bi_dram'
+(an7583_evb) 30 | gd->bd->bi_dram[1].start = gd->ram_base + SZ_2G;
+(an7583_evb) | ^~
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c:31:23: error: 'struct bd_info' has no member named 'bi_dram'
+(an7583_evb) 31 | gd->bd->bi_dram[1].size = gd->ram_size - SZ_2G;
+(an7583_evb) make[3]: *** [scripts/Makefile.build:272: arch/arm/mach-airoha/an7583/init.o] Error 1 +(an7583_evb) make[2]: *** [scripts/Makefile.build:497: arch/arm/mach-airoha/an7583] Error 2 +(an7583_evb) make[1]: *** [Makefile:2221: arch/arm/mach-airoha] Error 2
+(an7583_evb) drivers/clk/airoha/clk-airoha.c:19:10: fatal error: asm/arch/scu-regmap.h: No such file or directory
+(an7583_evb) 19 | #include <asm/arch/scu-regmap.h>
+(an7583_evb) | ^~~~~~~~~~~~~~~~~~~~~~~
+(an7583_evb) compilation terminated.
+(an7583_evb) make[4]: *** [scripts/Makefile.build:272: drivers/clk/airoha/clk-airoha.o] Error 1 +(an7583_evb) make[3]: *** [scripts/Makefile.build:497: drivers/clk/airoha] Error 2 +(an7583_evb) make[2]: *** [scripts/Makefile.build:497: drivers/clk] Error 2
+(an7583_evb) make[1]: *** [Makefile:2221: drivers] Error 2
+(an7583_evb) make: *** [Makefile:189: __sub-make] Error 2

    0    0    1 /1              an7583_evb

When trying to build on current next, please look in to this, thanks.

Signature · 1 line
Tom
#2 lore raw

Tom, could you use


https://lore.kernel.org/u-boot/[email protected]/

instead of this patch?

The above patch series based on the same commit, but provides much more complete an7583 support.
Changes from above patch:
 * fixed arch/arm/mach-airoha/an7583/init.c compilation issue
 * added an7583 specific helper needed for clk-airoha
 * patches for proper support of clk, reset, network

Regards,
Mikhail Kshevetskiy

Quoted 41 lines · Tom Rini
Quoted 10 lines · Christian Marangi

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 CPU and RAM initialization. Everything is mostly based on AN7581 that share lots of common piece.

---
Changes v2:
- Rebase on top of next

I see:

   aarch64:  +   an7583_evb
(quoted diff) +23 -0
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c: In function 'dram_init_banksize':
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c:26:15: error: 'struct bd_info' has no member named 'bi_dram'
+(an7583_evb)    26 |         gd->bd->bi_dram[0].start = gd->ram_base;
+(an7583_evb)       |               ^~
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c:27:15: error: 'struct bd_info' has no member named 'bi_dram'
+(an7583_evb)    27 |         gd->bd->bi_dram[0].size = get_effective_memsize();
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c:30:23: error: 'struct bd_info' has no member named 'bi_dram'
+(an7583_evb)    30 |                 gd->bd->bi_dram[1].start = gd->ram_base + SZ_2G;
+(an7583_evb)       |                       ^~
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c:31:23: error: 'struct bd_info' has no member named 'bi_dram'
+(an7583_evb)    31 |                 gd->bd->bi_dram[1].size = gd->ram_size - SZ_2G;
+(an7583_evb) make[3]: *** [scripts/Makefile.build:272: arch/arm/mach-airoha/an7583/init.o] Error 1
+(an7583_evb) make[2]: *** [scripts/Makefile.build:497: arch/arm/mach-airoha/an7583] Error 2
+(an7583_evb) make[1]: *** [Makefile:2221: arch/arm/mach-airoha] Error 2
+(an7583_evb) drivers/clk/airoha/clk-airoha.c:19:10: fatal error: asm/arch/scu-regmap.h: No such file or directory
+(an7583_evb)    19 | #include <asm/arch/scu-regmap.h>
+(an7583_evb)       |          ^~~~~~~~~~~~~~~~~~~~~~~
+(an7583_evb) compilation terminated.
+(an7583_evb) make[4]: *** [scripts/Makefile.build:272: drivers/clk/airoha/clk-airoha.o] Error 1
+(an7583_evb) make[3]: *** [scripts/Makefile.build:497: drivers/clk/airoha] Error 2
+(an7583_evb) make[2]: *** [scripts/Makefile.build:497: drivers/clk] Error 2
+(an7583_evb) make[1]: *** [Makefile:2221: drivers] Error 2
+(an7583_evb) make: *** [Makefile:189: __sub-make] Error 2
    0    0    1 /1              an7583_evb

When trying to build on current next, please look in to this, thanks.

#3 lore raw
Quoted 5 lines · Mikhail Kshevetskiy

Tom, could you use


https://lore.kernel.org/u-boot/[email protected]/

Quoted 8 lines

instead of this patch?

The above patch series based on the same commit, but provides much more complete an7583 support.
Changes from above patch:
 * fixed arch/arm/mach-airoha/an7583/init.c compilation issue
 * added an7583 specific helper needed for clk-airoha
 * patches for proper support of clk, reset, network

I will look at that series instead, thanks.

Quoted 46 lines

Regards,
Mikhail Kshevetskiy

Quoted 41 lines · Tom Rini
Quoted 10 lines · Christian Marangi

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 CPU and RAM initialization. Everything is mostly based on AN7581 that share lots of common piece.

---
Changes v2:
- Rebase on top of next

I see:

   aarch64:  +   an7583_evb
(quoted diff) +23 -0
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c: In function 'dram_init_banksize':
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c:26:15: error: 'struct bd_info' has no member named 'bi_dram'
+(an7583_evb)    26 |         gd->bd->bi_dram[0].start = gd->ram_base;
+(an7583_evb)       |               ^~
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c:27:15: error: 'struct bd_info' has no member named 'bi_dram'
+(an7583_evb)    27 |         gd->bd->bi_dram[0].size = get_effective_memsize();
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c:30:23: error: 'struct bd_info' has no member named 'bi_dram'
+(an7583_evb)    30 |                 gd->bd->bi_dram[1].start = gd->ram_base + SZ_2G;
+(an7583_evb)       |                       ^~
+(an7583_evb) arch/arm/mach-airoha/an7583/init.c:31:23: error: 'struct bd_info' has no member named 'bi_dram'
+(an7583_evb)    31 |                 gd->bd->bi_dram[1].size = gd->ram_size - SZ_2G;
+(an7583_evb) make[3]: *** [scripts/Makefile.build:272: arch/arm/mach-airoha/an7583/init.o] Error 1
+(an7583_evb) make[2]: *** [scripts/Makefile.build:497: arch/arm/mach-airoha/an7583] Error 2
+(an7583_evb) make[1]: *** [Makefile:2221: arch/arm/mach-airoha] Error 2
+(an7583_evb) drivers/clk/airoha/clk-airoha.c:19:10: fatal error: asm/arch/scu-regmap.h: No such file or directory
+(an7583_evb)    19 | #include <asm/arch/scu-regmap.h>
+(an7583_evb)       |          ^~~~~~~~~~~~~~~~~~~~~~~
+(an7583_evb) compilation terminated.
+(an7583_evb) make[4]: *** [scripts/Makefile.build:272: drivers/clk/airoha/clk-airoha.o] Error 1
+(an7583_evb) make[3]: *** [scripts/Makefile.build:497: drivers/clk/airoha] Error 2
+(an7583_evb) make[2]: *** [scripts/Makefile.build:497: drivers/clk] Error 2
+(an7583_evb) make[1]: *** [Makefile:2221: drivers] Error 2
+(an7583_evb) make: *** [Makefile:189: __sub-make] Error 2
    0    0    1 /1              an7583_evb

When trying to build on current next, please look in to this, thanks.

Signature · 1 line
Tom