Skip to content

platform: device tree support for early platform drivers

Bartosz Golaszewski linux-arm-kernel linux-devicetree lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11platform: early: provide early_platform_add_device()include/linux/platform_device.h+5 -00 replies
2/11platform: provide early_platform_driver_register_probe_all()include/linux/platform_device.h+9 -00 replies
3/11platform: make support for early platform devices conditionalarch/sh/Kconfig drivers/base/Kconfig drivers/base/platform.c +1 more+40 -02 replies
4/11of: platform: use pdev as name for vars of type struct platform_devicedrivers/of/platform.c+25 -250 replies
5/11platform: use a dedicated list_head for early devicesdrivers/base/platform.c include/linux/device.h+15 -120 replies
6/11of: provide for_each_compatible_child_node()include/linux/of.h+3 -00 replies
7/11dt-bindings: add bindings for early devicesDocumentation/devicetree/bindings/early.txt+7 -00 replies
8/11of: platform: provide of_early_platform_populate()drivers/of/device.c drivers/of/platform.c include/linux/of_device.h +1 more+110 -150 replies
9/11platform: provide early_platform_driver()include/linux/platform_device.h+6 -00 replies
10/11of: platform: provide of_early_platform_probe()drivers/of/platform.c include/linux/of_platform.h+14 -00 replies
11/11misc: implement a dummy early platform driverdrivers/misc/Kconfig drivers/misc/Makefile drivers/misc/dummy-early.c+49 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/11] platform: device tree support for early platform drivers

From: Bartosz Golaszewski <[email protected]>

Device tree based systems often use OF_DECLARE() macros for devices that need to be initialized early in the boot process such as clocks, timers etc. However platform devices are more desirable.

This series aims at introducing support for early platform drivers for OF-based systems.

The idea is to have a special compatible fallback string: "earlydev" that similarily to "syscon" would be added to device nodes that need early probing. We then need to call of_early_platform_populate() early in the boot process to actually probe the registered devices.

I am aware that this new compatible does not strictly correspond with the "hardware description only" rule of DT, but we already have many functionalities that break this rule: syscon, gpio hogs etc.

The first user of this new functionality will be the DaVinci platform for which we want to probe the pll, psc and timer drivers early in the boot sequence but keep them implemented as platform drivers.

In the future, if this series gets accepted, this could become and alternative to TIMER_OF_DECLARE, CLK_OF_DECLARE etc. and could lead to deprecating of those macros in favor of early platform drivers.

Bartosz Golaszewski (11):
platform: early: provide early_platform_add_device()
platform: provide early_platform_driver_register_probe_all()
platform: make support for early platform devices conditional
of: platform: use pdev as name for vars of type struct platform_device
platform: use a dedicated list_head for early devices
of: provide for_each_compatible_child_node()
dt-bindings: add bindings for early devices
of: platform: provide of_early_platform_populate()
platform: provide early_platform_driver()
of: platform: provide of_early_platform_probe()
misc: implement a dummy early platform driver

 Documentation/devicetree/bindings/early.txt |   7 +
 arch/sh/Kconfig                             |   1 +
 drivers/base/Kconfig                        |   4 +
 drivers/base/platform.c                     |  26 ++--
 drivers/misc/Kconfig                        |   8 ++
 drivers/misc/Makefile                       |   1 +
 drivers/misc/dummy-early.c                  |  40 ++++++
 drivers/of/device.c                         |  14 +-
 drivers/of/platform.c                       | 143 +++++++++++++++-----
 include/linux/device.h                      |   4 +
 include/linux/of.h                          |   3 +
 include/linux/of_device.h                   |   5 +
 include/linux/of_platform.h                 |  19 +++
 include/linux/platform_device.h             |  52 +++++++
 14 files changed, 279 insertions(+), 48 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/early.txt
 create mode 100644 drivers/misc/dummy-early.c
Signature · 1 line
2.17.0