diff options
Diffstat (limited to 'arch/arm/mach-zynq/slcr.c')
-rw-r--r-- | arch/arm/mach-zynq/slcr.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c index f9f33496cee9..d58c9964e883 100644 --- a/arch/arm/mach-zynq/slcr.c +++ b/arch/arm/mach-zynq/slcr.c | |||
@@ -32,9 +32,36 @@ | |||
32 | #define SLCR_UNLOCK_MAGIC 0xDF0D | 32 | #define SLCR_UNLOCK_MAGIC 0xDF0D |
33 | #define SLCR_UNLOCK 0x8 /* SCLR unlock register */ | 33 | #define SLCR_UNLOCK 0x8 /* SCLR unlock register */ |
34 | 34 | ||
35 | #define SLCR_PS_RST_CTRL_OFFSET 0x200 /* PS Software Reset Control */ | ||
36 | #define SLCR_REBOOT_STATUS 0x258 /* PS Reboot Status */ | ||
37 | |||
35 | void __iomem *zynq_slcr_base; | 38 | void __iomem *zynq_slcr_base; |
36 | 39 | ||
37 | /** | 40 | /** |
41 | * zynq_slcr_system_reset - Reset the entire system. | ||
42 | */ | ||
43 | void zynq_slcr_system_reset(void) | ||
44 | { | ||
45 | u32 reboot; | ||
46 | |||
47 | /* | ||
48 | * Unlock the SLCR then reset the system. | ||
49 | * Note that this seems to require raw i/o | ||
50 | * functions or there's a lockup? | ||
51 | */ | ||
52 | writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK); | ||
53 | |||
54 | /* | ||
55 | * Clear 0x0F000000 bits of reboot status register to workaround | ||
56 | * the FSBL not loading the bitstream after soft-reboot | ||
57 | * This is a temporary solution until we know more. | ||
58 | */ | ||
59 | reboot = readl(zynq_slcr_base + SLCR_REBOOT_STATUS); | ||
60 | writel(reboot & 0xF0FFFFFF, zynq_slcr_base + SLCR_REBOOT_STATUS); | ||
61 | writel(1, zynq_slcr_base + SLCR_PS_RST_CTRL_OFFSET); | ||
62 | } | ||
63 | |||
64 | /** | ||
38 | * zynq_slcr_init | 65 | * zynq_slcr_init |
39 | * Returns 0 on success, negative errno otherwise. | 66 | * Returns 0 on success, negative errno otherwise. |
40 | * | 67 | * |