[U-Boot] [PATCH 04/10] sunxi: s/sun8i/sun8i_a23/
Hans de Goede
hdegoede at redhat.com
Tue Apr 14 18:06:55 CEST 2015
This is a preparation patch for adding A33 support, which will have a mach
name of sun8i-a33.
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
arch/arm/cpu/armv7/sunxi/Makefile | 8 ++++----
arch/arm/cpu/armv7/sunxi/board.c | 8 ++++----
arch/arm/cpu/armv7/sunxi/cpu_info.c | 2 +-
.../cpu/armv7/sunxi/{dram_sun8i.c => dram_sun8i_a23.c} | 0
arch/arm/cpu/armv7/sunxi/rsb.c | 2 +-
arch/arm/include/asm/arch-sunxi/clock.h | 3 ++-
arch/arm/include/asm/arch-sunxi/clock_sun6i.h | 6 +++---
arch/arm/include/asm/arch-sunxi/dram.h | 4 ++--
.../asm/arch-sunxi/{dram_sun8i.h => dram_sun8i_a23.h} | 0
board/sunxi/Kconfig | 15 ++++++++-------
board/sunxi/board.c | 4 ++--
configs/Ippo_q8h_v1_2_defconfig | 2 +-
configs/Ippo_q8h_v5_defconfig | 2 +-
drivers/power/Kconfig | 4 ++--
include/configs/sunxi-common.h | 2 +-
15 files changed, 32 insertions(+), 30 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 4bb12ad..b2e5e5d 100644
--- a/arch/arm/cpu/armv7/sunxi/Makefile
+++ b/arch/arm/cpu/armv7/sunxi/Makefile
@@ -15,16 +15,16 @@ obj-y += dram_helpers.o
obj-y += pinmux.o
obj-y += usbc.o
obj-$(CONFIG_MACH_SUN6I) += prcm.o
-obj-$(CONFIG_MACH_SUN8I) += prcm.o
+obj-$(CONFIG_MACH_SUN8I_A23) += prcm.o
obj-$(CONFIG_MACH_SUN9I) += prcm.o
obj-$(CONFIG_MACH_SUN6I) += p2wi.o
-obj-$(CONFIG_MACH_SUN8I) += rsb.o
+obj-$(CONFIG_MACH_SUN8I_A23) += rsb.o
obj-$(CONFIG_MACH_SUN9I) += rsb.o
obj-$(CONFIG_MACH_SUN4I) += clock_sun4i.o
obj-$(CONFIG_MACH_SUN5I) += clock_sun4i.o
obj-$(CONFIG_MACH_SUN6I) += clock_sun6i.o
obj-$(CONFIG_MACH_SUN7I) += clock_sun4i.o
-obj-$(CONFIG_MACH_SUN8I) += clock_sun6i.o
+obj-$(CONFIG_MACH_SUN8I_A23) += clock_sun6i.o
obj-$(CONFIG_MACH_SUN9I) += clock_sun9i.o
ifndef CONFIG_SPL_BUILD
@@ -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 30d5974..7ce79af 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -46,7 +46,7 @@ static int gpio_init(void)
sunxi_gpio_set_cfgpin(SUNXI_GPB(22), SUNXI_GPIO_INPUT);
sunxi_gpio_set_cfgpin(SUNXI_GPB(23), SUNXI_GPIO_INPUT);
#endif
-#if defined(CONFIG_MACH_SUN8I)
+#if defined(CONFIG_MACH_SUN8I_A23)
sunxi_gpio_set_cfgpin(SUNXI_GPF(2), SUN8I_GPF_UART0_TX);
sunxi_gpio_set_cfgpin(SUNXI_GPF(4), SUN8I_GPF_UART0_RX);
#else
@@ -70,7 +70,7 @@ static int gpio_init(void)
sunxi_gpio_set_cfgpin(SUNXI_GPG(3), SUN5I_GPG_UART1);
sunxi_gpio_set_cfgpin(SUNXI_GPG(4), SUN5I_GPG_UART1);
sunxi_gpio_set_pull(SUNXI_GPG(4), SUNXI_GPIO_PULL_UP);
-#elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN8I)
+#elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN8I_A23)
sunxi_gpio_set_cfgpin(SUNXI_GPL(2), SUN8I_GPL_R_UART);
sunxi_gpio_set_cfgpin(SUNXI_GPL(3), SUN8I_GPL_R_UART);
sunxi_gpio_set_pull(SUNXI_GPL(3), SUNXI_GPIO_PULL_UP);
@@ -89,14 +89,14 @@ 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);
#endif
#if defined CONFIG_MACH_SUN6I || \
defined CONFIG_MACH_SUN7I || \
- defined CONFIG_MACH_SUN8I
+ defined CONFIG_MACH_SUN8I_A23
/* Enable SMP mode for CPU0, by setting bit 6 of Auxiliary Ctl reg */
asm volatile(
"mrc p15, 0, r0, c1, c0, 1\n"
diff --git a/arch/arm/cpu/armv7/sunxi/cpu_info.c b/arch/arm/cpu/armv7/sunxi/cpu_info.c
index c3ec20d..6143038 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
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/cpu/armv7/sunxi/rsb.c b/arch/arm/cpu/armv7/sunxi/rsb.c
index f115a9c..d8d4957 100644
--- a/arch/arm/cpu/armv7/sunxi/rsb.c
+++ b/arch/arm/cpu/armv7/sunxi/rsb.c
@@ -20,7 +20,7 @@ static int rsb_set_device_mode(void);
static void rsb_cfg_io(void)
{
-#ifdef CONFIG_MACH_SUN8I
+#if defined CONFIG_MACH_SUN8I_A23
sunxi_gpio_set_cfgpin(SUNXI_GPL(0), SUN8I_GPL_R_RSB);
sunxi_gpio_set_cfgpin(SUNXI_GPL(1), SUN8I_GPL_R_RSB);
sunxi_gpio_set_pull(SUNXI_GPL(0), 1);
diff --git a/arch/arm/include/asm/arch-sunxi/clock.h b/arch/arm/include/asm/arch-sunxi/clock.h
index 3e5d999..ad4fb26 100644
--- a/arch/arm/include/asm/arch-sunxi/clock.h
+++ b/arch/arm/include/asm/arch-sunxi/clock.h
@@ -15,7 +15,8 @@
#define CLK_GATE_CLOSE 0x0
/* clock control module regs definition */
-#if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN8I)
+#if defined(CONFIG_MACH_SUN6I) || \
+ defined(CONFIG_MACH_SUN8I_A23)
#include <asm/arch/clock_sun6i.h>
#elif defined(CONFIG_MACH_SUN9I)
#include <asm/arch/clock_sun9i.h>
diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
index 8a80385..d625970 100644
--- a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
+++ b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
@@ -280,10 +280,10 @@ struct sunxi_ccm_reg {
#define CCM_HDMI_CTRL_DDC_GATE (0x1 << 30)
#define CCM_HDMI_CTRL_GATE (0x1 << 31)
-#ifndef CONFIG_MACH_SUN8I
-#define MBUS_CLK_DEFAULT 0x81000001 /* PLL6 / 2 */
-#else
+#if defined CONFIG_MACH_SUN8I_A23
#define MBUS_CLK_DEFAULT 0x81000003 /* PLL6 / 4 */
+#else
+#define MBUS_CLK_DEFAULT 0x81000001 /* PLL6 / 2 */
#endif
#define CCM_PLL5_PATTERN 0xd1303333
diff --git a/arch/arm/include/asm/arch-sunxi/dram.h b/arch/arm/include/asm/arch-sunxi/dram.h
index aedd194..bb96cc5 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 <asm/arch/dram_sun6i.h>
-#elif defined(CONFIG_MACH_SUN8I)
-#include <asm/arch/dram_sun8i.h>
+#elif defined(CONFIG_MACH_SUN8I_A23)
+#include <asm/arch/dram_sun8i_a23.h>
#else
#include <asm/arch/dram_sun4i.h>
#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 34044f8..92922b8 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -34,7 +34,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 ARCH_SUN6I
select CPU_V7
@@ -44,7 +44,7 @@ endchoice
config DRAM_CLK
int "sunxi dram clock speed"
- default 312 if MACH_SUN6I || MACH_SUN8I
+ default 312 if MACH_SUN6I || MACH_SUN8I_A23
default 360 if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I
---help---
Set the dram clock speed, valid range 240 - 480, must be a multiple
@@ -61,7 +61,7 @@ endif
config DRAM_ZQ
int "sunxi dram zq value"
- default 123 if MACH_SUN4I || MACH_SUN5I || MACH_SUN6I || MACH_SUN8I
+ default 123 if MACH_SUN4I || MACH_SUN5I || MACH_SUN6I || MACH_SUN8I_A23
default 127 if MACH_SUN7I
---help---
Set the dram zq value.
@@ -143,14 +143,15 @@ endif
config SYS_CLK_FREQ
default 912000000 if MACH_SUN7I
- default 1008000000 if MACH_SUN4I || MACH_SUN5I || MACH_SUN6I || MACH_SUN8I
+ default 1008000000 if MACH_SUN4I || MACH_SUN5I || MACH_SUN6I
+ default 1008000000 if MACH_SUN8I_A23
config SYS_CONFIG_NAME
default "sun4i" if MACH_SUN4I
default "sun5i" if MACH_SUN5I
default "sun6i" if MACH_SUN6I
default "sun7i" if MACH_SUN7I
- default "sun8i" if MACH_SUN8I
+ default "sun8i" if MACH_SUN8I_A23
config SYS_BOARD
default "sunxi"
@@ -288,7 +289,7 @@ config VIDEO
config VIDEO_HDMI
boolean "HDMI output support"
- depends on VIDEO && !MACH_SUN8I
+ depends on VIDEO && !MACH_SUN8I_A23
default y
---help---
Say Y here to add support for outputting video over HDMI.
@@ -302,7 +303,7 @@ config VIDEO_VGA
config VIDEO_VGA_VIA_LCD
boolean "VGA via LCD controller support"
- depends on VIDEO && (MACH_SUN5I || MACH_SUN6I || MACH_SUN8I)
+ depends on VIDEO && (MACH_SUN5I || MACH_SUN6I || MACH_SUN8I_A23)
default n
---help---
Say Y here to add support for external DACs connected to the parallel
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 7633d65..83ef0e5 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -116,7 +116,7 @@ static void mmc_pinmux_setup(int sdc)
sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
sunxi_gpio_set_drv(pin, 2);
}
-#elif defined(CONFIG_MACH_SUN8I)
+#elif defined(CONFIG_MACH_SUN8I_A23)
if (pins == SUNXI_GPIO_D) {
/* SDC1: PD2-PD7 */
for (pin = SUNXI_GPD(2); pin <= SUNXI_GPD(7); pin++) {
@@ -181,7 +181,7 @@ static void mmc_pinmux_setup(int sdc)
sunxi_gpio_set_pull(SUNXI_GPC(24), SUNXI_GPIO_PULL_UP);
sunxi_gpio_set_drv(SUNXI_GPC(24), 2);
}
-#elif defined(CONFIG_MACH_SUN8I)
+#elif defined(CONFIG_MACH_SUN8I_A23)
/* SDC2: PC5-PC6, PC8-PC16 */
for (pin = SUNXI_GPC(5); pin <= SUNXI_GPC(6); pin++) {
sunxi_gpio_set_cfgpin(pin, SUNXI_GPC_SDC2);
diff --git a/configs/Ippo_q8h_v1_2_defconfig b/configs/Ippo_q8h_v1_2_defconfig
index e003b4c..d9455c8 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 87d898e..4cc9a5e 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
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index f8f0239..39051e4 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -1,6 +1,6 @@
config AXP221_POWER
boolean "axp221 / axp223 pmic support"
- depends on MACH_SUN6I || MACH_SUN8I
+ depends on MACH_SUN6I || MACH_SUN8I_A23
default y
---help---
Say y here to enable support for the axp221 / axp223 pmic found on most
@@ -47,7 +47,7 @@ config AXP221_ALDO2_VOLT
int "axp221 aldo2 voltage"
depends on AXP221_POWER
default 0 if MACH_SUN6I
- default 2500 if MACH_SUN8I
+ default 2500 if MACH_SUN8I_A23
---help---
Set the voltage (mV) to program the axp221 aldo2 at, set to 0 to
disable aldo2. On sun6i (A31) boards this is typically unused and
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 1f7a1cb..ba4d66c 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -237,7 +237,7 @@ extern int soft_i2c_gpio_scl;
#endif
#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN5I)
#define OF_STDOUT_PATH "/soc at 01c00000/serial at 01c28400:115200"
-#elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN8I)
+#elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN8I_A23)
#define OF_STDOUT_PATH "/soc at 01c00000/serial at 01f02800:115200"
#else
#error Unsupported console port nr. Please fix stdout-path in sunxi-common.h.
--
2.3.4
More information about the U-Boot
mailing list