Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/powermac/cpcht.c
Show First 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | struct cpcht_softc { | ||||
uint64_t sc_populated_slots; | uint64_t sc_populated_slots; | ||||
struct cpcht_irq htirq_map[128]; | struct cpcht_irq htirq_map[128]; | ||||
struct mtx htirq_mtx; | struct mtx htirq_mtx; | ||||
}; | }; | ||||
static devclass_t cpcht_devclass; | static devclass_t cpcht_devclass; | ||||
DEFINE_CLASS_1(pcib, cpcht_driver, cpcht_methods, sizeof(struct cpcht_softc), | DEFINE_CLASS_1(pcib, cpcht_driver, cpcht_methods, sizeof(struct cpcht_softc), | ||||
ofw_pci_driver); | ofw_pcib_driver); | ||||
EARLY_DRIVER_MODULE(cpcht, ofwbus, cpcht_driver, cpcht_devclass, 0, 0, | EARLY_DRIVER_MODULE(cpcht, ofwbus, cpcht_driver, cpcht_devclass, 0, 0, | ||||
BUS_PASS_BUS); | BUS_PASS_BUS); | ||||
#define CPCHT_IOPORT_BASE 0xf4000000UL /* Hardwired */ | #define CPCHT_IOPORT_BASE 0xf4000000UL /* Hardwired */ | ||||
#define CPCHT_IOPORT_SIZE 0x00400000UL | #define CPCHT_IOPORT_SIZE 0x00400000UL | ||||
#define HTAPIC_REQUEST_EOI 0x20 | #define HTAPIC_REQUEST_EOI 0x20 | ||||
#define HTAPIC_TRIGGER_LEVEL 0x02 | #define HTAPIC_TRIGGER_LEVEL 0x02 | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | #endif | ||||
for (i = 0; i < 8; i++) | for (i = 0; i < 8; i++) | ||||
sc->htirq_map[i].irq_type = IRQ_INTERNAL; | sc->htirq_map[i].irq_type = IRQ_INTERNAL; | ||||
for (child = OF_child(node); child != 0; child = OF_peer(child)) | for (child = OF_child(node); child != 0; child = OF_peer(child)) | ||||
cpcht_configure_htbridge(dev, child); | cpcht_configure_htbridge(dev, child); | ||||
/* Now make the mapping table available to the MPIC */ | /* Now make the mapping table available to the MPIC */ | ||||
cpcht_irqmap = sc->htirq_map; | cpcht_irqmap = sc->htirq_map; | ||||
return (ofw_pci_attach(dev)); | return (ofw_pcib_attach(dev)); | ||||
} | } | ||||
static void | static void | ||||
cpcht_configure_htbridge(device_t dev, phandle_t child) | cpcht_configure_htbridge(device_t dev, phandle_t child) | ||||
{ | { | ||||
struct cpcht_softc *sc; | struct cpcht_softc *sc; | ||||
struct ofw_pci_register pcir; | struct ofw_pci_register pcir; | ||||
int ptr, nextptr; | int ptr, nextptr; | ||||
▲ Show 20 Lines • Show All 521 Lines • Show Last 20 Lines |