how to get gic registers from dts

Mihai Carabas mihai.carabas at gmail.com
Fri Aug 7 19:31:11 UTC 2015


On Fri, Aug 7, 2015 at 11:43 AM, Mihai Carabas <mihai.carabas at gmail.com>
wrote:

> Hello,
>
> I'm trying to integrate the VGIC infrastructure into the VMM code and I
> want to use some of the current GIC code.
>
> I have a generic question about how the gic registers are geting filled up
> in this piece of code:
> 167 >-------if (bus_alloc_resources(dev, arm_gic_spec, sc->gic_res)) {
> 168 >------->-------device_printf(dev, "could not allocate resources\n");
> 169 >------->-------return (ENXIO);
> 170 >-------}
> 171
> 172 >-------arm_post_filter = gic_post_filter;
> 173
> 174 >-------/* Distributor Interface */
> 175 >-------sc->gic_d_bst = rman_get_bustag(sc->gic_res[0]);
> 176 >-------sc->gic_d_bsh = rman_get_bushandle(sc->gic_res[0]);
> 177
> 178 >-------/* CPU Interface */
> 179 >-------sc->gic_c_bst = rman_get_bustag(sc->gic_res[1]);
> 180 >-------sc->gic_c_bsh = rman_get_bushandle(sc->gic_res[1]);
>
> So bus_alloc_resource allocates the gic_res, but in that code I coudn't
> find where the bustag and bushandle are getting populated. I need to get
> the GICH_* and GICV_* registers (which are in the thrid and forth position
> in the DTS) and I must understand the logic.
>
> I manage to find out how to use the rman infrastructure. I needed the
physical and the virtual address of the cpu control interface to make the
same mapping in hyp mode ( rman_get_start(sc->gic_res[2]), (void*)
rman_get_virtual(sc->gic_res[2])))

Thanks,
Mihai


More information about the freebsd-arm mailing list