aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-02-29Merge branch '2024-02-29-add-OF_UPSTREAM-option-for-dts-and-binding-files' ↵WIP/29Feb2024-nextTom Rini30-2779/+283
into next To quote Sumit Garg: Background ---------- This effort started while I was reviewing patch series corresponding to Qcom platforms [1] which was about to import modified devicetree source files from Linux kernel. I suppose keeping devicetree files sync with Linux kernel without any DT bindings schema validation has been a pain for U-Boot SoC/platform maintainers. There has been past discussions about a single DT repo but that hasn't come up and Linux kernel remained the place where DT source files as well as bindings are placed and maintained. However, Linux kernel DT maintainers proposed [2] for U-Boot to rather use devicetree-rebasing repo [3] which is a forked copy from Linux kernel for DT source files as well as bindings. It is tagged at every Linux kernel major release or intermideate release candidates. So here I have tried to reuse that to bring DT bingings compliance as well as a standard way to maintain a regular sync of DT source files with Linux kernel. In order to maintain devicetree files sync, U-Boot will maintains a Git subtree for devicetee-rebasing repo as `dts/upstream` sub-directory. U-Boot will regularly sync `dts/upstream/` subtree whenever the next window opens with the next available kernel major release. `dts/update-dts-subtree.sh` script provides a wrapper around git subtree pull command, usage from the top level U-Boot source tree, run: $ ./dts/update-dts-subtree.sh pull <devicetree-rebasing-release-tag> If required it is also possible to cherry-pick fixes from devicetree-rebasing tree prior to next sync, usage: $ ./dts/update-dts-subtree.sh pick <devicetree-rebasing-commit-id> The RFC/prototype for this series has been discussed with Linux DT maintainers as well as U-Boot maintainers here [4]. Now we would like to reach out to wider U-Boot community to seek feedback. [1] https://lore.kernel.org/all/CAFA6WYMLUD9cnkr=R0Uur+1UeTMkKjM2zDdMJtXb3nmrLk+pDg@mail.gmail.com/ [2] https://lore.kernel.org/all/CAL_JsqKEjv2tSGmT+0ZiO7_qbBfhTycbGnhJhYpKDFzfO9jzDg@mail.gmail.com/ [3] https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/ [4] https://github.com/u-boot/u-boot/pull/451 Changes ------- Traditionally, U-Boot placed copies of devicetree source files from Linux kernel into `arch/<arch>/dts/<name>.dts` which can be selected via setting "<name>" when prompted for `DEFAULT_DEVICE_TREE` by Kconfig. SoC/board maintainers are encouraged to migrate to use synced copies from `dts/upstream/src/<arch>/<vendor>`. To do that enable `OF_UPSTREAM` for the SoC being used via Kconfig and set up "<vendor>/<name>" when prompted for `DEFAULT_DEVICE_TREE` by Kconfig. An example have been shown for Amlogic meson-gxbb SoC and corresponding derived boards via patch #10 and #11. Devicetree bindings schema checks --------------------------------- With devicetee-rebasing Git subtree, the devicetree bindings are also regularly synced with Linux kernel as `dts/upstream/Bindings/` sub-directory. This allows U-Boot to run devicetree bindings schema checks which will bring compliance to U-Boot core/drivers regarding usage of devicetree. Dependencies ------------ The DT schema project must be installed in order to validate the DT schema binding documents and validate DTS files using the DT schema. The DT schema project can be installed with pip: $ pip3 install dtschema Note that 'dtschema' installation requires 'swig' and Python development files installed first. On Debian/Ubuntu systems: $ apt install swig python3-dev Several executables (dt-doc-validate, dt-mk-schema, dt-validate) will be installed. Ensure they are in your PATH (~/.local/bin by default). Recommended is also to install yamllint (used by dtschema when present). $ apt install yamllint Running checks -------------- In order to perform validation of DTB files, use the ``dtbs_check`` target: $ make dtbs_check It is also possible to run checks with a subset of matching schema files by setting the ``DT_SCHEMA_FILES`` variable to 1 or more specific schema files or patterns (partial match of a fixed string). Each file or pattern should be separated by ':'. $ make dtbs_check DT_SCHEMA_FILES=trivial-devices.yaml:rtc.yaml $ make dtbs_check DT_SCHEMA_FILES=/gpio/ $ make dtbs_check DT_SCHEMA_FILES=trivial-devices.yaml
2024-02-29dts: meson-gxbb: Drop redundant devicetree filesSumit Garg11-2703/+0
Since meson-gxbb based boards switched to using upstream DT, so drop redundant files from arch/arm/dts directory. Only *-u-boot.dtsi files kept in arch/arm/dts directory for these boards. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29dts: meson-gxbb: Switch to using upstream DTSumit Garg8-7/+8
Although there were still some variations in board DTS files based on meson-gxbb SoC but I think those were minor differences from upstream and shouldn't impact boot on these devices. So enable OF_UPSTREAM to use upstream DT and add amlogic/ prefix to the DEFAULT_DEVICE_TREE. And thereby directly build DTB from dts/upstream/src/ including *-u-boot.dtsi files from arch/$(ARCH)/dts/ directory. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29MAINTAINERS: Add myself as devicetree-rebasing maintainerSumit Garg1-0/+5
Add myself as devicetree-rebasing maintainer. Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29doc: devicetree: Updates for devicetree-rebasing subtreeSumit Garg1-20/+95
Encourage SoC/board maintainers to migrate to using devicetree-rebasing subtree and maintain a regular sync with Linux kernel devicetree files and bindings. Along with that add documentation regarding how to run DT bindings schema checks. Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29doc: devicetree: Align documentation to use Kconfig optionsSumit Garg1-26/+22
Since U-Boot switched away from manual CONFIG_* defines to Kconfig options, align devicetree documentation accordingly. Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29dts: Add script to uprev dts/upstream subtreeSumit Garg1-0/+48
dts/update-dts-subtree.sh is just a wrapper around git subtree commands. Usage from the top level U-Boot source tree, run: $ ./dts/update-dts-subtree.sh pull <release-tag> $ ./dts/update-dts-subtree.sh pick <commit-id> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29dts: Add alternative location for upstream DTB buildsSumit Garg3-3/+44
Allow platform owners to mirror devicetree files from devitree-rebasing directory into dts/upstream/src/$(ARCH) (special case for arm64). Then build then along with any *-u-boot.dtsi file present in arch/$(ARCH)/dts directory. Also add a new Makefile for arm64. This will help easy migration for platforms which currently are compliant with upstream Linux kernel devicetree files. Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29Makefile: Allow upstream DT subtree to provide DT includesSumit Garg2-1/+7
Allow platforms to reuse DT headers and dtsi includes directly form upstream DT subtree which will be frequently synced with Linux kernel. This will further allow us to drop corresponding DT includes copy from U-Boot tree. Also, since the DT includes from upstream DT subtree are done after DT includes from U-Boot tree, so it shouldn't cause any conflicts. Tested-by: Bryan Brattlof <bb@ti.com> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29scripts/Makefile.lib: Statically define *-u-boot.dtsi files locationSumit Garg1-13/+17
Allow u-boot to build DTB from a different directory tree such that *-u-boot.dtsi files can be included from a common location. Currently that location is arch/$(ARCH)/dts/, so statically define that common location. This is needed for platform owners to start building DTB files from devicetree-rebasing directory but still being able to include *-u-boot.dtsi files. Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29Makefile: Add support for DT bindings schema checksSumit Garg3-7/+36
This adds the build infrastructure for checking DT binding schema documents and validating dtb files using the binding schema. Here we use devicetree-rebasing subtree to provide the DT bindings. Along with that adapt dts/upstream/Bindings/Makefile to align with old U-Boot Kbuild infrastructure. Dependency: ----------- The DT schema project must be installed in order to validate the DT schema binding documents and validate DTS files using the DT schema. The DT schema project can be installed with pip:: pip3 install dtschema Note that 'dtschema' installation requires 'swig' and Python development files installed first. On Debian/Ubuntu systems:: apt install swig python3-dev Testing: -------- Build dts files and check using DT binding schema: $ make dtbs_check Optionally, DT_SCHEMA_FILES can be passed in with a schema file(s) to use for validation. This makes it easier to find and fix errors generated by a specific schema. Note, at this point dtbs_check is an optional build target as there are many warnings generated due to custom DT properties used by many platforms in u-boot. It is expected with these checks that compliance with DT bindings to take place. Once that's done it can be added to CI builds to remain compliant with DT bindings. Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29CI: Exclude devicetree-rebasing subtree for CONFIG checksSumit Garg2-2/+4
Since devicetree-rebasing is an external repo with its own coding style, exclude it from Azure and gitlab CI CONFIG checks. Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29Merge commit '53633a893a06bd5a0c807287d9cc29337806eaf7' as 'dts/upstream'Tom Rini11277-0/+2103666
2024-02-29Squashed 'dts/upstream/' content from commit aaba2d45dc2aTom Rini11277-0/+2103666
git-subtree-dir: dts/upstream git-subtree-split: aaba2d45dc2a1b3bbb710f2a3808ee1c9f340abe
2024-02-29Merge patch series "Handoff bloblist from previous boot stage"Tom Rini10-40/+208
Raymond Mao <raymond.mao@linaro.org> says: This patch set adds/adapts a few bloblist APIs and implements Arm arch custom function to retrieve the bloblist (aka. Transfer List) from previous loader via boot arguments when BLOBLIST option is enabled and all boot arguments are compliant to the register conventions defined in the Firmware Handoff spec v0.9. If an arch wishes to have different behaviors for loading bloblist from the previous boot stage, it is required to implement the custom function xferlist_from_boot_arg().
2024-02-29dts: OF_HAS_PRIOR_STAGE should depend on !BLOBLISTRaymond Mao1-0/+1
When BLOBLIST is enabled, FDT is expected to be from bloblist carried from previous stage, instead of from OF_BOARD, therefore only enable OF_HAS_PRIOR_STAGE when BLOBLIST is disabled. Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
2024-02-29bloblist: Load the bloblist from the previous loaderRaymond Mao2-18/+54
During bloblist initialization, load the bloblist via boot arguments from the previous loader. If a valid bloblist exists in boot arguments, relocate it into the fixed bloblist memory region. If not, fallback to support BLOBLIST_ADDR or BLOBLIST_ALLOC. Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
2024-02-29arm: Get bloblist from boot argumentsRaymond Mao3-0/+46
Add arch custom function to get bloblist from boot arguments. Check whether boot arguments aligns with the register conventions defined in FW Handoff spec v0.9. Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
2024-02-29arm: armv8: save boot argumentsRaymond Mao1-0/+23
Save boot arguments x[0-3] into an array for handover of bloblist from previous boot stage. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Suggested-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-29arm: armv7: save boot argumentsRaymond Mao1-0/+29
Save boot arguments r[0-3] into an array for handover of bloblist from previous boot stage. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Suggested-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-29bloblist: refactor of bloblist_reloc()Raymond Mao4-16/+17
The current bloblist pointer and size can be retrieved from global data, so we don't need to pass them from the function arguments. This change also help to remove all external access of gd->bloblist outside of bloblist module. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-29bloblist: check bloblist with specified buffer sizeRaymond Mao3-6/+7
Instead of expecting the bloblist total size to be the same as the pre-allocated buffer size, practically we are more interested in whether the pre-allocated buffer size is bigger than the bloblist total size. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-29bloblist: add API to check the register conventionsRaymond Mao2-0/+31
Add bloblist_check_reg_conv() to check whether the bloblist is compliant to the register conventions defined in Firmware Handoff specification. This API can be used for all Arm platforms. Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
2024-02-28Merge patch series "mux: Drop usage of "u-boot,mux-autoprobe""WIP/28Feb2024-nextTom Rini5-8/+7
Roger Quadros <rogerq@kernel.org> says: MUX driver should autoprobe if the device tree has "idle-states" property. Drop using the custom "u-boot,mux-autoprobe" property in TI device trees.
2024-02-28arm: dts: k3-u-boot: Add missing "bootph-all" property to MUX nodes.Roger Quadros3-0/+20
As it is present for USB and USB won't work without the MUX initialized correctly, add "bootph-all" property to MUX nodes. Signed-off-by: Roger Quadros <rogerq@kernel.org>
2024-02-28arm: dts: k3-u-boot: Drop usage of "u-boot, mux-autoprobe"Roger Quadros4-22/+0
MUX driver should autoprobe if the device tree has "idle-states" property. Drop using the custom "u-boot,mux-autoprobe" property. Signed-off-by: Roger Quadros <rogerq@kernel.org>
2024-02-28mux: autoprobe if "idle-states" present in device treeRoger Quadros1-1/+2
Some platforms need the MUX state to be auto initialized at boot time even if there are no explicit users for the MUX. In these cases, the MUX device tree has "idle-states" property which specifies what state the MUX should be initialized to. So far we were relying on custom u-boot property "u-boot,mux-autoprobe" to autoprobe such MUXes. This patch causes the MUX to autoprobe if it has "idle-states" property in device tree. This should allow us to stop using the custom "u-boot,mux-autoprobe" property. Signed-off-by: Roger Quadros <rogerq@kernel.org>
2024-02-28Merge tag 'efi-next-2024-02-28' of ↵Tom Rini8-19/+100
https://source.denx.de/u-boot/custodians/u-boot-efi into next Pull request efi-next-2024-02-28 * set IMAGE_DLLCHARACTERISTICS_NX_COMPAT in EFI binaries * provide SBI based runtime system reset * page align EFI binary section on ARMv7 * separate .data and .text sections of EFI binaries on ARMv7
2024-02-28arm: separate .data and .text sections of EFI binariesHeinrich Schuchardt2-16/+52
EFI binaries should not contain sections that are both writable and executable. Separate the RX .text section from the RW .data section. We currently don't created relocation sections (.rel.*) for our EFI binaries. Anyway these would have to be converted to PE/COFF relocations. Enumerate them under DISCARD and add a comment. Correct the characteristics of the sections. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-28arm: page align EFI binary sectionHeinrich Schuchardt1-2/+2
Change the alignment of the relocation code in EFI binaries to match page boundaries. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-28efi_driver: provide SBI based runtime system resetHeinrich Schuchardt3-1/+31
On RISC-V systems system the Supervisory Binary Interface provides system reset and poweroff. Use it at EFI runtime. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-02-28efi_loader: set IMAGE_DLLCHARACTERISTICS_NX_COMPATHeinrich Schuchardt4-0/+15
The IMAGE_DLLCHARACTERISTICS_NX_COMPAT flag marks an EFI binary where the following conditions are met [1]: * Executable and writable sections are separated. * The application does not run self-modifying code. * The application uses the EFI_MEMORY_ATTRIBUTE_PROTOCOL when loading executable code. * The application does not assume that all memory ranges are usable. * The stack is not expected to be executable. The only EFI binaries U-Boot provides that do not fulfill these requirements are the EFI app and the EFI payload. Once we have implemented separation of writable and executable memory in U-Boot we can use the IMAGE_DLLCHARACTERISTICS_NX_COMPAT flag to decide if we will load an EFI binary. [1] New UEFI CA memory mitigation requirements for signing https://techcommunity.microsoft.com/t5/hardware-dev-center/new-uefi-ca-memory-mitigation-requirements-for-signing/ba-p/3608714 Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-02-27Merge patch series "kbuild: Allow for CONFIG_SYS_CONFIG_NAME to be unset"Tom Rini76-223/+11
Perform a little re-organization of Kconfig so that we can have CONFIG_SYS_CONFIG_NAME be unset and so not require a "board.h" file. Then go and remove a number of now not required header files.
2024-02-27Kconfig: Centralize prompting for SYS_CONFIG_NAMETom Rini33-100/+10
Generally speaking, we do not prompt for this value and define it in the board specific Kconfig file. There are some valid use cases however today where we do prompt for this value, so instead of having this be done in a number of locations, do this at the top-level location only. This removes the question from a number of other locations and makes it consistent that when we do set the value directly, we always do it the same way. We don't need to specify the type, it's always string. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27hc2910-2aghd05: Remove empty config headerTom Rini3-10/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the hc2910-2aghd05 platform and remove the otherwise empty file. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27slimbootloader: Remove empty config headerTom Rini3-8/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the slimbootloader platform and remove the otherwise empty file. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27qemu-x86*: Remove empty config headerTom Rini3-9/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the qemu-x86* platforms and remove the otherwise empty file. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27minnowmax: Remove empty config headerTom Rini3-8/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the minnowmax platform and remove the otherwise empty file. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27galileo: Remove empty config headerTom Rini3-8/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the galileo platform and remove the otherwise empty file. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27efi-x86_payload: Remove empty config headerTom Rini3-8/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the efi-x86_payload* platforms and remove the otherwise empty file. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27efi-x86_app: Remove empty config headerTom Rini3-9/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the efi-x86_app* platforms and remove the otherwise empty file. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27edison: Remove empty config headerTom Rini3-8/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the edison platform and remove the otherwise empty file. Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27crownbay: Remove empty config headerTom Rini3-8/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the crownbay platform and remove the otherwise empty file. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27cougarcanyon2: Remove empty config headerTom Rini3-8/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the cougarcanyon2 platform and remove the otherwise empty file. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27cherryhill: Remove empty config headerTom Rini3-8/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the cherryhill platform and remove the otherwise empty file. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27bayleybay: Remove empty config headerTom Rini3-8/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the bayleybay platform and remove the otherwise empty file. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27coreboot: Remove empty config headerTom Rini3-12/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the coreboot platform and remove the otherwise empty file. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27xilinx_mbv: Remove empty config headerTom Rini3-10/+0
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a lack of board.h file, unset this on the xilinx_mbv platforms and remove the otherwise empty file. Acked-by: Michal Simek <michal.simek@amd.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27kbuild: Allow for CONFIG_SYS_CONFIG_NAME to be unsetTom Rini1-1/+1
It is possible to have a platform which does not require a board.h file to build, but today we need an empty one for our generated config.h file to be valid. Allow for omitting this file if CONFIG_SYS_CONFIG_NAME is not set. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-26Prepare v2024.04-rc3v2024.04-rc3Tom Rini2-2/+2
Signed-off-by: Tom Rini <trini@konsulko.com>