Skip to contentSkip to conversation

OMAP SSI driver / N900 modem support

PATCH In review Sebastian Reichel 2 participants 24 messages May 10, 2014 – May 27, 2014

Subsystems (6)
lore
Share & tools
lore

Sebastian Reichel

author maintainer
#0 lore raw

v5 cover OMAP SSI driver / N900 modem support

Hi,

This is the ninth round of the OMAP SSI driver patches. I plan to move all the whole patchset (except DTS changes) to for-next on 2014-05-15 23:42 if nobody objects until then. @Tony: Is this sufficiently early to get the DTS changes into 3.16 via your tree?

Changes since PATCHv4 [0]:
* Removed first three patches (HSI Documentation, MAINTAINER file update and hsi-char fix) from the patchset. I added them to for-next already.
* Added module parameter pm to the nokia-modem kernel module, which can be used to disable requesting the gpios (needed by fremantle). The same parameter will be used later to enable full-kernel based power management. This is not yet implemented in the driver and would break all existing userspace applications.
* Added Tested-By from Ivaylo Dimitrov, who successfully tested it with Maemo fremantle (with some additional patches not directly touching the modem, but needed to boot Maemo).
* Export ssi-protocol reset function, so that nokia-n900 can call it if ssi-protocol is built as module.
* Updated KConfig, so that n900-modem / ssi-protocol and omap-ssi can be built independently.
* Updated KConfig omap-ssi entry to depend on omap3 or compile-test.
* Fix build for disabled CONFIG_OF

For testing you can either apply this patchset to current mainline kernel or use the n900-modem-support-4 branch available on [1]. Feedback is highly appreciated :)

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 (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 full N900 modem PM (in-kernel)
* Remove wakeline checks (thus removing the FIXMEs)

[0] https://lkml.org/lkml/2014/4/25/520
[1] git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi.git

-- Sebastian

Sebastian Reichel (10):
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 ++
 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                     |   12 +-
 drivers/hsi/clients/nokia-modem.c                  |  285 ++++
 drivers/hsi/clients/ssi_protocol.c                 | 1191 +++++++++++++++++
 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                                  |  275 +++-
 include/linux/hsi/hsi.h                            |   39 +-
 include/linux/hsi/ssi_protocol.h                   |   42 +
 23 files changed, 4566 insertions(+), 17 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 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
2.0.0.rc0
author maintainer
#1 lore raw

PATCH v5 1/10 HSI: method to unregister clients from an hsi port

This 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
index 749f7b5..e96a987 100644
@@ -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
index 39bfd5b..5a9f121 100644
@@ -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
2.0.0.rc0
author maintainer
#2 lore raw

PATCH v5 2/10 HSI: Add channel resource support to HSI clients

In reply to Sebastian Reichel

Make 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
index 3073320..57f70c2 100644
@@ -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
index 5a9f121..e3cff94 100644
@@ -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
2.0.0.rc0
author maintainer
#3 lore raw

PATCH v5 3/10 HSI: export method to (un)register clients

In reply to Sebastian Reichel

Expose 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
index de2ad8f..834a2d6 100644
@@ -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
index e3cff94..e20a399 100644
@@ -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
2.0.0.rc0
author maintainer
#4 lore raw

PATCH v5 4/10 HSI: Add common DT binding for HSI client devices

In reply to Sebastian Reichel

Implement and document generic DT bindings for HSI clients.

---
 .../devicetree/bindings/hsi/client-devices.txt     |  44 +++++
 drivers/hsi/hsi.c                                  | 208 ++++++++++++++++++++-
 include/linux/hsi/hsi.h                            |  11 ++
 3 files changed, 261 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hsi/client-devices.txt
Documentation/devicetree/bindings/hsi/client-devices.txt new file +44 -0
new file mode 100644
index 0000000..104c9a3
@@ -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 +206 -2

232 lines not on this page · raw message

include/linux/hsi/hsi.h +11 -0
index e20a399..3ec0630 100644
@@ -301,6 +301,17 @@ struct hsi_client *hsi_new_client(struct hsi_port *port,
 int hsi_remove_client(struct device *dev, void *data);
 void hsi_port_unregister_clients(struct hsi_port *port);
 
+#ifdef CONFIG_OF
+void hsi_add_clients_from_dt(struct hsi_port *port,
+			     struct device_node *clients);
+#else
+static inline void hsi_add_clients_from_dt(struct hsi_port *port,
+					   struct device_node *clients)
+{
+	return;
+}
+#endif
+
 static inline void hsi_controller_set_drvdata(struct hsi_controller *hsi,
 								void *data)
 {
Signature · 1 line
2.0.0.rc0
author maintainer
#5 lore raw

PATCH v5 5/10 HSI: Introduce OMAP SSI driver

In reply to Sebastian Reichel

Add 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
index d94e38d..2c76de4 100644
@@ -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
index 9d5d33f..360371e 100644
@@ -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
new file mode 100644
index 0000000..a0c6a61
@@ -0,0 +1,19 @@
+#
+# HSI controllers configuration
+#
+comment "HSI controllers"
+
+config OMAP_SSI
+	tristate "OMAP SSI hardware driver"
+	depends on HSI && (ARCH_OMAP3 || COMPILE_TEST)
+	---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
new file mode 100644
index 0000000..d2665cf
@@ -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
2.0.0.rc0
author maintainer
#6 lore raw

PATCH v5 6/10 Documentation: DT: omap-ssi binding documentation

In reply to Sebastian Reichel

Create 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
new file mode 100644
index 0000000..f26625e
@@ -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
2.0.0.rc0
author maintainer
#7 lore raw

PATCH v5 7/10 HSI: Introduce driver for SSI Protocol

In reply to Sebastian Reichel

This 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 | 1191 ++++++++++++++++++++++++++++++++++++
 include/linux/hsi/ssi_protocol.h   |   42 ++
 4 files changed, 1243 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
index 3bacd27..efd6288 100644
@@ -4,6 +4,14 @@
 
 comment "HSI clients"
 
+config SSI_PROTOCOL
+	tristate "SSI protocol"
+	depends on HSI && 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
index 327c0e2..ccbf768 100644
@@ -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 +1191 -0

1,191 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
2.0.0.rc0
author maintainer
#8 lore raw

PATCH v5 8/10 HSI: Introduce Nokia N900 modem driver

In reply to Sebastian Reichel

The 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                  | 285 +++++++++++++++++++++
 4 files changed, 352 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
new file mode 100644
index 0000000..8a97978
@@ -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
index efd6288..600582a 100644
@@ -4,6 +4,15 @@
 
 comment "HSI clients"
 
+config NOKIA_MODEM
+	tristate "Nokia Modem"
+	depends on HSI && 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 && PHONET
drivers/hsi/clients/Makefile +1 -0
index ccbf768..4d5bc0e 100644
@@ -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 +285 -0

285 lines not on this page · raw message

Signature · 1 line
2.0.0.rc0
author maintainer
#9 lore raw

PATCH v5 9/10 DTS: ARM: OMAP3-N900: Add SSI support

In reply to Sebastian Reichel

Add 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
index 1a57b61..ef8b241 100644
@@ -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";
+};
\ No newline at end of file
arch/arm/boot/dts/omap3.dtsi +45 -0

51 lines not on this page · raw message

arch/arm/boot/dts/omap34xx.dtsi +11 -0
index 2e92360..3819c1e 100644
@@ -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
index 22cf464..541704a 100644
@@ -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
2.0.0.rc0
maintainer
#10 lore raw

Re: [PATCHv5 09/10] DTS: ARM: OMAP3-N900: Add SSI support

Quoted 1 line · Sebastian Reichel

Add SSI device tree data for OMAP3 and Nokia N900.

Picking this patch into omap-for-v3.16/dt thanks.

Tony

maintainer
#11 lore raw

Re: [PATCHv5 09/10] DTS: ARM: OMAP3-N900: Add SSI support

Quoted 4 lines · Tony Lindgren
Quoted 1 line · Sebastian Reichel

Add SSI device tree data for OMAP3 and Nokia N900.

Picking this patch into omap-for-v3.16/dt thanks.

Just noticed that this patch seems to somehow break idle modes on n900, so dropping both dts changes for now.

Basically the n900 debug LEDs won't ever go off with these two dts patches enabled, even without the modem drivers loaded. I did not dig deeper, but it's probably something related to hwmod using this data for some settings.

Sorry did not notice it earlier as I did not have the PM regression fix patches merged with my testing branch.

Regards,

Tony

author maintainer
#12 lore raw

Re: [PATCHv5 09/10] DTS: ARM: OMAP3-N900: Add SSI support

Hi,

Quoted 6 lines · Tony Lindgren
Quoted 4 lines · Tony Lindgren
Quoted 1 line · Sebastian Reichel

Add SSI device tree data for OMAP3 and Nokia N900.

Picking this patch into omap-for-v3.16/dt thanks.

Quoted 8 lines

Just noticed that this patch seems to somehow break idle modes on n900, so dropping both dts changes for now.

Basically the n900 debug LEDs won't ever go off with these two dts patches enabled, even without the modem drivers loaded. I did not dig deeper, but it's probably something related to hwmod using this data for some settings.

Is hwmod data interpreted at all without the DT entries? The hwmod data may be wrong. The information from commit 398917ce161e10d3c66afaefdb89c73c64c4b02d was simply interpolated from all information I found. The OMAP3 public TRM does not contain *any* information about the ssi IP-Core.

Quoted 2 lines

Sorry did not notice it earlier as I did not have the PM regression fix patches merged with my testing branch.

I hoped to see working modem in 3.16, which will probably be used for the next Debian stable :(

-- Sebastian

maintainer
#13 lore raw

Re: [PATCHv5 09/10] DTS: ARM: OMAP3-N900: Add SSI support

Quoted 12 lines · Sebastian Reichel

Hi,

Quoted 9 lines · Tony Lindgren
Quoted 4 lines · Tony Lindgren
Quoted 1 line · Sebastian Reichel

Add SSI device tree data for OMAP3 and Nokia N900.

Picking this patch into omap-for-v3.16/dt thanks.

Just noticed that this patch seems to somehow break idle modes on n900, so dropping both dts changes for now.

Quoted 7 lines
Quoted 5 lines

Basically the n900 debug LEDs won't ever go off with these two dts patches enabled, even without the modem drivers loaded. I did not dig deeper, but it's probably something related to hwmod using this data for some settings.

Is hwmod data interpreted at all without the DT entries?

Yes for autoidling unused devices. We parse that with omap_device_build_from_dt().

Quoted 5 lines

The hwmod data may be wrong. The information from commit 398917ce161e10d3c66afaefdb89c73c64c4b02d was simply interpolated from all information I found. The OMAP3 public TRM does not contain *any* information about the ssi IP-Core.

It's probably something with the sysc or idlemodes that keeps things from idling. Maybe wrong address? Or wrong flags? I'm pretty sure it was the first .dts patch out of these two as the second one alone did not apply.

Quoted 5 lines
Quoted 2 lines

Sorry did not notice it earlier as I did not have the PM regression fix patches merged with my testing branch.

I hoped to see working modem in 3.16, which will probably be used for the next Debian stable :(

That would indeed be nice, let's try to debug it as we still have few days. I'm finally able to test for PM regressions with DT patches, too bad we did not have that earlier because of multiple issues.

Anyways, this dts issue should not prevent merging the driver changes, I'm all for that!

Regards,

Tony

maintainer
#14 lore raw

Re: [PATCHv5 09/10] DTS: ARM: OMAP3-N900: Add SSI support

Quoted 6 lines · Tony Lindgren
Quoted 5 lines · Sebastian Reichel

The hwmod data may be wrong. The information from commit 398917ce161e10d3c66afaefdb89c73c64c4b02d was simply interpolated from all information I found. The OMAP3 public TRM does not contain *any* information about the ssi IP-Core.

Yeah seems to be just reserved..

Quoted 4 lines

It's probably something with the sysc or idlemodes that keeps things from idling. Maybe wrong address? Or wrong flags? I'm pretty sure it was the first .dts patch out of these two as the second one alone did not apply.

Hmm yeah below is probably how it should be, does this work for you? With this fix applied and your ssi dts patches n900 keeps hitting off-idle for me.

Regards,

Tony

8< --------
From: Tony Lindgren <[email protected]>
Date: Wed, 21 May 2014 12:31:35 -0700
Subject: [PATCH] ARM: OMAP2+: Fix ssi hwmod entry to allow idling

The current entry prevents system from idling if the hwmod is defined in the .dts file so let's change the idlemodes.

Note that I'm not sure we have SYSC_HAS_EMUFREE and SYSS_HAS_RESET_STATUS, but that can be verified later on.

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -3
@@ -3692,9 +3692,7 @@ static struct omap_hwmod_class_sysconfig omap34xx_ssi_sysc = {
 	.sysc_flags	= (SYSC_HAS_AUTOIDLE | SYSC_HAS_EMUFREE |
 			   SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE |
 			   SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
-	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
-			   SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
-			   MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
 	.sysc_fields	= &omap_hwmod_sysc_type1,
 };
 
author maintainer
#15 lore raw

Re: [PATCHv5 09/10] DTS: ARM: OMAP3-N900: Add SSI support

Hi,

Quoted 9 lines · Tony Lindgren
Quoted 6 lines · Tony Lindgren
Quoted 5 lines · Sebastian Reichel

The hwmod data may be wrong. The information from commit 398917ce161e10d3c66afaefdb89c73c64c4b02d was simply interpolated from all information I found. The OMAP3 public TRM does not contain *any* information about the ssi IP-Core.

Yeah seems to be just reserved..

Right. The only documentation of the SSI module is existing code sent by Carlos / included in the maemo kernel.

Quoted 8 lines
Quoted 4 lines

It's probably something with the sysc or idlemodes that keeps things from idling. Maybe wrong address? Or wrong flags? I'm pretty sure it was the first .dts patch out of these two as the second one alone did not apply.

Hmm yeah below is probably how it should be, does this work for you? With this fix applied and your ssi dts patches n900 keeps hitting off-idle for me.

I can confirm, that the N900 hits idle states when the DT patch and the hwmod patch is applied. I have not actually tested if it also works without your hwmod patch.

There are still problems with the idle state if the driver is actually loaded (and I see 100% runtime pm usage in powertop), but that can be fixed later.

Feel free to add Tested-by/Acked-By to the hwmod patch.

-- Sebastian

maintainer
#16 lore raw

Re: [PATCHv5 09/10] DTS: ARM: OMAP3-N900: Add SSI support

Quoted 4 lines · Sebastian Reichel

On Wed, May 21, 2014 at 12:45:28PM -0700, Tony Lindgren wrote:

Right. The only documentation of the SSI module is existing code sent by Carlos / included in the maemo kernel.

That's probably better than any documentation though :)

Quoted 13 lines
Quoted 8 lines
Quoted 4 lines

It's probably something with the sysc or idlemodes that keeps things from idling. Maybe wrong address? Or wrong flags? I'm pretty sure it was the first .dts patch out of these two as the second one alone did not apply.

Hmm yeah below is probably how it should be, does this work for you? With this fix applied and your ssi dts patches n900 keeps hitting off-idle for me.

I can confirm, that the N900 hits idle states when the DT patch and the hwmod patch is applied. I have not actually tested if it also works without your hwmod patch.

Quoted 5 lines

There are still problems with the idle state if the driver is actually loaded (and I see 100% runtime pm usage in powertop), but that can be fixed later.

Feel free to add Tested-by/Acked-By to the hwmod patch.

OK thanks for testing. I'll apply your dts changes as soon as I have an ack from Paul on the hwmod changes. Probably best to queue them together to avoid PM breaking.

Regards,

Tony

author maintainer
#17 lore raw

Re: [PATCHv5 09/10] DTS: ARM: OMAP3-N900: Add SSI support

Hi,

Quoted 7 lines · Tony Lindgren
Quoted 4 lines · Sebastian Reichel

On Wed, May 21, 2014 at 12:45:28PM -0700, Tony Lindgren wrote:

Right. The only documentation of the SSI module is existing code sent by Carlos / included in the maemo kernel.

That's probably better than any documentation though :)

Both have their advantages. Just with the code its hard to add features like context loss checks.

Quoted 13 lines
Quoted 13 lines
Quoted 8 lines
Quoted 4 lines

It's probably something with the sysc or idlemodes that keeps things from idling. Maybe wrong address? Or wrong flags? I'm pretty sure it was the first .dts patch out of these two as the second one alone did not apply.

Hmm yeah below is probably how it should be, does this work for you? With this fix applied and your ssi dts patches n900 keeps hitting off-idle for me.

I can confirm, that the N900 hits idle states when the DT patch and the hwmod patch is applied. I have not actually tested if it also works without your hwmod patch.

Quoted 7 lines
Quoted 5 lines

There are still problems with the idle state if the driver is actually loaded (and I see 100% runtime pm usage in powertop), but that can be fixed later.

Feel free to add Tested-by/Acked-By to the hwmod patch.

OK thanks for testing.

You are welcome.

Quoted 3 lines

I'll apply your dts changes as soon as I have an ack from Paul on the hwmod changes. Probably best to queue them together to avoid PM breaking.

Ok. Sounds legit.

-- Sebastian

maintainer Acked-by Sebastian Reichel
#18 lore raw

Re: [PATCHv5 09/10] DTS: ARM: OMAP3-N900: Add SSI support

Quoted 7 lines · Sebastian Reichel
Quoted 5 lines · Tony Lindgren
Quoted 2 lines · Sebastian Reichel

Feel free to add Tested-by/Acked-By to the hwmod patch.

OK thanks for testing.

Quoted 7 lines

You are welcome.

Quoted 3 lines

I'll apply your dts changes as soon as I have an ack from Paul on the hwmod changes. Probably best to queue them together to avoid PM breaking.

Ok. Sounds legit.

Based on chatting with Paul it seems that we most likely don't have bits for sysc_flags for SYSC_HAS_EMUFREE or SYSS_HAS_RESET_STATUS either. So applying the updated patch below, and the SSI dts changes into omap-for-v3.16/dt-v2.

I'm keeping your previous ack Sebastian as the the idlemodes did not change from the previous version, hopefully that's OK with you.

Regards,

Tony

8< ------------------
From: Tony Lindgren <[email protected]>
Date: Wed, 21 May 2014 12:31:35 -0700
Subject: [PATCH] ARM: OMAP2+: Fix ssi hwmod entry to allow idling

The current entry prevents system from idling if
the hwmod is defined in the .dts file so let's
change the idlemodes.

Note that we probably don't have SYSC_HAS_EMUFREE
or SYSS_HAS_RESET_STATUS either. If we do, those
can be added later on.

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +3 -6
@@ -3689,12 +3689,9 @@ static struct omap_hwmod_class_sysconfig omap34xx_ssi_sysc = {
 	.rev_offs	= 0x0000,
 	.sysc_offs	= 0x0010,
 	.syss_offs	= 0x0014,
-	.sysc_flags	= (SYSC_HAS_AUTOIDLE | SYSC_HAS_EMUFREE |
-			   SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE |
-			   SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
-	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
-			   SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
-			   MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
+	.sysc_flags	= (SYSC_HAS_AUTOIDLE | SYSC_HAS_MIDLEMODE |
+			   SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
 	.sysc_fields	= &omap_hwmod_sysc_type1,
 };
 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#19 lore raw

Re: [PATCHv5 09/10] DTS: ARM: OMAP3-N900: Add SSI support

Quoted 7 lines · Tony Lindgren

Based on chatting with Paul it seems that we most likely don't have bits for sysc_flags for SYSC_HAS_EMUFREE or SYSS_HAS_RESET_STATUS either. So applying the updated patch below, and the SSI dts changes into omap-for-v3.16/dt-v2.

I'm keeping your previous ack Sebastian as the the idlemodes did not change from the previous version, hopefully that's OK with you.

Sure, go for it.

-- Sebastian

author maintainer
#20 lore raw

Re: [PATCHv5 09/10] DTS: ARM: OMAP3-N900: Add SSI support

In reply to Tony Lindgren

Hi,

Quoted 9 lines · Tony Lindgren
Quoted 9 lines
Quoted 8 lines

Just noticed that this patch seems to somehow break idle modes on n900, so dropping both dts changes for now.

Basically the n900 debug LEDs won't ever go off with these two dts patches enabled, even without the modem drivers loaded. I did not dig deeper, but it's probably something related to hwmod using this data for some settings.

Quoted 4 lines
Quoted 1 line

Is hwmod data interpreted at all without the DT entries?

Yes for autoidling unused devices. We parse that with omap_device_build_from_dt().

That function seems to parse DT stuff. What I meant was not without the *driver*, but without the *DT entry*.

I think the hwmod entries are completly ignored until there is a DT device?

Quoted 11 lines
Quoted 5 lines

The hwmod data may be wrong. The information from commit 398917ce161e10d3c66afaefdb89c73c64c4b02d was simply interpolated from all information I found. The OMAP3 public TRM does not contain *any* information about the ssi IP-Core.

It's probably something with the sysc or idlemodes that keeps things from idling. Maybe wrong address? Or wrong flags? I'm pretty sure it was the first .dts patch out of these two as the second one alone did not apply.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Sorry did not notice it earlier as I did not have the PM regression fix patches merged with my testing branch.

I hoped to see working modem in 3.16, which will probably be used for the next Debian stable :(

That would indeed be nice, let's try to debug it as we still have few days.

I will have a look at it now.

Quoted 2 lines

I'm finally able to test for PM regressions with DT patches, too > bad we did not have that earlier because of multiple issues.

Yes. More time would have been nice.

Quoted 2 lines

Anyways, this dts issue should not prevent merging the driver changes, I'm all for that!

Of course, driver changes are unrelated. They are already in linux-next btw.

-- Sebastian

maintainer
#21 lore raw

Re: [PATCHv5 09/10] DTS: ARM: OMAP3-N900: Add SSI support

Quoted 14 lines · Sebastian Reichel

Hi,

Quoted 11 lines · Tony Lindgren
Quoted 10 lines
Quoted 8 lines

Just noticed that this patch seems to somehow break idle modes on n900, so dropping both dts changes for now.

Basically the n900 debug LEDs won't ever go off with these two dts patches enabled, even without the modem drivers loaded. I did not dig deeper, but it's probably something related to hwmod using this data for some settings.

Is hwmod data interpreted at all without the DT entries?

Quoted 8 lines
Quoted 2 lines

Yes for autoidling unused devices. We parse that with omap_device_build_from_dt().

That function seems to parse DT stuff. What I meant was not without the *driver*, but without the *DT entry*.

I think the hwmod entries are completly ignored until there is a DT device?

Yes for device tree based booting. They get initialized based on the ti,hwmods property. Posted a suggested fix, you've probably seen it by now :)

Tony

author maintainer
#22 lore raw

PATCH v5 10/10 DTS: ARM: OMAP3-N900: Add modem support

In reply to Sebastian Reichel

Add 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
index ef8b241..3cd899d 100644
@@ -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";
-};
\ No newline at end of file
+};
Signature · 1 line
2.0.0.rc0
maintainer
#23 lore raw

Re: [PATCHv5 10/10] DTS: ARM: OMAP3-N900: Add modem support

Quoted 1 line · Sebastian Reichel

Add modem device tree data to Nokia N900's DTS file.

Picking this patch too.

Tony