public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* isa_read/write not available on ppc - solution suggestions ??
@ 2001-05-01 13:52 mike_phillips
  2001-05-01  4:32 ` Arnaldo Carvalho de Melo
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: mike_phillips @ 2001-05-01 13:52 UTC (permalink / raw)
  To: linux-kernel, netdev

To get the pcmcia ibmtr driver (ibmtr/ibmtr_cs) working on ppc, all the 
isa_read/write's have to be changed to regular read/write due to the lack 
of the isa_read/write functions for ppc.

So, the question is should I simply:

a) change everything to read/write and friends (the way the driver used to 
be before the isa_read/write function were introduced)
b) Put ugly macros in the driver to use the different functions depending 
upon architecture.
c) Implement the isa_read/write functions for ppc ? 
or d) something completely different I haven't thought of. 

Remember, this driver must support isa, pcmcia, mca, ix86 and now ppc. 

Personally I'd rather not have arch dependent macros in the driver, but I 
know there is a good reason why the isa_read/write functions were 
introduced in the first place. 

Suggestions ?

Mike
Linux Token Ring Project
http://www.linuxtr.net

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: isa_read/write not available on ppc - solution suggestions ??
@ 2001-05-01 15:27 mike_phillips
  2001-05-01 17:22 ` Linus Torvalds
  0 siblings, 1 reply; 20+ messages in thread
From: mike_phillips @ 2001-05-01 15:27 UTC (permalink / raw)
  To: Brian Gerst; +Cc: Alan Cox, linux-kernel, netdev

>mike_phillips@urscorp.com wrote:
>> 
>> To get the pcmcia ibmtr driver (ibmtr/ibmtr_cs) working on ppc, all the
>> isa_read/write's have to be changed to regular read/write due to the 
lack
>> of the isa_read/write functions for ppc.

> Treat it like a PCI device and use ioremap().  Then change isa_readl()
> to readl() etc.

Bleurgh, the latest version of the driver (not in the kernel yet) searches 
for turbo based cards by checking the isa address space from 0xc0000 - 
0xe0000 in 8k chunks. So we'd have to ioremap each 8k section, check it, 
find out the adapter isn't there and then iounmap it. 

Oh well, if that's what it takes =:0

Mike


^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: isa_read/write not available on ppc - solution suggestions ??
@ 2001-05-01 17:41 mike_phillips
  0 siblings, 0 replies; 20+ messages in thread
From: mike_phillips @ 2001-05-01 17:41 UTC (permalink / raw)
  To: linux-kernel

> I would suggest the opposite approach instead: make the PPC just 
> support isa_readx/isa_writex instead.
>
> Much simpler, and doesn't need changes to (correct) driver sources.
>
> I bet that the patch will be smaller too. It's a simple case of
> - do the ioremap() _once_ at bootup, save the result in a static
>   variable somewhere.
> - implement the (one-liner) isa_readx/isa_writex functions.
>
> On many architectures you don't even need to do the ioremap, as it's
> always available (same as on x86).

That would be my preferred solution as well. The one-liners are easy, the 
ioremap may be more fun. Time to investigate the ppc code and docs. 

Unless one of the kindly ppc maintainers who knows far more about the arch 
than me would like to do it :)

Mike


^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: isa_read/write not available on ppc - solution suggestions ??
@ 2001-05-02 13:12 mike_phillips
  2001-05-03 11:08 ` Anton Blanchard
  0 siblings, 1 reply; 20+ messages in thread
From: mike_phillips @ 2001-05-02 13:12 UTC (permalink / raw)
  To: paulus; +Cc: linux-kernel

> We can certainly do that, no problem.

> BUT that won't get a token ring pcmcia card working in the newer
> powerbooks, such as the titanium G4 powerbook, because the PCI host
> bridge doesn't map any cpu addresses to the bottom 16MB of PCI memory
> space.  This is not a problem as far as pcmcia cards are concerned -
> the pcmcia stuff just picks an appropriate address (typically in the
> range 0x90000000 - 0x9fffffff) and sets the pcmcia/cardbus bridge to
> map that to the card.  But it means that the physical addresses for
> the card's memory space will be above the 16MB point, so it is
> essential to do the ioremap.

This is where the multiple support issue comes in. In ibmtr_cs.c we do 
ioremap the addresses so pcmcia all works nicely. What we don't do at 
present is an ioremap in ibmtr.c for the non-pcmcia adapters (isa & mca). 
So, I suppose the real fix would be to implement the ioremap in ibmtr.c so 
that regular read/writes can be used everywhere in the driver. (This is 
half the battle with changes to the driver, it supports so many 
combinations that one change for one type of adapter can kill support for 
another adapter, and that's my bottom line with updates: No loss of 
functionality we already had.)

Or we could just tell people to use the cardbus token ring adapter on ppc 
instead ;)

Mike


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2001-05-03 11:16 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-01 13:52 isa_read/write not available on ppc - solution suggestions ?? mike_phillips
2001-05-01  4:32 ` Arnaldo Carvalho de Melo
2001-05-01 14:35 ` Alan Cox
2001-05-01 14:50   ` Brian Gerst
2001-05-01 15:14     ` Alan Cox
2001-05-01 14:36 ` Brian Gerst
2001-05-01 17:33 ` Geert Uytterhoeven
  -- strict thread matches above, loose matches on Subject: below --
2001-05-01 15:27 mike_phillips
2001-05-01 17:22 ` Linus Torvalds
2001-05-01 19:45   ` Russell King
2001-05-01 21:19     ` Linus Torvalds
2001-05-01 21:31       ` Russell King
2001-05-01 22:46         ` Linus Torvalds
2001-05-02 15:10           ` Jonathan Lundell
2001-05-02  1:02   ` Paul Mackerras
2001-05-02 19:28     ` Benjamin Herrenschmidt
2001-05-02  7:26   ` Geert Uytterhoeven
2001-05-01 17:41 mike_phillips
2001-05-02 13:12 mike_phillips
2001-05-03 11:08 ` Anton Blanchard

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