diff options
author | Faiz Abbas <faiz_abbas@ti.com> | 2018-07-09 12:48:38 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2018-07-10 01:31:27 -0400 |
commit | 7f35e63dbfcb627bd30bac45702ffdf1ddde1516 (patch) | |
tree | c084a5cd1c33664f92dc656432954190fc8946b8 | |
parent | 91c17a7006d2e8313afb9666f66313fdc992bfda (diff) |
bus: ti-sysc: Add support for using ti-sysc for MCAN on dra76x
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>
-rw-r--r-- | Documentation/devicetree/bindings/bus/ti-sysc.txt | 1 | ||||
-rw-r--r-- | drivers/bus/ti-sysc.c | 18 | ||||
-rw-r--r-- | include/dt-bindings/bus/ti-sysc.h | 2 | ||||
-rw-r--r-- | include/linux/platform_data/ti-sysc.h | 1 |
4 files changed, 22 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/bus/ti-sysc.txt b/Documentation/devicetree/bindings/bus/ti-sysc.txt index d8ed5b780ed9..91dc2333af01 100644 --- a/Documentation/devicetree/bindings/bus/ti-sysc.txt +++ b/Documentation/devicetree/bindings/bus/ti-sysc.txt | |||
@@ -36,6 +36,7 @@ Required standard properties: | |||
36 | "ti,sysc-omap-aes" | 36 | "ti,sysc-omap-aes" |
37 | "ti,sysc-mcasp" | 37 | "ti,sysc-mcasp" |
38 | "ti,sysc-usb-host-fs" | 38 | "ti,sysc-usb-host-fs" |
39 | "ti,sysc-dra7-mcan" | ||
39 | 40 | ||
40 | - reg shall have register areas implemented for the interconnect | 41 | - reg shall have register areas implemented for the interconnect |
41 | target module in question such as revision, sysc and syss | 42 | 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 80d60f43db56..c9db5369e2ec 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c | |||
@@ -1552,6 +1552,23 @@ static const struct sysc_capabilities sysc_omap4_usb_host_fs = { | |||
1552 | .regbits = &sysc_regbits_omap4_usb_host_fs, | 1552 | .regbits = &sysc_regbits_omap4_usb_host_fs, |
1553 | }; | 1553 | }; |
1554 | 1554 | ||
1555 | static const struct sysc_regbits sysc_regbits_dra7_mcan = { | ||
1556 | .dmadisable_shift = -ENODEV, | ||
1557 | .midle_shift = -ENODEV, | ||
1558 | .sidle_shift = -ENODEV, | ||
1559 | .clkact_shift = -ENODEV, | ||
1560 | .enwkup_shift = 4, | ||
1561 | .srst_shift = 0, | ||
1562 | .emufree_shift = -ENODEV, | ||
1563 | .autoidle_shift = -ENODEV, | ||
1564 | }; | ||
1565 | |||
1566 | static const struct sysc_capabilities sysc_dra7_mcan = { | ||
1567 | .type = TI_SYSC_DRA7_MCAN, | ||
1568 | .sysc_mask = SYSC_DRA7_MCAN_ENAWAKEUP | SYSC_OMAP4_SOFTRESET, | ||
1569 | .regbits = &sysc_regbits_dra7_mcan, | ||
1570 | }; | ||
1571 | |||
1555 | static int sysc_init_pdata(struct sysc *ddata) | 1572 | static int sysc_init_pdata(struct sysc *ddata) |
1556 | { | 1573 | { |
1557 | struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev); | 1574 | struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev); |
@@ -1743,6 +1760,7 @@ static const struct of_device_id sysc_match[] = { | |||
1743 | { .compatible = "ti,sysc-mcasp", .data = &sysc_omap4_mcasp, }, | 1760 | { .compatible = "ti,sysc-mcasp", .data = &sysc_omap4_mcasp, }, |
1744 | { .compatible = "ti,sysc-usb-host-fs", | 1761 | { .compatible = "ti,sysc-usb-host-fs", |
1745 | .data = &sysc_omap4_usb_host_fs, }, | 1762 | .data = &sysc_omap4_usb_host_fs, }, |
1763 | { .compatible = "ti,sysc-dra7-mcan", .data = &sysc_dra7_mcan, }, | ||
1746 | { }, | 1764 | { }, |
1747 | }; | 1765 | }; |
1748 | MODULE_DEVICE_TABLE(of, sysc_match); | 1766 | MODULE_DEVICE_TABLE(of, sysc_match); |
diff --git a/include/dt-bindings/bus/ti-sysc.h b/include/dt-bindings/bus/ti-sysc.h index 2c005376ac0e..7138384e2ef9 100644 --- a/include/dt-bindings/bus/ti-sysc.h +++ b/include/dt-bindings/bus/ti-sysc.h | |||
@@ -15,6 +15,8 @@ | |||
15 | /* SmartReflex sysc found on 36xx and later */ | 15 | /* SmartReflex sysc found on 36xx and later */ |
16 | #define SYSC_OMAP3_SR_ENAWAKEUP (1 << 26) | 16 | #define SYSC_OMAP3_SR_ENAWAKEUP (1 << 26) |
17 | 17 | ||
18 | #define SYSC_DRA7_MCAN_ENAWAKEUP (1 << 4) | ||
19 | |||
18 | /* SYSCONFIG STANDBYMODE/MIDLEMODE/SIDLEMODE supported by hardware */ | 20 | /* SYSCONFIG STANDBYMODE/MIDLEMODE/SIDLEMODE supported by hardware */ |
19 | #define SYSC_IDLE_FORCE 0 | 21 | #define SYSC_IDLE_FORCE 0 |
20 | #define SYSC_IDLE_NO 1 | 22 | #define SYSC_IDLE_NO 1 |
diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h index 990aad477458..2efa3470a451 100644 --- a/include/linux/platform_data/ti-sysc.h +++ b/include/linux/platform_data/ti-sysc.h | |||
@@ -14,6 +14,7 @@ enum ti_sysc_module_type { | |||
14 | TI_SYSC_OMAP4_SR, | 14 | TI_SYSC_OMAP4_SR, |
15 | TI_SYSC_OMAP4_MCASP, | 15 | TI_SYSC_OMAP4_MCASP, |
16 | TI_SYSC_OMAP4_USB_HOST_FS, | 16 | TI_SYSC_OMAP4_USB_HOST_FS, |
17 | TI_SYSC_DRA7_MCAN, | ||
17 | }; | 18 | }; |
18 | 19 | ||
19 | struct ti_sysc_cookie { | 20 | struct ti_sysc_cookie { |