]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - drivers/net/fsl-mc/mc.c
drivers: net: mc: Report extra memory to Linux
[thirdparty/u-boot.git] / drivers / net / fsl-mc / mc.c
index cc59b21f9f48193c8b28938f64021bac8608d006..c980ba4edb9866c4b94c1ba0958a5a00f05aafdc 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright 2017-2018 NXP
  */
 #include <common.h>
+#include <env.h>
 #include <errno.h>
 #include <linux/bug.h>
 #include <asm/io.h>
@@ -281,6 +282,16 @@ static int mc_fixup_dpl_mac_addr(void *blob, int dpmac_id,
                                 MC_FIXUP_DPL);
 }
 
+void fdt_fixup_mc_ddr(u64 *base, u64 *size)
+{
+       u64 mc_size = mc_get_dram_block_size();
+
+       if (mc_size < MC_DRAM_BLOCK_DEFAULT_SIZE) {
+               *base = mc_get_dram_addr() + mc_size;
+               *size = MC_DRAM_BLOCK_DEFAULT_SIZE - mc_size;
+       }
+}
+
 void fdt_fsl_mc_fixup_iommu_map_entry(void *blob)
 {
        u32 *prop;