public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: mike@compulab•co.il (Mike Rapoport)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 0/3] [ARM] tegra: PCI Express support
Date: Sun, 19 Sep 2010 16:07:02 +0200	[thread overview]
Message-ID: <4C961906.4040303@compulab.co.il> (raw)
In-Reply-To: <201009161912.12330.arnd@arndb.de>

Arnd Bergmann wrote:
> On Thursday 16 September 2010 18:53:33 Mike Rapoport wrote:
>> These patches enable PCI Express support on Tegra2.
>> The implementation is based on original NVidia code from (1), but it
>> is heavily reworked to avoid custom PCI enumeration and make the code
>> more Linux friendly.
>>
>> This implementation assumes that the PCIe subsystem is fully powered
>> and ungated by the bootloader.
> 
> The patches look good to me, but it seems that I/O space accesses are
> still broken and need to be redirected to the PCI I/O range, like
> the (totally untested) patch below.

Thanks for catching this.

> Signed-off-by: Arnd Bergmann <arnd@arndb•de>
> 
> diff --git a/arch/arm/mach-tegra/include/mach/io.h b/arch/arm/mach-tegra/include/mach/io.h
> index 35edfc3..d54e384 100644
> --- a/arch/arm/mach-tegra/include/mach/io.h
> +++ b/arch/arm/mach-tegra/include/mach/io.h
> @@ -21,7 +21,8 @@
>  #ifndef __MACH_TEGRA_IO_H
>  #define __MACH_TEGRA_IO_H
>  
> -#define IO_SPACE_LIMIT 0xffffffff
> +/* Two 1MB windows */
> +#define IO_SPACE_LIMIT (SZ_1M + SZ_1M - 1)

This would limit ioport_resource to 2M, and request_resource(&ioport_resource, 
&res) will fail because ioport_resource does not take into account that IO can 
start somewhere else than at 0.
>  
>  /* On TEGRA, many peripherals are very closely packed in
>   * two 256MB io windows (that actually only use about 64KB
> @@ -69,7 +70,7 @@ void tegra_iounmap(volatile void __iomem *addr);
>  
>  static inline void __iomem *__io(unsigned long addr)
>  {
> -	return (void __iomem *)addr;
> +	return addr + tegra_pcie.regs + SZ_4M;

I wish things were that simple :)
As far as I understand, the IO space should be mapped prior to use and __io 
should return the virtual address.
I'll add it for the next re-spin.

>  }
>  #define __io(a)         __io(a)
>  #define __mem_pci(a)    (a)


-- 
Sincerely yours,
Mike.

  reply	other threads:[~2010-09-19 14:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-16 16:53 [PATCH 0/3] [ARM] tegra: PCI Express support Mike Rapoport
2010-09-16 16:53 ` [PATCH 1/3] [ARM] tegra: add PCI Express clocks Mike Rapoport
2010-09-16 21:27   ` Colin Cross
2010-09-16 22:27     ` Mike Rapoport
2010-09-17  0:14       ` Gary King
2010-09-19  7:54         ` Mike Rapoport
2010-09-16 23:53   ` Mogambo Park
2010-09-19  7:52     ` Mike Rapoport
2010-09-16 16:53 ` [PATCH 2/3] [ARM] tegra: add PCI Express support Mike Rapoport
2010-09-16 21:42   ` Colin Cross
2010-09-16 22:16     ` Mike Rapoport
2010-09-16 16:53 ` [PATCH 3/3] [ARM] tegra: harmony: enable PCI Express Mike Rapoport
2010-09-16 21:44   ` Colin Cross
2010-09-16 21:57     ` Mike Rapoport
2010-09-16 17:12 ` [PATCH 0/3] [ARM] tegra: PCI Express support Arnd Bergmann
2010-09-19 14:07   ` Mike Rapoport [this message]
2010-09-19 14:39     ` Arnd Bergmann
2010-09-19 15:02       ` Russell King - ARM Linux
2010-09-19 16:34         ` Arnd Bergmann
2010-09-19 16:40           ` Russell King - ARM Linux
2010-09-19 17:09             ` Arnd Bergmann
2010-09-19 15:36       ` Mike Rapoport
2010-09-19 16:01         ` Russell King - ARM Linux
2010-09-20  7:15           ` Mike Rapoport
2010-09-20  9:13             ` Arnd Bergmann
2010-09-20  9:58             ` Russell King - ARM Linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C961906.4040303@compulab.co.il \
    --to=mike@compulab$(echo .)co.il \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox