Hi Stefano,

On 05/05/2021 09:25, Stefano Gurrieri wrote:
> Hello Ralf,
> 
> thanks for your advice. I've patched the driver
> /inmates/lib/arm-common/uart-imx.c/ and everything it works.

Excellent, patches welcome! :-)

> 
> Speaking in general, I find a bit strange that there aren't drivers
> ready to develop a bare-metal application into inmate cell (like for M4
> into MCUXpresso SDK).
> Do you know if in the future there will be implemented this "software
> layer"?
> For example if I want to use other peripherals (SPI, I2C, etc...)...
> there is something?

Inmates are used for tiny demos, testing the hypervisor or for
bootloading Linux. There's a infinite amount of different devices out
there - providing drivers for every device would end up in
reimplementing already existing operating systems. IOW, if you look for
extensive device support, you should consider moving from libinmate to
an embedded operating system (Linux, FreeRTOS, RTEMS, Zephyr, …).

Or, of course, if your application is reasonable small, implement the
missing drivers for libinmate.

  Ralf

> 
> Thank you.
> Waiting a feedback from you.
> Regards.
> Stefano
> 
> On Thursday, April 29, 2021 at 6:16:28 PM UTC+2 Ralf Ramsauer wrote:
> 
>     Hi Stefano,
> 
>     On 29/04/2021 10:45, Stefano Gurrieri wrote:
>     > Hello,
>     >
>     > I’ve experimented succefully jailhouse on my target
>     (var-som-mx8m-mini +
>     > symphony carrier board); specifically I’ve tested a second linux and
>     > other demos (ivshmem-demo, gic-demo...). 
>     >
>     > Furthermore, I’ve cross-compiled a very easy bare-metal
>     application, but
>     > I’m not able to use UART3 (second uart) from this cell (linux root
>     cell
>     > send correctly debug messages on UART4 -first uart-). Attached you
>     can find:
>     >
>     > - *imx8mm-uart-demo.c*                  my config cell
>     >
>     > - *uart-demo.c*                                   demo loaded into
>     > inmate cell
>     >
>     > Runtime, after enabling jailhouse, I enter:
>     >
>     > jailhouse cell create
>     /usr/share/jailhouse/cells/imx8mm-uart-demo.cell
>     >
>     > jailhouse cell load 1 /usr/share/jailhouse/inmates/uart-demo.bin
>     >
>     > jailhouse cell start 1
>     >
>     > In theory, I should be able to see “/printk(”blablabla”)/ messages
>     on my
>     > uart3 console (the second serial console), but I don’t see anything.
>     >
>     > ***
>     >
>     > Questions:
>     >
>     > 1. Have you some idea? What I got wrong?
>     >
>     > 2. The config cell seems correct, but I’m asking who initialize uart3
>     > serial? Linux? Because if it’s linux, the uart3 is disabled in the
>     dtb.
>     > Is it possible initialize uart3 serial also into jailhouse?
> 
>     If it's disabled in the DT, and nobody initialised it before, then yes,
>     there's a certain chance that the UART arrives unconfigured in the
>     cell.
> 
>     Have a look at inmates/lib/arm-common/uart-imx.c . The init routine
>     currently does nothing. IOW, you either need to patch the driver and
>     add
>     optional initialisation (you can have a look at other drivers, there
>     are
>     already appropriate fields in the config structures for uart
>     configuration), or rely on Linux to hand it over initialised.
> 
>     Ralf
> 
>     >
>     > Thanks a lot for your help in advance!
>     >
>     > Kind regards.
>     >
>     > Stefano
>     >
>     > --
>     > You received this message because you are subscribed to the Google
>     > Groups "Jailhouse" group.
>     > To unsubscribe from this group and stop receiving emails from it,
>     send
>     > an email to [email protected]
>     > <mailto:[email protected]>.
>     > To view this discussion on the web visit
>     >
>     
> https://groups.google.com/d/msgid/jailhouse-dev/dd1ffb4f-3c78-4a8d-9982-7b589e0f3754n%40googlegroups.com
>     
> <https://groups.google.com/d/msgid/jailhouse-dev/dd1ffb4f-3c78-4a8d-9982-7b589e0f3754n%40googlegroups.com>
> 
>     >
>     
> <https://groups.google.com/d/msgid/jailhouse-dev/dd1ffb4f-3c78-4a8d-9982-7b589e0f3754n%40googlegroups.com?utm_medium=email&utm_source=footer
>     
> <https://groups.google.com/d/msgid/jailhouse-dev/dd1ffb4f-3c78-4a8d-9982-7b589e0f3754n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Jailhouse" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jailhouse-dev/c2dffc36-35f4-43bf-8166-107f4fcae804n%40googlegroups.com
> <https://groups.google.com/d/msgid/jailhouse-dev/c2dffc36-35f4-43bf-8166-107f4fcae804n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/f2af08c1-490b-b421-4034-0c396d5d093a%40oth-regensburg.de.

Reply via email to