Subject: Re: Question aboug hardware.h

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

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

>Yes.  All the virtual->physical and physical->virtual macros are only valid
>for RAM areas, not general IO.

   Does this mean that these two macros are useless!??
   What address type(physical or virtual) do we use to access the registers of 
   peripheral control modules??

   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: Nicolas Pitre <[email-masked]>
Date: Fri, 5 May 2000 10:20:05 -0400 (EDT)

>    peripheral control modules??

You really don't have to bother about virtual or physical location of
registers.  If you want to clear some GPIOs, simply use

	GEDR |= (1<<x);		/* set GPIO x direction for output */
	GPCR = (1<<x);		/* set GPIO x low */
	val = (GPLR & (1<<y));	/* read GPIO y level (zero or not) */

where x and y are your GPIO numbers.  If you want to play with the memory
control register, simply use MECR like:

	MECR = (MECR & (some_bits)) | some_other_bits;

All those peripheral registers are defined in include/asm/arch/SA-1100.h.
You should use them and not care about where and how they are mapped.

Nicolas