MCPcopy Create free account
hub / github.com/F-Stack/f-stack / its_init_cpu

Function its_init_cpu

freebsd/arm64/arm64/gicv3_its.c:697–738  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

695}
696
697static int
698its_init_cpu(device_t dev, struct gicv3_its_softc *sc)
699{
700 device_t gicv3;
701 vm_paddr_t target;
702 u_int cpuid;
703 struct redist_pcpu *rpcpu;
704
705 gicv3 = device_get_parent(dev);
706 cpuid = PCPU_GET(cpuid);
707 if (!CPU_ISSET(cpuid, &sc->sc_cpus))
708 return (0);
709
710 /* Check if the ITS is enabled on this CPU */
711 if ((gic_r_read_4(gicv3, GICR_TYPER) & GICR_TYPER_PLPIS) == 0)
712 return (ENXIO);
713
714 rpcpu = gicv3_get_redist(dev);
715
716 /* Do per-cpu LPI init once */
717 if (!rpcpu->lpi_enabled) {
718 its_init_cpu_lpi(dev, sc);
719 rpcpu->lpi_enabled = true;
720 }
721
722 if ((gic_its_read_8(sc, GITS_TYPER) & GITS_TYPER_PTA) != 0) {
723 /* This ITS wants the redistributor physical address */
724 target = vtophys(rman_get_virtual(&rpcpu->res));
725 } else {
726 /* This ITS wants the unique processor number */
727 target = GICR_TYPER_CPUNUM(gic_r_read_8(gicv3, GICR_TYPER)) <<
728 CMD_TARGET_SHIFT;
729 }
730
731 sc->sc_its_cols[cpuid]->col_target = target;
732 sc->sc_its_cols[cpuid]->col_id = cpuid;
733
734 its_cmd_mapc(dev, sc->sc_its_cols[cpuid], 1);
735 its_cmd_invall(dev, sc->sc_its_cols[cpuid]);
736
737 return (0);
738}
739
740static int
741gicv3_its_sysctl_trace_enable(SYSCTL_HANDLER_ARGS)

Callers 2

gicv3_its_attachFunction · 0.85
gicv3_its_init_secondaryFunction · 0.85

Calls 7

device_get_parentFunction · 0.85
gic_r_read_4Function · 0.85
its_init_cpu_lpiFunction · 0.85
rman_get_virtualFunction · 0.85
gic_r_read_8Function · 0.85
its_cmd_mapcFunction · 0.85
its_cmd_invallFunction · 0.85

Tested by

no test coverage detected