From 993d809cc115ce23dd2df1df19dc8bb548cc19cd Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 21 Mar 2021 00:55:48 +0100 Subject: [PATCH] feat(drivers/rcar3): add extra offset if booting B-side In case MFISBTSTSR bit 4 is 1, that means the loader was started as B-side. Load the remaining boot components from 8 MiB offset. Signed-off-by: Marek Vasut Change-Id: I11d882f30ca4f0cf55fd28d3470ff1063d350d10 --- drivers/renesas/common/io/io_rcar.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/renesas/common/io/io_rcar.c b/drivers/renesas/common/io/io_rcar.c index c3e8319de..17d7aaa29 100644 --- a/drivers/renesas/common/io/io_rcar.c +++ b/drivers/renesas/common/io/io_rcar.c @@ -151,6 +151,9 @@ int32_t rcar_get_certificate(const int32_t name, uint32_t *cert) return -EINVAL; } +#define MFISBTSTSR (0xE6260604U) +#define MFISBTSTSR_BOOT_PARTITION (0x00000010U) + static int32_t file_to_offset(const int32_t name, uintptr_t *offset, uint32_t *cert, uint32_t *no_load, uintptr_t *partition) @@ -169,6 +172,9 @@ static int32_t file_to_offset(const int32_t name, uintptr_t *offset, } *offset = rcar_image_header[addr]; + + if (mmio_read_32(MFISBTSTSR) & MFISBTSTSR_BOOT_PARTITION) + *offset += 0x800000; *cert = RCAR_CERT_SIZE; *cert *= RCAR_ATTR_GET_CERTOFF(name_offset[i].attr); *cert += RCAR_SDRAM_certESS;