Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/powermac/grackle.c
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | static device_method_t grackle_methods[] = { | ||||
DEVMETHOD(pcib_read_config, grackle_read_config), | DEVMETHOD(pcib_read_config, grackle_read_config), | ||||
DEVMETHOD(pcib_write_config, grackle_write_config), | DEVMETHOD(pcib_write_config, grackle_write_config), | ||||
DEVMETHOD_END | DEVMETHOD_END | ||||
}; | }; | ||||
static devclass_t grackle_devclass; | static devclass_t grackle_devclass; | ||||
DEFINE_CLASS_1(pcib, grackle_driver, grackle_methods, | DEFINE_CLASS_1(pcib, grackle_driver, grackle_methods, | ||||
sizeof(struct grackle_softc), ofw_pci_driver); | sizeof(struct grackle_softc), ofw_pcib_driver); | ||||
DRIVER_MODULE(grackle, ofwbus, grackle_driver, grackle_devclass, 0, 0); | DRIVER_MODULE(grackle, ofwbus, grackle_driver, grackle_devclass, 0, 0); | ||||
static int | static int | ||||
grackle_probe(device_t dev) | grackle_probe(device_t dev) | ||||
{ | { | ||||
const char *type, *compatible; | const char *type, *compatible; | ||||
type = ofw_bus_get_type(dev); | type = ofw_bus_get_type(dev); | ||||
Show All 20 Lines | grackle_attach(device_t dev) | ||||
* The Grackle PCI config addr/data registers are actually in | * The Grackle PCI config addr/data registers are actually in | ||||
* PCI space, but since they are needed to actually probe the | * PCI space, but since they are needed to actually probe the | ||||
* PCI bus, use the fact that they are also available directly | * PCI bus, use the fact that they are also available directly | ||||
* on the processor bus and map them | * on the processor bus and map them | ||||
*/ | */ | ||||
sc->sc_addr = (vm_offset_t)pmap_mapdev(GRACKLE_ADDR, PAGE_SIZE); | sc->sc_addr = (vm_offset_t)pmap_mapdev(GRACKLE_ADDR, PAGE_SIZE); | ||||
sc->sc_data = (vm_offset_t)pmap_mapdev(GRACKLE_DATA, PAGE_SIZE); | sc->sc_data = (vm_offset_t)pmap_mapdev(GRACKLE_DATA, PAGE_SIZE); | ||||
return (ofw_pci_attach(dev)); | return (ofw_pcib_attach(dev)); | ||||
} | } | ||||
static u_int32_t | static u_int32_t | ||||
grackle_read_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, | grackle_read_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, | ||||
int width) | int width) | ||||
{ | { | ||||
struct grackle_softc *sc; | struct grackle_softc *sc; | ||||
vm_offset_t caoff; | vm_offset_t caoff; | ||||
▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines |