Re: [PATCH v2 19/28] ARM: Add fixed PCI i/o mapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On 02/29/2012 03:53 PM, Arnd Bergmann wrote:
> On Wednesday 29 February 2012, Rob Herring wrote:
> 
>> +static struct map_desc pci_io_desc __initdata = {
>> +       .virtual        = PCI_IO_VIRT_BASE,
>> +       .pfn            = 0,
>> +       .length         = SZ_1M,
>> +       .type           = MT_DEVICE,
>> +};
>> +
>> +void __init pci_map_io(unsigned long paddr[], int nr)
>> +{
>> +       int i;
>> +
>> +       if (nr > 1)
>> +               pci_io_desc.length = SZ_64K;
>> +
>> +       for (i = 0; i < nr; i++) {
>> +               pci_io_desc.pfn = __phys_to_pfn(paddr[i]);
>> +               iotable_init(&pci_io_desc, 1);
>> +
>> +               pci_io_desc.virtual += SZ_64K;
>> +       }
>> +}
>> +
>> +void __init pci_map_io_single(unsigned long paddr)
>> +{
>> +       pci_map_io(&paddr, 1);
>> +}
> 
> Very clever interface, I like that!
> 
>> diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
>> index d7861b9..f0af548 100644
>> --- a/arch/arm/include/asm/io.h
>> +++ b/arch/arm/include/asm/io.h
>> @@ -111,6 +111,10 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
>>   */
>>  #ifdef CONFIG_NEED_MACH_IO_H
>>  #include <mach/io.h>
>> +#elif defined(CONFIG_PCI)
>> +#define PCI_IO_VIRT_BASE 0xfef00000
>> +#define IO_SPACE_LIMIT ((resource_size_t)0xfffff)
>> +#define __io(a)                __typesafe_io(PCI_IO_VIRT_BASE + ((a) & IO_SPACE_LIMIT))
>>  #else
>>  #define __io(a)                ({ (void)(a); __typesafe_io(0); })
>>  #endif
> 
> Should we shrink the vmalloc area now so it stays clear of the io port range?
> 

No, then the mapping will fail. I do need to double check all the
mappings and make sure there is no overlap but we only care on the PCI
platforms I converted.

Also, it should be noted this shrinks the i/o space on some platforms.
dove and kirkwood had 1MB x 2 buses and now have 64KB per bus. ixp2000 I
think has 32MB with a note saying they need "a lot". Is there really a
use for lots of i/o space?

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


[Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [PDAs]     [Linux]     [Linux MIPS]     [Yosemite Campsites]     [Photos]

Add to Google Follow linuxarm on Twitter