All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V2] imx: vf610 add get_cpu_rev
@ 2015-09-01  9:15 Peng Fan
  2015-09-01 14:35 ` Stefano Babic
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Fan @ 2015-09-01  9:15 UTC (permalink / raw
  To: u-boot

Since we need to support runtime check for different drivers, we need
to add get_cpu_rev for vf610, otherwise there will be build errors.

This patch introduces a dummy CPU id which is not read from chip
silicon. Later when we can get the real id from chip, can fix the
value of MXC_CPU_VF610 then.

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

Changes v2:
 Take suggestion from Stefano, get_cpu_rev for vf610 should return an 
 ID saying dummy ID, but not 0.

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

diff --git a/arch/arm/cpu/armv7/vf610/generic.c b/arch/arm/cpu/armv7/vf610/generic.c
index 05c401d..08b9ef4 100644
--- a/arch/arm/cpu/armv7/vf610/generic.c
+++ b/arch/arm/cpu/armv7/vf610/generic.c
@@ -9,6 +9,7 @@
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/crm_regs.h>
+#include <asm/imx-common/sys_proto.h>
 #include <netdev.h>
 #ifdef CONFIG_FSL_ESDHC
 #include <fsl_esdhc.h>
@@ -266,6 +267,11 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
 }
 #endif
 
+u32 get_cpu_rev(void)
+{
+	return MXC_CPU_VF610 << 12;
+}
+
 #if defined(CONFIG_DISPLAY_CPUINFO)
 static char *get_reset_cause(void)
 {
diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h
index be13b96..1c8d24e 100644
--- a/arch/arm/include/asm/arch-imx/cpu.h
+++ b/arch/arm/include/asm/arch-imx/cpu.h
@@ -21,6 +21,7 @@
 #define MXC_CPU_MX6D		0x67
 #define MXC_CPU_MX6DP		0x68
 #define MXC_CPU_MX6QP		0x69
+#define MXC_CPU_VF610		0xF6 /* dummy ID */
 
 #define CS0_128					0
 #define CS0_64M_CS1_64M				1
-- 
1.8.4

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

* [U-Boot] [PATCH V2] imx: vf610 add get_cpu_rev
  2015-09-01  9:15 [U-Boot] [PATCH V2] imx: vf610 add get_cpu_rev Peng Fan
@ 2015-09-01 14:35 ` Stefano Babic
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Babic @ 2015-09-01 14:35 UTC (permalink / raw
  To: u-boot

Hi Peng,

On 01/09/2015 11:15, Peng Fan wrote:
> Since we need to support runtime check for different drivers, we need
> to add get_cpu_rev for vf610, otherwise there will be build errors.
> 
> This patch introduces a dummy CPU id which is not read from chip
> silicon. Later when we can get the real id from chip, can fix the
> value of MXC_CPU_VF610 then.
> 
> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
> Suggested-by: Stefano Babic <sbabic@denx.de>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
> 
> Changes v2:
>  Take suggestion from Stefano, get_cpu_rev for vf610 should return an 
>  ID saying dummy ID, but not 0.
> 
>  arch/arm/cpu/armv7/vf610/generic.c  | 6 ++++++
>  arch/arm/include/asm/arch-imx/cpu.h | 1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/arch/arm/cpu/armv7/vf610/generic.c b/arch/arm/cpu/armv7/vf610/generic.c
> index 05c401d..08b9ef4 100644
> --- a/arch/arm/cpu/armv7/vf610/generic.c
> +++ b/arch/arm/cpu/armv7/vf610/generic.c
> @@ -9,6 +9,7 @@
>  #include <asm/arch/imx-regs.h>
>  #include <asm/arch/clock.h>
>  #include <asm/arch/crm_regs.h>
> +#include <asm/imx-common/sys_proto.h>
>  #include <netdev.h>
>  #ifdef CONFIG_FSL_ESDHC
>  #include <fsl_esdhc.h>
> @@ -266,6 +267,11 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
>  }
>  #endif
>  
> +u32 get_cpu_rev(void)
> +{
> +	return MXC_CPU_VF610 << 12;
> +}
> +
>  #if defined(CONFIG_DISPLAY_CPUINFO)
>  static char *get_reset_cause(void)
>  {
> diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h
> index be13b96..1c8d24e 100644
> --- a/arch/arm/include/asm/arch-imx/cpu.h
> +++ b/arch/arm/include/asm/arch-imx/cpu.h
> @@ -21,6 +21,7 @@
>  #define MXC_CPU_MX6D		0x67
>  #define MXC_CPU_MX6DP		0x68
>  #define MXC_CPU_MX6QP		0x69
> +#define MXC_CPU_VF610		0xF6 /* dummy ID */
>  
>  #define CS0_128					0
>  #define CS0_64M_CS1_64M				1
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-01  9:15 [U-Boot] [PATCH V2] imx: vf610 add get_cpu_rev Peng Fan
2015-09-01 14:35 ` 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.