From d4c671cc2742927d3aef830b3b56e1ca2377c887 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 5 Mar 2015 12:25:16 -0700 Subject: dm: Add a new CPU init function which can use driver model Since driver model is set up after arch_cpu_init(), that function cannot use drivers. Add a new arch_cpu_init_dm() function which is called immediately after driver model is ready, and can reference devices. This can be used to probe essential devices for the CPU. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/common.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/common.h b/include/common.h index 6df05b8bb1..9c0f1ba811 100644 --- a/include/common.h +++ b/include/common.h @@ -252,6 +252,17 @@ static inline int print_cpuinfo(void) int update_flash_size(int flash_size); int arch_early_init_r(void); +/** + * arch_cpu_init_dm() - init CPU after driver model is available + * + * This is called immediately after driver model is available before + * relocation. This is similar to arch_cpu_init() but is able to reference + * devices + * + * @return 0 if OK, -ve on error + */ +int arch_cpu_init_dm(void); + /** * Reserve all necessary stacks * -- cgit