void __init arm64_memblock_init(void)
{
+ /*
+ * Remove the memory that we will not be able to cover
+ * with the linear mapping.
+ */
+ const s64 linear_region_size = -(s64)PAGE_OFFSET;
+
+ memblock_remove(0, memstart_addr);
+ memblock_remove(memstart_addr + linear_region_size, ULLONG_MAX);
+
memblock_enforce_memory_limit(memory_limit);
/*
__setup("keepinitrd", keepinitrd_setup);
#endif
+
+void __init early_init_dt_add_memory_arch(u64 base, u64 size)
+{
+ if (!PAGE_ALIGNED(base)) {
+ if (size < PAGE_SIZE - (base & ~PAGE_MASK)) {
+ pr_warn("Ignoring memory block 0x%llx - 0x%llx\n",
+ base, base + size);
+ return;
+ }
+ size -= PAGE_SIZE - (base & ~PAGE_MASK);
+ base = PAGE_ALIGN(base);
+ }
+ size &= PAGE_MASK;
+
+ memblock_add(base, size);
+}