diff options
author | Soren Brinkmann <soren.brinkmann@xilinx.com> | 2013-07-17 13:10:14 -0400 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2013-07-26 08:14:39 -0400 |
commit | b5f177ff305b3db63b5ea273e6471708790133f2 (patch) | |
tree | b8f4b981ee2097a94b6daec6a1b0e2ad0cec6982 /arch/arm/mach-zynq/slcr.c | |
parent | c323f2a188e333a6d8ee5ebb7cd2460020459f74 (diff) |
arm: zynq: slcr: Clean up #defines
Use a common naming scheme for register offset #defines:
Some of those used a '_OFFSET' suffix to distinguish them from others.
This scheme is used for all register offsets now.
Separate the register offset #defines from others and sort them in
increasing order.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch/arm/mach-zynq/slcr.c')
-rw-r--r-- | arch/arm/mach-zynq/slcr.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c index 232c27502320..44a4ab62e9a8 100644 --- a/arch/arm/mach-zynq/slcr.c +++ b/arch/arm/mach-zynq/slcr.c | |||
@@ -19,17 +19,16 @@ | |||
19 | #include <linux/clk/zynq.h> | 19 | #include <linux/clk/zynq.h> |
20 | #include "common.h" | 20 | #include "common.h" |
21 | 21 | ||
22 | #define SLCR_UNLOCK_MAGIC 0xDF0D | 22 | /* register offsets */ |
23 | #define SLCR_UNLOCK 0x8 /* SCLR unlock register */ | 23 | #define SLCR_UNLOCK_OFFSET 0x8 /* SCLR unlock register */ |
24 | |||
25 | #define SLCR_PS_RST_CTRL_OFFSET 0x200 /* PS Software Reset Control */ | 24 | #define SLCR_PS_RST_CTRL_OFFSET 0x200 /* PS Software Reset Control */ |
25 | #define SLCR_A9_CPU_RST_CTRL_OFFSET 0x244 /* CPU Software Reset Control */ | ||
26 | #define SLCR_REBOOT_STATUS_OFFSET 0x258 /* PS Reboot Status */ | ||
26 | 27 | ||
28 | #define SLCR_UNLOCK_MAGIC 0xDF0D | ||
27 | #define SLCR_A9_CPU_CLKSTOP 0x10 | 29 | #define SLCR_A9_CPU_CLKSTOP 0x10 |
28 | #define SLCR_A9_CPU_RST 0x1 | 30 | #define SLCR_A9_CPU_RST 0x1 |
29 | 31 | ||
30 | #define SLCR_A9_CPU_RST_CTRL 0x244 /* CPU Software Reset Control */ | ||
31 | #define SLCR_REBOOT_STATUS 0x258 /* PS Reboot Status */ | ||
32 | |||
33 | void __iomem *zynq_slcr_base; | 32 | void __iomem *zynq_slcr_base; |
34 | 33 | ||
35 | /** | 34 | /** |
@@ -44,15 +43,15 @@ void zynq_slcr_system_reset(void) | |||
44 | * Note that this seems to require raw i/o | 43 | * Note that this seems to require raw i/o |
45 | * functions or there's a lockup? | 44 | * functions or there's a lockup? |
46 | */ | 45 | */ |
47 | writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK); | 46 | writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK_OFFSET); |
48 | 47 | ||
49 | /* | 48 | /* |
50 | * Clear 0x0F000000 bits of reboot status register to workaround | 49 | * Clear 0x0F000000 bits of reboot status register to workaround |
51 | * the FSBL not loading the bitstream after soft-reboot | 50 | * the FSBL not loading the bitstream after soft-reboot |
52 | * This is a temporary solution until we know more. | 51 | * This is a temporary solution until we know more. |
53 | */ | 52 | */ |
54 | reboot = readl(zynq_slcr_base + SLCR_REBOOT_STATUS); | 53 | reboot = readl(zynq_slcr_base + SLCR_REBOOT_STATUS_OFFSET); |
55 | writel(reboot & 0xF0FFFFFF, zynq_slcr_base + SLCR_REBOOT_STATUS); | 54 | writel(reboot & 0xF0FFFFFF, zynq_slcr_base + SLCR_REBOOT_STATUS_OFFSET); |
56 | writel(1, zynq_slcr_base + SLCR_PS_RST_CTRL_OFFSET); | 55 | writel(1, zynq_slcr_base + SLCR_PS_RST_CTRL_OFFSET); |
57 | } | 56 | } |
58 | 57 | ||
@@ -64,9 +63,9 @@ void zynq_slcr_cpu_start(int cpu) | |||
64 | { | 63 | { |
65 | /* enable CPUn */ | 64 | /* enable CPUn */ |
66 | writel(SLCR_A9_CPU_CLKSTOP << cpu, | 65 | writel(SLCR_A9_CPU_CLKSTOP << cpu, |
67 | zynq_slcr_base + SLCR_A9_CPU_RST_CTRL); | 66 | zynq_slcr_base + SLCR_A9_CPU_RST_CTRL_OFFSET); |
68 | /* enable CLK for CPUn */ | 67 | /* enable CLK for CPUn */ |
69 | writel(0x0 << cpu, zynq_slcr_base + SLCR_A9_CPU_RST_CTRL); | 68 | writel(0x0 << cpu, zynq_slcr_base + SLCR_A9_CPU_RST_CTRL_OFFSET); |
70 | } | 69 | } |
71 | 70 | ||
72 | /** | 71 | /** |
@@ -77,7 +76,7 @@ void zynq_slcr_cpu_stop(int cpu) | |||
77 | { | 76 | { |
78 | /* stop CLK and reset CPUn */ | 77 | /* stop CLK and reset CPUn */ |
79 | writel((SLCR_A9_CPU_CLKSTOP | SLCR_A9_CPU_RST) << cpu, | 78 | writel((SLCR_A9_CPU_CLKSTOP | SLCR_A9_CPU_RST) << cpu, |
80 | zynq_slcr_base + SLCR_A9_CPU_RST_CTRL); | 79 | zynq_slcr_base + SLCR_A9_CPU_RST_CTRL_OFFSET); |
81 | } | 80 | } |
82 | 81 | ||
83 | /** | 82 | /** |
@@ -103,7 +102,7 @@ int __init zynq_slcr_init(void) | |||
103 | } | 102 | } |
104 | 103 | ||
105 | /* unlock the SLCR so that registers can be changed */ | 104 | /* unlock the SLCR so that registers can be changed */ |
106 | writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK); | 105 | writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK_OFFSET); |
107 | 106 | ||
108 | pr_info("%s mapped to %p\n", np->name, zynq_slcr_base); | 107 | pr_info("%s mapped to %p\n", np->name, zynq_slcr_base); |
109 | 108 | ||