diff mbox series

[05/11] mach-snapdragon: allocate fastboot buffer dynamically

Message ID 20240809-b4-snapdragon-improvements-v1-5-7c353f3e8f74@linaro.org
State New
Headers show
Series mach-snapdragon: various improvements for newer boards | expand

Commit Message

Caleb Connolly Aug. 8, 2024, 11:59 p.m. UTC
We don't know at build time where a sensible place for this is, allocate
it at runtime like the other variables.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
---
 arch/arm/mach-snapdragon/board.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c
index 36335627f4ff..37925c40f36f 100644
--- a/arch/arm/mach-snapdragon/board.c
+++ b/arch/arm/mach-snapdragon/board.c
@@ -410,8 +410,13 @@  void __weak qcom_late_init(void)
 {
 }
 
 #define KERNEL_COMP_SIZE	SZ_64M
+#ifdef CONFIG_FASTBOOT_BUF_SIZE
+#define FASTBOOT_BUF_SIZE CONFIG_FASTBOOT_BUF_SIZE
+#else
+#define FASTBOOT_BUF_SIZE 0
+#endif
 
 #define addr_alloc(lmb, size) lmb_alloc(lmb, size, SZ_2M)
 
 /* Stolen from arch/arm/mach-apple/board.c */
@@ -426,8 +431,10 @@  int board_late_init(void)
 	status |= env_set_hex("kernel_addr_r", addr_alloc(&lmb, SZ_128M));
 	status |= env_set_hex("ramdisk_addr_r", addr_alloc(&lmb, SZ_128M));
 	status |= env_set_hex("kernel_comp_addr_r", addr_alloc(&lmb, KERNEL_COMP_SIZE));
 	status |= env_set_hex("kernel_comp_size", KERNEL_COMP_SIZE);
+	if (IS_ENABLED(CONFIG_FASTBOOT))
+		status |= env_set_hex("fastboot_addr_r", addr_alloc(&lmb, FASTBOOT_BUF_SIZE));
 	status |= env_set_hex("scriptaddr", addr_alloc(&lmb, SZ_4M));
 	status |= env_set_hex("pxefile_addr_r", addr_alloc(&lmb, SZ_4M));
 	status |= env_set_hex("fdt_addr_r", addr_alloc(&lmb, SZ_2M));