]> git.sur5r.net Git - u-boot/commitdiff
drivers:net:fsl-mc: Update MC address calculation
authorPriyanka Jain <priyanka.jain@nxp.com>
Thu, 24 Aug 2017 11:12:43 +0000 (16:42 +0530)
committerYork Sun <york.sun@nxp.com>
Mon, 11 Sep 2017 14:55:36 +0000 (07:55 -0700)
Update MC address calculation as per MC design requirement of address
as least significant 512MB address of MC private allocated memory,
i.e. address should point to end address masked with 512MB offset in
private DRAM block.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Ashish Kumar <ashish.kumar@nxp.com>
[YS: reformatted commit message]
Reviewed-by: York Sun <york.sun@nxp.com>
drivers/net/fsl-mc/mc.c

index bdb6792c72aa4ffce3bf7dea6e4f4338cb672e9d..12dbcd8cc50e3e227a84b89827a1ad5cb4779e25 100644 (file)
@@ -800,12 +800,19 @@ int get_dpl_apply_status(void)
        return mc_dpl_applied;
 }
 
-/**
+/*
  * Return the MC address of private DRAM block.
+ * As per MC design document, MC initial base address
+ * should be least significant 512MB address of MC private
+ * memory, i.e. address should point to end address masked
+ * with 512MB offset in private DRAM block.
  */
 u64 mc_get_dram_addr(void)
 {
-       return gd->arch.resv_ram;
+       size_t mc_ram_size = mc_get_dram_block_size();
+
+       return (gd->arch.resv_ram + mc_ram_size - 1) &
+               MC_RAM_BASE_ADDR_ALIGNMENT_MASK;
 }
 
 /**