Re: HW access

Matthias Lange <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <[email protected]>
Hi,

On 08/09/2016 02:35 PM, ba_f wrote:
> Hello,
> 
> 
> due to sloppy documentation I need help from mailing-list, again.

We are constantly seeking to improve our documentation. What exactly did
you find sloppy or misleading?

> I want to access Hardware (HW) from a L4re-App.
> 
> Actually, I already did this with the old IO-config style.
> I described the HW in *.devs and *.io file and then I was accessing the
> HW, directly with l4io_request_iomem(ADDR, 4, L4IO_MEM_NONCACHED,
> &baseaddr);
> 
> With the new functions() style IO-config anything is described in a
> single *.io, right?

That is possible but not neccessary. You can still split io's
configuration into multiple files.

> Well, mine looks like this:
> 
> -- vim:ft=lua:
> Io.Dt.add_children(Io.system_bus(), function()
>   RNG = Io.Hw.Device(function()
>     compatible = {"dev-rng,mmio", "dev-rng"};
>     Property.hid  = "dev-rng, RNG_0";
>     Resource.regs = Io.Res.mmio(0x43c00000, 0x43c0ffff);
>   end);
> end);
> 
> Io.add_vbusses
> {
>     rng_server = Io.Vi.System_bus(function ()
>     dev = wrap(Io.system_bus():match("RNG"));

The match() function takes a string as an argument and compares it with
the list of CIDs. As your device tree does not contain a device with a
HID or CID matching "RNG", no device is added to the 'rng_server' vbus.

The solution is to supply a string from either the compatible table or
the hid property of the device(s) you want to match.

Btw, by adding a few '-v' options to io's cmdline you can make io more
verbose to e.g. print the whole device tree or vbus trees.

Matthias.

>   end);
> }
> 
> (Not sure if I really need 'compatible and 'Property.hid', here..?)
> 
> Anyway, all I see is output from IO but, no other L4Re-App seems to start.
> IO      | Io service
> IO      | Ready. Waiting for request.
> 
> Anybody already spot the fault?
> 
> May I still use l4io_request_iomem() to access the HW or, did things
> change here, too?
> 
> 
> 
> Thanks,
> 
> ba_f
> 
> _______________________________________________
> l4-hackers mailing list
> [email protected]
> http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers


-- 
Matthias Lange, [email protected], +49-351-41 888 614

Kernkonzept GmbH.  Sitz: Dresden.  Amtsgericht Dresden, HRB 31129.
Geschäftsführer: Dr.-Ing. Michael Hohmuth
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.