All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 0/9] dm: Prepare for supporting a live device tree
@ 2017-05-01 15:18 Simon Glass
  2017-05-01 15:18 ` [U-Boot] [PATCH v2 1/9] dm: Use dm.h header when driver mode is used Simon Glass
                   ` (8 more replies)
  0 siblings, 9 replies; 35+ messages in thread
From: Simon Glass @ 2017-05-01 15:18 UTC (permalink / raw)
  To: u-boot


The original livetree series [1] proved out the concept of a live device
tree in U-Boot. This involved converting the existing flat tree into a
node-based data structure immediately after relocation, and adjusting
some existing drivers to continue to work.

Several points came out of that work:

1. We need to avoid increasing code size for boards which continue to use
the flat device tree

2. Code-size increase for the live tree should be minimal, ideally only a
small one-off cost rather than a per-driver increment

3. Drivers should be written to support either type of tree, and both

4. We need a new API to read from the device tree from drivers (ie. using
dev_read...(struct udevice *) instead of fdtdec_get_...(blob, offset, ...)
so that they don't need to worry about which type of tree is used.

This series defines a new means of referring to a device tree node, and
updates U-Boot to use it. It does not include any support for live tree.

Following on from this will come conversion of sandbox to support live
tree, including getting all tests to pass

After that will be conversion of a representative board to support live
tree, as a way of evaluating code-size impact.

Ideally I would like to get all of the above sent out for review and
applied for the next release, but this depends on timing and feedback.

Finally, some documentation will be added and all existing drivers
converted to the new dev_read...() API, assuming this is practical.

[1] http://u-boot.10912.n7.nabble.com/PATCH-00-22-dm-Add-support-for-a-live-device-tree-td279035.html

Changes in v2:
- Cut the series down to only prepare the way for live tree
- Drop all live tree changes
- Adjust storage to avoid a code size increase

Simon Glass (9):
  dm: Use dm.h header when driver mode is used
  dm: core: Move dev_get_addr() etc. into a separate file
  dm: Rename dev_addr..() functions
  atmel: Fix up use of  dm_scan_fdt_node()
  Fix up inclusion of common.h
  dm: core: Dont export dm_scan_fdt_node()
  dm: core: Replace of_offset with accessor (part 2)
  dm: core: Add ofnode to represent device tree nodes
  dm: core: Adjust device_bind_common() to take an ofnode

 arch/arm/lib/bootm.c                               |   2 +-
 arch/arm/mach-mvebu/sata.c                         |   2 +-
 arch/arm/mach-rockchip/rk3188/sdram_rk3188.c       |   2 +-
 arch/arm/mach-rockchip/rk3328/clk_rk3328.c         |   2 +-
 arch/arm/mach-rockchip/rk3399/sdram_rk3399.c       |   2 +-
 arch/arm/mach-snapdragon/clock-apq8016.c           |   2 +-
 arch/arm/mach-uniphier/pinctrl-glue.c              |   4 +-
 arch/sandbox/cpu/cpu.c                             |   1 +
 board/amlogic/odroid-c2/odroid-c2.c                |   2 +-
 board/armltd/integrator/integrator.c               |   2 +-
 board/armltd/vexpress64/vexpress64.c               |   2 +-
 board/beckhoff/mx53cx9020/mx53cx9020.c             |   2 +-
 board/cadence/xtfpga/xtfpga.c                      |   2 +-
 board/cavium/thunderx/thunderx.c                   |   2 +-
 board/freescale/common/fsl_chain_of_trust.c        |   1 +
 board/freescale/common/fsl_validate.c              |   2 +-
 board/st/stm32f429-discovery/stm32f429-discovery.c |   2 +-
 board/st/stm32f746-disco/stm32f746-disco.c         |   2 +-
 board/st/stv0991/stv0991.c                         |   2 +-
 board/toradex/apalis_imx6/apalis_imx6.c            |   1 +
 board/toradex/colibri_imx6/colibri_imx6.c          |   1 +
 board/toradex/colibri_pxa270/colibri_pxa270.c      |   1 +
 cmd/bootefi.c                                      |   2 +-
 common/env_sf.c                                    |   1 +
 configs/mx7ulp_evk_defconfig                       |   1 +
 drivers/adc/exynos-adc.c                           |   2 +-
 drivers/block/dwc_ahci.c                           |  10 +-
 drivers/block/sata_ceva.c                          |   2 +-
 drivers/clk/aspeed/clk_ast2500.c                   |   2 +-
 drivers/clk/at91/clk-generated.c                   |   2 +-
 drivers/clk/at91/clk-h32mx.c                       |   2 +-
 drivers/clk/at91/clk-main.c                        |   2 +-
 drivers/clk/at91/clk-master.c                      |   2 +-
 drivers/clk/at91/clk-peripheral.c                  |   2 +-
 drivers/clk/at91/clk-plla.c                        |   2 +-
 drivers/clk/at91/clk-slow.c                        |   2 +-
 drivers/clk/at91/clk-system.c                      |   2 +-
 drivers/clk/at91/clk-utmi.c                        |   2 +-
 drivers/clk/at91/pmc.c                             |   7 +-
 drivers/clk/at91/sckc.c                            |   3 +-
 drivers/clk/clk_fixed_rate.c                       |   2 +-
 drivers/clk/clk_zynq.c                             |   2 +-
 drivers/clk/clk_zynqmp.c                           |   2 +-
 drivers/clk/exynos/clk-exynos7420.c                |   4 +-
 drivers/clk/rockchip/clk_rk3036.c                  |   2 +-
 drivers/clk/rockchip/clk_rk3188.c                  |   2 +-
 drivers/clk/rockchip/clk_rk3288.c                  |   2 +-
 drivers/clk/rockchip/clk_rk3328.c                  |   2 +-
 drivers/clk/rockchip/clk_rk3399.c                  |   4 +-
 drivers/clk/uniphier/clk-uniphier-core.c           |   4 +-
 drivers/core/Makefile                              |   2 +-
 drivers/core/device.c                              | 143 ++-------------------
 drivers/core/fdtaddr.c                             | 143 +++++++++++++++++++++
 drivers/core/regmap.c                              |   5 +-
 drivers/core/root.c                                |  19 ++-
 drivers/dma/ti-edma3.c                             |   4 +-
 drivers/firmware/firmware-uclass.c                 |   3 +-
 drivers/firmware/psci.c                            |   6 +-
 drivers/gpio/altera_pio.c                          |   2 +-
 drivers/gpio/at91_gpio.c                           |   2 +-
 drivers/gpio/atmel_pio4.c                          |   5 +-
 drivers/gpio/bcm2835_gpio.c                        |   2 +-
 drivers/gpio/gpio-uniphier.c                       |   4 +-
 drivers/gpio/imx_rgpio2p.c                         |   2 +-
 drivers/gpio/lpc32xx_gpio.c                        |   1 +
 drivers/gpio/msm_gpio.c                            |   2 +-
 drivers/gpio/mvebu_gpio.c                          |   2 +-
 drivers/gpio/mxc_gpio.c                            |   2 +-
 drivers/gpio/omap_gpio.c                           |   2 +-
 drivers/gpio/pm8916_gpio.c                         |   4 +-
 drivers/gpio/rk_gpio.c                             |   2 +-
 drivers/gpio/s5p_gpio.c                            |   4 +-
 drivers/gpio/sunxi_gpio.c                          |   2 +-
 drivers/gpio/tegra186_gpio.c                       |   2 +-
 drivers/gpio/tegra_gpio.c                          |   2 +-
 drivers/gpio/vybrid_gpio.c                         |   2 +-
 drivers/gpio/zynq_gpio.c                           |   2 +-
 drivers/i2c/Kconfig                                |   1 -
 drivers/i2c/at91_i2c.c                             |   2 +-
 drivers/i2c/designware_i2c.c                       |   2 +-
 drivers/i2c/exynos_hs_i2c.c                        |   2 +-
 drivers/i2c/i2c-cdns.c                             |   4 +-
 drivers/i2c/i2c-uniphier-f.c                       |   4 +-
 drivers/i2c/i2c-uniphier.c                         |   4 +-
 drivers/i2c/imx_lpi2c.c                            |  80 ++++++------
 drivers/i2c/mv_i2c.c                               |   2 +-
 drivers/i2c/mvtwsi.c                               |   2 +-
 drivers/i2c/mxc_i2c.c                              |   2 +-
 drivers/i2c/omap24xx_i2c.c                         |   2 +-
 drivers/i2c/rk_i2c.c                               |   2 +-
 drivers/i2c/s3c24x0_i2c.c                          |   2 +-
 drivers/i2c/tegra_i2c.c                            |   2 +-
 drivers/input/tegra-kbc.c                          |   2 +-
 drivers/mailbox/tegra-hsp.c                        |   2 +-
 drivers/misc/altera_sysid.c                        |   2 +-
 drivers/mmc/atmel_sdhci.c                          |   2 +-
 drivers/mmc/fsl_esdhc.c                            |   2 +-
 drivers/mmc/gen_atmel_mci.c                        |   4 +-
 drivers/mmc/meson_gx_mmc.c                         |   4 +-
 drivers/mmc/mmc-uclass.c                           |   2 +-
 drivers/mmc/msm_sdhci.c                            |   2 +-
 drivers/mmc/omap_hsmmc.c                           |   4 +-
 drivers/mmc/pic32_sdhci.c                          |   2 +-
 drivers/mmc/rockchip_dw_mmc.c                      |   2 +-
 drivers/mmc/rockchip_sdhci.c                       |   2 +-
 drivers/mmc/sdhci-cadence.c                        |   4 +-
 drivers/mmc/socfpga_dw_mmc.c                       |   2 +-
 drivers/mmc/sti_sdhci.c                            |   2 +-
 drivers/mmc/tangier_sdhci.c                        |   2 +-
 drivers/mmc/tegra_mmc.c                            |   4 +-
 drivers/mmc/uniphier-sd.c                          |   4 +-
 drivers/mmc/xenon_sdhci.c                          |   4 +-
 drivers/mmc/zynq_sdhci.c                           |   4 +-
 drivers/net/ag7xxx.c                               |   2 +-
 drivers/net/cpsw.c                                 |   2 +-
 drivers/net/designware.c                           |   2 +-
 drivers/net/dwc_eth_qos.c                          |   4 +-
 drivers/net/ethoc.c                                |   6 +-
 drivers/net/fec_mxc.c                              |   2 +-
 drivers/net/keystone_net.c                         |   2 +-
 drivers/net/macb.c                                 |   2 +-
 drivers/net/mvneta.c                               |   2 +-
 drivers/net/mvpp2.c                                |   8 +-
 drivers/net/phy/phy.c                              |   2 +-
 drivers/net/phy/ti.c                               |   2 +-
 drivers/net/sandbox-raw.c                          |   2 +-
 drivers/net/sandbox.c                              |   2 +-
 drivers/net/sun8i_emac.c                           |   8 +-
 drivers/net/sunxi_emac.c                           |   2 +-
 drivers/net/tsec.c                                 |   2 +-
 drivers/net/xilinx_axi_emac.c                      |   2 +-
 drivers/net/xilinx_emaclite.c                      |   2 +-
 drivers/net/zynq_gem.c                             |   2 +-
 drivers/pci/pcie_dw_mvebu.c                        |   4 +-
 drivers/phy/marvell/comphy_core.c                  |   4 +-
 drivers/phy/ti-pipe3-phy.c                         |   4 +-
 drivers/pinctrl/ath79/pinctrl_ar933x.c             |   2 +-
 drivers/pinctrl/ath79/pinctrl_qca953x.c            |   2 +-
 drivers/pinctrl/exynos/pinctrl-exynos.c            |   2 +-
 drivers/pinctrl/meson/pinctrl-meson-gxbb.c         |   3 +-
 drivers/pinctrl/meson/pinctrl-meson.c              |   2 +-
 drivers/pinctrl/mvebu/pinctrl-mvebu.c              |   2 +-
 drivers/pinctrl/nxp/pinctrl-imx.c                  |   2 +-
 drivers/pinctrl/nxp/pinctrl-imx5.c                 |   3 +-
 drivers/pinctrl/nxp/pinctrl-imx6.c                 |   3 +-
 drivers/pinctrl/nxp/pinctrl-imx7.c                 |   3 +-
 drivers/pinctrl/nxp/pinctrl-imx7ulp.c              |   3 +-
 drivers/pinctrl/pinctrl-at91-pio4.c                |   4 +-
 drivers/pinctrl/pinctrl-at91.c                     |   6 +-
 drivers/pinctrl/pinctrl-generic.c                  |   2 +-
 drivers/pinctrl/pinctrl-sandbox.c                  |   2 +-
 drivers/pinctrl/pinctrl-single.c                   |  13 +-
 drivers/pinctrl/pinctrl-uclass.c                   |   3 +-
 drivers/pinctrl/pinctrl_stm32.c                    |   2 +-
 drivers/pinctrl/rockchip/pinctrl_rk3188.c          |   4 +-
 drivers/pinctrl/rockchip/pinctrl_rk3328.c          |   2 +-
 drivers/pinctrl/uniphier/pinctrl-uniphier-core.c   |   4 +-
 drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c   |   3 +-
 drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c   |   3 +-
 drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c    |   3 +-
 drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c   |   3 +-
 drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c   |   3 +-
 drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c   |   3 +-
 drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c   |   3 +-
 drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c   |   3 +-
 drivers/pinctrl/uniphier/pinctrl-uniphier-sld3.c   |   3 +-
 drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c   |   3 +-
 drivers/power/pmic/pm8916.c                        |   2 +-
 drivers/pwm/exynos_pwm.c                           |   2 +-
 drivers/pwm/rk_pwm.c                               |   2 +-
 drivers/pwm/tegra_pwm.c                            |   2 +-
 drivers/reset/reset-uniphier.c                     |   4 +-
 drivers/serial/altera_jtag_uart.c                  |   2 +-
 drivers/serial/altera_uart.c                       |   2 +-
 drivers/serial/atmel_usart.c                       |   2 +-
 drivers/serial/ns16550.c                           |   2 +-
 drivers/serial/serial_ar933x.c                     |   2 +-
 drivers/serial/serial_arc.c                        |   2 +-
 drivers/serial/serial_bcm283x_mu.c                 |   2 +-
 drivers/serial/serial_lpuart.c                     |   4 +-
 drivers/serial/serial_meson.c                      |   2 +-
 drivers/serial/serial_msm.c                        |   2 +-
 drivers/serial/serial_mvebu_a3700.c                |   2 +-
 drivers/serial/serial_mxc.c                        |   2 +-
 drivers/serial/serial_pl01x.c                      |   2 +-
 drivers/serial/serial_s5p.c                        |   2 +-
 drivers/serial/serial_sti_asc.c                    |   2 +-
 drivers/serial/serial_stm32x7.c                    |   2 +-
 drivers/serial/serial_uniphier.c                   |   5 +-
 drivers/serial/serial_xuartlite.c                  |   2 +-
 drivers/serial/serial_zynq.c                       |   2 +-
 drivers/spi/altera_spi.c                           |   2 +-
 drivers/spi/ath79_spi.c                            |   2 +-
 drivers/spi/atmel_spi.c                            |   2 +-
 drivers/spi/davinci_spi.c                          |   2 +-
 drivers/spi/designware_spi.c                       |   2 +-
 drivers/spi/exynos_spi.c                           |   2 +-
 drivers/spi/fsl_dspi.c                             |   4 +-
 drivers/spi/kirkwood_spi.c                         |   2 +-
 drivers/spi/mvebu_a3700_spi.c                      |   2 +-
 drivers/spi/omap3_spi.c                            |   2 +-
 drivers/spi/rk_spi.c                               |   2 +-
 drivers/spi/tegra114_spi.c                         |   2 +-
 drivers/spi/tegra20_sflash.c                       |   2 +-
 drivers/spi/tegra20_slink.c                        |   2 +-
 drivers/spi/tegra210_qspi.c                        |   2 +-
 drivers/spi/ti_qspi.c                              |  12 +-
 drivers/spi/zynq_spi.c                             |   2 +-
 drivers/spmi/spmi-msm.c                            |   2 +-
 drivers/sysreset/sysreset_psci.c                   |   3 +-
 drivers/sysreset/sysreset_snapdragon.c             |   2 +-
 drivers/timer/altera_timer.c                       |   2 +-
 drivers/timer/arc_timer.c                          |   2 +-
 drivers/timer/ast_timer.c                          |   2 +-
 drivers/timer/omap-timer.c                         |   2 +-
 drivers/tpm/tpm_tis_lpc.c                          |   2 +-
 drivers/usb/host/dwc2.c                            |   2 +-
 drivers/usb/host/ehci-atmel.c                      |   2 +-
 drivers/usb/host/ehci-exynos.c                     |   2 +-
 drivers/usb/host/ehci-fsl.c                        |   2 +-
 drivers/usb/host/ehci-generic.c                    |   2 +-
 drivers/usb/host/ehci-marvell.c                    |   2 +-
 drivers/usb/host/ehci-msm.c                        |   2 +-
 drivers/usb/host/ehci-mx6.c                        |   4 +-
 drivers/usb/host/ehci-sunxi.c                      |   2 +-
 drivers/usb/host/ehci-tegra.c                      |   2 +-
 drivers/usb/host/ehci-vf.c                         |   2 +-
 drivers/usb/host/ehci-zynq.c                       |   2 +-
 drivers/usb/host/ohci-generic.c                    |   2 +-
 drivers/usb/host/ohci-sunxi.c                      |   2 +-
 drivers/usb/host/xhci-exynos5.c                    |   2 +-
 drivers/usb/host/xhci-fsl.c                        |   2 +-
 drivers/usb/host/xhci-mvebu.c                      |   2 +-
 drivers/usb/host/xhci-rockchip.c                   |   4 +-
 drivers/usb/musb-new/sunxi.c                       |   1 +
 drivers/usb/musb-new/ti-musb.c                     |   2 +-
 drivers/video/atmel_hlcdfb.c                       |   6 +-
 drivers/video/exynos/exynos_dp.c                   |   4 +-
 drivers/video/exynos/exynos_fb.c                   |   2 +-
 drivers/video/rockchip/rk_edp.c                    |   2 +-
 drivers/video/rockchip/rk_hdmi.c                   |   2 +-
 drivers/video/rockchip/rk_lvds.c                   |   2 +-
 drivers/video/rockchip/rk_vop.c                    |   2 +-
 drivers/video/tegra.c                              |   2 +-
 drivers/video/tegra124/dp.c                        |   2 +-
 include/dm.h                                       |   2 +
 include/dm/device.h                                | 106 ++-------------
 include/dm/fdtaddr.h                               | 110 ++++++++++++++++
 include/dm/ofnode.h                                | 100 ++++++++++++++
 include/dm/root.h                                  |  16 ---
 250 files changed, 757 insertions(+), 588 deletions(-)
 create mode 100644 drivers/core/fdtaddr.c
 create mode 100644 include/dm/fdtaddr.h
 create mode 100644 include/dm/ofnode.h

-- 
2.13.0.rc0.306.g87b477812d-goog

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2017-05-20 16:50 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-01 15:18 [U-Boot] [PATCH v2 0/9] dm: Prepare for supporting a live device tree Simon Glass
2017-05-01 15:18 ` [U-Boot] [PATCH v2 1/9] dm: Use dm.h header when driver mode is used Simon Glass
2017-05-10 21:43   ` Tom Rini
2017-05-11  2:12     ` Masahiro Yamada
2017-05-13  1:11       ` Simon Glass
2017-05-16  9:56         ` Masahiro Yamada
2017-05-17 10:07           ` Simon Glass
2017-05-01 15:18 ` [U-Boot] [PATCH v2 2/9] dm: core: Move dev_get_addr() etc. into a separate file Simon Glass
2017-05-10 21:43   ` Tom Rini
2017-05-16 10:04   ` Masahiro Yamada
2017-05-17 10:09     ` Simon Glass
2017-05-01 15:18 ` [U-Boot] [PATCH v2 3/9] dm: Rename dev_addr..() functions Simon Glass
2017-05-10 21:43   ` Tom Rini
2017-05-01 15:18 ` [U-Boot] [PATCH v2 4/9] atmel: Fix up use of dm_scan_fdt_node() Simon Glass
2017-05-10 21:43   ` Tom Rini
2017-05-01 15:18 ` [U-Boot] [PATCH v2 5/9] Fix up inclusion of common.h Simon Glass
2017-05-10 21:43   ` Tom Rini
2017-05-11  2:21     ` Masahiro Yamada
2017-05-13  1:11       ` Simon Glass
2017-05-16 10:32         ` Masahiro Yamada
2017-05-17 10:09           ` Simon Glass
2017-05-20 16:50             ` Masahiro Yamada
2017-05-01 15:18 ` [U-Boot] [PATCH v2 6/9] dm: core: Dont export dm_scan_fdt_node() Simon Glass
2017-05-10 21:43   ` Tom Rini
2017-05-01 15:18 ` [U-Boot] [PATCH v2 7/9] dm: core: Replace of_offset with accessor (part 2) Simon Glass
2017-05-10 21:43   ` Tom Rini
2017-05-01 15:18 ` [U-Boot] [PATCH v2 8/9] dm: core: Add ofnode to represent device tree nodes Simon Glass
2017-05-10 21:43   ` Tom Rini
2017-05-11  2:33   ` Masahiro Yamada
2017-05-13  1:11     ` Simon Glass
2017-05-16 10:35   ` Masahiro Yamada
2017-05-20  2:29     ` Simon Glass
2017-05-20 16:17       ` Masahiro Yamada
2017-05-01 15:18 ` [U-Boot] [PATCH v2 9/9] dm: core: Adjust device_bind_common() to take an ofnode Simon Glass
2017-05-10 21:43   ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.