Subject: Question aboug hardware.h

From: "Chien-Min Lee" <[email-masked]>
Date: Fri, 05 May 2000 12:19:08 +0800 (CST)

Dear All:

 I found the following code in linux-2.2.14-rmk3-np15

In file include\asm-arm\arch-sa1100\hardware.h
/*
 * SA1100 internal I/O mappings
 *
 * We have the following mapping:
 * 	phys		virt
 * 	80000000	f8000000
 * 	90000000	fa000000
 * 	a0000000	fc000000
 * 	b0000000	fe000000
 *
 * Nb: PCMCIA is mapped from 0xe0000000 to f7ffffff in mm-sa1100.c
 *
 */
#define io_p2v( x ) 		\
((((x)&0x00ffffff) | (((x)&0x30000000)>>VIO_SHIFT)) + VIO_BASE)

#define io_v2p( x ) 		\
((((x)&0x00ffffff) | (((x)&(0x30000000>>VIO_SHIFT))<<VIO_SHIFT))+PIO_START)

The above two macros dose map each i/o module base address to desired 
virtual address.
However, if we use the physical address 0x91xxxxxx, after the 
transform of io_p2v(0x91xxxxxx), it can not get the original physical 
address by io_v2p.
Is this situation normal!? 
This really confuses me.

 Thanks!!

kirk

--
----== Mailed via Openfind ==-----
http://mail2000.com.tw/ ���ѧK�O�� e-mail �H�c�A��

unsubscribe: body of `unsubscribe linux-arm-kernel' to [email-masked]

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Fri, 5 May 2000 08:20:17 +0100 (BST)

> Is this situation normal!? 

Yes.  All the virtual->physical and physical->virtual macros are only valid
for RAM areas, not general IO.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |            http://www.arm.linux.org.uk/            /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |