From: Sudeep Holla <sudeep.holla@arm.com>
To: linux-kernel@vger.kernel.org
Cc: Sudeep Holla <sudeep.holla@arm.com>,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
Rob Herring <robh@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Andy Gross <andy.gross@linaro.org>,
Jens Wiklander <jens.wiklander@linaro.org>
Subject: [PATCH 1/3] firmware: of: populate /firmware/ node during init
Date: Fri, 11 Aug 2017 14:30:35 +0100 [thread overview]
Message-ID: <1502458237-1683-2-git-send-email-sudeep.holla@arm.com> (raw)
In-Reply-To: <1502458237-1683-1-git-send-email-sudeep.holla@arm.com>
Since "/firmware" does not have its own "compatible" property as it's
just collection of nodes representing firmware interface, it's sub-nodes
are not populated during system initialization.
Currently different firmware drivers search the /firmware/ node and
populate the sub-node devices selectively. Instead we can populate
the /firmware/ node during init to avoid more drivers continuing to
populate the devices selectively.
This patch adds initcall to achieve the same.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
drivers/firmware/Makefile | 1 +
drivers/firmware/of.c | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+)
create mode 100644 drivers/firmware/of.c
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 91d3ff62c653..d9a6fce43613 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -17,6 +17,7 @@ obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o
obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o
obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o
obj-$(CONFIG_FW_CFG_SYSFS) += qemu_fw_cfg.o
+obj-$(CONFIG_OF) += of.o
obj-$(CONFIG_QCOM_SCM) += qcom_scm.o
obj-$(CONFIG_QCOM_SCM_64) += qcom_scm-64.o
obj-$(CONFIG_QCOM_SCM_32) += qcom_scm-32.o
diff --git a/drivers/firmware/of.c b/drivers/firmware/of.c
new file mode 100644
index 000000000000..149b9660fb44
--- /dev/null
+++ b/drivers/firmware/of.c
@@ -0,0 +1,34 @@
+/*
+ * Populates the nodes under /firmware/ device tree node
+ *
+ * Copyright (C) 2017 ARM Ltd.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Released under the GPLv2 only.
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include <linux/init.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+
+static int __init firmware_of_init(void)
+{
+ struct device_node *fw_np;
+ int ret;
+
+ fw_np = of_find_node_by_name(NULL, "firmware");
+
+ if (!fw_np)
+ return 0;
+
+ ret = of_platform_populate(fw_np, NULL, NULL, NULL);
+
+ of_node_put(fw_np);
+
+ return ret;
+}
+arch_initcall_sync(firmware_of_init);
--
2.7.4
next prev parent reply other threads:[~2017-08-11 13:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-11 13:30 [PATCH 0/3] firmware: of: populate /firmware/ node during init Sudeep Holla
2017-08-11 13:30 ` Sudeep Holla [this message]
2017-08-11 14:15 ` [PATCH 1/3] " Rob Herring
2017-08-11 15:16 ` Sudeep Holla
[not found] ` <7a3b73d0-988c-1d2a-43cc-4d30b4eac0f1-5wv7dgnIgG8@public.gmane.org>
2017-08-11 15:22 ` Sudeep Holla
[not found] ` <1502458237-1683-2-git-send-email-sudeep.holla-5wv7dgnIgG8@public.gmane.org>
2017-08-11 14:37 ` Arnd Bergmann
2017-08-11 15:05 ` Rob Herring
[not found] ` <CABGGisyQKfre_qMqnngOiKbqUaHF0KWKtZyYPJ47iPwgL5t6xw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-11 15:54 ` Arnd Bergmann
2017-08-14 13:28 ` Sudeep Holla
2017-09-27 16:54 ` Sudeep Holla
[not found] ` <CAK8P3a1p8xS4u5EQ9auqgcmhXaybhDdsa6ah3G-7TeEf+ko9kA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-11 15:37 ` Sudeep Holla
2017-08-11 13:30 ` [PATCH 2/3] firmware: qcom_scm: drop redandant of_platform_populate Sudeep Holla
2017-08-11 13:30 ` [PATCH 3/3] drivers: tee: rework optee_driver_{init,exit} to use platform device Sudeep Holla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1502458237-1683-2-git-send-email-sudeep.holla@arm.com \
--to=sudeep.holla@arm.com \
--cc=andy.gross@linaro.org \
--cc=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=jens.wiklander@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).