Skip to content

Commit a25ed73

Browse files
committed
GICv3 debug1
1 parent cd5c51d commit a25ed73

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

sys/arm64/arm64/gicv3_its.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,7 @@ its_init_cpu(device_t dev, struct gicv3_its_softc *sc)
704704

705705
gicv3 = device_get_parent(dev);
706706
cpuid = PCPU_GET(cpuid);
707+
printf("%s: cpuid: %u \n", __func__, PCPU_GET(cpuid));
707708
if (!CPU_ISSET(cpuid, &sc->sc_cpus))
708709
return (0);
709710

@@ -727,7 +728,7 @@ its_init_cpu(device_t dev, struct gicv3_its_softc *sc)
727728
target = GICR_TYPER_CPUNUM(gic_r_read_8(gicv3, GICR_TYPER)) <<
728729
CMD_TARGET_SHIFT;
729730
}
730-
731+
printf("%s: cpuid: %d, target: 0x%lX\n", __func__, cpuid, target);
731732
sc->sc_its_cols[cpuid]->col_target = target;
732733
sc->sc_its_cols[cpuid]->col_id = cpuid;
733734

@@ -869,24 +870,34 @@ gicv3_its_attach(device_t dev)
869870

870871
CPU_ZERO(&sc->sc_cpus);
871872
if (bus_get_domain(dev, &domain) == 0) {
873+
printf("%s: per domain cpus\n", __func__);
872874
if (domain < MAXMEMDOM)
873875
CPU_COPY(&cpuset_domain[domain], &sc->sc_cpus);
874876
} else {
875877
CPU_COPY(&all_cpus, &sc->sc_cpus);
878+
printf("%s: all cpus\n", __func__);
876879
}
877880

878881
/* Allocate the command circular buffer */
879882
gicv3_its_cmdq_init(sc);
880883

881884
/* Allocate the per-CPU collections */
882885
for (int cpu = 0; cpu <= mp_maxid; cpu++)
886+
{
887+
883888
if (CPU_ISSET(cpu, &sc->sc_cpus) != 0)
889+
{
884890
sc->sc_its_cols[cpu] = malloc(
885891
sizeof(*sc->sc_its_cols[0]), M_GICV3_ITS,
886892
M_WAITOK | M_ZERO);
893+
printf("%s: new its col[%d]\n", __func__, cpu);
894+
}
887895
else
896+
{
888897
sc->sc_its_cols[cpu] = NULL;
889-
898+
printf("%s: NULL its col[%d]\n", __func__, cpu);
899+
}
900+
}
890901
/* Enable the ITS */
891902
gic_its_write_4(sc, GITS_CTLR,
892903
gic_its_read_4(sc, GITS_CTLR) | GITS_CTLR_EN);
@@ -1045,8 +1056,10 @@ gicv3_its_select_cpu(device_t dev, struct intr_irqsrc *isrc)
10451056
sc->gic_irq_cpu = intr_irq_next_cpu(sc->gic_irq_cpu,
10461057
&sc->sc_cpus);
10471058
CPU_SETOF(sc->gic_irq_cpu, &isrc->isrc_cpu);
1059+
printf("%s: gic_irq_cpu: %d\n", __func__, sc->gic_irq_cpu);
10481060
}
1049-
1061+
else
1062+
printf("%s: cpuset not empty\n", __func__);
10501063
return (0);
10511064
}
10521065

@@ -1055,10 +1068,12 @@ gicv3_its_bind_intr(device_t dev, struct intr_irqsrc *isrc)
10551068
{
10561069
struct gicv3_its_irqsrc *girq;
10571070

1071+
printf("%s: Enter\n", __func__);
10581072
gicv3_its_select_cpu(dev, isrc);
10591073

10601074
girq = (struct gicv3_its_irqsrc *)isrc;
10611075
its_cmd_movi(dev, girq);
1076+
printf("%s: Leave\n", __func__);
10621077
return (0);
10631078
}
10641079

@@ -1101,6 +1116,7 @@ gicv3_its_init_secondary(device_t dev)
11011116
if (its_init_cpu(dev, sc) != 0)
11021117
panic("gicv3_its_init_secondary: No usable ITS on CPU%d",
11031118
PCPU_GET(cpuid));
1119+
printf("%s: cpuid: %u \n", __func__, PCPU_GET(cpuid));
11041120
}
11051121
#endif
11061122

@@ -1797,7 +1813,7 @@ its_cmd_movi(device_t dev, struct gicv3_its_irqsrc *girq)
17971813

17981814
sc = device_get_softc(dev);
17991815
col = sc->sc_its_cols[CPU_FFS(&girq->gi_isrc.isrc_cpu) - 1];
1800-
1816+
printf("%s: isrc_cpu %ld, col; %p\n", __func__, CPU_FFS(&girq->gi_isrc.isrc_cpu) - 1, col);
18011817
desc.cmd_type = ITS_CMD_MOVI;
18021818
desc.cmd_desc_movi.its_dev = girq->gi_its_dev;
18031819
desc.cmd_desc_movi.col = col;

0 commit comments

Comments
 (0)