linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* G4 + Linux + PCI device + x86 driver = 0
@ 1999-11-14  0:55 David W. Patmore
  1999-11-14 11:41 ` Takashi Oe
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: David W. Patmore @ 1999-11-14  0:55 UTC (permalink / raw)
  To: linuxppc-dev


Hi,

I'm trying to port a device driver from working x86 code over to a G4 (early
350MHz) running LinuxPPC.  The driver will load up, but the memory access
isn't working.

Linux version: 2.2.6 Sat Oct 30 1999
gcc version: egcs-2.91.66

warning sign:  I get warning message "pcidrv.o was compiled for kernel
version
2.2.6-15apmac, while this kernel is version 2.2.6".  I force the driver to
load
using "insmod -f pcidrv.o".

The original x86 (Redhat 6.0) driver uses virt_to_bus() to get the address
to write to.  In LinuxPPC, that function is not available (not in name
table).  I guess that I'm supposed to use ioremap(), but that doesn't seem
to do it for me either.

Code snip:
	ul_reg_addr = p_dev->base_address[0];

	pul_remapped =ioremap( ul_reg_addr, 32 );

	printk( "pcidrv: base addr %08X \n", ul_reg_addr );
	printk( "pcidrv: pul_remapped %08X \n", pul_remapped );
	printk( "pcidrv: remapped data: %08X \n", *pul_remapped );

	iounmap( pul_remapped );

The outcome of running this code is:  pci base address (0x80890000),
remapped (0xC8271000), data (0xFFFFFFFF).  The data is a status word which I
expect to be not
all "F"s.  Note that iounmap is "TBD" in the source, so each time the code
runs per
reboot, iomap returns a new address.

If anyone has some advice, I'd be very pleased to hear it.  I need to go on
the G4, because that is what I have on hand.

Thanks very much,

David Patmore


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~1999-12-06  6:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-11-14  0:55 G4 + Linux + PCI device + x86 driver = 0 David W. Patmore
1999-11-14 11:41 ` Takashi Oe
1999-11-14 23:50 ` Paul Mackerras
1999-11-15  9:33 ` Adrian Cox
1999-12-03 23:00   ` Update: " David W. Patmore
1999-12-04  0:50     ` David Edelsohn
1999-12-04  1:13       ` endian-swapping Hollis R Blanchard
1999-12-04  1:56         ` endian-swapping David Edelsohn
1999-12-04 19:13         ` endian-swapping Gabriel Paubert
1999-12-04 11:57     ` Update: RE: G4 + Linux + PCI device + x86 driver = 0 Michel Lanners
1999-12-05 19:42       ` Geert Uytterhoeven
1999-12-06  6:51         ` Michel Lanners

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).