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

addressing external memory



Say I connect a 4K sram chip to the etrax address and data busses, and tie
its chip enable to CSR0.

Will this code work for accessing this memory?

#define CSR0_START 0x08000000
#define NOCACHE	   0x80000000

int kcore = open("/proc/kcore",O_RDWR);
void * sram = mmap(CSR0_START | NOCACHE, 4096,0,
	          PROT_READ|PROT_WRITE, kcore,0);


Thanks!
Ben