camkes-arm-vm not registering GPIO?
Hi All, I am playing around with the capabilities of the camkes-arm-vm project pn the Tegra TK1 and and wondering if someone else has come across this issue. It looks like GPIO functionality is not available in the buildroot. I can confirm the GPIO source is present and is being built: camkes-arm-vm/libs/libplatsupport/rc/plat/tk1/gpio.c camkes-arm-vm/libs/libplatsupport/plat_include/tk1/platsupport/plat/gpio.h [CC] src/plat/tk1/gpio.o The expected sysfs support is not present and looking and the relevant dmesg: # dmesg | grep gpio [ 0.057543] gpiochip_add: GPIOs 0..255 (tegra-gpio) failed to register [ 1.485061] input: gpio-keys as /devices/soc0/gpio-keys/input/input0 Any thoughts on what could be causing GPIO to the failing to register? Steven
Hi Steven,
Your problem could be that the GPIO MMIO frame is not being given to the VM. The config setting CONFIG_TK1_INSECURE increases the amount of hardware devices that are
passed through to the VM. Once the GPIO device is accessible in the VM, Linux should be able to attach its own GPIO driver which will then make it accessible through sysfs.
Currently on TK1 there isn't support for virtualisation of the GPIO hardware so you can either give Linux access to the hardware frames to manage GPIO hardware itself, or use a limited seL4 gpio driver in a separate CAmkES component but this wouldn't be accessible from on top of Linux unless you created your own virtual device.
Hope this helps.
Kind regards,
Kent
________________________________________
From: Devel
Hi Kent, Thank you for the direction. I set CONFIG_TK1_INSECURE in the kernel config and rebuilt the TK1 image however I was unable to successfully tftpboot. Rather than pull in all insecure TK1 devices I specifically added only the GPIO MMIO and Interrupts in projects/vm/components/VM/vm_common.camkes: . . . #ifdef CONFIG_PLAT_TK1 vm.untyped_mmios = [ "0x50046000:12", // Interrupt Controller Virtual CPU interface (Virtual Machine view) "0x60004000:12", // Interrupt controller registers (ICTLR) "0x6000d000:12", // GPIOS 1-8 "0x700b0000:12", // SDMMC-1, SDMMC-2, SDMMC-3, SDMMC-4, . . . vm.irqs = [27, // INTERRUPT_VGPT (INTERRUPT_PPI_11) 53, // INTERRUPT_USB2 63, // INTERRUPT_SDMMC4 64, // INTERRUPT_GPIO1 65, // INTERRUPT_GPIO2 66, // INTERRUPT_GPIO3 67, // INTERRUPT_GPIO4 87, // INTERRUPT_GPIO5 119, // INTERRUPT_GPIO6 121, // INTERRUPT_GPIO7 122, // INTERRUPT_UARTD 129, // INTERRUPT_USB3 157, // INTERRUPT_GPIO8 . . . Doing this allows me to tftpboot but still see GPIO devices failing to register (and no GPIO devices in /sys). Right now my questions are: (1) Are you able to successfully enable CONFIG_TK1_INSECURE and boot on the TK1? (2) Are there more devices/interrupts other than GPIO specific ones that need to be pulled into the config for GPIO to function? Steven On 05/10/17 00:26, Kent.Mcleod@data61.csiro.au wrote:
Hi Steven,
Your problem could be that the GPIO MMIO frame is not being given to the VM. The config setting CONFIG_TK1_INSECURE increases the amount of hardware devices that are passed through to the VM. Once the GPIO device is accessible in the VM, Linux should be able to attach its own GPIO driver which will then make it accessible through sysfs.
Currently on TK1 there isn't support for virtualisation of the GPIO hardware so you can either give Linux access to the hardware frames to manage GPIO hardware itself, or use a limited seL4 gpio driver in a separate CAmkES component but this wouldn't be accessible from on top of Linux unless you created your own virtual device. Hope this helps.
Kind regards, Kent ________________________________________ From: Devel
on behalf of Steven Johnston Sent: Tuesday, May 9, 2017 9:45 AM To: devel@sel4.systems Subject: [seL4] camkes-arm-vm not registering GPIO? Hi All,
I am playing around with the capabilities of the camkes-arm-vm project pn the Tegra TK1 and and wondering if someone else has come across this issue. It looks like GPIO functionality is not available in the buildroot.
I can confirm the GPIO source is present and is being built:
camkes-arm-vm/libs/libplatsupport/rc/plat/tk1/gpio.c camkes-arm-vm/libs/libplatsupport/plat_include/tk1/platsupport/plat/gpio.h
[CC] src/plat/tk1/gpio.o
The expected sysfs support is not present and looking and the relevant dmesg:
# dmesg | grep gpio
[ 0.057543] gpiochip_add: GPIOs 0..255 (tegra-gpio) failed to register [ 1.485061] input: gpio-keys as /devices/soc0/gpio-keys/input/input0
Any thoughts on what could be causing GPIO to the failing to register?
Steven
_______________________________________________ Devel mailing list Devel@sel4.systems https://sel4.systems/lists/listinfo/devel
Hi Steven,
Some changes were pushed out last night to Github which may have fixed your issue of not being able to tftpboot. When I use the CONFIG_TK1_INSECURE config setting, once the device successfully boots I can see 6000d000.gpio under /sys/devices/soc0 however I haven't tested that they actually work.
If you aren't using the CONFIG_TK1_INSECURE config, then in addition to configuring the mmios and interrupts in the cmakes file you also need to add them to the linux_pt_irqs struct in projects/vm/components/VM/src/tk1_vmlinux.c.
Kind regards,
Kent.
________________________________________
From: Steven Johnston
Hi Steven,
Your problem could be that the GPIO MMIO frame is not being given to the VM. The config setting CONFIG_TK1_INSECURE increases the amount of hardware devices that are passed through to the VM. Once the GPIO device is accessible in the VM, Linux should be able to attach its own GPIO driver which will then make it accessible through sysfs.
Currently on TK1 there isn't support for virtualisation of the GPIO hardware so you can either give Linux access to the hardware frames to manage GPIO hardware itself, or use a limited seL4 gpio driver in a separate CAmkES component but this wouldn't be accessible from on top of Linux unless you created your own virtual device. Hope this helps.
Kind regards, Kent ________________________________________ From: Devel
on behalf of Steven Johnston Sent: Tuesday, May 9, 2017 9:45 AM To: devel@sel4.systems Subject: [seL4] camkes-arm-vm not registering GPIO? Hi All,
I am playing around with the capabilities of the camkes-arm-vm project pn the Tegra TK1 and and wondering if someone else has come across this issue. It looks like GPIO functionality is not available in the buildroot.
I can confirm the GPIO source is present and is being built:
camkes-arm-vm/libs/libplatsupport/rc/plat/tk1/gpio.c camkes-arm-vm/libs/libplatsupport/plat_include/tk1/platsupport/plat/gpio.h
[CC] src/plat/tk1/gpio.o
The expected sysfs support is not present and looking and the relevant dmesg:
# dmesg | grep gpio
[ 0.057543] gpiochip_add: GPIOs 0..255 (tegra-gpio) failed to register [ 1.485061] input: gpio-keys as /devices/soc0/gpio-keys/input/input0
Any thoughts on what could be causing GPIO to the failing to register?
Steven
_______________________________________________ Devel mailing list Devel@sel4.systems https://sel4.systems/lists/listinfo/devel
Thanks Kent, I can confirm that the CONFIG_TK1_INSECURE image builds, tftpboots, and creates 6000d000.gpio under /sys/devices/soc0. If I understand the "gpio-keys" device correctly the user is unable to toggle GPIO pins directly but can detect signal interrupts on the pins. I'll have to read up a bit before testing if they actually work. Thanks again, Steven On 05/24/2017 08:58 PM, Kent.Mcleod@data61.csiro.au wrote:
Hi Steven,
Some changes were pushed out last night to Github which may have fixed your issue of not being able to tftpboot. When I use the CONFIG_TK1_INSECURE config setting, once the device successfully boots I can see 6000d000.gpio under /sys/devices/soc0 however I haven't tested that they actually work.
If you aren't using the CONFIG_TK1_INSECURE config, then in addition to configuring the mmios and interrupts in the cmakes file you also need to add them to the linux_pt_irqs struct in projects/vm/components/VM/src/tk1_vmlinux.c.
Kind regards, Kent.
________________________________________ From: Steven Johnston
Sent: Wednesday, May 24, 2017 6:12 AM To: Mcleod, Kent (Data61, Kensington NSW); devel@sel4.systems Subject: Re: [seL4] camkes-arm-vm not registering GPIO? Hi Kent,
Thank you for the direction. I set CONFIG_TK1_INSECURE in the kernel config and rebuilt the TK1 image however I was unable to successfully tftpboot.
Rather than pull in all insecure TK1 devices I specifically added only the GPIO MMIO and Interrupts in projects/vm/components/VM/vm_common.camkes:
. . . #ifdef CONFIG_PLAT_TK1
vm.untyped_mmios = [ "0x50046000:12", // Interrupt Controller Virtual CPU interface (Virtual Machine view) "0x60004000:12", // Interrupt controller registers (ICTLR) "0x6000d000:12", // GPIOS 1-8 "0x700b0000:12", // SDMMC-1, SDMMC-2, SDMMC-3, SDMMC-4, . . . vm.irqs = [27, // INTERRUPT_VGPT (INTERRUPT_PPI_11) 53, // INTERRUPT_USB2 63, // INTERRUPT_SDMMC4 64, // INTERRUPT_GPIO1 65, // INTERRUPT_GPIO2 66, // INTERRUPT_GPIO3 67, // INTERRUPT_GPIO4 87, // INTERRUPT_GPIO5 119, // INTERRUPT_GPIO6 121, // INTERRUPT_GPIO7 122, // INTERRUPT_UARTD 129, // INTERRUPT_USB3 157, // INTERRUPT_GPIO8 . . .
Doing this allows me to tftpboot but still see GPIO devices failing to register (and no GPIO devices in /sys).
Right now my questions are:
(1) Are you able to successfully enable CONFIG_TK1_INSECURE and boot on the TK1?
(2) Are there more devices/interrupts other than GPIO specific ones that need to be pulled into the config for GPIO to function?
Steven
On 05/10/17 00:26, Kent.Mcleod@data61.csiro.au wrote:
Hi Steven,
Your problem could be that the GPIO MMIO frame is not being given to the VM. The config setting CONFIG_TK1_INSECURE increases the amount of hardware devices that are passed through to the VM. Once the GPIO device is accessible in the VM, Linux should be able to attach its own GPIO driver which will then make it accessible through sysfs.
Currently on TK1 there isn't support for virtualisation of the GPIO hardware so you can either give Linux access to the hardware frames to manage GPIO hardware itself, or use a limited seL4 gpio driver in a separate CAmkES component but this wouldn't be accessible from on top of Linux unless you created your own virtual device. Hope this helps.
Kind regards, Kent ________________________________________ From: Devel
on behalf of Steven Johnston Sent: Tuesday, May 9, 2017 9:45 AM To: devel@sel4.systems Subject: [seL4] camkes-arm-vm not registering GPIO? Hi All,
I am playing around with the capabilities of the camkes-arm-vm project pn the Tegra TK1 and and wondering if someone else has come across this issue. It looks like GPIO functionality is not available in the buildroot.
I can confirm the GPIO source is present and is being built:
camkes-arm-vm/libs/libplatsupport/rc/plat/tk1/gpio.c camkes-arm-vm/libs/libplatsupport/plat_include/tk1/platsupport/plat/gpio.h
[CC] src/plat/tk1/gpio.o
The expected sysfs support is not present and looking and the relevant dmesg:
# dmesg | grep gpio
[ 0.057543] gpiochip_add: GPIOs 0..255 (tegra-gpio) failed to register [ 1.485061] input: gpio-keys as /devices/soc0/gpio-keys/input/input0
Any thoughts on what could be causing GPIO to the failing to register?
Steven
_______________________________________________ Devel mailing list Devel@sel4.systems https://sel4.systems/lists/listinfo/devel
participants (2)
-
Kent.Mcleod@data61.csiro.au
-
Steven Johnston