Changeset View
Changeset View
Standalone View
Standalone View
head/sys/arm64/arm64/gicv3_its.c
Show First 20 Lines • Show All 571 Lines • ▼ Show 20 Lines | for (i = 0; i <= mp_maxid; i++) { | ||||
cpu_dcache_wb_range((vm_offset_t)sc->sc_pend_base[i], | cpu_dcache_wb_range((vm_offset_t)sc->sc_pend_base[i], | ||||
LPI_PENDTAB_SIZE); | LPI_PENDTAB_SIZE); | ||||
} | } | ||||
} | } | ||||
static int | static int | ||||
its_init_cpu(device_t dev, struct gicv3_its_softc *sc) | its_init_cpu(device_t dev, struct gicv3_its_softc *sc) | ||||
{ | { | ||||
struct redist_pcpu *rpcpu; | |||||
device_t gicv3; | device_t gicv3; | ||||
vm_paddr_t target; | vm_paddr_t target; | ||||
uint64_t xbaser, tmp; | uint64_t xbaser, tmp; | ||||
uint32_t ctlr; | uint32_t ctlr; | ||||
u_int cpuid; | u_int cpuid; | ||||
gicv3 = device_get_parent(dev); | gicv3 = device_get_parent(dev); | ||||
cpuid = PCPU_GET(cpuid); | cpuid = PCPU_GET(cpuid); | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | its_init_cpu(device_t dev, struct gicv3_its_softc *sc) | ||||
ctlr |= GICR_CTLR_LPI_ENABLE; | ctlr |= GICR_CTLR_LPI_ENABLE; | ||||
gic_r_write_4(gicv3, GICR_CTLR, ctlr); | gic_r_write_4(gicv3, GICR_CTLR, ctlr); | ||||
/* Make sure the GIC has seen everything */ | /* Make sure the GIC has seen everything */ | ||||
dsb(sy); | dsb(sy); | ||||
if ((gic_its_read_8(sc, GITS_TYPER) & GITS_TYPER_PTA) != 0) { | if ((gic_its_read_8(sc, GITS_TYPER) & GITS_TYPER_PTA) != 0) { | ||||
/* This ITS wants the redistributor physical address */ | /* This ITS wants the redistributor physical address */ | ||||
target = vtophys(gicv3_get_redist_vaddr(dev)); | rpcpu = gicv3_get_redist(dev); | ||||
target = vtophys(rman_get_virtual(&rpcpu->res)); | |||||
} else { | } else { | ||||
/* This ITS wants the unique processor number */ | /* This ITS wants the unique processor number */ | ||||
target = GICR_TYPER_CPUNUM(gic_r_read_8(gicv3, GICR_TYPER)); | target = GICR_TYPER_CPUNUM(gic_r_read_8(gicv3, GICR_TYPER)); | ||||
} | } | ||||
sc->sc_its_cols[cpuid]->col_target = target; | sc->sc_its_cols[cpuid]->col_target = target; | ||||
sc->sc_its_cols[cpuid]->col_id = cpuid; | sc->sc_its_cols[cpuid]->col_id = cpuid; | ||||
▲ Show 20 Lines • Show All 1,070 Lines • Show Last 20 Lines |