bus: ti-sysc: Add support for using ti-sysc for MCAN on dra76x
authorFaiz Abbas <faiz_abbas@ti.com>
Mon, 9 Jul 2018 16:48:38 +0000 (22:18 +0530)
committerTony Lindgren <tony@atomide.com>
Tue, 10 Jul 2018 05:31:27 +0000 (22:31 -0700)
The dra76x MCAN generic interconnect module has a its own
format for the bits in the control registers.

Therefore add a new module type, new regbits and new capabilities
specific to the MCAN module.

Acked-by: Rob Herring <robh@kernel.org>
CC: Tony Lindgren <tony@atomide.com>
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Documentation/devicetree/bindings/bus/ti-sysc.txt
drivers/bus/ti-sysc.c
include/dt-bindings/bus/ti-sysc.h
include/linux/platform_data/ti-sysc.h

index d8ed5b780ed9d31dec1ee7b59aa6758abde4b41d..91dc2333af012771e915981ed5df8bb8800d8d5b 100644 (file)
@@ -36,6 +36,7 @@ Required standard properties:
                "ti,sysc-omap-aes"
                "ti,sysc-mcasp"
                "ti,sysc-usb-host-fs"
+               "ti,sysc-dra7-mcan"
 
 - reg          shall have register areas implemented for the interconnect
                target module in question such as revision, sysc and syss
index 80d60f43db56123076fed5ea2047da35af88af8f..c9db5369e2ec07794bd0aa55e81e3a3dc982f979 100644 (file)
@@ -1552,6 +1552,23 @@ static const struct sysc_capabilities sysc_omap4_usb_host_fs = {
        .regbits = &sysc_regbits_omap4_usb_host_fs,
 };
 
+static const struct sysc_regbits sysc_regbits_dra7_mcan = {
+       .dmadisable_shift = -ENODEV,
+       .midle_shift = -ENODEV,
+       .sidle_shift = -ENODEV,
+       .clkact_shift = -ENODEV,
+       .enwkup_shift = 4,
+       .srst_shift = 0,
+       .emufree_shift = -ENODEV,
+       .autoidle_shift = -ENODEV,
+};
+
+static const struct sysc_capabilities sysc_dra7_mcan = {
+       .type = TI_SYSC_DRA7_MCAN,
+       .sysc_mask = SYSC_DRA7_MCAN_ENAWAKEUP | SYSC_OMAP4_SOFTRESET,
+       .regbits = &sysc_regbits_dra7_mcan,
+};
+
 static int sysc_init_pdata(struct sysc *ddata)
 {
        struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev);
@@ -1743,6 +1760,7 @@ static const struct of_device_id sysc_match[] = {
        { .compatible = "ti,sysc-mcasp", .data = &sysc_omap4_mcasp, },
        { .compatible = "ti,sysc-usb-host-fs",
          .data = &sysc_omap4_usb_host_fs, },
+       { .compatible = "ti,sysc-dra7-mcan", .data = &sysc_dra7_mcan, },
        {  },
 };
 MODULE_DEVICE_TABLE(of, sysc_match);
index 2c005376ac0e3f68f4631180acbe7c83a06d415e..7138384e2ef9f4ef9865d4b417ea986ff9e36ef3 100644 (file)
@@ -15,6 +15,8 @@
 /* SmartReflex sysc found on 36xx and later */
 #define SYSC_OMAP3_SR_ENAWAKEUP                (1 << 26)
 
+#define SYSC_DRA7_MCAN_ENAWAKEUP       (1 << 4)
+
 /* SYSCONFIG STANDBYMODE/MIDLEMODE/SIDLEMODE supported by hardware */
 #define SYSC_IDLE_FORCE                        0
 #define SYSC_IDLE_NO                   1
index 990aad477458113abf887af2f12e68bf56eec66d..2efa3470a451b9d1d3fc3f082d0c59bcfd247c17 100644 (file)
@@ -14,6 +14,7 @@ enum ti_sysc_module_type {
        TI_SYSC_OMAP4_SR,
        TI_SYSC_OMAP4_MCASP,
        TI_SYSC_OMAP4_USB_HOST_FS,
+       TI_SYSC_DRA7_MCAN,
 };
 
 struct ti_sysc_cookie {