Genode onto i.mx53 qsb

Stefan Kalkowski stefan.kalkowski at ...1...
Mon Sep 22 11:19:00 CEST 2014


Hi,

On 09/19/2014 06:24 AM, Joseph Lee wrote:
> Thank you for your explanation Stefan,
> 
> Currently, I am testing the simple 'tz_vmm' run example. As you
> mentioned, I tried to make 'UNSECURE' all the devices such as I2C GPIO
> and IPU. In addition, I also changed the kernel cmdline argument in
> genode/os/src/server/tz_vmm/imx53/main.cc (/console=ttymxc0,115200
> gpu_nommu video=mxcdi0fb:RGB666,XGA di0_primary ldb=di0/)
> But still the Linux doesn't show up on the screen(lvds). is there any
> other configuration?

Sure, as I explained in my last mail, in that example Linux uses a
para-virtualized framebuffer instead of the original i.MX53 IPU. To
change that, you'll have to compile Linux on your own without the
changes regarding the para-virtualized framebuffer. The modified Linux
source code can be found here:

  https://github.com/skalk/linux.git (branch imx53-tz)

If you revert the last four commits I assume it should work.

> 
> Another question is that how do we run a trusted application inside the
> secure world (Genode) in this simple 'tz_vmm' example?

Every application you incorporate into the run script (os/run/tz_vmm)
will be started as part of the secure side. To get familiar with the
configuration of Genode's init process, have a look at here:

  http://genode.org/documentation/developer-resources/init

or alternatively in 'repos/os/doc/init.txt'. Moreover, there are plenty
of other run scripts available within the Genode source tree that might
serve you as guideline.

The configuration itself hardly depends on what kind of application you
like to incorporate. When you dismantle the tz_vmm scenario in a way
that Linux uses all peripheral devices exclusively, I assume you're
planning to incorporate a non-interactive application?

Regards
Stefan

> 
> Thanks in advance for your answers.
> 
> 
> On Wed, Sep 17, 2014 at 7:55 AM, Stefan Kalkowski
> <stefan.kalkowski at ...1...
> <mailto:stefan.kalkowski at ...1...>> wrote:
> 
>     Hi Joseph,
> 
>     within the 'tz_vmm' run example Genode's framebuffer driver for i.MX53
>     isn't used at all. It is a very simple example used for testing the
>     TrustZone world-switch regulary. It only starts the simple TrustZone
>     VMM, which boots Linux. Linux thereby uses the devices (that are
>     configured in the kernel) directly without interaction with the
>     secure side.
> 
>     Given your last mail, I was assuming you want Linux to use the
>     framebuffer directly too. In that case, I forgot to mention that you'll
>     have to mark the appropriated devices like I2C and GPIO controller, as
>     well as the IPU as unsecure devices, which is hardcoded in the
>     constructor of the central security unit of that platform:
> 
>       repos/base-hw/src/core/include/spec/imx53/trustzone/csu.h
> 
>     However, if you want Linux (the unsecure world) to share the framebuffer
>     with the secure Genode world, then you'll have to incorporate at least
>     the framebuffer driver (maybe a graphical system and some other
>     applications) into the run-script. A good starting point are our
>     run-scripts for graphical systems e.g.: repos/os/run/demo.run
> 
>     Moreover, the simple VMM example in the current mainline Genode
>     repository doesn't include the handling of the para-virtualized
>     framebuffer device that is used in the TrustZone-specific Linux version
>     we use. Whenever Linux is using another memory range as framebuffer,
>     this is propagated to the VMM via a hypercall, have a look here:
> 
> 
>     https://github.com/skalk/linux/blob/bc1707a23a9770cf080a1b87b4f553a2a39ac636/drivers/video/mxc/mxc_ipuv3_fb.c
> 
>     On the secure, the VMM has to use the information to either copy
>     regularyly the content of the Linux framebuffer to some window, or it
>     uses the special overlay functionality of the i.MX53 IPU to let the
>     hardware copy the content. Both approaches are used in the graphical
>     demo for the i.MX53 SABRE tablet. The corresponding code of the VMM of
>     that example can be found here:
> 
> 
>     https://github.com/skalk/genode/tree/i.MX53_tablet_demo/os/src/server/vmm/imx53
> 
>     You might use it as a starting point to turn the 'tz_vmm' scenario into
>     a graphical one.
> 
>     Regards
>     Stefan
> 
>     On 09/16/2014 06:33 PM, Joseph Lee wrote:
>     > Hi Stefan,
>     >
>     > Thank you again for you reply
>     >
>     > I just noticed that the i.MX53 framebuffer driver doesn't detect the
>     > lvds display configuration automatically.
>     > I tried to change the default LCD display configuration (resolution) in
>     > the driver code.
>     >
>     > https://github.com/genodelabs/genode/blob/master/repos/os/src/drivers/framebuffer/imx53/driver.h
>     >
>     >
>     > So i changed the values of qsb_width and qsb_height to the corresponding
>     > lvds values(1024 x 768).
>     > But still i don't see anything on the screen.
>     >
>     > Could you please let me know if there is any other configuration? thank
>     > you in advance for your answers.
>     >
>     > best regards,
>     > Joseph
>     >
>     > On Tue, Sep 16, 2014 at 8:04 AM, Stefan Kalkowski
>     > <stefan.kalkowski at ...1...
>     <mailto:stefan.kalkowski at ...1...>
>     > <mailto:stefan.kalkowski at ...1...
>     <mailto:stefan.kalkowski at ...1...>>> wrote:
>     >
>     >     Hi Joseph,
>     >
>     >     On 09/15/2014 05:20 PM, Joseph Lee wrote:
>     >     > Thank you Stefan for your valuable feedback
>     >     >
>     >     > I think it is working now. But i have another issue. There
>     is nothing
>     >     > displayed on the screen (LVDS Display kit)
>     >     > I already configured the u-boot environment variable
>     bootargs_base.
>     >     >
>     >     >          bootargs_base=set bootargs console=ttymxc0,115200
>     gpu_nommu ${lvds}
>     >     >
>     >     > And it is working with the per-installed Linux operating
>     system. I am
>     >     > using u-boot 2009.08 version.
>     >     >
>     >     > Herewith, i have attached the output on serial console.
>     >     >
>     >     > What is still missing? thank you in advance
>     >
>     >     The u-boot variable you mentioned is used when u-boot starts
>     the Linux
>     >     kernel. Then the bootloader provides the corresponding
>     arguments to the
>     >     kernel. In our small test scenario, a Genode application
>     called tz_vmm
>     >     fulfills the role of the bootloader for the Linux instance
>     running in
>     >     TrustZone's "normal world". Therefore, the tz_vmm has to
>     provide the
>     >     arguments to the Linux kernel. They are hardcoded in the
>     application,
>     >     have a look at:
>     >
>     >
>     >   
>      https://github.com/genodelabs/genode/blob/master/repos/os/src/server/tz_vmm/imx53/main.cc
>     >
>     >     In line 36 you see the command line for the Linux kernel.
>     >
>     >     Regards
>     >     Stefan
>     >
>     >     >
>     >     > regards,
>     >     > Joseph
>     >     >
>     >     > On Mon, Sep 15, 2014 at 8:44 AM, Stefan Kalkowski
>     >     > <stefan.kalkowski at ...1...
>     <mailto:stefan.kalkowski at ...1...>
>     >     <mailto:stefan.kalkowski at ...1...
>     <mailto:stefan.kalkowski at ...1...>>
>     >     > <mailto:stefan.kalkowski at ...1...
>     <mailto:stefan.kalkowski at ...1...>
>     >     <mailto:stefan.kalkowski at ...1...
>     <mailto:stefan.kalkowski at ...1...>>>> wrote:
>     >     >
>     >     >     Hi Joseph,
>     >     >
>     >     >     what u-boot version do you use? I recently run into a
>     similar
>     >     problem
>     >     >     when using a recent u-boot version. It had to do with a more
>     >     strict
>     >     >     checking before unzipping. To test out whether it is the
>     same
>     >     problem
>     >     >     try to run the image without compressing it. Therefore, you
>     >     might build
>     >     >     your uImage by hand:
>     >     >
>     >     >       /usr/local/genode-gcc/bin/genode-arm-objcopy -O binary \
>     >     >       var/run/tz_vmm/image.elf var/run/tz_vmm/image.bin
>     >     >
>     >     >     and:
>     >     >
>     >     >       mkimage -A arm -O linux -T kernel -C none -a 0x70010000 \
>     >     >       -e 0x70010000 -d var/run/tz_vmm/image.bin
>     var/run/tz_vmm/uImage
>     >     >
>     >     >     If that works for you it's probably the same issue.
>     >     >
>     >     >     Regards
>     >     >     Stefan
>     >     >
>     >     >     On 09/14/2014 06:47 AM, Joseph Lee wrote:
>     >     >     > Hello,
>     >     >     >
>     >     >     > I'm trying to port genode onto i.mx53 quick start board. I
>     >     followed the
>     >     >     > building steps in this thread.
>     >     >     >
>     >   
>      http://sourceforge.net/p/genode/mailman/genode-main/thread/9167aa55bacd5e3f00e64168280aef3e%40lcc.uma.es/#msg31683911
>     >     >     >
>     >     >     > Now i get /uImage/ in in the building
>     >     directory(var/run/tz_vmm) with
>     >     >     > other two files (/boot_modules.s/ and /image.elf/).
>     The size of
>     >     >     /uImage/
>     >     >     > is 7.5MB
>     >     >     >
>     >     >     > I loaded the /uImage/ to memory address 0x70800000.
>     When I tried
>     >     >     to boot
>     >     >     > with the same memory address (bootm 0x70800000), i get the
>     >     following error.
>     >     >     >
>     >     >     > ## Booting kernel from Legacy Image at 70800000 ...
>     >     >     >    Image Name:
>     >     >     >    Image Type:   ARM Linux Kernel Image (gzip compressed)
>     >     >     >    Data Size:    7858693 Bytes =  7.5 MB
>     >     >     >    Load Address: 70010000
>     >     >     >    Entry Point:  70010000
>     >     >     >    Verifying Checksum ... OK
>     >     >     >    Uncompressing Kernel Image ... Error: inflate()
>     returned -5
>     >     >     > GUNZIP: uncompress, out-of-mem or overwrite error - must
>     >     RESET board to
>     >     >     > recover
>     >     >     > resetting ...
>     >     >     >
>     >     >     > I tried again with another memory address (0x78000000) if
>     >     there was
>     >     >     > overlap. Still I get the same result.
>     >     >     >
>     >     >     > I also checked if there is overlap with the physical
>     address
>     >     ranges used
>     >     >     > by u-boot bootloader using /readelf/.
>     >     >     >
>     >     >     > Here is the output
>     >     >     >
>     >     >     > Elf file type is EXEC (Executable file)
>     >     >     > Entry point 0x70010000
>     >     >     > There are 3 program headers, starting at offset 52
>     >     >     >
>     >     >     > Program Headers:
>     >     >     >   Type                  Offset   VirtAddr   PhysAddr
>     >      FileSiz MemSiz
>     >     >     > Flg Align
>     >     >     >   EXIDX          0x077138 0x7007f138 0x7007f138 0x02578
>     >     0x02578 R   0x4
>     >     >     >   LOAD           0x008000 0x70010000 0x70010000 0x6ac64
>     >     0x6ac64 R E 0x8000
>     >     >     >   LOAD           0x073000 0x7007b000 0x7007b000 0x0b03c
>     >     0xd3ed5 RW  0x8000
>     >     >     >
>     >     >     > What is missing? thanks in advance
>     >     >     >
>     >     >     > best regards,
>     >     >     > Joseph,
>     >     >     >
>     >     >     >
>     >     >     >
>     >     >     >
>     >     >
>     >     
>     ------------------------------------------------------------------------------
>     >     >     > Want excitement?
>     >     >     > Manually upgrade your production database.
>     >     >     > When you want reliability, choose Perforce
>     >     >     > Perforce version control. Predictably reliable.
>     >     >     >
>     >     >
>     >     
>     http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
>     >     >     >
>     >     >     >
>     >     >     >
>     >     >     > _______________________________________________
>     >     >     > genode-main mailing list
>     >     >     > genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>
>     >     <mailto:genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>>
>     >     >     <mailto:genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>
>     >     <mailto:genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>>>
>     >     >     > https://lists.sourceforge.net/lists/listinfo/genode-main
>     >     >     >
>     >     >
>     >     >     --
>     >     >     Stefan Kalkowski
>     >     >     Genode Labs
>     >     >
>     >     >     http://www.genode-labs.com/ · http://genode.org/
>     >     >
>     >     >     ------------------------------------------------------------------------------
>     >     >     Want excitement?
>     >     >     Manually upgrade your production database.
>     >     >     When you want reliability, choose Perforce
>     >     >     Perforce version control. Predictably reliable.
>     >     >     http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
>     >     >     _______________________________________________
>     >     >     genode-main mailing list
>     >     >     genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>
>     >     <mailto:genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>>
>     >     >     <mailto:genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>
>     >     <mailto:genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>>>
>     >     >     https://lists.sourceforge.net/lists/listinfo/genode-main
>     >     >
>     >     >
>     >     >
>     >     >
>     >     > ------------------------------------------------------------------------------
>     >     > Want excitement?
>     >     > Manually upgrade your production database.
>     >     > When you want reliability, choose Perforce
>     >     > Perforce version control. Predictably reliable.
>     >     > http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
>     >     >
>     >     >
>     >     >
>     >     > _______________________________________________
>     >     > genode-main mailing list
>     >     > genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>
>     >     <mailto:genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>>
>     >     > https://lists.sourceforge.net/lists/listinfo/genode-main
>     >     >
>     >
>     >     --
>     >     Stefan Kalkowski
>     >     Genode Labs
>     >
>     >     http://www.genode-labs.com/ · http://genode.org/
>     >
>     >     ------------------------------------------------------------------------------
>     >     Want excitement?
>     >     Manually upgrade your production database.
>     >     When you want reliability, choose Perforce.
>     >     Perforce version control. Predictably reliable.
>     >     http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
>     >     _______________________________________________
>     >     genode-main mailing list
>     >     genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>
>     >     <mailto:genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>>
>     >     https://lists.sourceforge.net/lists/listinfo/genode-main
>     >
>     >
>     >
>     >
>     > ------------------------------------------------------------------------------
>     > Want excitement?
>     > Manually upgrade your production database.
>     > When you want reliability, choose Perforce.
>     > Perforce version control. Predictably reliable.
>     > http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
>     >
>     >
>     >
>     > _______________________________________________
>     > genode-main mailing list
>     > genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>
>     > https://lists.sourceforge.net/lists/listinfo/genode-main
>     >
> 
>     --
>     Stefan Kalkowski
>     Genode Labs
> 
>     http://www.genode-labs.com/ · http://genode.org/
> 
>     ------------------------------------------------------------------------------
>     Want excitement?
>     Manually upgrade your production database.
>     When you want reliability, choose Perforce
>     Perforce version control. Predictably reliable.
>     http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
>     _______________________________________________
>     genode-main mailing list
>     genode-main at lists.sourceforge.net
>     <mailto:genode-main at lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/genode-main
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Slashdot TV.  Video for Nerds.  Stuff that Matters.
> http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
> 
> 
> 
> _______________________________________________
> genode-main mailing list
> genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
> 

-- 
Stefan Kalkowski
Genode Labs

http://www.genode-labs.com/ · http://genode.org/




More information about the users mailing list