ARM: Add support for Cortina Systems CS75xx and Securifi Almond+
Subsystems (5)
v7 cover ARM: Add support for Cortina Systems CS75xx and Securifi Almond+
This series adds initial support for the Cortina Systems CS75xx ("Goldengate G2") network processors and the first board using one, the Securifi Almond+ touchscreen Wi-Fi router (CS7542, 2x Cortex-A9 r2p1, PL310 r3p1, 512 MiB DDR3, 512 MiB NAND).
There is no public documentation for the SoC. The register information comes from the GPL vendor kernels (Linux 2.6.36 for the Almond+, Linux 4.9 for the Verizon FiOS G1100 which uses the same SoC) and from disassembly of the stock U-Boot 2009.11. A full out-of-tree port (clock, irqchip, GPIO, I2C, RTC, NAND, PCIe, MDIO and the packet engine) runs on Linux 6.18 in OpenWrt; this series is the first, minimal step to get the platform into mainline:
- bindings: vendor prefix, SoC/board compatibles, an SMP enable method and the UART,
- the platform Kconfig and SMP bring-up (the generic DT machine is used, there is no DT_MACHINE_START),
- DEBUG_LL for UART0,
- a UART driver with console and earlycon support,
- SoC dtsi and board dts describing the CPUs, GIC, SCU, timers, L2, UARTs and memory,
- multi_v7_defconfig and MAINTAINERS updates.
The serial binding and driver (patches 6-7) are meant to go through the soc tree together with the rest of the series rather than through the tty tree, with an Ack from the tty maintainers.
Testing: build tested with multi_v7_defconfig (GCC 14 and Clang 21, W=1) and checked with dt_binding_check/dtbs_check. On a Securifi Almond+ this series boots v7.4-rc1 to an initramfs shell with both CPUs online ("smp: Brought up 1 node, 2 CPUs"; IPIs and the TWD timer tick on both cores); the L2C-310, the global and TWD timers and the UART driver (ttyCS0) come up. The kernel was started from a running OpenWrt system with a small kexec-style loader rather than from the stock U-Boot, because U-Boot enters the kernel with the MMU on (see 2 below). The same patches on Linux 6.18 in OpenWrt, with the head.S workaround from 2, also boot from NAND through the stock U-Boot; that is how the secondary CPU wake-up fix in v4 was found.
Open questions:
1. The stock U-Boot arms the CPU0 private (TWD) watchdog before starting the kernel; without a driver the board resets after ~300 seconds. The OpenWrt port disarms it in init_early, which I did not want to propose here. Instead, a driver for "arm,cortex-a9-twd-wdt" (the binding exists, but there is currently no driver for it) that takes over the running watchdog on all CPUs is written and tested on this board and posted on its own to the watchdog list, together with a restart handler (this series has no way to restart the SoC). Until it is merged, this series on its own boots but resets after ~5 minutes.
Is a TWD watchdog driver the preferred way to deal with this?
2. The same U-Boot enters the kernel with the MMU and data cache enabled (identity map with XN set, dirty lines left in the D-cache), which breaks the decompressor. The OpenWrt port carries a small workaround at the start of arch/arm/boot/compressed/head.S that cleans the cache and turns the MMU off. It is not part of this series. Replacing the bootloader is possible but risky for users of this (discontinued) device. Would a quirk of that kind be acceptable in head.S at all, or should this be solved outside the kernel (e.g. a chain-loaded bootloader)? For the tests below the kernel was started from a running Linux with the MMU off, so this was not an issue.
3. The APB clock is 100, 150 or 170 MHz depending on the boot strap pins. It is modelled as a fixed-clock with the rate set in the board dts. A clock driver for the global control block, which also contains the strap, pinmux and reset registers, will follow and replace it.
4. The Cortex-A9 r2p1 is also affected by errata 742230, 742231, 743622 and 751472, whose workarounds are not available on multiplatform kernels because they are expected to be applied by the bootloader. The stock U-Boot does not apply them. Is there a preferred way to deal with this?
5. The UART ports are named ttyCS to avoid clashing with the 8250 driver in multi_v7_defconfig, and PORT_GENERIC is used instead of a new port type. The FIFO depth is not documented; the driver assumes 16.
6. The top 64 MiB of RAM are reserved: the vendor firmware gives them to the packet engine queue manager and the stock kernel is booted with mem=448M. The reservation will be referenced by the network driver later; I kept it now so that the memory is not handed out and later claimed.
Planned follow-ups, as separate series: the peripheral interrupt controller, GPIO and I2C drivers (posted separately, one series per subsystem, with their device tree nodes to follow once this series is merged), the TWD watchdog (posted separately), then the global control block/clock, RTC, NAND,
PCIe (DesignWare glue), MDIO, the Ethernet/packet engine and a fix for the SX8650 touchscreen.
---
Changes in v7:
- rebase on v7.4-rc1
- cpus binding: the boot loader parks the secondary core in a WFI loop that polls the release register, not in a WFE loop
- goldengate: drop Linus' Reviewed-by, the patch changed in v4 and v5 (wakeup IPI for the secondary core, PL310 erratum 769419); Linus, could you have another look?
- board dts: drop the ramoops region, it is only useful for development
- cover: the serial patches go with the rest of the series, not through the tty tree on their own (Krzysztof)
- move Signed-off-by after the other trailers
- collect Reviewed-by tags
- Link to v6: https://patch.msgid.link/[email protected]
Changes in v6:
- serial: also ignore overruns when CREAD is cleared, everything received is dropped then (sashiko-bot)
- Link to v5: https://patch.msgid.link/[email protected]
Changes in v5:
- goldengate: select PL310_ERRATA_769419, the PL310 is r3p1-50rel0 (CACHE_ID 0x410000c7), not r3p2 as v4 said; fix the revision in the commit message and here
- serial: scale the TX FIFO wait in putchar with the frame time, 10 ms is shorter than one character below 1200 baud (sashiko-bot)
- serial: no change for the other two sashiko-bot points on v4:
uart_port_tx() checks tx_ready before it sends x_char, and SysRq is reachable through MAGIC_SYSRQ_SERIAL_SEQUENCE; the UART has no break indication that the driver could use
- Link to v4: https://patch.msgid.link/[email protected]
Changes in v4:
- serial: use guard()/scoped_guard() for the port lock and the port table mutex (Jiri Slaby)
- serial: honour INPCK/IGNPAR: report parity and framing errors with TTY_PARITY/TTY_FRAME and insert the overrun marker after the characters still in the FIFO (sashiko-bot)
- goldengate: also send a wakeup IPI to the secondary core: the stock U-Boot parks it in WFI, SEV alone only worked when it was parked by another kernel (found booting from NAND instead of from RAM); the change is small, I kept Linus' Reviewed-by
- drop the RFC prefix
- Link to v3: https://patch.msgid.link/[email protected]
Changes in v3:
- serial: do not put the console setup callback in .init.text, it is called from a probe that may be deferred past boot (sashiko-bot)
- collect Reviewed-by tags
- Link to v2: https://patch.msgid.link/[email protected]
Changes in v2:
- serial: drop the empty break_ctl, request_port and release_port callbacks, comment why set_mctrl stays, add a copyright line (Greg)
- serial: take the port lock around all IE accesses in startup, flush stale RX data on startup and disable the receiver on shutdown
- serial: bound the RX loop per interrupt, check RXDAT_VALID in poll_get_char, scale the console TX drain timeout with the frame time
- serial: serialise port index allocation, reject too low clock rates
- serial: name the driver after the vendor (cortina-uart.c, SERIAL_CORTINA), as the same block is used in the Cortina Access SoCs (Linus Walleij, Arnd Bergmann); the binding and the help text name the Cortina Systems CS75xx and Cortina Access parts (Jason Li)
- serial binding: describe the CS7542 only; other SoCs get their own compatible with "cortina,cs7542-uart" as fallback (Conor Dooley)
- debug: keep the character register intact on BE8 in senduart
- platform: move arch/arm/mach-cortina to arch/arm/mach-goldengate, as mach-gemini is a Cortina SoC too, and use one ARCH_CORTINA_ACCESS symbol for the whole family, as for the 64-bit Cortina Access parts, with the rationale in the commit message (Linus Walleij, Krzysztof Kozlowski, Arnd Bergmann); mach-goldengate vs. mach-cortina is still open, I am happy to rename the directory if mach-cortina is preferred
- collect Reviewed-by and Acked-by tags
- Link to v1: https://patch.msgid.link/[email protected]
---
Fil Dunsky (10):
dt-bindings: vendor-prefixes: Add Securifi
dt-bindings: arm: Add Cortina Systems CS7542 and Securifi Almond+
dt-bindings: arm: cpus: Add Cortina Systems CS7542 enable method
ARM: goldengate: Add support for the CS75xx SoC family
ARM: debug: Add Cortina Systems CS75xx UART0 support
dt-bindings: serial: Add Cortina Systems CS7542 UART
tty: serial: Add Cortina UART driver
ARM: dts: cortina: Add CS7542 SoC and Securifi Almond+ board
ARM: multi_v7_defconfig: Enable Cortina Systems CS75xx support
MAINTAINERS: Add entry for Cortina Systems CS75xx
Documentation/devicetree/bindings/arm/cortina.yaml | 31 ++ Documentation/devicetree/bindings/arm/cpus.yaml | 2 + .../bindings/serial/cortina,cs7542-uart.yaml | 52 ++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 11 + arch/arm/Kconfig | 2 + arch/arm/Kconfig.debug | 16 +- arch/arm/Makefile | 1 + arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/cortina/Makefile | 3 + .../dts/cortina/cs7542-securifi-almondplus.dts | 46 ++ arch/arm/boot/dts/cortina/cs7542.dtsi | 127 +++++ arch/arm/configs/multi_v7_defconfig | 3 + arch/arm/include/debug/cs75xx.S | 37 ++ arch/arm/mach-goldengate/Kconfig | 19 + arch/arm/mach-goldengate/Makefile | 2 + arch/arm/mach-goldengate/platsmp.c | 72 +++ drivers/tty/serial/Kconfig | 24 + drivers/tty/serial/Makefile | 1 + drivers/tty/serial/cortina-uart.c | 601 +++++++++++++++++++++ 20 files changed, 1051 insertions(+), 2 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20260930-b4-cs75xx-033a2c047508
Best regards,
Signature · 1 line
Fil Dunsky <[email protected]>
PATCH v7 1/10 dt-bindings: vendor-prefixes: Add Securifi
Securifi Ltd. makes the Almond series of touchscreen Wi-Fi routers. Add a vendor prefix for it.
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -1499,6 +1499,8 @@ patternProperties: description: SDMC Technology Co., Ltd "^seagate,.*": description: Seagate Technology PLC + "^securifi,.*": + description: Securifi Ltd. "^seeed,.*": description: Seeed Technology Co., Ltd "^seirobotics,.*":
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v7 01/10] dt-bindings: vendor-prefixes: Add Securifi
Sashiko has reviewed this patch and found no issues.
Quoted 8 lines
From: Fil Dunsky <[email protected]>
Securifi Ltd. makes the Almond series of touchscreen Wi-Fi routers. Add a vendor prefix for it.
Reviewed-by Linus Walleij <[email protected]>Acked-by Conor Dooley <[email protected]>Signed-off-by Fil Dunsky <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v7 2/10 dt-bindings: arm: Add Cortina Systems CS7542 and Securifi Almond+
In reply to Fil DunskyAdd the top-level binding for boards built around the Cortina Systems CS7542 ("Goldengate G2") network processor, a dual Cortex-A9 SoC, and the first such board, the Securifi Almond+ touchscreen router.
--- Documentation/devicetree/bindings/arm/cortina.yaml | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+)
Documentation/devicetree/bindings/arm/cortina.yaml new file +31 -0
@@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/cortina.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Cortina Systems CS75xx platforms + +maintainers: + - Fil Dunsky <[email protected]> + +description: + The CS75xx ("Goldengate G2") family are network processors from Cortina + Systems. The CS7542 has two Cortex-A9 cores with an SCU, GIC, private + timers and a PL310 L2 cache controller, a packet processing engine, three + PCIe root ports, a NAND flash controller and low speed peripherals. + +properties: + $nodename: + const: '/' + compatible: + oneOf: + - description: CS7542 based boards + items: + - enum: + - securifi,almondplus + - const: cortina,cs7542 + +additionalProperties: true + +...
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v7 02/10] dt-bindings: arm: Add Cortina Systems CS7542 and Securifi Almond+
Sashiko has reviewed this patch and found no issues.
Quoted 9 lines
From: Fil Dunsky <[email protected]>
Add the top-level binding for boards built around the Cortina Systems CS7542 ("Goldengate G2") network processor, a dual Cortex-A9 SoC, and the first such board, the Securifi Almond+ touchscreen router.
Reviewed-by Linus Walleij <[email protected]>Acked-by Conor Dooley <[email protected]>Signed-off-by Fil Dunsky <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
PATCH v7 3/10 dt-bindings: arm: cpus: Add Cortina Systems CS7542 enable method
In reply to Fil DunskyOn the CS7542 the bootloader parks the secondary Cortex-A9 core in a WFI loop that polls a global software register and jumps to the address found there. Add the "cortina,cs7542-smp" enable method for it and, as with the other release-address based methods, require cpu-release-addr to point at that register.
--- Documentation/devicetree/bindings/arm/cpus.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/arm/cpus.yaml +2 -0
@@ -269,6 +269,7 @@ properties: - brcm,bcm63138 - brcm,bcm-nsp-smp - brcm,brahma-b15 + - cortina,cs7542-smp - marvell,armada-375-smp - marvell,armada-380-smp - marvell,armada-390-smp
@@ -484,6 +485,7 @@ allOf: enable-method: enum: - spin-table + - cortina,cs7542-smp - renesas,r9a06g032-smp required: - enable-method
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v7 03/10] dt-bindings: arm: cpus: Add Cortina Systems CS7542 enable method
Sashiko has reviewed this patch and found no issues.
Quoted 11 lines
From: Fil Dunsky <[email protected]>
On the CS7542 the bootloader parks the secondary Cortex-A9 core in a WFI loop that polls a global software register and jumps to the address found there. Add the "cortina,cs7542-smp" enable method for it and, as with the other release-address based methods, require cpu-release-addr to point at that register.
Reviewed-by Linus Walleij <[email protected]>Signed-off-by Fil Dunsky <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
PATCH v7 4/10 ARM: goldengate: Add support for the CS75xx SoC family
In reply to Fil DunskyThe Cortina Systems CS75xx ("Goldengate G2") are network processors with two Cortex-A9 cores, an SCU, GIC, the Cortex-A9 global and private timers and a PL310 L2 cache controller. The family includes at least the CS7522 and the CS7542; the CS7542 is used, among others, in the Securifi Almond+ router.
Apart from the vendor this has little in common with the Cortina Systems Gemini (SL3516/CS3516) supported by mach-gemini: Gemini is a single ARMv4 FA526 with Faraday peripherals (FTINTC010, FTTMR010, FTGPIO010, a 16550 UART) built for ARCH_MULTI_V4, while the CS75xx is an ARMv7 MPCore whose UART, GPIO, interrupt controller and NAND controller are different blocks. It therefore gets its own directory, named after the Goldengate codename like in the vendor kernel. The Kconfig symbol, ARCH_CORTINA_ACCESS, covers the whole family and is named after Cortina Access, which last sold these chips and also makes the newer 64-bit parts.
The generic DT machine is sufficient for the platform, so only the SMP bring-up needs code: the bootloader parks the secondary core in a WFI loop that polls a global software register, so boot it by writing the physical address of secondary_startup to the register named by the cpu-release-addr property and sending it a wakeup IPI.
The CPU is a Cortex-A9 r2p1, so select the errata workarounds that apply to that revision and can be enabled on a multiplatform kernel. The PL310 is r3p1-50rel0 (CACHE_ID 0x410000c7), select the workaround for its erratum 769419 as well.
--- arch/arm/Kconfig | 2 ++ arch/arm/Makefile | 1 + arch/arm/mach-goldengate/Kconfig | 19 ++++++++++ arch/arm/mach-goldengate/Makefile | 2 ++ arch/arm/mach-goldengate/platsmp.c | 72 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 96 insertions(+)
arch/arm/Kconfig +2 -0
@@ -391,6 +391,8 @@ source "arch/arm/mach-footbridge/Kconfig" source "arch/arm/mach-gemini/Kconfig" +source "arch/arm/mach-goldengate/Kconfig" + source "arch/arm/mach-highbank/Kconfig" source "arch/arm/mach-hisi/Kconfig"
arch/arm/Makefile +1 -0
@@ -187,6 +187,7 @@ machine-$(CONFIG_ARCH_DOVE) += dove machine-$(CONFIG_ARCH_EXYNOS) += exynos machine-$(CONFIG_ARCH_FOOTBRIDGE) += footbridge machine-$(CONFIG_ARCH_GEMINI) += gemini +machine-$(CONFIG_ARCH_CORTINA_ACCESS) += goldengate machine-$(CONFIG_ARCH_HIGHBANK) += highbank machine-$(CONFIG_ARCH_HISI) += hisi machine-$(CONFIG_ARCH_IXP4XX) += ixp4xx
arch/arm/mach-goldengate/Kconfig new file +19 -0
@@ -0,0 +1,19 @@ +# SPDX-License-Identifier: GPL-2.0-only +config ARCH_CORTINA_ACCESS + bool "Cortina Systems CS75xx (Goldengate G2)" + depends on ARCH_MULTI_V7 + select ARM_ERRATA_754322 + select ARM_ERRATA_764369 if SMP + select ARM_GIC + select ARM_GLOBAL_TIMER + select CACHE_L2X0 + select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK + select HAVE_ARM_SCU if SMP + select HAVE_ARM_TWD if SMP + select PL310_ERRATA_769419 + help + Support for the Cortina Systems CS75xx (Goldengate G2) family of + network processors, such as the CS7542 used in the Securifi + Almond+ router. These SoCs have two Cortex-A9 cores with a PL310 + L2 cache controller, a packet processing engine, PCIe, NAND and + the usual low speed peripherals.
arch/arm/mach-goldengate/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_SMP) += platsmp.o
arch/arm/mach-goldengate/platsmp.c new file +72 -0
72 lines not on this page · raw message
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v7 04/10] ARM: goldengate: Add support for the CS75xx SoC family
Sashiko has reviewed this patch and found no issues.
Quoted 20 lines
From: Fil Dunsky <[email protected]>
The Cortina Systems CS75xx ("Goldengate G2") are network processors with two Cortex-A9 cores, an SCU, GIC, the Cortex-A9 global and private timers and a PL310 L2 cache controller. The family includes at least the CS7522 and the CS7542; the CS7542 is used, among others, in the Securifi Almond+ router.
Apart from the vendor this has little in common with the Cortina Systems Gemini (SL3516/CS3516) supported by mach-gemini: Gemini is a single ARMv4 FA526 with Faraday peripherals (FTINTC010, FTTMR010, FTGPIO010, a 16550 UART) built for
ARCH_MULTI_V4, while the CS75xx is an ARMv7 MPCore whose UART, GPIO, interrupt controller and NAND controller are different blocks. It therefore gets its own directory, named after the Goldengate codename like in the vendor kernel. The [ ... ]
to that revision and can be enabled on a multiplatform kernel. The PL310 is r3p1-50rel0 (CACHE_ID0x410000c7), select the workaround for its erratum 769419 as well.
Quoted 1 line
Signed-off-by Fil Dunsky <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
Re: [PATCH v7 04/10] ARM: goldengate: Add support for the CS75xx SoC family
In reply to Fil DunskyQuoted 25 lines · On Sat, Nov 14, 2026 at 2:41 PM Fil Dunsky via B4 Relay…
From: Fil Dunsky <[email protected]>
The Cortina Systems CS75xx ("Goldengate G2") are network processors with two Cortex-A9 cores, an SCU, GIC, the Cortex-A9 global and private timers and a PL310 L2 cache controller. The family includes at least the CS7522 and the CS7542; the CS7542 is used, among others, in the Securifi Almond+ router.
Apart from the vendor this has little in common with the Cortina Systems Gemini (SL3516/CS3516) supported by mach-gemini: Gemini is a single ARMv4 FA526 with Faraday peripherals (FTINTC010, FTTMR010, FTGPIO010, a 16550 UART) built for
ARCH_MULTI_V4, while the CS75xx is an ARMv7 MPCore whose UART, GPIO, interrupt controller and NAND controller are different blocks. It therefore gets its own directory, named after the Goldengate codename like in the vendor kernel. TheKconfigsymbol,ARCH_CORTINA_ACCESS, covers the whole family and is named after Cortina Access, which last sold these chips and also makes the newer 64-bit parts.The generic DT machine is sufficient for the platform, so only the SMP bring-up needs code: the bootloader parks the secondary core in a WFI loop that polls a global software register, so boot it by writing the physical address of
secondary_startupto the register named by the cpu-release-addr property and sending it a wakeup IPI.
Quoted 6 lines
The CPU is a Cortex-A9 r2p1, so select the errata workarounds that apply to that revision and can be enabled on a multiplatform kernel. The PL310 is r3p1-50rel0 (
CACHE_ID0x410000c7), select the workaround for its erratum 769419 as well.Signed-off-by Fil Dunsky <[email protected]>
Looks good to me.
Yours,
Linus Walleij
PATCH v7 5/10 ARM: debug: Add Cortina Systems CS75xx UART0 support
In reply to Fil DunskyAdd low-level debug output through UART0 of the Cortina Systems CS75xx SoCs. The UART is mapped at a fixed virtual address by the generic debug_ll_io_init(), so no platform map_io is needed.
--- arch/arm/Kconfig.debug | 16 ++++++++++++++-- arch/arm/include/debug/cs75xx.S | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-)
arch/arm/Kconfig.debug +14 -2
@@ -308,6 +308,15 @@ choice Say Y here if you want the debug print routines to direct their output to the second serial port on these devices. + config DEBUG_CS75XX_UART0 + bool "Kernel low-level debugging messages via CS75xx UART0" + depends on ARCH_CORTINA_ACCESS + help + Say Y here if you want the debug print routines to direct + their output to UART0 of Cortina Systems CS75xx SoCs. This + is the console port on the Securifi Almond+. The UART is + expected to be set up by the bootloader. + config DEBUG_DAVINCI_DA8XX_UART1 bool "Kernel low-level debugging on DaVinci DA8XX using UART1" depends on ARCH_DAVINCI_DA8XX
@@ -1531,6 +1540,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_BCM63XX_UART || DEBUG_BCMBCA + default "debug/cs75xx.S" if DEBUG_CS75XX_UART0 default "debug/digicolor.S" if DEBUG_DIGICOLOR_UA0 default "debug/brcmstb.S" if DEBUG_BRCMSTB_UART default "mach/debug-macro.S"
@@ -1632,6 +1642,7 @@ config DEBUG_UART_PHYS default 0xe8008000 if DEBUG_R7S72100_SCIF2 || DEBUG_R7S9210_SCIF2 default 0xe8009000 if DEBUG_R7S9210_SCIF4 default 0xf0000000 if DEBUG_DIGICOLOR_UA0 + default 0xf0070110 if DEBUG_CS75XX_UART0 default 0xf1012000 if DEBUG_MVEBU_UART0_ALTERNATE default 0xf1012100 if DEBUG_MVEBU_UART1_ALTERNATE default 0xf7fc9000 if DEBUG_BERLIN_UART
@@ -1670,7 +1681,7 @@ config DEBUG_UART_PHYS DEBUG_RMOBILE_SCIFA4 || \ DEBUG_S3C64XX_UART || \ DEBUG_BCM63XX_UART || DEBUG_BCMBCA || DEBUG_ASM9260_UART || \ - DEBUG_DIGICOLOR_UA0 || \ + DEBUG_CS75XX_UART0 || DEBUG_DIGICOLOR_UA0 || \ DEBUG_AT91_UART || DEBUG_STM32_UART || \ DEBUG_STIH41X_ASC2 || DEBUG_STIH41X_SBC_ASC1 || \ DEBUG_STIH418_SBC_ASC0
@@ -1708,6 +1719,7 @@ config DEBUG_UART_VIRT default 0xf7000800 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART2 default 0xf7000c00 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART3 default 0xf7020000 if DEBUG_AT91_SAMA5D2_UART1 + default 0xf7070110 if DEBUG_CS75XX_UART0 default 0xf7fc9000 if DEBUG_BERLIN_UART default 0xf8007000 if DEBUG_HIP04_UART default 0xf8009000 if DEBUG_VEXPRESS_UART0_CA9
@@ -1772,7 +1784,7 @@ config DEBUG_UART_VIRT DEBUG_QCOM_UARTDM || \ DEBUG_S3C64XX_UART || \ DEBUG_BCM63XX_UART || DEBUG_BCMBCA || DEBUG_ASM9260_UART || \ - DEBUG_DIGICOLOR_UA0 || \ + DEBUG_CS75XX_UART0 || DEBUG_DIGICOLOR_UA0 || \ DEBUG_AT91_UART || DEBUG_STM32_UART || \ DEBUG_STIH41X_ASC2 || DEBUG_STIH41X_SBC_ASC1 || \ DEBUG_STIH418_SBC_ASC0
arch/arm/include/debug/cs75xx.S new file +37 -0
@@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Debugging macro include header for the Cortina Systems CS75xx UART + */ + +#define CS75XX_UART_TXDAT 0x10 +#define CS75XX_UART_INFO 0x18 +#define CS75XX_UART_INFO_TX_FULL (1 << 2) +#define CS75XX_UART_INFO_TX_EMPTY (1 << 3) + + .macro addruart, rp, rv, tmp + ldr \rp, =CONFIG_DEBUG_UART_PHYS + ldr \rv, =CONFIG_DEBUG_UART_VIRT + .endm + + .macro senduart, rd, rx + ARM_BE8(rev \rd, \rd) + str \rd, [\rx, #CS75XX_UART_TXDAT] + ARM_BE8(rev \rd, \rd) + .endm + + .macro waituartcts, rd, rx + .endm + + .macro waituarttxrdy, rd, rx +1001: ldr \rd, [\rx, #CS75XX_UART_INFO] + ARM_BE8(rev \rd, \rd) + tst \rd, #CS75XX_UART_INFO_TX_FULL + bne 1001b + .endm + + .macro busyuart, rd, rx +1002: ldr \rd, [\rx, #CS75XX_UART_INFO] + ARM_BE8(rev \rd, \rd) + tst \rd, #CS75XX_UART_INFO_TX_EMPTY + beq 1002b + .endm
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v7 05/10] ARM: debug: Add Cortina Systems CS75xx UART0 support
Sashiko has reviewed this patch and found no issues.
Quoted 8 lines
From: Fil Dunsky <[email protected]>
Add low-level debug output through UART0 of the Cortina Systems CS75xx SoCs. The UART is mapped at a fixed virtual address by the generic
debug_ll_io_init(), so no platformmap_iois needed.Reviewed-by Linus Walleij <[email protected]>Signed-off-by Fil Dunsky <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
PATCH v7 6/10 dt-bindings: serial: Add Cortina Systems CS7542 UART
In reply to Fil DunskyAdd the binding for the UART found in the Cortina Systems CS75xx (Goldengate G2) SoCs such as the CS7542.
--- .../bindings/serial/cortina,cs7542-uart.yaml | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+)
Documentation/devicetree/bindings/serial/cortina,cs7542-uart.yaml new file +52 -0
@@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/serial/cortina,cs7542-uart.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Cortina UART + +maintainers: + - Fil Dunsky <[email protected]> + +description: + The UART found in the Cortina Systems CS7542 (Goldengate G2) SoC. It has + transmit and receive FIFOs and a 24-bit baud rate divider running from the + peripheral (APB) clock. Other SoCs with the same block, the rest of the + CS75xx family and the Cortina Access parts, are to be added with their own + compatible string and "cortina,cs7542-uart" as the fallback. + +allOf: + - $ref: serial.yaml# + +properties: + compatible: + const: cortina,cs7542-uart + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - clocks + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + serial@f0070110 { + compatible = "cortina,cs7542-uart"; + reg = <0xf0070110 0x30>; + interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&apb_clk>; + };
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v7 06/10] dt-bindings: serial: Add Cortina Systems CS7542 UART
Sashiko has reviewed this patch and found no issues.
Quoted 8 lines
From: Fil Dunsky <[email protected]>
Add the binding for the UART found in the Cortina Systems CS75xx (Goldengate G2) SoCs such as the CS7542.
Reviewed-by Linus Walleij <[email protected]>Reviewed-by Krzysztof Kozlowski <[email protected]>Signed-off-by Fil Dunsky <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
PATCH v7 7/10 tty: serial: Add Cortina UART driver
In reply to Fil DunskyAdd a driver for the UART found in Cortina SoCs, starting with the Cortina Systems CS75xx (Goldengate G2) family such as the CS7542. The block has transmit and receive FIFOs with full/empty status, a 24-bit baud rate divider clocked from the peripheral (APB) clock, a receive sampling point register and one interrupt line per port with per-cause enable and write-one-to-clear status registers.
The same block, with an additional flow control register and a few more interrupt causes, is used in the Cortina Access CAxxxx SoCs, which were briefly supported by commit b61c8bf4694b ("tty: serial: Add UART driver for Cortina-Access platform") before it was removed again. The driver is therefore named after the vendor rather than one SoC, so that those parts can be added with their own compatible strings.
The driver is a rewrite of the vendor driver shipped with the Linux 2.6.36 and 4.9 based vendor kernels, using the current serial core API (uart_port_tx(), port lock helpers, deferred sysrq handling) and devm resource management. It supports the system console and earlycon. Hardware flow control is not supported.
The ports are named ttyCS so that the driver can coexist with the 8250 driver in multiplatform kernels, where the 8250 core registers ttyS0 and up even without any 8250 hardware, and PORT_GENERIC is used rather than allocating a new port type.
--- drivers/tty/serial/Kconfig | 24 ++ drivers/tty/serial/Makefile | 1 + drivers/tty/serial/cortina-uart.c | 601 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 626 insertions(+)
drivers/tty/serial/Kconfig +24 -0
@@ -1359,6 +1359,30 @@ config SERIAL_CONEXANT_DIGICOLOR_CONSOLE If you have enabled the USART serial port on Conexant Digicolor SoCs, you can make it the console by answering Y to this option. +config SERIAL_CORTINA + tristate "Cortina UART support" + depends on ARCH_CORTINA_ACCESS || COMPILE_TEST + depends on OF + select SERIAL_CORE + help + Support for the on-chip UART of Cortina Systems CS75xx + (Goldengate G2) SoCs such as the CS7542. Cortina Access SoCs use + the same UART. The ports are named ttyCS0 to ttyCS3. + + To compile this driver as a module, choose M here: the module + will be called cortina-uart. + +config SERIAL_CORTINA_CONSOLE + bool "Console on Cortina UART" + depends on SERIAL_CORTINA=y + select SERIAL_CORE_CONSOLE + select SERIAL_EARLYCON + help + Say Y here to use a Cortina UART as the system + console. This also enables the early console, which can be + selected with "earlycon" on the kernel command line when the + device tree chosen node has a stdout-path pointing at the UART. + config SERIAL_ST_ASC tristate "ST ASC serial port support" select SERIAL_CORE
drivers/tty/serial/Makefile +1 -0
@@ -36,6 +36,7 @@ obj-$(CONFIG_SERIAL_BCM63XX) += bcm63xx_uart.o obj-$(CONFIG_SERIAL_CLPS711X) += clps711x.o obj-$(CONFIG_SERIAL_CPM) += cpm_uart.o obj-$(CONFIG_SERIAL_CONEXANT_DIGICOLOR) += digicolor-usart.o +obj-$(CONFIG_SERIAL_CORTINA) += cortina-uart.o obj-$(CONFIG_SERIAL_DZ) += dz.o obj-$(CONFIG_SERIAL_FSL_LINFLEXUART) += fsl_linflexuart.o obj-$(CONFIG_SERIAL_FSL_LPUART) += fsl_lpuart.o
drivers/tty/serial/cortina-uart.c new file +601 -0
601 lines not on this page · raw message
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v7 07/10] tty: serial: Add Cortina UART driver
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] tty: serial: cortina-uart: missing uart_handle_break() breaks SysRq - [Medium] tty: serial…
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [Medium] tty: serial: cortina-uart: missing uart_handle_break() breaks SysRq
- [Medium] tty: serial: cortina-uart: unconditional RX/TX handling in cortina_uart_isr()
--
commit b5b5d422d0304117c1e8a78b6129aa1a61ffa2ba
Author: Fil Dunsky <[email protected]>
tty: serial: Add Cortina UART driver
This commit adds a serial driver for the UART found in Cortina Systems CS75xx (Goldengate G2) SoCs, with system console and earlycon support.
Quoted 5 lines
drivers/tty/serial/cortina-uart.c new file +0
-0
[ ... ]
Quoted 60 lines
drivers/tty/serial/cortina-uart.c new file +60
-0+static void cortina_uart_tx_chars (struct uart_port *port) +{ +u8 ch; + +uart_port_tx (port, ch, + !(readl (port->membase +CORTINA_UART_INFO ) & +CORTINA_UART_INFO_TX_FULL ), +writel (ch, port->membase +CORTINA_UART_TXDAT )); +} + +static void cortina_uart_start_tx (struct uart_port *port) +{ +cortina_uart_ie_update (port,0 ,CORTINA_UART_IRQ_TX_EMPTY ); + +/* +* The TX empty interrupt only fires when the FIFO drains, so prime +* the FIFO here. +*/ +cortina_uart_tx_chars (port); +} + +static void cortina_uart_stop_rx (struct uart_port *port) +{ +cortina_uart_ie_update (port,CORTINA_UART_IRQ_RX_NONEMPTY ,0 ); +} + +static void cortina_uart_rx_chars (struct uart_port *port,u32 status) +{ +struct tty_port *tport = &port->state->port; +unsigned int budget =CORTINA_UART_RX_BUDGET ; +u32 data, err; + +if (status &CORTINA_UART_IRQ_RX_OVERRUN ) + port->icount.overrun++; +if (status &CORTINA_UART_IRQ_RX_PARITY ) + port->icount.parity++; +if (status &CORTINA_UART_IRQ_RX_STOP ) + port->icount.frame++; + +/* +* The parity and framing error status is only latched in the interrupt +* register, not per character, so charge it to the first character +* read in this pass. +*/ + err = status & port->read_status_mask &CORTINA_UART_IRQ_RX_ERR ; + +while (budget-- && !(readl (port->membase +CORTINA_UART_INFO ) & +CORTINA_UART_INFO_RX_EMPTY )) { +u8 ch, flag =TTY_NORMAL ; +u32 ch_err = err; + + data =readl (port->membase +CORTINA_UART_RXDAT ); +if (!(data &CORTINA_UART_RXDAT_VALID )) +continue ; + + port->icount.rx++; + ch =FIELD_GET (CORTINA_UART_RXDAT_DATA , data); + err =0 ; + +if (port->ignore_status_mask &CORTINA_UART_RXDAT_VALID )
drivers/tty/serial/cortina-uart.c line 189
Quoted 10 lines
drivers/tty/serial/cortina-uart.c new file +10
-0+continue ; +if (ch_err & port->ignore_status_mask) +continue ; + +if (ch_err &CORTINA_UART_IRQ_RX_PARITY ) + flag =TTY_PARITY ; +else if (ch_err &CORTINA_UART_IRQ_RX_STOP ) + flag =TTY_FRAME ; +else if (uart_prepare_sysrq_char (port, ch)) +continue ;
[Severity: Medium]
Can uart_prepare_sysrq_char() ever succeed without a call to uart_handle_break()?
uart_prepare_sysrq_char() checks port->sysrq, which is only armed by uart_handle_break(). Because nothing in the driver calls uart_handle_break() when a break is received (a NUL character with CORTINA_UART_IRQ_RX_STOP), port->sysrq stays 0 and serial SysRq and break handling never trigger. In addition, cortina_uart_set_termios() only adds CORTINA_UART_IRQ_RX_STOP to port->read_status_mask when INPCK is set, which masks stop-bit errors and breaks when INPCK is clear.
Quoted 17 lines
drivers/tty/serial/cortina-uart.c new file +17
-0+ +tty_insert_flip_char (tport, ch, flag); + } + +/* The characters left in the FIFO were received before the lost ones */ +if (status &CORTINA_UART_IRQ_RX_OVERRUN & + ~port->ignore_status_mask) +tty_insert_flip_char (tport,0 ,TTY_OVERRUN ); + +tty_flip_buffer_push (tport); +} + +static irqreturn_t cortina_uart_isr (int irq,void *dev_id) +{ +struct uart_port *port = dev_id; +u32 status; +
drivers/tty/serial/cortina-uart.c line 216
Quoted 10 lines
drivers/tty/serial/cortina-uart.c new file +10
-0+guard (uart_port_lock_check_sysrq_irqsave)(port); + + status =readl (port->membase +CORTINA_UART_INT ); +writel (status, port->membase +CORTINA_UART_INT ); + +cortina_uart_rx_chars (port, status); +cortina_uart_tx_chars (port); + +return IRQ_HANDLED ; +}
[Severity: Medium]
Should cortina_uart_isr() check which interrupt causes are active before running the RX and TX handlers?
Calling cortina_uart_tx_chars() -> uart_port_tx() on every RX interrupt when TX is idle or stopped sees pending < WAKEUP_CHARS and triggers a spurious uart_write_wakeup() and ->stop_tx() MMIO write. Likewise, calling cortina_uart_rx_chars() on a TX-only interrupt schedules flip-buffer work via tty_flip_buffer_push() even when the RX FIFO is empty, and unconditionally returning IRQ_HANDLED when status is 0 prevents the spurious IRQ detector from catching a stuck interrupt.
Also, cortina_uart_start_tx() enables CORTINA_UART_IRQ_TX_EMPTY in CORTINA_UART_IE before priming the FIFO and without clearing any stale CORTINA_UART_IRQ_TX_EMPTY bit in CORTINA_UART_INT, which immediately fires a spurious TX interrupt while the newly filled FIFO is still full.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7
PATCH v7 8/10 ARM: dts: cortina: Add CS7542 SoC and Securifi Almond+ board
In reply to Fil DunskyAdd a minimal description of the Cortina Systems CS7542 SoC: the two Cortex-A9 cores, SCU, GIC, global timer, private timer and watchdog, PL310 L2 cache controller and the four on-chip UARTs.
The peripheral clock (APB) runs at 100, 150 or 170 MHz depending on the boot strap pins. Until there is a driver for the global control block that reads the straps, model it as a fixed clock whose rate is provided by the board.
The Securifi Almond+ is a touchscreen Wi-Fi router with 512 MiB of DDR3, 512 MiB of NAND flash, a QCA8337 switch, QCA9880 and AR9580 Wi-Fi and an ASM1042 USB 3.0 controller behind the SoC PCIe root ports. For now, describe the memory and the console UART, and reserve the top 64 MiB of RAM which the vendor firmware hands to the packet engine queue manager.
--- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/cortina/Makefile | 3 + .../dts/cortina/cs7542-securifi-almondplus.dts | 46 ++++++++ arch/arm/boot/dts/cortina/cs7542.dtsi | 127 +++++++++++++++++++++ 4 files changed, 177 insertions(+)
arch/arm/boot/dts/Makefile +1 -0
@@ -12,6 +12,7 @@ subdir-y += broadcom subdir-y += calxeda subdir-y += cirrus subdir-y += cnxt +subdir-y += cortina subdir-y += gemini subdir-y += hisilicon subdir-y += hpe
arch/arm/boot/dts/cortina/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 +dtb-$(CONFIG_ARCH_CORTINA_ACCESS) += \ + cs7542-securifi-almondplus.dtb
arch/arm/boot/dts/cortina/cs7542-securifi-almondplus.dts new file +46 -0
46 lines not on this page · raw message
arch/arm/boot/dts/cortina/cs7542.dtsi new file +127 -0
127 lines not on this page · raw message
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v7 08/10] ARM: dts: cortina: Add CS7542 SoC and Securifi Almond+ board
Sashiko has reviewed this patch and found no issues.
Quoted 18 lines
From: Fil Dunsky <[email protected]>
Add a minimal description of the Cortina Systems CS7542 SoC: the two Cortex-A9 cores, SCU, GIC, global timer, private timer and watchdog, PL310 L2 cache controller and the four on-chip UARTs.
The peripheral clock (APB) runs at 100, 150 or 170 MHz depending on the boot strap pins. Until there is a driver for the global control block that reads the straps, model it as a fixed clock whose rate is provided by the board.
The Securifi Almond+ is a touchscreen Wi-Fi router with 512 MiB of DDR3, 512 MiB of NAND flash, a QCA8337 switch, QCA9880 and AR9580 Wi-Fi and an ASM1042 USB 3.0 controller behind the SoC PCIe root ports. For now, describe the memory and the console UART, and reserve the top 64 MiB of RAM which the vendor firmware hands to the packet engine queue manager.
Quoted 2 lines
Reviewed-by Linus Walleij <[email protected]>Signed-off-by Fil Dunsky <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=8
PATCH v7 9/10 ARM: multi_v7_defconfig: Enable Cortina Systems CS75xx support
In reply to Fil DunskyEnable the Cortina Systems CS75xx platform and its UART driver with console support, as used on the Securifi Almond+ router.
--- arch/arm/configs/multi_v7_defconfig | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/configs/multi_v7_defconfig +3 -0
@@ -45,6 +45,7 @@ CONFIG_MACH_BERLIN_BG2CD=y CONFIG_MACH_BERLIN_BG2Q=y CONFIG_ARCH_DIGICOLOR=y CONFIG_ARCH_EXYNOS=y +CONFIG_ARCH_CORTINA_ACCESS=y CONFIG_ARCH_HIGHBANK=y CONFIG_ARCH_HISI=y CONFIG_ARCH_HI3xxx=y
@@ -396,6 +397,8 @@ CONFIG_SERIAL_FSL_LPUART=y CONFIG_SERIAL_FSL_LPUART_CONSOLE=y CONFIG_SERIAL_CONEXANT_DIGICOLOR=y CONFIG_SERIAL_CONEXANT_DIGICOLOR_CONSOLE=y +CONFIG_SERIAL_CORTINA=y +CONFIG_SERIAL_CORTINA_CONSOLE=y CONFIG_SERIAL_ST_ASC=y CONFIG_SERIAL_ST_ASC_CONSOLE=y CONFIG_SERIAL_STM32=y
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v7 09/10] ARM: multi_v7_defconfig: Enable Cortina Systems CS75xx support
Sashiko has reviewed this patch and found no issues.
Quoted 7 lines
From: Fil Dunsky <[email protected]>
Enable the Cortina Systems CS75xx platform and its UART driver with console support, as used on the Securifi Almond+ router.
Reviewed-by Linus Walleij <[email protected]>Signed-off-by Fil Dunsky <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=9
PATCH v7 10/10 MAINTAINERS: Add entry for Cortina Systems CS75xx
In reply to Fil DunskyAdd an entry covering the Cortina Systems CS75xx platform code, device trees, bindings and UART driver.
--- MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+)
MAINTAINERS +11 -0
@@ -2950,6 +2950,17 @@ F: tools/perf/tests/shell/coresight/* F: tools/perf/util/cs-etm-decoder/* F: tools/perf/util/cs-etm.* +ARM/CORTINA SYSTEMS CS75XX ARM ARCHITECTURE +M: Fil Dunsky <[email protected]> +L: [email protected] (moderated for non-subscribers) +S: Maintained +F: Documentation/devicetree/bindings/arm/cortina.yaml +F: Documentation/devicetree/bindings/serial/cortina,cs7542-uart.yaml +F: arch/arm/boot/dts/cortina/ +F: arch/arm/include/debug/cs75xx.S +F: arch/arm/mach-goldengate/ +F: drivers/tty/serial/cortina-uart.c + ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE M: Hans Ulli Kroll <[email protected]> M: Linus Walleij <[email protected]>
Signature · 1 line
2.53.0