Received: by 10.192.165.148 with SMTP id m20csp4921015imm; Tue, 24 Apr 2018 10:33:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp+W9fKBaLjmmB1wi/wO+Lnh9A2vVibHaHFgTVSfj1c6nKYtf5Iz9kezLAI46qLg5a0PFac X-Received: by 2002:a17:902:76c1:: with SMTP id j1-v6mr774438plt.284.1524591180648; Tue, 24 Apr 2018 10:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524591180; cv=none; d=google.com; s=arc-20160816; b=A5PlBF6ddtk1scH9OOV0FOzKKTuK2ILnuX3FnksyDALCbbYVoZmO3TpPU/tocYA4H2 sIIUGUSCgpiIIjSjCHXl+ue6mTNf4Zq9BNvChOoPAsVoHjz156dDY1ezlSQx0YRUezz0 R4kADkp4vFQj8IoEW2EeTq8vc0C8yDdFIFKaXPkeaRcxe+Ov4IQlF+JpABGy44yk9qPe 0diUir+/lxpYr3gbprKeViyuZR2vSa++/AGcxd+hLI9+w5sUsDk6eydUi/CH4hthQ6Ag SoYrnMo0qknKwNg+SMExJPfbYSvLszgA1fpwulnlCbm/mHQceGgo2ym1zDMwNnLAO1iJ tiSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=IFrQEk4nDjzvgcrPTH5iMFpItGQmQCsWREhwNBnKrRs=; b=ofiMrE9aizwl2shGChuv+dueb0SAea4Drf3pN6kXXCIdstYoLfVxxeIBJwlvc4xu7x JoL4N9nx613coCtuke+Q1KUQvkZJEhjRwe0TsJh3LLxdS3jpCBjBFuJZR0/DxLylkEWM RAyxsMMrsqfNG1y3k+vayqs2S/O8N2y6AWvwIwJ3vpu2jcpTmXCAfQ8mQVQtAo5XT7ln y7eCndmqFhrMSiepcwyA6Lq1qCaO8V87N76D7cWfYHLg1+vi2WBTQrFdmQbqweXcjlcZ Qn/qArUNkaJnYgC1Hj9sf1+j/L34WHftwPhmJvCiak3Wk150AGHIrXFYPIiZiKTXqvif NI5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=XIEUzhx1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7si11085578pgv.251.2018.04.24.10.32.45; Tue, 24 Apr 2018 10:33:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=XIEUzhx1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752273AbeDXRbP (ORCPT + 99 others); Tue, 24 Apr 2018 13:31:15 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:54623 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751561AbeDXRbM (ORCPT ); Tue, 24 Apr 2018 13:31:12 -0400 Received: by mail-wm0-f67.google.com with SMTP id f6so2591877wmc.4 for ; Tue, 24 Apr 2018 10:31:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=IFrQEk4nDjzvgcrPTH5iMFpItGQmQCsWREhwNBnKrRs=; b=XIEUzhx1CBM+5bvo0oz4/gZZRApG+P/hHIDQMXmzOoyoFEYjnoAJSl4otqLwnti5M3 0L+YZbs2GHWt3JmyeLA3qDgDRnZNvh8hgHR6EzligrDcER1DxpeTIwvxs9TwH3ExGecl iuGkZ+Ii0K3MqAPvmJg9kWzyPFJDWIT27E7zkyFF8ltRGfMl8xoNS82GweaP4xAS++yO tR7IcF0ndC3K4YD1xK9Lu4hX5J5I5OiZzoF8OkVncQ/fN3Mh6FbSgrwMt6RYS/rgL/EF 2iPIA5DEXhspFfmCFOxN3vGKaMwcLqTvC45t3NYjaa/AKKlZqOX8+LaVuyI682/wETJG 2B4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IFrQEk4nDjzvgcrPTH5iMFpItGQmQCsWREhwNBnKrRs=; b=qQMkhOw/7/tg3M7peJbfvW4LVfcsjP5aBJ7wLIYnp/otT3eCOAvyEcWJpfDFm0mvR1 itcwP7ry8dTwYVILf7tb1FUsX4EWrDLZBQNT3P7KZUsdt2pjAaG8Eo8oHR0vLVBD2Tr4 RahQnQyiU6Jul6D6qaiSd1LTRXdVn7vnAaWFQnVJ8kjQtq/K1Wv25OXuoWVIWjJ65oVd 7awcAP1QMKov+RMJrV7x6xxbFVFkj3DPkBjm922YkNHixN8hlc2PomTK0ZxHitGX40Uv 9wjp+ByOZsj23DX6ohWj/0voE22ch2Q53m4y/Ujt3Wr78erP+GYaDVCbpQnSEJs4kFu6 1Sig== X-Gm-Message-State: ALQs6tA2pl9JZ+GIDNhUzrsEdl2bnhIs+NJ7g1Ef0IIXiSo1UhXE/6lY gZEiEP8ZQ5YiZfSddDWd9Brbyg== X-Received: by 10.28.247.9 with SMTP id v9mr13538519wmh.67.1524591070681; Tue, 24 Apr 2018 10:31:10 -0700 (PDT) Received: from brgl-bgdev.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id n21sm15513826wmi.37.2018.04.24.10.31.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 10:31:09 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , David Lechner , Michael Turquette , Stephen Boyd , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Yoshinori Sato , Rich Felker , Frank Rowand , "Rafael J . Wysocki" , Jarkko Sakkinen , Dmitry Torokhov , Arend van Spriel , Heikki Krogerus , Michal Suchanek , Jan Kiszka , Andy Shevchenko Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 00/11] platform: device tree support for early platform drivers Date: Tue, 24 Apr 2018 19:30:40 +0200 Message-Id: <20180424173051.15099-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski 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 -- 2.17.0