OMAP SSI driver
Subsystems (6)
v2 cover OMAP SSI driver
Hi,
Here is the second round of the OMAP SSI driver patches.
In this round I added/fixed:
- Usage of runtime PM
Previously runtime PM was only used to enable/disable the involved clocks. Now the driver makes use of resume/suspend callbacks, which simplified its code (the driver did its own reference counting).
- Removal of deprecated IRQF_DISABLED flag from irq requests
- HWMOD: set SSI parent to L4-Core instead of L3
I checked the public OMAP3 TRM, which assigns the address space used by the driver as reserved L4-Core address space.
- HWMOD: removed data, which will be specified via Device Tree
- Change omap_ssi_port.wktest and omap_ssi_port.wkin_cken from "unsigned int" to "bool"
- Change omap_ssi_port.wk_refcount from "int" to "unsigned int"
- Convert __raw_read* to read*_relaxed / write*_relaxed
- Removal of involved platform and board code
- Split driver into omap_ssi.c and omap_ssi_port.c
This changes helps in making the DT interface cleaner.
- Creation & Documentation of DT bindings
TODO:
- Central Message Queue
I did not yet implement a central message queue in the HSI framework. I would prefer to do this after SSI is working in the mainline kernel, since that makes testing easier.
- HSI client registration via DT
This needs changes in the HSI framework, which currently assumes, that clients are registered via board support code. This is more or less independent of the controller and should be added in an independent patchset IMHO.
Version 1 (*) of the patchset: https://lkml.org/lkml/2013/8/11/67
(*) There have been patchsets send out by Carlos before my RFCv1,
see RFCv1 for details.
-- Sebastian
Sebastian Reichel (3):
ARM: OMAP2+: hwmod-data: Add SSI information
ARM: OMAP2+: HSI: Introduce OMAP SSI driver
ARM: dts: N900: Add SSI information
Documentation/devicetree/bindings/hsi/omap_ssi.txt | 73 ++ arch/arm/boot/dts/omap3-n900.dts | 8 + arch/arm/boot/dts/omap34xx.dtsi | 49 + arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 48 + drivers/hsi/Kconfig | 1 + drivers/hsi/Makefile | 1 + drivers/hsi/controllers/Kconfig | 20 + drivers/hsi/controllers/Makefile | 6 + drivers/hsi/controllers/omap_ssi.c | 585 +++++++++ drivers/hsi/controllers/omap_ssi.h | 167 +++ drivers/hsi/controllers/omap_ssi_port.c | 1346 ++++++++++++++++++++ drivers/hsi/controllers/omap_ssi_regs.h | 172 +++ 12 files changed, 2476 insertions(+) create mode 100644 Documentation/devicetree/bindings/hsi/omap_ssi.txt 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
Signature · 1 line
1.8.4.rc3
RFC v2 1/3 ARM: OMAP2+: hwmod-data: Add SSI information
This patch adds Synchronous Serial Interface (SSI) hwmod support for OMAP34xx SoCs.
--- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +48 -0
@@ -3693,6 +3693,53 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__aes = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; +/* +* 'ssi' class +* synchronous serial interface (multichannel and full-duplex serial if) +*/ + +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_fields = &omap_hwmod_sysc_type1, +}; + +static struct omap_hwmod_class omap34xx_ssi_hwmod_class = { + .name ="ssi" , + .sysc = &omap34xx_ssi_sysc, +}; + +static struct omap_hwmod omap34xx_ssi_hwmod = { + .name ="ssi" , + .class = &omap34xx_ssi_hwmod_class, + .clkdm_name ="core_l4_clkdm" , + .main_clk ="ssi_ssr_fck" , + .prcm = { + .omap2 = { + .prcm_reg_id =1 , + .module_bit =OMAP3430_EN_SSI_SHIFT , + .module_offs =CORE_MOD , + .idlest_reg_id =1 , + .idlest_idle_bit =OMAP3430ES2_ST_SSI_IDLE_SHIFT , + }, + }, +}; + +/* L4 CORE -> SSI */ +static struct omap_hwmod_ocp_if omap34xx_l4_core__ssi = { + .master = &omap3xxx_l4_core_hwmod, + .slave = &omap34xx_ssi_hwmod, + .clk ="ssi_ick" , + .user =OCP_USER_MPU |OCP_USER_SDMA , +}; +static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[]__initdata = { &omap3xxx_l3_main__l4_core, &omap3xxx_l3_main__l4_per,
@@ -3818,6 +3865,7 @@ static struct omap_hwmod_ocp_if *omap34xx_hwmod_ocp_ifs[] __initdata = {#ifdef CONFIG_OMAP_IOMMU_IVA2 &omap3xxx_l3_main__mmu_iva, #endif + &omap34xx_l4_core__ssi,NULL };
Signature · 6 lines
1.8.4.rc3 -- 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
RFC v2 2/3 ARM: OMAP2+: HSI: Introduce OMAP SSI driver
In reply to Sebastian ReichelThis patch adds an OMAP SSI driver to the HSI framework.
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 | 20 + drivers/hsi/controllers/Makefile | 6 + drivers/hsi/controllers/omap_ssi.c | 585 ++++++++++++++ drivers/hsi/controllers/omap_ssi.h | 167 ++++ drivers/hsi/controllers/omap_ssi_port.c | 1346 +++++++++++++++++++++++++++++++ drivers/hsi/controllers/omap_ssi_regs.h | 172 ++++ 8 files changed, 2298 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 +20 -0
@@ -0,0 +1,20 @@ +# +# HSI controllers configuration +# +comment "HSI controllers" + +config OMAP_SSI + tristate "OMAP SSI hardware driver" + depends on ARCH_OMAP && HSI + default n + ---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 +585 -0
585 lines not on this page · raw message
drivers/hsi/controllers/omap_ssi.h new file +167 -0
167 lines not on this page · raw message
drivers/hsi/controllers/omap_ssi_port.c new file +1346 -0
1,346 lines not on this page · raw message
drivers/hsi/controllers/omap_ssi_regs.h new file +172 -0
172 lines not on this page · raw message
Signature · 1 line
1.8.4.rc3
Tony Lindgren
maintainerRe: [RFCv2 2/3] ARM: OMAP2+: HSI: Introduce OMAP SSI driver
Quoted 1 line · Sebastian Reichel
This patch adds an OMAP SSI driver to the HSI framework.
Thanks for working on this.
drivers/hsi/controllers/Kconfig line 13
Quoted 8 lines
drivers/hsi/controllers/Kconfig new file +8
-0+config OMAP_SSI + tristate "OMAP SSI hardware driver" + depends on ARCH_OMAP && HSI + default n + ---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.
You can drop the "default n" line here, it's the default.
drivers/hsi/controllers/omap_ssi.c line 49
Quoted 3 lines
drivers/hsi/controllers/omap_ssi.c new file +3
-0+/* TODO: HACK: define omap_pm_get_dev_context_loss_count, because it is defined +* in arch/arm/mach-omap2/omap-pm.h and thus not available via #include */ +int omap_pm_get_dev_context_loss_count (struct device *dev);
You can drop this and related calls completely and rely on some SSI configuration registers instead to detect if context was lost.
The reason for that is that the context loss count should be implemented in Linux generic way if needed at all and we can leave out a dependency to that.
If there's a chance that the context is only partially lost, then of course something else is needed. So far I have not hit that issue for MMC or serial at least, but you'd have to test this with off-idle to verify it.
Regards,
Tony
RFC v2 3/3 ARM: dts: N900: Add SSI information
In reply to Sebastian ReichelAdd SSI device tree data for OMAP34xx and Nokia N900.
--- Documentation/devicetree/bindings/hsi/omap_ssi.txt | 73 ++++++++++++++++++++++ arch/arm/boot/dts/omap3-n900.dts | 8 +++ arch/arm/boot/dts/omap34xx.dtsi | 49 +++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 Documentation/devicetree/bindings/hsi/omap_ssi.txt
Documentation/devicetree/bindings/hsi/omap_ssi.txt new file +73 -0
@@ -0,0 +1,73 @@ +OMAP SSI controller bindings + +Required properties: +- compatible: Should be set to the following value + ti,omap3-ssi (applicable to OMAP34xx devices) +- ti,hwmods: Name of the hwmod associated to the controller, which + is "ssi". +- reg: Contains SSI register address range (base address and + length). +- reg-names: Contains the names of the address ranges. It's + expected, that "sys" and "gdd" address ranges are + provided. +- interrupts: Contains the interrupt information for the controller. +- interrupt-names: Contains the names of the interrupts. It's expected, + that "gdd_mpu" is provided. +- ranges Required as an empty node +- #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: Contains port's register address range (base address + and length). +- reg-names: Contains the names of the address ranges. It's + expected, that "tx" and "rx" address ranges are + provided. +- interrupt-parent Should be a phandle for the interrupt controller +- interrupts: Contains the interrupt information for the port. +- interrupt-names: Contains the names of the interrupts. It's expected, + that "mpu_irq0" and "mpu_irq1" are provided. +- 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"; + ti,hwmods = "ssi"; + + reg = <0x48058000 0x1000>, + <0x48059000 0x1000>; + reg-names = "sys", + "gdd"; + + interrupts = <55>; + interrupt-names = "gdd_mpu"; + + #address-cells = <1>; + #size-cells = <1>; + ranges; + + ssi-port@0 { + compatible = "ti,omap3-ssi-port"; + + reg = <0x4805a000 0x800>, + <0x4805a800 0x800>; + reg-names = "tx", + "rx"; + + interrupt-parent = <&intc>; + interrupts = <51>, + <52>; + interrupt-names = "mpu_irq0", + "mpu_irq1"; + + ti,ssi-cawake-gpio = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* 151 */ + } +}
arch/arm/boot/dts/omap3-n900.dts +8 -0
@@ -186,6 +186,14 @@ power = <50>; }; +&ssi_port1 { + ti,ssi-cawake-gpio = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* 151 */ +}; + +&ssi_port2 { + status = "disabled"; +}; + &uart1 { pinctrl-names = "default"; pinctrl-0 = <&uart1_pins>;
arch/arm/boot/dts/omap34xx.dtsi +49 -0
53 lines not on this page · raw message
Signature · 6 lines
1.8.4.rc3 -- 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
Re: [RFCv2 3/3] ARM: dts: N900: Add SSI information
Quoted 167 lines · Sebastian Reichel
Add SSI device tree data for OMAP34xx and Nokia N900.
Signed-off-by Sebastian Reichel <[email protected]>--- Documentation/devicetree/bindings/hsi/omap_ssi.txt | 73 ++++++++++++++++++++++ arch/arm/boot/dts/omap3-n900.dts | 8 +++ arch/arm/boot/dts/omap34xx.dtsi | 49 +++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 Documentation/devicetree/bindings/hsi/omap_ssi.txtDocumentation/devicetree/bindings/hsi/omap_ssi.txt new file +73
-0@@ -0,0 +1,73 @@ +OMAP SSI controller bindings + +Required properties: +- compatible: Should be set to the following value + ti,omap3-ssi (applicable to OMAP34xx devices) +- ti,hwmods: Name of the hwmod associated to the controller, which + is "ssi". +- reg: Contains SSI register address range (base address and + length). +- reg-names: Contains the names of the address ranges. It's + expected, that "sys" and "gdd" address ranges are + provided. +- interrupts: Contains the interrupt information for the controller. +- interrupt-names: Contains the names of the interrupts. It's expected, + that "gdd_mpu" is provided. +- ranges Required as an empty node +- #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: Contains port's register address range (base address + and length). +- reg-names: Contains the names of the address ranges. It's + expected, that "tx" and "rx" address ranges are + provided. +- interrupt-parent Should be a phandle for the interrupt controller +- interrupts: Contains the interrupt information for the port. +- interrupt-names: Contains the names of the interrupts. It's expected, + that "mpu_irq0" and "mpu_irq1" are provided. +- 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 at 48058000 { + compatible = "ti,omap3-ssi"; + ti,hwmods = "ssi"; + + reg = <0x48058000 0x1000>, + <0x48059000 0x1000>; + reg-names = "sys", + "gdd"; + + interrupts = <55>; + interrupt-names = "gdd_mpu"; + + #address-cells = <1>; + #size-cells = <1>; + ranges; + + ssi-port at 0 { + compatible = "ti,omap3-ssi-port"; + + reg = <0x4805a000 0x800>, + <0x4805a800 0x800>; + reg-names = "tx", + "rx"; + + interrupt-parent = <&intc>; + interrupts = <51>, + <52>; + interrupt-names = "mpu_irq0", + "mpu_irq1"; + + ti,ssi-cawake-gpio = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* 151 */ + } +}arch/arm/boot/dts/omap3-n900.dts +8
-0@@ -186,6 +186,14 @@ power = <50>; }; +&ssi_port1 { + ti,ssi-cawake-gpio = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* 151 */ +}; + +&ssi_port2 { + status = "disabled"; +}; + &uart1 { pinctrl-names = "default"; pinctrl-0 = <&uart1_pins>;arch/arm/boot/dts/omap34xx.dtsi +49
-1@@ -25,4 +25,53 @@ clock-latency = <300000>; /* From legacy driver */ }; }; + + ocp { + ssi: ssi-controller at 48058000 { + compatible = "ti,omap3-ssi"; + ti,hwmods = "ssi"; + + reg = <0x48058000 0x1000>, + <0x48059000 0x1000>; + reg-names = "sys", + "gdd"; + + interrupts = <55>; + interrupt-names = "gdd_mpu"; + + #address-cells = <1>; + #size-cells = <1>; + ranges; + + ssi_port1: ssi-port at 0 { + compatible = "ti,omap3-ssi-port"; + + reg = <0x4805a000 0x800>, + <0x4805a800 0x800>; + reg-names = "tx", + "rx"; + + interrupt-parent = <&intc>; + interrupts = <51>, + <52>; + interrupt-names = "mpu_irq0", + "mpu_irq1"; + }; + + ssi_port2: ssi-port at 1 { + compatible = "ti,omap3-ssi-port"; + + reg = <0x4805b000 0x800>, + <0x4805b800 0x800>; + reg-names = "tx", + "rx"; + + interrupt-parent = <&intc>; + interrupts = <53>, + <54>; + interrupt-names = "mpu_irq0", + "mpu_irq1"; + }; + }; + }; }; --
Quoted 1 line
1.8.4.rc3
Hi Sebastian,
Is the Synchronous Serial Interface (SSI) only supported by OMAP34xx/OMAP35xx SoC and not by OMAP36xx/OMAP37xx SoC?
I'm asking this since if SSI is supported by both we should add the device nodes in omap3.dtsi instead of omap34xx.dtsi.
I thought that all OMAP3 SoC supported SSI and all OMAP4 SoC supported HSI but I guess I was wrong...
Thanks a lot and best regards,
Javier
Re: [RFCv2 3/3] ARM: dts: N900: Add SSI information
Hi,
Quoted 8 lines
Is the Synchronous Serial Interface (SSI) only supported by OMAP34xx/OMAP35xx SoC and not by OMAP36xx/OMAP37xx SoC?
I'm asking this since if SSI is supported by both we should add the device nodes in
omap3.dtsiinstead ofomap34xx.dtsi.I thought that all OMAP3 SoC supported SSI and all OMAP4 SoC supported HSI but I guess I was wrong...
I just do not know. Information about the SSI core is not included in the public OMAP TRM. It only lists the memory space as reserved.
Thus I only included it in OMAP34xx, which is used in Nokia N900 and must support SSI.
-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130916/f2c6d2d9/attachment-0001.sig>
Re: [RFCv2 3/3] ARM: dts: N900: Add SSI information
Quoted 8 lines · Sebastian Reichel
Hi,
Quoted 6 lines
Is the Synchronous Serial Interface (SSI) only supported by OMAP34xx/OMAP35xx SoC and not by OMAP36xx/OMAP37xx SoC?
I'm asking this since if SSI is supported by both we should add the device nodes in
omap3.dtsiinstead ofomap34xx.dtsi.
Quoted 9 lines
Quoted 2 lines
I thought that all OMAP3 SoC supported SSI and all OMAP4 SoC supported HSI but I guess I was wrong...
I just do not know. Information about the SSI core is not included in the public OMAP TRM. It only lists the memory space as reserved.
Thus I only included it in OMAP34xx, which is used in Nokia N900 and must support SSI.
I see... hopefully someone from TI can shed some light on this.
Quoted 2 lines
-- Sebastian
Best regards,
Javier
Aaro Koskinen
maintainerRe: [RFCv2 3/3] ARM: dts: N900: Add SSI information
In reply to Sebastian ReichelHi,
Quoted 6 lines · Sebastian Reichel
Quoted 6 lines
Is the Synchronous Serial Interface (SSI) only supported by OMAP34xx/OMAP35xx SoC and not by OMAP36xx/OMAP37xx SoC?
I'm asking this since if SSI is supported by both we should add the device nodes in
omap3.dtsiinstead ofomap34xx.dtsi.
Quoted 8 lines
Quoted 2 lines
I thought that all OMAP3 SoC supported SSI and all OMAP4 SoC supported HSI but I guess I was wrong...
I just do not know. Information about the SSI core is not included in the public OMAP TRM. It only lists the memory space as reserved.
Thus I only included it in OMAP34xx, which is used in Nokia N900 and must support SSI.
I think N9 and N950 (OMAP3630) are using pretty much the same driver.
A.
Re: [RFCv2 3/3] ARM: dts: N900: Add SSI information
Quoted 10 lines · Aaro Koskinen
Quoted 9 lines · Sebastian Reichel
Quoted 8 lines
Is the Synchronous Serial Interface (SSI) only supported by OMAP34xx/OMAP35xx SoC and not by OMAP36xx/OMAP37xx SoC?
I'm asking this since if SSI is supported by both we should add the device nodes in
omap3.dtsiinstead ofomap34xx.dtsi.I thought that all OMAP3 SoC supported SSI and all OMAP4 SoC supported HSI but I guess I was wrong...
Quoted 7 lines
Quoted 5 lines
I just do not know. Information about the SSI core is not included in the public OMAP TRM. It only lists the memory space as reserved.
Thus I only included it in OMAP34xx, which is used in Nokia N900 and must support SSI.
I think N9 and N950 (OMAP3630) are using pretty much the same driver.
OK. I've checked the N950 kernel from [0] and it uses the same data. I will move the data from omap34xx.dtsi to omap3.dtsi in the next RFC.
Thanks for the hint.
[0] https://github.com/nemomobile/kernel-adaptation-n950-n9/
-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130916/ff330637/attachment.sig>
Re: [RFCv2 3/3] ARM: dts: N900: Add SSI information
In reply to Sebastian ReichelQuoted 44 lines · Sebastian Reichel
Add SSI device tree data for OMAP34xx and Nokia N900.
Signed-off-by Sebastian Reichel <[email protected]>--- Documentation/devicetree/bindings/hsi/omap_ssi.txt | 73 ++++++++++++++++++++++ arch/arm/boot/dts/omap3-n900.dts | 8 +++ arch/arm/boot/dts/omap34xx.dtsi | 49 +++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 Documentation/devicetree/bindings/hsi/omap_ssi.txtDocumentation/devicetree/bindings/hsi/omap_ssi.txt new file +28
-0@@ -0,0 +1,73 @@ +OMAP SSI controller bindings + +Required properties: +- compatible: Should be set to the following value + ti,omap3-ssi (applicable to OMAP34xx devices) +- ti,hwmods: Name of the hwmod associated to the controller, which + is "ssi". +- reg: Contains SSI register address range (base address and + length). +- reg-names: Contains the names of the address ranges. It's + expected, that "sys" and "gdd" address ranges are + provided. +- interrupts: Contains the interrupt information for the controller. +- interrupt-names: Contains the names of the interrupts. It's expected, + that "gdd_mpu" is provided. +- ranges Required as an empty node +- #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: Contains port's register address range (base address + and length). +- reg-names: Contains the names of the address ranges. It's + expected, that "tx" and "rx" address ranges are
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 38
Quoted 10 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt new file +10
-0+ provided. +- interrupt-parent Should be a phandle for the interrupt controller +- interrupts: Contains the interrupt information for the port. +- interrupt-names: Contains the names of the interrupts. It's expected, + that "mpu_irq0" and "mpu_irq1" are provided. +- 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. +
This belongs to patch which introduces SSI driver, no?
Signature · 2 lines
Regards, Nishanth Menon
Re: [RFCv2 3/3] ARM: dts: N900: Add SSI information
In reply to Sebastian ReichelQuoted 1 line · Sebastian Reichel
Add SSI device tree data for OMAP34xx and Nokia N900.
What is an "SSI" device, ...
Documentation/devicetree/bindings/hsi/omap_ssi.txt
Quoted 1 line
Documentation/devicetree/bindings/hsi/omap_ssi.txt +0
-0
... and what is the "HSI" subsystem?
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 5
Quoted 5 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt +5
-0+OMAP SSI controller bindings + +Required properties: +- compatible: Should be set to the following value + ti,omap3-ssi (applicable to OMAP34xx devices)
I think that'd be better phrased as:
Should include "ti,omap3-ssi".
The binding should not preclude other compatibel values being present (e.g. a SoC-specific compatible value, to allow SoC-specific quirks to be enabled later).
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 7
Quoted 2 lines
+- ti,hwmods: Name of the hwmod associated to the controller, which
Documentation/devicetree/bindings/hsi/omap_ssi.txt +1
-0+ is "ssi".
I don't think we should add any more of that, for new bindings.
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 12
Quoted 5 lines
+- reg: Contains SSI register address range (base address and
Documentation/devicetree/bindings/hsi/omap_ssi.txt +4
-0+ length). +- reg-names: Contains the names of the address ranges. It's + expected, that "sys" and "gdd" address ranges are + provided.
Why two entries in reg-names but only one in reg?
I think it'd be better to write:
reg-names: Contains the values "sys" and "gdd".
reg: Contains a register specifier for each entry in
reg-names.
A similar re-ordering/-wording would apply to interrupts/interrupt-names.
Quoted 1 line
+- ranges Required as an empty node
s/node/property/
Why must ranges be empty? As long as the content correctly represents the bus setup, why does the content matter at all. How about:
ranges Represents the bus address mapping between the main
controller node and the child nodes below.
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 24
Quoted 5 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt +5
-0+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)
Hmm. Is it really the case that there is 1 controller with n ports? Are the ports really dependent upon some shared resource? Couldn't the ports be represented as separate top-level SSI controllers?
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 33
Quoted 3 lines
+- interrupts: Contains the interrupt information for the port. +- interrupt-names: Contains the names of the interrupts. It's expected,Documentation/devicetree/bindings/hsi/omap_ssi.txt +1
-0+ that "mpu_irq0" and "mpu_irq1" are provided.
What exactly are those interrupts? "MPU" sounds like an external micro-controller/processor...
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 37
Quoted 4 lines
+- ti,ssi-cawake-gpio: Defines which GPIO pin is used to signify CAWAKE
Documentation/devicetree/bindings/hsi/omap_ssi.txt +3
-0+ events for the port. This is an optional board-specific + property. If it's missing the port will not be + enabled.
That also sounds like something that's a higher-level protocol, rather than whatever low-level transport "SSI" implements. Should this be part of a child node that represents the device attached to the SSI controller?
Does the SSI controller (or its ports) not need any clocks, resets, regulators, ...?
Re: [RFCv2 3/3] ARM: dts: N900: Add SSI information
Hi,
Quoted 4 lines · Stephen Warren
Quoted 1 line · Sebastian Reichel
Add SSI device tree data for OMAP34xx and Nokia N900.
What is an "SSI" device, ...
Synchronous Serial Interface (SSI), which is an interface from the OMAP3 for modem connection. It's a legacy variant of High-speed Synchronous Serial Interface (HSI). This in turn is a standard from MIPI:
http://www.mipi.org/specifications/high-speed-synchronous-serial-interface-hsi
Quoted 4 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt
Quoted 2 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt +0
-0... and what is the "HSI" subsystem?
A framework for HSI devices living in drivers/hsi.
Quoted 8 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 5
Quoted 5 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt +5
-0+OMAP SSI controller bindings + +Required properties: +- compatible: Should be set to the following value + ti,omap3-ssi (applicable to OMAP34xx devices)I think that'd be better phrased as:
Quoted 5 lines
Should include "ti,omap3-ssi".
The binding should not preclude other compatibel values being present (e.g. a SoC-specific compatible value, to allow SoC-specific quirks to be enabled later).
Right. Will be fixed in the next RFC.
Quoted 4 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 7
Quoted 2 lines
+- ti,hwmods: Name of the hwmod associated to the controller, which
Documentation/devicetree/bindings/hsi/omap_ssi.txt +1
-0+ is "ssi".I don't think we should add any more of that, for new bindings.
That basically means not adding new drivers until hwmod is completly removed, since no new drivers not using DT are accepted anymore.
hwmod still holds some information, which are not yet mapped to DT.
Quoted 8 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 12
Quoted 5 lines
+- reg: Contains SSI register address range (base address and
Documentation/devicetree/bindings/hsi/omap_ssi.txt +4
-0+ length). +- reg-names: Contains the names of the address ranges. It's + expected, that "sys" and "gdd" address ranges are + provided.Why two entries in reg-names but only one in reg?
Quoted 7 lines
I think it'd be better to write:
reg-names: Contains the values "sys" and "gdd".
reg: Contains a register specifier for each entry in
reg-names.A similar re-ordering/-wording would apply to interrupts/interrupt-names.
OK. Will be fixed in the next RFC.
Quoted 9 lines
Quoted 1 line
+- ranges Required as an empty node
s/node/property/
Why must ranges be empty? As long as the content correctly represents the bus setup, why does the content matter at all. How about:
ranges Represents the bus address mapping between the main
controller node and the child nodes below.
OK. Will be fixed in the next RFC.
Quoted 7 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 24
Quoted 5 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt +5
-0+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)Hmm. Is it really the case that there is 1 controller with n ports?
Yes with n=2.
Quoted 1 line
Are the ports really dependent upon some shared resource?
Yes and runtime power management.
Quoted 2 lines
Couldn't the ports be represented as separate top-level SSI controllers?
Maybe with some phandles. The current layout is cleaner IMHO. The ports are part of the controller and actually most boards only use one of them.
In the original driver only the controller hat platform data with memory areas called "port1_rx" etc.
Quoted 7 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 33
Quoted 3 lines
+- interrupts: Contains the interrupt information for the port. +- interrupt-names: Contains the names of the interrupts. It's expected,Documentation/devicetree/bindings/hsi/omap_ssi.txt +1
-0+ that "mpu_irq0" and "mpu_irq1" are provided.What exactly are those interrupts? "MPU" sounds like an external micro-controller/processor...
Quoted 8 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 37
Quoted 4 lines
+- ti,ssi-cawake-gpio: Defines which GPIO pin is used to signify CAWAKE
Documentation/devicetree/bindings/hsi/omap_ssi.txt +3
-0+ events for the port. This is an optional board-specific + property. If it's missing the port will not be + enabled.That also sounds like something that's a higher-level protocol, rather than whatever low-level transport "SSI" implements. Should this be part of a child node that represents the device attached to the SSI controller?
Both the interrupts and the cawake-gpio are used as irqs for starting data transfers. As far as I understand it none of them are specific to the attached device.
NOTE: I do not have documentation for the chip. I just ported the old patch from Carlos Chinea (who developed the initial driver for Nokia) to the new kernel frameworks, since I want to use the modem of my Nokia N900.
Quoted 2 lines
Does the SSI controller (or its ports) not need any clocks, resets, regulators, ...?
The only other stuff needed is taken care of by hwmod, which can be seen in this patch:
https://lkml.org/lkml/2013/9/15/97
As far as I understand it, this kind of information is not yet supported by DT on OMAP boards. On the other hand new OMAP drivers are not allowed to add further board code, so temporarily the ti,hwmod hack must be used.
-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130924/38525852/attachment-0001.sig>
Re: [RFCv2 3/3] ARM: dts: N900: Add SSI information
Quoted 5 lines · Sebastian Reichel
Hi,
Quoted 2 lines · Stephen Warren
Quoted 1 line · Sebastian Reichel
Add SSI device tree data for OMAP34xx and Nokia N900.
...
Quoted 11 lines
Quoted 4 lines
Quoted 2 lines
+- ti,hwmods: Name of the hwmod associated to the controller,
which + is "ssi".I don't think we should add any more of that, for new bindings.
That basically means not adding new drivers until hwmod is completly removed, since no new drivers not using DT are accepted anymore.
hwmod still holds some information, which are not yet mapped to DT.
Tony, is defining hwmod properties for new OMAP bindings what everyone is currently doing? I'm not sure how that will work with a stable DT ABI...
I wonder if it makes sense not to define the ti,hwmods property in the binding document (so it doesn't become part of the ABI), but put it into the DTS file simply to make the current Linux code work? I'm not sure if that's any better though.
Quoted 16 lines
Quoted 6 lines
Quoted 3 lines
+Required Port sub-node properties: +- compatible: Should be
set to the following value + ti,omap3-ssi-port (applicable to OMAP34xx devices)Hmm. Is it really the case that there is 1 controller with n ports?
Yes with n=2.
Quoted 1 line
Are the ports really dependent upon some shared resource?
Yes and runtime power management.
Quoted 2 lines
Couldn't the ports be represented as separate top-level SSI controllers?
Quoted 6 lines
Maybe with some phandles. The current layout is cleaner IMHO. The ports are part of the controller and actually most boards only use one of them.
In the original driver only the controller hat platform data with memory areas called "
port1_rx" etc.
If the HW block really does include 2 ports, then representing it as a single node in DT is fine; I was just making sure.
Quoted 13 lines
Quoted 13 lines
Quoted 4 lines
+- interrupts: Contains the interrupt information for the
port. +- interrupt-names: Contains the names of the interrupts.
It's expected, + that "mpu_irq0" and "mpu_irq1" are
provided.What exactly are those interrupts? "MPU" sounds like an external micro-controller/processor...
Quoted 4 lines
+- 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.
Quoted 8 lines
Quoted 4 lines
That also sounds like something that's a higher-level protocol, rather than whatever low-level transport "SSI" implements. Should this be part of a child node that represents the device attached to the SSI controller?
Both the interrupts and the cawake-gpio are used as irqs for starting data transfers. As far as I understand it none of them are specific to the attached device.
But are the interrupts and GPIO actually part of the HSI protocol itself, or something layered on top? While your particular board has them wired up, is it strictly necessary for all boards using HSI to have those IRQs/GPIOs?
Quoted 7 lines
Quoted 2 lines
Does the SSI controller (or its ports) not need any clocks, resets, regulators, ...?
The only other stuff needed is taken care of by hwmod, which can be seen in this patch:
It would be best to completely define the DT binding so that all required clocks etc. are already present in the DT. That way, the DT ABI won't change once people stop using hwmods. Tony, is that possible on OMAP at present, irrespective of whether those e.g. clock properties will actually be used by Linux?
Tony Lindgren
maintainerRe: [RFCv2 3/3] ARM: dts: N900: Add SSI information
Quoted 20 lines · Stephen Warren
Quoted 5 lines · Sebastian Reichel
Hi,
Quoted 2 lines · Stephen Warren
Quoted 1 line · Sebastian Reichel
Add SSI device tree data for OMAP34xx and Nokia N900.
...
Quoted 11 lines
Quoted 4 lines
Quoted 2 lines
+- ti,hwmods: Name of the hwmod associated to the controller,
which + is "ssi".I don't think we should add any more of that, for new bindings.
That basically means not adding new drivers until hwmod is completly removed, since no new drivers not using DT are accepted anymore.
hwmod still holds some information, which are not yet mapped to DT.
Quoted 8 lines
Tony, is defining hwmod properties for new OMAP bindings what everyone is currently doing? I'm not sure how that will work with a stable DT ABI...
I wonder if it makes sense not to define the ti,hwmods property in the binding document (so it doesn't become part of the ABI), but put it into the DTS file simply to make the current Linux code work? I'm not sure if that's any better though.
There are still pieces of information in hwmod that is needed for PM to work for things like device autoidle and reset. The plan is to describe those with Linux generic bindings, but that's going to take a while.
Clearly once we have those bindings, ti,hwmods is not needed and then the problem is how to support old .dtb files..
Quoted 5 lines
It would be best to completely define the DT binding so that all required clocks etc. are already present in the DT. That way, the DT ABI won't change once people stop using hwmods. Tony, is that possible on OMAP at present, irrespective of whether those e.g. clock properties will actually be used by Linux?
Unfortunately not doable yet. For v3.13 we should have the clock bindings in place, but quite a bit of work still remains for the remaining hwmod pieces.
Considering all this, we may be best off dropping ti,hwmods binding completely, and populate it based on DT auxdata or something similar. That means that old .dtb files won't work once we populate things from DT, but at least the binding issue would be sorted out.
If anybody has better suggestions, let me know.
Regards,
Tony
Tony Lindgren
maintainerRe: [RFCv2 3/3] ARM: dts: N900: Add SSI information
In reply to Sebastian ReichelQuoted 26 lines · Sebastian Reichel
Documentation/devicetree/bindings/hsi/omap_ssi.txt new file +26
-0+ +Example for Nokia N900: + +ssi-controller at 48058000 { + compatible = "ti,omap3-ssi"; + ti,hwmods = "ssi"; + + reg = <0x48058000 0x1000>, + <0x48059000 0x1000>; + reg-names = "sys", + "gdd"; + + interrupts = <55>; + interrupt-names = "gdd_mpu"; + + #address-cells = <1>; + #size-cells = <1>; + ranges; + + ssi-port at 0 { + compatible = "ti,omap3-ssi-port"; + + reg = <0x4805a000 0x800>, + <0x4805a800 0x800>; + reg-names = "tx", + "rx";
Documentation/devicetree/bindings/hsi/omap_ssi.txt line 73
Quoted 10 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt new file +10
-0+ + interrupt-parent = <&intc>; + interrupts = <51>, + <52>; + interrupt-names = "mpu_irq0", + "mpu_irq1"; + + ti,ssi-cawake-gpio = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* 151 */ + } +}
These should be in the omap3.dtsi file and not nested but separate. I'm almost certain that these are completely independent hardware modules and this means they can live their own PM life independently.
So can you please do a minimal patch for omap3.dtsi that just sets up the standard resources separately for both modules the same way we have for other hardware modules in omap3.dtsi do?
One of them should be called ssi, no idea what the other module name should be as those register ranges show up as reserved in the docs I have.
The other binding pieces can be added later on as they get are ready.
Regards,
Tony
Re: [RFCv2 3/3] ARM: dts: N900: Add SSI information
Hi Tony,
Quoted 42 lines · Tony Lindgren
Quoted 26 lines · Sebastian Reichel
Documentation/devicetree/bindings/hsi/omap_ssi.txt new file +26
-0+ +Example for Nokia N900: + +ssi-controller at 48058000 { + compatible = "ti,omap3-ssi"; + ti,hwmods = "ssi"; + + reg = <0x48058000 0x1000>, + <0x48059000 0x1000>; + reg-names = "sys", + "gdd"; + + interrupts = <55>; + interrupt-names = "gdd_mpu"; + + #address-cells = <1>; + #size-cells = <1>; + ranges; + + ssi-port at 0 { + compatible = "ti,omap3-ssi-port"; + + reg = <0x4805a000 0x800>, + <0x4805a800 0x800>; + reg-names = "tx", + "rx";Documentation/devicetree/bindings/hsi/omap_ssi.txt line 73
Quoted 10 lines
Documentation/devicetree/bindings/hsi/omap_ssi.txt new file +10
-0+ + interrupt-parent = <&intc>; + interrupts = <51>, + <52>; + interrupt-names = "mpu_irq0", + "mpu_irq1"; + + ti,ssi-cawake-gpio = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* 151 */ + } +}These should be in the
omap3.dtsifile and not nested but separate. I'm almost certain that these are completely independent hardware modules and this means they can live their own PM life independently.
Quoted 6 lines
So can you please do a minimal patch for
omap3.dtsithat just sets up the standard resources separately for both modules the same way we have for other hardware modules inomap3.dtsido?One of them should be called ssi, no idea what the other module name should be as those register ranges show up as reserved in the docs I have.
In the public documentation of the omaps all SSI related stuff is missing and memory areas are marked as reserved. I could not find out how to receive the NDA version, so the following is purely speculation based on the code.
If I understand it right the HW looks like this:
+-----------------+ | GDD (DMA) | <- this one is currently called ssi-controller +--------+--------+ | Port 1 | Port 2 | <- these are currently called ssi-port +--------+--------+
I think the GDD part must be enabled while Port 1 or Port 2 is enabled. The last RFC driver from Carlos did not even split up the irq/memory areas into different platform devices, but just requested all of them in one ssi platform device.
Quoted 1 line
The other binding pieces can be added later on as they get are ready.
Sure. They are almost finished btw. I was able to get a gsm network scan.
-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131121/b7b8674a/attachment.sig>
Tony Lindgren
maintainerRe: [RFCv2 3/3] ARM: dts: N900: Add SSI information
Quoted 15 lines · Sebastian Reichel
On Wed, Nov 20, 2013 at 05:38:59PM -0800, Tony Lindgren wrote:
In the public documentation of the omaps all SSI related stuff is missing and memory areas are marked as reserved. I could not find out how to receive the NDA version, so the following is purely speculation based on the code.
If I understand it right the HW looks like this:
+-----------------+ | GDD (DMA) | <- this one is currently called ssi-controller +--------+--------+ | Port 1 | Port 2 | <- these are currently called ssi-port +--------+--------+
Quoted 4 lines
I think the GDD part must be enabled while Port 1 or Port 2 is enabled. The last RFC driver from Carlos did not even split up the irq/memory areas into different platform devices, but just requested all of them in one ssi platform device.
Might be worth checking. If these blocks have the revision and SYSC register in the beginning of their address space like all omap modules, then they are completely separate blocks and can idle independently.
The fact that they have separate interrutps makes me think that's the case, otherwise there would be just interrupt(s) at the ssi-controllel level.
Quoted 4 lines
Quoted 1 line
The other binding pieces can be added later on as they get are ready.
Sure. They are almost finished btw. I was able to get a gsm network scan.
That's great :)
Regards,
Tony
Re: [RFCv2 3/3] ARM: dts: N900: Add SSI information
Quoted 16 lines · Tony Lindgren
Quoted 15 lines · Sebastian Reichel
On Wed, Nov 20, 2013 at 05:38:59PM -0800, Tony Lindgren wrote:
In the public documentation of the omaps all SSI related stuff is missing and memory areas are marked as reserved. I could not find out how to receive the NDA version, so the following is purely speculation based on the code.
If I understand it right the HW looks like this:
+-----------------+ | GDD (DMA) | <- this one is currently called ssi-controller +--------+--------+ | Port 1 | Port 2 | <- these are currently called ssi-port +--------+--------+
Quoted 8 lines
Quoted 4 lines
I think the GDD part must be enabled while Port 1 or Port 2 is enabled. The last RFC driver from Carlos did not even split up the irq/memory areas into different platform devices, but just requested all of them in one ssi platform device.
Might be worth checking. If these blocks have the revision and SYSC register in the beginning of their address space like all omap modules, then they are completely separate blocks and can idle independently.
This does not seem to be the case.
I think this is just one big IP-Core, which provides two ports.
Quoted 3 lines
The fact that they have separate interrutps makes me think that's the case, otherwise there would be just interrupt(s) at the ssi-controllel level.
The original driver from Carlos had all IRQs in one big platform device. I created the ports subdevices, since it looked cleaner than naming resources "port1_mpu_irq0".
-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131122/60f08dbe/attachment.sig>