Merge tag 'u-boot-stm32-20211012' of https://source.denx.de/u-boot/custodians/u-boot-stm
[platform/kernel/u-boot.git] / arch / arm / lib / stack.c
index c89a219..656084c 100644 (file)
@@ -11,6 +11,9 @@
  * Marius Groeger <mgroeger@sysgo.de>
  */
 #include <common.h>
+#include <init.h>
+#include <lmb.h>
+#include <asm/global_data.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -31,3 +34,16 @@ int arch_reserve_stacks(void)
 
        return 0;
 }
+
+static ulong get_sp(void)
+{
+       ulong ret;
+
+       asm("mov %0, sp" : "=r"(ret) : );
+       return ret;
+}
+
+void arch_lmb_reserve(struct lmb *lmb)
+{
+       arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 16384);
+}