On Mon, 8 May 2000, Nandana wrote: > Date: Mon, 08 May 2000 13:02:06 +0600 > From: Nandana <[EMAIL PROTECTED]> > To: Nicolas Pitre <[EMAIL PROTECTED]> > Subject: Re: Question aboug hardware.h > > Hi, > Have someone got any idea about the method to access PCMCIA attribute > space . > We tried it using io_p2v but we had segmentation faults. > Regards > Harsha See linux/arch/arm/mm/mm-sa1100.c. There you'll find all physical vs virtual mappings for all peripherals. For example, PCMCIA 1 IO space is virtually mapped at 0xe0000000. Then you just need to access memory from that address (simple read or write) to get the data. The io_p2v macro is only used for definition inside SA-1100.h. You shouldn't have to use it directly. Nicolas
Hi, Have someone got any idea about the method to access PCMCIA attribute space . We tried it using io_p2v but we had segmentation faults. Regards Harsha Nicolas Pitre wrote: > On Fri, 5 May 2000, Chien-Min Lee wrote: > > > > > >> 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?? > > 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 > > unsubscribe: body of `unsubscribe linux-arm-kernel' to >[EMAIL PROTECTED]
