mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Teresa Remmet <t.remmet@phytec.de>
To: barebox@lists.infradead.org
Subject: [PATCH v2 1/7] drivers: bus: Add ti-sysc bus driver
Date: Wed, 13 Feb 2019 09:34:22 +0100	[thread overview]
Message-ID: <1550046868-19264-1-git-send-email-t.remmet@phytec.de> (raw)

Adds minimal support for the sysc interconnect target module found
on many TI SoCs. With this device tree includes have been rearagned.
We need the driver to probe the child devices of the bus.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
---
Changes in v2:
- set driver in Kconfig to default y
- Use postcore_platform_driver() call
- Use global of_default_bus_match_table() instead of local table

 drivers/bus/Kconfig   |  8 ++++++++
 drivers/bus/Makefile  |  1 +
 drivers/bus/ti-sysc.c | 37 +++++++++++++++++++++++++++++++++++++
 3 files changed, 46 insertions(+)
 create mode 100644 drivers/bus/ti-sysc.c

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 202df59762e8..219982d878a8 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -6,6 +6,14 @@ config BUS_OMAP_GPMC
 	depends on OMAP_GPMC
 	bool "TI OMAP/AM33xx GPMC support"
 
+config TI_SYSC
+	depends on ARCH_OMAP
+	bool "TI sysc interconnect target module driver"
+	default y
+	help
+	  Generic driver for Texas Instruments interconnect target module
+	  found on many TI SoCs.
+
 config IMX_WEIM
 	depends on ARCH_IMX
 	bool "i.MX WEIM driver"
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index 4b7aa888aba8..ba5cee40636b 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -1,3 +1,4 @@
 obj-$(CONFIG_BUS_OMAP_GPMC)	+= omap-gpmc.o
 obj-$(CONFIG_IMX_WEIM)		+= imx-weim.o
 obj-$(CONFIG_MVEBU_MBUS)	+= mvebu-mbus.o
+obj-$(CONFIG_TI_SYSC)		+= ti-sysc.o
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
new file mode 100644
index 000000000000..af52d839bdd5
--- /dev/null
+++ b/drivers/bus/ti-sysc.c
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Phytec Messtechnik GmbH, Teresa Remmet <t.remmet@phytec.de>
+ */
+
+#include <common.h>
+#include <init.h>
+#include <of.h>
+#include <linux/err.h>
+
+static int ti_sysc_probe(struct device_d *dev)
+{
+	int ret;
+
+	ret = of_platform_populate(dev->device_node,
+					of_default_bus_match_table, dev);
+	if (ret)
+		dev_err(dev, "%s fail to create devices.\n",
+					dev->device_node->full_name);
+	return ret;
+};
+
+static struct of_device_id ti_sysc_dt_ids[] = {
+	{ .compatible = "ti,sysc-omap4",},
+	{ .compatible = "ti,sysc-omap4-simple",},
+	{ .compatible = "ti,sysc-omap4-timer",},
+	{ .compatible = "ti,sysc-omap2",},
+	{ },
+};
+
+static struct driver_d ti_sysc_driver = {
+	.name = "ti-sysc",
+	.probe = ti_sysc_probe,
+	.of_compatible = DRV_OF_COMPAT(ti_sysc_dt_ids),
+};
+
+postcore_platform_driver(ti_sysc_driver);
-- 
2.7.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2019-02-13  8:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13  8:34 Teresa Remmet [this message]
2019-02-13  8:34 ` [PATCH v2 2/7] arm: configs: omap_defconfig: Enable " Teresa Remmet
2019-02-13  8:34 ` [PATCH v2 3/7] arm: configs: am33xx_mlo_defconfig: " Teresa Remmet
2019-02-13  8:34 ` [PATCH v2 4/7] drivers: of: Add function to enable and register a device by alias Teresa Remmet
2019-02-13  8:34 ` [PATCH v2 5/7] arm: mach-omap: am335x_generic: Enable nodes by alias where needed Teresa Remmet
2019-02-13  8:34 ` [PATCH v2 6/7] net: ethernet: cpsw: cpsw-phy-sel: Use phandle for phy sel Teresa Remmet
2019-02-13  8:34 ` [PATCH v2 7/7] arm: dts: am335x-phytec: Use phy-handle instead of phy_id Teresa Remmet
2019-02-13 19:30 ` [PATCH v2 1/7] drivers: bus: Add ti-sysc bus driver Sascha Hauer

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=1550046868-19264-1-git-send-email-t.remmet@phytec.de \
    --to=t.remmet@phytec.de \
    --cc=barebox@lists.infradead.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