[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1760643.vMTR5o5E9g@wuerfel>
Date: Fri, 23 Sep 2016 11:51:49 +0200
From: Arnd Bergmann <arnd@...db.de>
To: "zhichang.yuan" <zhichang.yuan02@...il.com>
Cc: Gabriele Paoloni <gabriele.paoloni@...wei.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"lorenzo.pieralisi@....com" <lorenzo.pieralisi@....com>,
"minyard@....org" <minyard@....org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
John Garry <john.garry@...wei.com>,
"will.deacon@....com" <will.deacon@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Yuanzhichang <yuanzhichang@...ilicon.com>,
Linuxarm <linuxarm@...wei.com>,
"xuwei (O)" <xuwei5@...ilicon.com>,
"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
"benh@...nel.crashing.org" <benh@...nel.crashing.org>,
"zourongrong@...il.com" <zourongrong@...il.com>,
"liviu.dudau@....com" <liviu.dudau@....com>,
"kantyzc@....com" <kantyzc@....com>
Subject: Re: [PATCH V3 2/4] ARM64 LPC: LPC driver implementation on Hip06
On Friday, September 23, 2016 12:27:17 AM CEST zhichang.yuan wrote:
> For this patch sketch, I have a question.
> Do we call pci_address_to_pio in arch_of_address_to_pio to get the
> corresponding logical IO port
> for LPC??
No, of course not, that would be silly:
The argument to pci_address_to_pio() is a phys_addr_t, and we we don't
have one because there is no address associated with your PIO, that
is the entire point of your driver!
Also, we already know the mapping because this is what the inb/outb
workaround is looking at, so there is absolutely no reason to call it
either.
> If we don't, it seems the LPC specific IO address will conflict with PCI
> host bridges' logical IO.
>
> Supposed our LPC populated the IO range from 0x100 to 0x3FF( this is
> normal for ISA similar
> devices), after arch_of_address_to_pio(), the r->start will be set as
> 0x100, r->end will be set as
> 0x3FF. And if there is one PCI host bridge who request a IO window size
> over 0x400 at the same
> time, the corresponding r->start and r->end will be set as 0x0, 0x3FF
> after of_address_to_resource
> for this host bridge. Then the IO conflict happens.
You would still need to reserve some space in the io_range_list
to avoid possible conflicts, which is a bit ugly with the current
definition of pci_register_io_range, but I'm sure can be done.
One way I can think of would be to change pci_register_io_range()
to just return the logical port number directly (it already
knows it!), and pass an invalid physical address (e.g.
#define ISA_WORKAROUND_IO_PORT_WINDOW -0x10000) into it for
invalid translations.
Another alternative that just occurred to me would be to move
the pci_address_to_pio() call from __of_address_to_resource()
into of_bus_pci_translate() and then do the special handling
for the ISA/LPC bus in of_bus_isa_translate().
Arnd
Powered by blists - more mailing lists