public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] imx: mx27 implement get_cpu_rev
@ 2015-08-12  9:40 Peng Fan
  2015-08-12 15:50 ` Stefano Babic
  0 siblings, 1 reply; 3+ messages in thread
From: Peng Fan @ 2015-08-12  9:40 UTC (permalink / raw)
  To: u-boot

Write a function named get_cpu_rev to make it support
runtime checking using "is_cpu_type(MXC_CPU_xx)".

Also introduce a macro MXC_CPU_MX27 with value 0x27.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
---

Note:
 Based on https://patchwork.ozlabs.org/patch/505618/ to support runtime
 check patch.

 arch/arm/cpu/arm926ejs/mx27/generic.c | 6 ++++++
 arch/arm/include/asm/arch-imx/cpu.h   | 1 +
 2 files changed, 7 insertions(+)

diff --git a/arch/arm/cpu/arm926ejs/mx27/generic.c b/arch/arm/cpu/arm926ejs/mx27/generic.c
index 5ee9f07..b713c84 100644
--- a/arch/arm/cpu/arm926ejs/mx27/generic.c
+++ b/arch/arm/cpu/arm926ejs/mx27/generic.c
@@ -12,6 +12,7 @@
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/gpio.h>
+#include <asm/imx-common/sys_proto.h>
 #ifdef CONFIG_MXC_MMC
 #include <asm/arch/mxcmmc.h>
 #endif
@@ -159,6 +160,11 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
 }
 
 
+u32 get_cpu_rev(void)
+{
+	return MXC_CPU_MX27 << 12;
+}
+
 #if defined(CONFIG_DISPLAY_CPUINFO)
 int print_cpuinfo (void)
 {
diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h
index 71208aa..be13b96 100644
--- a/arch/arm/include/asm/arch-imx/cpu.h
+++ b/arch/arm/include/asm/arch-imx/cpu.h
@@ -6,6 +6,7 @@
 
 #define MXC_CPU_MX23		0x23
 #define MXC_CPU_MX25		0x25
+#define MXC_CPU_MX27		0x27
 #define MXC_CPU_MX28		0x28
 #define MXC_CPU_MX31		0x31
 #define MXC_CPU_MX35		0x35
-- 
1.8.4

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

end of thread, other threads:[~2015-08-13  0:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-12  9:40 [U-Boot] [PATCH] imx: mx27 implement get_cpu_rev Peng Fan
2015-08-12 15:50 ` Stefano Babic
2015-08-13  0:24   ` Peng Fan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox