Skip to contentSkip to conversation

ARM: Conexant Digicolor CX92755 SoC support

PATCH Superseded Baruch Siach 2 participants 14 messages Dec 23, 2014 – Dec 24, 2014

Subsystems (7)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Baruch Siach

author maintainer
#0 lore raw

cover ARM: Conexant Digicolor CX92755 SoC support

This series adds initial support for the Conexant CX92755 SoC. The CX92755 is one of the Digicolor series of SoCs, all sharing many of the same peripherals. The code was tested on the CX92755 evaluation kit, AKA Equinox.

Uses attempting to try this code will most likely also want the UART/console driver available from https://patchwork.kernel.org/patch/5515861/.

Baruch Siach (8):
ARM: initial support for Conexant Digicolor CX92755 SoC
ARM: digicolor: add low level debug support
ARM: digicolor: add minimal device tree description
ARM: devicetree: document supported Conexant Digicolor SoC
irqchip: Conexant CX92755 interrupts controller driver
irqchip: devicetree: document Conexant Digicolor irq binding
clocksource: driver for Conexant Digicolor SoC timer
clocksource: devicetree: document Conexant Digicolor timer binding

 .../devicetree/bindings/arm/digicolor.txt          |   6 +
 .../bindings/interrupt-controller/digicolor-ic.txt |  20 +++
 .../devicetree/bindings/timer/digicolor-timer.txt  |  18 +++
 arch/arm/Kconfig                                   |   2 +
 arch/arm/Kconfig.debug                             |  12 +-
 arch/arm/boot/dts/Makefile                         |   1 +
 arch/arm/boot/dts/conexant_equinox.dts             |  67 +++++++++
 arch/arm/boot/dts/cx92755.dtsi                     | 103 ++++++++++++++
 arch/arm/include/debug/digicolor.S                 |  35 +++++
 arch/arm/mach-digicolor/Kconfig                    |   4 +
 arch/arm/mach-digicolor/Makefile                   |   1 +
 arch/arm/mach-digicolor/digicolor.c                |  19 +++
 drivers/clocksource/Makefile                       |   1 +
 drivers/clocksource/timer-digicolor.c              | 155 +++++++++++++++++++++
 drivers/irqchip/Makefile                           |   1 +
 drivers/irqchip/irq-digicolor.c                    | 135 ++++++++++++++++++
 16 files changed, 578 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/digicolor.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/digicolor-ic.txt
 create mode 100644 Documentation/devicetree/bindings/timer/digicolor-timer.txt
 create mode 100644 arch/arm/boot/dts/conexant_equinox.dts
 create mode 100644 arch/arm/boot/dts/cx92755.dtsi
 create mode 100644 arch/arm/include/debug/digicolor.S
 create mode 100644 arch/arm/mach-digicolor/Kconfig
 create mode 100644 arch/arm/mach-digicolor/Makefile
 create mode 100644 arch/arm/mach-digicolor/digicolor.c
 create mode 100644 drivers/clocksource/timer-digicolor.c
 create mode 100644 drivers/irqchip/irq-digicolor.c
Signature · 1 line
2.1.3
author maintainer
#1 lore raw

PATCH 1/8 ARM: initial support for Conexant Digicolor CX92755 SoC

---
 arch/arm/Kconfig                    |  2 ++
 arch/arm/mach-digicolor/Kconfig     |  3 +++
 arch/arm/mach-digicolor/Makefile    |  1 +
 arch/arm/mach-digicolor/digicolor.c | 18 ++++++++++++++++++
 4 files changed, 24 insertions(+)
 create mode 100644 arch/arm/mach-digicolor/Kconfig
 create mode 100644 arch/arm/mach-digicolor/Makefile
 create mode 100644 arch/arm/mach-digicolor/digicolor.c
arch/arm/Kconfig +2 -0
index 97d07ed60a0b..86e2202565e6 100644
@@ -858,6 +858,8 @@ source "arch/arm/mach-cns3xxx/Kconfig"
 
 source "arch/arm/mach-davinci/Kconfig"
 
+source "arch/arm/mach-digicolor/Kconfig"
+
 source "arch/arm/mach-dove/Kconfig"
 
 source "arch/arm/mach-ep93xx/Kconfig"
arch/arm/mach-digicolor/Kconfig new file +3 -0
new file mode 100644
index 000000000000..4830122a9dd0
@@ -0,0 +1,3 @@
+config ARCH_DIGICOLOR
+	bool "Conexant Digicolor SoC Support"
+	depends on ARCH_MULTI_V7
arch/arm/mach-digicolor/Makefile new file +1 -0
new file mode 100644
index 000000000000..3d8a1d228408
@@ -0,0 +1 @@
+obj-$(CONFIG_ARCH_DIGICOLOR)	+= digicolor.o
arch/arm/mach-digicolor/digicolor.c new file +18 -0
new file mode 100644
index 000000000000..cfc88d1caa47
@@ -0,0 +1,18 @@
+/*
+ * Support for Conexant Digicolor SoCs
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <asm/mach/arch.h>
+
+static const char *digicolor_dt_compat[] __initconst = {
+	"cnxt,cx92755",
+	NULL,
+};
+
+DT_MACHINE_START(DIGICOLOR, "Conexant Digicolor (Flattened Device Tree)")
+	.dt_compat	= digicolor_dt_compat,
+MACHINE_END
Signature · 1 line
2.1.3
author maintainer
#2 lore raw

PATCH 2/8 ARM: digicolor: add low level debug support

In reply to Baruch Siach
---
 arch/arm/Kconfig.debug              | 12 ++++++++++--
 arch/arm/include/debug/digicolor.S  | 35 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-digicolor/digicolor.c |  1 +
 3 files changed, 46 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/include/debug/digicolor.S
arch/arm/Kconfig.debug +10 -2
index 5ddd4906f7a7..7ccab0629dd2 100644
@@ -241,6 +241,13 @@ choice
 		  Say Y here if you want the debug print routines to direct
 		  their output to the serial port in the DC21285 (Footbridge).
 
+	config DEBUG_DIGICOLOR_UA0
+		bool "Kernel low-level debugging messages via Digicolor UA0"
+		depends on ARCH_DIGICOLOR
+		help
+		  Say Y here if you want the debug print routines to direct
+		  their output to the UA0 serial port in the CX92755.
+
 	config DEBUG_FOOTBRIDGE_COM1
 		bool "Kernel low-level debugging messages via footbridge 8250 at PCI COM1"
 		depends on FOOTBRIDGE
@@ -1204,6 +1211,7 @@ config DEBUG_LL_INCLUDE
 	default "debug/vt8500.S" if DEBUG_VT8500_UART0
 	default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
 	default "debug/bcm63xx.S" if DEBUG_UART_BCM63XX
+	default "debug/digicolor.S" if DEBUG_DIGICOLOR_UA0
 	default "mach/debug-macro.S"
 
 # Compatibility options for PL01x
@@ -1320,7 +1328,7 @@ config DEBUG_UART_PHYS
 		DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF2 || \
 		DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
 		DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
-		DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART
+		DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || DEBUG_DIGICOLOR_UA0
 
 config DEBUG_UART_VIRT
 	hex "Virtual base address of debug UART"
@@ -1398,7 +1406,7 @@ config DEBUG_UART_VIRT
 	depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
 		DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \
 		DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART || \
-		DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART
+		DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || DEBUG_DIGICOLOR_UA0
 
 config DEBUG_UART_8250_SHIFT
 	int "Register offset shift for the 8250 debug UART"
arch/arm/include/debug/digicolor.S new file +35 -0
new file mode 100644
index 000000000000..c9517150766a
@@ -0,0 +1,35 @@
+/*
+ * Debugging macro include header for Conexant Digicolor USART
+ *
+ * Copyright (C) 2014 Paradox Innovation Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+*/
+
+#define UA0_STATUS	0x0742
+#define UA0_EMI_REC	0x0744
+
+#define UA0_STATUS_TX_READY	0x40
+
+#ifdef CONFIG_DEBUG_UART_PHYS
+		.macro	addruart, rp, rv, tmp
+		ldr	\rp, =CONFIG_DEBUG_UART_PHYS
+		ldr	\rv, =CONFIG_DEBUG_UART_VIRT
+		.endm
+#endif
+
+		.macro	senduart,rd,rx
+		strb	\rd, [\rx, #UA0_EMI_REC]
+		.endm
+
+		.macro	waituart,rd,rx
+		.endm
+
+	.macro	busyuart,rd,rx
+1001:		ldrb	\rd, [\rx, #UA0_STATUS]
+		tst	\rd, #UA0_STATUS_TX_READY
+		beq	1001b
+		.endm
arch/arm/mach-digicolor/digicolor.c +1 -0
index cfc88d1caa47..7d1eda19d84c 100644
@@ -14,5 +14,6 @@ static const char *digicolor_dt_compat[] __initconst = {
 };
 
 DT_MACHINE_START(DIGICOLOR, "Conexant Digicolor (Flattened Device Tree)")
+	.map_io		= debug_ll_io_init,
 	.dt_compat	= digicolor_dt_compat,
 MACHINE_END
Signature · 1 line
2.1.3
author maintainer
#5 lore raw

PATCH 3/8 ARM: digicolor: add minimal device tree description

In reply to Baruch Siach

cx92755.dtsi describes CX92755 on chip peripherals. conexant_equinox.dts describes the Equinox evaluation board for the CX92755 SoC.

---
 arch/arm/boot/dts/Makefile             |   1 +
 arch/arm/boot/dts/conexant_equinox.dts |  67 +++++++++++++++++++++
 arch/arm/boot/dts/cx92755.dtsi         | 103 +++++++++++++++++++++++++++++++++
 3 files changed, 171 insertions(+)
 create mode 100644 arch/arm/boot/dts/conexant_equinox.dts
 create mode 100644 arch/arm/boot/dts/cx92755.dtsi
arch/arm/boot/dts/Makefile +1 -0
index 91bd5bd62857..fbeb65eaddda 100644
@@ -75,6 +75,7 @@ dtb-$(CONFIG_ARCH_BRCMSTB) += \
 	bcm7445-bcm97445svmb.dtb
 dtb-$(CONFIG_ARCH_DAVINCI) += da850-enbw-cmc.dtb \
 	da850-evm.dtb
+dtb-$(CONFIG_ARCH_DIGICOLOR) += conexant_equinox.dtb
 dtb-$(CONFIG_ARCH_EFM32) += efm32gg-dk3750.dtb
 dtb-$(CONFIG_ARCH_EXYNOS) += exynos3250-monk.dtb \
 	exynos3250-rinato.dtb \
arch/arm/boot/dts/conexant_equinox.dts new file +67 -0

67 lines not on this page · raw message

arch/arm/boot/dts/cx92755.dtsi new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
2.1.3
author maintainer
#6 lore raw

PATCH 4/8 ARM: devicetree: document supported Conexant Digicolor SoC

In reply to Baruch Siach
---
 Documentation/devicetree/bindings/arm/digicolor.txt | 6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/digicolor.txt
Documentation/devicetree/bindings/arm/digicolor.txt new file +6 -0
new file mode 100644
index 000000000000..658553f40b23
@@ -0,0 +1,6 @@
+Conexant Digicolor Platforms Device Tree Bindings
+
+Each device tree must specify which Conexant Digicolor SoC it uses.
+Must be the following compatible string:
+
+  cnxt,cx92755
Signature · 1 line
2.1.3
author maintainer
#7 lore raw

PATCH 5/8 irqchip: Conexant CX92755 interrupts controller driver

In reply to Baruch Siach
---
 drivers/irqchip/Makefile        |   1 +
 drivers/irqchip/irq-digicolor.c | 135 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 136 insertions(+)
 create mode 100644 drivers/irqchip/irq-digicolor.c
drivers/irqchip/Makefile +1 -0
index 9516a324be6d..42965d2476bb 100644
@@ -42,3 +42,4 @@ obj-$(CONFIG_BRCMSTB_L2_IRQ)		+= irq-brcmstb-l2.o
 obj-$(CONFIG_KEYSTONE_IRQ)		+= irq-keystone.o
 obj-$(CONFIG_MIPS_GIC)			+= irq-mips-gic.o
 obj-$(CONFIG_ARCH_MEDIATEK)		+= irq-mtk-sysirq.o
+obj-$(CONFIG_ARCH_DIGICOLOR)		+= irq-digicolor.o
drivers/irqchip/irq-digicolor.c new file +135 -0

135 lines not on this page · raw message

Signature · 1 line
2.1.3
author maintainer
#10 lore raw

PATCH 6/8 irqchip: devicetree: document Conexant Digicolor irq binding

In reply to Baruch Siach
---
 .../bindings/interrupt-controller/digicolor-ic.txt   | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/digicolor-ic.txt
Documentation/devicetree/bindings/interrupt-controller/digicolor-ic.txt new file +20 -0
new file mode 100644
index 000000000000..fdf9a4c59bf3
@@ -0,0 +1,20 @@
+Conexant Digicolor Interrupt Controller
+
+Required properties:
+
+- compatible : should be "cnxt,cx92755-ic"
+- reg : Specifies base physical address and size of the MISC area, that is
+  where the interrupt controller registers are located
+- interrupt-controller : Identifies the node as an interrupt controller
+- #interrupt-cells : Specifies the number of cells needed to encode an
+  interrupt source. The value shall be 1.
+
+Example:
+
+	intc: intc at f0000000 {
+		compatible = "cnxt,cx92755-ic";
+		interrupt-controller;
+		#interrupt-cells = <1>;
+		reg = <0xf0000000 0x1000>;
+	};
+
Signature · 1 line
2.1.3
author maintainer
#11 lore raw

PATCH 7/8 clocksource: driver for Conexant Digicolor SoC timer

In reply to Baruch Siach
---
 arch/arm/mach-digicolor/Kconfig       |   1 +
 drivers/clocksource/Makefile          |   1 +
 drivers/clocksource/timer-digicolor.c | 155 ++++++++++++++++++++++++++++++++++
 3 files changed, 157 insertions(+)
 create mode 100644 drivers/clocksource/timer-digicolor.c
arch/arm/mach-digicolor/Kconfig +1 -0
index 4830122a9dd0..1e53f684a522 100644
@@ -1,3 +1,4 @@
 config ARCH_DIGICOLOR
 	bool "Conexant Digicolor SoC Support"
 	depends on ARCH_MULTI_V7
+	select CLKSRC_MMIO
drivers/clocksource/Makefile +1 -0
index 94d90b24b56b..a993c108be67 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_SH_TIMER_TMU)	+= sh_tmu.o
 obj-$(CONFIG_EM_TIMER_STI)	+= em_sti.o
 obj-$(CONFIG_CLKBLD_I8253)	+= i8253.o
 obj-$(CONFIG_CLKSRC_MMIO)	+= mmio.o
+obj-$(CONFIG_ARCH_DIGICOLOR)	+= timer-digicolor.o
 obj-$(CONFIG_DW_APB_TIMER)	+= dw_apb_timer.o
 obj-$(CONFIG_DW_APB_TIMER_OF)	+= dw_apb_timer_of.o
 obj-$(CONFIG_CLKSRC_NOMADIK_MTU)	+= nomadik-mtu.o
drivers/clocksource/timer-digicolor.c new file +155 -0

155 lines not on this page · raw message

Signature · 1 line
2.1.3
author maintainer
#12 lore raw

PATCH 8/8 clocksource: devicetree: document Conexant Digicolor timer binding

In reply to Baruch Siach
---
 .../devicetree/bindings/timer/digicolor-timer.txt      | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/digicolor-timer.txt
Documentation/devicetree/bindings/timer/digicolor-timer.txt new file +18 -0
new file mode 100644
index 000000000000..623812da03b4
@@ -0,0 +1,18 @@
+Conexant Digicolor SoCs Timer Controller
+
+Required properties:
+
+- compatible : should be "cnxt,cx92755-timer"
+- reg : Specifies base physical address and size of the MISC area, that is
+  where the "Agent Communication" registers are located
+- interrupts : Contains 8 interrupts, one for each timer
+- clocks: phandle to the main clock
+
+Example:
+
+	timer at f0000000 {
+		compatible = "cnxt,cx92755-timer";
+		reg = <0xf0000000 0x1000>;
+		interrupts = <19>, <31>, <34>, <35>, <52>, <53>, <54>, <55>;
+		clocks = <&main_clk>;
+	};
Signature · 1 line
2.1.3
maintainer
#3 lore raw

Re: [PATCH 2/8] ARM: digicolor: add low level debug support

In reply to Baruch Siach

arch/arm/mach-digicolor/digicolor.c static const char *digicolor_dt_compat[] __initconst = { · line 19

Quoted 7 lines · On Tuesday 23 December 2014 09:58:39 Baruch Siach wrote:
arch/arm/mach-digicolor/digicolor.c +1 -0
@@ -14,5 +14,6 @@ static const char *digicolor_dt_compat[] __initconst = {
 };
 
 DT_MACHINE_START(DIGICOLOR, "Conexant Digicolor (Flattened Device Tree)")
+       .map_io         = debug_ll_io_init,
        .dt_compat      = digicolor_dt_compat,
 MACHINE_END

This change is not needed, the debug_ll_io_init function is used by default if no other map_io callback is specified.

Arnd

maintainer
#8 lore raw

Re: [PATCH 5/8] irqchip: Conexant CX92755 interrupts controller driver

In reply to Baruch Siach
Quoted 10 lines · On Tuesday 23 December 2014 09:58:42 Baruch Siach wrote:
drivers/irqchip/irq-digicolor.c new file +9 -0
+static void __exception_irq_entry digicolor_handle_irq(struct pt_regs *regs)
+{
+       u32 status, hwirq;
+
+       do {
+               status = readl(digicolor_irq_base + IC_INT0STATUS_LO);
+               if (status) {
+                       hwirq = ffs(status) - 1;
+               } else {

drivers/irqchip/irq-digicolor.c line 52

Quoted 10 lines
drivers/irqchip/irq-digicolor.c new file +10 -0
+                       status = readl(digicolor_irq_base + IC_INT0STATUS_XLO);
+                       if (status)
+                               hwirq = ffs(status) - 1 + 32;
+                       else
+                               return;
+               }
+
+               handle_domain_irq(digicolor_irq_domain, hwirq, regs);
+       } while (1);
+}

Have you tried using the generic_irqchip code for this? The hardware seems simple enough.

Arnd

maintainer
#13 lore raw
In reply to Baruch Siach
Quoted 7 lines · On Tuesday 23 December 2014 09:58:37 Baruch Siach wrote:

This series adds initial support for the Conexant CX92755 SoC. The CX92755 is one of the Digicolor series of SoCs, all sharing many of the same peripherals. The code was tested on the CX92755 evaluation kit, AKA Equinox.

Uses attempting to try this code will most likely also want the UART/console driver available from https://patchwork.kernel.org/patch/5515861/.

Looks very nice overall!

I have replied to two of the patches, the rest looks fine to me.

Arnd

author maintainer
#4 lore raw

Re: [PATCH 2/8] ARM: digicolor: add low level debug support

In reply to Arnd Bergmann

Hi Arnd,

Quoted 11 lines · Arnd Bergmann

arch/arm/mach-digicolor/digicolor.c static const char *digicolor_dt_compat[] __initconst = { · line 19

Quoted 7 lines · On Tuesday 23 December 2014 09:58:39 Baruch Siach wrote:
arch/arm/mach-digicolor/digicolor.c +1 -0
@@ -14,5 +14,6 @@ static const char *digicolor_dt_compat[] __initconst = {
 };
 
 DT_MACHINE_START(DIGICOLOR, "Conexant Digicolor (Flattened Device Tree)")
+       .map_io         = debug_ll_io_init,
        .dt_compat      = digicolor_dt_compat,
 MACHINE_END

This change is not needed, the debug_ll_io_init function is used by default if no other map_io callback is specified.

OK. I'll remove it for next version.

Thanks,
baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
author maintainer
#9 lore raw

Re: [PATCH 5/8] irqchip: Conexant CX92755 interrupts controller driver

In reply to Arnd Bergmann

Hi Arnd,

Quoted 16 lines · Arnd Bergmann
Quoted 15 lines · On Tuesday 23 December 2014 09:58:42 Baruch Siach wrote:
drivers/irqchip/irq-digicolor.c new file +15 -0
+static void __exception_irq_entry digicolor_handle_irq(struct pt_regs *regs)
+{
+       u32 status, hwirq;
+
+       do {
+               status = readl(digicolor_irq_base + IC_INT0STATUS_LO);
+               if (status) {
+                       hwirq = ffs(status) - 1;
+               } else {
+                       status = readl(digicolor_irq_base + IC_INT0STATUS_XLO);
+                       if (status)
+                               hwirq = ffs(status) - 1 + 32;
+                       else
+                               return;
+               }
Quoted 8 lines

drivers/irqchip/irq-digicolor.c line 52

Quoted 5 lines
drivers/irqchip/irq-digicolor.c new file +4 -0
+
+               handle_domain_irq(digicolor_irq_domain, hwirq, regs);
+       } while (1);
+}

Have you tried using the generic_irqchip code for this? The hardware seems simple enough.

Thanks for the tip. I'll look into converting to GENERIC_IRQ_CHIP for next version.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -