All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 1/8] imx: mx6 correct is_soc_rev usage
@ 2015-06-11 10:30 Peng Fan
  2015-06-11 10:30 ` [U-Boot] [PATCH v2 2/8] imx: mx6 correct get_cpu_rev Peng Fan
                   ` (7 more replies)
  0 siblings, 8 replies; 24+ messages in thread
From: Peng Fan @ 2015-06-11 10:30 UTC (permalink / raw)
  To: u-boot

is_soc_rev should return a bool value, so use "==", but not "-",
change (is_soc_rev(CHIP_REV_1_0) > 0) to (soc_rev() > CHIP_REV_1_0).
This patch also add space between "&" for cpu_type(rev) macro.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
---

Changes v2:
 new patch

 arch/arm/imx-common/timer.c               | 4 ++--
 arch/arm/include/asm/arch-mx6/sys_proto.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/imx-common/timer.c b/arch/arm/imx-common/timer.c
index e522990..c12556a 100644
--- a/arch/arm/imx-common/timer.c
+++ b/arch/arm/imx-common/timer.c
@@ -44,8 +44,8 @@ static inline int gpt_has_clk_source_osc(void)
 {
 #if defined(CONFIG_MX6)
 	if (((is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D)) &&
-	     (is_soc_rev(CHIP_REV_1_0) > 0)) || is_cpu_type(MXC_CPU_MX6DL) ||
-	      is_cpu_type(MXC_CPU_MX6SOLO) || is_cpu_type(MXC_CPU_MX6SX))
+	    (soc_rev() > CHIP_REV_1_0)) || is_cpu_type(MXC_CPU_MX6DL) ||
+	     is_cpu_type(MXC_CPU_MX6SOLO) || is_cpu_type(MXC_CPU_MX6SX))
 		return 1;
 
 	return 0;
diff --git a/arch/arm/include/asm/arch-mx6/sys_proto.h b/arch/arm/include/asm/arch-mx6/sys_proto.h
index c583291..9756708 100644
--- a/arch/arm/include/asm/arch-mx6/sys_proto.h
+++ b/arch/arm/include/asm/arch-mx6/sys_proto.h
@@ -12,7 +12,7 @@
 #include "../arch-imx/cpu.h"
 
 #define soc_rev() (get_cpu_rev() & 0xFF)
-#define is_soc_rev(rev)        (soc_rev() - rev)
+#define is_soc_rev(rev) (soc_rev() == rev)
 
 u32 get_nr_cpus(void);
 u32 get_cpu_rev(void);
@@ -20,7 +20,7 @@ u32 get_cpu_speed_grade_hz(void);
 u32 get_cpu_temp_grade(int *minc, int *maxc);
 
 /* returns MXC_CPU_ value */
-#define cpu_type(rev) (((rev) >> 12)&0xff)
+#define cpu_type(rev) (((rev) >> 12) & 0xff)
 
 /* both macros return/take MXC_CPU_ constants */
 #define get_cpu_type()	(cpu_type(get_cpu_rev()))
-- 
1.8.4

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

end of thread, other threads:[~2015-06-29 12:26 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-11 10:30 [U-Boot] [PATCH v2 1/8] imx: mx6 correct is_soc_rev usage Peng Fan
2015-06-11 10:30 ` [U-Boot] [PATCH v2 2/8] imx: mx6 correct get_cpu_rev Peng Fan
2015-06-27 16:22   ` Stefano Babic
2015-06-11 10:30 ` [U-Boot] [PATCH v2 3/8] imx: mx6 introuduce macro is_mx6dqp Peng Fan
2015-06-27 16:22   ` Stefano Babic
2015-06-11 10:30 ` [U-Boot] [PATCH v2 4/8] imx: mx6: ccm: Change the clock settings for i.MX6QP Peng Fan
2015-06-27 16:44   ` Stefano Babic
2015-06-29  1:50     ` Peng Fan
2015-06-11 10:30 ` [U-Boot] [PATCH v2 5/8] imx: mx6: hab : Remove the cache issue workaroud in hab " Peng Fan
2015-06-11 10:30 ` [U-Boot] [PATCH v2 6/8] imx: mx6qp Enable PRG clock and AQoS setting for IPU Peng Fan
2015-06-27 17:04   ` Stefano Babic
2015-06-27 21:10   ` Fabio Estevam
2015-06-11 10:30 ` [U-Boot] [PATCH v2 7/8] imx: mx6qpsabreauto: Add MX6QP SABREAUTO CPU3 board support Peng Fan
2015-06-27 17:08   ` Stefano Babic
2015-06-29  2:05     ` Peng Fan
2015-06-29  7:26       ` Stefano Babic
2015-06-29  8:06         ` Peng Fan
2015-06-29  8:19           ` Stefano Babic
2015-06-29 12:02           ` Fabio Estevam
2015-06-29 12:26             ` Peng Fan
2015-06-27 17:11   ` Fabio Estevam
2015-06-11 10:30 ` [U-Boot] [PATCH v2 8/8] imx: mx6qp: Adjust AQos settings for peripherals Peng Fan
2015-06-27 17:09   ` Stefano Babic
2015-06-27 16:17 ` [U-Boot] [PATCH v2 1/8] imx: mx6 correct is_soc_rev usage Stefano Babic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.