blob: f76f449cb6d368494262b056318092c33fe3d93b [file] [log] [blame]
Andrew Geisslerea144b032023-01-27 16:03:57 -06001From 70cf3f7498e98a98b21804f577f3b850018894da Mon Sep 17 00:00:00 2001
Brad Bishopbec4ebc2022-08-03 09:55:16 -04002From: Rui Miguel Silva <rui.silva@linaro.org>
3Date: Wed, 8 Jan 2020 09:48:11 +0000
4Subject: [PATCH 2/2] board: arm: add corstone500 board
5
6Upstream-Status: Pending [Not submitted to upstream yet]
7Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
8
9Add support for the Arm corstone500 platform, with a cortex-a5
10chip, add the default configuration, initialization and
11makefile for this system.
12
13Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Brad Bishopbec4ebc2022-08-03 09:55:16 -040014---
15 arch/arm/Kconfig | 10 +++
16 board/armltd/corstone500/Kconfig | 12 +++
17 board/armltd/corstone500/Makefile | 8 ++
Andrew Geisslerea144b032023-01-27 16:03:57 -060018 board/armltd/corstone500/corstone500.c | 48 ++++++++++++
19 configs/corstone500_defconfig | 41 ++++++++++
20 include/configs/corstone500.h | 102 +++++++++++++++++++++++++
21 6 files changed, 221 insertions(+)
Brad Bishopbec4ebc2022-08-03 09:55:16 -040022 create mode 100644 board/armltd/corstone500/Kconfig
23 create mode 100644 board/armltd/corstone500/Makefile
24 create mode 100644 board/armltd/corstone500/corstone500.c
25 create mode 100644 configs/corstone500_defconfig
26 create mode 100644 include/configs/corstone500.h
27
28diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
Andrew Geisslerea144b032023-01-27 16:03:57 -060029index 82cd456f51f1..a925e7759ee8 100644
Brad Bishopbec4ebc2022-08-03 09:55:16 -040030--- a/arch/arm/Kconfig
31+++ b/arch/arm/Kconfig
Andrew Geisslerea144b032023-01-27 16:03:57 -060032@@ -1349,6 +1349,15 @@ config TARGET_CORSTONE1000
33 select PL01X_SERIAL
34 select DM
Brad Bishopbec4ebc2022-08-03 09:55:16 -040035
36+config TARGET_CORSTONE500
37+ bool "Support Corstone500"
38+ select CPU_V7A
39+ select SEMIHOSTING
40+ select PL01X_SERIAL
41+ help
42+ This enables support for Corstone500 ARM which is a
43+ Cortex-A5 system
44+
Andrew Geisslerea144b032023-01-27 16:03:57 -060045 config TARGET_TOTAL_COMPUTE
46 bool "Support Total Compute Platform"
47 select ARM64
48@@ -2302,6 +2311,7 @@ source "board/bosch/shc/Kconfig"
Brad Bishopbec4ebc2022-08-03 09:55:16 -040049 source "board/bosch/guardian/Kconfig"
50 source "board/Marvell/octeontx/Kconfig"
51 source "board/Marvell/octeontx2/Kconfig"
52+source "board/armltd/corstone500/Kconfig"
53 source "board/armltd/vexpress/Kconfig"
54 source "board/armltd/vexpress64/Kconfig"
55 source "board/cortina/presidio-asic/Kconfig"
56diff --git a/board/armltd/corstone500/Kconfig b/board/armltd/corstone500/Kconfig
57new file mode 100644
Patrick Williams92b42cb2022-09-03 06:53:57 -050058index 000000000000..8e689bd1fdc8
Brad Bishopbec4ebc2022-08-03 09:55:16 -040059--- /dev/null
60+++ b/board/armltd/corstone500/Kconfig
61@@ -0,0 +1,12 @@
62+if TARGET_CORSTONE500
63+
64+config SYS_BOARD
65+ default "corstone500"
66+
67+config SYS_VENDOR
68+ default "armltd"
69+
70+config SYS_CONFIG_NAME
71+ default "corstone500"
72+
73+endif
74diff --git a/board/armltd/corstone500/Makefile b/board/armltd/corstone500/Makefile
75new file mode 100644
Patrick Williams92b42cb2022-09-03 06:53:57 -050076index 000000000000..6598fdd3ae0d
Brad Bishopbec4ebc2022-08-03 09:55:16 -040077--- /dev/null
78+++ b/board/armltd/corstone500/Makefile
79@@ -0,0 +1,8 @@
80+# SPDX-License-Identifier: GPL-2.0+
81+#
82+# (C) Copyright 2022 ARM Limited
83+# (C) Copyright 2022 Linaro
84+# Rui Miguel Silva <rui.silva@linaro.org>
85+#
86+
87+obj-y := corstone500.o
88diff --git a/board/armltd/corstone500/corstone500.c b/board/armltd/corstone500/corstone500.c
89new file mode 100644
Patrick Williams92b42cb2022-09-03 06:53:57 -050090index 000000000000..e878f5c6a521
Brad Bishopbec4ebc2022-08-03 09:55:16 -040091--- /dev/null
92+++ b/board/armltd/corstone500/corstone500.c
93@@ -0,0 +1,48 @@
94+// SPDX-License-Identifier: GPL-2.0+
95+/*
96+ * (C) Copyright 2022 ARM Limited
97+ * (C) Copyright 2022 Linaro
98+ * Rui Miguel Silva <rui.silva@linaro.org>
99+ */
100+
101+#include <common.h>
102+#include <dm.h>
103+#include <dm/platform_data/serial_pl01x.h>
104+#include <malloc.h>
105+#include <asm/global_data.h>
106+
107+static const struct pl01x_serial_plat serial_platdata = {
108+ .base = V2M_UART0,
109+ .type = TYPE_PL011,
110+ .clock = CONFIG_PL011_CLOCK,
111+};
112+
113+U_BOOT_DRVINFO(corstone500_serials) = {
114+ .name = "serial_pl01x",
115+ .plat = &serial_platdata,
116+};
117+
118+int board_init(void)
119+{
120+ return 0;
121+}
122+
123+int dram_init(void)
124+{
125+ gd->ram_size = PHYS_SDRAM_1_SIZE;
126+
127+ return 0;
128+}
129+
130+int dram_init_banksize(void)
131+{
132+ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
133+ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
134+
135+ return 0;
136+}
137+
138+void reset_cpu(ulong addr)
139+{
140+}
141+
142diff --git a/configs/corstone500_defconfig b/configs/corstone500_defconfig
143new file mode 100644
Andrew Geisslerea144b032023-01-27 16:03:57 -0600144index 000000000000..e475cbe7e40d
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400145--- /dev/null
146+++ b/configs/corstone500_defconfig
Andrew Geisslerea144b032023-01-27 16:03:57 -0600147@@ -0,0 +1,41 @@
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400148+CONFIG_ARM=y
149+CONFIG_SKIP_LOWLEVEL_INIT=y
150+CONFIG_TARGET_CORSTONE500=y
151+CONFIG_SYS_TEXT_BASE=0x88000000
152+CONFIG_SYS_MALLOC_LEN=0x840000
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400153+CONFIG_NR_DRAM_BANKS=1
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400154+CONFIG_ENV_SIZE=0x40000
Andrew Geisslerea144b032023-01-27 16:03:57 -0600155+CONFIG_SYS_PROMPT="corstone500# "
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400156+CONFIG_IDENT_STRING=" corstone500 aarch32"
157+CONFIG_SYS_LOAD_ADDR=0x90000000
Andrew Geisslerea144b032023-01-27 16:03:57 -0600158+CONFIG_SYS_MEMTEST_START=0x80000000
159+CONFIG_SYS_MEMTEST_END=0xff000000
160+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
161+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x83f00000
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400162+CONFIG_SUPPORT_RAW_INITRD=y
163+CONFIG_BOOTDELAY=1
164+CONFIG_USE_BOOTARGS=y
165+CONFIG_BOOTARGS="console=ttyAMA0 earlycon=pl011,0x1a200000 root=/dev/ram0 rw loglevel=9"
166+# CONFIG_DISPLAY_CPUINFO is not set
167+# CONFIG_DISPLAY_BOARDINFO is not set
168+CONFIG_HUSH_PARSER=y
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400169+# CONFIG_CMD_CONSOLE is not set
170+CONFIG_CMD_BOOTZ=y
171+# CONFIG_CMD_XIMG is not set
172+# CONFIG_CMD_EDITENV is not set
173+# CONFIG_CMD_ENV_EXISTS is not set
174+CONFIG_CMD_MEMTEST=y
175+CONFIG_CMD_ARMFLASH=y
176+# CONFIG_CMD_LOADS is not set
177+# CONFIG_CMD_ITEST is not set
178+# CONFIG_CMD_SETEXPR is not set
179+CONFIG_CMD_DHCP=y
180+# CONFIG_CMD_NFS is not set
181+CONFIG_CMD_MII=y
182+CONFIG_CMD_PING=y
183+CONFIG_CMD_CACHE=y
184+CONFIG_CMD_FAT=y
185+CONFIG_DM=y
186+CONFIG_MTD_NOR_FLASH=y
187+CONFIG_DM_SERIAL=y
188+CONFIG_OF_LIBFDT=y
189diff --git a/include/configs/corstone500.h b/include/configs/corstone500.h
190new file mode 100644
Andrew Geisslerea144b032023-01-27 16:03:57 -0600191index 000000000000..416f5fa4399d
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400192--- /dev/null
193+++ b/include/configs/corstone500.h
Andrew Geisslerea144b032023-01-27 16:03:57 -0600194@@ -0,0 +1,102 @@
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400195+/* SPDX-License-Identifier: GPL-2.0+ */
196+/*
197+ * (C) Copyright 2022 ARM Limited
198+ * (C) Copyright 2022 Linaro
199+ * Rui Miguel Silva <rui.silva@linaro.org>
200+ *
201+ * Configuration for Cortex-A5 Corstone500. Parts were derived from other ARM
202+ * configurations.
203+ */
204+
205+#ifndef __CORSTONE500_H
206+#define __CORSTONE500_H
207+
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400208+/* Generic Timer Definitions */
209+#define CONFIG_SYS_HZ_CLOCK 7500000
210+#define CONFIG_SYS_HZ 1000
211+#define COUNTER_FREQUENCY CONFIG_SYS_HZ_CLOCK
212+
213+#ifdef CONFIG_CORSTONE500_MEMORY_MAP_EXTENDED
214+#define V2M_SRAM0 0x00010000
215+#define V2M_SRAM1 0x02200000
216+#define V2M_QSPI 0x0a800000
217+#else
218+#define V2M_SRAM0 0x00000000
219+#define V2M_SRAM1 0x02000000
220+#define V2M_QSPI 0x08000000
221+#endif
222+
223+#define V2M_DEBUG 0x10000000
224+#define V2M_BASE_PERIPH 0x1a000000
225+#define V2M_A5_PERIPH 0x1c000000
226+#define V2M_L2CC_PERIPH 0x1c010000
227+
228+#define V2M_MASTER_EXPANSION0 0x40000000
229+#define V2M_MASTER_EXPANSION1 0x60000000
230+
231+#define V2M_BASE 0x80000000
232+
233+#define V2M_PERIPH_OFFSET(x) (x << 16)
234+
235+#define V2M_SYSID (V2M_BASE_PERIPH)
236+#define V2M_SYCTL (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(1))
237+#define V2M_COUNTER_CTL (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(2))
238+#define V2M_COUNTER_READ (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(3))
239+#define V2M_TIMER_CTL (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(4))
240+#define V2M_TIMER0 (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(5))
241+
242+#define V2M_WATCHDOG_CTL (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(16))
243+#define V2M_WATCHDOG_REFRESH (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(17))
244+
245+#define V2M_UART0 (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(32))
246+#define V2M_UART1 (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(33))
247+
248+#define V2M_RTC (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(34))
249+#define V2M_TRNG (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(35))
250+
251+/* PL011 Serial Configuration */
252+#define CONFIG_CONS_INDEX 0
253+#define CONFIG_PL011_CLOCK 7500000
254+
255+/* Physical Memory Map */
256+#define PHYS_SDRAM_1 (V2M_BASE)
257+
258+/* Top 16MB reserved for secure world use */
259+#define DRAM_SEC_SIZE 0x01000000
260+#define PHYS_SDRAM_1_SIZE (0x80000000 - DRAM_SEC_SIZE)
261+
262+/* Miscellaneous configurable options */
263+#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
264+
265+#define CONFIG_SYS_MMIO_TIMER
266+
267+#define CONFIG_EXTRA_ENV_SETTINGS \
268+ "kernel_name=Image\0" \
269+ "kernel_addr=0x80f00000\0" \
270+ "initrd_name=ramdisk.img\0" \
271+ "initrd_addr=0x84000000\0" \
272+ "fdt_name=devtree.dtb\0" \
273+ "fdt_addr=0x83000000\0" \
274+ "fdt_high=0xffffffff\0" \
275+ "initrd_high=0xffffffff\0"
276+
277+#define CONFIG_BOOTCOMMAND "echo copy to RAM...; " \
278+ "cp.b 0x80100000 $kernel_addr 0xb00000; " \
279+ "cp.b 0x80d00000 $initrd_addr 0x800000; " \
280+ "bootz $kernel_addr $initrd_addr:0x800000 $fdt_addr"
281+
282+/* Monitor Command Prompt */
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400283+#define CONFIG_SYS_FLASH_BASE 0x80000000
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400284+/* Store environment at top of flash */
285+#define CONFIG_ENV_ADDR 0x0a7c0000
286+#define CONFIG_ENV_SECT_SIZE 0x0040000
287+
288+#define CONFIG_SYS_FLASH_CFI 1
289+#define CONFIG_FLASH_CFI_DRIVER 1
290+#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_32BIT
291+#define CONFIG_SYS_MAX_FLASH_BANKS 1
292+
293+#define CONFIG_SYS_FLASH_EMPTY_INFO /* flinfo indicates empty blocks */
294+#define FLASH_MAX_SECTOR_SI 0x00040000
295+#define CONFIG_ENV_IS_IN_FLASH 1
296+#endif
297--
Andrew Geisslerea144b032023-01-27 16:03:57 -06002982.38.1
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400299