isa_io_base and _IO_BASE usage

sd.mail sd.mail at laposte.net
Thu May 4 22:30:19 EST 2006


Hi,
i would like to have some details about isa_io_base and _IO_BASE usage because i can't access to a PCI-PMC I/O space correctly.
My platform is a PMC board based on MPC85xx (see end of mail to show isa_io_base and _IO_BASE configuration).
I have set MPC85XX_PCI1_IO_BASE to 0xF3000000 and MPC85XX_PCI1_IO_SIZE to 0x01000000.
I can't correctly access to a PCI-PMC-disk in PIO mode. 
Function ide_inb (in drivers/ide/ide-iops.c function ) produces a trap because of inb macro add ___IO_BASE = _IO_BASE = isa_io_mem to port address.
When trap is produce, port parameter is equal to 0xF3000028, for result to an access on bus to 0xF3000028+0xF3000000 !!!
If i set isa_io_base to 0, my PCI-PMC-disk is recognized and i can use it !
My questions are :
Is-it a good solution to set isa_io_base to 0 ?
Is-it better to set _IO_BASE to 0 and keep isa_io_base = hose_a->io_base_virt ?
Why we add ___IO_BASE in __do_in_asm macro ?

Any suggestion are greatly appreciated.
Thanks, 
Sebastien D.

include/asm-ppc/mpc85xx.h :
---------------------------
#define _IO_BASE isa_io_base
arch/ppc/syslib/ppc85xx_setup.c :
---------------------------------
hose_a->io_space.start = MPC85XX_PCI1_LOWER_IO;
hose_a->io_space.end = MPC85XX_PCI1_UPPER_IO;
hose_a->io_base_phys = MPC85XX_PCI1_IO_BASE;
#ifdef CONFIG_85xx_PCI2
hose_a->io_base_virt = ioremap(MPC85XX_PCI1_IO_BASE,
MPC85XX_PCI1_IO_SIZE +
MPC85XX_PCI2_IO_SIZE);
#else
hose_a->io_base_virt = ioremap(MPC85XX_PCI1_IO_BASE,
MPC85XX_PCI1_IO_SIZE);
#endif
isa_io_base = (unsigned long)hose_a->io_base_virt;
include/asm-ppc/io.h :
----------------------
__do_in_asm(inb, "lbzx")
#define ___IO_BASE ((void __iomem *)_IO_BASE)
#define __do_in_asm(name, op) \
extern __inline__ unsigned int name(unsigned int port) \
{ \
unsigned int x; \
__asm__ __volatile__( \
"0:" op " %0,0,%1\n" \
"1: twi 0,%0,0\n" \
"2: isync\n" \
"3: nop\n" \
"4:\n" \
".section .fixup,\"ax\"\n" \
"5: li %0,-1\n" \
" b 4b\n" \
".previous\n" \
".section __ex_table,\"a\"\n" \
" .align 2\n" \
" .long 0b,5b\n" \
" .long 1b,5b\n" \
" .long 2b,5b\n" \
" .long 3b,5b\n" \
".previous" \
: "=&r" (x) \
: "r" (port + ___IO_BASE)); \
return x; \
}

Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn)






More information about the Linuxppc-embedded mailing list