1 From 6b0c83a5c7b9189fb1c5cf56145ec4882d9e5588 Mon Sep 17 00:00:00 2001
2 From: Zoltan HERPAI <wigyori@uid0.hu>
3 Date: Tue, 6 Jun 2023 18:13:34 +0000
4 Subject: [PATCH 79/90] riscv: Add CONFIG_TARGET_SUN20I_D1
6 Signed-off-by: Samuel Holland <samuel@sholland.org>
7 Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
9 arch/riscv/Kconfig | 5 +++++
10 board/sunxi/Kconfig | 30 +++++++++++++++++++++++++++---
11 common/spl/Kconfig | 1 +
12 drivers/clk/sunxi/Kconfig | 1 +
13 include/configs/sun20i.h | 11 +++++++++++
14 5 files changed, 45 insertions(+), 3 deletions(-)
15 create mode 100644 include/configs/sun20i.h
17 --- a/arch/riscv/Kconfig
18 +++ b/arch/riscv/Kconfig
19 @@ -31,6 +31,11 @@ config TARGET_SIPEED_MAIX
20 bool "Support Sipeed Maix Board"
21 select SYS_CACHE_SHIFT_6
23 +config TARGET_SUN20I_D1
24 + bool "Support Allwinner D1 Boards"
26 + select SYS_CACHE_SHIFT_6
31 --- a/board/sunxi/Kconfig
32 +++ b/board/sunxi/Kconfig
33 @@ -13,8 +13,18 @@ config BOARD_SUNXI
34 select DM_SERIAL if SERIAL
36 select DM_SPI_FLASH if SPI
37 + select GENERIC_RISCV if RISCV
40 + select RAM if SPL_DM
41 + select SPL_CLK if SPL_DM
42 + select SPL_DM if RISCV && SPL
43 + select SPL_DM_SPI if SPL_DM && SPL_SPI
44 + select SPL_DM_SPI_FLASH if SPL_DM && SPL_SPI
45 + select SPL_OF_CONTROL if SPL_DM
46 + select SPL_PINCTRL if SPL_DM
47 + select SPL_PINCONF if SPL_DM
48 + select SPL_RAM if SPL_DM
49 select SPL_SEPARATE_BSS if SPL
51 select SYS_RELOC_GD_ENV_ADDR
52 @@ -28,12 +38,14 @@ config BOARD_SUNXI
57 imply OF_LIBFDT_OVERLAY
58 imply PRE_CONSOLE_BUFFER
61 imply SPL_LIBCOMMON_SUPPORT
62 imply SPL_LIBGENERIC_SUPPORT
67 @@ -41,6 +53,7 @@ config BOARD_SUNXI
72 imply SYSRESET_WATCHDOG
73 imply SYSRESET_WATCHDOG_AUTO
74 imply USB_EHCI_GENERIC
75 @@ -67,6 +80,12 @@ config SPL_BSS_START_ADDR
76 default 0x4ff80000 if SUNXI_MINIMUM_DRAM_MB >= 256
77 default 0x43f80000 if SUNXI_MINIMUM_DRAM_MB >= 64
79 +config SPL_OPENSBI_LOAD_ADDR
80 + default 0x40000000 if RISCV
83 + default 0x48000 if TARGET_SUN20I_D1
85 config SPL_STACK_R_ADDR
86 default 0x81e00000 if MACH_SUNIV
87 default 0x2fe00000 if MACH_SUN9I
88 @@ -75,13 +94,13 @@ config SPL_STACK_R_ADDR
91 default 0x10060 if MACH_SUN9I || MACH_SUN50I || MACH_SUN50I_H5
92 - default 0x20060 if SUN50I_GEN_H6
93 + default 0x20060 if SUN50I_GEN_H6 || TARGET_SUN20I_D1
96 config SUNXI_MINIMUM_DRAM_MB
98 default 32 if MACH_SUNIV
99 - default 64 if MACH_SUN8I_V3S
100 + default 64 if MACH_SUN8I_V3S || TARGET_SUN20I_D1
103 Minimum DRAM size expected on the board. Traditionally we
104 @@ -94,7 +113,7 @@ config SUNXI_MINIMUM_DRAM_MB
105 config SUNXI_SRAM_ADDRESS
107 default 0x10000 if MACH_SUN9I || MACH_SUN50I || MACH_SUN50I_H5
108 - default 0x20000 if SUN50I_GEN_H6
109 + default 0x20000 if SUN50I_GEN_H6 || TARGET_SUN20I_D1
112 Older Allwinner SoCs have their boot mask ROM mapped just
113 @@ -113,6 +132,7 @@ config SYS_CLK_FREQ
114 default 912000000 if MACH_SUN7I
115 default 1008000000 if MACH_SUN8I
116 default 1008000000 if MACH_SUN9I
117 + default 1008000000 if TARGET_SUN20I_D1
118 default 816000000 if MACH_SUN50I || MACH_SUN50I_H5
119 default 888000000 if MACH_SUN50I_H6
120 default 1008000000 if MACH_SUN50I_H616
121 @@ -125,10 +145,14 @@ config SYS_CONFIG_NAME
122 default "sun7i" if MACH_SUN7I
123 default "sun8i" if MACH_SUN8I
124 default "sun9i" if MACH_SUN9I
125 + default "sun20i" if TARGET_SUN20I_D1
126 default "sun50i" if MACH_SUN50I
127 default "sun50i" if MACH_SUN50I_H6
128 default "sun50i" if MACH_SUN50I_H616
131 + default "generic" if TARGET_SUN20I_D1
134 default 0x81000000 if MACH_SUNIV
135 default 0x22000000 if MACH_SUN9I
136 --- a/common/spl/Kconfig
137 +++ b/common/spl/Kconfig
138 @@ -78,6 +78,7 @@ config SPL_MAX_SIZE
139 hex "Maximum size of the SPL image, excluding BSS"
140 default 0x37fa0 if MACH_SUN50I_H616
141 default 0x30000 if ARCH_MX6 && MX6_OCRAM_256KB
142 + default 0x27fa0 if TARGET_SUN20I_D1
143 default 0x25fa0 if MACH_SUN50I_H6
144 default 0x1b000 if AM33XX && !TI_SECURE_DEVICE
145 default 0x10000 if ARCH_MX6 && !MX6_OCRAM_256KB
146 --- a/drivers/clk/sunxi/Kconfig
147 +++ b/drivers/clk/sunxi/Kconfig
148 @@ -98,6 +98,7 @@ config CLK_SUN8I_H3
151 bool "Clock driver for Allwinner D1"
152 + default TARGET_SUN20I_D1
154 This enables common clock driver support for platforms based
157 +++ b/include/configs/sun20i.h
159 +/* SPDX-License-Identifier: GPL-2.0+ */
161 + * Placeholder wrapper to allow addressing Allwinner D1 (and later) sun20i
162 + * CPU based devices separately. Please do not add anything in here.
167 +#include <configs/sunxi-common.h>
169 +#endif /* __CONFIG_H */