From: "sd\.mail" <sd.mail@laposte.net>
To: "linuxppc-embedded" <linuxppc-embedded@ozlabs.org>
Subject: isa_io_base and _IO_BASE usage
Date: Thu, 4 May 2006 14:30:19 +0200 [thread overview]
Message-ID: <IYQQQJ$15FC0C241A37525F2DA33CF46BA086DD@laposte.net> (raw)
Hi,
i would like to have some details about isa_io_base and _IO_BASE usage be=
cause 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 be=
cause of inb macro add ___IO_BASE =3D _IO_BASE =3D isa_io_mem to port add=
ress.
When trap is produce, port parameter is equal to 0xF3000028, for result t=
o 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 =3D hose_a->io_bas=
e_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 =3D MPC85XX_PCI1_LOWER_IO;
hose_a->io_space.end =3D MPC85XX_PCI1_UPPER_IO;
hose_a->io_base_phys =3D MPC85XX_PCI1_IO_BASE;
#ifdef CONFIG_85xx_PCI2
hose_a->io_base_virt =3D ioremap(MPC85XX_PCI1_IO_BASE,
MPC85XX_PCI1_IO_SIZE +
MPC85XX_PCI2_IO_SIZE);
#else
hose_a->io_base_virt =3D ioremap(MPC85XX_PCI1_IO_BASE,
MPC85XX_PCI1_IO_SIZE);
#endif
isa_io_base =3D (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" \
: "=3D&r" (x) \
: "r" (port + ___IO_BASE)); \
return x; \
}=0A=0AAcc=E9dez au courrier =E9lectronique de La Poste : www.laposte.net=
; =0A3615 LAPOSTENET (0,34 =80/mn) ; t=E9l : 08 92 68 13 50 (0,34=80/mn)=
=0A=0A
reply other threads:[~2006-05-04 12:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='IYQQQJ$15FC0C241A37525F2DA33CF46BA086DD@laposte.net' \
--to=sd.mail@laposte.net \
--cc=linuxppc-embedded@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox