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

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

You can then access mem with e.g. mem[30] = 3 or with
memory to memory DMA (remember that DMA requires 
physical addresses and that all pages are present
in memory etc).

If you need the SRAM to be uncached you should 
do MEM_CSR0_START | MEM_NON_CACHEABLE instead.

/Mikael
-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
Behalf Of Pieter Grimmerink
Sent: Thursday, December 05, 2002 10:29 AM
To: dev-etrax
Subject: Battery powered ram


I would like to connect a small battery powered SRAM chip to the etrax100LX, 
and use that for non volatile storage.
Now I'm wondering how I should reserve its physical address range at bootup, 
in order to be able to map it as a device (like /dev/mem).
Could this be done in a kernel driver, or is that already too late (memory 
might already be in use?)

Best regards,

Pieter