Acces NS9210 registers from user program

Hello,

I need to acces the NS9210 Special Function Registers like the SPI configuration register.
I’m however new to linux and can seem to find a way to access this register directly from my c program.

Does anyone know how to do this?

Thanks in advance,
Ive

You cannot access memory or memory mapped registers from Linux user space directly.
In general you should write a kernel module to access physical memory and ASIC registers,
http://www.makelinux.net/ldd3/chp-2-sect-3.shtml
the module will look like this (just found on google, can’t guarantee it will work):
http://www.mail-archive.com/freebsd-hackers@freebsd.org/msg66826.html
http://www.mail-archive.com/freebsd-hackers@freebsd.org/msg66849.html

but as an alternative take a look at example:
DigiEL_LiveDVD/toolchain/builder/packages/memwatch
This example shows how to access real memory/registers from user space in a more simple way and it was tested to work on DEL.

Thanks,

the memwatch demo from the cd was what i was looking for

Seems like i’m not there jet…
I was able to read/write the registers, but when i tried to write to the SPI Control registers (0x9003_1000 - 0x9003_7FFF), they didn’t change.
I’ve been searching for a while now what may be the cause of this problem, but so far i stil can’t write the SPI control register.

Thanks in advance,
Ive

Are you able to write/read other registers? Perhaps SPI has to be enabled somewhre in like master reset regeter or master clock register or both…

thanks for the reply, you were right: if we enable the spi master driver we can write to the spi registers and change the settings for spi slave.

thanks