summaryrefslogtreecommitdiff
path: root/Documentation/misc-devices/c2port.rst
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-08-05 08:47:54 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2020-08-05 08:47:54 +0300
commit2324d50d051ec0f14a548e78554fb02513d6dcef (patch)
tree467e5622cf878daed7c00be90a02a1f036de04ad /Documentation/misc-devices/c2port.rst
parenta754292348bf88ec6b55563eca4faba7dcfe2ae7 (diff)
parent2c12c8103d8f15790cf880f1545dafa36acb004a (diff)
downloadlinux-2324d50d051ec0f14a548e78554fb02513d6dcef.tar.xz
Merge tag 'docs-5.9' of git://git.lwn.net/linux
Pull documentation updates from Jonathan Corbet: "It's been a busy cycle for documentation - hopefully the busiest for a while to come. Changes include: - Some new Chinese translations - Progress on the battle against double words words and non-HTTPS URLs - Some block-mq documentation - More RST conversions from Mauro. At this point, that task is essentially complete, so we shouldn't see this kind of churn again for a while. Unless we decide to switch to asciidoc or something...:) - Lots of typo fixes, warning fixes, and more" * tag 'docs-5.9' of git://git.lwn.net/linux: (195 commits) scripts/kernel-doc: optionally treat warnings as errors docs: ia64: correct typo mailmap: add entry for <alobakin@marvell.com> doc/zh_CN: add cpu-load Chinese version Documentation/admin-guide: tainted-kernels: fix spelling mistake MAINTAINERS: adjust kprobes.rst entry to new location devices.txt: document rfkill allocation PCI: correct flag name docs: filesystems: vfs: correct flag name docs: filesystems: vfs: correct sync_mode flag names docs: path-lookup: markup fixes for emphasis docs: path-lookup: more markup fixes docs: path-lookup: fix HTML entity mojibake CREDITS: Replace HTTP links with HTTPS ones docs: process: Add an example for creating a fixes tag doc/zh_CN: add Chinese translation prefer section doc/zh_CN: add clearing-warn-once Chinese version doc/zh_CN: add admin-guide index doc:it_IT: process: coding-style.rst: Correct __maybe_unused compiler label futex: MAINTAINERS: Re-add selftests directory ...
Diffstat (limited to 'Documentation/misc-devices/c2port.rst')
-rw-r--r--Documentation/misc-devices/c2port.rst94
1 files changed, 94 insertions, 0 deletions
diff --git a/Documentation/misc-devices/c2port.rst b/Documentation/misc-devices/c2port.rst
new file mode 100644
index 000000000000..7e4f6a79418a
--- /dev/null
+++ b/Documentation/misc-devices/c2port.rst
@@ -0,0 +1,94 @@
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: <isonum.txt>
+
+===============
+C2 port support
+===============
+
+(C) Copyright 2007 Rodolfo Giometti <giometti@enneenne.com>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+
+
+Overview
+--------
+
+This driver implements the support for Linux of Silicon Labs (Silabs)
+C2 Interface used for in-system programming of micro controllers.
+
+By using this driver you can reprogram the in-system flash without EC2
+or EC3 debug adapter. This solution is also useful in those systems
+where the micro controller is connected via special GPIOs pins.
+
+References
+----------
+
+The C2 Interface main references are at (https://www.silabs.com)
+Silicon Laboratories site], see:
+
+- AN127: FLASH Programming via the C2 Interface at
+ https://www.silabs.com/Support Documents/TechnicalDocs/an127.pdf
+
+- C2 Specification at
+ https://www.silabs.com/pages/DownloadDoc.aspx?FILEURL=Support%20Documents/TechnicalDocs/an127.pdf&src=SearchResults
+
+however it implements a two wire serial communication protocol (bit
+banging) designed to enable in-system programming, debugging, and
+boundary-scan testing on low pin-count Silicon Labs devices. Currently
+this code supports only flash programming but extensions are easy to
+add.
+
+Using the driver
+----------------
+
+Once the driver is loaded you can use sysfs support to get C2port's
+info or read/write in-system flash::
+
+ # ls /sys/class/c2port/c2port0/
+ access flash_block_size flash_erase rev_id
+ dev_id flash_blocks_num flash_size subsystem/
+ flash_access flash_data reset uevent
+
+Initially the C2port access is disabled since you hardware may have
+such lines multiplexed with other devices so, to get access to the
+C2port, you need the command::
+
+ # echo 1 > /sys/class/c2port/c2port0/access
+
+after that you should read the device ID and revision ID of the
+connected micro controller::
+
+ # cat /sys/class/c2port/c2port0/dev_id
+ 8
+ # cat /sys/class/c2port/c2port0/rev_id
+ 1
+
+However, for security reasons, the in-system flash access in not
+enabled yet, to do so you need the command::
+
+ # echo 1 > /sys/class/c2port/c2port0/flash_access
+
+After that you can read the whole flash::
+
+ # cat /sys/class/c2port/c2port0/flash_data > image
+
+erase it::
+
+ # echo 1 > /sys/class/c2port/c2port0/flash_erase
+
+and write it::
+
+ # cat image > /sys/class/c2port/c2port0/flash_data
+
+after writing you have to reset the device to execute the new code::
+
+ # echo 1 > /sys/class/c2port/c2port0/reset