Date: Fri, 7 Aug 2015 22:31:08 +0300 From: Mihai Carabas <mihai.carabas@gmail.com> To: freebsd-arm@freebsd.org Subject: Re: how to get gic registers from dts Message-ID: <CANg1yUtP%2BF2=13yPvS4uVFwzi7y%2BV27g-Ch0=9zYoaMKX15MPg@mail.gmail.com> In-Reply-To: <CANg1yUsSNZV9%2BtFi-VY4mLxXzh2PmcNWSWoHDXQdcpsY6dVR2A@mail.gmail.com> References: <CANg1yUsSNZV9%2BtFi-VY4mLxXzh2PmcNWSWoHDXQdcpsY6dVR2A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 7, 2015 at 11:43 AM, Mihai Carabas <mihai.carabas@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANg1yUtP%2BF2=13yPvS4uVFwzi7y%2BV27g-Ch0=9zYoaMKX15MPg>