From 78c627cf1f808d5ae9240809a81b71903bdf4fe2 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sun, 15 Jan 2017 14:59:03 +0900 Subject: ARM: uniphier: split out UMC clock enable The clock enable bits for UMC are more SoC-specific than for the other hardware blocks. Separate the UMC clocks and the other clocks for better code reuse across SoCs. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/init/init-sld8.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-uniphier/init/init-sld8.c') diff --git a/arch/arm/mach-uniphier/init/init-sld8.c b/arch/arm/mach-uniphier/init/init-sld8.c index 82d036b..07fccb1 100644 --- a/arch/arm/mach-uniphier/init/init-sld8.c +++ b/arch/arm/mach-uniphier/init/init-sld8.c @@ -31,7 +31,8 @@ int uniphier_sld8_init(const struct uniphier_board_data *bd) led_puts("L1"); - uniphier_ld4_early_clk_init(bd); + uniphier_sld3_early_clk_init(); + uniphier_sld3_dram_clk_init(); led_puts("L2"); -- cgit v1.1 From 8d6c99c66f94c78e65fdacca2fb2857101f8a5e7 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sun, 15 Jan 2017 14:59:04 +0900 Subject: ARM: uniphier: refactor MEMCONF init code Currently, memconf-sld3.c and memconf-pxs2.c duplicate the code. There are 3 patterns in terms of MEMCONF init: - DRAM 2 channels: LD4, sLD8, Pro4, Pro5, LD11 - DRAM 3 channels: sLD3 - DRAM 3 channels (Ch2 is disable by MEMCONF[21]): Pxs2, LD20 All of them can be moved into a single file by a little more refactoring. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/init/init-sld8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-uniphier/init/init-sld8.c') diff --git a/arch/arm/mach-uniphier/init/init-sld8.c b/arch/arm/mach-uniphier/init/init-sld8.c index 07fccb1..8e8d62b 100644 --- a/arch/arm/mach-uniphier/init/init-sld8.c +++ b/arch/arm/mach-uniphier/init/init-sld8.c @@ -27,7 +27,7 @@ int uniphier_sld8_init(const struct uniphier_board_data *bd) led_puts("L0"); - memconf_init(bd); + uniphier_memconf_2ch_init(bd); led_puts("L1"); -- cgit v1.1 From 9e3bb84bd880d8be82351d689415d6e142dfab32 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sun, 15 Jan 2017 14:59:05 +0900 Subject: ARM: uniphier: refactor SBC init code Merge sbc-admulti.c and sbc-savepin.c into a single file to avoid code duplication. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/init/init-sld8.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/arm/mach-uniphier/init/init-sld8.c') diff --git a/arch/arm/mach-uniphier/init/init-sld8.c b/arch/arm/mach-uniphier/init/init-sld8.c index 8e8d62b..075ac27 100644 --- a/arch/arm/mach-uniphier/init/init-sld8.c +++ b/arch/arm/mach-uniphier/init/init-sld8.c @@ -16,8 +16,7 @@ int uniphier_sld8_init(const struct uniphier_board_data *bd) { uniphier_ld4_bcu_init(bd); - uniphier_sbc_init_savepin(bd); - uniphier_ld4_sbc_init(bd); + uniphier_ld4_sbc_init(); support_card_reset(); -- cgit v1.1 From ef07a99b083378644bcb35e79eebd02b6cb8cd91 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sun, 15 Jan 2017 14:59:06 +0900 Subject: ARM: uniphier: refactor Support Card init code Splitting reset assertion (support_card_reset) and deassertion (support_card_init) is not adding much value any more. Handle all the initialization of Support Card in support_card_init(), then remove support_card_reset(). Also, detect_num_flash_banks() can have a static qualifier. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/init/init-sld8.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'arch/arm/mach-uniphier/init/init-sld8.c') diff --git a/arch/arm/mach-uniphier/init/init-sld8.c b/arch/arm/mach-uniphier/init/init-sld8.c index 075ac27..8da2843 100644 --- a/arch/arm/mach-uniphier/init/init-sld8.c +++ b/arch/arm/mach-uniphier/init/init-sld8.c @@ -18,12 +18,10 @@ int uniphier_sld8_init(const struct uniphier_board_data *bd) uniphier_ld4_sbc_init(); - support_card_reset(); + support_card_init(); uniphier_sld8_dpll_init(bd); - support_card_init(); - led_puts("L0"); uniphier_memconf_2ch_init(bd); -- cgit v1.1 From a8e6300d483d85f9eff211220db582cf6a403c0b Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sun, 15 Jan 2017 14:59:09 +0900 Subject: ARM: uniphier: refactor spl_init_board() Merge init-*.c into a single file using a table of callbacks because the initialization flow is almost common among SoCs. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/init/init-sld8.c | 57 --------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 arch/arm/mach-uniphier/init/init-sld8.c (limited to 'arch/arm/mach-uniphier/init/init-sld8.c') diff --git a/arch/arm/mach-uniphier/init/init-sld8.c b/arch/arm/mach-uniphier/init/init-sld8.c deleted file mode 100644 index 8da2843..0000000 --- a/arch/arm/mach-uniphier/init/init-sld8.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2013-2015 Panasonic Corporation - * Copyright (C) 2015-2016 Socionext Inc. - * Author: Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include - -#include "../init.h" -#include "../micro-support-card.h" - -int uniphier_sld8_init(const struct uniphier_board_data *bd) -{ - uniphier_ld4_bcu_init(bd); - - uniphier_ld4_sbc_init(); - - support_card_init(); - - uniphier_sld8_dpll_init(bd); - - led_puts("L0"); - - uniphier_memconf_2ch_init(bd); - - led_puts("L1"); - - uniphier_sld3_early_clk_init(); - uniphier_sld3_dram_clk_init(); - - led_puts("L2"); - - led_puts("L3"); - -#ifdef CONFIG_SPL_SERIAL_SUPPORT - preloader_console_init(); -#endif - - led_puts("L4"); - - { - int res; - - res = uniphier_sld8_umc_init(bd); - if (res < 0) { - while (1) - ; - } - } - - led_puts("L5"); - - return 0; -} -- cgit v1.1