2013/3/18 Sebastian Sumpf <Sebastian.Sumpf@...1...>:
Hi Alexander,
On 03/18/2013 04:51 PM, Alexander Tarasikov wrote:
Hello, Genode Hackers!
I'm currently implementing an X86 PCI bus driver for L4Linux as a temporary solution for getting USB support in L4Linux.
Current genode-side code is presented below. The l4linux patch is not ready, but I've submitted the relevant part of the diff to pastebin (it's only makefile and kconfig anyway)
https://github.com/Ksys-labs/genode/blob/pci_wip/ports-foc/src/drivers/genod... https://github.com/Ksys-labs/genode/blob/pci_wip/ports-foc/src/lib/l4lx/geno... https://github.com/Ksys-labs/genode/blob/pci_wip/ports-foc/src/lib/l4lx/l4_i... http://pastebin.com/9c37tuJR
I have implemented the linux driver which calls the Genode pci service routines. I have also extended the l4lx io library to allow mapping pci memory space. With this patches, the ehci and ohci drivers probe in linux, but fail to work because interrupts are not triggered. I have implemented the fake irq thread which kicks the irq handler every millisecond and with that usb works. This indicates that the pci subsystem and memory mapping are
I've got some questions regarding interrupt handling in L4Linux and Genode in general.
- Why are NR_IRQS_HW interrupts reserved on X86 in l4linux? The EHCI controller
wants the interrupt number 11 which is lower than NR_IRQS_HW. Ok, I worked around that by editing the constant and removing the "BUG_ON(NR_REQUESTABLE < 1)" in arch/l4/kernel/irq.c init_array function 2. How are capabilities actually assigned? it would seem to me that l4x_register_irq allocates the capabilitiies in the first available slot, but l4x_have_irqcap looks it up by index. I've worked around it by explicitely allocating 12 capabilities via l4x_cap_alloc, but still got error -2004 on irq attach. Now, I've had success in attaching irq after I allocated the capability via the following code in l4lx:
Genode::Foc_cpu_session_client cpu(Genode::env()->cpu_session_cap()); p->irq_cap = cpu.alloc_irq().dst(); 3. what's the purpose of multiplying the irq number by four in l4_msgtag_t ret = l4_irq_attach(p->irq_cap, data->irq << 2, l4x_cpu_thread_get_cap(p->cpu));? As far as I can see, in the base-foc irq implementation, irq number is never multiplied 4. non-genode question, probably. Do EHCI/PCI interrupts need a special kick to work? I've tried using Genode::Irq_session for irq11, but wait_for_irq never returns. On the other hand, I've tried the regular linux iso on the same machine (which is actually qemu) and the ehci interrupt is indeed 11 and it works fine there.
So, the question is, why is interrupt handling broken and the only working interrupt in l4linux is timer which actually uses L4 timer ipc instead of irq and how this should be fixed. Also, what do you think of making a "genode" arch for linux and getting rid of l4linux which uses the Fiasco.OC API bypassing Genode interfaces?
Since you are on x86 and it's interrupt eleven you are concerned about (is this Qemu?), I have one suggestion: Fiasco.OC on x86 uses the APIC instead of the aged PIC as interrupt controller. This means that the EHCI controller might not have IRQ 11 (on real hardware) or might have another interrupt mode on Qemu (lately IRQ 11 uses level/high instead of edge/high as trigger). To solve issues like that there is an ACPI driver in Genode. Please try adding 'drivers/acpi' to your scenario, add
<start name="acpi"> <resource name="RAM" quantum="2M"/> <binary name="acpi_drv"/> <provides> <service name="PCI"/> <service name="IRQ" /> </provides> <route> <service name="PCI"> <any-child /> </service> <any-service> <parent/> <any-child /> </any-service> </route> </start>
Hi! Tried doing that (already after writing the email), for some reason it failed to claim the config register region (0xcf8), digging the source code I found out it is due to region conflict. I was running a minimal configuration: timer, pci_drv and acpi utilizing pci_drv. Our tree is a bit out of sync, will try on genode master later. I think it showed some errors, does it handle well boards with broken ACPI (I guess you are aware that DSDT is mostly always not standard-compliant due to Microsoft compiler)
So, the capability problem is related to the limitation on using <32 interrupts on x86, right? I guess I won't have to worry about it.
Ok, I will try getting genode irq_session to work with it first. Thanks for your suggestion.
to your configuration file/run script, and remove the 'pci_drv' from your configuartion, since the driver will be started by the 'acpi_drv'.
Hope this helps,
Sebastian
Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar _______________________________________________ Genode-main mailing list Genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main