sunxi: Introduce common symbol for H6 like SoCs

It turns out that there are at least 2 other SoCs which have basically
the same memory map, similar clocks and other features as H6. It's very
likely that we'll see more such SoCs in the future. In order to ease
porting to new SoCs and lower ifdef clutter, introduce common symbol for
them.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
This commit is contained in:
Jernej Skrabec 2021-01-11 21:11:34 +01:00 committed by Andre Przywara
parent fbd37d8d28
commit 44726096cf
10 changed files with 24 additions and 17 deletions

View File

@ -39,7 +39,7 @@
.word 0xf57ff06f // isb sy .word 0xf57ff06f // isb sy
.word 0xe320f003 // wfi .word 0xe320f003 // wfi
.word 0xeafffffd // b @wfi .word 0xeafffffd // b @wfi
#ifndef CONFIG_MACH_SUN50I_H6 #ifndef CONFIG_SUN50I_GEN_H6
.word 0x017000a0 // writeable RVBAR mapping address .word 0x017000a0 // writeable RVBAR mapping address
#else #else
.word 0x09010040 // writeable RVBAR mapping address .word 0x09010040 // writeable RVBAR mapping address

View File

@ -16,7 +16,7 @@
/* clock control module regs definition */ /* clock control module regs definition */
#if defined(CONFIG_MACH_SUN8I_A83T) #if defined(CONFIG_MACH_SUN8I_A83T)
#include <asm/arch/clock_sun8i_a83t.h> #include <asm/arch/clock_sun8i_a83t.h>
#elif defined(CONFIG_MACH_SUN50I_H6) #elif defined(CONFIG_SUN50I_GEN_H6)
#include <asm/arch/clock_sun50i_h6.h> #include <asm/arch/clock_sun50i_h6.h>
#elif defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN8I) || \ #elif defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN8I) || \
defined(CONFIG_MACH_SUN50I) defined(CONFIG_MACH_SUN50I)

View File

@ -8,7 +8,7 @@
#if defined(CONFIG_MACH_SUN9I) #if defined(CONFIG_MACH_SUN9I)
#include <asm/arch/cpu_sun9i.h> #include <asm/arch/cpu_sun9i.h>
#elif defined(CONFIG_MACH_SUN50I_H6) #elif defined(CONFIG_SUN50I_GEN_H6)
#include <asm/arch/cpu_sun50i_h6.h> #include <asm/arch/cpu_sun50i_h6.h>
#else #else
#include <asm/arch/cpu_sun4i.h> #include <asm/arch/cpu_sun4i.h>

View File

@ -76,7 +76,7 @@ struct sunxi_timer_reg {
struct sunxi_tgp tgp[4]; struct sunxi_tgp tgp[4];
u8 res5[8]; u8 res5[8];
u32 cpu_cfg; u32 cpu_cfg;
#elif defined(CONFIG_SUNXI_GEN_SUN6I) || defined(CONFIG_MACH_SUN50I_H6) #elif defined(CONFIG_SUNXI_GEN_SUN6I) || defined(CONFIG_SUN50I_GEN_H6)
u8 res3[16]; u8 res3[16];
struct sunxi_wdog wdog[5]; /* We have 5 watchdogs */ struct sunxi_wdog wdog[5]; /* We have 5 watchdogs */
#endif #endif

View File

@ -82,7 +82,7 @@ config SUN8I_RSB
config SUNXI_SRAM_ADDRESS config SUNXI_SRAM_ADDRESS
hex hex
default 0x10000 if MACH_SUN9I || MACH_SUN50I || MACH_SUN50I_H5 default 0x10000 if MACH_SUN9I || MACH_SUN50I || MACH_SUN50I_H5
default 0x20000 if MACH_SUN50I_H6 default 0x20000 if SUN50I_GEN_H6
default 0x0 default 0x0
---help--- ---help---
Older Allwinner SoCs have their mask boot ROM mapped just below 4GB, Older Allwinner SoCs have their mask boot ROM mapped just below 4GB,
@ -108,6 +108,15 @@ config SUNXI_GEN_SUN6I
separate ahb reset control registers, custom pmic bus, new style separate ahb reset control registers, custom pmic bus, new style
watchdog, etc. watchdog, etc.
config SUN50I_GEN_H6
bool
select FIT
select SPL_LOAD_FIT
select SUPPORT_SPL
---help---
Select this for sunxi SoCs which have H6 like peripherals, clocks
and memory map.
config SUNXI_DRAM_DW config SUNXI_DRAM_DW
bool bool
---help--- ---help---
@ -302,11 +311,9 @@ config MACH_SUN50I_H5
config MACH_SUN50I_H6 config MACH_SUN50I_H6
bool "sun50i (Allwinner H6)" bool "sun50i (Allwinner H6)"
select ARM64 select ARM64
select SUPPORT_SPL
select FIT
select PHY_SUN4I_USB select PHY_SUN4I_USB
select SPL_LOAD_FIT
select DRAM_SUN50I_H6 select DRAM_SUN50I_H6
select SUN50I_GEN_H6
endchoice endchoice
@ -756,7 +763,7 @@ config VIDEO_SUNXI
depends on !MACH_SUN8I_V3S depends on !MACH_SUN8I_V3S
depends on !MACH_SUN9I depends on !MACH_SUN9I
depends on !MACH_SUN50I depends on !MACH_SUN50I
depends on !MACH_SUN50I_H6 depends on !SUN50I_GEN_H6
select VIDEO select VIDEO
imply VIDEO_DT_SIMPLEFB imply VIDEO_DT_SIMPLEFB
default y default y
@ -989,7 +996,7 @@ config SPL_STACK_R_ADDR
default 0x4fe00000 if MACH_SUN8I default 0x4fe00000 if MACH_SUN8I
default 0x2fe00000 if MACH_SUN9I default 0x2fe00000 if MACH_SUN9I
default 0x4fe00000 if MACH_SUN50I default 0x4fe00000 if MACH_SUN50I
default 0x4fe00000 if MACH_SUN50I_H6 default 0x4fe00000 if SUN50I_GEN_H6
config SPL_SPI_SUNXI config SPL_SPI_SUNXI
bool "Support for SPI Flash on Allwinner SoCs in SPL" bool "Support for SPI Flash on Allwinner SoCs in SPL"

View File

@ -26,7 +26,7 @@ else
obj-$(CONFIG_MACH_SUN8I) += clock_sun6i.o obj-$(CONFIG_MACH_SUN8I) += clock_sun6i.o
endif endif
obj-$(CONFIG_MACH_SUN9I) += clock_sun9i.o gtbus_sun9i.o obj-$(CONFIG_MACH_SUN9I) += clock_sun9i.o gtbus_sun9i.o
obj-$(CONFIG_MACH_SUN50I_H6) += clock_sun50i_h6.o obj-$(CONFIG_SUN50I_GEN_H6) += clock_sun50i_h6.o
ifdef CONFIG_SPL_BUILD ifdef CONFIG_SPL_BUILD
obj-$(CONFIG_DRAM_SUN4I) += dram_sun4i.o obj-$(CONFIG_DRAM_SUN4I) += dram_sun4i.o

View File

@ -144,7 +144,7 @@ static int gpio_init(void)
#error Unsupported console port number. Please fix pin mux settings in board.c #error Unsupported console port number. Please fix pin mux settings in board.c
#endif #endif
#ifdef CONFIG_MACH_SUN50I_H6 #ifdef CONFIG_SUN50I_GEN_H6
/* Update PIO power bias configuration by copy hardware detected value */ /* Update PIO power bias configuration by copy hardware detected value */
val = readl(SUNXI_PIO_BASE + SUN50I_H6_GPIO_POW_MOD_VAL); val = readl(SUNXI_PIO_BASE + SUN50I_H6_GPIO_POW_MOD_VAL);
writel(val, SUNXI_PIO_BASE + SUN50I_H6_GPIO_POW_MOD_SEL); writel(val, SUNXI_PIO_BASE + SUN50I_H6_GPIO_POW_MOD_SEL);
@ -329,7 +329,7 @@ void reset_cpu(ulong addr)
/* sun5i sometimes gets stuck without this */ /* sun5i sometimes gets stuck without this */
writel(WDT_MODE_RESET_EN | WDT_MODE_EN, &wdog->mode); writel(WDT_MODE_RESET_EN | WDT_MODE_EN, &wdog->mode);
} }
#elif defined(CONFIG_SUNXI_GEN_SUN6I) || defined(CONFIG_MACH_SUN50I_H6) #elif defined(CONFIG_SUNXI_GEN_SUN6I) || defined(CONFIG_SUN50I_GEN_H6)
#if defined(CONFIG_MACH_SUN50I_H6) #if defined(CONFIG_MACH_SUN50I_H6)
/* WDOG is broken for some H6 rev. use the R_WDOG instead */ /* WDOG is broken for some H6 rev. use the R_WDOG instead */
static const struct sunxi_wdog *wdog = static const struct sunxi_wdog *wdog =

View File

@ -30,7 +30,7 @@
.text .text
#ifndef CONFIG_MACH_SUN50I_H6 #ifndef CONFIG_SUN50I_GEN_H6
ldr r1, =0x017000a0 @ MMIO mapped RVBAR[0] register ldr r1, =0x017000a0 @ MMIO mapped RVBAR[0] register
#else #else
ldr r1, =0x09010040 @ MMIO mapped RVBAR[0] register ldr r1, =0x09010040 @ MMIO mapped RVBAR[0] register

View File

@ -159,7 +159,7 @@ config SPL_TEXT_BASE
hex "SPL Text Base" hex "SPL Text Base"
default ISW_ENTRY_ADDR if AM43XX || AM33XX || OMAP54XX || ARCH_KEYSTONE default ISW_ENTRY_ADDR if AM43XX || AM33XX || OMAP54XX || ARCH_KEYSTONE
default 0x10060 if MACH_SUN50I || MACH_SUN50I_H5 || MACH_SUN9I default 0x10060 if MACH_SUN50I || MACH_SUN50I_H5 || MACH_SUN9I
default 0x20060 if MACH_SUN50I_H6 default 0x20060 if SUN50I_GEN_H6
default 0x00060 if ARCH_SUNXI default 0x00060 if ARCH_SUNXI
default 0xfffc0000 if ARCH_ZYNQMP default 0xfffc0000 if ARCH_ZYNQMP
default 0x0 default 0x0
@ -468,7 +468,7 @@ config SPL_SHA512_SUPPORT
config SPL_FIT_IMAGE_TINY config SPL_FIT_IMAGE_TINY
bool "Remove functionality from SPL FIT loading to reduce size" bool "Remove functionality from SPL FIT loading to reduce size"
depends on SPL_FIT depends on SPL_FIT
default y if MACH_SUN50I || MACH_SUN50I_H5 || MACH_SUN50I_H6 default y if MACH_SUN50I || MACH_SUN50I_H5 || SUN50I_GEN_H6
default y if ARCH_IMX8M default y if ARCH_IMX8M
help help
Enable this to reduce the size of the FIT image loading code Enable this to reduce the size of the FIT image loading code

View File

@ -10,7 +10,7 @@
* A64 specific configuration * A64 specific configuration
*/ */
#ifndef CONFIG_MACH_SUN50I_H6 #ifndef CONFIG_SUN50I_GEN_H6
#define GICD_BASE 0x1c81000 #define GICD_BASE 0x1c81000
#define GICC_BASE 0x1c82000 #define GICC_BASE 0x1c82000
#else #else