All of lore.kernel.org
 help / color / mirror / Atom feed
* Questions about logic_pio
@ 2020-02-19 13:58 Jiaxun Yang
  2020-02-20  9:48 ` Wei Xu
  0 siblings, 1 reply; 11+ messages in thread
From: Jiaxun Yang @ 2020-02-19 13:58 UTC (permalink / raw)
  To: yuanzhichang, johngarry, xuwei5, gabrielepaoloni, bhelgaas,
	andyshevchenko
  Cc: linux-kernel

Hi there,

Logic PIO gives us a way to make indirect PIO access, however,
the way it handles direct (MMIO) I/O access confused me.

I was trying to create a PCI controller Driver and noticed that I/O range parsed
from DeviceTree will be added to the Logic PIO range by logic_pio_register_range. 
And than PCI subsystem will use the ioport obtained from `logic_pio_trans_cpuaddr`
to allocate resources for the host bridge. In my case, the range added to the logic pio
 was set as hw_start 0x4000, size 0x4000. Later, `logic_pio_trans_cpuaddr` called
by `pci_address_to_pio` gives a ioport of 0x0, which is totally wrong.

After dig into logic pio logic, I found that logic pio is trying to "allocate" an io_start
for MMIO ranges, the allocation starts from 0x0. And later the io_start is used to calculate
cpu_address.  In my opinion, for direct MMIO access, logic_pio address should always
equal to hw address, because there is no way to translate address from logic pio address
to actual hw address in {in,out}{b,sb,w,sb,l,sl} operations.

How this mechanism intends to work? What is the reason that we are trying to
allocate a io_start for MMIO rather than take their hw_start ioport directly?

Thanks. 

--
Jiaxun Yang



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-02-21 16:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-19 13:58 Questions about logic_pio Jiaxun Yang
2020-02-20  9:48 ` Wei Xu
2020-02-20 10:52   ` John Garry
2020-02-20 11:55     ` Jiaxun Yang
2020-02-20 14:23       ` John Garry
2020-02-20 15:12         ` Jiaxun Yang
2020-02-20 17:39           ` John Garry
2020-02-20 18:32             ` John Garry
2020-02-21  0:42               ` Jiaxun Yang
2020-02-21 11:49                 ` John Garry
2020-02-21 16:47                   ` Jiaxun Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.