Skip to content
  • Simon Glass's avatar
    doc: Add documentation about devicetree usage · d9a29c9b
    Simon Glass authored
    At present some of the ideas and techniques behind devicetree in U-Boot
    are assumed, implied or unsaid. Add some documentation to cover how
    devicetree is build, how it can be modified and the rules about using
    the various CONFIG_OF_... options.
    
    Commit-notes:
    This patch attracted quite a bit of discussion here:
    
    https://patchwork.ozlabs.org/project/uboot/patch/20210909201033.755713-4-sjg@chromium.org/
    
    
    
    I have not included the text suggested by François. While I agree that
    it would be useful to have an introduction in this space, I do not agree
    that we should have two devicetrees or that U-Boot should not have its own
    things in the devicetree, so it is not clear to me what we should actually
    write.
    
    The 'Devicetree Control in U-Boot' docs were recently merged and these
    provide some base info, for now.
    END
    
    Series-to: u-boot
    Series-version: 4
    Series-links: 261659
    Series-cc: Mark Kettenis <mark.kettenis@xs4all.nl>
    Series-cc: trini, heinrich
    Series-cc: Sean Anderson <seanga2@gmail.com>
    Series-cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
    Series-changes: 2
    - Fix typos per Sean (thank you!) and a few others
    - Add a 'Use of U-Boot /config node' section
    - Drop mention of dm-verity since that actually uses the kernel cmdline
    - Explain that OF_BOARD will still work after these changes (in
      'Once this bug is fixed...' paragraph)
    - Expand a bit on the reason why the 'Current situation' is bad
    - Clarify in a second place that Linux and U-Boot use the same devicetree
      in 'To be clear, while U-Boot...'
    - Expand on why we should have rules for other projects in
      'Devicetree in another project'
    - Add a comment as to why devicetree in U-Boot is not 'bad design'
    - Reword 'in-tree U-Boot devicetree' to 'devicetree source in U-Boot'
    - Rewrite 'Devicetree generated on-the-fly in another project' to cover
      points raised on v1
    - Add 'Why does U-Boot have its nodes and properties?'
    - Add 'Why not have two devicetrees?'
    
    Series-changes: 3
    - Clarify the 'bug' refered to at the top
    - Reword 'This means that there' paragraph to explain U-Boot-specific things
    - Move to doc/develop/devicetree now that OF_CONTROL is in the docs
    
    Cover-letter:
    doc: Clarify how U-Boot makes use of devicetree
    This series includes a documentation update to clarify how U-Boot makes
    use of devicetree and its requirements when working with other firmware
    projects.
    
    Once agreed it should provide more clarity in this area, which seems to
    have devolved into a confusing mire recently.
    
    My goal here is to sort out this area one and for all, clearly documenting
    the use cases and implications of them. I hope that the end result of this
    (substantial) effort will be a shared understanding of how to move
    forward in U-Boot and hopefully some ideas for firmware in general.
    
    It also cleans up the config binding since this has got a bit out-of-date.
    END
    
    Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
    Reviewed-by: default avatarMarcel Ziswiler <marcel.ziswiler@toradex.com>
    d9a29c9b