2009-04-08 13:25:50     Using dd with OTP memory driver

Document created by Aaronwu Employee on Aug 14, 2013
Version 1Show Document
  • View in full screen mode

2009-04-08 13:25:50     Using dd with OTP memory driver

ian davidson (UNITED KINGDOM)

Message: 72428   


Can dd be used to write to the OTP memory driver?


I have built the kernel with On-Chip OTP memory support (with writing enabled), the driver initialised OK; done mknod with mode bits 666; dd works OK reading the OTP memory.


So to read the last 8 byte record of the "Unsecured general purpose space" at Page Address 0xDF I do:


root:/mnt/DPLtarget/otp> dd if=/dev/otp of=cps223 bs=8 skip=223 seek=223 count=1

1+0 records in

1+0 records out



And get file cps223 of 8 bytes - all zero - which is fine.


I have created an 8 byte file (jill) which I want to write into the same place and do:


root:/mnt/DPLtarget/otp> dd if=jill of=/dev/otp bs=8 skip=0 seek=223 count=1

dd: writing '/dev/otp': Invalid argument

1+0 records in

0+0 records out



Am I using dd incorrectly?


Also how do I enable pr_debug( ) in the driver for this device,


Many thanks,


Ian Davidson


root:/mnt/DPLtarget/otp> version

kernel:    Linux release, build #104 Mon Apr 6 17:57:24 BST 2009

toolchain: bfin-uclinux-gcc release gcc version 4.1.2 (ADI svn)

user-dist: release 2008R1.5, build #96 Mon Apr 6 17:57:47 BST 2009

root:/mnt/DPLtarget/otp> cat /proc/version

Linux version (iand@vgc-ds1.vitecnet.local) (gcc version 4.1.2 (ADI svn)) #104 Mon Apr 6 17:57:24 BST 2009



Processor is BF527C









2009-04-08 13:56:14     Re: Using dd with OTP memory driver

ian davidson (UNITED KINGDOM)

Message: 72429   


hang on a bit, I've just tried it with u-boot ang got an error:


dpl_u-boot> otp write 100000 60 1

Writing one time programmable memory

Make sure your operating voltages and temperature are within spec

   source address:  0x00100000

   OTP destination: lower page 0x060 - lower page 0x060

   number to write: 1 halfpages

type "YES" (no quotes) to confirm: YES

OTP memory write: addr 0x00100000  page 0x060  count 1 ...

ERROR at page 0x060 (lower-halfpage): 0x003: OTP fuse write error



So I guess wen need to check operating voltages and temperatures on oour target,


or perhaps this page is protected.








2009-04-08 16:51:30     Re: Using dd with OTP memory driver

Mike Frysinger (UNITED STATES)

Message: 72435   


OTP writing was not supported in the last release.  only current trunk supports it (u-boot and linux).


further, you need to have a new enough part ... bf54x-0.0 for example did not support writing.




2009-04-09 07:31:42     Re: Using dd with OTP memory driver

ian davidson (UNITED KINGDOM)

Message: 72463   


thanks Mike