* Re: PCI mapping question
1997-05-01 22:08 Hein Roehrig
@ 1997-05-01 15:16 ` jestabro
0 siblings, 0 replies; 11+ messages in thread
From: jestabro @ 1997-05-01 15:16 UTC (permalink / raw)
>>> Hein Roehrig said:
>
> I got rather confused trying to understand how I access PCI memory
> from kernel resp. user mode.
>
> Say, I have a 32-bit PCI address. How do I get the corresponding
> physical address that I can use for ioremap resp. mmap on /dev/mem ?
For user space access to PCI bus memory via "mmap", you need to use the
LIBC routine "unsigned long _bus_base(void)"; add the PCI bus address to
the value returned by that (unsigned long!!!), and pass that along to
"mmap" as the physical address.
The Alphas have (a minimum of) 34 bits of physical address space;
part of that (called DENSE memory space) maps to PCI bus memory.
User memory mapped to PCI bus DENSE space *MUST* be accessed on natural
boundaries of 4 (int) and 8 (long) bytes *ONLY*, otherwise you get unaligned
access traps (harmless except to performance) at least, bus hangs at worst.
If you want to access in smaller chunks (byte and short), refer to the Alpha
Architecture manual (available as PS or PDF on the Digital Semiconductor
website) about SPARSE memory space. There's another LIBC routine,
"unsigned long _bus_base_sparse(void)" that helps the user to "mmap"
such as well.
For examples of both usages, refer to XFree86 3.2 sources in the
"os-support/linux/" and "common_hw/" areas under programs/Xserver/hw/xfree86/.
> For the LCA, bus_to_virt substracts 1G from the bus address -- thats
> weird, if it is meant to translate PCI addresses to virtual addresses,
> esp. since bios32.c layouts the PCI bus to start at 16M... Obviously,
> I must be missing something!?
Not quite...
"virt_to_bus()" converts a kernel virtual address into an address a
DMA-capable device can use to access host memory from off the PCI/ISA
bus. For example, a SCSI driver would use "virt_to_bus()" to get an address
that the controller could use at which to put a block off disk into memory.
"bus_to_virt()" is usually used only by drivers whose controllers pass back
an address they (the controller) used to put something into host memory,
and now the driver needs to get at that data directly.
The Alpha hardware (typically) has "DMA windows" on the PCI bus; these are
(1 or more) ranges of PCI addresses which allow direct access off the bus
into host memory. Usually, the range of PCI addresses from 1Gb to 2Gb-1
is setup to correspond to host memory addresses 0 to 1Gb-1.
Thus, "virt_to_bus()" takes a kernel virtual host memory address (usually :-),
and converts it to physical, then adds the DMA window "base". The final
address, when presented by a peripheral controller (like SCSI or Ethernet)
onto the PCI bus, will trigger access to the desired host memory. Note that
the final address is *not* directly usable by the kernel.
Enough? :-)
--Jay++
-------------------------------------------------------------------------------
American Non Sequitur Society: we don't make sense, but we do like pizza...
Jay A Estabrook Alpha Migration Tools - LINUX Project
Digital Equipment Corp. (508) 952-4202 or (DTN) 227-4202
151 Taylor Street - TAY1-2 enet: jestabro@amt.tay1.dec.com
Littleton, MA 01460-1407 decnet: tallis::jestabro
-------------------------------------------------------------------------------
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* PCI mapping question
@ 1997-05-01 22:08 Hein Roehrig
1997-05-01 15:16 ` jestabro
0 siblings, 1 reply; 11+ messages in thread
From: Hein Roehrig @ 1997-05-01 22:08 UTC (permalink / raw)
Hi all,
I got rather confused trying to understand how I access PCI memory
from kernel resp. user mode.
Say, I have a 32-bit PCI address. How do I get the corresponding
physical address that I can use for ioremap resp. mmap on /dev/mem ?
For the LCA, bus_to_virt substracts 1G from the bus address -- thats
weird, if it is meant to translate PCI addresses to virtual addresses,
esp. since bios32.c layouts the PCI bus to start at 16M... Obviously,
I must be missing something!?
TIA,
Hein
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PCI mapping question
[not found] <199705020016.UAA00790@alpha0.estabrook.org>
@ 1997-05-02 7:04 ` Harald Koenig
1997-05-02 18:17 ` Nikita Schmidt
1 sibling, 0 replies; 11+ messages in thread
From: Harald Koenig @ 1997-05-02 7:04 UTC (permalink / raw)
On May 1, jestabro@amt.tay1.dec.com wrote:
> refer to the Alpha
> Architecture manual (available as PS or PDF on the Digital Semiconductor
> website)
where? 2nd edition too ???
Harald
--
All SCSI disks will from now on ___ _____
be required to send an email notice 0--,| /OOOOOOO\
24 hours prior to complete hardware failure! <_/ / /OOOOOOOOOOO\
\ \/OOOOOOOOOOOOOOO\
\ OOOOOOOOOOOOOOOOO|//
Harald Koenig, \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik // / \\ \
koenig@tat.physik.uni-tuebingen.de ^^^^^ ^^^^^
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PCI mapping question
@ 1997-05-02 8:18 Kari Davidsson
0 siblings, 0 replies; 11+ messages in thread
From: Kari Davidsson @ 1997-05-02 8:18 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2571 bytes --]
jestabro@amt.tay1.dec.com wrote:
>
> >>> Hein Roehrig said:
snip snap
> Not quite...
>
> "virt_to_bus()" converts a kernel virtual address into an address a
> DMA-capable device can use to access host memory from off the PCI/ISA
> bus. For example, a SCSI driver would use "virt_to_bus()" to get an address
> that the controller could use at which to put a block off disk into memory.
>
> "bus_to_virt()" is usually used only by drivers whose controllers pass back
> an address they (the controller) used to put something into host memory,
> and now the driver needs to get at that data directly.
>
> The Alpha hardware (typically) has "DMA windows" on the PCI bus; these are
How are these "DMA windows" created. I am having a problem a making a
PCI
card read correctly from the host memory. Are they created automatically
when the buffer is kmalloced within the driver? When
kmalloc(size,GFP_BUFFER|GFP_DMA); is called?
I have been trying to figure "this" out but I guess reading kernel
source is not
my strongest point 8-). "this" was undefined untill now, I think my
problems are
related to these "DMA windows". At least my card is reading some
bulls*** from the
host memory 8-)
> (1 or more) ranges of PCI addresses which allow direct access off the bus
> into host memory. Usually, the range of PCI addresses from 1Gb to 2Gb-1
> is setup to correspond to host memory addresses 0 to 1Gb-1.
>
> Thus, "virt_to_bus()" takes a kernel virtual host memory address (usually :-),
> and converts it to physical, then adds the DMA window "base". The final
> address, when presented by a peripheral controller (like SCSI or Ethernet)
> onto the PCI bus, will trigger access to the desired host memory. Note that
> the final address is *not* directly usable by the kernel.
>
> Enough? :-)
Do you have some more? 8-)
>
> --Jay++
Thanks,
K.D.
--
*********************************************************************
* Kári Davíðsson * *
* Opiskelijankatu 4 F 330 * *
* 33720 Tampere * Your advertisement here. *
* Finland * Low prices. *
* Tel: + 358-(0)50-5225153 * *
* d154402@cs.tut.fi * *
*********************************************************************
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PCI mapping question
[not found] <19970502090409.14032@tat.physik.uni-tuebingen.de>
@ 1997-05-02 13:55 ` jestabro
0 siblings, 0 replies; 11+ messages in thread
From: jestabro @ 1997-05-02 13:55 UTC (permalink / raw)
>>> Harald Koenig said:
> On May 1, jestabro@amt.tay1.dec.com wrote:
>
> > refer to the Alpha
> > Architecture manual (available as PS or PDF on the Digital Semiconductor
> > website)
>
> where? 2nd edition too ???
http://ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.ht
ml
--Jay++
-------------------------------------------------------------------------------
American Non Sequitur Society: we don't make sense, but we do like pizza...
Jay A Estabrook Alpha Migration Tools - LINUX Project
Digital Equipment Corp. (508) 952-4202 or (DTN) 227-4202
151 Taylor Street - TAY1-2 enet: jestabro@amt.tay1.dec.com
Littleton, MA 01460-1407 decnet: tallis::jestabro
-------------------------------------------------------------------------------
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PCI mapping question
@ 1997-05-02 14:18 Paul Anderson
0 siblings, 0 replies; 11+ messages in thread
From: Paul Anderson @ 1997-05-02 14:18 UTC (permalink / raw)
jestabro@amt.tay1.dec.com wrote:
>
> >>> Harald Koenig said:
> > On May 1, jestabro@amt.tay1.dec.com wrote:
> >
> > > refer to the Alpha
> > > Architecture manual (available as PS or PDF on the Digital Semiconductor
> > > website)
> >
> > where? 2nd edition too ???
>
> http://ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.ht
> ml
>
> --Jay++
The URL you list is not found on the aforementioned server. If you have
a new link it would be very helpful.
Paul Anderson
--
"Good morning, doctors. I have taken the liberty of removing
Windows 95 from my hard drive."
Arthur C Clarke, author of 2001:A Space Odyssey, on the first words
he would have liked HAL, his fictional computer, to speak
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PCI mapping question
[not found] <3369F8E8.2781@agapesystems.com>
@ 1997-05-02 14:22 ` Philip Blundell
0 siblings, 0 replies; 11+ messages in thread
From: Philip Blundell @ 1997-05-02 14:22 UTC (permalink / raw)
On Fri, 2 May 1997, Paul Anderson wrote:
> What is funny is that there are PDF files and there is no Acrobat reader
> for Digital Unix. You would think that DEC would put some pressure on
> Adobe to provide this and not provide their format until there is a
> reader. Unless, of course, there is now a reader and then I stand
> corrected.
New versions of Ghostscript will read PDF.
p.
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PCI mapping question
@ 1997-05-02 14:23 Paul Anderson
0 siblings, 0 replies; 11+ messages in thread
From: Paul Anderson @ 1997-05-02 14:23 UTC (permalink / raw)
jestabro@amt.tay1.dec.com wrote:
>
> >>> Harald Koenig said:
> > On May 1, jestabro@amt.tay1.dec.com wrote:
> >
> > > refer to the Alpha
> > > Architecture manual (available as PS or PDF on the Digital Semiconductor
> > > website)
> >
> > where? 2nd edition too ???
>
> http://ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.ht
> ml
>
> --Jay++
I just used this and it works:
ftp://ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.html#alpha
What is funny is that there are PDF files and there is no Acrobat reader
for Digital Unix. You would think that DEC would put some pressure on
Adobe to provide this and not provide their format until there is a
reader. Unless, of course, there is now a reader and then I stand
corrected.
Paul Anderson
--
"Good morning, doctors. I have taken the liberty of removing
Windows 95 from my hard drive."
Arthur C Clarke, author of 2001:A Space Odyssey, on the first words
he would have liked HAL, his fictional computer, to speak
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PCI mapping question
[not found] <Pine.SOL.3.96.970502152151.28130b-100000@hammer.thor.cam.ac.uk>
@ 1997-05-02 14:35 ` Michal Jaegermann
0 siblings, 0 replies; 11+ messages in thread
From: Michal Jaegermann @ 1997-05-02 14:35 UTC (permalink / raw)
Philip Blundell noted:
>
> On Fri, 2 May 1997, Paul Anderson wrote:
>
> > What is funny is that there are PDF files and there is no Acrobat reader
> > for Digital Unix. You would think that DEC would put some pressure on
> > Adobe to provide this and not provide their format until there is a
> > reader. Unless, of course, there is now a reader and then I stand
> > corrected.
>
> New versions of Ghostscript will read PDF.
I also would be surprised if xpdf would not compile on DU. It does
work on Linux/axp.
--mj
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PCI mapping question
@ 1997-05-02 14:52 Tim Miller
0 siblings, 0 replies; 11+ messages in thread
From: Tim Miller @ 1997-05-02 14:52 UTC (permalink / raw)
Michal Jaegermann wrote:
> I also would be surprised if xpdf would not compile on DU. It does
> work on Linux/axp.
>
> --mj
Unfortunately, xpdf 0.6 (which is the latest I've found) screws up
equations/formula in scientific journal articles. It also produces
a whole SLEW of errors when trying to read pdf files that state
Adobe Acrobat Reader 3.0 required...perhaps 0.6 is missing the
latest standard? I don't know...that suggestion is merely a
guess.
Also, if I am out of line (i.e. xpdf has a later revision) by
all means let me know!!!
Tim
--
~~ WWW Page: http://quantum.phy.vanderbilt.edu/~tim/ ~~
Tim Miller | "Am I mature enough to get old?"
Vanderbilt University | --Me.
Graduate Studies in Physics |
Relativistic Heavy Ions |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PCI mapping question
[not found] <199705020016.UAA00790@alpha0.estabrook.org>
1997-05-02 7:04 ` Harald Koenig
@ 1997-05-02 18:17 ` Nikita Schmidt
1 sibling, 0 replies; 11+ messages in thread
From: Nikita Schmidt @ 1997-05-02 18:17 UTC (permalink / raw)
On May 1, jestabro@amt.tay1.dec.com wrote:
>
> User memory mapped to PCI bus DENSE space *MUST* be accessed on natural
> boundaries of 4 (int) and 8 (long) bytes *ONLY*, otherwise you get unaligned
> access traps (harmless except to performance) at least, bus hangs at worst.
>
Actually this is described in the Core Logic chipset specification,
rather than in the Alpha Architecture manual. But nevertheless, the
question is: are hangs really possible given that low level things like
PALcode and kernel interrupt routines are properly set up? I always
considered such hangs to be major architecture/implementation design
flaws: exceptions should be raised instead. PDP-11 (unlike, say, Intel
8088/*86) was *very* resistant to the events that could potentially
cause lockups.
And, since the non-extended Alpha architecture does not even provide
instructions capable of memory access other than in naturally aligned
4 or 8 byte words (so that CPU cannot issue unaligned or less than 4
byte granular memory access requests), is it at all possible to abuse
the DENSE space?
Kit
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~1997-05-02 18:17 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <19970502090409.14032@tat.physik.uni-tuebingen.de>
1997-05-02 13:55 ` PCI mapping question jestabro
1997-05-02 14:52 Tim Miller
[not found] <Pine.SOL.3.96.970502152151.28130b-100000@hammer.thor.cam.ac.uk>
1997-05-02 14:35 ` Michal Jaegermann
-- strict thread matches above, loose matches on Subject: below --
1997-05-02 14:23 Paul Anderson
[not found] <3369F8E8.2781@agapesystems.com>
1997-05-02 14:22 ` Philip Blundell
1997-05-02 14:18 Paul Anderson
1997-05-02 8:18 Kari Davidsson
[not found] <199705020016.UAA00790@alpha0.estabrook.org>
1997-05-02 7:04 ` Harald Koenig
1997-05-02 18:17 ` Nikita Schmidt
1997-05-01 22:08 Hein Roehrig
1997-05-01 15:16 ` jestabro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox