aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma/main.c
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2011-07-22 19:20:07 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-08 14:29:24 -0400
commit517f43e5a922d51ac960424de4f72676fe6a7390 (patch)
tree02920911d43c4e480ac0eba21c15587776b16d6b /drivers/bcma/main.c
parent67a5c29e1623edda5ff3f0355af533e72a245ad9 (diff)
bcma: add functions to scan cores needed on SoCs
The chip common and mips core have to be setup early in the boot process to get the cpu clock. bcma_bus_early_register() gets pointers to some space to store the core data and searches for the chip common and mips core and initializes chip common. After that was done and the kernel is out of early boot we just have to run bcma_bus_register() and it will search for the other cores, initialize and register them. The cores are getting the same numbers as before. Acked-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma/main.c')
-rw-r--r--drivers/bcma/main.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 873e2e4ac55f..360a289738fc 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -169,6 +169,52 @@ void bcma_bus_unregister(struct bcma_bus *bus)
169 bcma_unregister_cores(bus); 169 bcma_unregister_cores(bus);
170} 170}
171 171
172int __init bcma_bus_early_register(struct bcma_bus *bus,
173 struct bcma_device *core_cc,
174 struct bcma_device *core_mips)
175{
176 int err;
177 struct bcma_device *core;
178 struct bcma_device_id match;
179
180 bcma_init_bus(bus);
181
182 match.manuf = BCMA_MANUF_BCM;
183 match.id = BCMA_CORE_CHIPCOMMON;
184 match.class = BCMA_CL_SIM;
185 match.rev = BCMA_ANY_REV;
186
187 /* Scan for chip common core */
188 err = bcma_bus_scan_early(bus, &match, core_cc);
189 if (err) {
190 pr_err("Failed to scan for common core: %d\n", err);
191 return -1;
192 }
193
194 match.manuf = BCMA_MANUF_MIPS;
195 match.id = BCMA_CORE_MIPS_74K;
196 match.class = BCMA_CL_SIM;
197 match.rev = BCMA_ANY_REV;
198
199 /* Scan for mips core */
200 err = bcma_bus_scan_early(bus, &match, core_mips);
201 if (err) {
202 pr_err("Failed to scan for mips core: %d\n", err);
203 return -1;
204 }
205
206 /* Init CC core */
207 core = bcma_find_core(bus, BCMA_CORE_CHIPCOMMON);
208 if (core) {
209 bus->drv_cc.core = core;
210 bcma_core_chipcommon_init(&bus->drv_cc);
211 }
212
213 pr_info("Early bus registered\n");
214
215 return 0;
216}
217
172int __bcma_driver_register(struct bcma_driver *drv, struct module *owner) 218int __bcma_driver_register(struct bcma_driver *drv, struct module *owner)
173{ 219{
174 drv->drv.name = drv->name; 220 drv->drv.name = drv->name;