From 5e6bacdb84dbf5cb3b24498784807c3f3c7bdeb4 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 6 Apr 2015 20:55:39 +0200 Subject: [PATCH] sunxi: s/sun8i/sun8i_a23/ This is a preparation patch for adding A33 support, which will have a mach name of sun8i-a33. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- arch/arm/cpu/armv7/sunxi/Makefile | 2 +- arch/arm/cpu/armv7/sunxi/board.c | 2 +- arch/arm/cpu/armv7/sunxi/cpu_info.c | 4 ++-- .../cpu/armv7/sunxi/{dram_sun8i.c => dram_sun8i_a23.c} | 0 arch/arm/include/asm/arch-sunxi/dram.h | 4 ++-- .../asm/arch-sunxi/{dram_sun8i.h => dram_sun8i_a23.h} | 0 board/sunxi/Kconfig | 8 +++++++- configs/Ippo_q8h_v1_2_defconfig | 2 +- configs/Ippo_q8h_v5_defconfig | 2 +- 9 files changed, 15 insertions(+), 9 deletions(-) rename arch/arm/cpu/armv7/sunxi/{dram_sun8i.c => dram_sun8i_a23.c} (100%) rename arch/arm/include/asm/arch-sunxi/{dram_sun8i.h => dram_sun8i_a23.h} (100%) diff --git a/arch/arm/cpu/armv7/sunxi/Makefile b/arch/arm/cpu/armv7/sunxi/Makefile index 4bb12ad8bd..59c26ae786 100644 --- a/arch/arm/cpu/armv7/sunxi/Makefile +++ b/arch/arm/cpu/armv7/sunxi/Makefile @@ -38,6 +38,6 @@ obj-$(CONFIG_MACH_SUN4I) += dram_sun4i.o obj-$(CONFIG_MACH_SUN5I) += dram_sun4i.o obj-$(CONFIG_MACH_SUN6I) += dram_sun6i.o obj-$(CONFIG_MACH_SUN7I) += dram_sun4i.o -obj-$(CONFIG_MACH_SUN8I) += dram_sun8i.o +obj-$(CONFIG_MACH_SUN8I_A23) += dram_sun8i_a23.o obj-y += fel_utils.o endif diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c index 260b42d2cf..873f8b31f7 100644 --- a/arch/arm/cpu/armv7/sunxi/board.c +++ b/arch/arm/cpu/armv7/sunxi/board.c @@ -89,7 +89,7 @@ void spl_board_load_image(void) void s_init(void) { -#if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I +#if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I_A23 /* Magic (undocmented) value taken from boot0, without this DRAM * access gets messed up (seems cache related) */ setbits_le32(SUNXI_SRAMC_BASE + 0x44, 0x1800); diff --git a/arch/arm/cpu/armv7/sunxi/cpu_info.c b/arch/arm/cpu/armv7/sunxi/cpu_info.c index b6cb9dea64..77435f39f3 100644 --- a/arch/arm/cpu/armv7/sunxi/cpu_info.c +++ b/arch/arm/cpu/armv7/sunxi/cpu_info.c @@ -64,7 +64,7 @@ int print_cpuinfo(void) } #elif defined CONFIG_MACH_SUN7I puts("CPU: Allwinner A20 (SUN7I)\n"); -#elif defined CONFIG_MACH_SUN8I +#elif defined CONFIG_MACH_SUN8I_A23 puts("CPU: Allwinner A23 (SUN8I)\n"); #else #warning Please update cpu_info.c with correct CPU information @@ -76,7 +76,7 @@ int print_cpuinfo(void) int sunxi_get_sid(unsigned int *sid) { -#if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I +#if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I_A23 #ifdef CONFIG_AXP221_POWER return axp221_get_sid(sid); #else diff --git a/arch/arm/cpu/armv7/sunxi/dram_sun8i.c b/arch/arm/cpu/armv7/sunxi/dram_sun8i_a23.c similarity index 100% rename from arch/arm/cpu/armv7/sunxi/dram_sun8i.c rename to arch/arm/cpu/armv7/sunxi/dram_sun8i_a23.c diff --git a/arch/arm/include/asm/arch-sunxi/dram.h b/arch/arm/include/asm/arch-sunxi/dram.h index aedd1941d5..bb96cc572a 100644 --- a/arch/arm/include/asm/arch-sunxi/dram.h +++ b/arch/arm/include/asm/arch-sunxi/dram.h @@ -18,8 +18,8 @@ /* dram regs definition */ #if defined(CONFIG_MACH_SUN6I) #include -#elif defined(CONFIG_MACH_SUN8I) -#include +#elif defined(CONFIG_MACH_SUN8I_A23) +#include #else #include #endif diff --git a/arch/arm/include/asm/arch-sunxi/dram_sun8i.h b/arch/arm/include/asm/arch-sunxi/dram_sun8i_a23.h similarity index 100% rename from arch/arm/include/asm/arch-sunxi/dram_sun8i.h rename to arch/arm/include/asm/arch-sunxi/dram_sun8i_a23.h diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index b716a8ba1e..3d865d140c 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -46,7 +46,7 @@ config MACH_SUN7I select SUPPORT_SPL select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT -config MACH_SUN8I +config MACH_SUN8I_A23 bool "sun8i (Allwinner A23)" select CPU_V7 select SUNXI_GEN_SUN6I @@ -54,6 +54,12 @@ config MACH_SUN8I endchoice +# The sun8i SoCs share a lot, this helps to avoid a lot of "if A23 || A33" +config MACH_SUN8I + bool + default y if MACH_SUN8I_A23 || MACH_SUN8I_A33 + + config DRAM_CLK int "sunxi dram clock speed" default 312 if MACH_SUN6I || MACH_SUN8I diff --git a/configs/Ippo_q8h_v1_2_defconfig b/configs/Ippo_q8h_v1_2_defconfig index e003b4ccc6..d9455c8f35 100644 --- a/configs/Ippo_q8h_v1_2_defconfig +++ b/configs/Ippo_q8h_v1_2_defconfig @@ -11,7 +11,7 @@ CONFIG_VIDEO_LCD_BL_EN="PH6" CONFIG_VIDEO_LCD_BL_PWM="PH0" CONFIG_ARM=y CONFIG_ARCH_SUNXI=y -CONFIG_MACH_SUN8I=y +CONFIG_MACH_SUN8I_A23=y CONFIG_DRAM_CLK=432 # zq = 0xf74a CONFIG_DRAM_ZQ=63306 diff --git a/configs/Ippo_q8h_v5_defconfig b/configs/Ippo_q8h_v5_defconfig index 87d898e983..4cc9a5e1eb 100644 --- a/configs/Ippo_q8h_v5_defconfig +++ b/configs/Ippo_q8h_v5_defconfig @@ -11,7 +11,7 @@ CONFIG_VIDEO_LCD_BL_EN="PH6" CONFIG_VIDEO_LCD_BL_PWM="PH0" CONFIG_ARM=y CONFIG_ARCH_SUNXI=y -CONFIG_MACH_SUN8I=y +CONFIG_MACH_SUN8I_A23=y CONFIG_DRAM_CLK=480 # zq = 0xf777 CONFIG_DRAM_ZQ=63351 -- 2.30.2