From 323d1f9d5bebfe55e97e23c8094055685665afef Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 22 Sep 2015 00:27:39 +0900 Subject: ARM: uniphier: allow to enable multiple SoCs Before this commit, the Kconfig menu in mach-uniphier only allowed us to choose one SoC to be compiled. Each SoC has its own defconfig file for the build-test coverage. Consequently, some defconfig files are duplicated with only the difference in CONFIG_DEFAULT_DEVICE_TREE and CONFIG_{SOC_NAME}=y. Now, most of board-specific parameters have been moved to device trees, so it makes sense to include init code of multiple SoCs into a single image as long as the SoCs have similar architecture. In fact, some SoCs of UniPhier family are very similar: - PH1-LD4 and PH1-sLD8 - PH1-LD6b and ProXstream2 (will be added in the upcoming commit) This commit will be helpful to merge some defconfig files for better maintainability. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/include/mach/init.h | 83 ++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 arch/arm/mach-uniphier/include/mach/init.h (limited to 'arch/arm/mach-uniphier/include/mach/init.h') diff --git a/arch/arm/mach-uniphier/include/mach/init.h b/arch/arm/mach-uniphier/include/mach/init.h new file mode 100644 index 0000000000..228cbb1a19 --- /dev/null +++ b/arch/arm/mach-uniphier/include/mach/init.h @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2015 Masahiro Yamada + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __MACH_INIT_H +#define __MACH_INIT_H + +struct uniphier_board_data { + unsigned long dram_ch0_base; + unsigned long dram_ch0_size; + unsigned long dram_ch0_width; + unsigned long dram_ch1_base; + unsigned long dram_ch1_size; + unsigned long dram_ch1_width; + unsigned long dram_ch2_base; + unsigned long dram_ch2_size; + unsigned long dram_ch2_width; + unsigned int dram_freq; +}; + +const struct uniphier_board_data *uniphier_get_board_param(const void *fdt); + +int ph1_sld3_init(const struct uniphier_board_data *bd); +int ph1_ld4_init(const struct uniphier_board_data *bd); +int ph1_pro4_init(const struct uniphier_board_data *bd); +int ph1_sld8_init(const struct uniphier_board_data *bd); + +#if defined(CONFIG_MICRO_SUPPORT_CARD) +int ph1_sld3_sbc_init(const struct uniphier_board_data *bd); +int ph1_ld4_sbc_init(const struct uniphier_board_data *bd); +int ph1_pro4_sbc_init(const struct uniphier_board_data *bd); +#else +static inline int ph1_sld3_sbc_init(const struct uniphier_board_data *bd) +{ + return 0; +} + +static inline int ph1_ld4_sbc_init(const struct uniphier_board_data *bd) +{ + return 0; +} + +static inline int ph1_pro4_sbc_init(const struct uniphier_board_data *bd) +{ + return 0; +} +#endif + +int ph1_sld3_bcu_init(const struct uniphier_board_data *bd); +int ph1_ld4_bcu_init(const struct uniphier_board_data *bd); + +int memconf_init(const struct uniphier_board_data *bd); +int ph1_sld3_memconf_init(const struct uniphier_board_data *bd); + +int ph1_sld3_pll_init(const struct uniphier_board_data *bd); +int ph1_ld4_pll_init(const struct uniphier_board_data *bd); +int ph1_pro4_pll_init(const struct uniphier_board_data *bd); +int ph1_sld8_pll_init(const struct uniphier_board_data *bd); + +int ph1_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd); +int ph1_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd); + +int ph1_ld4_early_clk_init(const struct uniphier_board_data *bd); + +int ph1_sld3_early_pin_init(const struct uniphier_board_data *bd); + +int ph1_ld4_umc_init(const struct uniphier_board_data *bd); +int ph1_pro4_umc_init(const struct uniphier_board_data *bd); +int ph1_sld8_umc_init(const struct uniphier_board_data *bd); + +void ph1_sld3_pin_init(void); +void ph1_ld4_pin_init(void); +void ph1_pro4_pin_init(void); +void ph1_sld8_pin_init(void); + +void ph1_ld4_clk_init(void); +void ph1_pro4_clk_init(void); + +#define pr_err(fmt, args...) printf(fmt, ##args) + +#endif /* __MACH_INIT_H */ -- cgit From 28f40d4a4db2b6c701d349fd4fac286d21369de2 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 22 Sep 2015 00:27:40 +0900 Subject: ARM: uniphier: add PH1-Pro5 support The DDR SDRAM initialization code has not been mainlined yet, but U-Boot proper should work. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/include/mach/init.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/arm/mach-uniphier/include/mach/init.h') diff --git a/arch/arm/mach-uniphier/include/mach/init.h b/arch/arm/mach-uniphier/include/mach/init.h index 228cbb1a19..914182d1e8 100644 --- a/arch/arm/mach-uniphier/include/mach/init.h +++ b/arch/arm/mach-uniphier/include/mach/init.h @@ -26,6 +26,7 @@ int ph1_sld3_init(const struct uniphier_board_data *bd); int ph1_ld4_init(const struct uniphier_board_data *bd); int ph1_pro4_init(const struct uniphier_board_data *bd); int ph1_sld8_init(const struct uniphier_board_data *bd); +int ph1_pro5_init(const struct uniphier_board_data *bd); #if defined(CONFIG_MICRO_SUPPORT_CARD) int ph1_sld3_sbc_init(const struct uniphier_board_data *bd); @@ -63,6 +64,7 @@ int ph1_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd); int ph1_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd); int ph1_ld4_early_clk_init(const struct uniphier_board_data *bd); +int ph1_pro5_early_clk_init(const struct uniphier_board_data *bd); int ph1_sld3_early_pin_init(const struct uniphier_board_data *bd); @@ -74,9 +76,11 @@ void ph1_sld3_pin_init(void); void ph1_ld4_pin_init(void); void ph1_pro4_pin_init(void); void ph1_sld8_pin_init(void); +void ph1_pro5_pin_init(void); void ph1_ld4_clk_init(void); void ph1_pro4_clk_init(void); +void ph1_pro5_clk_init(void); #define pr_err(fmt, args...) printf(fmt, ##args) -- cgit From 019df879a93e266ac19f5eb00e4ee605db279b14 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 22 Sep 2015 00:27:41 +0900 Subject: ARM: uniphier: add ProXstream2 and PH1-LD6b support The DDR SDRAM initialization code has not been mainlined yet, but U-Boot proper should work. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/include/mach/init.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'arch/arm/mach-uniphier/include/mach/init.h') diff --git a/arch/arm/mach-uniphier/include/mach/init.h b/arch/arm/mach-uniphier/include/mach/init.h index 914182d1e8..5108eddfc4 100644 --- a/arch/arm/mach-uniphier/include/mach/init.h +++ b/arch/arm/mach-uniphier/include/mach/init.h @@ -27,11 +27,13 @@ int ph1_ld4_init(const struct uniphier_board_data *bd); int ph1_pro4_init(const struct uniphier_board_data *bd); int ph1_sld8_init(const struct uniphier_board_data *bd); int ph1_pro5_init(const struct uniphier_board_data *bd); +int proxstream2_init(const struct uniphier_board_data *bd); #if defined(CONFIG_MICRO_SUPPORT_CARD) int ph1_sld3_sbc_init(const struct uniphier_board_data *bd); int ph1_ld4_sbc_init(const struct uniphier_board_data *bd); int ph1_pro4_sbc_init(const struct uniphier_board_data *bd); +int proxstream2_sbc_init(const struct uniphier_board_data *bd); #else static inline int ph1_sld3_sbc_init(const struct uniphier_board_data *bd) { @@ -47,6 +49,11 @@ static inline int ph1_pro4_sbc_init(const struct uniphier_board_data *bd) { return 0; } + +static inline int proxstream2_sbc_init(const struct uniphier_board_data *bd) +{ + return 0; +} #endif int ph1_sld3_bcu_init(const struct uniphier_board_data *bd); @@ -54,6 +61,7 @@ int ph1_ld4_bcu_init(const struct uniphier_board_data *bd); int memconf_init(const struct uniphier_board_data *bd); int ph1_sld3_memconf_init(const struct uniphier_board_data *bd); +int proxstream2_memconf_init(const struct uniphier_board_data *bd); int ph1_sld3_pll_init(const struct uniphier_board_data *bd); int ph1_ld4_pll_init(const struct uniphier_board_data *bd); @@ -65,6 +73,7 @@ int ph1_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd); int ph1_ld4_early_clk_init(const struct uniphier_board_data *bd); int ph1_pro5_early_clk_init(const struct uniphier_board_data *bd); +int proxstream2_early_clk_init(const struct uniphier_board_data *bd); int ph1_sld3_early_pin_init(const struct uniphier_board_data *bd); @@ -77,10 +86,13 @@ void ph1_ld4_pin_init(void); void ph1_pro4_pin_init(void); void ph1_sld8_pin_init(void); void ph1_pro5_pin_init(void); +void proxstream2_pin_init(void); +void ph1_ld6b_pin_init(void); void ph1_ld4_clk_init(void); void ph1_pro4_clk_init(void); void ph1_pro5_clk_init(void); +void proxstream2_clk_init(void); #define pr_err(fmt, args...) printf(fmt, ##args) -- cgit