Now I want to start fresh from what I think is the earliest call to initialize the GIC, this is found in bl31/bl31_main.c where we see:
unsigned int core_pos = plat_my_core_pos();
#if USE_GIC_DRIVER
/*
* Initialize the GIC driver as well as per-cpu and global interfaces.
* Platform has had an opportunity to initialise specifics.
*/
gic_init(core_pos);
gic_pcpu_init(core_pos);
gic_cpuif_enable(core_pos);
#endif /* USE_GIC_DRIVER */
We have ctags to help us working top down like this, making it easy to
investigate these 3 calls. We find:
/* in gicv3_base.c */
void __init gic_init(unsigned int cpu_idx)
{
gicv3_driver_init(&gic_data);
gicv3_distif_init();
}
We find gic_pcpu_init() also in gicv3_base.c.
Finally, the call to gic_cpuif_enable() just bounces the call to a driver routine like so:
void gic_cpuif_enable(unsigned int cpu_idx)
{
gicv3_cpuif_enable(cpu_idx);
}
One uses fixed addresses for the redistributor base, the other uses this probing scheme I discovered to build a list of redistributor addresses. All of this merits a closer look.
Tom's electronics pages / tom@mmto.org