[U-Boot] [PATCH v3 37/42] common: Move board_get_usable_ram_top() out of common.h
Simon Glass
sjg at chromium.org
Tue Nov 12 19:42:46 UTC 2019
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 at chromium.org>
---
Changes in v3: None
Changes in v2: None
arch/arm/mach-mvebu/arm64-common.c | 1 +
arch/arm/mach-rockchip/sdram_common.c | 1 +
arch/arm/mach-tegra/board2.c | 1 +
arch/mips/mach-jz47xx/jz4780/jz4780.c | 1 +
arch/riscv/cpu/generic/dram.c | 1 +
arch/x86/cpu/broadwell/sdram.c | 1 +
arch/x86/cpu/coreboot/sdram.c | 1 +
arch/x86/cpu/efi/payload.c | 1 +
arch/x86/cpu/efi/sdram.c | 1 +
arch/x86/cpu/intel_common/mrc.c | 1 +
arch/x86/cpu/ivybridge/sdram.c | 1 +
arch/x86/cpu/qemu/dram.c | 1 +
arch/x86/cpu/quark/dram.c | 1 +
arch/x86/cpu/slimbootloader/sdram.c | 1 +
arch/x86/lib/fsp/fsp_dram.c | 1 +
arch/x86/lib/init_helpers.c | 1 +
board/armadeus/apf27/apf27.c | 1 +
board/imgtec/boston/ddr.c | 1 +
board/menlo/m53menlo/m53menlo.c | 1 +
board/raspberrypi/rpi/rpi.c | 1 +
board/ti/am65x/evm.c | 1 +
board/ti/j721e/evm.c | 1 +
common/board_f.c | 1 +
drivers/video/fsl_dcu_fb.c | 1 +
drivers/video/sunxi/sunxi_display.c | 1 +
include/common.h | 11 -----------
include/init.h | 20 ++++++++++++++++++--
lib/efi_loader/efi_memory.c | 1 +
28 files changed, 44 insertions(+), 13 deletions(-)
diff --git a/arch/arm/mach-mvebu/arm64-common.c b/arch/arm/mach-mvebu/arm64-common.c
index aaf7b7c447..40b98dbf08 100644
--- a/arch/arm/mach-mvebu/arm64-common.c
+++ b/arch/arm/mach-mvebu/arm64-common.c
@@ -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>
diff --git a/arch/arm/mach-rockchip/sdram_common.c b/arch/arm/mach-rockchip/sdram_common.c
index 22a4aca940..74a1223532 100644
--- a/arch/arm/mach-rockchip/sdram_common.c
+++ b/arch/arm/mach-rockchip/sdram_common.c
@@ -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_common.h>
diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c
index 07f54f0684..d3497a2673 100644
--- a/arch/arm/mach-tegra/board2.c
+++ b/arch/arm/mach-tegra/board2.c
@@ -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>
diff --git a/arch/mips/mach-jz47xx/jz4780/jz4780.c b/arch/mips/mach-jz47xx/jz4780/jz4780.c
index 0949cbc3d0..967fc41be4 100644
--- a/arch/mips/mach-jz47xx/jz4780/jz4780.c
+++ b/arch/mips/mach-jz47xx/jz4780/jz4780.c
@@ -9,6 +9,7 @@
#include <config.h>
#include <common.h>
#include <cpu_legacy.h>
+#include <init.h>
#include <asm/io.h>
#include <asm/sections.h>
#include <mach/jz4780.h>
diff --git a/arch/riscv/cpu/generic/dram.c b/arch/riscv/cpu/generic/dram.c
index b7b1207235..1dc77efeca 100644
--- a/arch/riscv/cpu/generic/dram.c
+++ b/arch/riscv/cpu/generic/dram.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <fdtdec.h>
+#include <init.h>
#include <linux/sizes.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/arch/x86/cpu/broadwell/sdram.c b/arch/x86/cpu/broadwell/sdram.c
index b31d78c092..dfd8afc35f 100644
--- a/arch/x86/cpu/broadwell/sdram.c
+++ b/arch/x86/cpu/broadwell/sdram.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <dm.h>
+#include <init.h>
#include <pci.h>
#include <syscon.h>
#include <asm/cpu.h>
diff --git a/arch/x86/cpu/coreboot/sdram.c b/arch/x86/cpu/coreboot/sdram.c
index 664817feff..27e859885e 100644
--- a/arch/x86/cpu/coreboot/sdram.c
+++ b/arch/x86/cpu/coreboot/sdram.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <init.h>
#include <asm/e820.h>
#include <asm/arch/sysinfo.h>
diff --git a/arch/x86/cpu/efi/payload.c b/arch/x86/cpu/efi/payload.c
index 019e312527..8f8a933194 100644
--- a/arch/x86/cpu/efi/payload.c
+++ b/arch/x86/cpu/efi/payload.c
@@ -8,6 +8,7 @@
#include <cpu.h>
#include <efi.h>
#include <errno.h>
+#include <init.h>
#include <usb.h>
#include <asm/bootparam.h>
#include <asm/e820.h>
diff --git a/arch/x86/cpu/efi/sdram.c b/arch/x86/cpu/efi/sdram.c
index a45525f842..3143c079ad 100644
--- a/arch/x86/cpu/efi/sdram.c
+++ b/arch/x86/cpu/efi/sdram.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <efi.h>
+#include <init.h>
#include <asm/u-boot-x86.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/arch/x86/cpu/intel_common/mrc.c b/arch/x86/cpu/intel_common/mrc.c
index b35102a3f0..755670a847 100644
--- a/arch/x86/cpu/intel_common/mrc.c
+++ b/arch/x86/cpu/intel_common/mrc.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <dm.h>
+#include <init.h>
#include <syscon.h>
#include <asm/cpu.h>
#include <asm/gpio.h>
diff --git a/arch/x86/cpu/ivybridge/sdram.c b/arch/x86/cpu/ivybridge/sdram.c
index 8a58d0383d..51ca4ad301 100644
--- a/arch/x86/cpu/ivybridge/sdram.c
+++ b/arch/x86/cpu/ivybridge/sdram.c
@@ -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>
diff --git a/arch/x86/cpu/qemu/dram.c b/arch/x86/cpu/qemu/dram.c
index 6707b7b363..19d92f27d8 100644
--- a/arch/x86/cpu/qemu/dram.c
+++ b/arch/x86/cpu/qemu/dram.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <init.h>
#include <asm/post.h>
#include <asm/arch/qemu.h>
diff --git a/arch/x86/cpu/quark/dram.c b/arch/x86/cpu/quark/dram.c
index 1c5d6a963c..3e502c010d 100644
--- a/arch/x86/cpu/quark/dram.c
+++ b/arch/x86/cpu/quark/dram.c
@@ -7,6 +7,7 @@
#include <cpu_legacy.h>
#include <errno.h>
#include <fdtdec.h>
+#include <init.h>
#include <malloc.h>
#include <asm/mrccache.h>
#include <asm/mtrr.h>
diff --git a/arch/x86/cpu/slimbootloader/sdram.c b/arch/x86/cpu/slimbootloader/sdram.c
index 05d40d196c..33e91fb636 100644
--- a/arch/x86/cpu/slimbootloader/sdram.c
+++ b/arch/x86/cpu/slimbootloader/sdram.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <init.h>
#include <linux/sizes.h>
#include <asm/e820.h>
#include <asm/arch/slimbootloader.h>
diff --git a/arch/x86/lib/fsp/fsp_dram.c b/arch/x86/lib/fsp/fsp_dram.c
index 2d1023068f..bc456bb4a9 100644
--- a/arch/x86/lib/fsp/fsp_dram.c
+++ b/arch/x86/lib/fsp/fsp_dram.c
@@ -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>
diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c
index 3e3a11ac2f..5bb55e256f 100644
--- a/arch/x86/lib/init_helpers.c
+++ b/arch/x86/lib/init_helpers.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <init.h>
#include <linux/errno.h>
#include <asm/mtrr.h>
diff --git a/board/armadeus/apf27/apf27.c b/board/armadeus/apf27/apf27.c
index 20be0c3bd4..75395d92cd 100644
--- a/board/armadeus/apf27/apf27.c
+++ b/board/armadeus/apf27/apf27.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <init.h>
#include <jffs2/jffs2.h>
#include <nand.h>
#include <netdev.h>
diff --git a/board/imgtec/boston/ddr.c b/board/imgtec/boston/ddr.c
index 3f8a5c0d8e..241b384668 100644
--- a/board/imgtec/boston/ddr.c
+++ b/board/imgtec/boston/ddr.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <init.h>
#include <asm/io.h>
diff --git a/board/menlo/m53menlo/m53menlo.c b/board/menlo/m53menlo/m53menlo.c
index bda5f0df5b..065e6a2ccc 100644
--- a/board/menlo/m53menlo/m53menlo.c
+++ b/board/menlo/m53menlo/m53menlo.c
@@ -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>
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 9e0abdda31..8898c14f54 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -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>
diff --git a/board/ti/am65x/evm.c b/board/ti/am65x/evm.c
index 544f872459..4d86757c39 100644
--- a/board/ti/am65x/evm.c
+++ b/board/ti/am65x/evm.c
@@ -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>
diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index db5d7b8834..51b121ce05 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
+#include <init.h>
#include <asm/io.h>
#include <spl.h>
#include <asm/arch/sys_proto.h>
diff --git a/common/board_f.c b/common/board_f.c
index 5dcecd66d6..18aa84dba9 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -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>
diff --git a/drivers/video/fsl_dcu_fb.c b/drivers/video/fsl_dcu_fb.c
index add64b85b5..076e9ea019 100644
--- a/drivers/video/fsl_dcu_fb.c
+++ b/drivers/video/fsl_dcu_fb.c
@@ -6,6 +6,7 @@
* FSL DCU Framebuffer driver
*/
+#include <init.h>
#include <asm/io.h>
#include <common.h>
#include <dm.h>
diff --git a/drivers/video/sunxi/sunxi_display.c b/drivers/video/sunxi/sunxi_display.c
index 9172a3b011..9fd864bde2 100644
--- a/drivers/video/sunxi/sunxi_display.c
+++ b/drivers/video/sunxi/sunxi_display.c
@@ -9,6 +9,7 @@
#include <common.h>
#include <cpu_legacy.h>
#include <efi_loader.h>
+#include <init.h>
#include <time.h>
#include <asm/arch/clock.h>
diff --git a/include/common.h b/include/common.h
index 16d4b0612f..9bdd1cf85c 100644
--- a/include/common.h
+++ b/include/common.h
@@ -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
*
diff --git a/include/init.h b/include/init.h
index afc953d51e..6076283d2c 100644
--- a/include/init.h
+++ b/include/init.h
@@ -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 */
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index 83cbc9154f..e2d6ea4fb8 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <efi_loader.h>
+#include <init.h>
#include <malloc.h>
#include <mapmem.h>
#include <watchdog.h>
--
2.24.0.rc1.363.gb1bccd3e3d-goog
More information about the U-Boot
mailing list