From: Faiz Abbas <hidden> Date: 2018-04-08 09:58:09
The following patches add dts and hwmod support for MCAN in TI's
dra76 SOCs.
The patches depend on the following series:
https://patchwork.kernel.org/patch/10221105/
Tested on linux-next
Franklin S Cooper Jr (1):
ARM: dts: dra76x: Add MCAN node
Lokesh Vutla (2):
ARM: dra762: hwmod: Add MCAN support
ARM: dts: dra762: Add MCAN clock support
arch/arm/boot/dts/dra76-evm.dts | 7 +++++
arch/arm/boot/dts/dra76x.dtsi | 50 +++++++++++++++++++++++++++++++
arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 32 ++++++++++++++++++++
3 files changed, 89 insertions(+)
--
2.7.4
From: Faiz Abbas <hidden> Date: 2018-04-08 09:58:14
From: Lokesh Vutla <redacted>
MCAN is clocked by H14 divider of DPLL_GMAC. Unlike other
DPLL dividers this DPLL_GMAC H14 divider is controlled by
control module. Adding support for these clocks.
Signed-off-by: Lokesh Vutla <redacted>
Signed-off-by: Faiz Abbas <redacted>
---
arch/arm/boot/dts/dra76x.dtsi | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
From: Faiz Abbas <hidden> Date: 2018-04-08 09:58:18
From: Franklin S Cooper Jr <redacted>
Add support for the MCAN peripheral which supports both classic
CAN messages along with the new CAN-FD message.
Add MCAN node to evm and enable it with a maximum datarate of 5 mbps
Signed-off-by: Franklin S Cooper Jr <redacted>
Signed-off-by: Sekhar Nori <redacted>
Signed-off-by: Faiz Abbas <redacted>
---
arch/arm/boot/dts/dra76-evm.dts | 7 +++++++
arch/arm/boot/dts/dra76x.dtsi | 17 +++++++++++++++++
2 files changed, 24 insertions(+)
Looks like you're missing the related struct omap_hwmod_class_sysconfig
entry for this with the rev and sysconfig registers.
Sorry, I missed this email earlier. The MCAN module doesn't have
sysconfig registers.
If there's no sysconfig register you should have no need for adding
anything to omap_hwmod_7xx_data.c. We now have the dts clkctrl
clocks, you can just add that to the dts node for the device.
Regards,
Tony
From: Tony Lindgren <tony@atomide.com> Date: 2018-05-15 17:17:04
* Faiz Abbas [off-list ref] [180408 09:59]:
From: Lokesh Vutla <redacted>
MCAN is clocked by H14 divider of DPLL_GMAC. Unlike other
DPLL dividers this DPLL_GMAC H14 divider is controlled by
control module. Adding support for these clocks.
Looks like you're missing the related struct omap_hwmod_class_sysconfig
entry for this with the rev and sysconfig registers.
Sorry, I missed this email earlier. The MCAN module doesn't have
sysconfig registers.
If there's no sysconfig register you should have no need for adding
anything to omap_hwmod_7xx_data.c. We now have the dts clkctrl
clocks, you can just add that to the dts node for the device.
However.. My guess is there is somewhere a top level interconnect
target module that uses DRA7XX_CM_WKUPAON_ADC_CLKCTRL. And that
module may have multiple child devices.
Regards,
Tony
Looks like you're missing the related struct omap_hwmod_class_sysconfig
entry for this with the rev and sysconfig registers.
Sorry, I missed this email earlier. The MCAN module doesn't have
sysconfig registers.
If there's no sysconfig register you should have no need for adding
anything to omap_hwmod_7xx_data.c. We now have the dts clkctrl
clocks, you can just add that to the dts node for the device.
However.. My guess is there is somewhere a top level interconnect
target module that uses DRA7XX_CM_WKUPAON_ADC_CLKCTRL. And that
module may have multiple child devices.
And I'm guessing the top level module with sysconfig related
registers is named "adc" :)
Regards,
Tony
Looks like you're missing the related struct omap_hwmod_class_sysconfig
entry for this with the rev and sysconfig registers.
Sorry, I missed this email earlier. The MCAN module doesn't have
sysconfig registers.
If there's no sysconfig register you should have no need for adding
anything to omap_hwmod_7xx_data.c. We now have the dts clkctrl
clocks, you can just add that to the dts node for the device.
However.. My guess is there is somewhere a top level interconnect
target module that uses DRA7XX_CM_WKUPAON_ADC_CLKCTRL. And that
module may have multiple child devices.
And I'm guessing the top level module with sysconfig related
registers is named "adc" :)
Thanks that helps :) Looks like we have:
MCANSS_PID rev 0
MCANSS_CTRL sysconfig 0x4
MCANSS_STAT sysstatus 0x8
With current Linux next, this should work with just ti-sysc if
we added yet another sysconfig layout.. See
Documentation/devicetree/bindings/bus/ti-sysc.txt
Looks like this is not quite "ti,sysc-omap4" as there are no
ti,sysc-midle or ti,sysc-sidle, and sysstatus reset bit is
inverted..
Anyways, I think the dts part should be similar to this with
the new sysconfig added (untested):
target-module@42c00000 {
compatible ="ti,sysc-yet-to-be-determined";
ti,hwmods = "mcan";
reg = <0x42c00000 4>,
<0x42c00004 4>,
<0x42c00008 4>;
reg-names = "rev", "sysc", "syss";
clocks = <&wkupaon_clkctrl CM_WKUPAON_ADC_CLKCTRL>;
clock-names = "fck";
ti,sysc-mask = <(SYSC_OMAP4_SOFTRESET | SYSC_DRA7_ENAWAKEUP)>;
ti,syss-mask = <1>;
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 0x42c00000 0x2000>;
mcan@0 {
compatible = "bosch,m_can";
reg = <0x1a00 0x4000>,
<0 0x18fc>;
reg-names = "m_can", "message_ram";
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "int0", "int1";
clocks = <&mcan_clk>, <&l3_iclk_div>;
clock-names = "cclk", "hclk";
bosch,mram-cfg = <0x0 0 0 32 0 0 1 1>;
};
};
You'd have to add a new struct sysc_regbits to ti-sysc.c similar
to sysc_regbits_omap4 for the .srst_shift = 0. Not sure if the same
register layout is used for other modules, but might be worth checking
the TRM. Also the clock node is missing for wkupaon_clkctrl from
include/dt-bindings/clock/dra7.h.
If the "message_ram" can operate independent of the driver,
it could be a separate child node under the target-module.
In the hwmod you still need the struct omap_hwmod for now,
but clocks should no longer be needed there.
Regards,
Tony
So the omap_hwmod_class, omap_hwmod_ocp_if and entry on the
dra76x_hwmod_ocp_ifs list are still needed with ti-sysc for a
while. Eventually that data will just come from the dts interconnect
hierarchy. For struct omap_hwmod_class_sysconfig, ti-sysc will
allocate and it based on the dts data.
Regards,
Tony
So the omap_hwmod_class, omap_hwmod_ocp_if and entry on the
dra76x_hwmod_ocp_ifs list are still needed with ti-sysc for a
while. Eventually that data will just come from the dts interconnect
hierarchy. For struct omap_hwmod_class_sysconfig, ti-sysc will
allocate and it based on the dts data.
Thanks for the detailed pointers. I will figure out the ti-sysc node
that needs to be added and post a v2.
Thanks,
Faiz