[PATCH 00/12] dm: Expand of-platdata support to GPIOs and clean up

Simon Glass sjg at chromium.org
Sat Aug 7 15:24:00 CEST 2021


The of-platdata feature allows driver model to be used in SPL without
the overhead of a devicetree. The relevant parts of the devicetree are
converted to C by the dtoc tool.

So far of-platdata supports various drivers but not enough to support
the am335x boards.

This series adds GPIO support to of-platdata, via a
gpio_request_by_phandle() function which looks up GPIOs from the
of-platdata information.

It also tidies up the existing clock support and finishes off irq support.

Finally it includes a new OF_REAL symbol to control whether a devicetree
is actually available at runtime. This allows some simplification of
the #ifdef logic.

For am335x, the cpsw driver uses several devicetree subnodes. For this to
work with dtoc it needs to be converted to separate drivers for each
subnode, each with a compatible string.


Simon Glass (12):
  treewide: fdt: Move fdt_get_config_... to ofnode_conf_read...
  fdt: Create a new OF_REAL Kconfig
  treewide: Simply conditions with the new OF_REAL
  treewide: Use OF_REAL instead of !OF_PLATDATA
  mmc: nds32: ftsdc010: Convert to livetree
  treewide: Try to avoid the preprocessor with OF_REAL
  fdt: Update Makefile rules with the new OF_REAL Kconfig
  dm: Add comments to dt-structs contents
  clk: Rename clk_get_by_driver_info()
  dm: doc: Add a note about of-platdata header files
  irq: Tidy up of-platdata irq support
  dm: gpio: Add of-platdata support

 Makefile                                      |  7 +-
 arch/arm/mach-rockchip/rk3188/rk3188.c        |  4 +-
 arch/arm/mach-rockchip/rk3399/syscon_rk3399.c |  2 +-
 arch/arm/mach-rockchip/rk3568/syscon_rk3568.c |  2 +-
 arch/sandbox/dts/sandbox.dtsi                 | 21 +++++-
 arch/sandbox/dts/test.dts                     |  3 +
 arch/sandbox/include/asm/irq.h                | 20 ++++++
 arch/x86/cpu/apollolake/hostbridge.c          |  4 +-
 arch/x86/cpu/apollolake/lpc.c                 |  2 +-
 arch/x86/cpu/apollolake/pch.c                 |  2 +-
 arch/x86/cpu/apollolake/pmc.c                 |  4 +-
 arch/x86/cpu/apollolake/uart.c                |  2 +-
 arch/x86/cpu/coreboot/coreboot.c              |  5 +-
 arch/x86/cpu/intel_common/itss.c              |  2 +-
 arch/x86/cpu/intel_common/p2sb.c              | 24 +++----
 arch/x86/lib/lpc-uclass.c                     |  2 +-
 arch/x86/lib/tpl.c                            |  2 +-
 board/dhelectronics/dh_stm32mp1/board.c       |  5 +-
 board/firefly/firefly-rk3288/firefly-rk3288.c |  4 +-
 board/google/chromebook_coral/coral.c         |  2 +-
 board/sandbox/sandbox.c                       |  5 +-
 board/st/stm32mp1/stm32mp1.c                  |  5 +-
 common/autoboot.c                             |  8 +--
 common/board_r.c                              |  4 +-
 common/cli.c                                  |  7 +-
 common/spl/spl.c                              |  2 +-
 common/spl/spl_spi.c                          | 12 ++--
 configs/sandbox_noinst_defconfig              |  2 +
 configs/sandbox_spl_defconfig                 |  2 +
 disk/part_efi.c                               |  8 +--
 doc/develop/driver-model/of-plat.rst          | 32 +++++++--
 doc/device-tree-bindings/config.txt           |  4 +-
 drivers/clk/clk-uclass.c                      | 15 ++--
 drivers/clk/clk_fixed_factor.c                | 18 ++---
 drivers/clk/clk_fixed_rate.c                  |  7 +-
 drivers/clk/rockchip/clk_px30.c               |  4 +-
 drivers/clk/rockchip/clk_rk3188.c             |  8 +--
 drivers/clk/rockchip/clk_rk3288.c             | 10 +--
 drivers/clk/rockchip/clk_rk3308.c             |  4 +-
 drivers/clk/rockchip/clk_rk3368.c             | 10 +--
 drivers/clk/rockchip/clk_rk3399.c             | 20 +++---
 drivers/core/device.c                         |  4 +-
 drivers/core/fdtaddr.c                        |  2 +-
 drivers/core/lists.c                          |  2 +-
 drivers/core/ofnode.c                         | 33 +++++++++
 drivers/core/root.c                           |  4 +-
 drivers/core/simple-bus.c                     |  2 +-
 drivers/core/syscon-uclass.c                  |  2 +-
 drivers/core/uclass.c                         |  2 +-
 drivers/core/util.c                           |  2 +-
 drivers/firmware/firmware-uclass.c            |  2 +-
 drivers/gpio/Makefile                         |  4 +-
 drivers/gpio/gpio-uclass.c                    | 28 +++++++-
 drivers/gpio/intel_gpio.c                     |  2 +-
 drivers/gpio/mxs_gpio.c                       |  4 +-
 drivers/gpio/omap_gpio.c                      |  4 +-
 drivers/gpio/sandbox.c                        | 14 ++--
 drivers/gpio/sandbox_test.c                   | 21 ++++++
 drivers/i2c/i2c-emul-uclass.c                 |  2 +-
 drivers/i2c/i2c-uclass.c                      | 10 +--
 drivers/i2c/omap24xx_i2c.c                    |  4 +-
 drivers/misc/Makefile                         |  2 +-
 drivers/misc/cros_ec.c                        |  2 +-
 drivers/misc/irq-uclass.c                     | 10 ++-
 drivers/misc/irq_sandbox.c                    | 15 +---
 drivers/misc/irq_sandbox_test.c               | 22 ++++++
 drivers/misc/misc-uclass.c                    |  2 +-
 drivers/misc/p2sb-uclass.c                    | 20 +++---
 drivers/mmc/fsl_esdhc_imx.c                   | 17 ++---
 drivers/mmc/ftsdc010_mci.c                    | 45 ++++++------
 drivers/mmc/mxsmmc.c                          |  4 +-
 drivers/mmc/omap_hsmmc.c                      |  6 +-
 drivers/mmc/rockchip_dw_mmc.c                 |  8 ++-
 drivers/mmc/rockchip_sdhci.c                  | 14 ++--
 drivers/pch/pch-uclass.c                      |  2 +-
 drivers/pinctrl/intel/pinctrl_apl.c           |  4 +-
 drivers/pinctrl/nxp/pinctrl-mxs.c             |  2 +-
 drivers/pinctrl/pinctrl-qe-io.c               |  2 +-
 drivers/pinctrl/pinctrl-uclass.c              |  2 +-
 drivers/pinctrl/rockchip/pinctrl-px30.c       |  2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3036.c     |  2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3128.c     |  2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3188.c     |  2 +-
 drivers/pinctrl/rockchip/pinctrl-rk322x.c     |  2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3288.c     |  2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3308.c     |  2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3328.c     |  2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3368.c     |  2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3399.c     |  2 +-
 drivers/pinctrl/rockchip/pinctrl-rv1108.c     |  2 +-
 drivers/power/domain/power-domain-uclass.c    |  4 +-
 drivers/ram/rockchip/dmc-rk3368.c             | 12 ++--
 drivers/ram/rockchip/sdram_rk3188.c           |  5 +-
 drivers/ram/rockchip/sdram_rk322x.c           |  5 +-
 drivers/ram/rockchip/sdram_rk3288.c           |  5 +-
 drivers/ram/rockchip/sdram_rk3328.c           |  4 +-
 drivers/ram/rockchip/sdram_rk3399.c           |  9 +--
 drivers/rtc/rtc-uclass.c                      |  2 +-
 drivers/serial/ns16550.c                      |  8 +--
 drivers/serial/sandbox.c                      |  2 +-
 drivers/serial/serial_mt7620.c                |  4 +-
 drivers/serial/serial_omap.c                  |  6 +-
 drivers/spi/cf_spi.c                          |  4 +-
 drivers/spi/davinci_spi.c                     |  4 +-
 drivers/spi/fsl_espi.c                        |  4 +-
 drivers/spi/ich.c                             |  6 +-
 drivers/spi/mxs_spi.c                         |  4 +-
 drivers/spi/omap3_spi.c                       |  4 +-
 drivers/spi/pl022_spi.c                       |  4 +-
 drivers/spi/rk_spi.c                          | 38 +++++------
 drivers/spi/spi-uclass.c                      | 14 ++--
 drivers/sysreset/sysreset_sandbox.c           |  2 +-
 drivers/timer/rockchip_timer.c                | 16 ++---
 drivers/timer/timer-uclass.c                  | 68 ++++++++++---------
 drivers/timer/tsc_timer.c                     |  2 +-
 drivers/tpm/tpm-uclass.c                      |  2 +-
 drivers/video/cfb_console.c                   |  4 +-
 drivers/video/exynos/exynos_mipi_dsi.c        |  4 +-
 drivers/watchdog/wdt-uclass.c                 |  2 +-
 dts/Kconfig                                   | 29 +++++++-
 env/mmc.c                                     |  5 +-
 include/asm-generic/gpio.h                    |  5 ++
 include/clk.h                                 | 35 ++++++++--
 include/dm/device.h                           | 12 ++--
 include/dm/ofnode.h                           | 37 ++++++++++
 include/dt-structs.h                          | 27 ++++++++
 include/fdtdec.h                              | 33 ---------
 include/irq.h                                 | 29 ++++++++
 include/power-domain.h                        |  6 +-
 lib/Makefile                                  |  5 +-
 lib/fdtdec.c                                  | 44 ------------
 scripts/Makefile.spl                          |  9 +--
 test/dm/of_platdata.c                         | 65 ++++++++++++++++--
 test/dm/ofnode.c                              | 15 ++++
 tools/dtoc/dtb_platdata.py                    |  1 +
 135 files changed, 783 insertions(+), 477 deletions(-)
 create mode 100644 arch/sandbox/include/asm/irq.h
 create mode 100644 drivers/gpio/sandbox_test.c
 create mode 100644 drivers/misc/irq_sandbox_test.c

-- 
2.32.0.605.g8dce9f2422-goog



More information about the U-Boot mailing list