Skip to contentSkip to conversation

c2port (Version 3): support for Silicon C2 Interface.

PATCH New Rodolfo Giometti 1 participant 3 messages Oct 22, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

C2 port 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.

Main references are at Silicon Laboratories site:

* AN127: FLASH Programming via the C2 Interface
http://www.silabs.com/public/documents/tpub_doc/anote/Microcontrollers/Small_Form_Factor/en/an127.pdf

* C2 Specification
http://www.silabs.com/public/documents/tpub_doc/spec/Microcontrollers/en/C2spec.pdf

Currently this code supports only flash programming through sysfs interface but extensions shoud be easy to add.

Changelog
=========

Version 2 -> 3:
---------------

* Static variables fix up.

* Update_lock is now initialised at compile-time, not at runtime.

* Memory leak in c2port_device_register fixed.

* Comments review.

Version 1 -> 2:
---------------

* Documentation added.

* One client added.

Rodolfo

--

 b/Documentation/ABI/testing/sysfs-c2port   |   88 ++
 b/Documentation/c2port.txt                 |   90 ++
 b/drivers/misc/Kconfig                     |    2 
 b/drivers/misc/Makefile                    |    1 
 b/drivers/misc/c2port/Kconfig              |   24 
 b/drivers/misc/c2port/Makefile             |    1 
 b/drivers/misc/c2port/c2port-duramar2150.c |  158 ++++
 b/drivers/misc/c2port/core.c               | 1002 +++++++++++++++++++++++++++++
 b/include/linux/c2port.h                   |   65 +
 drivers/misc/c2port/Kconfig                |   11 
 drivers/misc/c2port/Makefile               |    2 
 11 files changed, 1444 insertions(+)
#1 lore raw

PATCH 1/2 Add c2 port support.

C2port 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 through sysfs interface but extensions shoud be easy to add.

---
 Documentation/ABI/testing/sysfs-c2port |   88 +++
 Documentation/c2port.txt               |   90 +++
 drivers/misc/Kconfig                   |    2 +
 drivers/misc/Makefile                  |    1 +
 drivers/misc/c2port/Kconfig            |   24 +
 drivers/misc/c2port/Makefile           |    1 +
 drivers/misc/c2port/core.c             | 1002 ++++++++++++++++++++++++++++++++
 include/linux/c2port.h                 |   65 ++
 8 files changed, 1273 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-c2port
 create mode 100644 Documentation/c2port.txt
 create mode 100644 drivers/misc/c2port/Kconfig
 create mode 100644 drivers/misc/c2port/Makefile
 create mode 100644 drivers/misc/c2port/core.c
 create mode 100644 include/linux/c2port.h
Documentation/ABI/testing/sysfs-c2port new file +88 -0
new file mode 100644
index 0000000..716cffc
@@ -0,0 +1,88 @@
+What:		/sys/class/c2port/
+Date:		October 2008
+Contact:	Rodolfo Giometti <[email protected]>
+Description:
+		The /sys/class/c2port/ directory will contain files and
+		directories that will provide a unified interface to
+		the C2 port interface.
+
+What:		/sys/class/c2port/c2portX
+Date:		October 2008
+Contact:	Rodolfo Giometti <[email protected]>
+Description:
+		The /sys/class/c2port/c2portX/ directory is related to X-th
+		C2 port into the system. Each directory will contain files to
+		manage and control its C2 port.
+
+What:		/sys/class/c2port/c2portX/access
+Date:		October 2008
+Contact:	Rodolfo Giometti <[email protected]>
+Description:
+		The /sys/class/c2port/c2portX/access file enable the access
+		to the C2 port from the system. No commands can be sent
+		till this entry is set to 0.
+
+What:		/sys/class/c2port/c2portX/dev_id
+Date:		October 2008
+Contact:	Rodolfo Giometti <[email protected]>
+Description:
+		The /sys/class/c2port/c2portX/dev_id file show the device ID
+		of the connected micro.
+
+What:		/sys/class/c2port/c2portX/flash_access
+Date:		October 2008
+Contact:	Rodolfo Giometti <[email protected]>
+Description:
+		The /sys/class/c2port/c2portX/flash_access file enable the
+		access to the on-board flash of the connected micro.
+		No commands can be sent till this entry is set to 0.
+
+What:		/sys/class/c2port/c2portX/flash_block_size
+Date:		October 2008
+Contact:	Rodolfo Giometti <[email protected]>
+Description:
+		The /sys/class/c2port/c2portX/flash_block_size file show
+		the on-board flash block size of the connected micro.
+
+What:		/sys/class/c2port/c2portX/flash_blocks_num
+Date:		October 2008
+Contact:	Rodolfo Giometti <[email protected]>
+Description:
+		The /sys/class/c2port/c2portX/flash_blocks_num file show
+		the on-board flash blocks number of the connected micro.
+
+What:		/sys/class/c2port/c2portX/flash_data
+Date:		October 2008
+Contact:	Rodolfo Giometti <[email protected]>
+Description:
+		The /sys/class/c2port/c2portX/flash_data file export
+		the content of the on-board flash of the connected micro.
+
+What:		/sys/class/c2port/c2portX/flash_erase
+Date:		October 2008
+Contact:	Rodolfo Giometti <[email protected]>
+Description:
+		The /sys/class/c2port/c2portX/flash_erase file execute
+		the "erase" command on the on-board flash of the connected
+		micro.
+
+What:		/sys/class/c2port/c2portX/flash_erase
+Date:		October 2008
+Contact:	Rodolfo Giometti <[email protected]>
+Description:
+		The /sys/class/c2port/c2portX/flash_erase file show the
+		on-board flash size of the connected micro.
+
+What:		/sys/class/c2port/c2portX/reset
+Date:		October 2008
+Contact:	Rodolfo Giometti <[email protected]>
+Description:
+		The /sys/class/c2port/c2portX/reset file execute a "reset"
+		command on the connected micro.
+
+What:		/sys/class/c2port/c2portX/rev_id
+Date:		October 2008
+Contact:	Rodolfo Giometti <[email protected]>
+Description:
+		The /sys/class/c2port/c2portX/rev_id file show the revision ID
+		of the connected micro.
Documentation/c2port.txt new file +90 -0

90 lines not on this page · raw message

drivers/misc/Kconfig +2 -0
index a726f3b..4910500 100644
@@ -475,4 +475,6 @@ config SGI_GRU_DEBUG
 	This option enables addition debugging code for the SGI GRU driver. If
 	you are unsure, say N.
 
+source "drivers/misc/c2port/Kconfig"
+
 endif # MISC_DEVICES
drivers/misc/Makefile +1 -0
index c6c13f6..d8a36e0 100644
@@ -30,3 +30,4 @@ obj-$(CONFIG_KGDB_TESTS)	+= kgdbts.o
 obj-$(CONFIG_SGI_XP)		+= sgi-xp/
 obj-$(CONFIG_SGI_GRU)		+= sgi-gru/
 obj-$(CONFIG_HP_ILO)		+= hpilo.o
+obj-$(CONFIG_C2PORT)		+= c2port/
drivers/misc/c2port/Kconfig new file +24 -0
new file mode 100644
index 0000000..f1bad2b
@@ -0,0 +1,24 @@
+#
+# C2 port devices
+#
+
+menuconfig C2PORT
+	tristate "Silicon Labs C2 port support (EXPERIMENTAL)"
+	depends on EXPERIMENTAL
+	default no
+	help
+	  This option enables support for Silicon Labs C2 port used to
+	  program Silicon micro controller chips (and other 8051 compatible).
+
+	  If your board have no such micro controllers you don't need this
+	  interface at all.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called c2port_core. Note that you also need a client module
+	  usually called c2port-*.
+
+	  If you are not sure, say N here.
+
+if C2PORT
+
+endif # C2PORT
drivers/misc/c2port/Makefile new file +1 -0
new file mode 100644
index 0000000..3c610a2
@@ -0,0 +1 @@
+obj-$(CONFIG_C2PORT)		+= core.o
drivers/misc/c2port/core.c new file +1002 -0

1,002 lines not on this page · raw message

include/linux/c2port.h new file +65 -0

65 lines not on this page · raw message

Signature · 1 line
1.5.4.3
#2 lore raw

PATCH 2/2 c2port: add c2port support for Eurotech Duramar 2150.

---
 drivers/misc/c2port/Kconfig              |   11 ++
 drivers/misc/c2port/Makefile             |    2 +
 drivers/misc/c2port/c2port-duramar2150.c |  158 ++++++++++++++++++++++++++++++
 3 files changed, 171 insertions(+), 0 deletions(-)
 create mode 100644 drivers/misc/c2port/c2port-duramar2150.c
drivers/misc/c2port/Kconfig +11 -0
index f1bad2b..e46af9a 100644
@@ -21,4 +21,15 @@ menuconfig C2PORT
 
 if C2PORT
 
+config C2PORT_DURAMAR_2150
+	tristate "C2 port support for Eurotech's Duramar 2150 (EXPERIMENTAL)"
+	depends on X86 && C2PORT
+	default no
+	help
+	  This option enables C2 support for the Eurotech's Duramar 2150
+	  on board micro controller.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called c2port-duramar2150.
+
 endif # C2PORT
drivers/misc/c2port/Makefile +2 -0
index 3c610a2..3b2cf43 100644
@@ -1 +1,3 @@
 obj-$(CONFIG_C2PORT)		+= core.o
+
+obj-$(CONFIG_C2PORT_DURAMAR_2150)	+= c2port-duramar2150.o
drivers/misc/c2port/c2port-duramar2150.c new file +158 -0

158 lines not on this page · raw message

Signature · 1 line
1.5.4.3