[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Battery powered ram





> -----Original Message-----
> From: Mikael Starvik [mailto:mikael.starvik@xxxxxxx.com]
> Sent: donderdag 5 december 2002 12:00
> To: 'Pieter Grimmerink'; dev-etrax
> Subject: RE: Battery powered ram
> 
> 
> Hi,
> 
> ioremap() is your friend here.
> 
> Something like this in a driver should do it:
> 
> unsigned long* mem;
> mem = ioremap(MEM_CSR0_START, MAP_SIZE);
> 
> where MAP_SIZE is the size of the area you want to map

Shouldn't I use request_mem_region() first to allocate the
memory?

Or is ioremap() enough to prevent the rest of the kernel
to use my memory?
I'm afraid ioremap does not actually allocate the memory 
for me.

> 
> You can then access mem with e.g. mem[30] = 3

So we don't have to use writeb / readb functions for
the etrax? 
But I guess that would only be necessary for memory regions 
that cannot be directly mapped in processor address space.


Thanks and best regards,

Pieter