MLK-19546 imx8qm/qxp: Fix issue in get_effective_memsize
authorYe Li <ye.li@nxp.com>
Tue, 11 Sep 2018 08:14:41 +0000 (01:14 -0700)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 08:48:14 +0000 (01:48 -0700)
commit170e0b77cddaa8bad28e5c9e57c3dc9af0e11d59
tree9000fb7f3134b554ee389c6dc53f58e270451cfa
parent6b2f0383012c4b20526265f523e274b82d116979
MLK-19546 imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff, the get_effective_memsize
does not return correct memory size. There is a check in get_effective_memsize to find the memreg
where the u-boot is running, and return the size of that memreg as the result of get_effective_memsize.
When using aligned start, the value is 0x80200000 since it is 2MB aligned. Thus the finding of memreg
will fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is 0x80020000.
This cause u-boot relocating to the high memory where has been occupied by Trusty OS.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 13fccde4c694453a3a038c4fb5fdb38cb7327747)
arch/arm/mach-imx/imx8/cpu.c