common: android: correct 32-bit non-compressed kernel address

The page size should be reserved before kernel load address.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iaa13fbc9a7a2872c5fb32a388ce96dd94654fc3d
This commit is contained in:
Joseph Chen 2020-03-04 18:26:24 +08:00 committed by Jianhong Chen
parent 591f14a84b
commit 15f6b6d065
1 changed files with 6 additions and 2 deletions

View File

@ -565,10 +565,14 @@ int android_image_parse_comp(struct andr_img_hdr *hdr, ulong *load_addr)
* kernel_addr_r is for IMAGE when kernel_addr_c is defined.
*/
if (comp == IH_COMP_NONE) {
if (kernel_addr_c)
if (kernel_addr_c) {
*load_addr = env_get_ulong("kernel_addr_r", 16, 0);
else
} else {
*load_addr = CONFIG_SYS_SDRAM_BASE + 0x8000;
env_set_hex("kernel_addr_r", *load_addr);
}
*load_addr -= hdr->page_size;
} else {
if (kernel_addr_c)
*load_addr = kernel_addr_c - hdr->page_size;