aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/Kconfig2
-rw-r--r--common/board_f.c21
-rw-r--r--common/board_r.c4
-rw-r--r--common/hash.c1
-rw-r--r--common/spl/Kconfig2
-rw-r--r--common/spl/Kconfig.tpl2
-rw-r--r--common/spl/spl_mmc.c2
-rw-r--r--common/spl/spl_semihosting.c31
8 files changed, 48 insertions, 17 deletions
diff --git a/common/Kconfig b/common/Kconfig
index cdb77a6a7d..0b09bd68bd 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1031,7 +1031,7 @@ config BLOBLIST_SIZE
config BLOBLIST_SIZE_RELOC
hex "Size of bloblist after relocation"
default BLOBLIST_SIZE if BLOBLIST_FIXED || BLOBLIST_ALLOC
- default 0 if BLOBLIST_PASSAGE
+ default 0x0 if BLOBLIST_PASSAGE
help
Sets the size of the bloblist in bytes after relocation. Since U-Boot
has a lot more memory available then, it is possible to use a larger
diff --git a/common/board_f.c b/common/board_f.c
index e9f4edb93d..2f986d9b28 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -124,8 +124,8 @@ static int display_text_info(void)
#if !defined(CONFIG_SANDBOX) && !defined(CONFIG_EFI_APP)
ulong bss_start, bss_end, text_base;
- bss_start = (ulong)&__bss_start;
- bss_end = (ulong)&__bss_end;
+ bss_start = (ulong)__bss_start;
+ bss_end = (ulong)__bss_end;
#ifdef CONFIG_TEXT_BASE
text_base = CONFIG_TEXT_BASE;
@@ -148,11 +148,12 @@ static int print_resetinfo(void)
bool status_printed = false;
int ret;
- /* Not all boards have sysreset drivers available during early
+ /*
+ * Not all boards have sysreset drivers available during early
* boot, so don't fail if one can't be found.
*/
for (ret = uclass_first_device_check(UCLASS_SYSRESET, &dev); dev;
- ret = uclass_next_device_check(&dev)) {
+ ret = uclass_next_device_check(&dev)) {
if (ret) {
debug("%s: %s sysreset device (error: %d)\n",
__func__, dev->name, ret);
@@ -289,21 +290,21 @@ __weak int init_func_vid(void)
static int setup_mon_len(void)
{
#if defined(__ARM__) || defined(__MICROBLAZE__)
- gd->mon_len = (ulong)&__bss_end - (ulong)_start;
+ gd->mon_len = (ulong)__bss_end - (ulong)_start;
#elif defined(CONFIG_SANDBOX) && !defined(__riscv)
- gd->mon_len = (ulong)&_end - (ulong)_init;
+ gd->mon_len = (ulong)_end - (ulong)_init;
#elif defined(CONFIG_SANDBOX)
/* gcc does not provide _init in crti.o on RISC-V */
gd->mon_len = 0;
#elif defined(CONFIG_EFI_APP)
- gd->mon_len = (ulong)&_end - (ulong)_init;
+ gd->mon_len = (ulong)_end - (ulong)_init;
#elif defined(CONFIG_NIOS2) || defined(CONFIG_XTENSA)
gd->mon_len = CONFIG_SYS_MONITOR_LEN;
#elif defined(CONFIG_SH) || defined(CONFIG_RISCV)
- gd->mon_len = (ulong)(&__bss_end) - (ulong)(&_start);
+ gd->mon_len = (ulong)(__bss_end) - (ulong)(_start);
#elif defined(CONFIG_SYS_MONITOR_BASE)
- /* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */
- gd->mon_len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE;
+ /* TODO: use (ulong)__bss_end - (ulong)__text_start; ? */
+ gd->mon_len = (ulong)__bss_end - CONFIG_SYS_MONITOR_BASE;
#endif
return 0;
}
diff --git a/common/board_r.c b/common/board_r.c
index 4aaa894031..598155c775 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -126,9 +126,9 @@ static int initr_reloc_global_data(void)
#ifdef __ARM__
monitor_flash_len = _end - __image_copy_start;
#elif defined(CONFIG_RISCV)
- monitor_flash_len = (ulong)&_end - (ulong)&_start;
+ monitor_flash_len = (ulong)_end - (ulong)_start;
#elif !defined(CONFIG_SANDBOX) && !defined(CONFIG_NIOS2)
- monitor_flash_len = (ulong)&__init_end - gd->relocaddr;
+ monitor_flash_len = (ulong)__init_end - gd->relocaddr;
#endif
#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
/*
diff --git a/common/hash.c b/common/hash.c
index cbffdfd6db..159179e7f2 100644
--- a/common/hash.c
+++ b/common/hash.c
@@ -21,7 +21,6 @@
#include <asm/global_data.h>
#include <asm/io.h>
#include <linux/errno.h>
-#include <u-boot/crc.h>
#else
#include "mkimage.h"
#include <linux/compiler_attributes.h>
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index c5dd476db5..1c2fe78e3e 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -67,7 +67,7 @@ config SPL_SIZE_LIMIT_SUBTRACT_MALLOC
config SPL_SIZE_LIMIT_PROVIDE_STACK
hex "SPL image size check: provide stack space before relocation"
depends on SPL_SIZE_LIMIT > 0
- default 0
+ default 0x0
help
If set, this size is reserved in SPL_SIZE_LIMIT check to ensure such
an image does not overflow SRAM if SPL_SIZE_LIMIT describes the size
diff --git a/common/spl/Kconfig.tpl b/common/spl/Kconfig.tpl
index 3d6cf1e59f..cc71578f64 100644
--- a/common/spl/Kconfig.tpl
+++ b/common/spl/Kconfig.tpl
@@ -126,7 +126,7 @@ config TPL_POWER
config TPL_TEXT_BASE
hex "Base address for the .text section of the TPL stage"
- default 0
+ default 0x0
help
The base address for the .text section of the TPL stage.
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index a665091b00..20f687e138 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -229,7 +229,7 @@ static int mmc_load_image_raw_os(struct spl_image_info *spl_image,
{
int ret;
-#if CONFIG_VAL(SYS_MMCSD_RAW_MODE_ARGS_SECTOR)
+#if defined(CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR)
unsigned long count;
count = blk_dread(mmc_get_blk_desc(mmc),
diff --git a/common/spl/spl_semihosting.c b/common/spl/spl_semihosting.c
index 5b5e842a11..f7dd289286 100644
--- a/common/spl/spl_semihosting.c
+++ b/common/spl/spl_semihosting.c
@@ -21,6 +21,23 @@ static int smh_read_full(long fd, void *memp, size_t len)
return 0;
}
+static ulong smh_fit_read(struct spl_load_info *load, ulong file_offset,
+ ulong size, void *buf)
+{
+ long fd;
+ ulong ret;
+
+ fd = smh_open(load->filename, MODE_READ | MODE_BINARY);
+ if (fd < 0) {
+ log_debug("could not open %s: %ld\n", load->filename, fd);
+ return 0;
+ }
+ ret = smh_read(fd, buf, size);
+ smh_close(fd);
+
+ return ret;
+}
+
static int spl_smh_load_image(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
{
@@ -49,6 +66,20 @@ static int spl_smh_load_image(struct spl_image_info *spl_image,
goto out;
}
+ if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) &&
+ image_get_magic(header) == FDT_MAGIC) {
+ struct spl_load_info load;
+
+ debug("Found FIT\n");
+ load.read = smh_fit_read;
+ load.bl_len = 1;
+ load.filename = filename;
+ load.priv = NULL;
+ smh_close(fd);
+
+ return spl_load_simple_fit(spl_image, &load, 0, header);
+ }
+
ret = spl_parse_image_header(spl_image, bootdev, header);
if (ret) {
log_debug("failed to parse image header: %d\n", ret);