common: Move board_get_usable_ram_top() out of common.h
authorSimon Glass <sjg@chromium.org>
Thu, 14 Nov 2019 19:57:45 +0000 (12:57 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 2 Dec 2019 23:25:04 +0000 (18:25 -0500)
Move this function into init.h which seems to be designed for this sort
of thing. Also update the header to declare struct global_data so that it
can be included without global_data.h being needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
28 files changed:
arch/arm/mach-mvebu/arm64-common.c
arch/arm/mach-rockchip/sdram.c
arch/arm/mach-tegra/board2.c
arch/mips/mach-jz47xx/jz4780/jz4780.c
arch/riscv/cpu/generic/dram.c
arch/x86/cpu/broadwell/sdram.c
arch/x86/cpu/coreboot/sdram.c
arch/x86/cpu/efi/payload.c
arch/x86/cpu/efi/sdram.c
arch/x86/cpu/intel_common/mrc.c
arch/x86/cpu/ivybridge/sdram.c
arch/x86/cpu/qemu/dram.c
arch/x86/cpu/quark/dram.c
arch/x86/cpu/slimbootloader/sdram.c
arch/x86/lib/fsp/fsp_dram.c
arch/x86/lib/init_helpers.c
board/armadeus/apf27/apf27.c
board/imgtec/boston/ddr.c
board/menlo/m53menlo/m53menlo.c
board/raspberrypi/rpi/rpi.c
board/ti/am65x/evm.c
board/ti/j721e/evm.c
common/board_f.c
drivers/video/fsl_dcu_fb.c
drivers/video/sunxi/sunxi_display.c
include/common.h
include/init.h
lib/efi_loader/efi_memory.c

index aaf7b7c4472c4f9834dc9957606ff010df82993f..40b98dbf08b03d08c7522b6e2b5f27deab77bf04 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <dm.h>
 #include <fdtdec.h>
+#include <init.h>
 #include <linux/libfdt.h>
 #include <linux/sizes.h>
 #include <pci.h>
index af00a6b637a327b086512f64ffe6f961c1bd8582..530644c0434ccd36cbc546a65a280590f18cbfba 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <init.h>
 #include <ram.h>
 #include <asm/io.h>
 #include <asm/arch-rockchip/sdram.h>
index 07f54f0684888b58d155f0d0e39faf558b139035..d3497a2673e5588faf624df0bf04fdc43cf755d2 100644 (file)
@@ -8,6 +8,7 @@
 #include <dm.h>
 #include <env.h>
 #include <errno.h>
+#include <init.h>
 #include <ns16550.h>
 #include <usb.h>
 #include <asm/io.h>
index ec18df8879d24dfa695b5922039530228299a3f5..0ae5e09e01985ec969e3d8ef4f5f243805e32bc5 100644 (file)
@@ -9,6 +9,7 @@
 #include <config.h>
 #include <common.h>
 #include <cpu_func.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/sections.h>
 #include <mach/jz4780.h>
index b7b120723510290dccd7d80a610c08a549a634cc..1dc77efeca550a5d3b727669ba911c2c976f108e 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <fdtdec.h>
+#include <init.h>
 #include <linux/sizes.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index b31d78c092ada20ac94902fa3b2c34ffc8c45776..dfd8afc35f5a35d6f89d5d4c7f6c93d40bbe84aa 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <init.h>
 #include <pci.h>
 #include <syscon.h>
 #include <asm/cpu.h>
index 664817feffd774a3fd9e31ff62e61a8e4a5db629..27e859885e8c41a7b49fff227b750f1223db86db 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/e820.h>
 #include <asm/arch/sysinfo.h>
 
index af6dd2f7434d2c650e02333e194ca551dcb137fd..66df1287871796fcd84ff3c36e939d2ab58d02fa 100644 (file)
@@ -8,6 +8,7 @@
 #include <cpu_func.h>
 #include <efi.h>
 #include <errno.h>
+#include <init.h>
 #include <usb.h>
 #include <asm/bootparam.h>
 #include <asm/e820.h>
index a45525f842e63c4c1a732d14cb382926c0f546b9..3143c079adbd9182aa09bba9aa529b882c009793 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <efi.h>
+#include <init.h>
 #include <asm/u-boot-x86.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index b35102a3f084e7286df11d25bd6f9c9365778d53..755670a847e14f9bc52715c37d31b3f0eaf6797b 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <init.h>
 #include <syscon.h>
 #include <asm/cpu.h>
 #include <asm/gpio.h>
index 8a58d0383d506e29f12773a6766fe3d998804df0..51ca4ad3017eebb0f198f98b4eef0d1535ea5fe0 100644 (file)
@@ -12,6 +12,7 @@
 #include <common.h>
 #include <errno.h>
 #include <fdtdec.h>
+#include <init.h>
 #include <malloc.h>
 #include <net.h>
 #include <rtc.h>
index 6707b7b363493b4cad1efed46f76cbf99a80cdc6..19d92f27d80c53a0edee11b0364e0f55075d03bd 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/post.h>
 #include <asm/arch/qemu.h>
 
index 1b764dfccde29523431848a89bc0cdf3396aa4ff..995e119fb6f09e955b51512a67972464b51a2e7a 100644 (file)
@@ -7,6 +7,7 @@
 #include <cpu_func.h>
 #include <errno.h>
 #include <fdtdec.h>
+#include <init.h>
 #include <malloc.h>
 #include <asm/mrccache.h>
 #include <asm/mtrr.h>
index 05d40d196ce5bfa1f0e581605cc08c6a98a89ab3..33e91fb6366b59d17dcfb37308b52ad027281b1d 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <linux/sizes.h>
 #include <asm/e820.h>
 #include <asm/arch/slimbootloader.h>
index 2d1023068feb856015aab667dd319b46f3e04004..bc456bb4a9e0442e2af461c69cb04e3f3b0ff4a9 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <handoff.h>
+#include <init.h>
 #include <asm/fsp/fsp_support.h>
 #include <asm/e820.h>
 #include <asm/mrccache.h>
index 3e3a11ac2fa93e4bd2675f2cdc012917407182b7..5bb55e256fbb966aa047525671b27aaa3437e85d 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <linux/errno.h>
 #include <asm/mtrr.h>
 
index 20be0c3bd4ef7dad734f010c2ac680d9df87072d..75395d92cd1fb151bf7295182a308c7d60006bd0 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <jffs2/jffs2.h>
 #include <nand.h>
 #include <netdev.h>
index 3f8a5c0d8e6ba1ceaa489b621f6a58865bf90e3e..241b3846687ad5d1058b9e82cced83966eb8e16c 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 
 #include <asm/io.h>
 
index bda5f0df5bceb7adff8d28fb22f07f913bc6ada8..065e6a2ccc444d1f2e736c6f481b8a6dc7b2700b 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
index 3d4afaf653aa9d6932f077c45faa9666eb030a56..5f120ea9c282fdd3cd02bf657b99d1c87ad20b79 100644 (file)
@@ -10,6 +10,7 @@
 #include <efi_loader.h>
 #include <fdt_support.h>
 #include <fdt_simplefb.h>
+#include <init.h>
 #include <lcd.h>
 #include <memalign.h>
 #include <mmc.h>
index 544f872459c879d6935258ea59e376c451f75e80..4d86757c39de6524b5afbac59701402e02bd548a 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <init.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/hardware.h>
 #include <asm/gpio.h>
index db5d7b8834f1cbd5168952cfd1b5cc2b2db8a369..51b121ce05f31319364c98f0fd5a64dc6e8cfa98 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <spl.h>
 #include <asm/arch/sys_proto.h>
index 05f4b73c6ed3db2ad666f16b9187baa1440b3331..d66afb37ca2f3966281a49920b17340367ecea5a 100644 (file)
@@ -20,6 +20,7 @@
 #include <fdtdec.h>
 #include <fs.h>
 #include <i2c.h>
+#include <init.h>
 #include <initcall.h>
 #include <lcd.h>
 #include <malloc.h>
index add64b85b5901ee9bbbcfd2eefcbf5f46d0fe891..076e9ea0193eb831975144f9faface1e1655d459 100644 (file)
@@ -6,6 +6,7 @@
  * FSL DCU Framebuffer driver
  */
 
+#include <init.h>
 #include <asm/io.h>
 #include <common.h>
 #include <dm.h>
index b1aa4b25be4fdcf4c31e2085ad8595fca1da6fda..31f0aa7ddcc456d9f38d4cb0cac798cbcf416dc9 100644 (file)
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <cpu_func.h>
 #include <efi_loader.h>
+#include <init.h>
 #include <time.h>
 
 #include <asm/arch/clock.h>
index 16d4b0612f8c54d39d6ec7a6580476b60f560f84..9bdd1cf85c41827f37f74f1bf07c44e3dd15a400 100644 (file)
@@ -73,17 +73,6 @@ extern u8 __dtb_dt_begin[];  /* embedded device tree blob */
 extern u8 __dtb_dt_spl_begin[];        /* embedded device tree blob for SPL/TPL */
 int mdm_init(void);
 
-/**
- * Get the uppermost pointer that is valid to access
- *
- * Some systems may not map all of their address space. This function allows
- * boards to indicate what their highest support pointer value is for DRAM
- * access.
- *
- * @param total_size   Size of U-Boot (unused?)
- */
-ulong board_get_usable_ram_top(ulong total_size);
-
 /**
  * arch_fixup_fdt() - Write arch-specific information to fdt
  *
index afc953d51e2d07cdbcde9459b7c2d275c3e60dee..6076283d2c8f70e2548bcb0a9ac48f6415200b08 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef __INIT_H_
 #define __INIT_H_      1
 
+#include <linux/types.h>
+
 #ifndef __ASSEMBLY__           /* put C only stuff in this section */
 
 /*
@@ -149,6 +151,8 @@ ulong board_init_f_alloc_reserve(ulong top);
  */
 void board_init_f_init_reserve(ulong base);
 
+struct global_data;
+
 /**
  * arch_setup_gd() - Set up the global_data pointer
  * @gd_ptr: Pointer to global data
@@ -160,10 +164,11 @@ void board_init_f_init_reserve(ulong base);
  *
  *    gd = gd_ptr;
  */
-void arch_setup_gd(gd_t *gd_ptr);
+void arch_setup_gd(struct global_data *gd_ptr);
 
 /* common/board_r.c */
-void board_init_r(gd_t *id, ulong dest_addr) __attribute__ ((noreturn));
+void board_init_r(struct global_data *id, ulong dest_addr)
+       __attribute__ ((noreturn));
 
 int cpu_init_r(void);
 int last_stage_init(void);
@@ -181,6 +186,17 @@ int init_func_vid(void);
 int checkboard(void);
 int show_board_info(void);
 
+/**
+ * Get the uppermost pointer that is valid to access
+ *
+ * Some systems may not map all of their address space. This function allows
+ * boards to indicate what their highest support pointer value is for DRAM
+ * access.
+ *
+ * @param total_size   Size of U-Boot (unused?)
+ */
+ulong board_get_usable_ram_top(ulong total_size);
+
 #endif /* __ASSEMBLY__ */
 /* Put only stuff here that the assembler can digest */
 
index d46001f608bc59e8ee9bf7a21908bdb110887162..89adf2031024cd189ff00d52a7d732a513240fb3 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <efi_loader.h>
+#include <init.h>
 #include <malloc.h>
 #include <mapmem.h>
 #include <watchdog.h>