summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-03-28 09:56:05 -0400
committerTom Rini <trini@konsulko.com>2022-03-28 09:56:05 -0400
commit94e836f7ddab44f5e62e69a2f9fa97e975fd1b90 (patch)
treed3d5947e5c1e76e0295e1c6e854ae9b35aaeac71 /arch
parentc259b197f6f8a4b1d33700e0b9202781fb8ce737 (diff)
parented48490f8d3f8715b23071a8a1cbe5bba8c8626e (diff)
Merge branch '2022-03-28-critical-fixes'
- A zstd, two Apple M1 and an MXS NAND critical bugfix - Clean up another file that wasn't being removed and update some external documentation links.
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-apple/board.c32
-rw-r--r--arch/arm/mach-apple/rtkit.c2
2 files changed, 15 insertions, 19 deletions
diff --git a/arch/arm/mach-apple/board.c b/arch/arm/mach-apple/board.c
index 54005f3adf0..722dff1f64c 100644
--- a/arch/arm/mach-apple/board.c
+++ b/arch/arm/mach-apple/board.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <dm.h>
#include <efi_loader.h>
+#include <lmb.h>
#include <asm/armv8/mmu.h>
#include <asm/global_data.h>
@@ -266,32 +267,27 @@ u64 get_page_table_size(void)
return SZ_256K;
}
+#define KERNEL_COMP_SIZE SZ_128M
+
int board_late_init(void)
{
- unsigned long base;
- unsigned long top;
+ struct lmb lmb;
u32 status = 0;
- /* Reserve 4M each for scriptaddr and pxefile_addr_r at the top of RAM
- * at least 1M below the stack.
- */
- top = gd->start_addr_sp - CONFIG_STACK_SIZE - SZ_8M - SZ_1M;
- top = ALIGN_DOWN(top, SZ_8M);
-
- status |= env_set_hex("scriptaddr", top + SZ_4M);
- status |= env_set_hex("pxefile_addr_r", top);
+ lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob);
/* somewhat based on the Linux Kernel boot requirements:
* align by 2M and maximal FDT size 2M
*/
- base = ALIGN(gd->ram_base, SZ_2M);
-
- status |= env_set_hex("fdt_addr_r", base);
- status |= env_set_hex("kernel_addr_r", base + SZ_2M);
- status |= env_set_hex("ramdisk_addr_r", base + SZ_128M);
- status |= env_set_hex("loadaddr", base + SZ_2G);
- status |= env_set_hex("kernel_comp_addr_r", base + SZ_2G - SZ_128M);
- status |= env_set_hex("kernel_comp_size", SZ_128M);
+ status |= env_set_hex("loadaddr", lmb_alloc(&lmb, SZ_1G, SZ_2M));
+ status |= env_set_hex("fdt_addr_r", lmb_alloc(&lmb, SZ_2M, SZ_2M));
+ status |= env_set_hex("kernel_addr_r", lmb_alloc(&lmb, SZ_128M, SZ_2M));
+ status |= env_set_hex("ramdisk_addr_r", lmb_alloc(&lmb, SZ_1G, SZ_2M));
+ status |= env_set_hex("kernel_comp_addr_r",
+ lmb_alloc(&lmb, KERNEL_COMP_SIZE, SZ_2M));
+ status |= env_set_hex("kernel_comp_size", KERNEL_COMP_SIZE);
+ status |= env_set_hex("scriptaddr", lmb_alloc(&lmb, SZ_4M, SZ_2M));
+ status |= env_set_hex("pxefile_addr_r", lmb_alloc(&lmb, SZ_4M, SZ_2M));
if (status)
log_warning("late_init: Failed to set run time variables\n");
diff --git a/arch/arm/mach-apple/rtkit.c b/arch/arm/mach-apple/rtkit.c
index dff475cab7d..2dcb8bdd3e4 100644
--- a/arch/arm/mach-apple/rtkit.c
+++ b/arch/arm/mach-apple/rtkit.c
@@ -170,7 +170,7 @@ wait_epmap:
pwrstate = APPLE_RTKIT_PWR_STATE_SLEEP;
while (pwrstate != APPLE_RTKIT_PWR_STATE_ON) {
- ret = mbox_recv(chan, &msg, 100000);
+ ret = mbox_recv(chan, &msg, 1000000);
if (ret < 0)
return ret;