Because difference in I/O initilization which makes backlight control not working I made a special kernel module to read and write I/O ports. Writing a program that does mmap of /dev/mem really does not work. Writing a kernel module anyway is much easier.

To compile:

gcc -V 3.3 -D__KERNEL__ -I/root/kernel/celinux-040503/include \
-Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
-fno-strict-aliasing -fno-common -fomit-frame-pointer \
-I /root/kernel/celinux-040503/include/asm/gcc -G 0 \
-mno-abicalls -fno-pic -pipe  -mtune=r4600 -mips2 -Wa,--trap \
-DMODULE -mlong-calls  -nostdinc -iwithprefix include \ 
-DKBUILD_BASENAME=ioprober  -c -o ioprober.o ioprober.c

It creates -/proc/iprober- directory. There it has address to read/write current address in base16. And it has r32, r16, r8 to read/write bits at address. Example:

echo b0050008 > /proc/ioprober/address
cat /proc/ioprober/r16 # read pwm0 duty cycle (base16)
echo 10 > /proc/ioprober/r16 # write pwm0 duty cycle (base16)
Topic attachments
I Attachment Action Size Date Who Comment
cc ioprober.c manage 4.0 K 23 Sep 2008 - 19:54 ArdVanBreemen The source
elseo ioprober.o manage 4.0 K 23 Sep 2008 - 19:54 ArdVanBreemen The module
Topic revision: r2 - 25 Jan 2009 - 14:34:37 - GertvdKnokke
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback