[U-Boot] [PATCH 1/2] ls102x: add soc version function
Shengzhou Liu
Shengzhou.Liu at freescale.com
Thu Nov 19 10:57:21 CET 2015
Add get_svr_ver_major() and get_svr_ver_minor() helper.
Signed-off-by: Shengzhou Liu <Shengzhou.Liu at freescale.com>
---
arch/arm/cpu/armv7/ls102xa/cpu.c | 14 ++++++++++++++
arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h | 3 +++
2 files changed, 17 insertions(+)
diff --git a/arch/arm/cpu/armv7/ls102xa/cpu.c b/arch/arm/cpu/armv7/ls102xa/cpu.c
index 14ae2a3..9253ea3 100644
--- a/arch/arm/cpu/armv7/ls102xa/cpu.c
+++ b/arch/arm/cpu/armv7/ls102xa/cpu.c
@@ -209,6 +209,20 @@ void enable_caches(void)
}
#endif /* #ifndef CONFIG_SYS_DCACHE_OFF */
+u32 get_svr_ver_major(void)
+{
+ struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+
+ return SVR_MAJ(in_be32(&gur->svr));
+}
+
+u32 get_svr_ver_minor(void)
+{
+ struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+
+ return SVR_MIN(in_be32(&gur->svr));
+}
+
#if defined(CONFIG_DISPLAY_CPUINFO)
int print_cpuinfo(void)
{
diff --git a/arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h b/arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h
index c59c93a..4a996b8 100644
--- a/arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h
+++ b/arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h
@@ -427,4 +427,7 @@ struct ccsr_ahci {
u32 pberr; /* port 0/1 BIST error */
u32 cmds; /* port 0/1 CMD status error */
};
+
+u32 get_svr_ver_major(void);
+u32 get_svr_ver_minor(void);
#endif /* __ASM_ARCH_LS102XA_IMMAP_H_ */
--
2.1.0.27.g96db324
More information about the U-Boot
mailing list