Genode on iMX53 with TrustZone

JaeminPark jmpark81 at ...9...
Thu Mar 12 12:54:13 CET 2015


Hi, Martin.

I used hw_imx53_tz build directory to build tz_vmm scenario.
However, I’m not sure whether I did the right thing regard of “u-boot”.

I’m posting my etc/specs.conf as follows (only 2 lines):
SPECS = genode hw_imx53_qsb_tz
SPECS += perf_counter

I just performed the following procedure to build and install u-boot to my sdcard posted in https://tthtlc.wordpress.com/2015/02/21/getting-genode-with-trustzone-on-the-i-mx53-quick-start-board/ <https://tthtlc.wordpress.com/2015/02/21/getting-genode-with-trustzone-on-the-i-mx53-quick-start-board/>.
Below, uImage came from Genode 15.02 and I’m quite confident that it is built correctly.
Now, to download u-boot bootloader (and its ARM gcc compiler):

git clone https://github.com/m-stein/uboot <https://github.com/m-stein/uboot> uboot_stein

cd uboot_stein/

wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.9-2014.09_linux.tar.xz <http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.9-2014.09_linux.tar.xz>
Extract out the config file:

make ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-arm-none-eabi-4.9-2014.09_linux/bin/arm-none-eabi- usbarmory_config

Now start the make process:

make ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-arm-none-eabi-4.9-2014.09_linux/bin/arm-none-eabi- V=1

Notice a “u-boot.imx” is created. But first we need to format the sdcard.

(from hence onwards my sdcard is detected as /dev/sdg???):

Aim: make a sdcard from uImage, which will require uboot bootloader:

sudo parted /dev/sdg –script mklabel msdos

sudo parted /dev/sdg –script mkpart primary ext4 5M 100%

Upon completion, “dd” the u-boot.imx (which is meant for imx53 as the target) to the sdcard’s 3rd 512-block:

sudo dd if=./u-boot.imx of=/dev/sdg seek=2 bs=512 conv=fsync

Take a look at the partition:

sudo fdisk -l /dev/sdg

sudo mkfs.ext4 /dev/sdg1

Now /dev/sdg1 is ext4-formatted, mount it:

udisks –mount /dev/sdg1

Copy the uImage there to the rootfs:

cp uImage /media/371a8dd7-58c1-4beb-aed3-cb18fb40f7eb/

And umount it:

sudo udisks –umount /dev/sdg1


> 2015. 3. 12., 오후 8:32, Martin Stein <martin.stein at ...1...> 작성:
> 
> Hi Jaemin,
> 
> On 12.03.2015 12:10, Martin Stein wrote:
>> 
>> 
>> 
>> -------- Forwarded Message --------
>> Subject:	Genode on iMX53 with TrustZone
>> Date:	Thu, 12 Mar 2015 16:05:30 +0900
>> From:	JaeminPark <jmpark81 at ...9...> <mailto:jmpark81 at ...9...>
>> To:	martin.stein at ...1... <mailto:martin.stein at ...1...>
>> 
>> Dear,
>> 
>> I’m writing this e-mail to ask you some questions to build and boot Genode with TrustZone into FreeScales iMX53 QSB.
>> 
>> According to the article in https://sourceforge.net/p/genode/mailman/message/33584768/ <https://sourceforge.net/p/genode/mailman/message/33584768/>, I could build and boot (maybe) Genode in my iMX53 board.
>> Through the serial, I only could see the log as bellow :
>> 
>>>> Starting kernel …
>> 
>> kernel initialized
>> Genode 15.02
>> init main() : — create local services —
>>>> [init -> tz_vmm] Start virtual machine…
>> 
>> After this log, I could see only blinking prompt.
> 
> This indicates that Genode is properly started but something is wrong with the Linux in the non-secure world. Either it fails in booting or it's output doesn't reach the UART you're listening on (the same that Genode uses).
> 
>> 
>> Is this successful boot of Genode with TrustZone? 
>> If possible, can you provide me with successful log on iMX53 QSB?
> 
> Attachment [1] is a proper output of the 'tz_vmm' scenario on the i.MX53 Quick Start Board using a 'hw_imx53_qsb_tz' build dir.
> 
>> 
>> Furthermore, I’d like to boot guest OS (normal world OS) after booting up Genode with TrustZone.
>> Is there any way for this?
>> 
> 
> The 'tz_vmm' test is exactly about that. It attempts to start a 2.6 Linux kernel (Freescale vendor adaption) in the non-secure world and allows it to use the same UART as Genode for serial user IO.
> 
> Make sure that you're using a build dir for 'hw_imx53_qsb_tz' and not for 'hw_usb_armory' although it's the same SOC. Can you please send me the content of your '$BUILD_DIR/etc/specs.conf'? Furthermore, are you trying or have you previously tried to use a self-build Linux/Initrd or have you just run 'tz_vmm' without any further preparation? To be on the safe side do 'rm $BUILD_DIR/bin/*' before building 'tz_vmm'.
> 
> Cheers,
> Martin
> 
> 
> 
> [1]
> 
> ## Booting kernel from Legacy Image at b0000000 ...
>    Image Name:   
>    Image Type:   ARM Linux Kernel Image (gzip compressed)
>    Data Size:    7869964 Bytes = 7.5 MiB
>    Load Address: 70010000
>    Entry Point:  70010000
>    Verifying Checksum ... OK
>    Uncompressing Kernel Image ... OK
> 
> Starting kernel ...
> 
> kernel initialized
> Genode 15.02-34-gb5355c4
> int main(): --- create local services ---
> int main(): --- start init ---
> int main(): transferred 246 MB to init
> int main(): --- init created, waiting for exit condition ---
> [init] Could not open ROM session for module "ld.lib.so"
> [init] parent provides
> [init]   service "ROM"
> [init]   service "RAM"
> [init]   service "IRQ"
> [init]   service "IO_MEM"
> [init]   service "CAP"
> [init]   service "PD"
> [init]   service "RM"
> [init]   service "CPU"
> [init]   service "LOG"
> [init]   service "SIGNAL"
> [init]   service "VM"
> [init] child "tz_vmm"
> [init]   RAM quota:  3932160
> [init]   ELF binary: tz_vmm
> [init]   priority:   0
> [init -> tz_vmm] Start virtual machine ...
> Initializing cgroup subsys cpu
> Linux version 2.6.35.3-01270-g9533414 (kalle at ...313...) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #843 PREEMPT Wed Nov 27 14:43:11 CET 2013
> CPU: ARMv7 Processor [412fc085] revision 5 (ARMv7), cr=10c53c7f
> CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
> Machine: Freescale MX53 LOCO Board
> Memory policy: ECC disabled, Data cache writeback
> Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 24384
> Kernel command line: console=ttymxc0,115200
> PID hash table entries: 512 (order: -1, 2048 bytes)
> Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
> Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
> allocated 491520 bytes of page_cgroup
> please try 'cgroup_disable=memory' option if you don't want memory cgroups
> Memory: 96MB = 96MB total
> Memory: 82964k/82964k available, 15340k reserved, 0K highmem
> Virtual kernel memory layout:
>     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
>     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
>     DMA     : 0xfde00000 - 0xffe00000   (  32 MB)
>     vmalloc : 0xc6800000 - 0xf4000000   ( 728 MB)
>     lowmem  : 0xc0000000 - 0xc6000000   (  96 MB)
>     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
>     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
>       .init : 0xc0008000 - 0xc0038000   ( 192 kB)
>       .text : 0xc0038000 - 0xc0866000   (8376 kB)
>       .data : 0xc0888000 - 0xc08e7640   ( 382 kB)
> SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
> Hierarchical RCU implementation.
>     RCU-based detection of stalled CPUs is disabled.
>     Verbose stalled-CPUs detection is disabled.
> NR_IRQS:368
> MXC GPIO hardware
> MXC IRQ initialized
> MXC_Early serial console at MMIO 0x53fbc000 (options '115200')
> bootconsole [ttymxc0] enabled
> Console: colour dummy device 80x30
> Calibrating delay loop... 999.42 BogoMIPS (lpj=4997120)
> pid_max: default: 32768 minimum: 301
> Security Framework initialized
> Mount-cache hash table entries: 512
> Initializing cgroup subsys debug
> Initializing cgroup subsys ns
> Initializing cgroup subsys cpuacct
> Initializing cgroup subsys memory
> Initializing cgroup subsys devices
> Initializing cgroup subsys freezer
> Initializing cgroup subsys blkio
> CPU: Testing write buffer coherency: ok
> regulator: core version 0.5
> NET: Registered protocol family 16
> i.MX IRAM pool: 128 KB at ...314...
> FAILED TO RELEASE IRAM PARTITION
> CPU is i.MX0 Revision 0.0
> Using SDMA I.API
> MXC DMA API initialized
> IMX usb wakeup probe
> IMX usb wakeup probe
> bio: create slab <bio-0> at 0
> SCSI subsystem initialized
> Freescale USB OTG Driver loaded, $Revision: 1.55 $
> 
> ****************************** NOTICE *****************************
> You have seen this notice as you have enabled OTG driver for mx53 LOCO board
> For mx53 loco board, the OTG function is unavailable due to hardware limitation
> So, Only one usb function (device or host) can be available for certain image
> Please config your kernel to disable OTG and the usb function you don't want to use
> And remain the other usb function you would like to use
> 
> Below OTG configs should be removed:
> CONFIG_MXC_OTG, CONFIG_USB_OTG
> 
> Choose one of below configs for host or device function
> But DO NOT choose them together
> 
> OTG host config
> CONFIG_USB_EHCI_ARC_OTG
> 
> OTG device config
> CONFIG_USB_GADGET
> 
> usbcore: registered new interface driver usbfs
> usbcore: registered new interface driver hub
> usbcore: registered new device driver usb
> da9052_ssc_i2c 0-0048: 2 - da9052_i2c_read:master_xfer Failed!!
> da9052_i2c_is_connected - i2c read failed.....
> da9052_ssc_i2c 0-0048: 2 - da9052_i2c_read:master_xfer Failed!!
> da9052_i2c_is_connected - i2c read failed.....
> da9052_ssc_i2c 0-0048: 2 - da9052_i2c_read:master_xfer Failed!!
> da9052_i2c_is_connected - i2c read failed.....
> da9052_ssc_i2c 0-0048: 2 - da9052_i2c_read:master_xfer Failed!!
> da9052_i2c_is_connected - i2c read failed.....
> da9052_ssc_i2c 0-0048: 2 - da9052_i2c_read:master_xfer Failed!!
> da9052_i2c_is_connected - i2c read failed.....
> da9052_ssc_i2c 0-0048: 2 - da9052_i2c_read:master_xfer Failed!!
> da9052_i2c_is_connected - i2c read failed.....
> da9052_ssc_i2c 0-0048: 2 - da9052_i2c_read:master_xfer Failed!!
> da9052_i2c_is_connected - i2c read failed.....
> da9052_ssc_i2c 0-0048: 2 - da9052_i2c_read:master_xfer Failed!!
> da9052_i2c_is_connected - i2c read failed.....
> da9052_ssc_i2c 0-0048: 2 - da9052_i2c_read:master_xfer Failed!!
> da9052_i2c_is_connected - i2c read failed.....
> da9052_ssc_i2c 0-0048: 2 - da9052_i2c_read:master_xfer Failed!!
> da9052_i2c_is_connected - i2c read failed.....
> da9052_ssc_i2c 0-0048: 2 - da9052_i2c_read:master_xfer Failed!!
> da9052_i2c_is_connected - i2c read failed.....
> Advanced Linux Sound Architecture Driver Version 1.0.23.
> Bluetooth: Core ver 2.15
> NET: Registered protocol family 31
> Bluetooth: HCI device and connection manager initialized
> Bluetooth: HCI socket layer initialized
> Switching to clocksource mxc_timer1
> NET: Registered protocol family 2
> IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
> TCP established hash table entries: 4096 (order: 3, 32768 bytes)
> TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
> TCP: Hash tables configured (established 4096 bind 4096)
> TCP reno registered
> UDP hash table entries: 256 (order: 0, 4096 bytes)
> UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
> NET: Registered protocol family 1
> RPC: Registered udp transport module.
> RPC: Registered tcp transport module.
> RPC: Registered tcp NFSv4.1 backchannel transport module.
> Unpacking initramfs...
> Freeing initrd memory: 4232K
> LPMode driver module loaded
> sdram autogating driver module loaded
> Bus freq driver module loaded
> DI1 is primary
> mxc_dvfs_core_probe
> mxc_dvfs_core_probe: failed to get gp regulator
> DVFS driver module loaded
> i.MXC CPU frequency driver
> mxc_cpufreq_driver_init: failed to get gp regulator
> DVFS PER driver module loaded
> ashmem: initialized
> msgmni has been set to 170
> alg: No test for stdrng (krng)
> cryptodev: driver loaded.
> io scheduler noop registered
> io scheduler deadline registered
> io scheduler cfq registered (default)
> By setting, SII driver will not be enabled
> mxcfb_probe: no remap
> mxcfb_probe: no remap
> mxcfb_probe: no remap
> Serial: MXC Internal UART driver
> mxcintuart.0: ttymxc0 at MMIO 0x53fbc000 (irq = 31) is a Freescale i.MX
> console [ttymxc0] enabled, bootconsole disabled
> console [ttymxc0] enabled, bootconsole disabled
> mxcintuart.1: ttymxc1 at MMIO 0x53fc0000 (irq = 32) is a Freescale i.MX
> mxcintuart.2: ttymxc2 at MMIO 0x5000c000 (irq = 33) is a Freescale i.MX
> mxcintuart.3: ttymxc3 at MMIO 0x53ff0000 (irq = 13) is a Freescale i.MX
> mxcintuart.4: ttymxc4 at MMIO 0x63f90000 (irq = 86) is a Freescale i.MX
> loop: module loaded
> pmem_adsp: 0 init
> pmem_gpu: 1 init
> MXC MTD nand Driver 3.0
> i.MX GPMI NFC
> vcan: Virtual CAN interface driver
> Freescale FlexCAN Driver 
> FEC Ethernet Driver
> fec_enet_mii_bus: probed
> PPP generic driver version 2.4.2
> PPP Deflate Compression module registered
> PPP BSD Compression module registered
> PPP MPPE Compression module registered
> NET: Registered protocol family 24
> tun: Universal TUN/TAP device driver, 1.6
> tun: (C) 1999-2004 Max Krasnyansky <maxk at ...293...> <mailto:maxk at ...316....>
> ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
> fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
> fsl-ehci fsl-ehci.0: irq 18, io base 0x53f80000
> fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
> hub 1-0:1.0: USB hub found
> hub 1-0:1.0: 1 port detected
> fsl-ehci fsl-ehci.1: Freescale On-Chip EHCI Host Controller
> fsl-ehci fsl-ehci.1: new USB bus registered, assigned bus number 2
> fsl-ehci fsl-ehci.1: irq 14, io base 0x53f80200
> fsl-ehci fsl-ehci.1: USB 2.0 started, EHCI 1.00
> hub 2-0:1.0: USB hub found
> hub 2-0:1.0: 1 port detected
> usbcore: registered new interface driver cdc_acm
> cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters
> Initializing USB Mass Storage driver...
> usbcore: registered new interface driver usb-storage
> USB Mass Storage support registered.
> usbcore: registered new interface driver usbserial
> usbserial: USB Serial Driver core
> USB Serial support registered for GSM modem (1-port)
> usbcore: registered new interface driver option
> option: v0.7.2:USB Driver for GSM modems
> ARC USBOTG Device Controller driver (1 August 2005)
> Android usb driver initialize
> android_usb gadget: android_usb ready
> fsl-usb2-udc: bind to driver android_usb 
> android gadget: register function adb
> android gadget: register function usb_mass_storage
> android gadget: register function rndis
> rndis_function_bind_config MAC: 00:00:00:00:00:00
> android_usb gadget: using random self ethernet address
> android_usb gadget: using random host ethernet address
> usb0: MAC 96:ad:9a:32:b9:5f
> usb0: HOST MAC 72:e8:02:9d:bb:a5
> android_usb gadget: usb_mass_storage, version: 2009/09/11
> android_usb gadget: Number of LUNs=3
>  lun0: LUN: removable file: (no medium)
>  lun1: LUN: removable file: (no medium)
>  lun2: LUN: removable file: (no medium)
> f_accessory init
> android gadget: register function accessory
> mice: could not register psaux device, error: -16
> mice: PS/2 mouse device common for all mice
> input: gpio-keys as /devices/platform/gpio-keys/input/input0
> MXC keypad loaded
> input: eGalax Touch Screen as /devices/virtual/input/input1
> input: FSL MPR121 Touchkey as /devices/virtual/input/input2
> p1003_fwv33 2-0041: couldn't read panel infomation.
> p1003_fwv33: probe of 2-0041 failed with error -5
> using rtc device, mxc_rtc, for alarms
> mxc_rtc mxc_rtc.0: rtc core: registered mxc_rtc as rtc0
> i2c /dev entries driver
> IR NEC protocol handler initialized
> IR RC5(x) protocol handler initialized
> IR RC6 protocol handler initialized
> IR JVC protocol handler initialized
> IR Sony protocol handler initialized
> Linux video capture interface: v2.00
> usbcore: registered new interface driver uvcvideo
> USB Video Class driver (v0.1.0)
> APM Battery Driver
> MXC WatchDog Driver 2.0
> MXC Watchdog # 0 Timer: initial timeout 60 sec
> device-mapper: ioctl: 4.17.0-ioctl (2010-03-05) initialised: dm-devel at ...52...315... <mailto:dm-devel at ...315...>
> Bluetooth: Virtual HCI driver ver 1.3
> Bluetooth: HCI UART driver ver 2.2
> Bluetooth: HCIATH3K protocol initialized
> Bluetooth: Generic Bluetooth USB driver ver 0.6
> usbcore: registered new interface driver btusb
> VPU initialized
> mxc_asrc registered
> gpu mmu disabled
> mxsdhci: MXC Secure Digital Host Controller Interface driver
> mxsdhci: MXC SDHCI Controller Driver. 
> mmc0: SDHCI detect irq 0 irq 1 INTERNAL DMA
> mxsdhci: MXC SDHCI Controller Driver. 
> mmc1: SDHCI detect irq 203 irq 3 INTERNAL DMA
> usbcore: registered new interface driver usbhid
> usbhid: USB HID core driver
> logger: created 64K log 'log_main'
> logger: created 256K log 'log_events'
> logger: created 64K log 'log_radio'
> logger: created 64K log 'log_system'
> Cirrus Logic CS42888 ALSA SoC Codec Driver
> sgtl5000_hw_read: read reg error : Reg 0x00
> Device with ID register 0 is not a SGTL5000
> mxc_spdif mxc_spdif.0: MXC SPDIF Audio Transmitter
> No device for codec mxc spdif
> No device for DAI mxc spdif
> No device for DAI imx-ssi-1-0
> No device for DAI imx-ssi-1-1
> No device for DAI imx-ssi-2-0
> No device for DAI imx-ssi-2-1
> No device for DAI imx-spdif-dai
> DMA Sound Buffer Allocated: Playback UseIram=1 ext_ram=1 buf->addr=85bb0000 buf->area=fe3e0000 size=24576
> asoc: mxc spdif <-> imx-spdif-dai mapping ok
> ALSA device list:
>   #0: imx-3stack-spdif (mxc spdif)
> nf_conntrack version 0.5.0 (1362 buckets, 5448 max)
> IPv4 over IPv4 tunneling driver
> GRE over IPv4 tunneling driver
> ip_tables: (C) 2000-2006 Netfilter Core Team
> TCP cubic registered
> NET: Registered protocol family 10
> IPv6 over IPv4 tunneling driver
> NET: Registered protocol family 17
> NET: Registered protocol family 15
> can: controller area network core (rev 20090105 abi 8)
> NET: Registered protocol family 29
> can: raw protocol (rev 20090105)
> can: broadcast manager protocol (rev 20090105 t)
> Bluetooth: L2CAP ver 2.14
> Bluetooth: L2CAP socket layer initialized
> Bluetooth: SCO (Voice Link) ver 0.6
> Bluetooth: SCO socket layer initialized
> Bluetooth: RFCOMM TTY layer initialized
> Bluetooth: RFCOMM socket layer initialized
> Bluetooth: RFCOMM ver 1.11
> Bluetooth: BNEP (Ethernet Emulation) ver 1.3
> Bluetooth: BNEP filters: protocol multicast
> Bluetooth: HIDP (Human Interface Emulation) ver 1.2
> L2TP core driver, V2.0
> PPPoL2TP kernel driver, V2.0
> VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 2
> mxc_rtc mxc_rtc.0: setting system clock to 1970-01-01 00:00:00 UTC (0)
> Freeing init memory: 192K
> mmc0: new high speed SDHC card at address aaaa
> mmcblk0: mmc0:aaaa SU04G 3.69 GiB 
>  mmcblk0: p1 p2 p3 < p5 p6 > p4
> Mount everything
> Setup networking
> eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=0:00, irq=-1)
> Starting netserver at port 8888
> Starting netserver at hostname 0.0.0.0 port 8888 and family AF_UNSPEC
> / # sleep 5
> wget http://genode.org/ <http://genode.org/>
> sleep 5
> PHY: 0:00 - Link is Up - 100/Full
> / # wget http://genode.org/ <http://genode.org/>
> Connecting to genode.org (88.198.56.169:80)
> index.html           100% |*******************************| 16051   0:00:00 ETA
> / #
> 
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the 
> conversation now. http://goparallel.sourceforge.net/_______________________________________________
> genode-main mailing list
> genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genode.org/pipermail/users/attachments/20150312/8c14562a/attachment.html>


More information about the users mailing list