Linux-Devicetree Archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM: OMAP2+: Optimize soc_is calls
@ 2015-09-07  7:05 Keerthy
       [not found] ` <1441609528-20344-1-git-send-email-j-keerthy-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Keerthy @ 2015-09-07  7:05 UTC (permalink / raw
  To: tony-4v6yS6AI5VpBDgjK7y7TUQ
  Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, j-keerthy-l0cyMroinI0

The series implements optimizing soc_is calls for DRA7 and AM43XX
family of SoCs. Originally the soc_is calls for DRA7 involved parsing
device tree nodes and some repetitive string comparisons. Optimizing
to store the result and use the result in the subsequent calls.

The series is boot tested on am437x-gp-evm, dra7-evm, dra72-evm.

Keerthy (3):
  ARM: OMAP2: DRA7: Modify optimize string comparisons in soc_is calls
  ARM: dts: AM43x-epos-evm: Add AM438x compatible string for epos
  ARM: OMAP2: AM43XX: Modify optimize string comparisons in soc_is calls

 .../devicetree/bindings/arm/omap/omap.txt          |  5 +++-
 arch/arm/boot/dts/am43x-epos-evm.dts               |  2 +-
 arch/arm/mach-omap2/id.c                           | 28 ++++++++++++++++++++++
 arch/arm/mach-omap2/soc.h                          | 25 +++++++++++++++----
 4 files changed, 53 insertions(+), 7 deletions(-)

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] ARM: OMAP2: DRA7: Modify optimize string comparisons in soc_is calls
       [not found] ` <1441609528-20344-1-git-send-email-j-keerthy-l0cyMroinI0@public.gmane.org>
@ 2015-09-07  7:05   ` Keerthy
  2015-09-07  7:05   ` [PATCH 2/3] ARM: dts: AM43x-epos-evm: Add AM438x compatible string for epos Keerthy
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Keerthy @ 2015-09-07  7:05 UTC (permalink / raw
  To: tony-4v6yS6AI5VpBDgjK7y7TUQ
  Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, j-keerthy-l0cyMroinI0

Currently everytime soc_is calls are made, firstly device tree nodes
are parsed and then string comparisons are made to determine the
soc version. Optimizing it to be done one time and store the result.
Use the stored value in all the subsequent checks for soc_is calls.

Signed-off-by: Keerthy <j-keerthy-l0cyMroinI0@public.gmane.org>
---
 arch/arm/mach-omap2/id.c  | 17 +++++++++++++++++
 arch/arm/mach-omap2/soc.h | 15 ++++++++++++---
 2 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index e3f713f..28acdb1 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -40,6 +40,7 @@
 #define OMAP_SOC_MAX_NAME_LENGTH		16
 
 static unsigned int omap_revision;
+static unsigned long soc_ids;
 static char soc_name[OMAP_SOC_MAX_NAME_LENGTH];
 static char soc_rev[OMAP_SOC_MAX_NAME_LENGTH];
 u32 omap_features;
@@ -50,6 +51,21 @@ unsigned int omap_rev(void)
 }
 EXPORT_SYMBOL(omap_rev);
 
+void init_dra_soc_id(void)
+{
+	if (of_machine_is_compatible("ti,dra7"))
+		soc_ids |= DRA7XX;
+	if (of_machine_is_compatible("ti,dra74"))
+		soc_ids |= DRA74X;
+	if (of_machine_is_compatible("ti,dra72"))
+		soc_ids |= DRA72X;
+}
+
+int check_soc_version(unsigned long id)
+{
+	return soc_ids & id;
+}
+
 int omap_type(void)
 {
 	static u32 val = OMAP2_DEVICETYPE_MASK;
@@ -643,6 +659,7 @@ void __init dra7xxx_check_revision(void)
 	u16 hawkeye;
 	u8 rev;
 
+	init_dra_soc_id();
 	idcode = read_tap_reg(OMAP_TAP_IDCODE);
 	hawkeye = (idcode >> 12) & 0xffff;
 	rev = (idcode >> 28) & 0xff;
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index f97654d..4b0a532 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -125,6 +125,15 @@
 #define OMAP2_DEVICE_TYPE_GP		3
 #define OMAP2_DEVICE_TYPE_BAD		4
 
+/*
+ * SoC types
+ */
+
+#define DRA7XX				BIT(0)
+#define	DRA74X				BIT(1)
+#define DRA72X				BIT(2)
+
+int check_soc_version(unsigned long id);
 int omap_type(void);
 
 /*
@@ -397,9 +406,9 @@ IS_OMAP_TYPE(3430, 0x3430)
 #undef soc_is_dra7xx
 #undef soc_is_dra74x
 #undef soc_is_dra72x
-#define soc_is_dra7xx()	(of_machine_is_compatible("ti,dra7"))
-#define soc_is_dra74x()	(of_machine_is_compatible("ti,dra74"))
-#define soc_is_dra72x()	(of_machine_is_compatible("ti,dra72"))
+#define soc_is_dra7xx()			check_soc_version(DRA7XX)
+#define soc_is_dra74x()			check_soc_version(DRA74X)
+#define soc_is_dra72x()			check_soc_version(DRA72X)
 #endif
 
 /* Various silicon revisions for omap2 */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ARM: dts: AM43x-epos-evm: Add AM438x compatible string for epos
       [not found] ` <1441609528-20344-1-git-send-email-j-keerthy-l0cyMroinI0@public.gmane.org>
  2015-09-07  7:05   ` [PATCH 1/3] ARM: OMAP2: DRA7: Modify optimize string comparisons in " Keerthy
@ 2015-09-07  7:05   ` Keerthy
  2015-09-07  7:05   ` [PATCH 3/3] ARM: OMAP2: AM43XX: Modify optimize string comparisons in soc_is calls Keerthy
  2015-09-14  8:54   ` [PATCH 0/3] ARM: OMAP2+: Optimize " Keerthy
  3 siblings, 0 replies; 5+ messages in thread
From: Keerthy @ 2015-09-07  7:05 UTC (permalink / raw
  To: tony-4v6yS6AI5VpBDgjK7y7TUQ
  Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, j-keerthy-l0cyMroinI0

Add AM438x compatible property to identify the SoCs on epos evms.

Signed-off-by: Keerthy <j-keerthy-l0cyMroinI0@public.gmane.org>
---
 Documentation/devicetree/bindings/arm/omap/omap.txt | 5 ++++-
 arch/arm/boot/dts/am43x-epos-evm.dts                | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/omap/omap.txt b/Documentation/devicetree/bindings/arm/omap/omap.txt
index 9f4e513..dc3b5f2 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
@@ -142,7 +145,7 @@ Boards:
   compatible = "ti,omap5-evm", "ti,omap5"
 
 - AM43x EPOS EVM
-  compatible = "ti,am43x-epos-evm", "ti,am4372", "ti,am43"
+  compatible = "ti,am43x-epos-evm", "ti,am438x", "ti,am43"
 
 - AM437x GP EVM
   compatible = "ti,am437x-gp-evm", "ti,am4372", "ti,am43"
diff --git a/arch/arm/boot/dts/am43x-epos-evm.dts b/arch/arm/boot/dts/am43x-epos-evm.dts
index 86c2dfb..1c9b9a0 100644
--- a/arch/arm/boot/dts/am43x-epos-evm.dts
+++ b/arch/arm/boot/dts/am43x-epos-evm.dts
@@ -18,7 +18,7 @@
 
 / {
 	model = "TI AM43x EPOS EVM";
-	compatible = "ti,am43x-epos-evm","ti,am4372","ti,am43";
+	compatible = "ti,am43x-epos-evm", "ti,am438x", "ti,am43";
 
 	aliases {
 		display0 = &lcd0;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] ARM: OMAP2: AM43XX: Modify optimize string comparisons in soc_is calls
       [not found] ` <1441609528-20344-1-git-send-email-j-keerthy-l0cyMroinI0@public.gmane.org>
  2015-09-07  7:05   ` [PATCH 1/3] ARM: OMAP2: DRA7: Modify optimize string comparisons in " Keerthy
  2015-09-07  7:05   ` [PATCH 2/3] ARM: dts: AM43x-epos-evm: Add AM438x compatible string for epos Keerthy
@ 2015-09-07  7:05   ` Keerthy
  2015-09-14  8:54   ` [PATCH 0/3] ARM: OMAP2+: Optimize " Keerthy
  3 siblings, 0 replies; 5+ messages in thread
From: Keerthy @ 2015-09-07  7:05 UTC (permalink / raw
  To: tony-4v6yS6AI5VpBDgjK7y7TUQ
  Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, j-keerthy-l0cyMroinI0

Currently everytime soc_is calls are made, firstly device tree nodes
are parsed and then string comparisons are made to determine the
soc version. Optimizing it to be done one time and store the result.
Use the stored value in all the subsequent checks for soc_is calls.

Signed-off-by: Keerthy <j-keerthy-l0cyMroinI0@public.gmane.org>
---
 arch/arm/mach-omap2/id.c  | 11 +++++++++++
 arch/arm/mach-omap2/soc.h | 10 ++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 28acdb1..3de8015 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -61,6 +61,16 @@ void init_dra_soc_id(void)
 		soc_ids |= DRA72X;
 }
 
+void init_am43_soc_id(void)
+{
+	if (of_machine_is_compatible("ti,am43"))
+		soc_ids |= AM43XX;
+	if (of_machine_is_compatible("ti,am4372"))
+		soc_ids |= AM437X;
+	if (of_machine_is_compatible("ti,am438x"))
+		soc_ids |= AM438X;
+}
+
 int check_soc_version(unsigned long id)
 {
 	return soc_ids & id;
@@ -357,6 +367,7 @@ void __init omap3xxx_check_revision(void)
 	u16 hawkeye;
 	u8 rev;
 
+	init_am43_soc_id();
 	/*
 	 * We cannot access revision registers on ES1.0.
 	 * If the processor type is Cortex-A8 and the revision is 0x0
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index 4b0a532..1c116e4 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -132,6 +132,9 @@
 #define DRA7XX				BIT(0)
 #define	DRA74X				BIT(1)
 #define DRA72X				BIT(2)
+#define AM43XX				BIT(3)
+#define AM437X				BIT(4)
+#define AM438X				BIT(5)
 
 int check_soc_version(unsigned long id);
 int omap_type(void);
@@ -247,6 +250,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
@@ -380,8 +384,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()		check_soc_version(AM43XX)
+# define soc_is_am437x()		check_soc_version(AM437X)
+# define soc_is_am438x()		check_soc_version(AM438X)
 #endif
 
 # if defined(CONFIG_ARCH_OMAP4)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] ARM: OMAP2+: Optimize soc_is calls
       [not found] ` <1441609528-20344-1-git-send-email-j-keerthy-l0cyMroinI0@public.gmane.org>
                     ` (2 preceding siblings ...)
  2015-09-07  7:05   ` [PATCH 3/3] ARM: OMAP2: AM43XX: Modify optimize string comparisons in soc_is calls Keerthy
@ 2015-09-14  8:54   ` Keerthy
  3 siblings, 0 replies; 5+ messages in thread
From: Keerthy @ 2015-09-14  8:54 UTC (permalink / raw
  To: Keerthy, tony-4v6yS6AI5VpBDgjK7y7TUQ
  Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA

Hi Tony,

On Monday 07 September 2015 12:35 PM, Keerthy wrote:
> The series implements optimizing soc_is calls for DRA7 and AM43XX
> family of SoCs. Originally the soc_is calls for DRA7 involved parsing
> device tree nodes and some repetitive string comparisons. Optimizing
> to store the result and use the result in the subsequent calls.
>
> The series is boot tested on am437x-gp-evm, dra7-evm, dra72-evm.


A gentle ping on this series. This series would be good to include rtc 
hwmods selectively for non-epos evms. Let me know if you have any 
comments on this.

-Keerthy

>
> Keerthy (3):
>    ARM: OMAP2: DRA7: Modify optimize string comparisons in soc_is calls
>    ARM: dts: AM43x-epos-evm: Add AM438x compatible string for epos
>    ARM: OMAP2: AM43XX: Modify optimize string comparisons in soc_is calls
>
>   .../devicetree/bindings/arm/omap/omap.txt          |  5 +++-
>   arch/arm/boot/dts/am43x-epos-evm.dts               |  2 +-
>   arch/arm/mach-omap2/id.c                           | 28 ++++++++++++++++++++++
>   arch/arm/mach-omap2/soc.h                          | 25 +++++++++++++++----
>   4 files changed, 53 insertions(+), 7 deletions(-)
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-14  8:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-07  7:05 [PATCH 0/3] ARM: OMAP2+: Optimize soc_is calls Keerthy
     [not found] ` <1441609528-20344-1-git-send-email-j-keerthy-l0cyMroinI0@public.gmane.org>
2015-09-07  7:05   ` [PATCH 1/3] ARM: OMAP2: DRA7: Modify optimize string comparisons in " Keerthy
2015-09-07  7:05   ` [PATCH 2/3] ARM: dts: AM43x-epos-evm: Add AM438x compatible string for epos Keerthy
2015-09-07  7:05   ` [PATCH 3/3] ARM: OMAP2: AM43XX: Modify optimize string comparisons in soc_is calls Keerthy
2015-09-14  8:54   ` [PATCH 0/3] ARM: OMAP2+: Optimize " Keerthy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).