From 18d0cee4e065a01fb3649cc6e1502254e68d50c6 Mon Sep 17 00:00:00 2001 From: Leo Yu-Chi Liang Date: Wed, 13 Aug 2025 14:16:35 +0800 Subject: common: spl: fix compilation warning Explicitly specify the type by replacing macro with variable to fix the possible compilation warning. Signed-off-by: Leo Yu-Chi Liang --- common/spl/spl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/spl/spl.c b/common/spl/spl.c index ed443c645a7..55ad497c86d 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -278,8 +278,8 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image) } else { spl_image->entry_point = CONFIG_SYS_UBOOT_START; spl_image->load_addr = CONFIG_TEXT_BASE; - log_debug("Default load addr %x (u_boot_pos=%lx)\n", - CONFIG_TEXT_BASE, u_boot_pos); + log_debug("Default load addr %lx (u_boot_pos=%lx)\n", + spl_image->load_addr, u_boot_pos); } spl_image->os = IH_OS_U_BOOT; spl_image->name = xpl_name(xpl_next_phase()); -- cgit v1.2.3 From 0b0641470b3037e7e212b40c7101c1269653f86e Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Thu, 14 Aug 2025 15:14:35 -0300 Subject: Kconfig: Convert SYS_EARLY_PCI_INIT to Kconfig The CONFIG_SYS_EARLY_PCI_INIT symbol is currently not supported by Kconfig. Make it a Kconfig symbol so that users could select it via defconfig. Signed-off-by: Fabio Estevam Reviewed-by: Tom Rini --- common/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common') diff --git a/common/Kconfig b/common/Kconfig index a2f653f7e72..cb17f056153 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -833,6 +833,13 @@ config PCI_INIT_R case of DM PCI-based Ethernet devices, which will not be detected without having the enumeration performed earlier. +config SYS_EARLY_PCI_INIT + bool "Enumerate PCI buses early during init" + depends on PCI + help + Do early PCI configuration before the eMMC gets initialised, + because PCI resources are crucial for eMMC access on some boards. + config RESET_PHY_R bool "Reset ethernet PHY during init" help -- cgit v1.2.3 From 122c25c00a238b55ac6745eb961c5ea66b45be8c Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Tue, 19 Aug 2025 12:55:54 +0200 Subject: common/spl: use memmove() in load_simple_fit() I had trouble booting some am335x boards (both beagleboneblack and a custom board). SPL would start just fine, and apparently load U-Boot proper, but it would hang when jumping to U-Boot. While debugging, I stumbled on this memcpy() which from code inspection very much looked to have overlapping src and dst, and indeed a simple printf revealed calling memcpy(0x8087bf68, 0x8087bf80, 0xf7f8) Now, it will always be with src > dst, our memcpy() implementations "most likely" do forward-copying, and in the end it turned out that this wasn't the culprit after all [*]. But to avoid me or others barking up the wrong tree in the future, and because this use of memcpy() is technically undefined, use memmove() instead. [*] That was 358d1cc232c ("spl: Align FDT load address"), which has since been fixed in master but not the v2025.07 I worked of by 52caad0d14a ("ARM: Align image end to 8 bytes to fit DT alignment"). Signed-off-by: Rasmus Villemoes Reviewed-by: Heinrich Schuchardt --- common/spl/spl_fit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 25f3c822a49..746c3d2fa28 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -353,7 +353,7 @@ static int load_simple_fit(struct spl_load_info *info, ulong fit_offset, } length = loadEnd - CONFIG_SYS_LOAD_ADDR; } else { - memcpy(load_ptr, src, length); + memmove(load_ptr, src, length); } if (image_info) { -- cgit v1.2.3 From 7e2c23eacd8e6fe76306ebf3cd6e31d52695b617 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 1 Sep 2025 17:16:35 +0200 Subject: bloblist: use correct types for physical addresses It is expected that bloblists are stored in high memory beyond 2 GiB. We must not use int as data type for these addresses but phys_addr_t. Fixes: f9ef9fb033d5 ("bloblist: Handle alignment with a void entry") Signed-off-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- common/bloblist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/bloblist.c b/common/bloblist.c index 6e4f020d7c4..d5fa62249a9 100644 --- a/common/bloblist.c +++ b/common/bloblist.c @@ -149,7 +149,8 @@ static int bloblist_addrec(uint tag, int size, int align_log2, { struct bloblist_hdr *hdr = gd->bloblist; struct bloblist_rec *rec; - int data_start, aligned_start, new_alloced; + phys_addr_t data_start, aligned_start; + phys_size_t new_alloced; if (!align_log2) align_log2 = BLOBLIST_BLOB_ALIGN_LOG2; -- cgit v1.2.3 From 559f11e66cf78a7cf57100086bba11a5a516cd25 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 1 Sep 2025 19:03:08 +0200 Subject: bloblist: adjust default bloblist size after reloc If neither CONFIG_BLOBLIST_FIXED NOR CONFIG_BLOBLIST_ALLOC is set, currently CONFIG_BLOBLIST_SIZE_RELOC defaults to 0 except if * CONFIG_ARM=y && CONFIG_EFI_LOADER=y && GENERATE_ACPI_TABLE=y. A size of zero never makes sense for a bloblist. When using QFW we need more than 64 KiB to host the ACPI table. In this case CONFIG_BLOBLIST_ALLOC is used. Set a reasonable default. Remove the CONFIG_BLOBLIST_SIZE_RELOC in ARM QEMU defconfigs which are not compatible with ACPI tables passed from QEMU. Reported-by: Emil Renner Berthing Fixes: 6f9b015c138b ("common: Enable BLOBLIST_TABLES on arm") Signed-off-by: Heinrich Schuchardt Acked-by: Ilias Apalodimas --- common/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/Kconfig b/common/Kconfig index cb17f056153..66dcc8cde15 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -1128,8 +1128,8 @@ config BLOBLIST_SIZE config BLOBLIST_SIZE_RELOC hex "Size of bloblist after relocation" - default BLOBLIST_SIZE if BLOBLIST_FIXED || BLOBLIST_ALLOC - default 0x20000 if (ARM && EFI_LOADER && GENERATE_ACPI_TABLE) + default BLOBLIST_SIZE if BLOBLIST_FIXED + default 0x20000 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 -- cgit v1.2.3 From a78941bc7ff72ab3b67197d53216306429e6a831 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 19 Sep 2025 12:09:58 +0200 Subject: exports.c: drop unused dummy function The !CONFIG_PHY_AQUANTIA defines were already superfluous since _exports.h does have a CONFIG_PHY_AQUANTIA, so the entries never existed. In fact, it couldn't have worked, because the defines would affect both occurences of the mdio_get_current_dev identifier in the EXPORT_FUNC(mdio_get_current_dev, struct mii_dev *, mdio_get_current_dev, void) so the C code would end up containing four copies of gd->jt->dummy = dummy but struct jt_funcs would not and does not have any 'dummy' member. Now that nothing in _exports.h refers to dummy(), remove the empty function. Signed-off-by: Rasmus Villemoes Reviewed-by: Tom Rini --- common/exports.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'common') diff --git a/common/exports.c b/common/exports.c index 48b084c3861..1b7fec685b1 100644 --- a/common/exports.c +++ b/common/exports.c @@ -7,10 +7,6 @@ DECLARE_GLOBAL_DATA_PTR; -__attribute__((unused)) static void dummy(void) -{ -} - unsigned long get_version(void) { return XF_VERSION; @@ -18,13 +14,6 @@ unsigned long get_version(void) #define EXPORT_FUNC(f, a, x, ...) gd->jt->x = f; -#ifndef CONFIG_PHY_AQUANTIA -# define mdio_get_current_dev dummy -# define phy_find_by_mask dummy -# define mdio_phydev_for_ethname dummy -# define miiphy_set_current_dev dummy -#endif - int jumptable_init(void) { gd->jt = malloc(sizeof(struct jt_funcs)); -- cgit v1.2.3 From 38d49808d4cd51e8972bfe7478db03325118d553 Mon Sep 17 00:00:00 2001 From: Boon Khai Ng Date: Thu, 14 Aug 2025 11:17:40 +0800 Subject: cache: Check dcache availability before calling cache functions When the data cache (dcache) is disabled, calling related status functions can lead to compilation errors due to undefined references. Adding a !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) check before invoking dcache_status() (used in common/memsize.c:get_ram_size()) and mmu_status() (from arch/arm/include/asm/io.h). Without this check, builds with dcache disabled will fail to compile. Signed-off-by: Boon Khai Ng Reviewed-by: Tom Rini --- common/memsize.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/memsize.c b/common/memsize.c index 86109579c95..3c3ae6f1eba 100644 --- a/common/memsize.c +++ b/common/memsize.c @@ -52,7 +52,10 @@ long get_ram_size(long *base, long maxsize) long val; long size; int i = 0; - int dcache_en = dcache_status(); + int dcache_en = 0; + + if (!CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) + dcache_en = dcache_status(); for (cnt = (maxsize / sizeof(long)) >> 1; cnt > 0; cnt >>= 1) { addr = base + cnt; /* pointer arith! */ -- cgit v1.2.3 From f4dd112a3822c86175d091362f5cce1029f0523b Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 1 Oct 2025 08:20:07 +0200 Subject: usb: onboard-hub: Make i2c-bus optional DT binding doesn't mandate i2c-bus as required property because hub itself doesn't need to have i2c connected. It can be in standalone mode that only power regulator and reset should be handled. Or hub should be configured via spi interface. Signed-off-by: Michal Simek Reviewed-by: Marek Vasut --- common/usb_onboard_hub.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 805b2ccbc00..6fc34489a98 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -61,8 +61,13 @@ static int usb5744_i2c_init(struct udevice *dev) int ret, slave_addr; ret = dev_read_phandle_with_args(dev, "i2c-bus", NULL, 0, 0, &phandle); + if (ret == -ENOENT) { + dev_dbg(dev, "i2c-bus not specified\n"); + return 0; + } + if (ret) { - dev_err(dev, "i2c-bus not specified\n"); + dev_err(dev, "i2c-bus read failed\n"); return ret; } -- cgit v1.2.3