aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-zynq/slcr.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-zynq/slcr.c')
-rw-r--r--arch/arm/mach-zynq/slcr.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
index a37d49a6e657..c43a2d16e223 100644
--- a/arch/arm/mach-zynq/slcr.c
+++ b/arch/arm/mach-zynq/slcr.c
@@ -26,10 +26,13 @@
26#define SLCR_PS_RST_CTRL_OFFSET 0x200 /* PS Software Reset Control */ 26#define SLCR_PS_RST_CTRL_OFFSET 0x200 /* PS Software Reset Control */
27#define SLCR_A9_CPU_RST_CTRL_OFFSET 0x244 /* CPU Software Reset Control */ 27#define SLCR_A9_CPU_RST_CTRL_OFFSET 0x244 /* CPU Software Reset Control */
28#define SLCR_REBOOT_STATUS_OFFSET 0x258 /* PS Reboot Status */ 28#define SLCR_REBOOT_STATUS_OFFSET 0x258 /* PS Reboot Status */
29#define SLCR_PSS_IDCODE 0x530 /* PS IDCODE */
29 30
30#define SLCR_UNLOCK_MAGIC 0xDF0D 31#define SLCR_UNLOCK_MAGIC 0xDF0D
31#define SLCR_A9_CPU_CLKSTOP 0x10 32#define SLCR_A9_CPU_CLKSTOP 0x10
32#define SLCR_A9_CPU_RST 0x1 33#define SLCR_A9_CPU_RST 0x1
34#define SLCR_PSS_IDCODE_DEVICE_SHIFT 12
35#define SLCR_PSS_IDCODE_DEVICE_MASK 0x1F
33 36
34static void __iomem *zynq_slcr_base; 37static void __iomem *zynq_slcr_base;
35static struct regmap *zynq_slcr_regmap; 38static struct regmap *zynq_slcr_regmap;
@@ -83,6 +86,22 @@ static inline int zynq_slcr_unlock(void)
83} 86}
84 87
85/** 88/**
89 * zynq_slcr_get_device_id - Read device code id
90 *
91 * Return: Device code id
92 */
93u32 zynq_slcr_get_device_id(void)
94{
95 u32 val;
96
97 zynq_slcr_read(&val, SLCR_PSS_IDCODE);
98 val >>= SLCR_PSS_IDCODE_DEVICE_SHIFT;
99 val &= SLCR_PSS_IDCODE_DEVICE_MASK;
100
101 return val;
102}
103
104/**
86 * zynq_slcr_system_reset - Reset the entire system. 105 * zynq_slcr_system_reset - Reset the entire system.
87 */ 106 */
88void zynq_slcr_system_reset(void) 107void zynq_slcr_system_reset(void)