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 96a248c..656084c 100644 (file)
@@ -12,6 +12,8 @@
  */
 #include <common.h>
 #include <init.h>
+#include <lmb.h>
+#include <asm/global_data.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -32,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);
+}