x86: tangier: Find proper memory region for relocation
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 27 Nov 2020 12:40:48 +0000 (14:40 +0200)
committerBin Meng <bmeng.cn@gmail.com>
Wed, 16 Dec 2020 05:47:34 +0000 (13:47 +0800)
commit21096c0af3733b63c1e9ee7772d95a0551b4fc85
tree00856a945ce7ade49ffe22ed3a03370d19213b4e
parent1b6314be50df11d9c07ba3c13618bac9df838d07
x86: tangier: Find proper memory region for relocation

It appears that U-Boot works by luck on Intel Edison board because the amount
of RAM is less than 1 GB and standard way of calculating the top of it work
for this configuration. However, this won't work if the amount of RAM is
different and split differently in address space. We have to find the suitable
window correctly.

Find proper memory region for relocation by scanning MMAP SFI table in
board_get_usable_ram_top() callback.

According to the address map documentation the Main Memory is guaranteed to lie
in the 0..2 GB range, that's why we limit search by this range.

Fixes: e71de54a4943 ("x86: Add Intel Tangier support")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: fixed a typo in the commit message]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/tangier/sdram.c