Commit 033c538e567aca5f0876f2504b5e278c2a0f83a8

Authored by Priyanka Jain
Committed by York Sun
1 parent c055cee195

drivers:net:fsl-mc: Update MC address calculation

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>

Showing 1 changed file with 9 additions and 2 deletions Side-by-side Diff

drivers/net/fsl-mc/mc.c
... ... @@ -800,12 +800,19 @@
800 800 return mc_dpl_applied;
801 801 }
802 802  
803   -/**
  803 +/*
804 804 * Return the MC address of private DRAM block.
  805 + * As per MC design document, MC initial base address
  806 + * should be least significant 512MB address of MC private
  807 + * memory, i.e. address should point to end address masked
  808 + * with 512MB offset in private DRAM block.
805 809 */
806 810 u64 mc_get_dram_addr(void)
807 811 {
808   - return gd->arch.resv_ram;
  812 + size_t mc_ram_size = mc_get_dram_block_size();
  813 +
  814 + return (gd->arch.resv_ram + mc_ram_size - 1) &
  815 + MC_RAM_BASE_ADDR_ALIGNMENT_MASK;
809 816 }
810 817  
811 818 /**