Skip to content

Commit 7f35e63

Browse files
Faiz-Abbastmlind
authored andcommitted
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>
1 parent 91c17a7 commit 7f35e63

4 files changed

Lines changed: 22 additions & 0 deletions

File tree

‎Documentation/devicetree/bindings/bus/ti-sysc.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Required standard properties:
3636
"ti,sysc-omap-aes"
3737
"ti,sysc-mcasp"
3838
"ti,sysc-usb-host-fs"
39+
"ti,sysc-dra7-mcan"
3940

4041
- reg shall have register areas implemented for the interconnect
4142
target module in question such as revision, sysc and syss

‎drivers/bus/ti-sysc.c‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,6 +1552,23 @@ static const struct sysc_capabilities sysc_omap4_usb_host_fs = {
15521552
.regbits = &sysc_regbits_omap4_usb_host_fs,
15531553
};
15541554

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+
15551572
static int sysc_init_pdata(struct sysc *ddata)
15561573
{
15571574
struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev);
@@ -1743,6 +1760,7 @@ static const struct of_device_id sysc_match[] = {
17431760
{ .compatible = "ti,sysc-mcasp", .data = &sysc_omap4_mcasp, },
17441761
{ .compatible = "ti,sysc-usb-host-fs",
17451762
.data = &sysc_omap4_usb_host_fs, },
1763+
{ .compatible = "ti,sysc-dra7-mcan", .data = &sysc_dra7_mcan, },
17461764
{ },
17471765
};
17481766
MODULE_DEVICE_TABLE(of, sysc_match);

‎include/dt-bindings/bus/ti-sysc.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
/* SmartReflex sysc found on 36xx and later */
1616
#define SYSC_OMAP3_SR_ENAWAKEUP (1 << 26)
1717

18+
#define SYSC_DRA7_MCAN_ENAWAKEUP (1 << 4)
19+
1820
/* SYSCONFIG STANDBYMODE/MIDLEMODE/SIDLEMODE supported by hardware */
1921
#define SYSC_IDLE_FORCE 0
2022
#define SYSC_IDLE_NO 1

‎include/linux/platform_data/ti-sysc.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ enum ti_sysc_module_type {
1414
TI_SYSC_OMAP4_SR,
1515
TI_SYSC_OMAP4_MCASP,
1616
TI_SYSC_OMAP4_USB_HOST_FS,
17+
TI_SYSC_DRA7_MCAN,
1718
};
1819

1920
struct ti_sysc_cookie {

0 commit comments

Comments
 (0)