Hi Travis,

It looks like the issue is related to the power management. You may need to 
read the board's manual(e.g UG1085) to find out if USB and SDHCI rely on any 
other devices which you also need to pass through to your Linux VM.

You may also try to recompile your Linux kernel with PM disabled. If it doesn't 
work for you, then you'll have to debug your Linux kernel to find the root 
cause of the error.

Good Luck.

- Siwei

________________________________________
From: Travis Wheatley <[email protected]>
Sent: Friday, 26 June 2020 6:25 AM
To: [email protected]
Cc: Zhuang, Siwei (Data61, Kensington NSW)
Subject: Re: ramdisk vs. persistant rfs in VMs.

I have made some good progress thanks to Siwei’s advice. I have modified my 
.dts file and have made a usb controller as well as the sdhci controller 
available to the VM. However, there still seems to be some issues at start up.

Here is what dmesg has to say about the usb controller(s)

root@xilinx-zcu102-2019_1:~# dmesg | grep usb
[    1.754678] usbcore: registered new interface driver usbfs
[    1.761934] usbcore: registered new interface driver hub
[    1.768958] usbcore: registered new device driver usb
[    3.827826] usbcore: registered new interface driver asix
[    3.834976] usbcore: registered new interface driver ax88179_178a
[    3.842998] usbcore: registered new interface driver cdc_ether
[    3.850682] usbcore: registered new interface driver net1080
[    3.858146] usbcore: registered new interface driver cdc_subset
[    3.865948] usbcore: registered new interface driver zaurus
[    3.873301] usbcore: registered new interface driver cdc_ncm
[    3.895799] usbcore: registered new interface driver uas
[    3.902820] usbcore: registered new interface driver usb-storage
[    3.916716] usbcore: registered new interface driver uvcvideo
[    3.991358] usbcore: registered new interface driver bcm203x
[    3.998824] usbcore: registered new interface driver bpa10x
[    4.006182] usbcore: registered new interface driver bfusb
[    4.013424] usbcore: registered new interface driver btusb
[    4.028142] usbcore: registered new interface driver ath3k
[    4.201363] usbcore: registered new interface driver usbhid
[    4.208699] usbhid: USB HID core driver
[    4.224831] usbcore: registered new interface driver snd-usb-audio
[    5.181742] dwc3-of-simple ff9e0000.usb1: failed to add to PM domain 
domain3: -13
[    5.191629] dwc3-of-simple: probe of ff9e0000.usb1 failed with error -13

Any clue?

Regarding the SD card, it is partitioned with a boot partition where uboot and 
the .elf file live and the remainder is the free space I hope to use as the 
filesystem. Here is what dmesg has to say about the sdhc interface.

root@xilinx-zcu102-2019_1:~# dmesg | grep sdhc
[    4.049894] sdhci: Secure Digital Host Controller Interface driver
[    4.058026] sdhci: Copyright(c) Pierre Ossman
[    4.063768] sdhci-pltfm: SDHCI platform and OF driver helper
[    5.209925] sdhci-arasan ff160000.mmc: failed to add to PM domain domain4: 
-13
[    5.219468] sdhci-arasan: probe of ff160000.mmc failed with error -13
[    5.351710] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[    5.360229] mmc0: sdhci: Sys addr:  0x00000000 | Version:  0x00000000
[    5.368759] mmc0: sdhci: Blk size:  0x00000000 | Blk cnt:  0x00000000
[    5.377280] mmc0: sdhci: Argument:  0x00000000 | Trn mode: 0x00000000
[  290.055387] random: fast init done
[    5.385810] mmc0: sdhci: Present:   0x00000000 | Host ctl: 0x00000000
[    5.394331] mmc0: sdhci: Power:     0x00000000 | Blk gap:  0x00000000
[    5.402860] mmc0: sdhci: Wake-up:   0x00000000 | Clock:    0x00000000
[    5.411381] mmc0: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
[    5.419902] mmc0: sdhci: Int enab:  0x00000000 | Sig enab: 0x00000000
[    5.428441] mmc0: sdhci: AC12 err:  0x00000000 | Slot int: 0x00000000
[    5.436962] mmc0: sdhci: Caps:      0x00000000 | Caps_1:   0x00000000
[    5.445491] mmc0: sdhci: Cmd:       0x00000000 | Max curr: 0x00000000
[    5.454021] mmc0: sdhci: Resp[0]:   0x00000000 | Resp[1]:  0x00000000
[    5.462551] mmc0: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
[    5.471089] mmc0: sdhci: Host ctl2: 0x00000000
[    5.477023] mmc0: sdhci: ============================================

Seems to be getting the same -13 error when setting up it’s domain.

So… what do I need to do to make these devices accessible from the linux 
command line?

On Jun 24, 2020, at 8:58 PM, Zhuang, Siwei (Data61, Kensington NSW) 
<[email protected]<mailto:[email protected]>> wrote:

Hi Travis,

The addresses are board specific. The document for your board is UG1085,

   
https://www.xilinx.com/support/documentation/user_guides/ug1085-zynq-ultrascale-trm.pdf

If all you need is a number, you can also find it in the dts files in u-boot, 
Linux kernel or seL4,

   https://github.com/seL4/seL4/blob/master/tools/dts/zynqmp.dts#L900, #L910

- Siwei
________________________________________
From: Travis Wheatley 
<[email protected]<mailto:[email protected]>>
Sent: Thursday, 25 June 2020 5:49 AM
To: [email protected]<mailto:[email protected]>
Cc: Zhuang, Siwei (Data61, Kensington NSW)
Subject: Re: ramdisk vs. persistant rfs in VMs.

Thanks Siwei. This was very helpful.

I do have a follow up question about the addresses used in the devices.camkes 
file. Are these board specific or standard locations for the microkernel? The 
board I am using is a zcu102. Not sure where/how to find the appropriate 
address to use for the sdhci device.

— Travis

On Jun 23, 2020, at 3:54 AM, Zhuang, Siwei (Data61, Kensington NSW) 
<[email protected]<mailto:[email protected]>> wrote:

Hi Travis,

If you only need one VM to access the SD card. You could pass-through the SD 
card controller to Linux, recompile the Linux kernel with the proper driver. 
Then passing your rootfs on SD card via Linux kernel boot parameters. An 
example can be found in the "camkes-arm-vm" repo. Have a read about the "TK1 
configuration" on this page,

  https://docs.sel4.systems/projects/camkes-arm-vm/

The configuration code can be found here,

  
https://github.com/SEL4PROJ/camkes-arm-vm/blob/master/apps/vm_minimal/tk1/devices.camkes#L38
  
https://github.com/SEL4PROJ/camkes-arm-vm/blob/master/apps/vm_minimal/tk1/devices.camkes#L43

If you need to share the SD card between an native seL4 application and a VM or 
among multiple VMs, you'll need a virtual SD card driver. We only have a 
virtual USB driver at the moment. Use it as a reference to make your virtual 
driver. The code can be found here,

  
https://github.com/SEL4PROJ/seL4_projects_libs/blob/master/libsel4vmmplatsupport/src/arch/arm/devices/vusb.c
  
https://github.com/SEL4PROJ/camkes-arm-vm/blob/master/components/VM/src/modules/plat/exynos5410/init.c

You can of course partition the SD card, if your board supports boot from SD 
card. Consult the board's manual regarding how to boot from SD card. Note that, 
the Linux VM would have the access to your boot partition, hence the seL4 boot 
image could be compromised. To avoid that, you'll need to intercept the SD card 
access from the VM. The code here demonstrates one way of doing it,

  
https://github.com/SEL4PROJ/seL4_projects_libs/blob/master/libsel4vmmplatsupport/src/plat/exynos5/devices/vsdhc.c

Hope these helps.

- Siwei
________________________________________
From: Devel <[email protected]<mailto:[email protected]>> on 
behalf of Travis Wheatley 
<[email protected]<mailto:[email protected]>>
Sent: Tuesday, 23 June 2020 6:47 AM
To: [email protected]<mailto:[email protected]>
Subject: [seL4] ramdisk vs. persistant rfs in VMs.

I’ve been working with VMs running under SEL4 on ARM hardware. I have been able 
to boot to a command prompt in a VM. However, the filesystem being used is a 
ramdisk. I need some sort of persistent storage, preferably a regular rfs that 
lives on an SD card. Not exactly sure what modifications to make and where to 
cause the kernel to use a persistent rfs rather than the ramdisk. Barring that, 
wondering if the SD card can be divided into multiple partitions such that one 
can be the boot partition and the other mounted to provide persistent storage 
space. Hoping one of y’all can point me in the right direction.

— Travis
_______________________________________________
Devel mailing list
[email protected]<mailto:[email protected]>
https://sel4.systems/lists/listinfo/devel



_______________________________________________
Devel mailing list
[email protected]
https://sel4.systems/lists/listinfo/devel

Reply via email to