News & Analysis
Linux utility to write/read OMAP35x memory mapped registers
Helen Tso
7/1/2009 12:28 PM EDT
Question: Is there a Linux application utility that allows the user to write/read OMAP35x memory mapped registers? This is for an OMAP35x evaluation module (EVM) from Mistral that does not have a LSP directory. Do I need to supply kernel source dir?
Answer: Yes to both questions. Click here for utility. Below are the instructions:
1.Introduction: The purpose of this document is to explain how to use a /proc function to read and write to registers on processors based on DaVinci technology and/or OMAP processors. Here, commands issued on the host begin with host $ and commands issued on the target begin with target $.
2.Installing the code: Download the attached regrw.tar.gz to your working directory and extract the files. For example, if the download was saved to the directory /home/user/workdir/regrw, you would issue the following commands in a Linux prompt:
host $ cd /home/user/workdir/regrwhost $ tar -xzvf regrw.tar.gz
Next, modify the Makefile so that LSPDIR points to your LSP directory. For example, change:
LSPDIR=Now, compile the code:
host $ makeThis will create a regwr.ko file that should be copied to that target's file system. For example:
host $ cp regrw.ko /home/user/target3. Running the code: To run the code, on the target, move to the directory where you placed the regrw.ko file, and install it. For example, if the file was placed in the target's root directory:
target $ cd /target $ insmod regrw.ko
Now you should be able to read and write to registers. To read from a register, issue a command of the form echo ADDR > /proc/regrw where ADDR is the hex address of the register to read. For example, to read from register 01c40000, issue the command:
target $ echo 01c40000 > /proc/regrw
To write to a register, issue a command of the form echo ADDR DATA > /proc/regw where ADDR is the hex address to write to, and DATA is the data to write to that register. For example, to write 00000000 to register 01c72784, issue the command:
target $ echo 01c72784 00000000 > /proc/regrw
When you are finished, remove the module:
target $ rmmod regrw
For follow up questions, go to TI's e2e Community.



