Skip to contentSkip to conversation

ieee802154: Add support for Cascoda CA8210

PATCH In review Harry Morris 2 participants 5 messages Mar 28, 2017

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

v9 cover ieee802154: Add support for Cascoda CA8210

This patchset adds a new device driver, documentation and build support for Cascoda's CA8210 IEEE 802.15.4 radio transceiver:
http://www.cascoda.com/products/ca-821x/

v9:
Add promiscuous mode support
Rework SPI retries
Fix printf typo
Remove old TODOs
add "select COMMON_CLK" to Kconfig entry

v8:
Use module_spi_driver helper
Remove async tx timeout at driver level Style conformance change
Rework synchronous command handling to remove mutex

v7:
Remove use of cs_change property, always transmit full length buffers Implement fully async spi transfers
Combine spi transmission and reception into one function Use completion objects when waiting for events
Rework a lot of locking
Remove deprecated xmit_sync
Remove use of workqueue for IRQ handling

v6:
Kernel style conformance changes
Additional documentation
More meaningful register structs/macros
Removal of old TODOs
Removal of unnecessary macros
Check for safe removal of test interface

v5:
+Cc: Marcel Holtmann

v4:
Added allowable tx_powers and cca_ed_levels Changed power units to mbm (tx_power & cca_ed_level)

Harry Morris (3):
ieee802154: Add CA8210 IEEE 802.15.4 device driver
ieee802154: Add device tree documentation for CA8210
ieee802154: Add entry in MAINTAINTERS for CA8210 driver

 .../devicetree/bindings/net/ieee802154/ca8210.txt  |   28 +
 .../devicetree/bindings/vendor-prefixes.txt        |    1 +
 MAINTAINERS                                        |    9 +
 drivers/net/ieee802154/Kconfig                     |   22 +
 drivers/net/ieee802154/Makefile                    |    1 +
 drivers/net/ieee802154/ca8210.c                    | 3240 ++++++++++++++++++++
 6 files changed, 3301 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/ieee802154/ca8210.txt
 create mode 100644 drivers/net/ieee802154/ca8210.c
Signature · 1 line
2.9.3.windows.1
#1 lore raw

PATCH v9 1/3 ieee802154: Add CA8210 IEEE 802.15.4 device driver

Add driver source and config for softMAC implementation of Cascoda's CA8210 IEEE 802.15.4 transceiver device. The driver mimics a common PHY-only implementation despite the CA8210 being a hardMAC device which exposes a SAP interface to the fully integrated MAC.

The chip is a modem-only device with an integrated processor which runs the 802.15.4 MAC. The chip communicates via full-duplex SPI with additional pins for NIRQ and NRESET. The chip can also output its 16MHz clock to a GPIO with a configurable divider.

The driver can be configured to implement a debugfs node that provides access to the SAP-based API to drive mechanisms not currently supported by the standard kernel interface.

---
 drivers/net/ieee802154/Kconfig  |   22 +
 drivers/net/ieee802154/Makefile |    1 +
 drivers/net/ieee802154/ca8210.c | 3240 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 3263 insertions(+)
 create mode 100644 drivers/net/ieee802154/ca8210.c
drivers/net/ieee802154/Kconfig +22 -0
index 3057a8d..ce4864d 100644
@@ -82,3 +82,25 @@ config IEEE802154_ADF7242
 
 	  This driver can also be built as a module. To do so, say M here.
 	  the module will be called 'adf7242'.
+
+config IEEE802154_CA8210
+	tristate "Cascoda CA8210 transceiver driver"
+	depends on IEEE802154_DRIVERS && MAC802154
+	depends on SPI
+	select COMMON_CLK
+	---help---
+	  Say Y here to enable the CA8210 SPI 802.15.4 wireless
+	  controller.
+
+	  This driver can also be built as a module. To do so, say M here.
+	  the module will be called 'ca8210'.
+
+config IEEE802154_CA8210_DEBUGFS
+	bool "CA8210 debugfs interface"
+	depends on IEEE802154_CA8210
+	depends on DEBUG_FS
+	---help---
+	  This option compiles debugfs code for the ca8210 driver. This
+	  exposes a debugfs node for each CA8210 instance which allows
+	  direct use of the Cascoda API, exposing the 802.15.4 MAC
+	  management entities.
drivers/net/ieee802154/Makefile +1 -0
index 3a923d3..8374bb4 100644
@@ -4,3 +4,4 @@ obj-$(CONFIG_IEEE802154_MRF24J40) += mrf24j40.o
 obj-$(CONFIG_IEEE802154_CC2520) += cc2520.o
 obj-$(CONFIG_IEEE802154_ATUSB) += atusb.o
 obj-$(CONFIG_IEEE802154_ADF7242) += adf7242.o
+obj-$(CONFIG_IEEE802154_CA8210) += ca8210.o
drivers/net/ieee802154/ca8210.c new file +3240 -0

2,971 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.9.3.windows.1

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH v9 2/3 ieee802154: Add device tree documentation for CA8210

In reply to Harry Morris
---
 .../devicetree/bindings/net/ieee802154/ca8210.txt  | 28 ++++++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.txt        |  1 +
 2 files changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/ieee802154/ca8210.txt
Documentation/devicetree/bindings/net/ieee802154/ca8210.txt new file +28 -0
new file mode 100644
index 0000000..a1046e6
@@ -0,0 +1,28 @@
+* CA8210 IEEE 802.15.4 *
+
+Required properties:
+	- compatible:           Should be "cascoda,ca8210"
+	- reg:                  Controlling chip select
+	- spi-max-frequency:    Maximum clock speed, should be *less than*
+	                        4000000
+	- spi-cpol:             Requires inverted clock polarity
+	- reset-gpio:           GPIO attached to reset
+	- irq-gpio:             GPIO attached to IRQ
+Optional properties:
+	- extclock-enable:      Include for the ca8210 to route its 16MHz clock
+	                        to an output
+	- extclock-freq:        Frequency in Hz of the external clock
+	- extclock-gpio:        GPIO of the ca8210 to output the clock on
+
+Example:
+	ca8210@0 {
+		compatible = "cascoda,ca8210";
+		reg = <0>;
+		spi-max-frequency = <3000000>;
+		spi-cpol;
+		reset-gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>;
+		irq-gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
+		extclock-enable;
+		extclock-freq = 16000000;
+		extclock-gpio = 2;
+	};
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
index 24c6f65..6c5609f 100644
@@ -47,6 +47,7 @@ brcm	Broadcom Corporation
 buffalo	Buffalo, Inc.
 calxeda	Calxeda
 capella	Capella Microsystems, Inc
+cascoda	Cascoda, Ltd.
 cavium	Cavium, Inc.
 cdns	Cadence Design Systems Inc.
 ceva	Ceva, Inc.
Signature · 1 line
2.9.3.windows.1
#3 lore raw

PATCH v9 3/3 ieee802154: Add entry in MAINTAINTERS for CA8210 driver

In reply to Harry Morris
---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)
MAINTAINERS +9 -0
index 5e925a2..cb3428f 100644
@@ -2829,6 +2829,15 @@ W:	http://www.linux-c6x.org/wiki/index.php/Main_Page
 S:	Maintained
 F:	arch/c6x/
 
+CA8210 IEEE-802.15.4 RADIO DRIVER
+M:	Harry Morris <[email protected]>
+M:	[email protected]
+L:	[email protected]
+W:	https://github.com/Cascoda/ca8210-linux.git
+S:	Maintained
+F:	drivers/net/ieee802154/ca8210.c
+F:	Documentation/devicetree/bindings/net/ieee802154/ca8210.txt
+
 CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS
 M:	David Howells <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
Signature · 1 line
2.9.3.windows.1
#4 lore raw
In reply to Harry Morris

Hi Harry,

Quoted 53 lines

This patchset adds a new device driver, documentation and build support for Cascoda's CA8210 IEEE 802.15.4 radio transceiver:
http://www.cascoda.com/products/ca-821x/

v9:
Add promiscuous mode support
Rework SPI retries
Fix printf typo
Remove old TODOs
add "select COMMON_CLK" to Kconfig entry

v8:
Use module_spi_driver helper
Remove async tx timeout at driver level Style conformance change
Rework synchronous command handling to remove mutex

v7:
Remove use of cs_change property, always transmit full length buffers Implement fully async spi transfers
Combine spi transmission and reception into one function Use completion objects when waiting for events
Rework a lot of locking
Remove deprecated xmit_sync
Remove use of workqueue for IRQ handling

v6:
Kernel style conformance changes
Additional documentation
More meaningful register structs/macros
Removal of old TODOs
Removal of unnecessary macros
Check for safe removal of test interface

v5:
+Cc: Marcel Holtmann

v4:
Added allowable tx_powers and cca_ed_levels Changed power units to mbm (tx_power & cca_ed_level)

Harry Morris (3):
ieee802154: Add CA8210 IEEE 802.15.4 device driver
ieee802154: Add device tree documentation for CA8210
ieee802154: Add entry in MAINTAINTERS for CA8210 driver

.../devicetree/bindings/net/ieee802154/ca8210.txt  |   28 +
.../devicetree/bindings/vendor-prefixes.txt        |    1 +
MAINTAINERS                                        |    9 +
drivers/net/ieee802154/Kconfig                     |   22 +
drivers/net/ieee802154/Makefile                    |    1 +
drivers/net/ieee802154/ca8210.c                    | 3240 ++++++++++++++++++++
6 files changed, 3301 insertions(+)
Quoted 2 lines

create mode 100644 Documentation/devicetree/bindings/net/ieee802154/ca8210.txt create mode 100644 drivers/net/ieee802154/ca8210.c

all 3 patches have been applied to bluetooth-next tree.

Regards

Marcel