OK I came up with the attched patch (on top of your previous series and set-args patch) which is I think about what you've suggested. I kept ob_pci_map for existing callers but renamed it to ob_pci_map_in to keep symmetry between ob_pci_map and ob_pci_unmap with ob_pci_map now only doing mapping as its name suggests (although I think this should still be simpler) and ob_pci_bus_map_in is doing its own address decoding now. The previous ob_pci_map (now called ob_pci_map_in which is a C helper for some of what map-in should do) can be cleaned up as you like. Also cleaned up some white space (tab vs. spaces) but that's excluded from this patch for brevity.
But it does not seem to work yet:
0 > " /pci@f2000000/ATY" open-dev to my-self
ob_pci_bar_map_in idx=1fc5ac54 pci_bus_addr_to_host_addr space=2 ba=0x82000000 ob_pci_map: phys=0x82000000 size=16384 ob_pci_bar_map_in idx=1fc5ac54 pci_bus_addr_to_host_addr space=2 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 ok 1 > . 7800 ok 0 > my-address ok 2 > . 0 ok 1 > . 0 ok 0 > my-address h# 1000014 my-space + h# 100 ok 4 > .s <4> 0 0 1007814 100 ok 4 > " map-in" $call-parent
ob_pci_bar_map_in idx=1fc5ac54 pci_bus_addr_to_host_addr space=1 ba=0x0 ob_pci_map: phys=0xf2000000 size=256
ok 1 > .s <1> -e000000 ok 1 > le-l@ ok 1 > . -1 ok 0 >
Any idea?
Regards, BALATON Zoltan