]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board_f: Introduce arch_setup_bdinfo initcall
authorOvidiu Panait <ovidiu.panait@windriver.com>
Fri, 24 Jul 2020 11:12:15 +0000 (14:12 +0300)
committerTom Rini <trini@konsulko.com>
Thu, 6 Aug 2020 18:26:35 +0000 (14:26 -0400)
Certain architectures (ppc, mips, sh, m68k) use setup board_part1 and
setup_board_part2 calls during pre-relocation init to populate gd->bd
boardinfo fields. This makes the generic init sequence cluttered with
arch-specific ifdefs.

In order to clean these arch-specific sequences from generic init,
introduce arch_setup_bdinfo weak initcall so that everyone can define their
own bdinfo setup routines.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
common/board_f.c
include/init.h

index 72446f6da5054d3794f1e9b1d14892af6dc0a052..43564314886b77f34e273ee02740609f9abc24c7 100644 (file)
@@ -598,11 +598,16 @@ static int display_new_sp(void)
        return 0;
 }
 
-int setup_bdinfo(void)
+__weak int arch_setup_bdinfo(void)
 {
        return 0;
 }
 
+int setup_bdinfo(void)
+{
+       return arch_setup_bdinfo();
+}
+
 #if defined(CONFIG_M68K) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \
        defined(CONFIG_SH)
 static int setup_board_part1(void)
index f2cd77007958a2bb54aa811c1a6d763e8f708c81..0f48ccb57ad274417fbffca66ce20392d23de531 100644 (file)
@@ -141,6 +141,18 @@ int arch_reserve_stacks(void);
  */
 int arch_reserve_mmu(void);
 
+/**
+ * arch_setup_bdinfo() - Architecture dependent boardinfo setup
+ *
+ * Architecture-specific routine for populating various boardinfo fields of
+ * gd->bd. It is called during the generic board init sequence.
+ *
+ * If an implementation is not provided, it will just be a nop stub.
+ *
+ * Return: 0 if OK
+ */
+int arch_setup_bdinfo(void);
+
 /**
  * setup_bdinfo() - Generic boardinfo setup
  *