Hi, I''ve been banging my head against this serial board and I''d like to know if anyone has tips. It''s an Oxford 0x1415:0xc138. It''s located at 03:00.0, I''ve identified a few problems with Xen''s initialization. First off, ns16550_parse_port_config string compares "pci" with strncmp(conf, "pci", 5) which obviously fails. It should be 3. I can send trivial patch. Once that is left behind, reading the bar with pci_conf_read32(0,b,d,f, PCI_BASE_ADDRESS_0) yields the mmio address of the first accessible region, instead of the bar. Linux inits this card fine, and reports three mmio regions at 0xfb600000 (size 16k), 0xfb400000 (size 2M) and 0xfb200000 (size 2M), BAR 1 with the actual IO port at 0xfb601000 (one page inside the first mmio region). It gets irq 19. Going back to Xen, instead of reading bar=1, it reads the mmio offset of the first region and then it naturally bails out. Even if it were to get the right bar, the io_base value it would compute (bar & 0xfffe) would be useless. I''ve tried passing the explicit parameters (com1=115200,8n1,0xfb601000,19,03:00.0), and the mere mention of an mmio io port for the serial card hard freezes the hypervisor immediately. Help, pointers, etc, are appreciated. I know next to nothing about PCI config, so pardon my inaccurate ramblings. Thanks, Andres
>>> On 23.11.11 at 16:55, "Andres Lagar-Cavilla" <andres@lagarcavilla.org> wrote: > First off, ns16550_parse_port_config string compares "pci" with > strncmp(conf, "pci", 5) which obviously fails. It should be 3. I can send > trivial patch.Yes, please. (It must be an oversight in an earlier change.)> Once that is left behind, reading the bar with pci_conf_read32(0,b,d,f, > PCI_BASE_ADDRESS_0) yields the mmio address of the first accessible > region, instead of the bar.This is an assumption, not a bug (not sure what, if any, conventions exist here). If your card doesn''t meet it, then you''ll have to either provide a patch (without breaking anyone else) or deal with this for yourself. But read on. Also, what is being read is the BAR, just that in your case it doesn''t point into IO port space.> Linux inits this card fine, and reports three mmio regions at 0xfb600000 > (size 16k), 0xfb400000 (size 2M) and 0xfb200000 (size 2M), BAR 1 with the > actual IO port at 0xfb601000 (one page inside the first mmio region). It > gets irq 19. > > Going back to Xen, instead of reading bar=1, it reads the mmio offset of > the first region and then it naturally bails out. Even if it were to get > the right bar, the io_base value it would compute (bar & 0xfffe) would be > useless.On x86, the code assumes that the interface is through an IO port; the MMIO variant, iirc, so far is there only for ia64. The primary issue being that the (stub) ioremap() x86 has isn''t suitable for this purpose.> I''ve tried passing the explicit parameters > (com1=115200,8n1,0xfb601000,19,03:00.0), and the mere mention of an mmio > io port for the serial card hard freezes the hypervisor immediately.That''s, as mentioned above, a result of the stubbed out ioremap(). Jan
Thanks, I will try a few things to get my card working. The main obstacle seems to get an x86 ioremap for this card. As I''ve mentioned, I''m basically poking in the dark here wrt configuring a pci dev. Andres>>>> On 23.11.11 at 16:55, "Andres Lagar-Cavilla" <andres@lagarcavilla.org> >>>> wrote: >> First off, ns16550_parse_port_config string compares "pci" with >> strncmp(conf, "pci", 5) which obviously fails. It should be 3. I can >> send >> trivial patch. > > Yes, please. (It must be an oversight in an earlier change.) > >> Once that is left behind, reading the bar with pci_conf_read32(0,b,d,f, >> PCI_BASE_ADDRESS_0) yields the mmio address of the first accessible >> region, instead of the bar. > > This is an assumption, not a bug (not sure what, if any, conventions > exist here). If your card doesn''t meet it, then you''ll have to either > provide a patch (without breaking anyone else) or deal with this for > yourself. But read on. > > Also, what is being read is the BAR, just that in your case it doesn''t > point > into IO port space. > >> Linux inits this card fine, and reports three mmio regions at 0xfb600000 >> (size 16k), 0xfb400000 (size 2M) and 0xfb200000 (size 2M), BAR 1 with >> the >> actual IO port at 0xfb601000 (one page inside the first mmio region). It >> gets irq 19. >> >> Going back to Xen, instead of reading bar=1, it reads the mmio offset of >> the first region and then it naturally bails out. Even if it were to get >> the right bar, the io_base value it would compute (bar & 0xfffe) would >> be >> useless. > > On x86, the code assumes that the interface is through an IO port; the > MMIO variant, iirc, so far is there only for ia64. The primary issue being > that the (stub) ioremap() x86 has isn''t suitable for this purpose. > >> I''ve tried passing the explicit parameters >> (com1=115200,8n1,0xfb601000,19,03:00.0), and the mere mention of an mmio >> io port for the serial card hard freezes the hypervisor immediately. > > That''s, as mentioned above, a result of the stubbed out ioremap(). > > Jan > >