summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/edid.c6
-rw-r--r--common/spl/Kconfig21
-rw-r--r--common/spl/spl_ext.c8
-rw-r--r--common/spl/spl_fat.c7
-rw-r--r--common/spl/spl_fit.c2
-rw-r--r--common/spl/spl_opensbi.c5
-rw-r--r--common/spl/spl_spi.c9
7 files changed, 51 insertions, 7 deletions
diff --git a/common/edid.c b/common/edid.c
index e2ac7100a88..e5aa4ca494f 100644
--- a/common/edid.c
+++ b/common/edid.c
@@ -16,6 +16,7 @@
#include <linux/ctype.h>
#include <linux/string.h>
+#if CONFIG_IS_ENABLED(I2C_EDID_STANDARD)
#define TIMING(c, ha, hfp, hbp, hsl, va, vfp, vbp, vsl, f) \
.pixelclock = { (c), (c), (c) }, \
.hactive = { (ha), (ha), (ha) }, \
@@ -206,6 +207,7 @@ static const struct display_timing dmt_timings[] = {
{ TIMING(556188000, 4096, 8, 32, 40, 2160, 48, 8, 6,
DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_LOW) },
};
+#endif
int edid_check_info(struct edid1_info *edid_info)
{
@@ -417,6 +419,7 @@ static bool edid_get_standard_timing(struct edid1_info *edid, int i, unsigned in
return false;
}
+#if CONFIG_IS_ENABLED(I2C_EDID_STANDARD)
static bool edid_find_valid_standard_timing(struct edid1_info *buf,
struct display_timing *timing,
bool (*mode_valid)(void *priv,
@@ -446,6 +449,7 @@ static bool edid_find_valid_standard_timing(struct edid1_info *buf,
return found;
}
+#endif
int edid_get_timing_validate(u8 *buf, int buf_size,
struct display_timing *timing,
@@ -493,10 +497,12 @@ int edid_get_timing_validate(u8 *buf, int buf_size,
}
}
+#if CONFIG_IS_ENABLED(I2C_EDID_STANDARD)
/* Look for timing in Standard Timings */
if (!found)
found = edid_find_valid_standard_timing(edid, timing, mode_valid,
mode_valid_priv);
+#endif
if (!found)
return -EINVAL;
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 97f542fcc8a..c08045f9c8d 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -80,11 +80,10 @@ config SPL_MAX_SIZE
default 0x1b000 if AM33XX && !TI_SECURE_DEVICE
default 0xec00 if OMAP34XX
default 0x10000 if ARCH_MX6 && !MX6_OCRAM_256KB
- default 0x7fa0 if SUNXI_SRAM_ADDRESS = 0x10000
- default 0x7fa0 if SUNXI_SRAM_ADDRESS = 0x20000 && !MACH_SUN50I_H616
default 0xbfa0 if MACH_SUN50I_H616
default 0x7000 if RCAR_GEN3
default 0x5fa0 if SUNXI_SRAM_ADDRESS = 0x0
+ default 0x7fa0 if ARCH_SUNXI
default 0x10000 if ASPEED_AST2600
default 0x27000 if IMX8MM && SPL_TEXT_BASE = 0x7E1000
default 0x30000 if ARCH_SC5XX && (SC59X_64 || SC59X)
@@ -1450,6 +1449,24 @@ config SYS_SPI_U_BOOT_OFFS
Address within SPI-Flash from where the u-boot payload is fetched
from.
+config SYS_SPI_KERNEL_OFFS
+ hex "Falcon mode: address of kernel payload in SPI flash"
+ depends on SPL_SPI_FLASH_SUPPORT && SPL_OS_BOOT
+ help
+ Address within SPI-Flash from where the kernel payload is fetched
+ in falcon boot.
+
+config SYS_SPI_ARGS_OFFS
+ hex "Falcon mode: address of args payload in SPI flash"
+ depends on SPL_SPI_FLASH_SUPPORT && SPL_OS_BOOT
+ help
+ Address within SPI-Flash from where the args payload (usually the
+ dtb) is fetched in falcon boot.
+
+config SYS_SPI_ARGS_SIZE
+ hex "Falcon mode: size of args payload in SPI flash"
+ depends on SPL_SPI_FLASH_SUPPORT && SPL_OS_BOOT
+
config SPL_THERMAL
bool "Driver support for thermal devices"
help
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index c5478820a9b..7e0274a3058 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -11,12 +11,20 @@
static ulong spl_fit_read(struct spl_load_info *load, ulong file_offset,
ulong size, void *buf)
{
+ struct legacy_img_hdr *header;
int ret;
loff_t actlen;
ret = ext4fs_read(buf, file_offset, size, &actlen);
if (ret)
return ret;
+
+ if (CONFIG_IS_ENABLED(OS_BOOT)) {
+ header = (struct legacy_img_hdr *)buf;
+ if (image_get_magic(header) != FDT_MAGIC)
+ return size;
+ }
+
return actlen;
}
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index fce451b7664..f426a068ff9 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -47,6 +47,7 @@ static int spl_register_fat_device(struct blk_desc *block_dev, int partition)
static ulong spl_fit_read(struct spl_load_info *load, ulong file_offset,
ulong size, void *buf)
{
+ struct legacy_img_hdr *header;
loff_t actread;
int ret;
char *filename = load->priv;
@@ -55,6 +56,12 @@ static ulong spl_fit_read(struct spl_load_info *load, ulong file_offset,
if (ret)
return ret;
+ if (CONFIG_IS_ENABLED(OS_BOOT)) {
+ header = (struct legacy_img_hdr *)buf;
+ if (image_get_magic(header) != FDT_MAGIC)
+ return size;
+ }
+
return actread;
}
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 49b4df60560..86506d6905c 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -397,7 +397,7 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image,
* Use the address following the image as target address for the
* device tree.
*/
- image_info.load_addr = spl_image->load_addr + spl_image->size;
+ image_info.load_addr = ALIGN(spl_image->load_addr + spl_image->size, 8);
/* Figure out which device tree the board wants to use */
node = spl_fit_get_image_node(ctx, FIT_FDT_PROP, index++);
diff --git a/common/spl/spl_opensbi.c b/common/spl/spl_opensbi.c
index 5a26d7c31a4..0ed6afeacc6 100644
--- a/common/spl/spl_opensbi.c
+++ b/common/spl/spl_opensbi.c
@@ -57,6 +57,11 @@ void __noreturn spl_invoke_opensbi(struct spl_image_info *spl_image)
hang();
}
+ if (!IS_ALIGNED((uintptr_t)spl_image->fdt_addr, 8)) {
+ pr_err("SPL image loaded an improperly-aligned device tree\n");
+ hang();
+ }
+
/*
* Originally, u-boot-spl will place DTB directly after the kernel,
* but the size of the kernel did not include the BSS section, which
diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c
index 691a431a926..00dbd3011f0 100644
--- a/common/spl/spl_spi.c
+++ b/common/spl/spl_spi.c
@@ -82,13 +82,14 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
#if CONFIG_IS_ENABLED(OS_BOOT)
if (spl_start_uboot()) {
int err = spl_load(spl_image, bootdev, &load, 0,
- CFG_SYS_SPI_KERNEL_OFFS);
+ CONFIG_SYS_SPI_KERNEL_OFFS);
if (!err)
/* Read device tree. */
- return spi_flash_read(flash, CFG_SYS_SPI_ARGS_OFFS,
- CFG_SYS_SPI_ARGS_SIZE,
- (void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR);
+ return spi_flash_read(
+ flash, CONFIG_SYS_SPI_ARGS_OFFS,
+ CONFIG_SYS_SPI_ARGS_SIZE,
+ (void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR);
}
#endif