linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] ARM: integrator: pciv3: do not remap IO so early
@ 2013-06-25 23:06 Linus Walleij
  2013-06-26  8:14 ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2013-06-25 23:06 UTC (permalink / raw)
  To: linux-arm-kernel

Instead of remapping the IO memory very early with
pci_map_io_early(), use pci_ioremap_io() when setting
up resources as most PCI bridges do. Also request this
resource properly.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-integrator/pci_v3.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
index bef1005..029d670 100644
--- a/arch/arm/mach-integrator/pci_v3.c
+++ b/arch/arm/mach-integrator/pci_v3.c
@@ -538,6 +538,13 @@ static int __init pci_v3_setup_resources(struct pci_sys_data *sys)
 		       "memory region\n");
 		return -EBUSY;
 	}
+	if (request_resource(&iomem_resource, &io_mem)) {
+		release_resource(&io_mem);
+		printk(KERN_ERR "PCI: unable to allocate I/O "
+		       "memory region\n");
+		return -EBUSY;
+	}
+	pci_ioremap_io(0, io_mem.start);
 
 	/*
 	 * the mem resource for this bus
@@ -1039,6 +1046,5 @@ int __init pci_v3_early_init(void)
 {
 	iotable_init(pci_v3_io_desc, ARRAY_SIZE(pci_v3_io_desc));
 	vga_base = (unsigned long)PCI_MEMORY_VADDR;
-	pci_map_io_early(__phys_to_pfn(PHYS_PCI_IO_BASE));
 	return 0;
 }
-- 
1.8.1.4

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

* [PATCH 3/3] ARM: integrator: pciv3: do not remap IO so early
  2013-06-25 23:06 [PATCH 3/3] ARM: integrator: pciv3: do not remap IO so early Linus Walleij
@ 2013-06-26  8:14 ` Russell King - ARM Linux
  2013-06-26 15:12   ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2013-06-26  8:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 26, 2013 at 01:06:00AM +0200, Linus Walleij wrote:
> Instead of remapping the IO memory very early with
> pci_map_io_early(), use pci_ioremap_io() when setting
> up resources as most PCI bridges do. Also request this
> resource properly.

What impact does this have with a VGA card plugged in?

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

* [PATCH 3/3] ARM: integrator: pciv3: do not remap IO so early
  2013-06-26  8:14 ` Russell King - ARM Linux
@ 2013-06-26 15:12   ` Arnd Bergmann
  2013-06-26 19:34     ` Linus Walleij
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2013-06-26 15:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 26 June 2013, Russell King - ARM Linux wrote:
> On Wed, Jun 26, 2013 at 01:06:00AM +0200, Linus Walleij wrote:
> > Instead of remapping the IO memory very early with
> > pci_map_io_early(), use pci_ioremap_io() when setting
> > up resources as most PCI bridges do. Also request this
> > resource properly.
> 
> What impact does this have with a VGA card plugged in?

It probably won't work. It's my fault for misreading the driver:
I saw it didn't do the pci_ioremap_io, but didn't remember the
*_early call being present in the platform.

	Arnd

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

* [PATCH 3/3] ARM: integrator: pciv3: do not remap IO so early
  2013-06-26 15:12   ` Arnd Bergmann
@ 2013-06-26 19:34     ` Linus Walleij
  2013-06-26 20:04       ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2013-06-26 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 26, 2013 at 5:12 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wednesday 26 June 2013, Russell King - ARM Linux wrote:
>> On Wed, Jun 26, 2013 at 01:06:00AM +0200, Linus Walleij wrote:
>> > Instead of remapping the IO memory very early with
>> > pci_map_io_early(), use pci_ioremap_io() when setting
>> > up resources as most PCI bridges do. Also request this
>> > resource properly.
>>
>> What impact does this have with a VGA card plugged in?
>
> It probably won't work. It's my fault for misreading the driver:
> I saw it didn't do the pci_ioremap_io, but didn't remember the
> *_early call being present in the platform.

I haven't got the VGA working (hacking on the biosemu in
U-boot from time to time, will get there I hope). So keep this
patch out for now.

However I don't see how the VGA console is using iospace?
We set vga_base to the start of non-prefetched memory, and
assume the first slot is the VGA card, then it goes poking into
the screen memory or something... but maybe it's poking the
ioports in some runpath I can't see :-P

Yours,
Linus Walleij

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

* [PATCH 3/3] ARM: integrator: pciv3: do not remap IO so early
  2013-06-26 19:34     ` Linus Walleij
@ 2013-06-26 20:04       ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2013-06-26 20:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 26 June 2013, Linus Walleij wrote:
> On Wed, Jun 26, 2013 at 5:12 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Wednesday 26 June 2013, Russell King - ARM Linux wrote:
> >> On Wed, Jun 26, 2013 at 01:06:00AM +0200, Linus Walleij wrote:
> >> > Instead of remapping the IO memory very early with
> >> > pci_map_io_early(), use pci_ioremap_io() when setting
> >> > up resources as most PCI bridges do. Also request this
> >> > resource properly.
> >>
> >> What impact does this have with a VGA card plugged in?
> >
> > It probably won't work. It's my fault for misreading the driver:
> > I saw it didn't do the pci_ioremap_io, but didn't remember the
> > *_early call being present in the platform.
> 
> I haven't got the VGA working (hacking on the biosemu in
> U-boot from time to time, will get there I hope). So keep this
> patch out for now.
> 
> However I don't see how the VGA console is using iospace?
> We set vga_base to the start of non-prefetched memory, and
> assume the first slot is the VGA card, then it goes poking into
> the screen memory or something... but maybe it's poking the
> ioports in some runpath I can't see :-P
> 

I think you are looking for vga_io_w()/vga_io_r() in case of
vga16fb. vgacon uses inb_p/outb_p directly.

	Arnd

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

end of thread, other threads:[~2013-06-26 20:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-25 23:06 [PATCH 3/3] ARM: integrator: pciv3: do not remap IO so early Linus Walleij
2013-06-26  8:14 ` Russell King - ARM Linux
2013-06-26 15:12   ` Arnd Bergmann
2013-06-26 19:34     ` Linus Walleij
2013-06-26 20:04       ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).