Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/mpc85xx/pci_mpc85xx.c
Show First 20 Lines • Show All 252 Lines • ▼ Show 20 Lines | static device_method_t fsl_pcib_methods[] = { | ||||
DEVMETHOD(pcib_map_msi, fsl_pcib_map_msi), | DEVMETHOD(pcib_map_msi, fsl_pcib_map_msi), | ||||
DEVMETHOD_END | DEVMETHOD_END | ||||
}; | }; | ||||
static devclass_t fsl_pcib_devclass; | static devclass_t fsl_pcib_devclass; | ||||
DEFINE_CLASS_1(pcib, fsl_pcib_driver, fsl_pcib_methods, | DEFINE_CLASS_1(pcib, fsl_pcib_driver, fsl_pcib_methods, | ||||
sizeof(struct fsl_pcib_softc), ofw_pci_driver); | sizeof(struct fsl_pcib_softc), ofw_pcib_driver); | ||||
EARLY_DRIVER_MODULE(pcib, ofwbus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0, | EARLY_DRIVER_MODULE(pcib, ofwbus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0, | ||||
BUS_PASS_BUS); | BUS_PASS_BUS); | ||||
static void | static void | ||||
fsl_pcib_err_intr(void *v) | fsl_pcib_err_intr(void *v) | ||||
{ | { | ||||
struct fsl_pcib_softc *sc; | struct fsl_pcib_softc *sc; | ||||
device_t dev; | device_t dev; | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | fsl_pcib_attach(device_t dev) | ||||
} | } | ||||
node = ofw_bus_get_node(dev); | node = ofw_bus_get_node(dev); | ||||
/* | /* | ||||
* Initialize generic OF PCI interface (ranges, etc.) | * Initialize generic OF PCI interface (ranges, etc.) | ||||
*/ | */ | ||||
error = ofw_pci_init(dev); | error = ofw_pcib_init(dev); | ||||
if (error) | if (error) | ||||
return (error); | return (error); | ||||
/* | /* | ||||
* Configure decode windows for PCI(E) access. | * Configure decode windows for PCI(E) access. | ||||
*/ | */ | ||||
if (fsl_pcib_decode_win(node, sc) != 0) | if (fsl_pcib_decode_win(node, sc) != 0) | ||||
goto err; | goto err; | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | if (error != 0) { | ||||
"Detach of the driver failed with error %d\n", | "Detach of the driver failed with error %d\n", | ||||
error); | error); | ||||
} | } | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
fsl_pcib_err_init(dev); | fsl_pcib_err_init(dev); | ||||
return (ofw_pci_attach(dev)); | return (ofw_pcib_attach(dev)); | ||||
err: | err: | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
static uint32_t | static uint32_t | ||||
fsl_pcib_cfgread(struct fsl_pcib_softc *sc, u_int bus, u_int slot, u_int func, | fsl_pcib_cfgread(struct fsl_pcib_softc *sc, u_int bus, u_int slot, u_int func, | ||||
u_int reg, int bytes) | u_int reg, int bytes) | ||||
▲ Show 20 Lines • Show All 515 Lines • Show Last 20 Lines |