Lines Matching +full:silicon +full:- +full:id
2 * Sonics Silicon Backplane
20 #include <linux/dma-mapping.h>
29 MODULE_DESCRIPTION("Sonics Silicon Backplane driver");
33 /* Temporary list of yet-to-be-attached buses */
37 /* Software ID counter */
64 if (bus->bustype == SSB_BUSTYPE_PCI && in ssb_pci_dev_to_bus()
65 bus->host_pci == pdev) in ssb_pci_dev_to_bus()
83 if (bus->bustype == SSB_BUSTYPE_PCMCIA && in ssb_pcmcia_dev_to_bus()
84 bus->host_pcmcia == pdev) in ssb_pcmcia_dev_to_bus()
111 return -ENODEV; in ssb_for_each_bus_call()
117 get_device(dev->dev); in ssb_device_get()
124 put_device(dev->dev); in ssb_device_put()
133 if (dev->driver) { in ssb_device_resume()
134 ssb_drv = drv_to_ssb_drv(dev->driver); in ssb_device_resume()
135 if (ssb_drv && ssb_drv->resume) in ssb_device_resume()
136 err = ssb_drv->resume(ssb_dev); in ssb_device_resume()
150 if (dev->driver) { in ssb_device_suspend()
151 ssb_drv = drv_to_ssb_drv(dev->driver); in ssb_device_suspend()
152 if (ssb_drv && ssb_drv->suspend) in ssb_device_suspend()
153 err = ssb_drv->suspend(ssb_dev, state); in ssb_device_suspend()
168 bus->mapped_device = NULL; in ssb_bus_resume()
170 bus->pcicore.setup_done = 0; in ssb_bus_resume()
181 ssb_chipco_resume(&bus->chipco); in ssb_bus_resume()
190 ssb_chipco_suspend(&bus->chipco); in ssb_bus_suspend()
198 /** ssb_devices_freeze - Freeze all devices on the bus.
214 ctx->bus = bus; in ssb_devices_freeze()
215 WARN_ON(bus->nr_devices > ARRAY_SIZE(ctx->device_frozen)); in ssb_devices_freeze()
217 for (i = 0; i < bus->nr_devices; i++) { in ssb_devices_freeze()
218 sdev = ssb_device_get(&bus->devices[i]); in ssb_devices_freeze()
220 if (!sdev->dev || !sdev->dev->driver || in ssb_devices_freeze()
221 !device_is_registered(sdev->dev)) { in ssb_devices_freeze()
225 sdrv = drv_to_ssb_drv(sdev->dev->driver); in ssb_devices_freeze()
226 if (WARN_ON(!sdrv->remove)) in ssb_devices_freeze()
228 sdrv->remove(sdev); in ssb_devices_freeze()
229 ctx->device_frozen[i] = 1; in ssb_devices_freeze()
235 /** ssb_devices_thaw - Unfreeze all devices on the bus.
237 * This will re-attach the device drivers and re-init the devices.
243 struct ssb_bus *bus = ctx->bus; in ssb_devices_thaw()
249 for (i = 0; i < bus->nr_devices; i++) { in ssb_devices_thaw()
250 if (!ctx->device_frozen[i]) in ssb_devices_thaw()
252 sdev = &bus->devices[i]; in ssb_devices_thaw()
254 if (WARN_ON(!sdev->dev || !sdev->dev->driver)) in ssb_devices_thaw()
256 sdrv = drv_to_ssb_drv(sdev->dev->driver); in ssb_devices_thaw()
257 if (WARN_ON(!sdrv || !sdrv->probe)) in ssb_devices_thaw()
260 err = sdrv->probe(sdev, &sdev->id); in ssb_devices_thaw()
262 dev_err(sdev->dev, in ssb_devices_thaw()
264 dev_name(sdev->dev)); in ssb_devices_thaw()
279 if (!dev->driver) in ssb_device_shutdown()
281 ssb_drv = drv_to_ssb_drv(dev->driver); in ssb_device_shutdown()
282 if (ssb_drv && ssb_drv->shutdown) in ssb_device_shutdown()
283 ssb_drv->shutdown(ssb_dev); in ssb_device_shutdown()
289 struct ssb_driver *ssb_drv = drv_to_ssb_drv(dev->driver); in ssb_device_remove()
291 if (ssb_drv && ssb_drv->remove) in ssb_device_remove()
292 ssb_drv->remove(ssb_dev); in ssb_device_remove()
299 struct ssb_driver *ssb_drv = drv_to_ssb_drv(dev->driver); in ssb_device_probe()
303 if (ssb_drv && ssb_drv->probe) in ssb_device_probe()
304 err = ssb_drv->probe(ssb_dev, &ssb_dev->id); in ssb_device_probe()
314 if ((tabid->vendor != devid->vendor) && in ssb_match_devid()
315 tabid->vendor != SSB_ANY_VENDOR) in ssb_match_devid()
317 if ((tabid->coreid != devid->coreid) && in ssb_match_devid()
318 tabid->coreid != SSB_ANY_ID) in ssb_match_devid()
320 if ((tabid->revision != devid->revision) && in ssb_match_devid()
321 tabid->revision != SSB_ANY_REV) in ssb_match_devid()
330 const struct ssb_device_id *id; in ssb_bus_match() local
332 for (id = ssb_drv->id_table; in ssb_bus_match()
333 id->vendor || id->coreid || id->revision; in ssb_bus_match()
334 id++) { in ssb_bus_match()
335 if (ssb_match_devid(id, &ssb_dev->id)) in ssb_bus_match()
347 return -ENODEV; in ssb_device_uevent()
353 ssb_dev->id.vendor, ssb_dev->id.coreid, in ssb_device_uevent()
354 ssb_dev->id.revision); in ssb_device_uevent()
361 return sprintf(buf, format_string, dev_to_ssb_dev(dev)->field); \
366 ssb_config_attr(coreid, id.coreid, "0x%04x\n")
367 ssb_config_attr(vendor, id.vendor, "0x%04x\n")
368 ssb_config_attr(revision, id.revision, "%u\n")
374 ssb_core_name(dev_to_ssb_dev(dev)->id.coreid)); in name_show()
420 for (i = bus->nr_devices - 1; i >= 0; i--) { in ssb_devices_unregister()
421 sdev = &(bus->devices[i]); in ssb_devices_unregister()
422 if (sdev->dev) in ssb_devices_unregister()
423 device_unregister(sdev->dev); in ssb_devices_unregister()
427 if (bus->bustype == SSB_BUSTYPE_SSB) in ssb_devices_unregister()
428 platform_device_unregister(bus->watchdog); in ssb_devices_unregister()
442 list_del(&bus->list); in ssb_bus_unregister()
467 for (i = 0; i < bus->nr_devices; i++) { in ssb_devices_register()
468 sdev = &(bus->devices[i]); in ssb_devices_register()
470 /* We don't register SSB-system devices to the kernel, in ssb_devices_register()
473 switch (sdev->id.coreid) { in ssb_devices_register()
486 err = -ENOMEM; in ssb_devices_register()
489 dev = &devwrap->dev; in ssb_devices_register()
490 devwrap->sdev = sdev; in ssb_devices_register()
492 dev->release = ssb_release_dev; in ssb_devices_register()
493 dev->bus = &ssb_bustype; in ssb_devices_register()
494 dev_set_name(dev, "ssb%u:%d", bus->busnumber, dev_idx); in ssb_devices_register()
496 switch (bus->bustype) { in ssb_devices_register()
499 sdev->irq = bus->host_pci->irq; in ssb_devices_register()
500 dev->parent = &bus->host_pci->dev; in ssb_devices_register()
501 sdev->dma_dev = dev->parent; in ssb_devices_register()
506 sdev->irq = bus->host_pcmcia->irq; in ssb_devices_register()
507 dev->parent = &bus->host_pcmcia->dev; in ssb_devices_register()
512 dev->parent = &bus->host_sdio->dev; in ssb_devices_register()
516 dev->dma_mask = &dev->coherent_dma_mask; in ssb_devices_register()
517 sdev->dma_dev = dev; in ssb_devices_register()
521 sdev->dev = dev; in ssb_devices_register()
528 sdev->dev = NULL; in ssb_devices_register()
536 if (bus->mipscore.pflash.present) { in ssb_devices_register()
544 if (bus->mipscore.sflash.present) { in ssb_devices_register()
567 list_del(&bus->list); in ssb_attach_queued_buses()
577 ssb_pcicore_init(&bus->pcicore); in ssb_attach_queued_buses()
578 if (bus->bustype == SSB_BUSTYPE_SSB) in ssb_attach_queued_buses()
582 if (err == -ENOTSUPP) in ssb_attach_queued_buses()
593 list_del(&bus->list); in ssb_attach_queued_buses()
596 list_move_tail(&bus->list, &buses); in ssb_attach_queued_buses()
612 memcpy(&bus->boardinfo, &iv.boardinfo, sizeof(iv.boardinfo)); in ssb_fetch_invariants()
613 memcpy(&bus->sprom, &iv.sprom, sizeof(iv.sprom)); in ssb_fetch_invariants()
614 bus->has_cardbus_slot = iv.has_cardbus_slot; in ssb_fetch_invariants()
626 spin_lock_init(&bus->bar_lock); in ssb_bus_register()
627 INIT_LIST_HEAD(&bus->list); in ssb_bus_register()
629 spin_lock_init(&bus->gpio_lock); in ssb_bus_register()
637 /* Init SDIO-host device (if any), before the scan */ in ssb_bus_register()
643 bus->busnumber = next_busnumber; in ssb_bus_register()
649 /* Init PCI-host device (if any) */ in ssb_bus_register()
653 /* Init PCMCIA-host device (if any) */ in ssb_bus_register()
662 ssb_chipcommon_init(&bus->chipco); in ssb_bus_register()
663 ssb_extif_init(&bus->extif); in ssb_bus_register()
664 ssb_mipscore_init(&bus->mipscore); in ssb_bus_register()
675 list_add_tail(&bus->list, &attach_queue); in ssb_bus_register()
689 list_del(&bus->list); in ssb_bus_register()
709 bus->bustype = SSB_BUSTYPE_PCI; in ssb_bus_pcibus_register()
710 bus->host_pci = host_pci; in ssb_bus_pcibus_register()
711 bus->ops = &ssb_pci_ops; in ssb_bus_pcibus_register()
715 dev_info(&host_pci->dev, in ssb_bus_pcibus_register()
716 "Sonics Silicon Backplane found on PCI device %s\n", in ssb_bus_pcibus_register()
717 dev_name(&host_pci->dev)); in ssb_bus_pcibus_register()
719 dev_err(&host_pci->dev, in ssb_bus_pcibus_register()
735 bus->bustype = SSB_BUSTYPE_PCMCIA; in ssb_bus_pcmciabus_register()
736 bus->host_pcmcia = pcmcia_dev; in ssb_bus_pcmciabus_register()
737 bus->ops = &ssb_pcmcia_ops; in ssb_bus_pcmciabus_register()
741 dev_info(&pcmcia_dev->dev, in ssb_bus_pcmciabus_register()
742 "Sonics Silicon Backplane found on PCMCIA device %s\n", in ssb_bus_pcmciabus_register()
743 pcmcia_dev->devname); in ssb_bus_pcmciabus_register()
756 bus->bustype = SSB_BUSTYPE_SDIO; in ssb_bus_sdiobus_register()
757 bus->host_sdio = func; in ssb_bus_sdiobus_register()
758 bus->ops = &ssb_sdio_ops; in ssb_bus_sdiobus_register()
759 bus->quirks = quirks; in ssb_bus_sdiobus_register()
763 dev_info(&func->dev, in ssb_bus_sdiobus_register()
764 "Sonics Silicon Backplane found on SDIO device %s\n", in ssb_bus_sdiobus_register()
778 bus->bustype = SSB_BUSTYPE_SSB; in ssb_bus_host_soc_register()
779 bus->ops = &ssb_host_soc_ops; in ssb_bus_host_soc_register()
783 pr_info("Sonics Silicon Backplane found at address 0x%08lX\n", in ssb_bus_host_soc_register()
793 drv->drv.name = drv->name; in __ssb_driver_register()
794 drv->drv.bus = &ssb_bustype; in __ssb_driver_register()
795 drv->drv.owner = owner; in __ssb_driver_register()
797 return driver_register(&drv->drv); in __ssb_driver_register()
803 driver_unregister(&drv->drv); in ssb_driver_unregister()
809 struct ssb_bus *bus = dev->bus; in ssb_set_devtypedata()
813 for (i = 0; i < bus->nr_devices; i++) { in ssb_set_devtypedata()
814 ent = &(bus->devices[i]); in ssb_set_devtypedata()
815 if (ent->id.vendor != dev->id.vendor) in ssb_set_devtypedata()
817 if (ent->id.coreid != dev->id.coreid) in ssb_set_devtypedata()
820 ent->devtypedata = data; in ssb_set_devtypedata()
947 if (bus->chipco.capabilities & SSB_CHIPCO_CAP_PMU) in ssb_clockspeed()
948 return ssb_pmu_get_controlclock(&bus->chipco); in ssb_clockspeed()
950 if (ssb_extif_available(&bus->extif)) in ssb_clockspeed()
951 ssb_extif_get_clockcontrol(&bus->extif, &plltype, in ssb_clockspeed()
953 else if (bus->chipco.dev) in ssb_clockspeed()
954 ssb_chipco_get_clockcontrol(&bus->chipco, &plltype, in ssb_clockspeed()
959 if (bus->chip_id == 0x5365) { in ssb_clockspeed()
983 case SSB_IDLOW_SSBREV_25: /* TODO - find the proper REJECT bit */ in ssb_tmslow_reject_bitmask()
1052 * timeout is in units of ten-microseconds
1071 dev_err(dev->dev, in ssb_wait_bits()
1075 return -ETIMEDOUT; in ssb_wait_bits()
1120 /* Some chipsets need routing known for PCIe and 64-bit DMA */
1123 u16 chip_id = dev->bus->chip_id; in ssb_dma_translation_special_bit()
1125 if (dev->id.coreid == SSB_DEV_80211) { in ssb_dma_translation_special_bit()
1135 switch (dev->bus->bustype) { in ssb_dma_translation()
1139 if (pci_is_pcie(dev->bus->host_pci) && in ssb_dma_translation()
1164 if (bus->bustype == SSB_BUSTYPE_SSB) in ssb_bus_may_powerdown()
1167 cc = &bus->chipco; in ssb_bus_may_powerdown()
1169 if (!cc->dev) in ssb_bus_may_powerdown()
1171 if (cc->dev->id.revision < 5) in ssb_bus_may_powerdown()
1179 bus->powered_up = 0; in ssb_bus_may_powerdown()
1196 bus->powered_up = 1; in ssb_bus_powerup()
1199 ssb_chipco_set_clockmode(&bus->chipco, mode); in ssb_bus_powerup()
1228 dev = bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev; in ssb_commit_settings()
1230 dev = bus->chipco.dev; in ssb_commit_settings()
1311 pr_err("Broadcom 43xx PCI-SSB-bridge initialization failed\n"); in ssb_modinit()