diff mbox series

[RFC,3/4] bus: ti-sysc: Add support for PRU-ICSS type

Message ID 20190402133752.6912-4-rogerq@ti.com
State New
Headers show
Series bus: ti-sysc: Add generic enable/disable & PRUSS | expand

Commit Message

Roger Quadros April 2, 2019, 1:37 p.m. UTC
The PRU-ICSS moduels has a SYSCONFIG register that is
similar to omap4-simple but with 2 speacial register bits.

Let's add a new type for that so we can deal with any
PRU-ICSS specific details if required.

Signed-off-by: Roger Quadros <rogerq@ti.com>

---
 .../devicetree/bindings/bus/ti-sysc.txt       |  1 +
 drivers/bus/ti-sysc.c                         | 21 +++++++++++++++++++
 include/linux/platform_data/ti-sysc.h         |  7 ++++++-
 3 files changed, 28 insertions(+), 1 deletion(-)

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/bus/ti-sysc.txt b/Documentation/devicetree/bindings/bus/ti-sysc.txt
index f200f45572ae..f9716c841ecd 100644
--- a/Documentation/devicetree/bindings/bus/ti-sysc.txt
+++ b/Documentation/devicetree/bindings/bus/ti-sysc.txt
@@ -38,6 +38,7 @@  Required standard properties:
 		"ti,sysc-dra7-mcasp"
 		"ti,sysc-usb-host-fs"
 		"ti,sysc-dra7-mcan"
+		"ti,sysc-pruss"
 
 - reg		shall have register areas implemented for the interconnect
 		target module in question such as revision, sysc and syss
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 1e63b6265764..e4ab4d422ea5 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -1993,6 +1993,26 @@  static const struct sysc_capabilities sysc_dra7_mcan = {
 	.regbits = &sysc_regbits_dra7_mcan,
 };
 
+/*
+ * PRU-ICSS, similar to omap4-simple but has special bits
+ */
+static const struct sysc_regbits sysc_regbits_pruss = {
+	.dmadisable_shift = -ENODEV,
+	.midle_shift = 2,
+	.sidle_shift = 0,
+	.clkact_shift = -ENODEV,
+	.enwkup_shift = -ENODEV,
+	.srst_shift = -ENODEV,
+	.emufree_shift = -ENODEV,
+	.autoidle_shift = -ENODEV,
+	.standby_init_shift = 4,
+	.sub_mwait_shift = 5,
+};
+
+static const struct sysc_capabilities sysc_pruss = {
+	.type = TI_SYSC_PRUSS,
+	.regbits = &sysc_regbits_pruss,
+};
 static int sysc_init_pdata(struct sysc *ddata)
 {
 	struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev);
@@ -2186,6 +2206,7 @@  static const struct of_device_id sysc_match[] = {
 	{ .compatible = "ti,sysc-usb-host-fs",
 	  .data = &sysc_omap4_usb_host_fs, },
 	{ .compatible = "ti,sysc-dra7-mcan", .data = &sysc_dra7_mcan, },
+	{ .compatible = "ti,sysc-pruss", .data = &sysc_pruss, },
 	{  },
 };
 MODULE_DEVICE_TABLE(of, sysc_match);
diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h
index 9256c0305968..bb95ae7da56c 100644
--- a/include/linux/platform_data/ti-sysc.h
+++ b/include/linux/platform_data/ti-sysc.h
@@ -15,6 +15,7 @@  enum ti_sysc_module_type {
 	TI_SYSC_OMAP4_MCASP,
 	TI_SYSC_OMAP4_USB_HOST_FS,
 	TI_SYSC_DRA7_MCAN,
+	TI_SYSC_PRUSS,
 };
 
 struct ti_sysc_cookie {
@@ -30,7 +31,9 @@  struct ti_sysc_cookie {
  * @srst_shift: Offset of the softreset bit
  * @autoidle_shift: Offset of the autoidle bit
  * @dmadisable_shift: Offset of the dmadisable bit
- * @emufree_shift; Offset of the emufree bit
+ * @emufree_shift: Offset of the emufree bit
+ * @standby_init_shift: Offset to standby_init bit
+ * @sub_mwait_shift: Offset to sub_mwait bit
  *
  * Note that 0 is a valid shift, and for ti-sysc.c -ENODEV can be used if a
  * feature is not available.
@@ -44,6 +47,8 @@  struct sysc_regbits {
 	s8 autoidle_shift;
 	s8 dmadisable_shift;
 	s8 emufree_shift;
+	s8 standby_init_shift;
+	s8 sub_mwait_shift;
 };
 
 #define SYSC_QUIRK_SWSUP_MSTANDBY	BIT(13)