public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] ls102x: add soc version function
@ 2015-11-19  9:57 Shengzhou Liu
  2015-11-19  9:57 ` [U-Boot] [PATCH 2/2] fsl/ddr: updated ddr errata-A008378 on ls102x Shengzhou Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Shengzhou Liu @ 2015-11-19  9:57 UTC (permalink / raw)
  To: u-boot

Add get_svr_ver_major() and get_svr_ver_minor() helper.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@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

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

end of thread, other threads:[~2015-11-19 16:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-19  9:57 [U-Boot] [PATCH 1/2] ls102x: add soc version function Shengzhou Liu
2015-11-19  9:57 ` [U-Boot] [PATCH 2/2] fsl/ddr: updated ddr errata-A008378 on ls102x Shengzhou Liu
2015-11-19 16:19   ` York Sun

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