linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>,
	Anton Blanchard <anton@samba.org>
Subject: Re: [RFC/PATCH] powerpc: Rewrite IO allocation & mapping on powerpc64
Date: Tue, 15 May 2007 06:59:41 +1000	[thread overview]
Message-ID: <1179176381.32247.98.camel@localhost.localdomain> (raw)
In-Reply-To: <200705141637.19572.arnd@arndb.de>

On Mon, 2007-05-14 at 16:37 +0200, Arnd Bergmann wrote:
> On Monday 14 May 2007, Benjamin Herrenschmidt wrote:
> > + * Define the address ranges for MMIO and IO space :
> > + *
> > + *  ISA_IO_BASE = VMALLOC_END, 64K reserved area
> > + *  PHB_IO_BASE = ISA_IO_BASE + 64K to ISA_IO_BASE + 2G, PHB IO spaces
> > + * IOREMAP_BASE = ISA_IO_BASE + 2G to VMALLOC_START + PGTABLE_RANGE
> > + */
> > +#define  ISA_IO_BASE	(VMALLOC_END)
> > +#define  ISA_IO_END	(VMALLOC_END + 0x10000ul)
> > +#define  PHB_IO_BASE	(ISA_IO_END)
> > +#define  PHB_IO_END	(VMALLOC_END + 0x80000000ul)
> > +#define IOREMAP_BASE	(PHB_IO_END)
> > +#define IOREMAP_END	(VMALLOC_START + PGTABLE_RANGE)
> 
> Very nice layout, it suddenly all makes sense ;-)
> 
> PHB_IO_END should probably be 
> 
> #define  PHB_IO_END	(VMALLOC_END + PIO_RESERVED)
> 
> At least, that is how I understand the definition of PIO_RESERVED.

I was wondering what that constant was about ... 0x40000000 doesn't seem
good though.

> Do you think it's ok to not treat the range between 64k and 1M special?
> There might be ISA drivers that expect devices in there. Maybe we should
> start PHB_IO_BASE after a 1M guard area where nothing is mapped.

I though legacy IO couldn't be above 64 K ? ISA bridges definitely don't
forward more than 64K...

> Where should Olof's PCMCIA space go? The ISA or the PHB range?

I'm not sure about Olof's issues with pcmcia. Usually, the PCMCIA bridge
is expected to remap IOs but I suppose he can have it anywhere as part
of the standard PHB ranges, unless he explicitely needs the low IOs.

I want to add a call that archs can do to explicitely bind the low 64K
when there is no ISA so he can always bind them to something special.

> Can we make this depend on CONFIG_ISA? Most platforms don't actually want
> to build in ISA support.

I'm not too sure about that. CONFIG_ISA means you have legacy devices or
ISA slots ? or both ?

> > @@ -11,7 +11,7 @@
> >   *      2 of the License, or (at your option) any later version.
> >   */
> >  
> > -#undef DEBUG
> > +#define DEBUG
> >  
> >  #include <linux/kernel.h>
> >  #include <linux/pci.h>
> 
> needs to get reverted of course

Sure, that's still very much a WIP patch

> >  /* pci_io_base -- the base address from which io bars are offsets.
> >   * This is the lowest I/O base address (so bar values are always positive),
> >   * and it *must* be the start of ISA space if an ISA bus exists because
> > - * ISA drivers use hard coded offsets.  If no ISA bus exists a dummy
> > - * page is mapped and isa_io_limit prevents access to it.
> > + * ISA drivers use hard coded offsets.
> >   */
> > -unsigned long isa_io_base;	/* NULL if no ISA bus */
> > -EXPORT_SYMBOL(isa_io_base);
> > -unsigned long pci_io_base;
> > +unsigned long pci_io_base = ISA_IO_BASE;
> >  EXPORT_SYMBOL(pci_io_base);
> >  
> >  void iSeries_pcibios_init(void);
> 
> Why do we even need to make pci_io_base a variable? There are not many
> places where it's used, and they are are read-only. Replacing it with the
> constant of ISA_IO_BASE should reduce the code size in every driver
> that uses port access functions.

I've been thinking about it yes.

Ben.

  parent reply	other threads:[~2007-05-14 20:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-14  7:53 [RFC/PATCH] powerpc: Rewrite IO allocation & mapping on powerpc64 Benjamin Herrenschmidt
2007-05-14  7:59 ` Benjamin Herrenschmidt
2007-05-14  8:03 ` Benjamin Herrenschmidt
2007-05-14  9:18 ` Benjamin Herrenschmidt
2007-05-14 13:50 ` Segher Boessenkool
2007-05-14 20:53   ` Benjamin Herrenschmidt
2007-05-15  0:17   ` Paul Mackerras
2007-05-15  4:33     ` Segher Boessenkool
2007-05-15  6:04       ` Benjamin Herrenschmidt
2007-05-14 14:37 ` Arnd Bergmann
2007-05-14 15:04   ` Segher Boessenkool
2007-05-14 23:56     ` Arnd Bergmann
2007-05-15  0:05       ` Olof Johansson
2007-05-14 20:59   ` Benjamin Herrenschmidt [this message]
2007-05-14 23:39     ` Arnd Bergmann
2007-05-15  0:06       ` Benjamin Herrenschmidt
2007-05-15 10:56 ` Christoph Hellwig
2007-05-15 20:42   ` Benjamin Herrenschmidt

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=1179176381.32247.98.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=anton@samba.org \
    --cc=arnd@arndb.de \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).