[PATCH u-boot-marvell v3 22/39] tools: kwboot: Patch destination address to DDR area for SPI image

Stefan Roese sr at denx.de
Fri Oct 1 08:23:00 CEST 2021


On 24.09.21 23:06, Marek Behún wrote:
> From: Pali Rohár <pali at kernel.org>
> 
> SPI/NOR kwbimage may have destination address set to 0xFFFFFFFF, which
> means that the image is not downloaded to DDR but rather it is executed
> directly from SPI/NOR. In this case execution address is set to SPI/NOR
> area.
> 
> When patching image to UART type, change destination and execution
> addresses from SPI/NOR XIP area to DDR area 0x00800000 (which is default
> for A38x).
> 
> Signed-off-by: Pali Rohár <pali at kernel.org>
> [ refactored ]
> Signed-off-by: Marek Behún <marek.behun at nic.cz>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   tools/kwboot.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/tools/kwboot.c b/tools/kwboot.c
> index 907a574bfc..b1dcd3796c 100644
> --- a/tools/kwboot.c
> +++ b/tools/kwboot.c
> @@ -836,6 +836,14 @@ kwboot_img_patch_hdr(void *img, size_t size)
>   		if (srcaddr == 0xFFFFFFFF)
>   			hdr->srcaddr = cpu_to_le32(hdrsz);
>   		break;
> +
> +	case IBR_HDR_SPI_ID:
> +		if (hdr->destaddr == cpu_to_le32(0xFFFFFFFF)) {
> +			kwboot_printv("Patching destination and execution addresses from SPI/NOR XIP area to DDR area 0x00800000\n");
> +			hdr->destaddr = cpu_to_le32(0x00800000);
> +			hdr->execaddr = cpu_to_le32(0x00800000);
> +		}
> +		break;
>   	}
>   
>   	is_secure = kwboot_img_is_secure(img);
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list