summaryrefslogtreecommitdiff
path: root/doc/usage
diff options
context:
space:
mode:
authorKory Maincent (TI.com) <[email protected]>2025-10-30 17:45:01 +0100
committerTom Rini <[email protected]>2025-11-03 10:02:39 -0600
commit78a06090f4860d52dfd1577619f53a7ec75122c9 (patch)
treeb0c3de30b114003baf8ffe4c1583d81fdd9a9a6b /doc/usage
parentb7edeac950dae10759527a1ed0d1c306710ec9de (diff)
boot: Add UCLASS support for extension boards
Introduce UCLASS-based extension board support to enable more standardized and automatic loading of extension board device tree overlays in preparation for integration with bootstd and pxe_utils. Several #if CONFIG_IS_ENABLED are used in cmd/extension_board.c to ease the development but don't worry they are removed later in the series. Signed-off-by: Kory Maincent (TI.com) <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'doc/usage')
-rw-r--r--doc/usage/cmd/extension.rst29
1 files changed, 17 insertions, 12 deletions
diff --git a/doc/usage/cmd/extension.rst b/doc/usage/cmd/extension.rst
index 4c261e74951..fbe95aace79 100644
--- a/doc/usage/cmd/extension.rst
+++ b/doc/usage/cmd/extension.rst
@@ -25,9 +25,8 @@ Device Tree overlays depending on the detected extension boards.
The "extension" command comes with three sub-commands:
- - "extension scan" makes the generic code call the board-specific
- extension_board_scan() function to retrieve the list of detected
- extension boards.
+ - "extension scan" makes the generic code call a board-specific extension
+ function to retrieve the list of detected extension boards.
- "extension list" allows to list the detected extension boards.
@@ -98,17 +97,23 @@ Simple extension_board_scan function example
.. code-block:: c
- int extension_board_scan(struct list_head *extension_list)
+ static int foo_extension_board_scan(struct alist *extension_list)
{
- struct extension *extension;
+ struct extension extension = {0};
- extension = calloc(1, sizeof(struct extension));
- snprintf(extension->overlay, sizeof(extension->overlay), "overlay.dtbo");
- snprintf(extension->name, sizeof(extension->name), "extension board");
- snprintf(extension->owner, sizeof(extension->owner), "sandbox");
- snprintf(extension->version, sizeof(extension->version), "1.1");
- snprintf(extension->other, sizeof(extension->other), "Extension board information");
- list_add_tail(&extension->list, extension_list);
+ snprintf(extension.overlay, sizeof(extension.overlay), "overlay.dtbo");
+ snprintf(extension.name, sizeof(extension.name), "extension board");
+ snprintf(extension.owner, sizeof(extension.owner), "sandbox");
+ snprintf(extension.version, sizeof(extension.version), "1.1");
+ snprintf(extension.other, sizeof(extension.other), "Extension board information");
+ if (!alist_add(extension_list, extension))
+ return -ENOMEM;
return 1;
}
+
+ U_BOOT_EXTENSION(foo_extension_name, foo_extension_board_scan);
+
+ U_BOOT_DRVINFO(foo_extension_name) = {
+ .name = "foo_extension_name",
+ };