* Re: MMIO for new NCR810 driver?
@ 1996-07-12 20:47 David Mosberger-Tang
0 siblings, 0 replies; 6+ messages in thread
From: David Mosberger-Tang @ 1996-07-12 20:47 UTC (permalink / raw)
>>>>> On Fri, 12 Jul 1996 22:32:33 +0000 (GMT), Gerard Roudier <groudier@club-internet.fr> said:
Gerard> I just try to find some code in the kernel tree which try to
Gerard> use readb() or readl() from bus addresses > 16 MB (our is 68
Gerard> MB) and I did not found anything. Have readb() or readw()
Gerard> ever worked for addresses > 16MB?
They should work. I'm fairly certain I tested the HAE stuff on the
Noname back when we added that it (i.e., a long time ago). But I'm
not sure whether it has been tested with a real device or for the
APECS, though there should be any difference w.r.t. readb/writeb etc.
--david
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <Pine.LNX.3.91.960713100009.10237E-100000@linux.cs.Helsinki.FI>]
* Re: MMIO for new NCR810 driver?
[not found] <Pine.LNX.3.91.960713100009.10237E-100000@linux.cs.Helsinki.FI>
@ 1996-07-13 11:50 ` Gerard Roudier
0 siblings, 0 replies; 6+ messages in thread
From: Gerard Roudier @ 1996-07-13 11:50 UTC (permalink / raw)
On Sat, 13 Jul 1996, Linus Torvalds wrote:
>
> On Fri, 12 Jul 1996, Gerard Roudier wrote:
> >
> > I have understand something like that too. I think that this address
> > calculation allows to acces the video memory directly, without calling
> > some readx() function.
>
> Don't follow that path too closely.
>
I always try to follow allowed pathes for kernel code.
Harald was speaking about X servers and I (wrongly?) imagine that, in user
space, this formula was some kind of reverse ingenieering of kernel
architecture dependant implementation for performances considerations.
> You MUST NOT access IO memory any other way than read/write[bwl]().
> or memcpy_fromio/toio(). EVER.
It is what I had understood and I have changed direct memory
references to "read[bwl]()" function calls in the driver in january.
I am a little aware of portability considerations and constraints but I
have to learn about architectures.
> There are other considerations than just address calculations. Using the
> address calculation stuff for 32- and 64-bit stuff can work on PCI alpha's
> (and on the new ev56 alphas you may even be able to use it for 8- and 16-bit
> accesses if you have a compiler that generates those instructions), but it's
> STILL not correct.
>
> It's simply not portable. On some architectures the IO space may be in a
> totally different address space than the kernel, so that you have to use
> special instructions and/or "segment overrides" (in x86 parlance) etc.
>
> On other architectures you'll only see a _window_ into the IO space, so that
> the IO access functions have to set up the window correctly, and the same
> processor virtual address can actually be _different_ IO ports depending on
> where the window happens to be. Or look at the Jensen, for example: it has
> _no_ support for dense memory, and you _cannot_ make the IO memory look like
> a memory access.
>
> In short, don't even try to make IO memory look like real memory: it
> isn't real memory, and it will never work reliably and portably if you
> try.
>
> Use "read[bwl]/write[bwl]/memcpy_toio/memcpy_fromio". On the x86, they
> translate to the obvious thing anyway so there is no performance impact,
> and on other architectures they may do strange things, but those strange
> things are _needed_.
Thank a lot for your explanations.
The questions I asked me were the following:
- Do read[bwl]() functions expect addresses relative to the base reported by
the PCI BIOS or something else (vremap(ed) for example)?
- Is there some advantage (or not) to try to use the BASE1 window (memory
mapped for i386 PCI implementation) for NCR chips on alpha hardwares?
> Linus
>
Gerard.
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <Pine.LNX.3.91.960712212833.116B-100000@gerard>]
* Re: MMIO for new NCR810 driver?
[not found] <Pine.LNX.3.91.960712212833.116B-100000@gerard>
@ 1996-07-13 7:09 ` Linus Torvalds
0 siblings, 0 replies; 6+ messages in thread
From: Linus Torvalds @ 1996-07-13 7:09 UTC (permalink / raw)
On Fri, 12 Jul 1996, Gerard Roudier wrote:
>
> I have understand something like that too. I think that this address
> calculation allows to acces the video memory directly, without calling
> some readx() function.
Don't follow that path too closely.
You MUST NOT access IO memory any other way than read/write[bwl]().
or memcpy_fromio/toio(). EVER.
There are other considerations than just address calculations. Using the
address calculation stuff for 32- and 64-bit stuff can work on PCI alpha's
(and on the new ev56 alphas you may even be able to use it for 8- and 16-bit
accesses if you have a compiler that generates those instructions), but it's
STILL not correct.
It's simply not portable. On some architectures the IO space may be in a
totally different address space than the kernel, so that you have to use
special instructions and/or "segment overrides" (in x86 parlance) etc.
On other architectures you'll only see a _window_ into the IO space, so that
the IO access functions have to set up the window correctly, and the same
processor virtual address can actually be _different_ IO ports depending on
where the window happens to be. Or look at the Jensen, for example: it has
_no_ support for dense memory, and you _cannot_ make the IO memory look like
a memory access.
In short, don't even try to make IO memory look like real memory: it
isn't real memory, and it will never work reliably and portably if you
try.
Use "read[bwl]/write[bwl]/memcpy_toio/memcpy_fromio". On the x86, they
translate to the obvious thing anyway so there is no performance impact,
and on other architectures they may do strange things, but those strange
things are _needed_.
Linus
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <199607120948.LAA11973@ceres.tat.physik.uni-tuebingen.de>]
* Re: MMIO for new NCR810 driver?
[not found] <199607120948.LAA11973@ceres.tat.physik.uni-tuebingen.de>
@ 1996-07-12 22:32 ` Gerard Roudier
0 siblings, 0 replies; 6+ messages in thread
From: Gerard Roudier @ 1996-07-12 22:32 UTC (permalink / raw)
Hello Harald,
On Fri, 12 Jul 1996, Harald Koenig wrote:
> > I just look into io.h.
> > I did not understand a lot all that stuff.
> > Address ffffbc0..... seems weird (to an ignorant as I am about Alpha).
> > Are you sure that __reab() is expecting addresses that have been remapped
> > by vremap() ?
>
> no, these strange addresses are almost correct; this is the PAGE_OFFSET
> (asm-alpha/page.h) or IDENT_ADDR (asm-alpha/io.h) and part of the address
> for PCI/ISA bus mapping. from the Xserver sources I only know that the
> ISA/PCI bus is mapped to BUS_BASE / APECS_DENSE_MEM = 0xfffffc0300000000UL,
> so this really should be 0xfffffc0300000000 + 0x44000000 = 0xfffffc0344000000
> AFAIK.
I have understand something like that too. I think that this address
calculation allows to acces the video memory directly, without calling
some readx() function. However, it seems that our virtual address
0xfffffe0000042000 has been processed by __readb() or __readw().
The result is something that donnot look like a valid address.
With i386 architecture we need to remap high physical addresses
corresponding to bus addresses in the kernel virtual space in order to be
able to do memory mapped IO from the kernel.
My opinion is that Alpha architecture does not need such recipe and that
the readx() functions are not expecting addresses with IDENT_ADDR offset.
> or for kernel symbols:
> gdb /linux/vmlinux
> (gdb) x/i init
> 0xfffffc0000310f98 <init>: 27bb0016 ldah gp, 1441792(t12)
>
> > Perhaps we should use directly the bus base address (44000000).
> > It is just an idea. I do not reply to the list because I am very probably
> > wrong.
>
> I've tried this too (one never knows;) but it really didn't work
Well.
IMHO, mmio seems to be unnecessary under Alpha. io functions are
implemented with memory instructions and readb() and readw() is too
large and may decrease performances against inx() (x=b,w,l) functions.
I just try to find some code in the kernel tree which try to use readb()
or readl() from bus addresses > 16 MB (our is 68 MB) and I did not found
anything.
Have readb() or readw() ever worked for addresses > 16MB?
>
> > Have you some pointer to documentations about Alpha architecture?
> > At the moment I am quite ignorant of that. I have to learn something
> > about Alpha machines. I am very interested in such hardware.
>
> I'd guess this should be all mentioned in
>
> Alpha AXP Architecture Reference Manual
> Second Edition
> Digital Press/Butterworth-Heinemann
> DEC order #: EY-T132E-DP
> ISBN 1-55558-145-5
> Library of Congress: QA76.9.A73A46
Thanks, I will try to find this Manual.
> but I don't have it (yet?). so far I'm trying to avoid such problems
> or find some AXP guru (they are all on this list ;-)
Seems they are very busy.
> who knows/tells me.
> for the Xserver so far I only needed the bus base address, everything
> else is in user space and seems to work nicely...
>
> you can find some information in linux/include/asm-alpha/apecs.h (for my XL)
> and linux/include/asm-alpha/lca.h (for UDB/Multia) which define
>
> /linux/include/asm-alpha/apecs.h:#define APECS_DENSE_MEM (IDENT_ADDR + 0x300000000UL)
> /linux/include/asm-alpha/lca.h:#define LCA_DENSE_MEM (IDENT_ADDR + 0x300000000UL)
readb() and readw() are implemented through sparce space (APECS_SPARSE_MEM).
> > > ncr_attach: unit=0 chip=810 base=44000000, io_port=b400, irq=11
> > > ncr53c810-0: using memory mapped IO at virtual address 0xfffffe0000042000
> > > Unable to handle kernel paging request at virtual address ffffbc0200840080
>
> I don't understand why the kernel paging request address is much lower than
> the virt. MMIO address and even lower than PAGE_OFFSET or APECS_DENSE_MEM
Look into apecs.h / readb() and you will understand what happened to your
virtual remapped address just before the fault.
>
> Harald
Gerard.
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <Pine.LNX.3.91.960711230857.6399C-100000@gerard>]
* Re: MMIO for new NCR810 driver?
[not found] <Pine.LNX.3.91.960711230857.6399C-100000@gerard>
@ 1996-07-12 9:35 ` Harald Koenig
0 siblings, 0 replies; 6+ messages in thread
From: Harald Koenig @ 1996-07-12 9:35 UTC (permalink / raw)
> I just look into io.h.
> I did not understand a lot all that stuff.
> Address ffffbc0..... seems weird (to an ignorant as I am about Alpha).
> Are you sure that __reab() is expecting addresses that have been remapped
> by vremap() ?
no, these strange addresses are almost correct; this is the PAGE_OFFSET
(asm-alpha/page.h) or IDENT_ADDR (asm-alpha/io.h) and part of the address
for PCI/ISA bus mapping. from the Xserver sources I only know that the
ISA/PCI bus is mapped to BUS_BASE / APECS_DENSE_MEM = 0xfffffc0300000000UL,
so this really should be 0xfffffc0300000000 + 0x44000000 = 0xfffffc0344000000
AFAIK.
or for kernel symbols:
gdb /linux/vmlinux
(gdb) x/i init
0xfffffc0000310f98 <init>: 27bb0016 ldah gp, 1441792(t12)
> Perhaps we should use directly the bus base address (44000000).
> It is just an idea. I do not reply to the list because I am very probably
> wrong.
I've tried this too (one never knows;) but it really didn't work
> Have you some pointer to documentations about Alpha architecture?
> At the moment I am quite ignorant of that. I have to learn something
> about Alpha machines. I am very interested in such hardware.
I'd guess this should be all mentioned in
Alpha AXP Architecture Reference Manual
Second Edition
Digital Press/Butterworth-Heinemann
DEC order #: EY-T132E-DP
ISBN 1-55558-145-5
Library of Congress: QA76.9.A73A46
but I don't have it (yet?). so far I'm trying to avoid such problems
or find some AXP guru (they are all on this list ;-) who knows/tells me.
for the Xserver so far I only needed the bus base address, everything
else is in user space and seems to work nicely...
you can find some information in linux/include/asm-alpha/apecs.h (for my XL)
and linux/include/asm-alpha/lca.h (for UDB/Multia) which define
/linux/include/asm-alpha/apecs.h:#define APECS_DENSE_MEM (IDENT_ADDR + 0x300000000UL)
/linux/include/asm-alpha/lca.h:#define LCA_DENSE_MEM (IDENT_ADDR + 0x300000000UL)
> > ncr_attach: unit=0 chip=810 base=44000000, io_port=b400, irq=11
> > ncr53c810-0: using memory mapped IO at virtual address 0xfffffe0000042000
> > Unable to handle kernel paging request at virtual address ffffbc0200840080
I don't understand why the kernel paging request address is much lower than
the virt. MMIO address and even lower than PAGE_OFFSET or APECS_DENSE_MEM
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: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
^ permalink raw reply [flat|nested] 6+ messages in thread
* MMIO for new NCR810 driver?
@ 1996-07-11 19:13 Harald Koenig
0 siblings, 0 replies; 6+ messages in thread
From: Harald Koenig @ 1996-07-11 19:13 UTC (permalink / raw)
does I/O mapping work with the new NCR driver for anyone on alpha?
both the XL266 and UDB233 panic like this (from the XL266):
ncr53c8xx : at PCI bus 0, device 6, function 0
ncr_attach: unit=0 chip=810 base=44000000, io_port=b400, irq=11
ncr53c810-0: using memory mapped IO at virtual address 0xfffffe0000042000
Unable to handle kernel paging request at virtual address ffffbc0200840080
swapper(1): Oops 0
pc = [<fffffc0000421b44>] ps = 0000
rp = [<fffffc000040710c>] sp = fffffc0000079d10
r0=fffffc0000476f70 r1=fffffc0200000000 r2=ffffbc0200840080 r3=0
r8=42c
r16=fffffe0000042004 r17=4400001c r18=1 r19=ffffffffffffffec
r20=f r21=0 r22=ffffffff88030000 r23=4
r24=f r25=10 r26=fffffc000040710c r27=fffffc0000421ac8
r28=0 r29=fffffc000046cc50 r30=fffffc0000079d10
Code: 4880b722 48241721 40410402 <a0020000> 4801f620 48060680 48003620 6bfa8001 27bb0005
with
(gdb) x/i 0xfffffc0000421b44
0xfffffc0000421b44 <_readb+124>: a0020000 ldl v0, 0(t1)
(gdb) x/i 0xfffffc000040710c
0xfffffc000040710c <ncr_attach+788>: 27ba0006 ldah gp, 393216(ra)
any idea what's still wrong with vremap() et.al. ?
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: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1996-07-13 11:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-07-12 20:47 MMIO for new NCR810 driver? David Mosberger-Tang
[not found] <Pine.LNX.3.91.960713100009.10237E-100000@linux.cs.Helsinki.FI>
1996-07-13 11:50 ` Gerard Roudier
[not found] <Pine.LNX.3.91.960712212833.116B-100000@gerard>
1996-07-13 7:09 ` Linus Torvalds
[not found] <199607120948.LAA11973@ceres.tat.physik.uni-tuebingen.de>
1996-07-12 22:32 ` Gerard Roudier
[not found] <Pine.LNX.3.91.960711230857.6399C-100000@gerard>
1996-07-12 9:35 ` Harald Koenig
-- strict thread matches above, loose matches on Subject: below --
1996-07-11 19:13 Harald Koenig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox