diff mbox

[v2,3/6] ARM: AM43xx: Introduce a separate soc_is function for am438x series of SoCs

Message ID 1439198906-31189-4-git-send-email-j-keerthy@ti.com
State Under Review, archived
Headers show

Commit Message

J, KEERTHY Aug. 10, 2015, 9:28 a.m. UTC
EPOS evms are fitted with a separate family of am43xx SoCs and are named
am438x series. Adding a separate soc_is function to identify that
particular series of SoCs. This can be done to avoid unnecessarily
registering hwmods like rtc when not needed on EPOS evms.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 Documentation/devicetree/bindings/arm/omap/omap.txt | 3 +++
 arch/arm/mach-omap2/board-generic.c                 | 1 +
 arch/arm/mach-omap2/id.c                            | 2 ++
 arch/arm/mach-omap2/soc.h                           | 7 +++++--
 4 files changed, 11 insertions(+), 2 deletions(-)

Comments

Tony Lindgren Aug. 11, 2015, 12:55 p.m. UTC | #1
* Keerthy <j-keerthy@ti.com> [150810 02:31]:
> @@ -371,8 +372,10 @@ IS_OMAP_TYPE(3430, 0x3430)
>  #ifdef	CONFIG_SOC_AM43XX
>  # undef soc_is_am43xx
>  # undef soc_is_am437x
> -# define soc_is_am43xx()		is_am43xx()
> -# define soc_is_am437x()		is_am437x()
> +# undef soc_is_am438x
> +# define soc_is_am43xx()		of_machine_is_compatible("ti,am43")
> +# define soc_is_am437x()		of_machine_is_compatible("ti,am4372")
> +# define soc_is_am438x()		of_machine_is_compatible("ti,am438x")
>  #endif

Hmm didn't I already comment on this change? I don't want to do it
for one SoC. Please add the SoC detection the old way for am43xx,
then do another series that changes all the DT only SoCs to use
of_machine_is_compatible() after it's been properly tested so now
regressions are caused for the early init code.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keerthy Aug. 11, 2015, 5:54 p.m. UTC | #2
On Tuesday 11 August 2015 06:25 PM, Tony Lindgren wrote:
> * Keerthy <j-keerthy@ti.com> [150810 02:31]:
>> @@ -371,8 +372,10 @@ IS_OMAP_TYPE(3430, 0x3430)
>>   #ifdef	CONFIG_SOC_AM43XX
>>   # undef soc_is_am43xx
>>   # undef soc_is_am437x
>> -# define soc_is_am43xx()		is_am43xx()
>> -# define soc_is_am437x()		is_am437x()
>> +# undef soc_is_am438x
>> +# define soc_is_am43xx()		of_machine_is_compatible("ti,am43")
>> +# define soc_is_am437x()		of_machine_is_compatible("ti,am4372")
>> +# define soc_is_am438x()		of_machine_is_compatible("ti,am438x")
>>   #endif
>
> Hmm didn't I already comment on this change? I don't want to do it
> for one SoC. Please add the SoC detection the old way for am43xx,
> then do another series that changes all the DT only SoCs to use
> of_machine_is_compatible() after it's been properly tested so now
> regressions are caused for the early init code.

Okay. I misinterpreted your earlier comment. Thanks for clarifying.
I will re-do.

>
> Regards,
>
> Tony
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren Aug. 12, 2015, 8:37 a.m. UTC | #3
* Keerthy <a0393675@ti.com> [150811 10:57]:
> 
> 
> On Tuesday 11 August 2015 06:25 PM, Tony Lindgren wrote:
> >* Keerthy <j-keerthy@ti.com> [150810 02:31]:
> >>@@ -371,8 +372,10 @@ IS_OMAP_TYPE(3430, 0x3430)
> >>  #ifdef	CONFIG_SOC_AM43XX
> >>  # undef soc_is_am43xx
> >>  # undef soc_is_am437x
> >>-# define soc_is_am43xx()		is_am43xx()
> >>-# define soc_is_am437x()		is_am437x()
> >>+# undef soc_is_am438x
> >>+# define soc_is_am43xx()		of_machine_is_compatible("ti,am43")
> >>+# define soc_is_am437x()		of_machine_is_compatible("ti,am4372")
> >>+# define soc_is_am438x()		of_machine_is_compatible("ti,am438x")
> >>  #endif
> >
> >Hmm didn't I already comment on this change? I don't want to do it
> >for one SoC. Please add the SoC detection the old way for am43xx,
> >then do another series that changes all the DT only SoCs to use
> >of_machine_is_compatible() after it's been properly tested so now
> >regressions are caused for the early init code.
> 
> Okay. I misinterpreted your earlier comment. Thanks for clarifying.
> I will re-do.

Actually, can you please do the following patches first while at it:

1.  Change dra7 SoC detection to intialize soc_name and soc_rev
    registers based on the of_machine_is_compatible so we don't
    do pointless string comparisons with the current code

2. Add am437x detection the same way

3. Change all the existing DT only SoCs to do the same (this
   can be done in a separate series)

That should allow us to drop most of the SoC detection code.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keerthy Aug. 13, 2015, 6:59 a.m. UTC | #4
On Wednesday 12 August 2015 02:07 PM, Tony Lindgren wrote:
> * Keerthy <a0393675@ti.com> [150811 10:57]:
>>
>>
>> On Tuesday 11 August 2015 06:25 PM, Tony Lindgren wrote:
>>> * Keerthy <j-keerthy@ti.com> [150810 02:31]:
>>>> @@ -371,8 +372,10 @@ IS_OMAP_TYPE(3430, 0x3430)
>>>>   #ifdef	CONFIG_SOC_AM43XX
>>>>   # undef soc_is_am43xx
>>>>   # undef soc_is_am437x
>>>> -# define soc_is_am43xx()		is_am43xx()
>>>> -# define soc_is_am437x()		is_am437x()
>>>> +# undef soc_is_am438x
>>>> +# define soc_is_am43xx()		of_machine_is_compatible("ti,am43")
>>>> +# define soc_is_am437x()		of_machine_is_compatible("ti,am4372")
>>>> +# define soc_is_am438x()		of_machine_is_compatible("ti,am438x")
>>>>   #endif
>>>
>>> Hmm didn't I already comment on this change? I don't want to do it
>>> for one SoC. Please add the SoC detection the old way for am43xx,
>>> then do another series that changes all the DT only SoCs to use
>>> of_machine_is_compatible() after it's been properly tested so now
>>> regressions are caused for the early init code.
>>
>> Okay. I misinterpreted your earlier comment. Thanks for clarifying.
>> I will re-do.
>
> Actually, can you please do the following patches first while at it:
>
> 1.  Change dra7 SoC detection to intialize soc_name and soc_rev
>      registers based on the of_machine_is_compatible so we don't
>      do pointless string comparisons with the current code
>
> 2. Add am437x detection the same way
>
> 3. Change all the existing DT only SoCs to do the same (this
>     can be done in a separate series)
>
> That should allow us to drop most of the SoC detection code.

Alright. I will post only the clock dts patch and the driver patches for 
now.

I will work on 1,2 and 3 in order.

Thanks Tony for your feedback.

-Keerthy
>
> Regards,
>
> Tony
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keerthy Aug. 13, 2015, 9:04 a.m. UTC | #5
On Wednesday 12 August 2015 02:07 PM, Tony Lindgren wrote:
> * Keerthy <a0393675@ti.com> [150811 10:57]:
>>
>>
>> On Tuesday 11 August 2015 06:25 PM, Tony Lindgren wrote:
>>> * Keerthy <j-keerthy@ti.com> [150810 02:31]:
>>>> @@ -371,8 +372,10 @@ IS_OMAP_TYPE(3430, 0x3430)
>>>>   #ifdef	CONFIG_SOC_AM43XX
>>>>   # undef soc_is_am43xx
>>>>   # undef soc_is_am437x
>>>> -# define soc_is_am43xx()		is_am43xx()
>>>> -# define soc_is_am437x()		is_am437x()
>>>> +# undef soc_is_am438x
>>>> +# define soc_is_am43xx()		of_machine_is_compatible("ti,am43")
>>>> +# define soc_is_am437x()		of_machine_is_compatible("ti,am4372")
>>>> +# define soc_is_am438x()		of_machine_is_compatible("ti,am438x")
>>>>   #endif
>>>
>>> Hmm didn't I already comment on this change? I don't want to do it
>>> for one SoC. Please add the SoC detection the old way for am43xx,
>>> then do another series that changes all the DT only SoCs to use
>>> of_machine_is_compatible() after it's been properly tested so now
>>> regressions are caused for the early init code.
>>
>> Okay. I misinterpreted your earlier comment. Thanks for clarifying.
>> I will re-do.
>
> Actually, can you please do the following patches first while at it:
>
> 1.  Change dra7 SoC detection to intialize soc_name and soc_rev
>      registers based on the of_machine_is_compatible so we don't
>      do pointless string comparisons with the current code

Tony,

just another confirmation. So the intent here is to directly do
of_machine_is_compatible checks instead if soc_is_dra* and try to remove 
soc_is calls from mach-omap2 code right?

-Keerthy
>
> 2. Add am437x detection the same way
>
> 3. Change all the existing DT only SoCs to do the same (this
>     can be done in a separate series)
>
> That should allow us to drop most of the SoC detection code.
>
> Regards,
>
> Tony
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren Aug. 13, 2015, 9:59 a.m. UTC | #6
* Keerthy <a0393675@ti.com> [150813 02:08]:
> 
> 
> On Wednesday 12 August 2015 02:07 PM, Tony Lindgren wrote:
> >* Keerthy <a0393675@ti.com> [150811 10:57]:
> >>
> >>
> >>On Tuesday 11 August 2015 06:25 PM, Tony Lindgren wrote:
> >>>* Keerthy <j-keerthy@ti.com> [150810 02:31]:
> >>>>@@ -371,8 +372,10 @@ IS_OMAP_TYPE(3430, 0x3430)
> >>>>  #ifdef	CONFIG_SOC_AM43XX
> >>>>  # undef soc_is_am43xx
> >>>>  # undef soc_is_am437x
> >>>>-# define soc_is_am43xx()		is_am43xx()
> >>>>-# define soc_is_am437x()		is_am437x()
> >>>>+# undef soc_is_am438x
> >>>>+# define soc_is_am43xx()		of_machine_is_compatible("ti,am43")
> >>>>+# define soc_is_am437x()		of_machine_is_compatible("ti,am4372")
> >>>>+# define soc_is_am438x()		of_machine_is_compatible("ti,am438x")
> >>>>  #endif
> >>>
> >>>Hmm didn't I already comment on this change? I don't want to do it
> >>>for one SoC. Please add the SoC detection the old way for am43xx,
> >>>then do another series that changes all the DT only SoCs to use
> >>>of_machine_is_compatible() after it's been properly tested so now
> >>>regressions are caused for the early init code.
> >>
> >>Okay. I misinterpreted your earlier comment. Thanks for clarifying.
> >>I will re-do.
> >
> >Actually, can you please do the following patches first while at it:
> >
> >1.  Change dra7 SoC detection to intialize soc_name and soc_rev
> >     registers based on the of_machine_is_compatible so we don't
> >     do pointless string comparisons with the current code
> 
> just another confirmation. So the intent here is to directly do
> of_machine_is_compatible checks instead if soc_is_dra* and try to remove
> soc_is calls from mach-omap2 code right?

Only do of_machine_is_compatible check once to initialize
the necessary variables for soc_is_* to use. 

Rgarads,

Tony
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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/Documentation/devicetree/bindings/arm/omap/omap.txt b/Documentation/devicetree/bindings/arm/omap/omap.txt
index 9f4e513..4269c13 100644
--- a/Documentation/devicetree/bindings/arm/omap/omap.txt
+++ b/Documentation/devicetree/bindings/arm/omap/omap.txt
@@ -100,6 +100,9 @@  SoCs:
 - AM4372
   compatible = "ti,am4372", "ti,am43"
 
+- AM438x
+  compatible = "ti,am438x", "ti,am43"
+
 Boards:
 
 - OMAP3 BeagleBoard : Low cost community board
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 34ff14b..3d70d6a 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -266,6 +266,7 @@  MACHINE_END
 #ifdef CONFIG_SOC_AM43XX
 static const char *const am43_boards_compat[] __initconst = {
 	"ti,am4372",
+	"ti,am438x",
 	"ti,am43",
 	NULL,
 };
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index e3f713f..1bab9f5 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -228,6 +228,8 @@  static void __init omap3_cpuinfo(void)
 		cpu_name =  "AM335X";
 	} else if (soc_is_am437x()) {
 		cpu_name =  "AM437x";
+	} else if (soc_is_am438x()) {
+		cpu_name =  "AM438X";
 	} else if (cpu_is_ti814x()) {
 		cpu_name = "TI814X";
 	} else if (omap3_has_iva() && omap3_has_sgx()) {
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index f97654d..feb27fd 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -238,6 +238,7 @@  IS_AM_SUBCLASS(437x, 0x437)
 #define soc_is_am335x()			0
 #define soc_is_am43xx()			0
 #define soc_is_am437x()			0
+#define soc_is_am438x()			0
 #define cpu_is_omap44xx()		0
 #define cpu_is_omap443x()		0
 #define cpu_is_omap446x()		0
@@ -371,8 +372,10 @@  IS_OMAP_TYPE(3430, 0x3430)
 #ifdef	CONFIG_SOC_AM43XX
 # undef soc_is_am43xx
 # undef soc_is_am437x
-# define soc_is_am43xx()		is_am43xx()
-# define soc_is_am437x()		is_am437x()
+# undef soc_is_am438x
+# define soc_is_am43xx()		of_machine_is_compatible("ti,am43")
+# define soc_is_am437x()		of_machine_is_compatible("ti,am4372")
+# define soc_is_am438x()		of_machine_is_compatible("ti,am438x")
 #endif
 
 # if defined(CONFIG_ARCH_OMAP4)