On Sat, 20 Jul 2019, BALATON Zoltan wrote:
0 > "/pci@f2000000/ATY" open-dev to my-self
ob_pci_bar_map_in idx=1fc5ac54 ob_pci_map: ba=0x82000000 size=16384 ob_pci_map: after decode flags=0x0 space_code=0x2 mask=0xf pci_bus_addr_to_host_addr: space=0x2 ba=0x82000000 ob_pci_map: phys=0x82000000 size=16384 ob_pci_bar_map_in idx=1fc5ac54 ob_pci_map: ba=0x81000000 size=16777216 ob_pci_map: after decode flags=0x0 space_code=0x2 mask=0xf pci_bus_addr_to_host_addr: space=0x2 ba=0x81000000 ob_pci_map: phys=0x81000000 size=16777216
ok 0 > my-unit ok 3 > . 7800 ok 2 > . 0 ok 1 > . 0 ok 0 > my-space . 0 ok
^ this is still wrong, should be 7800
0 > my-address . . 0 0 ok 0 > my-address h# 1000014 h# 7800 + h# 100 ok 4 > .s <4> 0 0 1007814 100 ok 4 > " map-in" $call-parent
ob_pci_bar_map_in idx=1fc5ac54 ob_pci_map: ba=0x00000000 size=256 ob_pci_map: after decode flags=0x0 space_code=0x2 mask=0xf pci_bus_addr_to_host_addr: space=0x2 ba=0x00000000 ob_pci_map: phys=0x00000000 size=256
ok
So the base address already looks wrong in the first line of ob_pci_map. Does the ob_pci_bar_map_in() function decode its parameters correctly?
/* ( pci-addr.lo pci-addr.mid pci-addr.hi size -- virt ) */
static void ob_pci_bus_map_in(int *idx) { uint32_t ba; ucell size; ucell virt;
PCI_DPRINTF("ob_pci_bar_map_in idx=%p\n", idx); size = POP(); POP(); POP(); ba = POP(); virt = ob_pci_map(ba, size); PUSH(virt);
}
Shouldn't this be
size = POP(); ba = POP(); POP(); POP();
above?
Or maybe not because it looks correct for BARs as above at the top of this message. So why does this function ignore the pci-addr.hi which is the only non-0 in this call or should it try to map config space of the card for ba=0?
Regards, BALATON Zoltan