diff mbox

[1/3] ARM: dra762: hwmod: Add MCAN support

Message ID 1523181542-3770-2-git-send-email-faiz_abbas@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Faiz Abbas April 8, 2018, 9:59 a.m. UTC
From: Lokesh Vutla <lokeshvutla@ti.com>

Add MCAN hwmod data and register it for dra762 silicons.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 32 +++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

Comments

Tony Lindgren May 1, 2018, 3:26 p.m. UTC | #1
Hi,

* Faiz Abbas <faiz_abbas@ti.com> [180408 09:59]:
> From: Lokesh Vutla <lokeshvutla@ti.com>
> 
> Add MCAN hwmod data and register it for dra762 silicons.
> 
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
> ---
>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 32 +++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> index 62352d1..a2cd7f8 100644
> --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> @@ -1356,6 +1356,29 @@ static struct omap_hwmod dra7xx_mailbox13_hwmod = {
>  };
>  
>  /*
> + * 'mcan' class
> + *
> + */
> +static struct omap_hwmod_class dra76x_mcan_hwmod_class = {
> +	.name	= "mcan",
> +};

Looks like you're missing the related struct omap_hwmod_class_sysconfig
entry for this with the rev and sysconfig registers.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Faiz Abbas May 15, 2018, 6:04 a.m. UTC | #2
Hi Tony,

On Tuesday 01 May 2018 08:56 PM, Tony Lindgren wrote:
> Hi,
> 
> * Faiz Abbas <faiz_abbas@ti.com> [180408 09:59]:
>> From: Lokesh Vutla <lokeshvutla@ti.com>
>>
>> Add MCAN hwmod data and register it for dra762 silicons.
>>
>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
>> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
>> ---
>>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 32 +++++++++++++++++++++++++++++++
>>  1 file changed, 32 insertions(+)
>>
>> diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
>> index 62352d1..a2cd7f8 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
>> @@ -1356,6 +1356,29 @@ static struct omap_hwmod dra7xx_mailbox13_hwmod = {
>>  };
>>  
>>  /*
>> + * 'mcan' class
>> + *
>> + */
>> +static struct omap_hwmod_class dra76x_mcan_hwmod_class = {
>> +	.name	= "mcan",
>> +};
> 
> 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.

Thanks,
Faiz
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren May 15, 2018, 5:14 p.m. UTC | #3
* Faiz Abbas <faiz_abbas@ti.com> [180515 06:05]:
> Hi Tony,
> 
> On Tuesday 01 May 2018 08:56 PM, Tony Lindgren wrote:
> > Hi,
> > 
> > * Faiz Abbas <faiz_abbas@ti.com> [180408 09:59]:
> >> From: Lokesh Vutla <lokeshvutla@ti.com>
> >>
> >> Add MCAN hwmod data and register it for dra762 silicons.
> >>
> >> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> >> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
> >> ---
> >>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 32 +++++++++++++++++++++++++++++++
> >>  1 file changed, 32 insertions(+)
> >>
> >> diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> >> index 62352d1..a2cd7f8 100644
> >> --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> >> +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> >> @@ -1356,6 +1356,29 @@ static struct omap_hwmod dra7xx_mailbox13_hwmod = {
> >>  };
> >>  
> >>  /*
> >> + * 'mcan' class
> >> + *
> >> + */
> >> +static struct omap_hwmod_class dra76x_mcan_hwmod_class = {
> >> +	.name	= "mcan",
> >> +};
> > 
> > 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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren May 15, 2018, 5:18 p.m. UTC | #4
* Tony Lindgren <tony@atomide.com> [180515 17:17]:
> * Faiz Abbas <faiz_abbas@ti.com> [180515 06:05]:
> > Hi Tony,
> > 
> > On Tuesday 01 May 2018 08:56 PM, Tony Lindgren wrote:
> > > Hi,
> > > 
> > > * Faiz Abbas <faiz_abbas@ti.com> [180408 09:59]:
> > >> From: Lokesh Vutla <lokeshvutla@ti.com>
> > >>
> > >> Add MCAN hwmod data and register it for dra762 silicons.
> > >>
> > >> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> > >> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
> > >> ---
> > >>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 32 +++++++++++++++++++++++++++++++
> > >>  1 file changed, 32 insertions(+)
> > >>
> > >> diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> > >> index 62352d1..a2cd7f8 100644
> > >> --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> > >> +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> > >> @@ -1356,6 +1356,29 @@ static struct omap_hwmod dra7xx_mailbox13_hwmod = {
> > >>  };
> > >>  
> > >>  /*
> > >> + * 'mcan' class
> > >> + *
> > >> + */
> > >> +static struct omap_hwmod_class dra76x_mcan_hwmod_class = {
> > >> +	.name	= "mcan",
> > >> +};
> > > 
> > > 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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren May 15, 2018, 5:23 p.m. UTC | #5
* Tony Lindgren <tony@atomide.com> [180515 17:20]:
> * Tony Lindgren <tony@atomide.com> [180515 17:17]:
> > * Faiz Abbas <faiz_abbas@ti.com> [180515 06:05]:
> > > Hi Tony,
> > > 
> > > On Tuesday 01 May 2018 08:56 PM, Tony Lindgren wrote:
> > > > Hi,
> > > > 
> > > > * Faiz Abbas <faiz_abbas@ti.com> [180408 09:59]:
> > > >> From: Lokesh Vutla <lokeshvutla@ti.com>
> > > >>
> > > >> Add MCAN hwmod data and register it for dra762 silicons.
> > > >>
> > > >> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> > > >> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
> > > >> ---
> > > >>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 32 +++++++++++++++++++++++++++++++
> > > >>  1 file changed, 32 insertions(+)
> > > >>
> > > >> diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> > > >> index 62352d1..a2cd7f8 100644
> > > >> --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> > > >> +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> > > >> @@ -1356,6 +1356,29 @@ static struct omap_hwmod dra7xx_mailbox13_hwmod = {
> > > >>  };
> > > >>  
> > > >>  /*
> > > >> + * 'mcan' class
> > > >> + *
> > > >> + */
> > > >> +static struct omap_hwmod_class dra76x_mcan_hwmod_class = {
> > > >> +	.name	= "mcan",
> > > >> +};
> > > > 
> > > > 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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Faiz Abbas May 17, 2018, 8:13 a.m. UTC | #6
Hi Tony,

On Tuesday 15 May 2018 10:53 PM, Tony Lindgren wrote:
> * Tony Lindgren <tony@atomide.com> [180515 17:20]:
>> * Tony Lindgren <tony@atomide.com> [180515 17:17]:
>>> * Faiz Abbas <faiz_abbas@ti.com> [180515 06:05]:
>>>> Hi Tony,
>>>>
>>>> On Tuesday 01 May 2018 08:56 PM, Tony Lindgren wrote:
>>>>> Hi,
>>>>>
>>>>> * Faiz Abbas <faiz_abbas@ti.com> [180408 09:59]:
>>>>>> From: Lokesh Vutla <lokeshvutla@ti.com>
>>>>>>
>>>>>> Add MCAN hwmod data and register it for dra762 silicons.
>>>>>>
>>>>>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
>>>>>> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
>>>>>> ---
>>>>>>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 32 +++++++++++++++++++++++++++++++
>>>>>>  1 file changed, 32 insertions(+)
>>>>>>
>>>>>> diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
>>>>>> index 62352d1..a2cd7f8 100644
>>>>>> --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
>>>>>> +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
>>>>>> @@ -1356,6 +1356,29 @@ static struct omap_hwmod dra7xx_mailbox13_hwmod = {
>>>>>>  };
>>>>>>  
>>>>>>  /*
>>>>>> + * 'mcan' class
>>>>>> + *
>>>>>> + */
>>>>>> +static struct omap_hwmod_class dra76x_mcan_hwmod_class = {
>>>>>> +	.name	= "mcan",
>>>>>> +};
>>>>>
>>>>> 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" :)
> 

Yes. The MCAN clocks are controlled by the ADC_CLKCTRL register.
Please see TRM:
http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=spruie9&fileType=pdf
page: 1530

Thanks,
Faiz
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren May 17, 2018, 9:04 p.m. UTC | #7
* Faiz Abbas <faiz_abbas@ti.com> [180517 08:14]:
> On Tuesday 15 May 2018 10:53 PM, Tony Lindgren wrote:
> > And I'm guessing the top level module with sysconfig related
> > registers is named "adc" :)
> > 
> 
> Yes. The MCAN clocks are controlled by the ADC_CLKCTRL register.
> Please see TRM:
> http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=spruie9&fileType=pdf
> page: 1530

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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren May 17, 2018, 9:09 p.m. UTC | #8
* Faiz Abbas <faiz_abbas@ti.com> [180408 09:59]:
> From: Lokesh Vutla <lokeshvutla@ti.com>
> 
> Add MCAN hwmod data and register it for dra762 silicons.
> 
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
> ---
>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 32 +++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> index 62352d1..a2cd7f8 100644
> --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> @@ -1356,6 +1356,29 @@ static struct omap_hwmod dra7xx_mailbox13_hwmod = {
>  };
>  
>  /*
> + * 'mcan' class
> + *
> + */
> +static struct omap_hwmod_class dra76x_mcan_hwmod_class = {
> +	.name	= "mcan",
> +};
> +
> +/* mcan */
> +static struct omap_hwmod dra76x_mcan_hwmod = {
> +	.name		= "mcan",
> +	.class		= &dra76x_mcan_hwmod_class,
> +	.clkdm_name	= "wkupaon_clkdm",
> +	.main_clk	= "mcan_clk",
> +	.prcm = {
> +		.omap4 = {
> +			.clkctrl_offs = DRA7XX_CM_WKUPAON_ADC_CLKCTRL_OFFSET,
> +			.context_offs = DRA7XX_RM_WKUPAON_ADC_CONTEXT_OFFSET,
> +			.modulemode   = MODULEMODE_SWCTRL,
> +		},
> +	},
> +};

So based on the ti-sysc related dts comments, this patch should
work except you should be able to just leave out the clocks here
with the dts changes.

> +/*
>   * 'mcspi' class
>   *
>   */
> @@ -3818,6 +3841,14 @@ static struct omap_hwmod_ocp_if dra7xx_l4_per2__epwmss2 = {
>  	.user		= OCP_USER_MPU,
>  };
>  
> +/* l3_main_1 -> mcan */
> +static struct omap_hwmod_ocp_if dra76x_l3_main_1__mcan = {
> +	.master		= &dra7xx_l3_main_1_hwmod,
> +	.slave		= &dra76x_mcan_hwmod,
> +	.clk		= "l3_iclk_div",
> +	.user		= OCP_USER_MPU | OCP_USER_SDMA,
> +};
> +
>  static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
>  	&dra7xx_l3_main_1__dmm,
>  	&dra7xx_l3_main_2__l3_instr,
> @@ -3958,6 +3989,7 @@ static struct omap_hwmod_ocp_if *dra7xx_gp_hwmod_ocp_ifs[] __initdata = {
>  /* SoC variant specific hwmod links */
>  static struct omap_hwmod_ocp_if *dra76x_hwmod_ocp_ifs[] __initdata = {
>  	&dra7xx_l4_per3__usb_otg_ss4,
> +	&dra76x_l3_main_1__mcan,
>  	NULL,
>  };

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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Faiz Abbas May 18, 2018, 11:54 a.m. UTC | #9
Hi Tony,

On Friday 18 May 2018 02:39 AM, Tony Lindgren wrote:
> * Faiz Abbas <faiz_abbas@ti.com> [180408 09:59]:
>> From: Lokesh Vutla <lokeshvutla@ti.com>
>>
>> Add MCAN hwmod data and register it for dra762 silicons.
>>
>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
>> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
>> ---
>>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 32 +++++++++++++++++++++++++++++++
>>  1 file changed, 32 insertions(+)
>>
>> diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
>> index 62352d1..a2cd7f8 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
>> @@ -1356,6 +1356,29 @@ static struct omap_hwmod dra7xx_mailbox13_hwmod = {
>>  };
>>  
>>  /*
>> + * 'mcan' class
>> + *
>> + */
>> +static struct omap_hwmod_class dra76x_mcan_hwmod_class = {
>> +	.name	= "mcan",
>> +};
>> +
>> +/* mcan */
>> +static struct omap_hwmod dra76x_mcan_hwmod = {
>> +	.name		= "mcan",
>> +	.class		= &dra76x_mcan_hwmod_class,
>> +	.clkdm_name	= "wkupaon_clkdm",
>> +	.main_clk	= "mcan_clk",
>> +	.prcm = {
>> +		.omap4 = {
>> +			.clkctrl_offs = DRA7XX_CM_WKUPAON_ADC_CLKCTRL_OFFSET,
>> +			.context_offs = DRA7XX_RM_WKUPAON_ADC_CONTEXT_OFFSET,
>> +			.modulemode   = MODULEMODE_SWCTRL,
>> +		},
>> +	},
>> +};
> 
> So based on the ti-sysc related dts comments, this patch should
> work except you should be able to just leave out the clocks here
> with the dts changes.
> 
>> +/*
>>   * 'mcspi' class
>>   *
>>   */
>> @@ -3818,6 +3841,14 @@ static struct omap_hwmod_ocp_if dra7xx_l4_per2__epwmss2 = {
>>  	.user		= OCP_USER_MPU,
>>  };
>>  
>> +/* l3_main_1 -> mcan */
>> +static struct omap_hwmod_ocp_if dra76x_l3_main_1__mcan = {
>> +	.master		= &dra7xx_l3_main_1_hwmod,
>> +	.slave		= &dra76x_mcan_hwmod,
>> +	.clk		= "l3_iclk_div",
>> +	.user		= OCP_USER_MPU | OCP_USER_SDMA,
>> +};
>> +
>>  static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
>>  	&dra7xx_l3_main_1__dmm,
>>  	&dra7xx_l3_main_2__l3_instr,
>> @@ -3958,6 +3989,7 @@ static struct omap_hwmod_ocp_if *dra7xx_gp_hwmod_ocp_ifs[] __initdata = {
>>  /* SoC variant specific hwmod links */
>>  static struct omap_hwmod_ocp_if *dra76x_hwmod_ocp_ifs[] __initdata = {
>>  	&dra7xx_l4_per3__usb_otg_ss4,
>> +	&dra76x_l3_main_1__mcan,
>>  	NULL,
>>  };
> 
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index 62352d1..a2cd7f8 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -1356,6 +1356,29 @@  static struct omap_hwmod dra7xx_mailbox13_hwmod = {
 };
 
 /*
+ * 'mcan' class
+ *
+ */
+static struct omap_hwmod_class dra76x_mcan_hwmod_class = {
+	.name	= "mcan",
+};
+
+/* mcan */
+static struct omap_hwmod dra76x_mcan_hwmod = {
+	.name		= "mcan",
+	.class		= &dra76x_mcan_hwmod_class,
+	.clkdm_name	= "wkupaon_clkdm",
+	.main_clk	= "mcan_clk",
+	.prcm = {
+		.omap4 = {
+			.clkctrl_offs = DRA7XX_CM_WKUPAON_ADC_CLKCTRL_OFFSET,
+			.context_offs = DRA7XX_RM_WKUPAON_ADC_CONTEXT_OFFSET,
+			.modulemode   = MODULEMODE_SWCTRL,
+		},
+	},
+};
+
+/*
  * 'mcspi' class
  *
  */
@@ -3818,6 +3841,14 @@  static struct omap_hwmod_ocp_if dra7xx_l4_per2__epwmss2 = {
 	.user		= OCP_USER_MPU,
 };
 
+/* l3_main_1 -> mcan */
+static struct omap_hwmod_ocp_if dra76x_l3_main_1__mcan = {
+	.master		= &dra7xx_l3_main_1_hwmod,
+	.slave		= &dra76x_mcan_hwmod,
+	.clk		= "l3_iclk_div",
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
 	&dra7xx_l3_main_1__dmm,
 	&dra7xx_l3_main_2__l3_instr,
@@ -3958,6 +3989,7 @@  static struct omap_hwmod_ocp_if *dra7xx_gp_hwmod_ocp_ifs[] __initdata = {
 /* SoC variant specific hwmod links */
 static struct omap_hwmod_ocp_if *dra76x_hwmod_ocp_ifs[] __initdata = {
 	&dra7xx_l4_per3__usb_otg_ss4,
+	&dra76x_l3_main_1__mcan,
 	NULL,
 };