lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 24 Nov 2014 21:10:08 +0100
From:	Geert Uytterhoeven <geert+renesas@...der.be>
To:	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Ulrich Hecht <ulrich.hecht+renesas@...il.com>,
	Simon Horman <horms@...ge.net.au>,
	Magnus Damm <magnus.damm@...il.com>
Cc:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Grant Likely <grant.likely@...aro.org>,
	Arnd Bergmann <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-pm@...r.kernel.org, devicetree@...r.kernel.org,
	linux-sh@...r.kernel.org, linux-kernel@...r.kernel.org,
	Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH/RFC 3/3] drivers: bus: Add Renesas Bus State Controller Driver

Add a driver for the Renesas Bus State Controller (BSC, sometimes called
"LBSC within Bus Bridge", or "External Bus Interface") found on several
Renesas ARM SoCs.

The sole purpose of this driver is to enable its clock and PM domain (if
exist(s)), which are specified in the DT and managed from platform and
PM domain code.  The BSC clock and PM domain must be enabled for
external devices connected to the BSC (e.g. NOR FLASH or Ethernet) to
work.

Due to the child-parent relationship with devices connected to the BSC,
PM domain and clock state transitions are handled in the correct order.

Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
---
  - Is there a simpler way to do this?
  - As none of this code is really hardware-specific, should the driver
    be renamed to simple-bus, and match against "simple-bus"?
  - Should this be moved to core code, without an explicit driver for
    "simple-bus"?
Please reply to the cover letter!

Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
---
 drivers/bus/Kconfig       |  8 ++++++++
 drivers/bus/Makefile      |  1 +
 drivers/bus/renesas-bsc.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 60 insertions(+)
 create mode 100644 drivers/bus/renesas-bsc.c

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 7697fc8903f62d07..7e901480ba67dcad 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -58,6 +58,14 @@ config OMAP_OCP2SCP
 	  OCP2SCP and in OMAP5, both USB PHY and SATA PHY is connected via
 	  OCP2SCP.
 
+config RENESAS_BSC
+	bool "Renesas Bus State Controller"
+	depends on ARCH_SHMOBILE && OF
+	help
+	  Driver for the Renesas Bus State Controller (BSC, sometimes called
+	  "LBSC within Bus Bridge", or "External Bus Interface") found on
+	  several Renesas ARM SoCs.
+
 config VEXPRESS_CONFIG
 	bool "Versatile Express configuration bus"
 	default y if ARCH_VEXPRESS
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index 2eb1f668c7fbc00d..b1ac67cfa9d5663c 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -14,4 +14,5 @@ obj-$(CONFIG_MVEBU_MBUS) += mvebu-mbus.o
 obj-$(CONFIG_OMAP_INTERCONNECT)	+= omap_l3_smx.o omap_l3_noc.o
 
 obj-$(CONFIG_OMAP_OCP2SCP)	+= omap-ocp2scp.o
+obj-$(CONFIG_RENESAS_BSC)	+= renesas-bsc.o
 obj-$(CONFIG_VEXPRESS_CONFIG)	+= vexpress-config.o
diff --git a/drivers/bus/renesas-bsc.c b/drivers/bus/renesas-bsc.c
new file mode 100644
index 0000000000000000..ca35aae266d3365a
--- /dev/null
+++ b/drivers/bus/renesas-bsc.c
@@ -0,0 +1,51 @@
+/*
+ * Renesas Bus State Controller Driver
+ *
+ * Copyright (C) 2014 Glider bvba
+ *
+ * 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.
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
+
+
+static int renesas_bsc_probe(struct platform_device *pdev)
+{
+	dev_dbg(&pdev->dev, "%s\n", __func__);
+
+	pm_runtime_enable(&pdev->dev);
+	return 0;
+}
+
+static int renesas_bsc_remove(struct platform_device *pdev)
+{
+	dev_dbg(&pdev->dev, "%s\n", __func__);
+
+	pm_runtime_disable(&pdev->dev);
+	return 0;
+}
+
+static const struct of_device_id renesas_bsc_of_match[] = {
+	{ .compatible = "renesas,bsc", },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, renesas_bsc_of_match);
+
+static struct platform_driver renesas_bsc_driver = {
+	.probe = renesas_bsc_probe,
+	.remove = renesas_bsc_remove,
+	.driver = {
+		.name = "renesas-bsc",
+		.of_match_table = renesas_bsc_of_match,
+	},
+};
+
+module_platform_driver(renesas_bsc_driver);
+
+MODULE_DESCRIPTION("Renesas Bus State Controller Driver");
+MODULE_AUTHOR("Geert Uytterhoeven <geert@...ux-m68k.org>");
+MODULE_LICENSE("GPL");
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ