[PATCH v3 0/5] sysinfo: Add gpio sysinfo driver

Sean Anderson sean.anderson at seco.com
Wed Mar 31 19:50:35 CEST 2021


This series adds a GPIO sysinfo driver using the
dm_gpio_get_values_as_int_base3 function. The board revision is mapped
based in devicetree properties. This series is based on Simon's GPIO
series [1].

[1] https://patchwork.ozlabs.org/project/uboot/list/?series=228126

Changes in v3:
- Fix assuming any nonzero return of dev_count_phandle_with_args was an error.
- Fix assuming nonzero return from dm_gpio_get_values_as_int_base3 is an
  error.
- Move detected bool into sysinfo_priv struct
- Rebase onto u-boot/next
- Use SYSINFO_ID_BOARD_MODEL instead of SYSINFO_ID_REVISION

Changes in v2:
- Document sysinfo_gpio_priv
- Enforce sysinfo detect ordering in uclass. Users must still call
  sysinfo_detect beforehand.
- Fix unbalanced brace in sysinfo_gpio_get_int
- Modify sysinfo test to check for detect() ordering.
- Refactor driver to take advantage of the uclass detect ordering
  guarantee.
- Reorder includes
- Set BOARD_HWVERSION to SYSINFO_ID_REVISION, as they represent the same
  content.
- Use enums instead of defines for sysinfo ids

Sean Anderson (5):
  dm: gpio: Fix gpio_get_list_count failing with livetree
  sysinfo: Use global sysinfo IDs for existing sysinfo drivers
  sysinfo: Require that sysinfo_detect be called before other methods
  sysinfo: Add gpio-sysinfo driver
  test: Add gpio-sysinfo test

 arch/sandbox/dts/test.dts                     |   7 +
 common/spl/spl_fit.c                          |   4 +
 .../sysinfo/gpio-sysinfo.txt                  |  37 +++++
 drivers/gpio/gpio-uclass.c                    |   6 +-
 drivers/sysinfo/Kconfig                       |   8 +
 drivers/sysinfo/Makefile                      |   1 +
 drivers/sysinfo/gazerbeam.h                   |   8 +-
 drivers/sysinfo/gpio.c                        | 141 ++++++++++++++++++
 drivers/sysinfo/sandbox.h                     |   2 +-
 drivers/sysinfo/sysinfo-uclass.c              |  29 +++-
 include/sysinfo.h                             |  26 ++--
 test/dm/Makefile                              |   1 +
 test/dm/sysinfo-gpio.c                        |  69 +++++++++
 test/dm/sysinfo.c                             |  23 +--
 14 files changed, 336 insertions(+), 26 deletions(-)
 create mode 100644 doc/device-tree-bindings/sysinfo/gpio-sysinfo.txt
 create mode 100644 drivers/sysinfo/gpio.c
 create mode 100644 test/dm/sysinfo-gpio.c

-- 
2.25.1



More information about the U-Boot mailing list