Skip to content

Add support for extension boards detection and DT overlays application

Kory Maincent u-boot 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest10 patches 0 repliesNew
  2. v410 patches 0 repliesSuperseded
  3. v310 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v212 patches0 repliesSuperseded
v110 patches0 repliesSuperseded

Changes in v5 from the cover letter

- Rebase on master

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10fdt_support: move fdt_valid from cmd_fdt.c to fdt_support.ccmd/fdt.c common/fdt_support.c include/fdt_support.h+48 -491 reply
2/10cmd: add support for a new "extension" commandcmd/Kconfig cmd/Makefile cmd/extension_board.c +2 more+322 -01 reply
3/10pytest: add sandbox test for "extension" commandarch/Kconfig arch/sandbox/dts/Makefile arch/sandbox/dts/overlay0.dts +3 more+96 -01 reply
4/10ti/common: add support for extension_scan_board functionboard/ti/common/Kconfig board/ti/common/Makefile board/ti/common/cape_detect.c +1 more+131 -01 reply
5/10am57xx: add support for cape detect functionalityarch/arm/mach-omap2/omap5/Kconfig board/ti/am57xx/board.c+2 -01 reply
6/10w1: replace dt detection by automatic detectiondrivers/w1-eeprom/ds24xxx.c drivers/w1-eeprom/ds2502.c drivers/w1-eeprom/w1-eeprom-uclass.c +3 more+104 -351 reply
7/10arm: sunxi: add support for DIP detection to CHIP boardarch/arm/mach-sunxi/Kconfig board/sunxi/Makefile board/sunxi/chip.c+110 -02 replies
8/10configs: CHIP: add support for DIP detect functionalityconfigs/CHIP_defconfig+1 -02 replies
8/10configs: CHIP: add support for DIP detect functionality+0 -00 replies
9/10arm: am335x: add support for i2c2 busarch/arm/mach-omap2/am33xx/clock_am33xx.c board/ti/am335x/board.c board/ti/am335x/board.h +1 more+19 -01 reply
10/10am335x: add support for cape detect functionalityarch/arm/mach-omap2/am33xx/Kconfig board/ti/am335x/board.c+2 -01 reply

Reviews trailers per patch

6 of 11 patches have a Reviewed-by or Acked-by.

PatchTom RiniMaxime RipardAndre Przywara
1/10R-b R-b
2/10R-b
3/10
4/10
5/10
6/10R-b
7/10R-b A-b
8/10A-b A-b
8/10A-b A-b
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

Cover letter [PATCH v5 00/10] Add support for extension boards detection and DT overlays application

This series of patches aims at proposing a generic U-Boot mechanism to detect extension boards connected to the HW platform, and apply the appropriate Device Tree overlays depending on the detected extension boards.

Indeed, numerous popular platforms, such as the BeagleBone or the RaspberryPi, feature some kind of extension board mechanism. These extension boards are often discoverable through some kind of EEPROM (connected on I2C, 1-wire, etc.) and require Device Tree overlays to be applied at the U-Boot level to provide a complete HW description to the Linux kernel. However, currently this logic is usually implemented ad-hoc in downstream forks of U-Boot.

This series proposes to bring a HW-agnostic and generic solution to this problem to upstream U-Boot. The series shows that it is generic enough by implementing its usage for 2 different families of HW platforms and expansion boards:

- The BeagleBone Black and BeagleBone AI, that use extension boards where the EEPROM describing the extension boards is connected over I2C.

- The CHIP, that uses extension boards where the EEPROM describing the extension boards is connected over 1-wire.

The patch series implements a new command called "extension", with two sub-commands:

- "extension scan" to detect available extension boards

- "extension list" will simply list the detected extension boards

- "extension apply" will allow to apply the Device Tree overlays corresponding to one extension board or to all expansion boards

Note that the name "extension" has been chosen to not refer to any particular board-specific terminology for extension boards ("cape" for BeagleBone, "DIP" for CHIP, "hat" for RaspberryPi, etc.). However, we welcome suggestions of other names and are definitely willing to use a different naming.

The "extension apply" command requires two environment variables to be defined so that it knows how to apply DT overlays. This is described in more details in PATCH 1.

This generic code requires board-specific code for the detection and enumeration of extension boards. This is simply implemented in the form of a board-specific extension_board_scan() function, which fills in a list of detected extension boards.

In detail:

- PATCH 1 move fdt_valid function to fdt_support file
- PATCH 2 implements the generic command and logic
- PATCH 3 implements the python test for the "extension" command
- PATCH 4 implements the board-specific code for the BeagleBone platforms
- PATCH 5 enables the mechanism for the BeagleBone AI
- PATCH 6 review the detection mechanism of one-wire devices
- PATCH 7 and 8 enable the mechanism for the CHIP
- PATCH 9 and 10 enable the mechanism for the BeagleBone Black

Thanks in advance for your review and feedback

Change since v1:
- remove the one wire devicetree description of the CHIP board
- rewrite the detection of w1 to makes it automatic and not devicetree dependent
- replace Kconfig CHIP board target by Kconfig CHIP_DIP_SCAN simple option
- rewrite doc to rST syntax
- make few syntax update

Change since v2:
- review the detection of w1 to makes it compatible with automatic detection alongside the devicetree description detection
- update the patch separation between the mechanism for the CHIP and the configuration activation

Change since v3:
- Update commit messages on the extension command patch
- Remove a test on CMD_EXTENSION in the chip.c file.

Change since v4:
- Rebase on master

Kory Maincent (10):
fdt_support: move fdt_valid from cmd_fdt.c to fdt_support.c
cmd: add support for a new "extension" command
pytest: add sandbox test for "extension" command ti/common: add support for extension_scan_board function
am57xx: add support for cape detect functionality
w1: replace dt detection by automatic detection
arm: sunxi: add support for DIP detection to CHIP board
configs: CHIP: add support for DIP detect functionality
arm: am335x: add support for i2c2 bus
am335x: add support for cape detect functionality

 arch/Kconfig                              |   2 +
 arch/arm/mach-omap2/am33xx/Kconfig        |   1 +
 arch/arm/mach-omap2/am33xx/clock_am33xx.c |   1 +
 arch/arm/mach-omap2/omap5/Kconfig         |   1 +
 arch/arm/mach-sunxi/Kconfig               |   9 ++
 arch/sandbox/dts/Makefile                 |   1 +
 arch/sandbox/dts/overlay0.dts             |   9 ++
 arch/sandbox/dts/overlay1.dts             |   9 ++
 board/sandbox/sandbox.c                   |  23 +++
 board/sunxi/Makefile                      |   1 +
 board/sunxi/chip.c                        | 100 +++++++++++++
 board/ti/am335x/board.c                   |   3 +
 board/ti/am335x/board.h                   |   1 +
 board/ti/am335x/mux.c                     |  15 ++
 board/ti/am57xx/board.c                   |   1 +
 board/ti/common/Kconfig                   |   6 +
 board/ti/common/Makefile                  |   1 +
 board/ti/common/cape_detect.c             |  96 +++++++++++++
 board/ti/common/cape_detect.h             |  28 ++++
 cmd/Kconfig                               |  12 ++
 cmd/Makefile                              |   1 +
 cmd/extension_board.c                     | 167 ++++++++++++++++++++++
 cmd/fdt.c                                 |  49 -------
 common/fdt_support.c                      |  46 ++++++
 configs/CHIP_defconfig                    |   1 +
 doc/usage/extension.rst                   | 111 ++++++++++++++
 drivers/w1-eeprom/ds24xxx.c               |   7 +
 drivers/w1-eeprom/ds2502.c                |   6 +
 drivers/w1-eeprom/w1-eeprom-uclass.c      |  31 ----
 drivers/w1/w1-uclass.c                    |  76 +++++++++-
 include/extension_board.h                 |  31 ++++
 include/fdt_support.h                     |   2 +
 include/w1-eeprom.h                       |   2 -
 include/w1.h                              |  17 +++
 test/py/tests/test_extension.py           |  52 +++++++
 35 files changed, 835 insertions(+), 84 deletions(-)
 create mode 100644 arch/sandbox/dts/overlay0.dts
 create mode 100644 arch/sandbox/dts/overlay1.dts
 create mode 100644 board/sunxi/chip.c
 create mode 100644 board/ti/common/cape_detect.c
 create mode 100644 board/ti/common/cape_detect.h
 create mode 100644 cmd/extension_board.c
 create mode 100644 doc/usage/extension.rst
 create mode 100644 include/extension_board.h
 create mode 100644 test/py/tests/test_extension.py
Signature · 1 line
2.17.1