u-boot/arch/riscv/dts/binman.dtsi
Mayuresh Chitale 5a348ccf02 riscv: binman: Fix compilation error
Some platforms may not have any DDR memory below 4G and for such platforms
the TEXT_BASE and LOAD addresses etc are all 64 bit addresses due to
which the u-boot build fails with below error:

u-boot/arch/riscv/dts/binman.dtsi:30.14-25
Value out of range for 32-bit array element
u-boot/arch/riscv/dts/binman.dtsi:43.14-25
Value out of range for 32-bit array element
u-boot/arch/riscv/dts/binman.dtsi:44.15-26
Value out of range for 32-bit array element
FATAL ERROR: Syntax error parsing input tree

Fix by setting the address-cells property to 2 and converting load
addresses to 64 bit values.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-19 17:29:32 +08:00

85 lines
1.6 KiB
Text

// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2021, Bin Meng <bmeng.cn@gmail.com>
*/
#include <config.h>
#define U64_TO_U32_H(addr) (((addr) >> 32) & 0xffffffff)
#define U64_TO_U32_L(addr) ((addr) & 0xffffffff)
/ {
binman: binman {
multiple-images;
};
};
&binman {
itb {
filename = "u-boot.itb";
fit {
description = "Configuration to load OpenSBI before U-Boot";
#address-cells = <2>;
fit,fdt-list = "of-list";
images {
uboot {
description = "U-Boot";
type = "standalone";
os = "U-Boot";
arch = "riscv";
compression = "none";
load = <U64_TO_U32_H(CONFIG_TEXT_BASE)
U64_TO_U32_L(CONFIG_TEXT_BASE)>;
uboot_blob: blob-ext {
filename = "u-boot-nodtb.bin";
};
};
opensbi {
description = "OpenSBI fw_dynamic Firmware";
type = "firmware";
os = "opensbi";
arch = "riscv";
compression = "none";
load = <U64_TO_U32_H(CONFIG_SPL_OPENSBI_LOAD_ADDR)
U64_TO_U32_L(CONFIG_SPL_OPENSBI_LOAD_ADDR)>;
entry = <U64_TO_U32_H(CONFIG_SPL_OPENSBI_LOAD_ADDR)
U64_TO_U32_L(CONFIG_SPL_OPENSBI_LOAD_ADDR)>;
opensbi_blob: opensbi {
filename = "fw_dynamic.bin";
missing-msg = "opensbi";
};
};
#ifndef CONFIG_OF_BOARD
@fdt-SEQ {
description = "NAME";
type = "flat_dt";
compression = "none";
};
#endif
};
configurations {
default = "conf-1";
#ifndef CONFIG_OF_BOARD
@conf-SEQ {
#else
conf-1 {
#endif
description = "NAME";
firmware = "opensbi";
loadables = "uboot";
#ifndef CONFIG_OF_BOARD
fdt = "fdt-SEQ";
#endif
};
};
};
};
};