Re: [PATCH v3] ARM: OMAP: Change all cpu_is_* occurences to soc_is_*

2015-10-20 Thread Tony Lindgren
* Keerthy  [151018 21:44]:
> On Friday 16 October 2015 11:18 PM, Tony Lindgren wrote:
> >
> >I decided to rework the earlier patches by Keerthy 
> >to keep changes down to minimum to avoid potential errors and stick
> >to just search and replace.
> >
> 
> Compile tested individual SoC Configs and boot tested on: AM437x-gp-evm,
> am335x-bone, dra72-evm and dra7-evm.
> 
> Tested-by: Keerthy 

Thanks for testing! FYI, I already pulle Felipe's timer changes on
top of it so I missed your Tested-by.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3] ARM: OMAP: Change all cpu_is_* occurences to soc_is_*

2015-10-18 Thread Keerthy

Hi Tony,

On Friday 16 October 2015 11:18 PM, Tony Lindgren wrote:

Hi,

* Keerthy  [151013 22:47]:

--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -155,6 +155,13 @@ static inline int soc_is_omap(void)
   * cpu_is_omap443x(): True for OMAP4430
   * cpu_is_omap446x(): True for OMAP4460
   * cpu_is_omap447x(): True for OMAP4470
+ * soc_is_omap24xx():  True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
+ * soc_is_omap242x():  True for OMAP2420, OMAP2422, OMAP2423
+ * soc_is_omap243x():  True for OMAP2430
+ * soc_is_omap343x():  True for OMAP3430
+ * soc_is_omap443x():  True for OMAP4430
+ * soc_is_omap446x():  True for OMAP4460
+ * soc_is_omap447x():  True for OMAP4470
   * soc_is_omap543x(): True for OMAP5430, OMAP5432
   */
  #define GET_OMAP_CLASS(omap_rev() & 0xff)


We don't want cpu_is stuff mixed into soc.h at all..


@@ -227,12 +234,24 @@ IS_AM_SUBCLASS(437x, 0x437)

  #define cpu_is_omap24xx() 0
  #define cpu_is_omap242x() 0
+#define cpu_is_omap2420()   0
  #define cpu_is_omap243x() 0
+#define cpu_is_omap2430()   0
  #define cpu_is_omap34xx() 0
  #define cpu_is_omap343x() 0
+#define cpu_is_omap3430()  0
+#define cpu_is_omap3630()  0
  #define cpu_is_ti81xx()   0
  #define cpu_is_ti816x()   0
  #define cpu_is_ti814x()   0
+#define soc_is_omap24xx()  0
+#define soc_is_omap242x()  0
+#define soc_is_omap243x()  0
+#define soc_is_omap34xx()  0
+#define soc_is_omap343x()  0
+#define soc_is_ti81xx()0
+#define soc_is_ti816x()0
+#define soc_is_ti814x()0
  #define soc_is_am35xx()   0
  #define soc_is_am33xx()   0
  #define soc_is_am335x()   0


Here too..


@@ -250,54 +273,74 @@ IS_AM_SUBCLASS(437x, 0x437)

  #if defined(MULTI_OMAP2)
  # if defined(CONFIG_ARCH_OMAP2)
+#  undef  soc_is_omap24xx
+#  define soc_is_omap24xx()is_omap24xx()
  #  undef  cpu_is_omap24xx
-#  define cpu_is_omap24xx()is_omap24xx()
+#  define cpu_is_omap24xx  soc_is_omap24xx
  # endif
  # if defined (CONFIG_SOC_OMAP2420)
+#  undef  soc_is_omap242x
+#  define soc_is_omap242x()is_omap242x()
  #  undef  cpu_is_omap242x
-#  define cpu_is_omap242x()is_omap242x()
+#  define cpu_is_omap242x  soc_is_omap242x
  # endif
  # if defined (CONFIG_SOC_OMAP2430)
+#  undef  soc_is_omap243x
+#  define soc_is_omap243x()is_omap243x()
  #  undef  cpu_is_omap243x
-#  define cpu_is_omap243x()is_omap243x()
+#  define cpu_is_omap243x  soc_is_omap243x
  # endif

...

And so on. And these changes should be kept to minimum, so..

I decided to redo the soc.h changes first with minimal search and replace
to cut down on any chance of errors. And then just added the legacy defines
for cpu_is at the end of the file for the ones that are still in use.

After some testing I'll apply just your id.c related changes on top of
the patch below :)

Regards,

Tony

8< ---
From: Tony Lindgren 
Date: Fri, 16 Oct 2015 10:08:45 -0700
Subject: [PATCH] ARM: OMAP2+: Rename cpu_is macros to soc_is

The naming for the cpu_is macros is confusing as the CPU is separate
and within the SoC. Let's rename all the macros to soc_is, and let's
define cpu_is also for the ones still in use. Then we can just remove
the cpu_is macros once the users are fixed up.

To keep the chances of breaking anything, the changes were
generated with the following regular expressions:

s/cpu_is/soc_is/g
s/CPU/SoC/g

Then the list of existing cpu_is users was generated with:

$ $ grep -o -e 'cpu_is_.\+()' arch/arm/mach-omap2/*.[chS] | \
cut -d: -f2 | sort | uniq

And added to the end of the soc.h.

I decided to rework the earlier patches by Keerthy 
to keep changes down to minimum to avoid potential errors and stick
to just search and replace.



Compile tested individual SoC Configs and boot tested on: AM437x-gp-evm,
am335x-bone, dra72-evm and dra7-evm.

Tested-by: Keerthy 


Signed-off-by: Tony Lindgren 

--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -129,9 +129,9 @@ int omap_type(void);

  /*
   * omap_rev bits:
- * CPU id bits (0730, 1510, 1710, 2422...) [31:16]
- * CPU revision(See _REV_ defined in cpu.h)[15:08]
- * CPU class bits (15xx, 16xx, 24xx, 34xx...)  [07:00]
+ * SoC id bits (0730, 1510, 1710, 2422...) [31:16]
+ * SoC revision(See _REV_ defined in cpu.h)[15:08]
+ * SoC class bits (15xx, 16xx, 24xx, 34xx...)  [07:00]
   */
  unsigned int omap_rev(void);

@@ -141,20 +141,20 @@ static inline int soc_is_omap(void)
  }

  /*
- * Get the CPU revision for OMAP 

Re: [PATCH v3] ARM: OMAP: Change all cpu_is_* occurences to soc_is_*

2015-10-16 Thread Tony Lindgren
Hi,

* Keerthy  [151013 22:47]:
> --- a/arch/arm/mach-omap2/soc.h
> +++ b/arch/arm/mach-omap2/soc.h
> @@ -155,6 +155,13 @@ static inline int soc_is_omap(void)
>   * cpu_is_omap443x():True for OMAP4430
>   * cpu_is_omap446x():True for OMAP4460
>   * cpu_is_omap447x():True for OMAP4470
> + * soc_is_omap24xx():True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
> + * soc_is_omap242x():True for OMAP2420, OMAP2422, OMAP2423
> + * soc_is_omap243x():True for OMAP2430
> + * soc_is_omap343x():True for OMAP3430
> + * soc_is_omap443x():True for OMAP4430
> + * soc_is_omap446x():True for OMAP4460
> + * soc_is_omap447x():True for OMAP4470
>   * soc_is_omap543x():True for OMAP5430, OMAP5432
>   */
>  #define GET_OMAP_CLASS   (omap_rev() & 0xff)

We don't want cpu_is stuff mixed into soc.h at all..

> @@ -227,12 +234,24 @@ IS_AM_SUBCLASS(437x, 0x437)
>  
>  #define cpu_is_omap24xx()0
>  #define cpu_is_omap242x()0
> +#define cpu_is_omap2420()   0
>  #define cpu_is_omap243x()0
> +#define cpu_is_omap2430()   0
>  #define cpu_is_omap34xx()0
>  #define cpu_is_omap343x()0
> +#define cpu_is_omap3430()0
> +#define cpu_is_omap3630()0
>  #define cpu_is_ti81xx()  0
>  #define cpu_is_ti816x()  0
>  #define cpu_is_ti814x()  0
> +#define soc_is_omap24xx()0
> +#define soc_is_omap242x()0
> +#define soc_is_omap243x()0
> +#define soc_is_omap34xx()0
> +#define soc_is_omap343x()0
> +#define soc_is_ti81xx()  0
> +#define soc_is_ti816x()  0
> +#define soc_is_ti814x()  0
>  #define soc_is_am35xx()  0
>  #define soc_is_am33xx()  0
>  #define soc_is_am335x()  0

Here too..

> @@ -250,54 +273,74 @@ IS_AM_SUBCLASS(437x, 0x437)
>  
>  #if defined(MULTI_OMAP2)
>  # if defined(CONFIG_ARCH_OMAP2)
> +#  undef  soc_is_omap24xx
> +#  define soc_is_omap24xx()  is_omap24xx()
>  #  undef  cpu_is_omap24xx
> -#  define cpu_is_omap24xx()  is_omap24xx()
> +#  define cpu_is_omap24xxsoc_is_omap24xx
>  # endif
>  # if defined (CONFIG_SOC_OMAP2420)
> +#  undef  soc_is_omap242x
> +#  define soc_is_omap242x()  is_omap242x()
>  #  undef  cpu_is_omap242x
> -#  define cpu_is_omap242x()  is_omap242x()
> +#  define cpu_is_omap242xsoc_is_omap242x
>  # endif
>  # if defined (CONFIG_SOC_OMAP2430)
> +#  undef  soc_is_omap243x
> +#  define soc_is_omap243x()  is_omap243x()
>  #  undef  cpu_is_omap243x
> -#  define cpu_is_omap243x()  is_omap243x()
> +#  define cpu_is_omap243xsoc_is_omap243x
>  # endif
...

And so on. And these changes should be kept to minimum, so..

I decided to redo the soc.h changes first with minimal search and replace
to cut down on any chance of errors. And then just added the legacy defines
for cpu_is at the end of the file for the ones that are still in use.

After some testing I'll apply just your id.c related changes on top of
the patch below :)

Regards,

Tony

8< ---
From: Tony Lindgren 
Date: Fri, 16 Oct 2015 10:08:45 -0700
Subject: [PATCH] ARM: OMAP2+: Rename cpu_is macros to soc_is

The naming for the cpu_is macros is confusing as the CPU is separate
and within the SoC. Let's rename all the macros to soc_is, and let's
define cpu_is also for the ones still in use. Then we can just remove
the cpu_is macros once the users are fixed up.

To keep the chances of breaking anything, the changes were
generated with the following regular expressions:

s/cpu_is/soc_is/g
s/CPU/SoC/g

Then the list of existing cpu_is users was generated with:

$ $ grep -o -e 'cpu_is_.\+()' arch/arm/mach-omap2/*.[chS] | \
cut -d: -f2 | sort | uniq

And added to the end of the soc.h.

I decided to rework the earlier patches by Keerthy 
to keep changes down to minimum to avoid potential errors and stick
to just search and replace.

Signed-off-by: Tony Lindgren 

--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -129,9 +129,9 @@ int omap_type(void);
 
 /*
  * omap_rev bits:
- * CPU id bits (0730, 1510, 1710, 2422...) [31:16]
- * CPU revision(See _REV_ defined in cpu.h)[15:08]
- * CPU class bits (15xx, 16xx, 24xx, 34xx...)  [07:00]
+ * SoC id bits (0730, 1510, 1710, 2422...) [31:16]
+ * SoC revision(See _REV_ defined in cpu.h)[15:08]
+ * SoC class bits (15xx, 16xx, 24xx, 34xx...)  [07:00]
  */
 unsigned int omap_rev(void);
 
@@ -141,20 +141,20 @@ static inline int soc_is_omap(void)
 }
 
 /*
- * Get the CPU revision for OMAP devices
+ * Get the SoC revision for OMAP devices
  */
 #define GET_OMAP_REVISION()((omap_rev() >> 8) & 

[PATCH v3] ARM: OMAP: Change all cpu_is_* occurences to soc_is_*

2015-10-13 Thread Keerthy
Currently apart from dra7, omap5 and amx3 all the other SoCs
are identified using cpu_is_* functions which is not right since
they are all SoCs(System on Chips). Hence changing the SoC
identification code to use soc_is instead of cpu_is and keeping
defines for cpu_is where needed. This allows us to replace the
rest of cpu_is usage along with other fixes as needed.

Acked-by: Russell King 
Signed-off-by: Keerthy 
---

Compile Testing:

** Compile tested individual: OMAP2, OMAP3, OMAP4, OMAP5, DRA7XX, AM437x,
   AM33XX defconfig.
** Ran Randconfig and found no errors under arch/arm/mach-omap2
   overnight testing.
   Source: https://github.com/felipebalbi/omap-seeds

Boot tested on: DRA7-EVM, AM437X-GP-EVM, AM335X-Beaglebone, OMAP3
Beagle-xm.

Changes in V3:

** Fixed individual defconfig, randconfig compilation errors.

 arch/arm/mach-omap2/id.c  |  30 
 arch/arm/mach-omap2/soc.h | 169 --
 2 files changed, 134 insertions(+), 65 deletions(-)

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 54a5ba5..8a2ae82 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -57,15 +57,15 @@ int omap_type(void)
if (val < OMAP2_DEVICETYPE_MASK)
return val;
 
-   if (cpu_is_omap24xx()) {
+   if (soc_is_omap24xx()) {
val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
-   } else if (cpu_is_ti81xx()) {
+   } else if (soc_is_ti81xx()) {
val = omap_ctrl_readl(TI81XX_CONTROL_STATUS);
} else if (soc_is_am33xx() || soc_is_am43xx()) {
val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
-   } else if (cpu_is_omap34xx()) {
+   } else if (soc_is_omap34xx()) {
val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
-   } else if (cpu_is_omap44xx()) {
+   } else if (soc_is_omap44xx()) {
val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
} else if (soc_is_omap54xx() || soc_is_dra7xx()) {
val = omap_ctrl_readl(OMAP5XXX_CONTROL_STATUS);
@@ -122,7 +122,7 @@ static u16 tap_prod_id;
 
 void omap_get_die_id(struct omap_die_id *odi)
 {
-   if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
+   if (soc_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_0);
odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_1);
odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_2);
@@ -218,17 +218,17 @@ static void __init omap3_cpuinfo(void)
 * on available features. Upon detection, update the CPU id
 * and CPU class bits.
 */
-   if (cpu_is_omap3630()) {
+   if (soc_is_omap3630()) {
cpu_name = "OMAP3630";
} else if (soc_is_am35xx()) {
cpu_name = (omap3_has_sgx()) ? "AM3517" : "AM3505";
-   } else if (cpu_is_ti816x()) {
+   } else if (soc_is_ti816x()) {
cpu_name = "TI816X";
} else if (soc_is_am335x()) {
cpu_name =  "AM335X";
} else if (soc_is_am437x()) {
cpu_name =  "AM437x";
-   } else if (cpu_is_ti814x()) {
+   } else if (soc_is_ti814x()) {
cpu_name = "TI814X";
} else if (omap3_has_iva() && omap3_has_sgx()) {
/* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
@@ -275,11 +275,11 @@ void __init omap3xxx_check_features(void)
OMAP3_CHECK_FEATURE(status, SGX);
OMAP3_CHECK_FEATURE(status, NEON);
OMAP3_CHECK_FEATURE(status, ISP);
-   if (cpu_is_omap3630())
+   if (soc_is_omap3630())
omap_features |= OMAP3_HAS_192MHZ_CLK;
-   if (cpu_is_omap3430() || cpu_is_omap3630())
+   if (soc_is_omap3430() || soc_is_omap3630())
omap_features |= OMAP3_HAS_IO_WAKEUP;
-   if (cpu_is_omap3630() || omap_rev() == OMAP3430_REV_ES3_1 ||
+   if (soc_is_omap3630() || omap_rev() == OMAP3430_REV_ES3_1 ||
omap_rev() == OMAP3430_REV_ES3_1_2)
omap_features |= OMAP3_HAS_IO_CHAIN_CTRL;
 
@@ -701,7 +701,7 @@ void __init omap2_set_globals_tap(u32 class, void __iomem 
*tap)
tap_base = tap;
 
/* XXX What is this intended to do? */
-   if (cpu_is_omap34xx())
+   if (soc_is_omap34xx())
tap_prod_id = 0x0210;
else
tap_prod_id = 0x0208;
@@ -719,11 +719,11 @@ static const char * const omap_types[] = {
 
 static const char * __init omap_get_family(void)
 {
-   if (cpu_is_omap24xx())
+   if (soc_is_omap24xx())
return kasprintf(GFP_KERNEL, "OMAP2");
-   else if (cpu_is_omap34xx())
+   else if (soc_is_omap34xx())
return kasprintf(GFP_KERNEL, "OMAP3");
-   else if (cpu_is_omap44xx())
+   else if (soc_is_omap44xx())
return kasprintf(GFP_KERNEL, "OMAP4");
else if