diff options
author | Simon Glass <sjg@chromium.org> | 2024-11-02 11:49:42 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-12-18 15:18:59 -0600 |
commit | fc37a73e667916e15e01e0f9d189da792df2b351 (patch) | |
tree | dfbf6aa2fd3a9af4d7900f929d06ea753b009670 /board/xilinx/common/board.c | |
parent | 447f18d00de80384df334acdbe5972762d3d1e1e (diff) |
fdt: Swap the signature for board_fdt_blob_setup()
This returns a devicetree and updates a parameter with an error code.
Swap it, since this fits better with the way U-Boot normally works. It
also (more easily) allows leaving the existing pointer unchanged.
No yaks were harmed in this change, but there is a very small code-size
reduction.
For sifive, the OF_BOARD option must be set for the function to be
called, so there is no point in checking it again. Also OF_SEPARATE is
defined always.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
[trini: Update total_compute]
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'board/xilinx/common/board.c')
-rw-r--r-- | board/xilinx/common/board.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index a12dccd4c51..deea6c71103 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -358,17 +358,17 @@ __maybe_unused int xilinx_read_eeprom(void) } #if defined(CONFIG_OF_BOARD) -void *board_fdt_blob_setup(int *err) +int board_fdt_blob_setup(void **fdtp) { void *fdt_blob; - *err = 0; - if (IS_ENABLED(CONFIG_TARGET_XILINX_MBV)) { fdt_blob = (void *)CONFIG_XILINX_OF_BOARD_DTB_ADDR; - if (fdt_magic(fdt_blob) == FDT_MAGIC) - return fdt_blob; + if (fdt_magic(fdt_blob) == FDT_MAGIC) { + *fdtp = fdt_blob; + return 0; + } } if (!IS_ENABLED(CONFIG_XPL_BUILD) && @@ -376,8 +376,10 @@ void *board_fdt_blob_setup(int *err) !IS_ENABLED(CONFIG_ZYNQMP_NO_DDR)) { fdt_blob = (void *)CONFIG_XILINX_OF_BOARD_DTB_ADDR; - if (fdt_magic(fdt_blob) == FDT_MAGIC) - return fdt_blob; + if (fdt_magic(fdt_blob) == FDT_MAGIC) { + *fdtp = fdt_blob; + return 0; + } debug("DTB is not passed via %p\n", fdt_blob); } @@ -396,13 +398,15 @@ void *board_fdt_blob_setup(int *err) fdt_blob = (ulong *)_end; } - if (fdt_magic(fdt_blob) == FDT_MAGIC) - return fdt_blob; + if (fdt_magic(fdt_blob) == FDT_MAGIC) { + *fdtp = fdt_blob; + + return 0; + } debug("DTB is also not passed via %p\n", fdt_blob); - *err = -EINVAL; - return NULL; + return -EINVAL; } #endif |