Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Fred Kleinsorge <kleinsorge@star.enet.dec.com>
Subject: Re: PCI Sparse Address Space
Date: 1996/09/19	[thread overview]
Message-ID: <324117C5.18AADFA6@star.enet.dec.com> (raw)
In-Reply-To: qxpk9ttglh7.fsf@foobar.cs.colorado.edu


Dirk Grunwald wrote:
> 
> Here's my experienced based on trying to port the driver for the
> Myricom Myrinet PCi interface to the DEC Alpha.
> 
> The system start up code (not certain if it's the SROM bootup or the
> SRM firmware) puts a device into "sparse space" based on a number of
> reasons.  The importance of this varies from machine to machine.
> 
> For example, the AlphaServer 2100 PCI interface (the "T3" chip, I
> think) maps any device as "sparse" if it marks a memory region as "not
> prefetchable". The myrinet has a 256KByte on-chip SRAM memory that was
> marked "not prefetchable", and thus communication with that memory
> requires the PIO functions. More recently, I've received EEPROM
> upgrades that mark it as "prefetchable", and that should fix the
> problem ( but I haven't had time to plug it into the 2100's).
> 
> By comparison, a system using the 21070 or 21170 PCI interface chipset
> doesn't appear to care diddly about the "prefetch" bit. On both EV4
> and EV5 based systems, the same Myrinet card can be mapped into a
> "dense" address space.
> 
> If you trace the code path for the code that reads/writes sparse
> address space, you'll get down ( in .../src/kernel/arch/alpha/hal) to
> a hardware abstraction layer that diddles the appropriate PCI bridge
> in the proper manner.
> 
> We couldn't afford the overhead of those function calls for the
> Myrinet interface and asked Myricom to spin another FPGA with the
> prefetch bit marked as prefetchable.
> 


  In a different thread, I started to explain this...

  The selection of a sparse versus dense space address is made by the console
  firmware as it configures the system.  The selection criteria is see if the
  memory is prefetchable.  If it is, then you get dence, if it isn't then you
  get sparse.

  The reason for the decision is simple:  If a memory-like region can be
  read without side effects (prefetchable implies this) then the assumption
  is made that all I/O to it can be made using doubleword reads and writes -
  and using read-mod-write sequences for partial word I/O.  If however the
  region is non-prefetchable, then the assumption is made that arbitrary reads
  can have side-effects, and doubleword read-mod-writes are probably not
  sufficient.

  So, the O/S gets this physical address from the PCI card, and the choice has
  been made... or has it?

  Now we get down to platform decisions (as opposed to Alpha chip decisions).  Each
  platform is based on a collection of parts, including the PCI interface and bridge
  chips.  And each lays out some scheme for address spaces.   On the AlphaStations,
  and on a few of AlphaServers - sparse space and dense space physically overmap each
  other.  That is, the address for any physical location in dense space is also available
  in sparse space.  This means that given the physical address from the PCI card,
  the operating system can permute it into either sparse or dense space as requested.

  Now, on _most_ AlphaServer boxes (like the 2100), the address space available for
  dense and sparse regions was not the same, and so they could not be completely
  overmapped.  So, the firmware makes them physically disjoint (one of the registers
  like the HAE).  A physical address in dense space cannot be mapped in dense space,
  and vice versa.  So now the physical address that you got from the PCI card will
  dictate how the card is accessable, and the decision is dictated by the prefetchable
  attribute.

  In general, the rule of thumb is:  If the PCI card does not have the prefetchable
  bit set, then you should be prepared to only use sparse space.  If the bit is set
  then you should be prepared to use dense space.  If you want to use a mixture, or
  have a preference to use the other space, then you will need to check the status
  from your attempt to map the space and make sure that it succeeds.  This is exactly
  what I did in writing frame buffer logic - I have a sparse-only implementation, and
  a mixed dense/sparse implementation - and I select which one to use based on the
  availability of dense space.

  Now.  Having said this.  The decision to make sparse and dense disjoint was done,
  I think, because the hardware group did not want to end up in the situation where
  some cards could be overmapped, and some cards could not - depending on the number,
  location, and requirements of the cards for PCI address space.  It is purely a
  software decision made by the firmware... and could be changed if there was a
  compelling reason.  Or perhaps it would be interesting to have a mechanism to
  alter the address assignment on a card-by-card basis (either in the O/S or in the
  firmware).

  Hope this clarifies things a little.



  reply	other threads:[~1996-09-19  4:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-16  4:00 PCI Sparse Address Space Jeff Hollingsworth
1996-09-17  4:00 ` Hubert Robitaille
1996-09-17  4:00 ` Dirk Grunwald
1996-09-19  4:00   ` Fred Kleinsorge [this message]
1996-09-18  4:00 ` Fred Zwarts
1996-09-18  4:00 ` Fred Kleinsorge
1996-09-19  4:00 ` zrepachol
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox