ØH> Could you describe your ideas on how a "tcl flash driver"
ØH> should work in more detail?


Now we have command to describe flash:

flash bank $NAME $DRIVER_NAME $ADDRESS $SIZE $width $width $TARGET

we have a few internal drivers, like cfs, aduc702x, at91sam3, etc.

I think it would be nice to realize additional driver: manual
and give it a few option:

 -block-size                - size of block to write
 -write-block-procedure     - TCL procedure writting a block

then we would use simple TCL scripts instead C-code.

For example to write a block for AT91sam9xe we need to write two
procedures:

proc ecc_command {command argument} {
            return [ expr (0x5A << 24) | ($argument << 8) | $command ]
}

proc write_block { data address } {

   # copy block into $address (using array2mem)
   ..
   mww $EEFC_FCR [ ecc_command 0x03 $block_no ] # 0x03 - write page command

   # wait READY flag from internal flash (using mem2array)
}


PS: array2mem and mem2array now don't work on my system, so I can't
wrote code exactly.
  

Then we would define flash bank:

flash bank $NAME manual $ADDRESS $SIZE $width $width $TARGET
flash-manual-options $NAME -block-size 512 -write-block-procedure write_block

and use it :)

I don't know if it is difficult to realize or not. Now I haven't
looked through source code :)

PS: sorry for my bad English again
-- 
... mpd is off

. ''`.                               Dmitry E. Oboukhov
: :’  :   email: un...@debian.org jabber://un...@uvw.ru
`. `~’              GPGKey: 1024D / F8E26537 2006-11-21
  `- 1B23 D4F8 8EC0 D902 0555  E438 AB8C 00CF F8E2 6537

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to