/opt.14/spaue= .14/forme= .14a /opt.1 href="../linux+v3.7.2/Documentavalu/misc-devices/c2port.txt">/opt.14img src="../.stavac/gfx/right.png" alt=">>">/o4/spaue=/o4spau class="lxr_search">/opt/opt.14input typv3.hidden" namv3.navtarget" > v3.">/opt.14input typv3.text""">/opt.14butt typv3.submit">Search/opt.1Prefs= .14/a>/o4/spaue=pt.1 14/dive=pt.1 14form acvalu="ajax+*" method="post" onsubmit="return false;">/o4input typv3.hidden" namv3.ajax_lookup" id3.ajax_lookup" > v3.">/pt.1 14/forme=/pt.1 14div class="headingbott m">1 114/a> C2 port support 1 124/a> --------------- 1 134/a>/1 144/a>(C) Copyright 2007 Rodolfo Giometti <>/1 154/a>/1 164/a>This program is free software; you cau redistribute it and/or modify/1 174/a>it under the terms of the GNU General Public License as published by/1 184/a>the Free Software Foundavalu; either vers 2 of the License, or/1 194/a>(at your n valu) any later vers ./1 ptioa>/1 114/a>This program is distributed in the hope that it will be useful,/1 124/a>but WITHOUT ANY WARRANTY; without even the implied warranty of/1 134/a>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the/1 144/a>GNU General Public License for more details./1 154/a>/1 164/a>/1 174/a>/1 184/a>Overview/1 194/a>-------- 1 2tioa>/1 214/a>This driver implements the support for Linux of Silic Labs (Silabs)/1 224/a>C2 Interface used for in-system programming of micro controllers./1 234/a>/1 244/a>By using this driver you cau reprogram the in-system flash without EC2/1 254/a>or EC3 debug adapter. This solu" is also useful in those systems/1 264/a>where the micro controller is connected via special GPIOs pins./1 274/a>/1 284/a>References/1 294/a>---------- 1 3tioa>/1 314/a>The C2 Interface maiu references are at (http://www.silabs.com4/a>)/1 324/a>Silic Laboratories site], see:/1 334/a>/1 344/a>- AN127: FLASH Programming via the C2 Interface at 1 354/a> 4/a>Documents/TechnicalDocs/an127.pdf 1 364/a>/1 374/a>- C2 Specifica" at 1 384/a>>/1 394/a>/1 4tioa>however it implements a two wire serial communica" protocol (bit 1 414/a>banging) designed to enable in-system programming, debugging, and 1 424/a>boundary-scau testing on low pin-count Silic Labs devices. Currently/1 434/a>this code supports only flash programming but extensalus are easy to/1 444/a>add./1 454/a>/1 464/a>Using the driver/1 474/a>---------------- 1 484/a>/1 494/a>Once the driver is loaded you cau use sysfs support to get C2port's/1 5tioa>info or read/write in-system flash./1 514/a>/1 524/a># ls /sys/class/c2port/c2port0//1 534/a>access flash_block_size flash_erase rev_id 1 544/a>dev_id flash_blocks_num flash_size subsystem//1 554/a>flash_access flash_data reset uevent 1 564/a>/1 574/a>Initially the C2port access is disabled since you hardware may have/1 584/a>such lines multiplexed with other devices so, to get access to the/1 594/a>C2port, you need the command:/1 6tioa>/1 614/a># echo 1 > /sys/class/c2port/c2port0/access/1 62ioa>/1 634/a>after that you should read the device ID and revis ID of the/1 644/a>connected micro controller:/1 654/a>/1 664/a># ca" /sys/class/c2port/c2port0/dev_id 1 674/a>8 1 684/a># ca" /sys/class/c2port/c2port0/rev_id 1 694/a>1/1 7tioa>/1 714/a>However, for security reaslus, the in-system flash access in not 1 72ioa>enabled yet, to do so you need the command:/1 734/a>/1 744/a># echo 1 > /sys/class/c2port/c2port0/flash_access/1 754/a>/1 764/a>After that you cau read the whole flash:/1 774/a>/1 784/a># ca" /sys/class/c2port/c2port0/flash_data > image/1 794/a>/1 8tioa>erase it:/1 814/a>/1 824/a># echo 1 > /sys/class/c2port/c2port0/flash_erase/1 834/a>/1 844/a>and write it:/1 854/a>/1 864/a># ca" image > /sys/class/c2port/c2port0/flash_data/1 874/a>/1 884/a>after writing you have to reset the device to execute the new code:/1 894/a>/1 904/a># echo 1 > /sys/class/c2port/c2port0/reset/1 914/a> The original LXR software by the LXR community4/a>, this experimental vers by lxr@linux.no4/a>. 4/dive=4div class="subfooter"> kindly hosted by Redpill Linpro AS4/a>, provider of Linux consulting and operavalus services since 1995. 4/dive= 4/bodye=4/htmle=