72 Commits

Author SHA1 Message Date
Simon Glass
840c1a6855 pickman: Add tool to compare branch differences
Add a tool to check the number of commits in a source branch
(us/next) that are not in the master branch (ci/master), and find
the last common commit between them.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-16 13:15:19 +00:00
Simon Glass
4096d43361 doc: Add malloc documentation
Add doc/develop/malloc.rst documenting U-Boot's dynamic memory
allocation implementation:

- Overview of pre/post-relocation malloc phases
- dlmalloc 2.8.6 version and features
- Data structure sizes (~500 bytes vs 1032 bytes in 2.6.6)
- Configuration options for code-size optimization
- Debugging features (mcheck, valgrind, malloc testing)
- API reference

Also add an introductory comment to dlmalloc.c summarising the
U-Boot configuration.

Series-to: concept
Series-cc: heinrich
Cover-letter:
malloc: Import dlmalloc 2.8.6
This series imports dlmalloc 2.8.6 from Doug Lea, replacing the old
version 2.6.6 that U-Boot has been using since 2002.

The new version provides:
- Better memory efficiency with improved binning algorithms
- More robust overflow checking via MAX_REQUEST
- Somewhat cleaner codebase

All U-Boot-specific modifications from the historical commits have been
ported to the new implementation, including:
- Pre-relocation malloc via malloc_simple
- Valgrind annotations
- Malloc testing infrastructure
- mcheck heap protection support
- Sandbox USE_DL_PREFIX support

The approach here is to leave the upstream code unchanged, so much as
possible, clearly marking U-Boot-specific changes with an #ifdef

Unfortunately the code size is not great out-of-the-box, so the final
part of the series includes some options to remove in-place realloc(),
provide a simplified init, remove the tree stucture for large blocks
and a few other things.

With these adjustments the new version is about 1K less code on Thumb2
(firefly-rk3288).

The new free() algorithm is more sophisticated but also larger. If
needed we might be able to shrink by a few hundred bytes. Of course SPL
doesn't normally use free() so the benefit might be minimal.

Another point worth mentioning is that the pre-inited av_[] array has
been replaced replaced with a BSS _sm_ struct which reduces the image
size by about 1.5K. One patch adjusts some imx8mp boards to deal with
the larger BSS.

Some code-size stats:

  $ buildman -b mala imx8mp_venice firefly-rk3288 firefly-rk3399 -sS --step 0
  Summary of 2 commits for 3 boards (3 threads, 11 jobs per thread)
  01: backtrace: Strip the source tree prefix from filenames
     aarch64:  w+   imx8mp_venice firefly-rk3399
  40: doc: Add malloc documentation
     aarch64: (for 2/2 boards) all -3904.0 bss +864.0 data -2076.0
       spl/u-boot-spl:all -654.0 spl/u-boot-spl:bss +316.0
       spl/u-boot-spl:data -1034.0 spl/u-boot-spl:text +64.0 text -2692.0
     arm: (for 1/1 boards) all -1436.0 data -1040.0 text -396.0

For the new malloc.h I have avoided including string.h so have added
that to various places that need it.

The existing common/dlmalloc.src file is left alone.

In order to bring this in without losing functionality, I went through
the patches applied to the original implementation over time. Where
these commits were added, they are added as a cherry-pick, with the
original commit hash.

Here is a list of what was done with each U-Boot commit on top of the
new common/dlmalloc.c and include/malloc.h:

 1. 217c9dad82 2002-10-25 Initial revision
    - Ignored

 2. 5b1d713721 2002-11-03 Initial revision
    - Ignored

 3. 8bde7f776c 2003-06-27 * Code cleanup:
    - Ignored as we don't really want to change the style

 4. d87080b721 2006-03-31 GCC-4.x fixes: clean up global data pointer initialization for all boards.
    - Global data is not needed at this point

 5. 81673e9ae1 2008-05-13 Make sure common.h is the first include.
    - common.h has been removed

 6. f2302d4430 2008-08-06 Fix merge problems
    - no merge problems to fix with the new code

 7. 60a3f404ac 2009-06-13 malloc.h: protect it against multiple include
    - Already covered: new malloc.h has MALLOC_280_H include guards

 8. 5e93bd1c9a 2009-08-21 Consolidate arch-specific sbrk() implementations
    - Already covered: sbrk() and mem_malloc_init() in separate commit

 9. d4e8ada0f6 2009-08-21 Consolidate arch-specific mem_malloc_init() implementations
    - Already covered: mem_malloc_init() in separate commit

10. 521af04d85 2009-09-21 Conditionally perform common relocation fixups
    - Not needed: Manual relocation removed in 4babaa0c28

11. b4feeb4e8a 2009-11-24 i386: Fix malloc initialization
    - Already covered: mem_malloc_init() is common, no arch-specific guards

12. 2740544881 2010-01-15 malloc: return NULL if not initialized yet
    - Done: Add check in dlmalloc() to return NULL if not initialized

13. ae30b8c200 2010-04-06 malloc: sbrk() should return MORECORE_FAILURE instead of NULL on failure
    - Already covered: sbrk() returns MFAIL on failure

14. ea882baf9c 2010-06-20 New implementation for internal handling of environment variables.
    - Not needed: Just changes #if 0 to #ifdef DEBUG for old stats code

15. 1ba91ba233 2010-10-14 dlmalloc.c: Fix gcc alias warning
    - Not needed: New dlmalloc has no strict-aliasing warnings

16. 2e5167ccad 2010-10-28 Replace CONFIG_RELOC_FIXUP_WORKS by CONFIG_NEEDS_MANUAL_RELOC
    - Not needed: Manual relocation removed in 4babaa0c28

17. 6163f5b4c8 2010-11-15 malloc: Fix issue with calloc memory possibly being non-zero
    - Already covered: sbrk() clears memory on negative increment

18. 21726a7afc 2011-06-29 Add assert() for debug assertions
    - Not needed: New dlmalloc uses U-Boot's global assert()

19. ea95cb7331 2011-09-10 utx8245: fix build breakage due to assert()
    - Not needed: New dlmalloc has different debug check functions

20. 213adf6dff 2012-03-29 Malloc: Fix -Wundef warnings
    - Not needed: New malloc.h doesn't have these #if issues

21. 93691842e8 2012-09-04 Fix strict-aliasing warning in dlmalloc
    - Not needed: New dlmalloc has no malloc_bin_reloc()

22. 00d0d2ad4e 2012-06-03 malloc: remove extern declarations of malloc_bin_reloc() in board.c files
    - Not needed: New dlmalloc has no malloc_bin_reloc()

23. 199adb601f 2012-10-29 common/misc: sparse fixes
    - Not needed: New dlmalloc uses proper NULL

24. 7b395232da 2013-01-21 malloc: make malloc_bin_reloc static
    - Not needed: New dlmalloc has no malloc_bin_reloc()

25. 472d546054 2013-04-01 Consolidate bool type
    - Not needed: Just a comment change (True -> true)

26. d93041a4ca 2014-07-10 Remove form-feeds from dlmalloc.c
    - Not needed: New dlmalloc doesn't have form-feeds

27. d59476b644 2014-07-10 Add a simple malloc() implementation for pre-relocation
    - Done (updated): Redirect to malloc_simple before GD_FLG_FULL_MALLOC_INIT

28. 6d7601e744 2014-07-10 sandbox: Always enable malloc debug
    - Done (updated): Combined with #64, use 'DEBUG 1' for new dlmalloc

29. 854d2b9753 2014-10-29 dlmalloc: ensure gd is set for early alloc
    - Not needed: Reverted by #38

30. 868de51dde 2014-08-26 malloc: Output region when debugging
    - Already covered: debug() message in mem_malloc_init()

31. c9356be307 2014-11-10 dm: Split the simple malloc() implementation into its own file
    - Already covered: Redirect to malloc_simple.c via GD_FLG_FULL_MALLOC_INIT

32. 0aa8a4ad99 2015-03-04 dlmalloc: do memset in malloc init as new default config
    - Already covered: SYS_MALLOC_CLEAR_ON_INIT at line 6396

33. fb5cf7f16b 2015-02-27 Move initf_malloc() to a common place
    - Already covered: initf_malloc() at line 6357

34. 1eb0c03c21 2015-09-13 malloc_simple: Add Kconfig option for using only malloc_simple in the SPL
    - Not needed: Changes to Kconfig/malloc_simple.c, not dlmalloc.c

35. 4f144a4164 2016-01-25 malloc: work around some memalign fragmentation issues
    - Done (updated): Ported to internal_memalign() at line 4955

36. ee05fedc6c 2016-02-04 malloc: solve dead code issue in memalign()
    - Not needed: New dlmalloc 2.8.6 has rewritten internal_memalign()

37. 2f0bcd4de1 2016-03-05 malloc: use hidden visibility
    - Done (updated): Use DLMALLOC_EXPORT at line 546

38. deff6fb3a7 2016-03-05 malloc: remove !gd handling
    - Not needed: Reverts #29, we don't add gd check

39. 4eece2602b 2016-04-21 common/dlmalloc.c: Delete content that was moved to malloc.h
    - Not needed: New dlmalloc doesn't have #if 0 code

40. 034eda867f 2016-04-25 malloc: improve memalign fragmentation fix
    - Done (updated): Combined with #35 in memalign workaround port

41. 4e33316f65 2017-05-25 malloc: Turn on DEBUG when enabling unit tests
    - Already covered: Combined with #28, #63 at line 555

42. f1896c45cb 2017-07-24 spl: make SPL and normal u-boot stage use independent SYS_MALLOC_F_LEN
    - Already covered: Use CONFIG_IS_ENABLED and CONFIG_VAL at line 6410

43. a874cac3b4 2017-11-10 malloc: don't compare pointers to 0
    - Not needed: New dlmalloc uses proper NULL comparisons

44. ee038c58d5 2018-05-18 malloc: Use malloc simple before malloc is fully initialized in memalign()
    - Already covered: memalign_simple redirect at line 5367

45. 7cbd2d2e32 2018-11-18 malloc_simple: Add logging of allocations
    - Not needed: Changes to malloc_simple.c, not dlmalloc.c

46. 4c6be01c27 2019-03-27 malloc: Fix memalign not honoring alignment prior to full malloc init
    - Already covered: Uses memalign_simple at line 5367

47. bb71a2d9dc 2019-10-25 dlmalloc: calloc: fix zeroing early allocations
    - Done (updated): Port to dlcalloc() at line 4857

48. cfda60f99a 2020-02-03 sandbox: Use a prefix for all allocation functions
    - Done: USE_DL_PREFIX and reverse mappings in malloc.h

49. be621c11b9 2020-04-15 dlmalloc: remove unit test support in SPL
    - Already covered: CONFIG_IS_ENABLED(UNIT_TEST) at line 554

50. 9297e366d6 2020-04-29 malloc: dlmalloc: add an ability for the malloc to be re-init/init multiple times
    - Not needed: No boards use CONFIG_SYS_MALLOC_DEFAULT_TO_INIT

51. f7ae49fc4f 2020-05-10 common: Drop log.h from common header
    - Already covered: Includes log.h at line 559

52. 401d1c4f5d 2020-10-30 common: Drop asm/global_data.h from common header
    - Already covered: Includes asm/global_data.h at line 557

53. c6bf4f3898 2021-02-10 malloc: adjust memcpy() and memset() definitions.
    - Not needed: New malloc.h doesn't declare memset/memcpy

54. c197f6e279 2021-03-15 malloc: Export malloc_simple_info()
    - Not needed: Only changes malloc.h, not dlmalloc.c

55. 5ad9220bf7 2021-05-29 malloc: add SPDX license identifiers
    - Not needed: New dlmalloc has MIT-0 license from upstream

56. bdaeea1b68 2022-03-23 malloc: Annotate allocator for valgrind
    - Done (updated): Valgrind annotations in dlmalloc(), dlfree(), dlrealloc()

57. 62d638386c 2022-09-06 test: Support testing malloc() failures
    - Done: malloc_testing/malloc_max_allocs in dlmalloc()

58. f88d48cc74 2023-02-27 dlmalloc: Fix a warning with clang-15
    - Done: Add (void) to dlmalloc_stats() function definition

59. c9db9a2ef5 2023-08-25 dlmalloc: Add support for SPL_SYS_MALLOC_CLEAR_ON_INIT
    - Already covered: Uses CONFIG_IS_ENABLED() in mem_malloc_init() from #32

60. 6a595c2f67 2023-09-06 common: malloc: Remove unused NEEDS_MANUAL_RELOC code bits
    - Not needed: NEEDS_MANUAL_RELOC has been removed

61. ac897385bb 2023-10-02 Merge branch 'next'
    - Not needed: Merge commit, no dlmalloc changes

62. 3d6d507514 2023-09-26 spl: Use SYS_MALLOC_F instead of SYS_MALLOC_F_LEN
    - Already covered: Uses CONFIG_IS_ENABLED(SYS_MALLOC_F) throughout

63. 1786861415 2023-10-07 malloc: Enable assertions if UNIT_TEST is enabled
    - Done (updated): Combined with #28, use 'DEBUG 1' for new dlmalloc

64. c82ff48115 2024-03-31 mcheck: prepare +1 tier for mcheck-wrappers, in dl-*alloc commands
    - Done (updated): Added STATIC_IF_MCHECK and *_impl macros for dlmalloc 2.8.6

65. dfba071ddc 2024-03-31 mcheck: Use memset/memcpy instead of MALLOC_ZERO/MALLOC_COPY for mcheck.
    - Done: Undef and redefine MALLOC_ZERO/MALLOC_COPY when mcheck enabled

66. 151493a875 2024-03-31 mcheck: integrate mcheck into dlmalloc.c
    - Done: Added mcheck wrapper functions for dlmalloc, dlfree, dlrealloc, dlmemalign, dlcalloc

67. ae838768d7 2024-03-31 mcheck: support memalign
    - Done: Implemented dlmemalign wrapper with mcheck hooks

68. 18c1bfafe0 2024-03-31 mcheck: add pedantic mode support
    - Done: Added mcheck_pedantic_prehook() calls and mcheck_pedantic()/mcheck_check_all() API

69. a79fc7a79c 2024-04-27 common: Remove <common.h> and add needed includes
    - Not needed: common.h has been removed

70. d678a59d2d 2024-05-18 Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
    - Not needed: common.h has been removed

71. 03de305ec4 2024-05-20 Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"
    - Not needed: common.h has been removed

72. 910cef3d2f 2024-07-13 common: Remove duplicate newlines
    - Not needed: New dlmalloc has its own formatting from upstream

73. 6627fbba20 2024-07-23 include: Remove duplicate newlines
    - Not needed: New malloc.h has its own formatting from upstream

74. 04894f5ad5 2024-07-30 malloc: Support testing with realloc()
    - Done: Combined with #57, malloc_testing check in dlrealloc()

75. 8642b2178d 2024-08-02 dlmalloc: Fix integer overflow in request2size()
    - Not needed: New dlmalloc 2.8.6 uses MAX_REQUEST for robust overflow checks

76. 0a10b49206 2024-08-02 dlmalloc: Fix integer overflow in sbrk()
    - Already covered: sbrk() checks bounds before memset in U-Boot section

77. 9b9368b5c4 2024-08-02 dlmalloc: Make sure allocation size is within malloc area
    - Not needed: New dlmalloc 2.8.6 uses MAX_REQUEST for robust overflow checks

78. 41fecdc94e 2024-10-21 common: Tidy up how malloc() is inited
    - Already covered: mem_malloc_init() uses map_sysmem in U-Boot section

79. 22f87ef530 2025-08-17 malloc: Avoid defining calloc()
    - Done: Added SYS_MALLOC_SIMPLE section to malloc.h with calloc redirect
END

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-01 17:04:37 +00:00
Simon Glass
9d6670f89a codman: Add documentation
Provide a description of the purpose of codman and some examples of how
to use it.

Series-to: concept
Cover-letter:
codman: Add a new source-code analysis tool

Add a new tool called 'codman' (code manager) for analysing source code
usage in U-Boot builds. This tool determines which files and lines of
code are actually compiled based on the build configuration.

The tool provides three analysis methods:
- unifdef: Static preprocessor analysis (default)
- DWARF: Debug information from compiled code (-w)
- (experimental) LSP: Language server analysis using clangd (-l)

Codman supports:

- File-level analysis: which files are compiled vs unused
- Line-level analysis: which lines are active vs removed by preprocessor
- Kconfig-impact analysis with -a/--adjust option
- Various output formats: stats, directories, detail, summary

Since there is quite a lot of processing involved, Codman uses parallel
processing where possible.

This tool is admittedly not quite up to my normal code quality, but it
has been an interesting experiment in using Claude to create something
from scratch.

The unifdef part of the tool benefits from some patches I created for
that tool:
- O(1) algorithm for symbol lookup, instead of O(n) - faster!
- support for IS_ENABLED(), CONFIG_IS_ENABLED()

Please get in touch if you would like the patches.

This series also includes a minor improvement to buildman and a tidy-up
of the tout library to reduce code duplication.
END

Signed-off-by: Simon Glass <simon.glass@canonical.com>
Series-links: 1:65
2025-11-24 06:47:19 -07:00
GitLab CI Runner
d5ba460e73 docs: Add concept release documentation and tracking
Add docs for the new concept release system:

- concept_cycle.rst: Technical documentation explaining the release
  mechanism, schedule calculations, and troubleshooting guide
- concept_releases.rst: Auto-updated release history file with
  installation instructions and real-time schedule generation
- Updated index.rst to include both new documentation files

The documentation covers:
- Bimonthly release schedule (Feb, Apr, Jun, Aug, Oct, Dec)
- RC numbering system counting backwards from final releases
- Dead period handling for dates too early in cycle
- Snap package distribution via Ubuntu Store
- Automated release tracking and history

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org)
2025-09-11 22:00:11 -06:00
Simon Glass
00548f1c6a doc: Add ulib documentation for shared and static libraries
Add documentation for the U-Boot Library (ulib) feature, explaining how
to build and use both shared (.so) and static (.a) libraries.

Series-to: concept
Cover-letter:
ulib: Provide test programs and documentation
This series completes the implementation of a basic U-Boot library:

- ensure that no output is written during init
- provide a static library to match the existing shared library
- add test programs for both, to ensure they continue to build correctly
- provide documentation to describe how to use the libraries

This is still very early in the implementation, but this series provides
enough for some initial experimentation.
END

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:25
2025-09-05 12:51:05 -06:00
Simon Glass
03df36da0f chid: Provide some developer docs
Describe how this feature works and provide some helpful links.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-04 07:08:25 -06:00
Simon Glass
10a0dec8bc pager: doc: Add mention of the pager feature
Add a note about the pager to the console documentation, with some more
information in the developer section. Also include the pager API.

Series-to: concept
Cover-letter:
Introduce a pager for the console
Some U-Boot commands can produce a lot of output and this can run off
top of the display. This series introduces a simple pager feature, to
allow the output to be read, before pressing SPACE to continue.

A fixed buffer size (4K) is used, which sets a limit on the permmited
output before paging fails and the output is simply written all in one
lot. In most cases this is plenty, but 'env print' does print the whole
environment as one string, so if the legacy distro-boot scripts are used
it could happen.

The default number of visible lines is set with a Kconfig option. Where
a video terminal is being used, the page size is set to match that. In
general U-Boot cannot guess the number of visible lines, since a serial
terminal may be in use.

There is also a 'pager' environment variable which can override any
detected value.

This initial series only counts newlines. It has no support for counting
characters so the result will be sub-optimal if very long lines are
written. This could be addressed in a future patch.

Some effort is made to handle common cases correctly. For example, if
stdout is changed to a serial or vidconsole device, that is used to
determine the page length. When redirecting sandbox to a file, no
attempt is made.

Future work may detect the terminal size by sending an ANSI sequence.
END

Signed-off-by: Simon Glass <sjg@chromium.org>
Series-version: 2
2025-08-26 14:36:07 -06:00
Simon Glass
16e59e0f94 Add a contrib directory
Add a place where people can add contributions, along with
documentation. These may be useful to other developers of U-Boot but are
not maintained / supported by the core developers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-09 06:36:15 -06:00
Simon Glass
2d29554e18 passage: Add documentation
Add documentation about standard passage and update the maintainers.

Series-changes: 2
- Add detailed arch-specific information
- Add comments about passing a bloblist to Linux
- Add comments about how to pass standard passage to EFI
- Fix 'it' typo

Series-changes: 3
- Fix 'that' typo
- Update docs for the various code changes

Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I91d5b9ae45e8d1081b1e165620ad1946bd69af00
2025-05-29 19:06:30 +01:00
Simon Glass
e9f7a83074 doc: Tidy up the hooks documentation
Now that these files are within the repo, link the documentation to the
normal U-Boot documentation. Update directory paths and convert it to
rST format.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-28 10:48:04 +01:00
Heinrich Schuchardt
8c87187119 doc: move README.kconfig to HTML documentation
* format according to Sphinx style
* add link to Linux Kconfig documentation
* sort table alphabetically in 'Conversion from boards.cfg to Kconfig'

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-11-23 23:15:39 +01:00
Simon Glass
7f4e1ea00b binman: Add a tutorial on resolving test-coverage bugs
Provide a short description of how tests work, why they are so critical
and how to resolve gaps in Binman's test coverage.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-10-18 14:10:22 -06:00
Tom Rini
47e544f576 Merge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD"
Simon Glass <sjg@chromium.org> says:

When the SPL build-phase was first created it was designed to solve a
particular problem (the need to init SDRAM so that U-Boot proper could
be loaded). It has since expanded to become an important part of U-Boot,
with three phases now present: TPL, VPL and SPL

Due to this history, the term 'SPL' is used to mean both a particular
phase (the one before U-Boot proper) and all the non-proper phases.
This has become confusing.

For a similar reason CONFIG_SPL_BUILD is set to 'y' for all 'SPL'
phases, not just SPL. So code which can only be compiled for actual SPL,
for example, must use something like this:

   #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD)

In Makefiles we have similar issues. SPL_ has been used as a variable
which expands to either SPL_ or nothing, to chose between options like
CONFIG_BLK and CONFIG_SPL_BLK. When TPL appeared, a new SPL_TPL variable
was created which expanded to 'SPL_', 'TPL_' or nothing. Later it was
updated to support 'VPL_' as well.

This series starts a change in terminology and usage to resolve the
above issues:

- The word 'xPL' is used instead of 'SPL' to mean a non-proper build
- A new CONFIG_XPL_BUILD define indicates that the current build is an
  'xPL' build
- The existing CONFIG_SPL_BUILD is changed to mean SPL; it is not now
  defined for TPL and VPL phases
- The existing SPL_ Makefile variable is renamed to SPL_
- The existing SPL_TPL Makefile variable is renamed to PHASE_

It should be noted that xpl_phase() can generally be used instead of
the above CONFIGs without a code-space or run-time penalty.

This series does not attempt to convert all of U-Boot to use this new
terminology but it makes a start. In particular, renaming spl.h and
common/spl seems like a bridge too far at this point.

The series is fully bisectable. It has also been checked to ensure there
are no code-size changes on any commit.
2024-10-11 12:23:25 -06:00
Simon Glass
64746bfdff doc: Move init-related things out of README
Move this section to rst, changing it just enough so that it builds.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
77a93ae681 doc: Move the generic memory-documentation to doc/
Move this section of the README into doc/ with some minor updates to
mention SPL and user lower-case hex.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-10-09 22:04:56 -06:00
Simon Glass
09c58e0263 doc: Move generic-board documentation into rst
This information is useful for people looking at how U-Boot has changed
over the years and the design decisions which led to it. Move it into
doc/ in an 'historical' section.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:06:08 -06:00
Simon Glass
c684db989e doc: Move bootstd into its own directory
Before adding more files, move the bootstd docs into a new directory,
with an index.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-07-19 13:53:05 +02:00
Alexander Dahl
636480e4e7 doc: develop: Add a general section on gdb usage
Mashed up from different sources linked below, including the now gone
Wiki and doc/README.arm-relocation file.  Tested on a custom board with
AT91 SAMA5D2 SoC and Segger J-Link Base adapter.  This is only generic
advice here, the usage is not board specific.  Some board docs have more
specific instructions on using gdb with a particular board.

Link: https://www.slideshare.net/slideshow/embedded-recipes-2019-introduction-to-jtag-debugging/177511981
Link: https://boundarydevices.com/debugging-using-segger-j-link-jtag/
Link: https://web.archive.org/web/20141224200032/http://www.denx.de/wiki/view/DULG/DebuggingUBoot
Link: https://web.archive.org/web/20141206064148/http://www.denx.de/wiki/view/DULG/GDBScripts1
Suggested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-06-30 13:58:31 +02:00
Joao Marcos Costa
33717dbb20 doc: add ide_integration.rst to doc/develop
Add 'Integration with IDEs' chapter.

For now, this chapter is mostly a reference to the documentation of
gen_compile_commands, in doc/build, but it can be futurely used as
a guide for other IDE-friendly features.

Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com>
Tested-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2023-10-11 13:24:55 -04:00
Simon Glass
4840b71bb0 qconfig: Update the documentation
Update qconfig's documentation to better reflect its new purpose in life.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-10-04 09:25:22 -06:00
Simon Glass
c5aacf5ef8 expo: Add documentation for the configuration editor
This is mentioned in passing in the 'cedit' command. Its file format is
described under `expo`. But it would be better if it had its own entry
in the documentation.

Add a new 'cedit' entry with a few details about this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Tom Rini
fa43709b8d doc: Begin adding a best practices document for board ports
To help guide developers down the right path, begin a document that
lists some best practices to follow when creating a new board port.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-09 08:41:52 +02:00
Heinrich Schuchardt
7fe3901f67 doc: move README.falcon to HTML
Move the Falcon mode documentation to HTML.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-08-03 09:21:02 +02:00
Heinrich Schuchardt
624faeecec doc: describe our documentation style
Provide a reference document for the U-Boot documentation style.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-08 07:44:33 +02:00
Heinrich Schuchardt
c85ee98efa doc: move directory hierarchy to HTML
Move section 'Directory hierarchy' from file README to the HTML
documentation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-27 18:32:00 +01:00
Simon Glass
b5c8fea7b8 expo: Add documentation
Add some documentation for the expo feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-16 18:26:51 -05:00
Tom Rini
541e68d0ee docs: Add a basic security document
Based loosely on the Linux kernel
Documentation/admin-guide/security-bugs.rst file, create a basic
security document for U-Boot.  In sum, security issues should be
disclosed in public on the mailing list if at all possible as an initial
position.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-11-06 10:50:04 +01:00
Tom Rini
e9a1ff9724 Merge branch 'master' into next
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-09-19 16:07:12 -04:00
Stefan Roese
00275f5ead cyclic: Add documentation
Add documentation for the cyclic function infrastructure, including the
cyclic command.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-13 16:01:44 -04:00
Tom Rini
6349b186d8 doc: sending_patches.rst: Incorporate the old "Patches" wiki content
Import as-is much of the old "Patches" wiki page to the current
sending_patches.rst file. This means we need to move patman to being
included in the higher level ToC and add a reference for "Custodians" in
the process document. A very minimal amount of content changing and
rewording is done here as part of the import, in order to make the
conversion easier.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-01 07:23:53 +02:00
Simon Glass
37c42b7270 patman: Add documentation to doc/
Link to patman's documentation from the doc/ directory so that it appears
in the 'make htmldocs' output.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-08-13 11:09:49 +02:00
Simon Glass
915458e148 vbe: Add some documentation
Add a few links to documents about Verified Boot for Embedded (VBE).
These will be expanded as development proceeds.

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-12 08:14:23 -04:00
Tom Rini
53d2ab9b5a doc: develop: Describe system configuration
Start by describing in general the best practices for how to implement
configuration of some aspect of U-Boot.  This generally means finding
the right choices for when something should be static or dynamically
configured and enabled.  Then further document when to use CONFIG or CFG
namespaces for static configuration.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-07-29 18:59:47 +02:00
Tom Rini
6b484ba69f doc: Add doc/develop/release_cycle.rst
Migrate the RelaseCycle wiki page to Sphinx.  In terms of visible
changes, we stop having a dynamic countdown to when the release is.  And
we drop the year-based statistics, that were not being kept up to date.
For the moment, we only link to statistics for v2022.07 but will add
back the historical data in a subsequent patch.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-07-14 14:14:27 -04:00
Tom Rini
dc1ad4766e doc: Migrate Process wiki page to Sphinx
Move the current Process wiki page to doc/develop/process.rst.  The
changes here are for formatting or slight rewording so that it reads
well when linking to other Sphinx documents.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-07-14 14:13:48 -04:00
Tom Rini
528581e32b doc: Migrate DesignPrinciples wiki page to Sphinx
Move the current DesignPrinciples wiki page to
doc/develop/designprinciples.rst.  The changes here are for formatting
or slight rewording so that it reads well when linking to other Sphinx
documents.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-07-14 14:13:44 -04:00
Tom Rini
4211fb2ef6 doc: Migrate CodingStyle wiki page to Sphinx
Move the current CodingStyle wiki page to doc/develop/codingstyle.rst.
The changes here are for formatting or slight rewording so that it reads
well when linking to other Sphinx documents.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-07-14 14:13:41 -04:00
Simon Glass
d411359d91 doc: Convert SPL documentation to ReST
Move this documentation over to .rst format.

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-05-02 09:58:13 -04:00
Simon Glass
e7b2ce191e bootstd: doc: Add documentation
Add documentation for this feature, including the commands and full
devicetree bindings.

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25 10:00:04 -04:00
Simon Glass
abe5d1184f event: Add documentation
Add documentation for events, including the event command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-10 08:28:36 -05:00
Heinrich Schuchardt
5e04435970 doc: describe generation of SMBIOS table
SMBIOS is not x86 specific. So we should have an architecture independent
page describing it.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-02-26 07:37:00 +01:00
Simon Glass
feafc61ea6 Makefile: Add a pylint checker to the build
At present the Python code in U-Boot is somewhat inconsistent, with some
files passing pylint quite cleanly and others not.

Add a way to track progress on this clean-up, by checking that no module
has got any worse as a result of changes.

This can be used with 'make pylint'.

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Re-generate pylint.base]
2022-01-24 17:36:15 -05:00
Heinrich Schuchardt
f5e9035043 doc: printf() codes
Document the format specifier codes used by U-Boot's printf()
implementation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-01-19 16:18:09 +01:00
Simon Glass
40b9e0dd05 doc: Improve environment documentation further
Make various other updates suggested during review of the rST conversion.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-11-16 14:35:08 -05:00
Simon Glass
37c5195dfc doc: Move distro boot doc to rST
Move this over to the new rST format.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-11 19:02:41 -05:00
Tom Rini
e908d20fcb Merge tag 'v2021.10-rc5' into next
Prepare v2021.10-rc5
2021-09-27 09:45:36 -04:00
Simon Glass
269d2d14d2 doc: Add mention of the /config binding
The devicetree binding files are in their own directory and use a simple
text format. Add a link for the binding for the /config node, since it
is otherwise hard to find.

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-09-25 12:30:54 +02:00
Tom Rini
6674edaabf Merge tag 'v2021.10-rc4' into next
Prepare v2021.10-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>

# gpg: Signature made Tue 14 Sep 2021 06:58:32 PM EDT
# gpg:                using RSA key 1A3C7F70E08FAB1707809BBF147C39FF9634B72C
# gpg: Good signature from "Thomas Rini <trini@konsulko.com>" [ultimate]

# Conflicts:
#	board/Arcturus/ucp1020/spl.c
#	cmd/mvebu/Kconfig
#	common/Kconfig.boot
#	common/image-fit.c
#	configs/UCP1020_defconfig
#	configs/sifive_unmatched_defconfig
#	drivers/pci/Kconfig
#	include/configs/UCP1020.h
#	include/configs/sifive-unmatched.h
#	lib/Makefile
#	scripts/config_whitelist.txt
2021-09-16 10:29:40 -04:00
Simon Glass
4d7bb45dc4 bloblist: Move to rST format
Move this documentation to the new format.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-09-11 11:02:02 +02:00
Tom Rini
e199fb35b4 scripts/checkpatch.pl: Resync with v5.13
This resyncs us with the version found in v5.13 of the Linux kernel with
the following exceptions:
- Keep our u-boot specific tests / code area.
- Change the location of checkpatch.rst (which we now import)
- Drop the "use strscpy" test as we don't have that, but do have strlcpy
  and want that used now.
- Keep debug/printf in the list for $logFunctions

And note that we now also include the spdxcheck.py tool that
checkpatch.pl supports calling out to, and include upstream's
checkpatch.rst in our develop section of the documentation.

Signed-off-by: Tom Rini <trini@konsulko.com>
2021-09-01 19:25:37 -04:00