Changeset View
Changeset View
Standalone View
Standalone View
head/sys/arm64/arm64/gic_v3_its.c
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | gic_v3_its_attach(device_t dev) | ||||
uint64_t gits_tmp; | uint64_t gits_tmp; | ||||
uint32_t gits_pidr2; | uint32_t gits_pidr2; | ||||
int rid; | int rid; | ||||
int ret; | int ret; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
/* | /* | ||||
* XXX ARM64TODO: Avoid configuration of more than one ITS | |||||
* device. To be removed when multi-PIC support is added | |||||
* to FreeBSD (or at least multi-ITS is implemented). Limit | |||||
* supported ITS sockets to '0' only. | |||||
*/ | |||||
if (device_get_unit(dev) != 0) { | |||||
device_printf(dev, | |||||
"Only single instance of ITS is supported, exitting...\n"); | |||||
return (ENXIO); | |||||
} | |||||
sc->its_socket = 0; | |||||
/* | |||||
* Initialize sleep & spin mutex for ITS | * Initialize sleep & spin mutex for ITS | ||||
*/ | */ | ||||
/* Protects ITS device list and assigned LPIs bitmaps. */ | /* Protects ITS device list and assigned LPIs bitmaps. */ | ||||
mtx_init(&sc->its_mtx, "ITS sleep lock", NULL, MTX_DEF); | mtx_init(&sc->its_mtx, "ITS sleep lock", NULL, MTX_DEF); | ||||
/* Protects access to ITS command circular buffer. */ | /* Protects access to ITS command circular buffer. */ | ||||
mtx_init(&sc->its_spin_mtx, "ITS spin lock", NULL, MTX_SPIN); | mtx_init(&sc->its_spin_mtx, "ITS spin lock", NULL, MTX_SPIN); | ||||
rid = 0; | rid = 0; | ||||
▲ Show 20 Lines • Show All 361 Lines • ▼ Show 20 Lines | if (device_is_attached(its_sc->dev)) { | ||||
* XXX ARM64TODO: This is part of the workaround that | * XXX ARM64TODO: This is part of the workaround that | ||||
* saves ITS software context for further use in | * saves ITS software context for further use in | ||||
* mask/unmask and here. This should be removed as soon | * mask/unmask and here. This should be removed as soon | ||||
* as the upper layer is capable of passing the ITS | * as the upper layer is capable of passing the ITS | ||||
* context to this function. | * context to this function. | ||||
*/ | */ | ||||
sc = its_sc; | sc = its_sc; | ||||
} else | } else | ||||
return (ENXIO); | |||||
/* Skip if running secondary init on a wrong socket */ | |||||
if (sc->its_socket != CPU_CURRENT_SOCKET) | |||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
/* | /* | ||||
* Check for LPIs support on this Re-Distributor. | * Check for LPIs support on this Re-Distributor. | ||||
*/ | */ | ||||
parent = device_get_parent(sc->dev); | parent = device_get_parent(sc->dev); | ||||
gic_sc = device_get_softc(parent); | gic_sc = device_get_softc(parent); | ||||
▲ Show 20 Lines • Show All 1,102 Lines • Show Last 20 Lines |