Lines Matching refs:core
36 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in manuf_show() local
37 return sprintf(buf, "0x%03X\n", core->id.manuf); in manuf_show()
43 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in id_show() local
44 return sprintf(buf, "0x%03X\n", core->id.id); in id_show()
50 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in rev_show() local
51 return sprintf(buf, "0x%02X\n", core->id.rev); in rev_show()
57 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in class_show() local
58 return sprintf(buf, "0x%X\n", core->id.class); in class_show()
90 struct bcma_device *core; in bcma_find_core_unit() local
92 list_for_each_entry(core, &bus->cores, list) { in bcma_find_core_unit()
93 if (core->id.id == coreid && core->core_unit == unit) in bcma_find_core_unit()
94 return core; in bcma_find_core_unit()
100 bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value, in bcma_wait_value() argument
107 val = bcma_read32(core, reg); in bcma_wait_value()
114 bcma_warn(core->bus, "Timeout waiting for register 0x%04X!\n", reg); in bcma_wait_value()
121 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_release_core_dev() local
122 if (core->io_addr) in bcma_release_core_dev()
123 iounmap(core->io_addr); in bcma_release_core_dev()
124 if (core->io_wrap) in bcma_release_core_dev()
125 iounmap(core->io_wrap); in bcma_release_core_dev()
126 kfree(core); in bcma_release_core_dev()
141 struct bcma_device *core) in bcma_of_find_child_device() argument
154 if (res.start == core->addr) in bcma_of_find_child_device()
161 struct bcma_device *core, in bcma_of_irq_parse() argument
167 if (core->dev.of_node) { in bcma_of_irq_parse()
168 rc = of_irq_parse_one(core->dev.of_node, num, out_irq); in bcma_of_irq_parse()
177 laddr[0] = cpu_to_be32(core->addr); in bcma_of_irq_parse()
182 struct bcma_device *core, int num) in bcma_of_get_irq() argument
190 ret = bcma_of_irq_parse(parent, core, &out_irq, num); in bcma_of_get_irq()
192 bcma_debug(core->bus, "bcma_of_get_irq() failed with rc=%d\n", in bcma_of_get_irq()
201 struct bcma_device *core) in bcma_of_fill_device() argument
205 node = bcma_of_find_child_device(parent, core); in bcma_of_fill_device()
207 core->dev.of_node = node; in bcma_of_fill_device()
209 core->irq = bcma_of_get_irq(parent, core, 0); in bcma_of_fill_device()
211 of_dma_configure(&core->dev, node, false); in bcma_of_fill_device()
214 unsigned int bcma_core_irq(struct bcma_device *core, int num) in bcma_core_irq() argument
216 struct bcma_bus *bus = core->bus; in bcma_core_irq()
223 if (bus->drv_mips.core && num == 0) { in bcma_core_irq()
224 mips_irq = bcma_core_mips_irq(core); in bcma_core_irq()
228 return bcma_of_get_irq(bus->dev, core, num); in bcma_core_irq()
238 void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core) in bcma_prepare_core() argument
240 device_initialize(&core->dev); in bcma_prepare_core()
241 core->dev.release = bcma_release_core_dev; in bcma_prepare_core()
242 core->dev.bus = &bcma_bus_type; in bcma_prepare_core()
243 dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index); in bcma_prepare_core()
244 core->dev.parent = bus->dev; in bcma_prepare_core()
246 bcma_of_fill_device(bus->dev, core); in bcma_prepare_core()
250 core->dma_dev = bus->dev; in bcma_prepare_core()
251 core->irq = bus->host_pci->irq; in bcma_prepare_core()
255 core->dma_dev = bus->dev; in bcma_prepare_core()
257 core->dev.dma_mask = &core->dev.coherent_dma_mask; in bcma_prepare_core()
258 core->dma_dev = &core->dev; in bcma_prepare_core()
278 static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core) in bcma_register_core() argument
282 err = device_add(&core->dev); in bcma_register_core()
285 core->id.id); in bcma_register_core()
288 core->dev_registered = true; in bcma_register_core()
293 struct bcma_device *core; in bcma_register_devices() local
296 list_for_each_entry(core, &bus->cores, list) { in bcma_register_devices()
300 switch (core->id.id) { in bcma_register_devices()
313 if (bcma_is_core_needed_early(core->id.id)) in bcma_register_devices()
316 np = core->dev.of_node; in bcma_register_devices()
321 if (core->id.id == BCMA_CORE_4706_MAC_GBIT && in bcma_register_devices()
322 core->core_unit > 0) in bcma_register_devices()
325 bcma_register_core(bus, core); in bcma_register_devices()
370 struct bcma_device *core, *tmp; in bcma_unregister_cores() local
372 list_for_each_entry_safe(core, tmp, &bus->cores, list) { in bcma_unregister_cores()
373 if (!core->dev_registered) in bcma_unregister_cores()
375 list_del(&core->list); in bcma_unregister_cores()
376 device_unregister(&core->dev); in bcma_unregister_cores()
382 list_for_each_entry_safe(core, tmp, &bus->cores, list) { in bcma_unregister_cores()
383 list_del(&core->list); in bcma_unregister_cores()
384 put_device(&core->dev); in bcma_unregister_cores()
391 struct bcma_device *core; in bcma_bus_register() local
401 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_register()
402 if (core) { in bcma_bus_register()
403 bus->drv_cc.core = core; in bcma_bus_register()
408 core = bcma_find_core(bus, BCMA_CORE_PCIE); in bcma_bus_register()
409 if (core) { in bcma_bus_register()
410 bus->drv_pci[0].core = core; in bcma_bus_register()
418 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_register()
419 if (bcma_is_core_needed_early(core->id.id)) in bcma_bus_register()
420 bcma_register_core(bus, core); in bcma_bus_register()
431 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_register()
432 if (core) { in bcma_bus_register()
433 bus->drv_cc.core = core; in bcma_bus_register()
438 core = bcma_find_core(bus, BCMA_CORE_NS_CHIPCOMMON_B); in bcma_bus_register()
439 if (core) { in bcma_bus_register()
440 bus->drv_cc_b.core = core; in bcma_bus_register()
445 core = bcma_find_core(bus, BCMA_CORE_MIPS_74K); in bcma_bus_register()
446 if (core) { in bcma_bus_register()
447 bus->drv_mips.core = core; in bcma_bus_register()
452 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 0); in bcma_bus_register()
453 if (core) { in bcma_bus_register()
454 bus->drv_pci[0].core = core; in bcma_bus_register()
459 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 1); in bcma_bus_register()
460 if (core) { in bcma_bus_register()
461 bus->drv_pci[1].core = core; in bcma_bus_register()
466 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE2, 0); in bcma_bus_register()
467 if (core) { in bcma_bus_register()
468 bus->drv_pcie2.core = core; in bcma_bus_register()
473 core = bcma_find_core(bus, BCMA_CORE_4706_MAC_GBIT_COMMON); in bcma_bus_register()
474 if (core) { in bcma_bus_register()
475 bus->drv_gmac_cmn.core = core; in bcma_bus_register()
510 struct bcma_device *core; in bcma_bus_early_register() local
520 core = bcma_find_core(bus, bcma_cc_core_id(bus)); in bcma_bus_early_register()
521 if (core) { in bcma_bus_early_register()
522 bus->drv_cc.core = core; in bcma_bus_early_register()
527 core = bcma_find_core(bus, BCMA_CORE_MIPS_74K); in bcma_bus_early_register()
528 if (core) { in bcma_bus_early_register()
529 bus->drv_mips.core = core; in bcma_bus_early_register()
541 struct bcma_device *core; in bcma_bus_suspend() local
543 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_suspend()
544 struct device_driver *drv = core->dev.driver; in bcma_bus_suspend()
548 adrv->suspend(core); in bcma_bus_suspend()
556 struct bcma_device *core; in bcma_bus_resume() local
559 if (bus->drv_cc.core) { in bcma_bus_resume()
564 list_for_each_entry(core, &bus->cores, list) { in bcma_bus_resume()
565 struct device_driver *drv = core->dev.driver; in bcma_bus_resume()
569 adrv->resume(core); in bcma_bus_resume()
595 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_bus_match() local
597 const struct bcma_device_id *cid = &core->id; in bcma_bus_match()
612 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_device_probe() local
619 err = adrv->probe(core); in bcma_device_probe()
628 struct bcma_device *core = container_of(dev, struct bcma_device, dev); in bcma_device_remove() local
633 adrv->remove(core); in bcma_device_remove()
639 const struct bcma_device *core = container_of_const(dev, struct bcma_device, dev); in bcma_device_uevent() local
643 core->id.manuf, core->id.id, in bcma_device_uevent()
644 core->id.rev, core->id.class); in bcma_device_uevent()