OMAP SSI driver / N900 modem support
Subsystems (3)
Sebastian Reichel
maintainerv4 cover OMAP SSI driver / N900 modem support
Hi,
This is the eigth round of the OMAP SSI driver patches. The plan is to get it merged into 3.16.
Changes since PATCHv3 [0]:
* Rebased devel branch to current master
* Dropped "ARM: dts: omap3 clocks: simplify ssi aliases" (included in 3.15-rc)
* Added Reviewed-by tag from Pavel Machek to some of the patches
* Changed some style issues in nokia-modem driver found by Pavel (and some more found by checkpatch)
* Fixed indention issues in omap_ssi_port.c found by Pavel
* Use "hsi-channel-ids" instead of "reg" as property name for channels IDs as suggested by Rob Herring
* Use "hsi-channel-names" instead of "reg-names" (which is the logical consequence of the previous change)
* Use port addresses instead of port ids in the port node names
* Add second port to the example dts to make it more clear, that the controller has two ports
* Define order for memory and interrupt DT properties
* Drop interrupt names for ssi ports
* Remove ugly endianess #ifdef from ssi protocol driver by properly using ntohs() and htons() macros
* Use for_each_available_child_of_node with of_platform_device_create instead of of_platform_bus_create to make sure *only* omap3-ssi-port subdevices are probed
* Removed hack, that the same resource is used for rx and tx channel for clients initialized from DT
* Update my mail address in MODULE_AUTHOR to [email protected]
Please send feedback (e.g. Tested-By or Reviewed-By :)), so that I can send a pull request for 3.16. You can either apply this patchset or use the n900-modem-support-2 branch available on [1].
For testing the patchset you should build the kernel with all config entries in the HSI subsystem activated and boot using the updated device tree information, since platform data based booting is not supported. Testing the patchset with ofono works like this:
# provide cmt device for ofono ln -sf /sys/bus/hsi/n900-modem /dev/cmt # start ofono ofono --nodetach --debug # enable the modem mdbus2 -s org.ofono /n900_0 org.ofono.Modem.SetProperty Powered true # enable modem's RF parts mdbus2 -s org.ofono /n900_0 org.ofono.Modem.SetProperty Online true # scan for available networks (takes some time) mdbus2 -s org.ofono /n900_0 org.ofono.NetworkRegistration.Scan
TODO (post-merge):
* Central Message Queue in HSI framework
* Remove the hwmod DT hack
* Implement proper context loss detection
* Implement N900 modem PM
* Remove wakeline checks (-> FIXMEs)
[0] https://lkml.org/lkml/2014/3/28/492
[1] git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi.git
-- Sebastian
Sebastian Reichel (13):
Documentation: HSI: Add some general description for the HSI subsystem
MAINTAINERS: update HSI entry
HSI: hsi-char: fix driver for multiport scenarios
HSI: method to unregister clients from an hsi port
HSI: Add channel resource support to HSI clients
HSI: export method to (un)register clients
HSI: Add common DT binding for HSI client devices
HSI: Introduce OMAP SSI driver
Documentation: DT: omap-ssi binding documentation
HSI: Introduce driver for SSI Protocol
HSI: Introduce Nokia N900 modem driver
DTS: ARM: OMAP3-N900: Add SSI support
DTS: ARM: OMAP3-N900: Add modem support
.../devicetree/bindings/hsi/client-devices.txt | 44 + .../devicetree/bindings/hsi/nokia-modem.txt | 57 + Documentation/devicetree/bindings/hsi/omap-ssi.txt | 97 ++ Documentation/hsi.txt | 75 ++ MAINTAINERS | 4 +- arch/arm/boot/dts/omap3-n900.dts | 65 + arch/arm/boot/dts/omap3.dtsi | 45 + arch/arm/boot/dts/omap34xx.dtsi | 11 + arch/arm/boot/dts/omap36xx.dtsi | 11 + drivers/hsi/Kconfig | 1 + drivers/hsi/Makefile | 1 + drivers/hsi/clients/Kconfig | 17 + drivers/hsi/clients/Makefile | 4 +- drivers/hsi/clients/hsi_char.c | 14 +- drivers/hsi/clients/nokia-modem.c | 272 ++++ drivers/hsi/clients/ssi_protocol.c | 1190 +++++++++++++++++ drivers/hsi/controllers/Kconfig | 19 + drivers/hsi/controllers/Makefile | 6 + drivers/hsi/controllers/omap_ssi.c | 625 +++++++++ drivers/hsi/controllers/omap_ssi.h | 166 +++ drivers/hsi/controllers/omap_ssi_port.c | 1399 ++++++++++++++++++++ drivers/hsi/controllers/omap_ssi_regs.h | 171 +++ drivers/hsi/hsi.c | 273 +++- include/linux/hsi/hsi.h | 30 +- include/linux/hsi/ssi_protocol.h | 42 + 25 files changed, 4620 insertions(+), 19 deletions(-) create mode 100644 Documentation/devicetree/bindings/hsi/client-devices.txt create mode 100644 Documentation/devicetree/bindings/hsi/nokia-modem.txt create mode 100644 Documentation/devicetree/bindings/hsi/omap-ssi.txt create mode 100644 Documentation/hsi.txt create mode 100644 drivers/hsi/clients/nokia-modem.c create mode 100644 drivers/hsi/clients/ssi_protocol.c create mode 100644 drivers/hsi/controllers/Kconfig create mode 100644 drivers/hsi/controllers/Makefile create mode 100644 drivers/hsi/controllers/omap_ssi.c create mode 100644 drivers/hsi/controllers/omap_ssi.h create mode 100644 drivers/hsi/controllers/omap_ssi_port.c create mode 100644 drivers/hsi/controllers/omap_ssi_regs.h create mode 100644 include/linux/hsi/ssi_protocol.h
Signature · 1 line
1.9.2
Sebastian Reichel
maintainerPATCH v4 1/13 Documentation: HSI: Add some general description for the HSI subsystem
Add a document, which gives a rough introduction about what HSI is and how its handled by the Linux kernel.
--- Documentation/hsi.txt | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Documentation/hsi.txt
Documentation/hsi.txt new file +75 -0
@@ -0,0 +1,75 @@ +HSI - High-speed Synchronous Serial Interface + +1. Introduction +~~~~~~~~~~~~~~~ + +High Speed Syncronous Interface (HSI) is a fullduplex, low latency protocol, +that is optimized for die-level interconnect between an Application Processor +and a Baseband chipset. It has been specified by the MIPI alliance in 2003 and +implemented by multiple vendors since then. + +The HSI interface supports full duplex communication over multiple channels +(typically 8) and is capable of reaching speeds up to 200 Mbit/s. + +The serial protocol uses two signals, DATA and FLAG as combined data and clock +signals and an additional READY signal for flow control. An additional WAKE +signal can be used to wakeup the chips from standby modes. The signals are +commonly prefixed by AC for signals going from the application die to the +cellular die and CA for signals going the other way around. + ++------------+ +---------------+ +| Cellular | | Application | +| Die | | Die | +| | - - - - - - CAWAKE - - - - - - >| | +| T|------------ CADATA ------------>|R | +| X|------------ CAFLAG ------------>|X | +| |<----------- ACREADY ------------| | +| | | | +| | | | +| |< - - - - - ACWAKE - - - - - - -| | +| R|<----------- ACDATA -------------|T | +| X|<----------- ACFLAG -------------|X | +| |------------ CAREADY ----------->| | +| | | | +| | | | ++------------+ +---------------+ + +2. HSI Subsystem in Linux +~~~~~~~~~~~~~~~~~~~~~~~~~ + +In the Linux kernel the hsi subsystem is supposed to be used for HSI devices. +The hsi subsystem contains drivers for hsi controllers including support for +multi-port controllers and provides a generic API for using the HSI ports. + +It also contains HSI client drivers, which make use of the generic API to +implement a protocol used on the HSI interface. These client drivers can +use an arbitrary number of channels. + +3. hsi-char Device +~~~~~~~~~~~~~~~~~~ + +Each port automatically registers a generic client driver called hsi_char, +which provides a charecter device for userspace representing the HSI port. +It can be used to communicate via HSI from userspace. Userspace may +configure the hsi_char device using the following ioctl commands: + +* HSC_RESET: + - flush the HSI port + +* HSC_SET_PM + - enable or disable the client. + +* HSC_SEND_BREAK + - send break + +* HSC_SET_RX + - set RX configuration + +* HSC_GET_RX + - get RX configuration + +* HSC_SET_TX + - set TX configuration + +* HSC_GET_TX + - get TX configuration
Signature · 1 line
1.9.2
Sebastian Reichel
maintainerPATCH v4 2/13 MAINTAINERS: update HSI entry
In reply to Sebastian ReichelAdd git tree for hsi subsystem, update Sebastian Reichel's e-mail address and add Documentation/hsi.txt as maintained file.
--- MAINTAINERS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
MAINTAINERS +3 -1
@@ -4203,9 +4203,11 @@ S: Maintained F: fs/hpfs/ HSI SUBSYSTEM -M: Sebastian Reichel <[email protected]> +M: Sebastian Reichel <[email protected]> +T: git git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi.git S: Maintained F: Documentation/ABI/testing/sysfs-bus-hsi +F: Documentation/hsi.txt F: drivers/hsi/ F: include/linux/hsi/ F: include/uapi/linux/hsi/
Signature · 1 line
1.9.2
Sebastian Reichel
maintainerPATCH v4 3/13 HSI: hsi-char: fix driver for multiport scenarios
In reply to Sebastian ReichelFix return code check of alloc_chrdev_region, which returns 0 on success.
--- drivers/hsi/clients/hsi_char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hsi/clients/hsi_char.c +1 -1
@@ -705,7 +705,7 @@ static int hsc_probe(struct device *dev)if (!hsc_major) { ret =alloc_chrdev_region (&hsc_dev, hsc_baseminor,HSC_DEVS , devname); -if (ret >0 ) +if (ret ==0 ) hsc_major =MAJOR (hsc_dev); }else { hsc_dev =MKDEV (hsc_major, hsc_baseminor);
Signature · 1 line
1.9.2
Sebastian Reichel
maintainerPATCH v4 4/13 HSI: method to unregister clients from an hsi port
In reply to Sebastian ReichelThis exports a method to unregister all clients from an hsi port.
--- drivers/hsi/hsi.c | 10 ++++++++++ include/linux/hsi/hsi.h | 1 + 2 files changed, 11 insertions(+)
drivers/hsi/hsi.c +10 -0
@@ -130,6 +130,16 @@ static void hsi_port_release(struct device *dev) }/** +* hsi_unregister_port - Unregister an HSI port +* @port: The HSI port to unregister +*/ +void hsi_port_unregister_clients (struct hsi_port *port) +{ +device_for_each_child (&port->device,NULL , hsi_remove_client); +} +EXPORT_SYMBOL_GPL (hsi_port_unregister_clients); + +/** * hsi_unregister_controller - Unregister an HSI controller * @hsi: The HSI controller to register */
include/linux/hsi/hsi.h +1 -0
@@ -282,6 +282,7 @@ struct hsi_controller *hsi_alloc_controller(unsigned int n_ports, gfp_t flags);void hsi_put_controller (struct hsi_controller *hsi);int hsi_register_controller (struct hsi_controller *hsi);void hsi_unregister_controller (struct hsi_controller *hsi); +void hsi_port_unregister_clients (struct hsi_port *port);static inline void hsi_controller_set_drvdata (struct hsi_controller *hsi,void *data)
Signature · 1 line
1.9.2
Sebastian Reichel
maintainerPATCH v4 5/13 HSI: Add channel resource support to HSI clients
In reply to Sebastian ReichelMake HSI channel ids platform data, which can be provided by platform data.
--- drivers/hsi/clients/hsi_char.c | 12 +++++------ drivers/hsi/hsi.c | 46 +++++++++++++++++++++++++++++++++++++++++- include/linux/hsi/hsi.h | 24 ++++++++++++++++++---- 3 files changed, 71 insertions(+), 11 deletions(-)
drivers/hsi/clients/hsi_char.c +6 -6
@@ -367,7 +367,7 @@ static int hsc_rx_set(struct hsi_client *cl, struct hsc_rx_config *rxc)return -EINVAL ; tmp = cl->rx_cfg; cl->rx_cfg.mode = rxc->mode; - cl->rx_cfg.channels = rxc->channels; + cl->rx_cfg.num_hw_channels = rxc->channels; cl->rx_cfg.flow = rxc->flow; ret =hsi_setup (cl);if (ret <0 ) {
@@ -383,7 +383,7 @@ static int hsc_rx_set(struct hsi_client *cl, struct hsc_rx_config *rxc)static inline void hsc_rx_get (struct hsi_client *cl,struct hsc_rx_config *rxc) { rxc->mode = cl->rx_cfg.mode; - rxc->channels = cl->rx_cfg.channels; + rxc->channels = cl->rx_cfg.num_hw_channels; rxc->flow = cl->rx_cfg.flow; }
@@ -402,7 +402,7 @@ static int hsc_tx_set(struct hsi_client *cl, struct hsc_tx_config *txc)return -EINVAL ; tmp = cl->tx_cfg; cl->tx_cfg.mode = txc->mode; - cl->tx_cfg.channels = txc->channels; + cl->tx_cfg.num_hw_channels = txc->channels; cl->tx_cfg.speed = txc->speed; cl->tx_cfg.arb_mode = txc->arb_mode; ret =hsi_setup (cl);
@@ -417,7 +417,7 @@ static int hsc_tx_set(struct hsi_client *cl, struct hsc_tx_config *txc)static inline void hsc_tx_get (struct hsi_client *cl,struct hsc_tx_config *txc) { txc->mode = cl->tx_cfg.mode; - txc->channels = cl->tx_cfg.channels; + txc->channels = cl->tx_cfg.num_hw_channels; txc->speed = cl->tx_cfg.speed; txc->arb_mode = cl->tx_cfg.arb_mode; }
@@ -435,7 +435,7 @@ static ssize_t hsc_read(struct file *file, char __user *buf, size_t len,return -EINVAL ;if (len > max_data_size) len = max_data_size; -if (channel->ch >= channel->cl->rx_cfg.channels) +if (channel->ch >= channel->cl->rx_cfg.num_hw_channels)return -ECHRNG ;if (test_and_set_bit (HSC_CH_READ , &channel->flags))return -EBUSY ;
@@ -492,7 +492,7 @@ static ssize_t hsc_write(struct file *file, const char __user *buf, size_t len,return -EINVAL ;if (len > max_data_size) len = max_data_size; -if (channel->ch >= channel->cl->tx_cfg.channels) +if (channel->ch >= channel->cl->tx_cfg.num_hw_channels)return -ECHRNG ;if (test_and_set_bit (HSC_CH_WRITE , &channel->flags))return -EBUSY ;
drivers/hsi/hsi.c +45 -1
69 lines not on this page · raw message
include/linux/hsi/hsi.h +20 -4
@@ -68,17 +68,31 @@ enum { };/** +* struct hsi_channel - channel resource used by the hsi clients +* @id: Channel number +* @name: Channel name +*/ +struct hsi_channel { +unsigned int id; +const char *name; +}; + +/** * struct hsi_config - Configuration for RX/TX HSI modules * @mode: Bit transmission mode (STREAM or FRAME) -* @channels: Number of channels to use [1..16] +* @channels: Channel resources used by the client +* @num_channels: Number of channel resources +* @num_hw_channels: Number of channels the transceiver is configured for [1..16] * @speed: Max bit transmission speed (Kbit/s) * @flow: RX flow type (SYNCHRONIZED or PIPELINE) * @arb_mode: Arbitration mode for TX frame (Round robin, priority) */ struct hsi_config { -unsigned int mode; -unsigned int channels; -unsigned int speed; +unsigned int mode; +struct hsi_channel *channels; +unsigned int num_channels; +unsigned int num_hw_channels; +unsigned int speed;union {unsigned int flow;/* RX only */ unsigned int arb_mode;/* TX only */
@@ -306,6 +320,8 @@ static inline struct hsi_port *hsi_find_port_num(struct hsi_controller *hsi,*/ int hsi_async (struct hsi_client *cl,struct hsi_msg *msg); +int hsi_get_channel_id_by_name (struct hsi_client *cl,char *name); +/** * hsi_id - Get HSI controller ID associated to a client * @cl: Pointer to a HSI client
Signature · 1 line
1.9.2
Sebastian Reichel
maintainerPATCH v4 6/13 HSI: export method to (un)register clients
In reply to Sebastian ReichelExpose method for registering and unregistering HSI clients, so that client drivers can register other client drivers.
This is useful for HSI drivers, which want to use the functionality of other HSI drivers. For example the N900 modem driver can load HSI drivers for mcsaab protocol and speech protocol.
--- drivers/hsi/hsi.c | 11 ++++++++--- include/linux/hsi/hsi.h | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-)
drivers/hsi/hsi.c +8 -3
@@ -69,14 +69,15 @@ static void hsi_client_release(struct device *dev)kfree (cl); } -static void hsi_new_client (struct hsi_port *port,struct hsi_board_info *info) +struct hsi_client *hsi_new_client (struct hsi_port *port, +struct hsi_board_info *info) {struct hsi_client *cl;size_t size; cl =kzalloc (sizeof (*cl),GFP_KERNEL );if (!cl) -return ; +return NULL ; cl->tx_cfg = info->tx_cfg;if (cl->tx_cfg.channels) {
@@ -103,7 +104,10 @@ static void hsi_new_client(struct hsi_port *port, struct hsi_board_info *info)pr_err ("hsi: failed to register client: %s\n" , info->name);put_device (&cl->device); } + +return cl; } +EXPORT_SYMBOL_GPL (hsi_new_client);static void hsi_scan_board_info (struct hsi_controller *hsi) {
@@ -119,12 +123,13 @@ static void hsi_scan_board_info(struct hsi_controller *hsi) } } -static int hsi_remove_client (struct device *dev,void *data__maybe_unused ) +int hsi_remove_client (struct device *dev,void *data__maybe_unused ) {device_unregister (dev);return 0 ; } +EXPORT_SYMBOL_GPL (hsi_remove_client);static int hsi_remove_port (struct device *dev,void *data__maybe_unused ) {
include/linux/hsi/hsi.h +3 -0
@@ -296,6 +296,9 @@ struct hsi_controller *hsi_alloc_controller(unsigned int n_ports, gfp_t flags);void hsi_put_controller (struct hsi_controller *hsi);int hsi_register_controller (struct hsi_controller *hsi);void hsi_unregister_controller (struct hsi_controller *hsi); +struct hsi_client *hsi_new_client (struct hsi_port *port, +struct hsi_board_info *info); +int hsi_remove_client (struct device *dev,void *data);void hsi_port_unregister_clients (struct hsi_port *port); static inline void hsi_controller_set_drvdata(struct hsi_controller *hsi,
Signature · 1 line
1.9.2
Sebastian Reichel
maintainerPATCH v4 7/13 HSI: Add common DT binding for HSI client devices
In reply to Sebastian ReichelImplement and document generic DT bindings for HSI clients.
--- .../devicetree/bindings/hsi/client-devices.txt | 44 +++++ drivers/hsi/hsi.c | 206 ++++++++++++++++++++- include/linux/hsi/hsi.h | 2 + 3 files changed, 250 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/hsi/client-devices.txt
Documentation/devicetree/bindings/hsi/client-devices.txt new file +44 -0
@@ -0,0 +1,44 @@ +Each HSI port is supposed to have one child node, which +symbols the remote device connected to the HSI port. The +following properties are standardized for HSI clients: + +Required HSI configuration properties: + +- hsi-channel-ids: A list of channel ids + +- hsi-rx-mode: Receiver Bit transmission mode ("stream" or "frame") +- hsi-tx-mode: Transmitter Bit transmission mode ("stream" or "frame") +- hsi-mode: May be used instead hsi-rx-mode and hsi-tx-mode if + the transmission mode is the same for receiver and + transmitter +- hsi-speed-kbps: Max bit transmission speed in kbit/s +- hsi-flow: RX flow type ("synchronized" or "pipeline") +- hsi-arb-mode: Arbitration mode for TX frame ("round-robin", "priority") + +Optional HSI configuration properties: + +- hsi-channel-names: A list with one name per channel specified in the + hsi-channel-ids property + + +Device Tree node example for an HSI client: + +hsi-controller { + hsi-port { + modem: hsi-client { + compatible = "nokia,n900-modem"; + + hsi-channel-ids = <0>, <1>, <2>, <3>; + hsi-channel-names = "mcsaab-control", + "speech-control", + "speech-data", + "mcsaab-data"; + hsi-speed-kbps = <55000>; + hsi-mode = "frame"; + hsi-flow = "synchronized"; + hsi-arb-mode = "round-robin"; + + /* more client specific properties */ + }; + }; +};
drivers/hsi/hsi.c +204 -2
232 lines not on this page · raw message
include/linux/hsi/hsi.h +2 -0
@@ -298,6 +298,8 @@ int hsi_register_controller(struct hsi_controller *hsi);void hsi_unregister_controller (struct hsi_controller *hsi);struct hsi_client *hsi_new_client (struct hsi_port *port,struct hsi_board_info *info); +void hsi_add_clients_from_dt (struct hsi_port *port, +struct device_node *clients);int hsi_remove_client (struct device *dev,void *data);void hsi_port_unregister_clients (struct hsi_port *port);
Signature · 1 line
1.9.2
Sebastian Reichel
maintainerPATCH v4 8/13 HSI: Introduce OMAP SSI driver
In reply to Sebastian ReichelAdd OMAP SSI driver to the HSI subsystem.
The Synchronous Serial Interface (SSI) is a legacy version of HSI. As in the case of HSI, it is mainly used to connect Application engines (APE) with cellular modem engines (CMT) in cellular handsets.
It provides a multichannel, full-duplex, multi-core communication with no reference clock. The OMAP SSI block is capable of reaching speeds of 110 Mbit/s.
--- drivers/hsi/Kconfig | 1 + drivers/hsi/Makefile | 1 + drivers/hsi/controllers/Kconfig | 19 + drivers/hsi/controllers/Makefile | 6 + drivers/hsi/controllers/omap_ssi.c | 625 ++++++++++++++ drivers/hsi/controllers/omap_ssi.h | 166 ++++ drivers/hsi/controllers/omap_ssi_port.c | 1399 +++++++++++++++++++++++++++++++ drivers/hsi/controllers/omap_ssi_regs.h | 171 ++++ 8 files changed, 2388 insertions(+) create mode 100644 drivers/hsi/controllers/Kconfig create mode 100644 drivers/hsi/controllers/Makefile create mode 100644 drivers/hsi/controllers/omap_ssi.c create mode 100644 drivers/hsi/controllers/omap_ssi.h create mode 100644 drivers/hsi/controllers/omap_ssi_port.c create mode 100644 drivers/hsi/controllers/omap_ssi_regs.h
drivers/hsi/Kconfig +1 -0
@@ -14,6 +14,7 @@ config HSI_BOARDINFO bool default y +source "drivers/hsi/controllers/Kconfig" source "drivers/hsi/clients/Kconfig" endif # HSI
drivers/hsi/Makefile +1 -0
@@ -3,4 +3,5 @@ # obj-$(CONFIG_HSI_BOARDINFO) += hsi_boardinfo.o obj-$(CONFIG_HSI) += hsi.o +obj-y += controllers/ obj-y += clients/
drivers/hsi/controllers/Kconfig new file +19 -0
@@ -0,0 +1,19 @@ +# +# HSI controllers configuration +# +comment "HSI controllers" + +config OMAP_SSI + tristate "OMAP SSI hardware driver" + depends on ARCH_OMAP && HSI + ---help--- + SSI is a legacy version of HSI. It is usually used to connect + an application engine with a cellular modem. + If you say Y here, you will enable the OMAP SSI hardware driver. + + If unsure, say N. + +config OMAP_SSI_PORT + tristate + default m if OMAP_SSI=m + default y if OMAP_SSI=y
drivers/hsi/controllers/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +# +# Makefile for HSI controllers drivers +# + +obj-$(CONFIG_OMAP_SSI) += omap_ssi.o +obj-$(CONFIG_OMAP_SSI_PORT) += omap_ssi_port.o
drivers/hsi/controllers/omap_ssi.c new file +625 -0
625 lines not on this page · raw message
drivers/hsi/controllers/omap_ssi.h new file +166 -0
166 lines not on this page · raw message
drivers/hsi/controllers/omap_ssi_port.c new file +1399 -0
1,399 lines not on this page · raw message
drivers/hsi/controllers/omap_ssi_regs.h new file +171 -0
171 lines not on this page · raw message
Signature · 1 line
1.9.2
Sebastian Reichel
maintainerPATCH v4 9/13 Documentation: DT: omap-ssi binding documentation
In reply to Sebastian ReichelCreate device tree binding documentation for
OMAP Synchronous Serial Interface (SSI) device.
--- Documentation/devicetree/bindings/hsi/omap-ssi.txt | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 Documentation/devicetree/bindings/hsi/omap-ssi.txt
Documentation/devicetree/bindings/hsi/omap-ssi.txt new file +97 -0
@@ -0,0 +1,97 @@ +OMAP SSI controller bindings + +OMAP Synchronous Serial Interface (SSI) controller implements a legacy +variant of MIPI's High Speed Synchronous Serial Interface (HSI). + +Required properties: +- compatible: Should include "ti,omap3-ssi". +- reg-names: Contains the values "sys" and "gdd" (in this order). +- reg: Contains a matching register specifier for each entry + in reg-names. +- interrupt-names: Contains the value "gdd_mpu". +- interrupts: Contains matching interrupt information for each entry + in interrupt-names. +- ranges: Represents the bus address mapping between the main + controller node and the child nodes below. +- clock-names: Must include the following entries: + "ssi_ssr_fck": The OMAP clock of that name + "ssi_sst_fck": The OMAP clock of that name + "ssi_ick": The OMAP clock of that name +- clocks: Contains a matching clock specifier for each entry in + clock-names. +- #address-cells: Should be set to <1> +- #size-cells: Should be set to <1> + +Each port is represented as a sub-node of the ti,omap3-ssi device. + +Required Port sub-node properties: +- compatible: Should be set to the following value + ti,omap3-ssi-port (applicable to OMAP34xx devices) +- reg-names: Contains the values "tx" and "rx" (in this order). +- reg: Contains a matching register specifier for each entry + in reg-names. +- interrupt-parent Should be a phandle for the interrupt controller +- interrupts: Should contain interrupt specifiers for mpu interrupts + 0 and 1 (in this order). +- ti,ssi-cawake-gpio: Defines which GPIO pin is used to signify CAWAKE + events for the port. This is an optional board-specific + property. If it's missing the port will not be + enabled. + +Example for Nokia N900: + +ssi-controller@48058000 { + compatible = "ti,omap3-ssi"; + + /* needed until hwmod is updated to use the compatible string */ + ti,hwmods = "ssi"; + + reg = <0x48058000 0x1000>, + <0x48059000 0x1000>; + reg-names = "sys", + "gdd"; + + interrupts = <55>; + interrupt-names = "gdd_mpu"; + + clocks = <&ssi_ssr_fck>, + <&ssi_sst_fck>, + <&ssi_ick>; + clock-names = "ssi_ssr_fck", + "ssi_sst_fck", + "ssi_ick"; + + #address-cells = <1>; + #size-cells = <1>; + ranges; + + ssi-port@4805a000 { + compatible = "ti,omap3-ssi-port"; + + reg = <0x4805a000 0x800>, + <0x4805a800 0x800>; + reg-names = "tx", + "rx"; + + interrupt-parent = <&intc>; + interrupts = <67>, + <68>; + + ti,ssi-cawake-gpio = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* 151 */ + } + + ssi-port@4805a000 { + compatible = "ti,omap3-ssi-port"; + + reg = <0x4805b000 0x800>, + <0x4805b800 0x800>; + reg-names = "tx", + "rx"; + + interrupt-parent = <&intc>; + interrupts = <69>, + <70>; + + status = "disabled"; /* second port is not used on N900 */ + } +}
Signature · 1 line
1.9.2
Sebastian Reichel
maintainerPATCH v4 10/13 HSI: Introduce driver for SSI Protocol
In reply to Sebastian ReichelThis adds a driver for the SSI McSAAB protocol as used in the Nokia N900.
--- drivers/hsi/clients/Kconfig | 8 + drivers/hsi/clients/Makefile | 3 +- drivers/hsi/clients/ssi_protocol.c | 1190 ++++++++++++++++++++++++++++++++++++ include/linux/hsi/ssi_protocol.h | 42 ++ 4 files changed, 1242 insertions(+), 1 deletion(-) create mode 100644 drivers/hsi/clients/ssi_protocol.c create mode 100644 include/linux/hsi/ssi_protocol.h
drivers/hsi/clients/Kconfig +8 -0
@@ -4,6 +4,14 @@ comment "HSI clients" +config SSI_PROTOCOL + tristate "SSI protocol" + depends on HSI && OMAP_SSI && PHONET + help + If you say Y here, you will enable the SSI protocol aka McSAAB. + + If unsure, say N. + config HSI_CHAR tristate "HSI/SSI character driver" depends on HSI
drivers/hsi/clients/Makefile +2 -1
@@ -2,4 +2,5 @@ # Makefile for HSI clients # -obj-$(CONFIG_HSI_CHAR) += hsi_char.o +obj-$(CONFIG_SSI_PROTOCOL) += ssi_protocol.o +obj-$(CONFIG_HSI_CHAR) += hsi_char.o
drivers/hsi/clients/ssi_protocol.c new file +1190 -0
1,190 lines not on this page · raw message
include/linux/hsi/ssi_protocol.h new file +42 -0
42 lines not on this page · raw message
Signature · 1 line
1.9.2
Sebastian Reichel
maintainerPATCH v4 11/13 HSI: Introduce Nokia N900 modem driver
In reply to Sebastian ReichelThe Nokia N900's modem is connected via Synchronous Serial Interface (SSI), which is a legacy version of MIPI's High-speed Synchronous Serial Interface (HSI).
The handles the GPIOs for enabling and resetting the modem and instanciates ssi-protocol for data exchange. It does not yet support exchanging voice data with the modem.
--- .../devicetree/bindings/hsi/nokia-modem.txt | 57 +++++ drivers/hsi/clients/Kconfig | 9 + drivers/hsi/clients/Makefile | 1 + drivers/hsi/clients/nokia-modem.c | 272 +++++++++++++++++++++ 4 files changed, 339 insertions(+) create mode 100644 Documentation/devicetree/bindings/hsi/nokia-modem.txt create mode 100644 drivers/hsi/clients/nokia-modem.c
Documentation/devicetree/bindings/hsi/nokia-modem.txt new file +57 -0
@@ -0,0 +1,57 @@ +Nokia modem client bindings + +The Nokia modem HSI client follows the common HSI client binding +and inherits all required properties. The following additional +properties are needed by the Nokia modem HSI client: + +Required properties: +- compatible: Should be one of + "nokia,n900-modem" +- hsi-channel-names: Should contain the following strings + "mcsaab-control" + "speech-control" + "speech-data" + "mcsaab-data" +- gpios: Should provide a GPIO handler for each GPIO listed in + gpio-names +- gpio-names: Should contain the following strings + "cmt_apeslpx" + "cmt_rst_rq" + "cmt_en" + "cmt_rst" + "cmt_bsi" +- interrupts: Should be IRQ handle for modem's reset indication + +Example: + +&ssi_port { + modem: hsi-client { + compatible = "nokia,n900-modem"; + + pinctrl-names = "default"; + pinctrl-0 = <&modem_pins>; + + hsi-channel-ids = <0>, <1>, <2>, <3>; + hsi-channel-names = "mcsaab-control", + "speech-control", + "speech-data", + "mcsaab-data"; + hsi-speed-kbps = <55000>; + hsi-mode = "frame"; + hsi-flow = "synchronized"; + hsi-arb-mode = "round-robin"; + + interrupts-extended = <&gpio3 8 IRQ_TYPE_EDGE_FALLING>; /* 72 */ + + gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>, /* 70 */ + <&gpio3 9 GPIO_ACTIVE_HIGH>, /* 73 */ + <&gpio3 10 GPIO_ACTIVE_HIGH>, /* 74 */ + <&gpio3 11 GPIO_ACTIVE_HIGH>, /* 75 */ + <&gpio5 29 GPIO_ACTIVE_HIGH>; /* 157 */ + gpio-names = "cmt_apeslpx", + "cmt_rst_rq", + "cmt_en", + "cmt_rst", + "cmt_bsi"; + }; +};
drivers/hsi/clients/Kconfig +9 -0
@@ -4,6 +4,15 @@ comment "HSI clients" +config NOKIA_MODEM + tristate "Nokia Modem" + depends on SSI_PROTOCOL + help + Say Y here if you want to add support for the modem on Nokia + N900 (Nokia RX-51) hardware. + + If unsure, say N. + config SSI_PROTOCOL tristate "SSI protocol" depends on HSI && OMAP_SSI && PHONET
drivers/hsi/clients/Makefile +1 -0
@@ -2,5 +2,6 @@ # Makefile for HSI clients # +obj-$(CONFIG_NOKIA_MODEM) += nokia-modem.o obj-$(CONFIG_SSI_PROTOCOL) += ssi_protocol.o obj-$(CONFIG_HSI_CHAR) += hsi_char.o
drivers/hsi/clients/nokia-modem.c new file +272 -0
272 lines not on this page · raw message
Signature · 1 line
1.9.2
Sebastian Reichel
maintainerPATCH v4 12/13 DTS: ARM: OMAP3-N900: Add SSI support
In reply to Sebastian ReichelAdd SSI device tree data for OMAP3 and Nokia N900.
--- arch/arm/boot/dts/omap3-n900.dts | 24 +++++++++++++++++++++ arch/arm/boot/dts/omap3.dtsi | 45 ++++++++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/omap34xx.dtsi | 11 ++++++++++ arch/arm/boot/dts/omap36xx.dtsi | 11 ++++++++++ 4 files changed, 91 insertions(+)
arch/arm/boot/dts/omap3-n900.dts +24 -0
@@ -173,6 +173,19 @@ 0x0da (PIN_OUTPUT | MUX_MODE1) /* dss_data23.sdi_clkn */ >; }; + + ssi_pins: pinmux_ssi { + pinctrl-single,pins = < + 0x150 (PIN_INPUT_PULLUP | MUX_MODE1) /* ssi1_rdy_tx */ + 0x14e (PIN_OUTPUT | MUX_MODE1) /* ssi1_flag_tx */ + 0x152 (PIN_INPUT | WAKEUP_EN | MUX_MODE4) /* ssi1_wake_tx (cawake) */ + 0x14c (PIN_OUTPUT | MUX_MODE1) /* ssi1_dat_tx */ + 0x154 (PIN_INPUT | MUX_MODE1) /* ssi1_dat_rx */ + 0x156 (PIN_INPUT | MUX_MODE1) /* ssi1_flag_rx */ + 0x158 (PIN_OUTPUT | MUX_MODE1) /* ssi1_rdy_rx */ + 0x15a (PIN_OUTPUT | MUX_MODE1) /* ssi1_wake */ + >; + }; }; &i2c1 {
@@ -662,3 +675,14 @@ }; }; }; + +&ssi_port1 { + pinctrl-names = "default"; + pinctrl-0 = <&ssi_pins>; + + ti,ssi-cawake-gpio = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* 151 */ +}; + +&ssi_port2 { + status = "disabled"; +};
arch/arm/boot/dts/omap3.dtsi +45 -0
51 lines not on this page · raw message
arch/arm/boot/dts/omap34xx.dtsi +11 -0
@@ -40,6 +40,17 @@ }; }; +&ssi { + status = "ok"; + + clocks = <&ssi_ssr_fck>, + <&ssi_sst_fck>, + <&ssi_ick>; + clock-names = "ssi_ssr_fck", + "ssi_sst_fck", + "ssi_ick"; +}; + /include/ "omap34xx-omap36xx-clocks.dtsi" /include/ "omap36xx-omap3430es2plus-clocks.dtsi" /include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"
arch/arm/boot/dts/omap36xx.dtsi +11 -0
@@ -78,6 +78,17 @@ clock-names = "fck", "tv_dac_clk"; }; +&ssi { + status = "ok"; + + clocks = <&ssi_ssr_fck>, + <&ssi_sst_fck>, + <&ssi_ick>; + clock-names = "ssi_ssr_fck", + "ssi_sst_fck", + "ssi_ick"; +}; + /include/ "omap34xx-omap36xx-clocks.dtsi" /include/ "omap36xx-omap3430es2plus-clocks.dtsi" /include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"
Signature · 1 line
1.9.2
Sebastian Reichel
maintainerPATCH v4 13/13 DTS: ARM: OMAP3-N900: Add modem support
In reply to Sebastian ReichelAdd modem device tree data to Nokia N900's DTS file.
--- arch/arm/boot/dts/omap3-n900.dts | 43 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-)
arch/arm/boot/dts/omap3-n900.dts +42 -1
@@ -186,6 +186,17 @@ 0x15a (PIN_OUTPUT | MUX_MODE1) /* ssi1_wake */ >; }; + + modem_pins: pinmux_modem { + pinctrl-single,pins = < + 0x0ac (PIN_OUTPUT | MUX_MODE4) /* gpio 70 => cmt_apeslpx */ + 0x0b0 (PIN_INPUT | WAKEUP_EN | MUX_MODE4) /* gpio 72 => ape_rst_rq */ + 0x0b2 (PIN_OUTPUT | MUX_MODE4) /* gpio 73 => cmt_rst_rq */ + 0x0b4 (PIN_OUTPUT | MUX_MODE4) /* gpio 74 => cmt_en */ + 0x0b6 (PIN_OUTPUT | MUX_MODE4) /* gpio 75 => cmt_rst */ + 0x15e (PIN_OUTPUT | MUX_MODE4) /* gpio 157 => cmt_bsi */ + >; + }; }; &i2c1 {
@@ -681,8 +692,38 @@ pinctrl-0 = <&ssi_pins>; ti,ssi-cawake-gpio = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* 151 */ + + modem: hsi-client { + compatible = "nokia,n900-modem"; + + pinctrl-names = "default"; + pinctrl-0 = <&modem_pins>; + + hsi-channel-ids = <0>, <1>, <2>, <3>; + hsi-channel-names = "mcsaab-control", + "speech-control", + "speech-data", + "mcsaab-data"; + hsi-speed-kbps = <55000>; + hsi-mode = "frame"; + hsi-flow = "synchronized"; + hsi-arb-mode = "round-robin"; + + interrupts-extended = <&gpio3 8 IRQ_TYPE_EDGE_FALLING>; /* 72 */ + + gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>, /* 70 */ + <&gpio3 9 GPIO_ACTIVE_HIGH>, /* 73 */ + <&gpio3 10 GPIO_ACTIVE_HIGH>, /* 74 */ + <&gpio3 11 GPIO_ACTIVE_HIGH>, /* 75 */ + <&gpio5 29 GPIO_ACTIVE_HIGH>; /* 157 */ + gpio-names = "cmt_apeslpx", + "cmt_rst_rq", + "cmt_en", + "cmt_rst", + "cmt_bsi"; + }; }; &ssi_port2 { status = "disabled"; -}; +};
Signature · 1 line
1.9.2