aboutsummaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2023-10-06spl: Remove #ifdefs with BOOTSTAGESimon Glass
This feature has some helpers in its header file so that its functions resolve to nothing when the feature is disabled. Add a few more and use these to simplify the code. With this there are no more #ifdefs in board_init_r() Signed-off-by: Simon Glass <sjg@chromium.org>
2023-10-06spl: Avoid an #ifdef when printing gd->malloc_ptrSimon Glass
Use an accessor in the header file to avoid this. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-10-06spl: Use SYS_MALLOC_F instead of SYS_MALLOC_F_LENSimon Glass
Use the new SPL/TPL/VPL_SYS_MALLOC_F symbols to determine whether the malloc pool exists. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2023-10-06spl: Drop the switch() statement for OS selectionSimon Glass
This code is pretty ugly, with many #ifdefs There are quite a lot of IH_OS_U_BOOT values so the compiler struggles to create a jump table here. Also, most of the options are normally disabled. Change it to an else...if construct instead. Add an accessor for the spl_image field behind an #ifdef to avoid needing #ifdef in the C code. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-10-06spl: Avoid #ifdef with CONFIG_SPL_PAYLOAD_ARGS_ADDRSimon Glass
Move the condition to the header file to improve readability. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-10-06spl: Drop #ifdefs for BOARD_INIT and watchdogSimon Glass
Avoid using the preprocessor for these checks. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-10-06spl: mx6: powerpc: Drop the condition on timer_init()Simon Glass
It doesn't make sense to have some boards do this differently. Drop the condition in the hope that the maintainers can figure out any run-time problems. This has been tested on qemu-ppce500 Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2023-10-06spl: Avoid #ifdef with CONFIG_SPL_SYS_MALLOCSimon Glass
Use IF_ENABLED_INT() to avoid needing to use the preprocessor. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-10-06spl: Rename SYS_SPL_ARGS_ADDR to SPL_PAYLOAD_ARGS_ADDRSimon Glass
Rename this so that SPL is first, as per U-Boot convention. Also add PAYLOAD_ since this is where in memory the parameters for the payload have been stored. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-10-06spl: Use CONFIG_SPL... instead of CONFIG_..._SPL_...Simon Glass
We like to put the SPL first so it is clear that it relates to SPL. Rename various malloc-related options which have crept in, to stick to this convention. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Martyn Welch <martyn.welch@collabora.com> Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com>
2023-10-02Merge branch 'next'Tom Rini
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-09-30Convert CFG_SYS_UBOOT_START to KconfigJesse Taube
Commit 65cc0e2a65d2 ("global: Move remaining CONFIG_SYS_* to CFG_SYS_*") renamed CONFIG_SYS_UBOOT_START to CFG_SYS_UBOOT_START. Unfortunately, this meant that the value was no longer available to the Makefile. This caused imxrt to fail to boot. All the other boards that used this variable were unaffected because they were using the default value which is CONFIG_TEXT_BASE. This commit converts CFG_SYS_UBOOT_START to Kconfig and sets the default value to CONFIG_TEXT_BASE. Suggested-by: Marek Vasut <marek.vasut+renesas@gmail.com> Suggested-by: Tom Rini <trini@konsulko.com> Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-09-24common: Drop linux/printk.h from common headerSimon Glass
This old patch was marked as deferred. Bring it back to life, to continue towards the removal of common.h Move this out of the common header and include it only where needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-09-22dm: core: Allow marking driver model as deadSimon Glass
On x86 devices we use CAR (Cache-As-RAM) to hold the malloc() region in SPL, since SDRAM is not set up yet. This means that driver model stores its tables in this region. When preparing to jump from SPL to U-Boot proper, we must disable CAR, so that the CPU can uses the caches normally. This means that driver model tables become inaccessible. From there until we jump to U-Boot proper, we must avoid using driver model. This is only a problem on boards which operate this way, for example chromebook_link64 Add a flag to indicate that driver model is dead and should not be used. It can be used in SPL to avoid hanging the machine. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-09-19spl: Tidy up load address in spl_ramSimon Glass
This CONFIG is used but is not given a value by some boards. Use a default value of 0 explicitly, rather than relying on the 0 value provided by CONFIG_SPL_LOAD_FIT_ADDRESS This will allow us to make SPL_LOAD_FIT_ADDRESS depend on SPL_LOAD_FIT as it should. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19Move fdt_simplefb to boot/Simon Glass
This relates to booting, so move it there. Create a new Kconfig menu for things related to devicetree fixup. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19boot: Move fdt_support to boot/Simon Glass
This relates to booting since it fixes up the devicetree for the OS. Move it into the boot/ directory. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19video: Move the BMP optionsSimon Glass
These appear prominently in the main menu at present. Move them to the video Kconfig where they belong. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19video: Move bmp code to drivers/videoSimon Glass
This relates to graphics which is only active when CONFIG_VIDEO is enabled. Move it into that directory. For most boards there is no harm in compiling it always, since it if not used it will be dropped by the linker. But for the EFI app this is not the case, so retain use of the BMP Kconfig. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-15sdp: Use plain udevice for UDC controller interactionMarek Vasut
Convert to plain udevice interaction with UDC controller device, avoid the use of UDC uclass dev_array . Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Marek Vasut <marex@denx.de>
2023-09-15spl: sdp: Detach the controller on errorMarek Vasut
In case anything errors out during the SDP transfer, detach the controller instead of bailing out right away. This way, the controller can be reattached on next attempt. Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Marek Vasut <marex@denx.de>
2023-09-15dfu: Use plain udevice for UDC controller interactionMarek Vasut
Convert to plain udevice interaction with UDC controller device, avoid the use of UDC uclass dev_array . Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Marek Vasut <marex@denx.de>
2023-09-15dfu: Detach the controller on errorMarek Vasut
In case anything errors out during the DFU registration, detach the controller instead of bailing out right away. This way, the controller can be reattached on next attempt. Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Marek Vasut <marex@denx.de>
2023-09-14cmd: bmp: Remove unused NEEDS_MANUAL_RELOC code bitsMarek Vasut
The last user of the NEEDS_MANUAL_RELOC has been removed in commit 26af162ac8f8 ("arch: m68k: Implement relocation") Remove now unused NEEDS_MANUAL_RELOC code. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14common: stdio: Remove unused NEEDS_MANUAL_RELOC code bitsMarek Vasut
The last user of the NEEDS_MANUAL_RELOC has been removed in commit 26af162ac8f8 ("arch: m68k: Implement relocation") Remove now unused NEEDS_MANUAL_RELOC code. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14common: hash: Remove unused NEEDS_MANUAL_RELOC code bitsMarek Vasut
The last user of the NEEDS_MANUAL_RELOC has been removed in commit 26af162ac8f8 ("arch: m68k: Implement relocation") Remove now unused NEEDS_MANUAL_RELOC code. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14common: event: Remove unused NEEDS_MANUAL_RELOC code bitsMarek Vasut
The last user of the NEEDS_MANUAL_RELOC has been removed in commit 26af162ac8f8 ("arch: m68k: Implement relocation") Remove now unused NEEDS_MANUAL_RELOC code. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14common: malloc: Remove unused NEEDS_MANUAL_RELOC code bitsMarek Vasut
The last user of the NEEDS_MANUAL_RELOC has been removed in commit 26af162ac8f8 ("arch: m68k: Implement relocation") Remove now unused NEEDS_MANUAL_RELOC code. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14common: hush: Remove unused NEEDS_MANUAL_RELOC code bitsMarek Vasut
The last user of the NEEDS_MANUAL_RELOC has been removed in commit 26af162ac8f8 ("arch: m68k: Implement relocation") Remove now unused NEEDS_MANUAL_RELOC code. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14common: board_r: Remove unused NEEDS_MANUAL_RELOC code bitsMarek Vasut
The last user of the NEEDS_MANUAL_RELOC has been removed in commit 26af162ac8f8 ("arch: m68k: Implement relocation") Remove now unused NEEDS_MANUAL_RELOC code. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14blkcache: Remove unused NEEDS_MANUAL_RELOC code bitsMarek Vasut
The last user of the NEEDS_MANUAL_RELOC has been removed in commit 26af162ac8f8 ("arch: m68k: Implement relocation") Remove now unused NEEDS_MANUAL_RELOC code. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-09spl: undefined return value in spl_blk_load_imageHeinrich Schuchardt
spl_blk_load_image() should not return an uninitialized value if blk_get_devnum_by_uclass_id() fails. Fixes: 8ce6a2e17577 ("spl: blk: Support loading images from fs") Reported-by: Xavier Drudis Ferran <xdrudis@tinet.cat> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Xavier Drudis Ferran <xdrudis@tinet.cat>
2023-09-05spl: add __noreturn attribute to spl_invoke_opensbi functionChanho Park
spl_invoke_opensbi function is not returned to SPL. Thus, we need to set __noreturn function attribute. Signed-off-by: Chanho Park <chanho61.park@samsung.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-09-05dlmalloc: Add support for SPL_SYS_MALLOC_CLEAR_ON_INITShengyu Qu
To support SPL_SYS_MALLOC_CLEAR_ON_INIT, we have to modify #ifdef CONFIG_SYS_MALLOC_CLEAR_ON_INIT to #if CONFIG_IS_ENABLED(SYS_MALLOC_CLEAR_ON_INIT) Signed-off-by: Bo Gan <ganboing@gmail.com> Signed-off-by: Shengyu Qu <wiagn233@outlook.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-04Merge tag 'v2023.10-rc4' into nextTom Rini
Prepare v2023.10-rc4
2023-08-31event: Use an event to replace last_stage_init()Simon Glass
Add a new event which handles this function. Convert existing use of the function to use the new event instead. Make sure that EVENT is enabled by affected boards, by selecting it from the LAST_STAGE_INIT option. For x86, enable it by default since all boards need it. For controlcenterdc, inline the get_tpm() function and make sure the event is not built in SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31freescale: Drop call to init_func_vid() in the init sequenceSimon Glass
Use the misc_init_f event instead, which is designed for this purpose. All boards with CONFIG_VID already enable CONFIG_EVENT. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31x86: Convert arch_fsp_init() to use eventsSimon Glass
Convert this to use events instead of calling a function directly in the init sequence. Rename it to arch_fsp_init_f() to distinguish it from the one that happens after relocation. For FSPv2 nothing needs to be done here, so drop the empty function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31initcall: Support manual relocationSimon Glass
Move the manual-relocation code to the initcall file. Make sure to avoid manually relocating event types. Only true function pointers should be relocated. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31initcall: Support emitting eventsSimon Glass
At present the initcall list consists of a list of function pointers. Over time the initcall lists will likely change to mostly emitting events, since most of the calls are board- or arch-specific. As a first step, allow an initcall to be an event type instead of a function pointer. Add the required macro and update initcall_run_list() to emit an event in that case, or ignore it if events are not enabled. The bottom 8 bits of the function pointer are used to hold the event type, with the rest being all ones. This should avoid any collision, since initcalls should not be above 0xffffff00 in memory. Convert misc_init_f over to use this mechanism. Add comments to the initcall header file while we are here. Also fix up the trace test to handle the change. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31event: Export event_type_name()Simon Glass
Export this function so it can be used with initcall debugging. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31Revert "initcall: Move to inline function"Simon Glass
Somehow I do not see any inlining with initcalls now. I was sure I saw it when this commit went in, but now it seems to make things worse. This reverts commit 47870afab92fca6e672c03d0dea802a55e200675. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31event: Support a simple spy recordSimon Glass
The current event spy is always passed the event context and the event. The context is always NULL for a static spy. The event is not often used. Introduce a 'simple' spy which takes no arguments. This allows us to drop the adaptation code that many of these spy records use. Update the event script to find these in the image. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-22common: bouncebuf: Add missing cast to dma_addr_tMarek Vasut
Fix the following warning produced on qemu-x86_64_defconfig: " common/bouncebuf.c: In function ‘bounce_buffer_stop’: common/bouncebuf.c:82:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 82 | dma_unmap_single((dma_addr_t)state->bounce_buffer, | ^ " The warning is valid, the pointer has to be up-cast first. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Andrew Davis <afd@ti.com>
2023-08-22dm: event: add EVT_DM_POST_INIT_R event typeChanho Park
This patch introduces EVT_DM_POST_INIT_R event type for handling hooks after relocation. Fixes: 55171aedda88 ("dm: Emit the arch_cpu_init_dm() even only before relocation") Suggested-by: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Chanho Park <chanho61.park@samsung.com> Tested-by: Milan P. Stanić <mps@arvanta.net> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Roland Ruckerbauer <mail@ruabmbua.dev> Tested-by: Roland Ruckerbauer <mail@ruabmbua.dev> Fixed missing event name in event.c: Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-21Merge tag 'v2023.10-rc3' into nextTom Rini
Prepare v2023.10-rc3 Signed-off-by: Tom Rini <trini@konsulko.com>
2023-08-19spl: don't assume NVMe partition 1 existsHeinrich Schuchardt
There is no requirement that a partition 1 exists in a partition table. We should not try to retrieve information about it. We should not even try reading with partition number CONFIG_SYS_NVME_BOOT_PARTITION here as this is done in the fs_set_blk_dev() call anyway. Fixes: 8ce6a2e17577 ("spl: blk: Support loading images from fs") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-08-17spl: mmc: Fix check of CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORElena Popa
When Falcon Mode is enabled, SPL needs to check the value of CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR. Unfortunately, it was using the CONFIG_VAL(SYS_MMCSD_RAW_MODE_ARGS_SECTOR) which converts it into CONFIG_SPL_SYS_MMCSD_RAW_MODE_ARGS_SECTOR when CONFIG_SPL_BUILD is enabled. CONFIG_SPL_SYS_MMCSD_RAW_MODE_ARGS_SECTOR does not exist in common/spl/Kconfig. Replaced with defined(CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR). Signed-off-by: Elena Popa <elena.popa@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-08-15common: return type board_get_usable_ram_topHeinrich Schuchardt
board_get_usable_ram_top() returns a physical address that is stored in gd->ram_top. The return type of the function should be phys_addr_t like the current type of gd->ram_top. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-08-14spl: add FIT support to semihosting boot methodHeinrich Schuchardt
Allow loading a FIT image via semihosting in SPL. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>