summaryrefslogtreecommitdiffstats
path: root/doc/api
Commit message (Collapse)AuthorAgeFilesLines
* doc: fix doc/develop/logging.rstHeinrich Schuchardt2021-01-272-0/+7
| | | | | | | | | | Sphinx 3 builds fail due to doc/develop/logging.rst producing duplicate labels. Include logging.h only once in the API section and use cross-references for the enums log_level_t and log_category_t. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* linker_lists: Fix alignment issueSimon Glass2020-12-181-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The linker script uses alphabetic sorting to group the different linker lists together. Each group has its own struct and potentially its own alignment. But when the linker packs the structs together it cannot ensure that a linker list starts on the expected alignment boundary. For example, if the first list has a struct size of 8 and we place 3 of them in the image, that means that the next struct will start at offset 0x18 from the start of the linker_list section. If the next struct has a size of 16 then it will start at an 8-byte aligned offset, but not a 16-byte aligned offset. With sandbox on x86_64, a reference to a linker list item using ll_entry_get() can force alignment of that particular linker_list item, if it is in the same file as the linker_list item is declared. Consider this example, where struct driver is 0x80 bytes: ll_entry_declare(struct driver, fred, driver) ... void *p = ll_entry_get(struct driver, fred, driver) If these two lines of code are in the same file, then the entry is forced to be aligned at the 'struct driver' alignment, which is 16 bytes. If the second line of code is in a different file, then no action is taken, since the compiler cannot update the alignment of the linker_list item. In the first case, an 8-byte 'fill' region is added: .u_boot_list_2_driver_2_testbus_drv 0x0000000000270018 0x80 test/built-in.o 0x0000000000270018 _u_boot_list_2_driver_2_testbus_drv .u_boot_list_2_driver_2_testfdt1_drv 0x0000000000270098 0x80 test/built-in.o 0x0000000000270098 _u_boot_list_2_driver_2_testfdt1_drv *fill* 0x0000000000270118 0x8 .u_boot_list_2_driver_2_testfdt_drv 0x0000000000270120 0x80 test/built-in.o 0x0000000000270120 _u_boot_list_2_driver_2_testfdt_drv .u_boot_list_2_driver_2_testprobe_drv 0x00000000002701a0 0x80 test/built-in.o 0x00000000002701a0 _u_boot_list_2_driver_2_testprobe_drv With this, the linker_list no-longer works since items after testfdt1_drv are not at the expected address. Ideally we would have a way to tell gcc not to align structs in this way. It is not clear how we could do this, and in any case it would require us to adjust every struct used by the linker_list feature. One possible fix is to force each separate linker_list to start on the largest possible boundary that can be required by the compiler. However that does not seem to work on x86_64, which uses 16-byte alignment in this case but needs 32-byte alignment. So add a Kconfig option to handle this. Set the default value to 4 so as to avoid changing platforms that don't need it. Update the ll_entry_start() accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
* doc: add sandbox APIHeinrich Schuchardt2020-11-052-0/+10
| | | | | | | Add sandbox API to generated HTML documentation Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* lib: Add getoptSean Anderson2020-10-302-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some commands can get very unweildy if they have too many positional arguments. Adding options makes them easier to read, remember, and understand. This implementation of getopt has been taken from barebox, which has had option support for quite a while. I have made a few modifications to their version, such as the removal of opterr in favor of a separate getopt_silent function. In addition, I have moved all global variables into struct getopt_context. The getopt from barebox also re-orders the arguments passed to it so that non-options are placed last. This allows users to specify options anywhere. For example, `ls -l foo/ -R` would be re-ordered to `ls -l -R foo/` as getopt parsed the options. However, this feature conflicts with the const argv in cmd_tbl->cmd. This was originally added in 54841ab50c ("Make sure that argv[] argument pointers are not modified."). The reason stated in that commit is that hush requires argv to stay unmodified. Has this situation changed? Barebox also uses hush, and does not have this problem. Perhaps we could use their fix? I have assigned maintenance of getopt to Simon Glass, as it is currently only used by the log command. I would also be fine maintaining it. Signed-off-by: Sean Anderson <seanga2@gmail.com>
* doc: Document timer APISean Anderson2020-10-222-0/+9
| | | | | | | | | | | This adds kerneldocs for <timer.h>. I don't know who should maintain doc/api/timer.rst, since the timer subsystem seems to be maintained by SoC maintainers. MAINTAINERS is left un-updated for the moment. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* pinctrl: Reformat documentation in dm/pinctrl.hSean Anderson2020-10-082-0/+8
| | | | | | | | | | | | | This normalizes the documentation to conform to kernel-doc style [1]. It also moves the documentation for pinctrl_ops inline, and adds argument and return-value documentation. I have kept the usual function style for these comments. I could not find any existing examples of function documentation inside structs. [1] https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* efi_loader: prepare for read only OP-TEE variablesHeinrich Schuchardt2020-07-111-0/+2
| | | | | | | | | | | | | | | | | | We currently have two implementations of UEFI variables: * variables provided via an OP-TEE module * variables stored in the U-Boot environment Read only variables are up to now only implemented in the U-Boot environment implementation. Provide a common interface for both implementations that allows handling read-only variables. As variable access is limited to very few source files put variable related definitions into new include efi_variable.h instead of efi_loader. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* doc: random number generationHeinrich Schuchardt2020-06-142-0/+18
| | | | | | | Add random number generation APIs to the HTML documentation. Fix style issues. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* doc: dfu: add DFU to HTML documentationHeinrich Schuchardt2020-05-252-0/+8
| | | | | | | | Add the device firmware update functions to the generated HTML documentation. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Lukasz Majewski <lukma@denx.de>
* doc: add Unicode functions to API descriptionHeinrich Schuchardt2020-05-092-0/+8
| | | | | | Add include/charset.h to generated HTML documentation Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_selftest: add unit test functions to HTML documentationHeinrich Schuchardt2020-05-091-0/+9
| | | | | | | | | Add the UEFI unit test helper functions to the generated HTML documentation. Correct some documentation texts in include/efi_selftest.h. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: function descriptions efi_watchdog.cHeinrich Schuchardt2020-04-161-0/+6
| | | | | | | Correct function descriptions in efi_watchdog.c. Add the descriptions to the generated HTML documentation. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: function descriptions efi_unicode_collation.cHeinrich Schuchardt2020-04-161-0/+6
| | | | | | | Correct function descriptions in efi_unicode_collation.c Add the Unicode collation protocol to the generated HTML documentation. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* doc/efi: add load file 2 protocol to HTML documentationHeinrich Schuchardt2020-02-281-0/+9
| | | | | | | | | | The load file 2 protocol can be used by the Linux kernel to load the initial RAM disk. U-Boot can be configured to provide an implementation. Add a description to the UEFI overview and document the related functions in the API section. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: document functions in efi_rng.cHeinrich Schuchardt2020-01-151-0/+6
| | | | | | Add the missing Sphinx documentation. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* doc: UEFI API documentationHeinrich Schuchardt2019-09-051-0/+33
| | | | | | | | Add some more files to the UEFI API documentation. Correct some Sphinx comments. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* doc: Move existing rst files into api sub-directoryBin Meng2019-07-244-0/+223
Currently the Sphinx doc only contains API descriptions of several U-Boot subsystems. For future extension, group these existing docs into an API sub-directory. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>