From cbcbf71bf238abd6daf13116b9a209c8fc98ae64 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 23 Jan 2017 13:31:22 -0700 Subject: [PATCH] powerpc: Drop probecpu() in favour of arch_cpu_init() To avoid an unnecessary arch-specific call in board_init_f(), rename this function. Signed-off-by: Simon Glass --- arch/powerpc/cpu/mpc8xxx/cpu.c | 2 +- board/Arcturus/ucp1020/spl.c | 2 +- board/freescale/b4860qds/spl.c | 2 +- board/freescale/c29xpcie/spl.c | 2 +- board/freescale/p1010rdb/spl.c | 2 +- board/freescale/p1022ds/spl.c | 2 +- board/freescale/p1_p2_rdb_pc/spl.c | 2 +- board/freescale/t102xqds/spl.c | 2 +- board/freescale/t102xrdb/spl.c | 2 +- board/freescale/t104xrdb/spl.c | 2 +- board/freescale/t208xqds/spl.c | 2 +- board/freescale/t208xrdb/spl.c | 2 +- board/freescale/t4qds/spl.c | 2 +- board/freescale/t4rdb/spl.c | 2 +- common/board_f.c | 4 ---- include/common.h | 12 +++++++++++- 16 files changed, 25 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/cpu/mpc8xxx/cpu.c b/arch/powerpc/cpu/mpc8xxx/cpu.c index 584f3b8d616..afb5b512ba5 100644 --- a/arch/powerpc/cpu/mpc8xxx/cpu.c +++ b/arch/powerpc/cpu/mpc8xxx/cpu.c @@ -308,7 +308,7 @@ int is_core_valid(unsigned int core) return !!((1 << core) & cpu_mask()); } -int probecpu (void) +int arch_cpu_init(void) { uint svr; uint ver; diff --git a/board/Arcturus/ucp1020/spl.c b/board/Arcturus/ucp1020/spl.c index 9c19c87b727..3a775be9ae9 100644 --- a/board/Arcturus/ucp1020/spl.c +++ b/board/Arcturus/ucp1020/spl.c @@ -83,7 +83,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L2_ADDR; bd->bi_memsize = CONFIG_SYS_L2_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); diff --git a/board/freescale/b4860qds/spl.c b/board/freescale/b4860qds/spl.c index fabc78301a0..35b812cb184 100644 --- a/board/freescale/b4860qds/spl.c +++ b/board/freescale/b4860qds/spl.c @@ -87,7 +87,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L3_ADDR; bd->bi_memsize = CONFIG_SYS_L3_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); diff --git a/board/freescale/c29xpcie/spl.c b/board/freescale/c29xpcie/spl.c index d8d73c70b8e..6613216950a 100644 --- a/board/freescale/c29xpcie/spl.c +++ b/board/freescale/c29xpcie/spl.c @@ -53,7 +53,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L2_ADDR; bd->bi_memsize = CONFIG_SYS_L2_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); diff --git a/board/freescale/p1010rdb/spl.c b/board/freescale/p1010rdb/spl.c index c22e2156753..05c76f2e45c 100644 --- a/board/freescale/p1010rdb/spl.c +++ b/board/freescale/p1010rdb/spl.c @@ -69,7 +69,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L2_ADDR; bd->bi_memsize = CONFIG_SYS_L2_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c index 6a5fe743437..ef385516005 100644 --- a/board/freescale/p1022ds/spl.c +++ b/board/freescale/p1022ds/spl.c @@ -83,7 +83,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L2_ADDR; bd->bi_memsize = CONFIG_SYS_L2_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); diff --git a/board/freescale/p1_p2_rdb_pc/spl.c b/board/freescale/p1_p2_rdb_pc/spl.c index 9e8f359d0db..2af5576ff72 100644 --- a/board/freescale/p1_p2_rdb_pc/spl.c +++ b/board/freescale/p1_p2_rdb_pc/spl.c @@ -80,7 +80,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L2_ADDR; bd->bi_memsize = CONFIG_SYS_L2_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); diff --git a/board/freescale/t102xqds/spl.c b/board/freescale/t102xqds/spl.c index c9239b87db1..3e96b33c40d 100644 --- a/board/freescale/t102xqds/spl.c +++ b/board/freescale/t102xqds/spl.c @@ -117,7 +117,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L3_ADDR; bd->bi_memsize = CONFIG_SYS_L3_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); diff --git a/board/freescale/t102xrdb/spl.c b/board/freescale/t102xrdb/spl.c index 6d8866e87d9..b70c2c5d791 100644 --- a/board/freescale/t102xrdb/spl.c +++ b/board/freescale/t102xrdb/spl.c @@ -104,7 +104,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L3_ADDR; bd->bi_memsize = CONFIG_SYS_L3_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c index 1c2023b6a32..4402e0f4b04 100644 --- a/board/freescale/t104xrdb/spl.c +++ b/board/freescale/t104xrdb/spl.c @@ -95,7 +95,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L3_ADDR; bd->bi_memsize = CONFIG_SYS_L3_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); diff --git a/board/freescale/t208xqds/spl.c b/board/freescale/t208xqds/spl.c index b1e1cf17e7c..334f5083b8e 100644 --- a/board/freescale/t208xqds/spl.c +++ b/board/freescale/t208xqds/spl.c @@ -103,7 +103,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L3_ADDR; bd->bi_memsize = CONFIG_SYS_L3_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); diff --git a/board/freescale/t208xrdb/spl.c b/board/freescale/t208xrdb/spl.c index bb23865d3be..aa8e9285fef 100644 --- a/board/freescale/t208xrdb/spl.c +++ b/board/freescale/t208xrdb/spl.c @@ -73,7 +73,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L3_ADDR; bd->bi_memsize = CONFIG_SYS_L3_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); diff --git a/board/freescale/t4qds/spl.c b/board/freescale/t4qds/spl.c index 6ca0f03ffe8..5e946dc84f6 100644 --- a/board/freescale/t4qds/spl.c +++ b/board/freescale/t4qds/spl.c @@ -112,7 +112,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L3_ADDR; bd->bi_memsize = CONFIG_SYS_L3_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); diff --git a/board/freescale/t4rdb/spl.c b/board/freescale/t4rdb/spl.c index b148a7fd1fa..a32e34ef96c 100644 --- a/board/freescale/t4rdb/spl.c +++ b/board/freescale/t4rdb/spl.c @@ -76,7 +76,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L3_ADDR; bd->bi_memsize = CONFIG_SYS_L3_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); diff --git a/common/board_f.c b/common/board_f.c index cc8aee74f03..5e2b8d14d47 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -858,10 +858,6 @@ static init_fnc_t init_sequence_f[] = { #endif initf_malloc, initf_console_record, -#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) - /* TODO: can this go into arch_cpu_init()? */ - probecpu, -#endif #if defined(CONFIG_X86) && defined(CONFIG_HAVE_FSP) x86_fsp_init, #endif diff --git a/include/common.h b/include/common.h index 2af555ee00c..53cdadf09cc 100644 --- a/include/common.h +++ b/include/common.h @@ -600,7 +600,17 @@ int cpu_num_dspcores(void); u32 cpu_mask (void); u32 cpu_dsp_mask(void); int is_core_valid (unsigned int); -int probecpu (void); + +/** + * arch_cpu_init() - basic cpu-dependent setup for an architecture + * + * This is called after early malloc is available. It should handle any + * CPU- or SoC- specific init needed to continue the init sequence. See + * board_f.c for where it is called. If this is not provided, a default + * version (which does nothing) will be used. + */ +int arch_cpu_init(void); + int checkcpu (void); int checkicache (void); int checkdcache (void);