diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2014-10-24 06:51:20 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-11-13 04:32:05 -0500 |
commit | f956a785a282f6b5a3e7d59937548f8b7c04d1ac (patch) | |
tree | 62813b553257c642da747b406358532b0306930f /arch/arm/mach-integrator/core.c | |
parent | bcc397de5af74ed31f35c0ca4cbd9faadb775c2e (diff) |
soc: move SoC driver for the ARM Integrator
This creates a new SoC bus driver for the ARM Integrator
family core modules to register the SoC bus and provide
sysfs info for the core module. We delete the corresponding
code from the Integrator machine and select this driver to
get a clean result.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-integrator/core.c')
-rw-r--r-- | arch/arm/mach-integrator/core.c | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index b06fd9f99a46..948872a419c1 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c | |||
@@ -60,40 +60,6 @@ void cm_control(u32 mask, u32 set) | |||
60 | raw_spin_unlock_irqrestore(&cm_lock, flags); | 60 | raw_spin_unlock_irqrestore(&cm_lock, flags); |
61 | } | 61 | } |
62 | 62 | ||
63 | static const char *integrator_arch_str(u32 id) | ||
64 | { | ||
65 | switch ((id >> 16) & 0xff) { | ||
66 | case 0x00: | ||
67 | return "ASB little-endian"; | ||
68 | case 0x01: | ||
69 | return "AHB little-endian"; | ||
70 | case 0x03: | ||
71 | return "AHB-Lite system bus, bi-endian"; | ||
72 | case 0x04: | ||
73 | return "AHB"; | ||
74 | case 0x08: | ||
75 | return "AHB system bus, ASB processor bus"; | ||
76 | default: | ||
77 | return "Unknown"; | ||
78 | } | ||
79 | } | ||
80 | |||
81 | static const char *integrator_fpga_str(u32 id) | ||
82 | { | ||
83 | switch ((id >> 12) & 0xf) { | ||
84 | case 0x01: | ||
85 | return "XC4062"; | ||
86 | case 0x02: | ||
87 | return "XC4085"; | ||
88 | case 0x03: | ||
89 | return "XVC600"; | ||
90 | case 0x04: | ||
91 | return "EPM7256AE (Altera PLD)"; | ||
92 | default: | ||
93 | return "Unknown"; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | void cm_clear_irqs(void) | 63 | void cm_clear_irqs(void) |
98 | { | 64 | { |
99 | /* disable core module IRQs */ | 65 | /* disable core module IRQs */ |
@@ -109,7 +75,6 @@ static const struct of_device_id cm_match[] = { | |||
109 | void cm_init(void) | 75 | void cm_init(void) |
110 | { | 76 | { |
111 | struct device_node *cm = of_find_matching_node(NULL, cm_match); | 77 | struct device_node *cm = of_find_matching_node(NULL, cm_match); |
112 | u32 val; | ||
113 | 78 | ||
114 | if (!cm) { | 79 | if (!cm) { |
115 | pr_crit("no core module node found in device tree\n"); | 80 | pr_crit("no core module node found in device tree\n"); |
@@ -121,13 +86,6 @@ void cm_init(void) | |||
121 | return; | 86 | return; |
122 | } | 87 | } |
123 | cm_clear_irqs(); | 88 | cm_clear_irqs(); |
124 | val = readl(cm_base + INTEGRATOR_HDR_ID_OFFSET); | ||
125 | pr_info("Detected ARM core module:\n"); | ||
126 | pr_info(" Manufacturer: %02x\n", (val >> 24)); | ||
127 | pr_info(" Architecture: %s\n", integrator_arch_str(val)); | ||
128 | pr_info(" FPGA: %s\n", integrator_fpga_str(val)); | ||
129 | pr_info(" Build: %02x\n", (val >> 4) & 0xFF); | ||
130 | pr_info(" Rev: %c\n", ('A' + (val & 0x03))); | ||
131 | } | 89 | } |
132 | 90 | ||
133 | /* | 91 | /* |
@@ -139,56 +97,3 @@ void __init integrator_reserve(void) | |||
139 | { | 97 | { |
140 | memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET); | 98 | memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET); |
141 | } | 99 | } |
142 | |||
143 | static u32 integrator_id; | ||
144 | |||
145 | static ssize_t intcp_get_manf(struct device *dev, | ||
146 | struct device_attribute *attr, | ||
147 | char *buf) | ||
148 | { | ||
149 | return sprintf(buf, "%02x\n", integrator_id >> 24); | ||
150 | } | ||
151 | |||
152 | static struct device_attribute intcp_manf_attr = | ||
153 | __ATTR(manufacturer, S_IRUGO, intcp_get_manf, NULL); | ||
154 | |||
155 | static ssize_t intcp_get_arch(struct device *dev, | ||
156 | struct device_attribute *attr, | ||
157 | char *buf) | ||
158 | { | ||
159 | return sprintf(buf, "%s\n", integrator_arch_str(integrator_id)); | ||
160 | } | ||
161 | |||
162 | static struct device_attribute intcp_arch_attr = | ||
163 | __ATTR(architecture, S_IRUGO, intcp_get_arch, NULL); | ||
164 | |||
165 | static ssize_t intcp_get_fpga(struct device *dev, | ||
166 | struct device_attribute *attr, | ||
167 | char *buf) | ||
168 | { | ||
169 | return sprintf(buf, "%s\n", integrator_fpga_str(integrator_id)); | ||
170 | } | ||
171 | |||
172 | static struct device_attribute intcp_fpga_attr = | ||
173 | __ATTR(fpga, S_IRUGO, intcp_get_fpga, NULL); | ||
174 | |||
175 | static ssize_t intcp_get_build(struct device *dev, | ||
176 | struct device_attribute *attr, | ||
177 | char *buf) | ||
178 | { | ||
179 | return sprintf(buf, "%02x\n", (integrator_id >> 4) & 0xFF); | ||
180 | } | ||
181 | |||
182 | static struct device_attribute intcp_build_attr = | ||
183 | __ATTR(build, S_IRUGO, intcp_get_build, NULL); | ||
184 | |||
185 | |||
186 | |||
187 | void integrator_init_sysfs(struct device *parent, u32 id) | ||
188 | { | ||
189 | integrator_id = id; | ||
190 | device_create_file(parent, &intcp_manf_attr); | ||
191 | device_create_file(parent, &intcp_arch_attr); | ||
192 | device_create_file(parent, &intcp_fpga_attr); | ||
193 | device_create_file(parent, &intcp_build_attr); | ||
194 | } | ||