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 v4: - Enable sysinfo_gpio test for sandbox - Fix test failure caused by uninitialized variable - Rebase onto u-boot/master 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 + configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + configs/sandbox_flattree_defconfig | 1 + configs/sandbox_noinst_defconfig | 1 + configs/sandbox_spl_defconfig | 1 + .../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 | 25 ++-- 19 files changed, 342 insertions(+), 27 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