aboutsummaryrefslogtreecommitdiff
path: root/drivers/fpga
diff options
context:
space:
mode:
authorTom Rini2022-09-30 15:52:10 -0400
committerTom Rini2022-09-30 15:52:10 -0400
commit6ee6e15975cad3c99fad3a66223f3fd9287a369b (patch)
tree2a1798758c85d3010640cf6bacb1ad7caaa29133 /drivers/fpga
parent01c88e3dcd667281cf3aa6f6b47f90900177aff9 (diff)
parentdb1ef1e12b993275e09f116ebc3d23d675c7e28c (diff)
Merge branch '2022-09-29-dm-core-support-multiple-device-trees-in-ofnode' into next
To quote the author: At present the ofnode interface is somewhat limited, in that it cannot access the device tree provided by the OS, only the one used by U-Boot itself (assuming these are separate). This prevents using ofnode functions to handle device tree fixups, i.e. ft_board_setup() and the like. The ofnode interface was introduced to allow a consistent API to access the device tree, whether a flat tree or a live tree (OF_LIVE) is in use. With the flat tree, adding nodes and properties at the start of the tree (as often happens when writing to the /chosen node) requires copying a lot of data for each operation. With live tree, such operations are quite a bit faster, since there is no memory copying required. This has to be weighed against the required memory allocation with OF_LIVE, as well as the cost of unflattening and flattening the device tree which U-Boot is running. This series enables support for access to multiple device trees with the ofnode interface. This is already available to some extent with OF_LIVE, but some of the ofnode functions need changes to allow the tree to be specified. The mechanism works by using the top 1-4 bits of the device tree offset. The sign bit is not affected, since negative values must be supported. With this implemented, it becomes possible to use the ofnode interface to do device tree fixups. The only current user is the EVT_FT_FIXUP event. This has two main benefits: - ofnode can now be used everywhere, in preference to the libfdt calls - live tree can eventually be used everywhere, with potential speed improvements when larger number of fixups are used This series is only a step along the way. Firstly, while it is possible to access the 'fix-up' tree using OF_LIVE, most of the fixup functions use flat tree directly, rather than the ofnode interface. These need to be updated. Also the tree must be flattened again before it is passed to the OS. This is not currently implemented. With OFNODE_MULTI_TREE disabled this has almost no effect on code size: around 4 bytes if EVENT is enabled, 0 if not. With the feature enabled, the increase is around 700 bytes, e.g. on venice2: $ buildman -b ofn2a venice2 -sS --step 0 Summary of 2 commits for 1 boards (1 thread, 64 jobs per thread) 01: image: Drop some other #ifdefs in image-board.c arm: w+ venice2 48: wip arm: (for 1/1 boards) all +668.0 text +668.0 This size increase is not too bad, considering the extra functionality, but is too large to enable everywhere. So for now this features needs to be opt-in only, based on EVENT.
Diffstat (limited to 'drivers/fpga')
-rw-r--r--drivers/fpga/socfpga_arria10.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/fpga/socfpga_arria10.c b/drivers/fpga/socfpga_arria10.c
index e86e3b74317..3b785e67d0b 100644
--- a/drivers/fpga/socfpga_arria10.c
+++ b/drivers/fpga/socfpga_arria10.c
@@ -555,14 +555,14 @@ static int first_loading_rbf_to_buffer(struct udevice *dev,
/* Load image header into buffer */
ret = request_firmware_into_buf(dev,
fpga_loadfs->fpga_fsinfo->filename,
- buffer_p, sizeof(struct image_header),
+ buffer_p, sizeof(struct legacy_img_hdr),
0);
if (ret < 0) {
debug("FPGA: Failed to read image header from flash.\n");
return -ENOENT;
}
- if (image_get_magic((struct image_header *)buffer_p) != FDT_MAGIC) {
+ if (image_get_magic((struct legacy_img_hdr *)buffer_p) != FDT_MAGIC) {
debug("FPGA: No FDT magic was found.\n");
return -EBADF;
}