summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMeenakshi Aggarwal <[email protected]>2019-05-23 15:13:43 +0530
committerPrabhakar Kushwaha <[email protected]>2019-08-22 09:07:35 +0530
commitcf0bbbd1ee7b7c5e40db81c6b61d82e853dd50fb (patch)
tree22b980b6c204495ecd6a60b278904b5af6ebc8e4 /drivers
parent1e60ccd94318fb86610e1e28512b2aaac5f4b069 (diff)
drivers: net: mc: Report extra memory to Linux
MC firmware need to be aligned to 512M, so minimum 512MB DDR is reserved. But MC support to work with 128MB or 256MB DDR memory also, in this case, rest of the memory is not usable. So reporting this extra memory to Linux through dtb memory fixup. Signed-off-by: Meenakshi Aggarwal <[email protected]> Reviewed-by: Prabhakar Kushwaha <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/fsl-mc/mc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index 1d96e4bdc2f..c980ba4edb9 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -282,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;