Patchwork MXS: Enable FLEXCAN for MXS/DT

login
register
mail settings
Submitter Marek Vasut
Date May 27, 2012, 2:11 a.m.
Message ID <1338084709-12043-1-git-send-email-marex@denx.de>
Download mbox | patch
Permalink /patch/161518/
State New
Headers show

Comments

Marek Vasut - May 27, 2012, 2:11 a.m.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
CC: Dong Aisheng <b29396@freescale.com>
CC: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Linux ARM kernel <linux-arm-kernel@lists.infradead.org>
CC: Shawn Guo <shawn.guo@linaro.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
---
 arch/arm/boot/dts/imx28.dtsi |    2 ++
 arch/arm/mach-mxs/Kconfig    |    1 +
 2 files changed, 3 insertions(+)
Shawn Guo - June 6, 2012, 5:39 a.m.
On Sun, May 27, 2012 at 04:11:49AM +0200, Marek Vasut wrote:
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Detlev Zundel <dzu@denx.de>
> CC: Dong Aisheng <b29396@freescale.com>
> CC: Fabio Estevam <fabio.estevam@freescale.com>
> Cc: Linux ARM kernel <linux-arm-kernel@lists.infradead.org>
> CC: Shawn Guo <shawn.guo@linaro.org>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Wolfgang Denk <wd@denx.de>
> ---
>  arch/arm/boot/dts/imx28.dtsi |    2 ++
>  arch/arm/mach-mxs/Kconfig    |    1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
> index 119f183..13c6084 100644
> --- a/arch/arm/boot/dts/imx28.dtsi
> +++ b/arch/arm/boot/dts/imx28.dtsi
> @@ -278,12 +278,14 @@
>  			};
>  
>  			can0: can@80032000 {
> +				compatible = "fsl,p1010-flexcan";
>  				reg = <0x80032000 2000>;
>  				interrupts = <8>;
>  				status = "disabled";
>  			};
>  
>  			can1: can@80034000 {
> +				compatible = "fsl,p1010-flexcan";
>  				reg = <0x80034000 2000>;
>  				interrupts = <9>;
>  				status = "disabled";
> diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
> index 91cf062..0406f37 100644
> --- a/arch/arm/mach-mxs/Kconfig
> +++ b/arch/arm/mach-mxs/Kconfig
> @@ -18,6 +18,7 @@ config SOC_IMX28
>  	select CPU_ARM926T
>  	select HAVE_PWM
>  	select PINCTRL_IMX28
> +	select MXS_HAVE_PLATFORM_FLEXCAN

This change shouldn't be part of this patch.  Furthermore, this symbol
and arch/arm/mach-mxs/devices/platform-flexcan.c should be removed
completely after we covert all these board files that have flexcan
device enabled over to DT.

Regards,
Shawn

>  
>  comment "MXS platforms:"
>  
> -- 
> 1.7.10
>
Marc Kleine-Budde - June 26, 2012, 9:04 a.m.
On 05/27/2012 04:11 AM, Marek Vasut wrote:
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Detlev Zundel <dzu@denx.de>
> CC: Dong Aisheng <b29396@freescale.com>
> CC: Fabio Estevam <fabio.estevam@freescale.com>
> Cc: Linux ARM kernel <linux-arm-kernel@lists.infradead.org>
> CC: Shawn Guo <shawn.guo@linaro.org>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Wolfgang Denk <wd@denx.de>
> ---
>  arch/arm/boot/dts/imx28.dtsi |    2 ++
>  arch/arm/mach-mxs/Kconfig    |    1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
> index 119f183..13c6084 100644
> --- a/arch/arm/boot/dts/imx28.dtsi
> +++ b/arch/arm/boot/dts/imx28.dtsi
> @@ -278,12 +278,14 @@
>  			};
>  
>  			can0: can@80032000 {
> +				compatible = "fsl,p1010-flexcan";
>  				reg = <0x80032000 2000>;
>  				interrupts = <8>;
>  				status = "disabled";
>  			};
>  
>  			can1: can@80034000 {
> +				compatible = "fsl,p1010-flexcan";
>  				reg = <0x80034000 2000>;
>  				interrupts = <9>;
>  				status = "disabled";
> diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
> index 91cf062..0406f37 100644
> --- a/arch/arm/mach-mxs/Kconfig
> +++ b/arch/arm/mach-mxs/Kconfig
> @@ -18,6 +18,7 @@ config SOC_IMX28
>  	select CPU_ARM926T
>  	select HAVE_PWM
>  	select PINCTRL_IMX28
> +	select MXS_HAVE_PLATFORM_FLEXCAN

This compiles in the code to create a flexcan platform device, which
should not be needed in the DT case. You save some bytes if you use:

+       select HAVE_CAN_FLEXCAN if NET && CAN

>  
>  comment "MXS platforms:"
>  

Marc
Marc Kleine-Budde - June 26, 2012, 9:07 a.m.
On 06/26/2012 11:04 AM, Marc Kleine-Budde wrote:
> On 05/27/2012 04:11 AM, Marek Vasut wrote:
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Detlev Zundel <dzu@denx.de>
>> CC: Dong Aisheng <b29396@freescale.com>
>> CC: Fabio Estevam <fabio.estevam@freescale.com>
>> Cc: Linux ARM kernel <linux-arm-kernel@lists.infradead.org>
>> CC: Shawn Guo <shawn.guo@linaro.org>
>> Cc: Stefano Babic <sbabic@denx.de>
>> Cc: Wolfgang Denk <wd@denx.de>
>> ---
>>  arch/arm/boot/dts/imx28.dtsi |    2 ++
>>  arch/arm/mach-mxs/Kconfig    |    1 +
>>  2 files changed, 3 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
>> index 119f183..13c6084 100644
>> --- a/arch/arm/boot/dts/imx28.dtsi
>> +++ b/arch/arm/boot/dts/imx28.dtsi
>> @@ -278,12 +278,14 @@
>>  			};
>>  
>>  			can0: can@80032000 {
>> +				compatible = "fsl,p1010-flexcan";
>>  				reg = <0x80032000 2000>;
>>  				interrupts = <8>;
>>  				status = "disabled";
>>  			};
>>  
>>  			can1: can@80034000 {
>> +				compatible = "fsl,p1010-flexcan";
>>  				reg = <0x80034000 2000>;
>>  				interrupts = <9>;
>>  				status = "disabled";
>> diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
>> index 91cf062..0406f37 100644
>> --- a/arch/arm/mach-mxs/Kconfig
>> +++ b/arch/arm/mach-mxs/Kconfig
>> @@ -18,6 +18,7 @@ config SOC_IMX28
>>  	select CPU_ARM926T
>>  	select HAVE_PWM
>>  	select PINCTRL_IMX28
>> +	select MXS_HAVE_PLATFORM_FLEXCAN
> 
> This compiles in the code to create a flexcan platform device, which
> should not be needed in the DT case. You save some bytes if you use:
> 
> +       select HAVE_CAN_FLEXCAN if NET && CAN

...and put this select to MACH_MXS_DT, instead of SOC_IMX28

Marc
Shawn Guo - June 26, 2012, 11:28 a.m.
On Tue, Jun 26, 2012 at 11:07:24AM +0200, Marc Kleine-Budde wrote:
> > +       select HAVE_CAN_FLEXCAN if NET && CAN
> 
> ...and put this select to MACH_MXS_DT, instead of SOC_IMX28
> 
Hmm, why?  Flexcan is a feature/block of SoC rather than a machine,
isn't it?
Marc Kleine-Budde - June 26, 2012, 11:43 a.m.
On 06/26/2012 01:28 PM, Shawn Guo wrote:
> On Tue, Jun 26, 2012 at 11:07:24AM +0200, Marc Kleine-Budde wrote:
>>> +       select HAVE_CAN_FLEXCAN if NET && CAN
>>
>> ...and put this select to MACH_MXS_DT, instead of SOC_IMX28
>>
> Hmm, why?  Flexcan is a feature/block of SoC rather than a machine,
> isn't it?

Yes, but the HAVE_CAN_FLEXCAN is used to make the driver available in
Kconfig. What about removing the "depends on HAVE_CAN_FLEXCAN" from the
driver symbol in Kconfig? I can push it via net-next and it will be
mainline in 3.6. You can remove the HAVE_CAN_FLEXCAN from the ARM (and
powerpc) trees.

To avoid Kconfig hickups I'll keep the HAVE_CAN_FLEXCAN symbol in the
net-tree as long as the select HAVE_CAN_FLEXCAN is still present.

Marc
Shawn Guo - June 26, 2012, 2:07 p.m.
On Tue, Jun 26, 2012 at 01:43:11PM +0200, Marc Kleine-Budde wrote:
> Yes, but the HAVE_CAN_FLEXCAN is used to make the driver available in
> Kconfig. What about removing the "depends on HAVE_CAN_FLEXCAN" from the
> driver symbol in Kconfig? I can push it via net-next and it will be
> mainline in 3.6. You can remove the HAVE_CAN_FLEXCAN from the ARM (and
> powerpc) trees.
> 
Ok, that works for me if you would like to have the CAN_FLEXCAN show
up anyway for all the ARCHs, but otherwise we just end up with replacing
"depends on HAVE_CAN_FLEXCAN" with "depends on ARCH_MXS || ARCH_MXC".
Marek Vasut - June 26, 2012, 3:43 p.m.
Dear Shawn Guo,

> On Tue, Jun 26, 2012 at 01:43:11PM +0200, Marc Kleine-Budde wrote:
> > Yes, but the HAVE_CAN_FLEXCAN is used to make the driver available in
> > Kconfig. What about removing the "depends on HAVE_CAN_FLEXCAN" from the
> > driver symbol in Kconfig? I can push it via net-next and it will be
> > mainline in 3.6. You can remove the HAVE_CAN_FLEXCAN from the ARM (and
> > powerpc) trees.
> 
> Ok, that works for me if you would like to have the CAN_FLEXCAN show
> up anyway for all the ARCHs, but otherwise we just end up with replacing
> "depends on HAVE_CAN_FLEXCAN" with "depends on ARCH_MXS || ARCH_MXC".

PPC also uses the flexcan, so don't forget about that.

Best regards,
Marek Vasut

Patch

diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index 119f183..13c6084 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -278,12 +278,14 @@ 
 			};
 
 			can0: can@80032000 {
+				compatible = "fsl,p1010-flexcan";
 				reg = <0x80032000 2000>;
 				interrupts = <8>;
 				status = "disabled";
 			};
 
 			can1: can@80034000 {
+				compatible = "fsl,p1010-flexcan";
 				reg = <0x80034000 2000>;
 				interrupts = <9>;
 				status = "disabled";
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index 91cf062..0406f37 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -18,6 +18,7 @@  config SOC_IMX28
 	select CPU_ARM926T
 	select HAVE_PWM
 	select PINCTRL_IMX28
+	select MXS_HAVE_PLATFORM_FLEXCAN
 
 comment "MXS platforms:"