ARM: Initial Actions Semi S500 and S900 enablement
Subsystems (9)
Andreas Färber
maintainerv2 cover ARM: Initial Actions Semi S500 and S900 enablement
Hello,
This series adds initial support for Actions Semiconductor S500 (ARMv7) and S900 (ARMv8) SoCs.
In addition to earlycon serial output, v2 includes a serial console driver RFC. Guitar output is coming further along thanks to a new timer implementation, but is still earlycon only - to be investigated. Bubblegum-96 reaches an initrd, but a small part of the serial output just before is lost (visible in dmesg).
https://github.com/afaerber/linux/commits/bg96-next
Booting from U-Boot is straightforward on both boards:
https://en.opensuse.org/HCL:Guitar
https://en.opensuse.org/HCL:Bubblegum-96
Have a lot of fun!
Cheers,
Andreas
v1 -> v2:
* S900 DT fixes (Mark)
* Kconfig name changes (Arnd)
* Bubblegum-96 .dts rename
* Vendor prefix rename
* Minor cleanups
* Add serial driver
* Add MAINTAINERS section
* Use SPDX-License-Identifier in DT (Rob)
* Add clocksource driver
Andreas F?rber (17):
dt-bindings: Add vendor prefix for Actions Semi
dt-bindings: arm: Document Actions Semi S500
dt-bindings: timer: Document Owl timer
clocksource: Add Owl timer
ARM: Prepare Actions Semi S500
ARM64: Prepare Actions Semi S900
dt-bindings: serial: Document Actions Semi Owl UARTs
tty: serial: Add Actions Semi Owl UART earlycon
Documentation: kernel-parameters: Document owl earlycon
ARM: dts: Add Actions Semi S500 and LeMaker Guitar
dt-bindings: Add vendor prefix for uCRobotics
dt-bindings: arm: Document Actions Semi S900
ARM64: dts: Add Actions Semi S900 and Bubblegum-96
MAINTAINERS: Add Actions Semi Owl section
tty: serial: owl: Implement console driver
ARM64: dts: actions: s900-bubblegum-96: Add fake uart5 clk
ARM: dts: s500-guitar-bb-rev-b: Add fake uart3 clock
Documentation/admin-guide/kernel-parameters.txt | 6 + Documentation/devicetree/bindings/arm/actions.txt | 39 ++ .../bindings/serial/actions,owl-uart.txt | 16 + .../bindings/timer/actions,owl-timer.txt | 16 + .../devicetree/bindings/vendor-prefixes.txt | 2 + MAINTAINERS | 10 + arch/arm/Kconfig | 2 + arch/arm/Makefile | 1 + arch/arm/boot/dts/Makefile | 2 + arch/arm/boot/dts/s500-guitar-bb-rev-b.dts | 33 + arch/arm/boot/dts/s500-guitar.dtsi | 20 + arch/arm/boot/dts/s500.dtsi | 135 ++++ arch/arm/mach-actions/Kconfig | 10 + arch/arm/mach-actions/Makefile | 1 + arch/arm/mach-actions/owl.c | 28 + arch/arm64/Kconfig.platforms | 5 + arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/actions/Makefile | 5 + arch/arm64/boot/dts/actions/s900-bubblegum-96.dts | 38 ++ arch/arm64/boot/dts/actions/s900.dtsi | 109 ++++ drivers/clocksource/Kconfig | 7 + drivers/clocksource/Makefile | 1 + drivers/clocksource/owl-timer.c | 146 +++++ drivers/tty/serial/Kconfig | 19 + drivers/tty/serial/Makefile | 1 + drivers/tty/serial/owl-uart.c | 707 +++++++++++++++++++++ include/uapi/linux/serial_core.h | 3 + 27 files changed, 1363 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/actions.txt create mode 100644 Documentation/devicetree/bindings/serial/actions,owl-uart.txt create mode 100644 Documentation/devicetree/bindings/timer/actions,owl-timer.txt create mode 100644 arch/arm/boot/dts/s500-guitar-bb-rev-b.dts create mode 100644 arch/arm/boot/dts/s500-guitar.dtsi create mode 100644 arch/arm/boot/dts/s500.dtsi create mode 100644 arch/arm/mach-actions/Kconfig create mode 100644 arch/arm/mach-actions/Makefile create mode 100644 arch/arm/mach-actions/owl.c create mode 100644 arch/arm64/boot/dts/actions/Makefile create mode 100644 arch/arm64/boot/dts/actions/s900-bubblegum-96.dts create mode 100644 arch/arm64/boot/dts/actions/s900.dtsi create mode 100644 drivers/clocksource/owl-timer.c create mode 100644 drivers/tty/serial/owl-uart.c
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 1/17 dt-bindings: Add vendor prefix for Actions Semi
Actions Semiconductor was listed on NASDAQ as ACTS until Dec 16, 2016.
---
v1 -> v2:
* Reverted from "acts" to "actions" (cf. IAP140 "mrvl" vs. "marvell")
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
@@ -6,6 +6,7 @@ using them to avoid name-space collisions. abcn Abracon Corporation abilis Abilis Systems active-semi Active-Semi International Inc +actions Actions Semiconductor Co., Ltd. ad Avionic Design GmbH adapteva Adapteva, Inc. adh AD Holdings Plc.
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 2/17 dt-bindings: arm: Document Actions Semi S500
In reply to Andreas FärberThe Actions Semi S500 is a quad-core ARM Cortex-A9 SoC. The LeMaker Guitar is an SODIMM-format module with that SoC.
---
v1 -> v2:
* Adopted "actions" vendor prefix
* Extended text
Documentation/devicetree/bindings/arm/actions.txt | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/actions.txt
Documentation/devicetree/bindings/arm/actions.txt new file +24 -0
@@ -0,0 +1,24 @@ +Actions Semi platforms device tree bindings +------------------------------------------- + + +S500 SoC +======== + +Required root node properties: + + - compatible : must contain "actions,s500" + + +Modules: + +Root node property compatible must contain, depending on module: + + - LeMaker Guitar: "lemaker,guitar" + + +Boards: + +Root node property compatible must contain, depending on board: + + - LeMaker Guitar Base Board rev. B: "lemaker,guitar-bb-rev-b", "lemaker,guitar"
Signature · 1 line
2.10.2
Andreas Färber
maintainerRFC v2 3/17 dt-bindings: timer: Document Owl timer
In reply to Andreas FärberThe Actions Semi S500 SoC contains a timer block with two timers.
---
v2: new
.../devicetree/bindings/timer/actions,owl-timer.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/actions,owl-timer.txt
Documentation/devicetree/bindings/timer/actions,owl-timer.txt new file +16 -0
@@ -0,0 +1,16 @@ +Actions Semi Owl Timer + +Required properties: +- compatible : "actions,owl-timer" +- reg : Offset and length of the register set for the device. +- interrupts : Should contain two timer interrupts. + + +Example: + + timer at b0168000 { + compatible = "actions,owl-timer"; + reg = <0xb0168000 0x100>; + interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; + };
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 4/17 clocksource: Add Owl timer
In reply to Andreas FärberImplement clocksource and clockevents for Actions Semi S500.
Based on LeMaker linux-actions tree.
---
v2: new
drivers/clocksource/Kconfig | 7 ++ drivers/clocksource/Makefile | 1 + drivers/clocksource/owl-timer.c | 146 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+) create mode 100644 drivers/clocksource/owl-timer.c
drivers/clocksource/Kconfig +7 -0
@@ -107,6 +107,13 @@ config ORION_TIMER help Enables the support for the Orion timer driver +config OWL_TIMER + bool "Owl timer driver" if COMPILE_TEST + depends on GENERIC_CLOCKEVENTS + select CLKSRC_MMIO + help + Enables the support for the Actions Semi Owl timer driver. + config SUN4I_TIMER bool "Sun4i timer driver" if COMPILE_TEST depends on GENERIC_CLOCKEVENTS
drivers/clocksource/Makefile +1 -0
@@ -53,6 +53,7 @@ obj-$(CONFIG_CLKSRC_PISTACHIO) += time-pistachio.o obj-$(CONFIG_CLKSRC_TI_32K) += timer-ti-32k.o obj-$(CONFIG_CLKSRC_NPS) += timer-nps.o obj-$(CONFIG_OXNAS_RPS_TIMER) += timer-oxnas-rps.o +obj-$(CONFIG_OWL_TIMER) += owl-timer.o obj-$(CONFIG_ARC_TIMERS) += arc_timer.o obj-$(CONFIG_ARM_ARCH_TIMER) += arm_arch_timer.o
drivers/clocksource/owl-timer.c new file +146 -0
146 lines not on this page · raw message
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 5/17 ARM: Prepare Actions Semi S500
In reply to Andreas FärberAdd ARCH_ACTIONS and mach-actions/owl.c for "actions,s500".
---
v1 -> v2:
* Renamed ARCH_OWL to ARCH_ACTION (Arnd)
* Renamed mach-owl to mach-actions, leaving owl.c
* Adopted "actions" vendor prefix
arch/arm/Kconfig | 2 ++ arch/arm/Makefile | 1 + arch/arm/mach-actions/Kconfig | 10 ++++++++++ arch/arm/mach-actions/Makefile | 1 + arch/arm/mach-actions/owl.c | 28 ++++++++++++++++++++++++++++ 5 files changed, 42 insertions(+) create mode 100644 arch/arm/mach-actions/Kconfig create mode 100644 arch/arm/mach-actions/Makefile create mode 100644 arch/arm/mach-actions/owl.c
arch/arm/Kconfig +2 -0
@@ -720,6 +720,8 @@ config ARCH_VIRT # source "arch/arm/mach-mvebu/Kconfig" +source "arch/arm/mach-actions/Kconfig" + source "arch/arm/mach-alpine/Kconfig" source "arch/arm/mach-artpec/Kconfig"
arch/arm/Makefile +1 -0
@@ -151,6 +151,7 @@ textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000 # Machine directory name. This list is sorted alphanumerically # by CONFIG_* macro name. +machine-$(CONFIG_ARCH_ACTIONS) += actions machine-$(CONFIG_ARCH_ALPINE) += alpine machine-$(CONFIG_ARCH_ARTPEC) += artpec machine-$(CONFIG_ARCH_AT91) += at91
arch/arm/mach-actions/Kconfig new file +10 -0
@@ -0,0 +1,10 @@ +menuconfig ARCH_ACTIONS + bool "Actions Semi SoCs" + depends on ARCH_MULTI_V7 + select ARM_GIC + select CACHE_L2X0 + select COMMON_CLK + select GENERIC_IRQ_CHIP + select OWL_TIMER + help + This enables support for the Actions Semiconductor S500 SoC family.
arch/arm/mach-actions/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_ARCH_ACTIONS) += owl.o
arch/arm/mach-actions/owl.c new file +28 -0
@@ -0,0 +1,28 @@ +/* +* Copyright (C) 2017 Andreas F?rber +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +*/ + +#include <linux/of_platform.h> +#include <asm/mach/arch.h> + +static const char *const owl_dt_compat[] = { +"actions,s500" , +NULL +}; + +DT_MACHINE_START (MESON ,"Actions Semi Owl platform" ) + .dt_compat = owl_dt_compat, + .l2c_aux_val = 0, + .l2c_aux_mask = ~0 , +MACHINE_END
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 6/17 ARM64: Prepare Actions Semi S900
In reply to Andreas FärberAdd ARCH_ACTIONS.
---
v1 -> v2:
* Renamed ARCH_OWL to ARCH_ACTION (Arnd)
arch/arm64/Kconfig.platforms | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm64/Kconfig.platforms +5 -0
@@ -1,5 +1,10 @@ menu "Platform selection" +config ARCH_ACTIONS + bool "Actions Semi Platforms" + help + This enables support for the Actions Semiconductor S900 SoC family. + config ARCH_SUNXI bool "Allwinner sunxi 64-bit SoC Family" select GENERIC_IRQ_CHIP
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 7/17 dt-bindings: serial: Document Actions Semi Owl UARTs
In reply to Andreas FärberThis UART is found on S500 and S900 SoCs.
---
v1 -> v2:
* Adopted "actions" vendor prefix
.../devicetree/bindings/serial/actions,owl-uart.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Documentation/devicetree/bindings/serial/actions,owl-uart.txt
Documentation/devicetree/bindings/serial/actions,owl-uart.txt new file +16 -0
@@ -0,0 +1,16 @@ +Actions Semi Owl UART + +Required properties: +- compatible : "actions,s500-uart", "actions,owl-uart" for S500 + "actions,s900-uart", "actions,owl-uart" for S900 +- reg : Offset and length of the register set for the device. +- interrupts : Should contain UART interrupt. + + +Example: + + uart3: serial at b0126000 { + compatible = "actions,s500-uart", "actions,owl-uart"; + reg = <0xb0126000 0x1000>; + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; + };
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 8/17 tty: serial: Add Actions Semi Owl UART earlycon
In reply to Andreas FärberThis implements an earlycon for Actions Semi S500/S900 SoCs.
Based on LeMaker linux-actions tree.
---
v1 -> v2:
* Extended Kconfig help to mention earlycon (Arnd)
* Spelled out Actions Semiconductor in Kconfig help
* Adopted "actions" vendor prefix
drivers/tty/serial/Kconfig | 19 ++++++ drivers/tty/serial/Makefile | 1 + drivers/tty/serial/owl-uart.c | 135 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 155 insertions(+) create mode 100644 drivers/tty/serial/owl-uart.c
drivers/tty/serial/Kconfig +19 -0
@@ -1677,6 +1677,25 @@ config SERIAL_MVEBU_CONSOLE and warnings and which allows logins in single user mode) Otherwise, say 'N'. +config SERIAL_OWL + bool "Actions Semi Owl serial port support" + depends on ARCH_ACTIONS || COMPILE_TEST + select SERIAL_CORE + help + This driver is for Actions Semiconductor S500/S900 SoC's UART. + Say 'Y' here if you wish to use the on-board serial port. + Otherwise, say 'N'. + +config SERIAL_OWL_CONSOLE + bool "Console on Actions Semi Owl serial port" + depends on SERIAL_OWL=y + select SERIAL_CORE_CONSOLE + select SERIAL_EARLYCON + default y + help + Say 'Y' here if you wish to use Actions Semiconductor S500/S900 UART + as the system console. Only earlycon is implemented currently. + endmenu config SERIAL_MCTRL_GPIO
drivers/tty/serial/Makefile +1 -0
@@ -91,6 +91,7 @@ obj-$(CONFIG_SERIAL_STM32) += stm32-usart.o obj-$(CONFIG_SERIAL_MVEBU_UART) += mvebu-uart.o obj-$(CONFIG_SERIAL_PIC32) += pic32_uart.o obj-$(CONFIG_SERIAL_MPS2_UART) += mps2-uart.o +obj-$(CONFIG_SERIAL_OWL) += owl-uart.o # GPIOLIB helpers for modem control lines obj-$(CONFIG_SERIAL_MCTRL_GPIO) += serial_mctrl_gpio.o
drivers/tty/serial/owl-uart.c new file +135 -0
135 lines not on this page · raw message
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 9/17 Documentation: kernel-parameters: Document owl earlycon
In reply to Andreas Färber---
v1 -> v2: unchanged
Documentation/admin-guide/kernel-parameters.txt | 6 ++++++ 1 file changed, 6 insertions(+)
Documentation/admin-guide/kernel-parameters.txt +6 -0
@@ -943,6 +943,12 @@ must already be setup and configured. Options are not yet supported. + owl,<addr> + Start an early, polled-mode console on an Owl serial + port at the specified address. The serial port must + already be setup and configured. Options are not yet + supported. + smh Use ARM semihosting calls for early console. s3c2410,<addr>
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 10/17 ARM: dts: Add Actions Semi S500 and LeMaker Guitar
In reply to Andreas Färber---
v1 -> v2:
* Reworded subject
* Updated ARCH_OWL to ARCH_ACTIONS (Arnd)
* Adopted "actions" vendor prefix
* Dropped irq.h include
* Added memory at 0 node for Guitar SoM
* Dropped bogus uart3 clock-frequency
* Added device_type for CPU nodes
* Fixed UART reg size
* Adopted SPDX-License-Identifier (Rob)
* Added remaining UART nodes
* Added timer node
arch/arm/boot/dts/Makefile | 2 + arch/arm/boot/dts/s500-guitar-bb-rev-b.dts | 26 ++++++ arch/arm/boot/dts/s500-guitar.dtsi | 20 +++++ arch/arm/boot/dts/s500.dtsi | 135 +++++++++++++++++++++++++++++ 4 files changed, 183 insertions(+) create mode 100644 arch/arm/boot/dts/s500-guitar-bb-rev-b.dts create mode 100644 arch/arm/boot/dts/s500-guitar.dtsi create mode 100644 arch/arm/boot/dts/s500.dtsi
arch/arm/boot/dts/Makefile +2 -0
@@ -638,6 +638,8 @@ dtb-$(CONFIG_ARCH_ORION5X) += \ orion5x-maxtor-shared-storage-2.dtb \ orion5x-netgear-wnr854t.dtb \ orion5x-rd88f5182-nas.dtb +dtb-$(CONFIG_ARCH_ACTIONS) += \ + s500-guitar-bb-rev-b.dtb dtb-$(CONFIG_ARCH_PRIMA2) += \ prima2-evb.dtb dtb-$(CONFIG_ARCH_OXNAS) += \
arch/arm/boot/dts/s500-guitar-bb-rev-b.dts new file +26 -0
@@ -0,0 +1,26 @@ +/* + * Copyright (c) 2016-2017 Andreas F?rber + * + * SPDX-License-Identifier: (GPL-2.0+ OR MIT) + */ + +/dts-v1/; + +#include "s500-guitar.dtsi" + +/ { + compatible = "lemaker,guitar-bb-rev-b", "lemaker,guitar", "actions,s500"; + model = "LeMaker Guitar Base Board rev. B"; + + aliases { + serial3 = &uart3; + }; + + chosen { + stdout-path = "serial3:115200n8"; + }; +}; + +&uart3 { + status = "okay"; +};
arch/arm/boot/dts/s500-guitar.dtsi new file +20 -0
@@ -0,0 +1,20 @@ +/* + * LeMaker Guitar SoM + * + * Copyright (c) 2016-2017 Andreas F?rber + * + * SPDX-License-Identifier: (GPL-2.0+ OR MIT) + */ + +#include "s500.dtsi" + +/ { + compatible = "lemaker,guitar", "actions,s500"; + + /delete-node/ memory; + + memory at 0 { + device_type = "memory"; + reg = <0x0 0x40000000>; + }; +};
arch/arm/boot/dts/s500.dtsi new file +135 -0
135 lines not on this page · raw message
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 11/17 dt-bindings: Add vendor prefix for uCRobotics
In reply to Andreas Färber---
v1 -> v2: unchanged
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
@@ -320,6 +320,7 @@ tronfy Tronfy tronsmart Tronsmart truly Truly Semiconductors Limited tyan Tyan Computer Corporation +ucrobotics uCRobotics udoo Udoo uniwest United Western Technologies Corp (UniWest) upisemi uPI Semiconductor Corp.
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 12/17 dt-bindings: arm: Document Actions Semi S900
In reply to Andreas FärberThe Actions Semi S900 is a quad-core ARM Cortex-A53 SoC.
The Bubblegum-96 is a 96Boards Consumer Edition compliant board (4/96).
---
v1 -> v2:
* Adopted "actions" vendor prefix
* Extended text
Documentation/devicetree/bindings/arm/actions.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
Documentation/devicetree/bindings/arm/actions.txt +15 -0
@@ -22,3 +22,18 @@ Boards: Root node property compatible must contain, depending on board: - LeMaker Guitar Base Board rev. B: "lemaker,guitar-bb-rev-b", "lemaker,guitar" + + +S900 SoC +======== + +Required root node properties: + +- compatible : must contain "actions,s900" + + +Boards: + +Root node property compatible must contain, depending on board: + + - uCRobotics Bubblegum-96: "ucrobotics,bubblegum-96"
Signature · 1 line
2.10.2
Andreas Färber
maintainerRFC v2 13/17 ARM64: dts: Add Actions Semi S900 and Bubblegum-96
In reply to Andreas Färber---
v1 -> v2:
* Reworded subject
* Added memory at 0 node for Bubblegum-96 (Mark)
* Filled in reserved-memory sub-node for Bubblegum-96 (Mark)
* Added arm-pmu interrupt-affinity property (Mark)
* Changed second GIC reg size 0x1000 -> 0x2000 for Bubblegum-96 (Mark)
* Updated ARCH_OWL to ARCH_ACTIONS (Arnd)
* Renamed s900-bubblegum96.dts to s900-bubblegum-96.dts
* Adopted "actions" vendor prefix
* Dropped irq.h include
* Adopted SPDX-License-Identifier (Rob)
arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/actions/Makefile | 5 + arch/arm64/boot/dts/actions/s900-bubblegum-96.dts | 31 ++++++ arch/arm64/boot/dts/actions/s900.dtsi | 109 ++++++++++++++++++++++ 4 files changed, 146 insertions(+) create mode 100644 arch/arm64/boot/dts/actions/Makefile create mode 100644 arch/arm64/boot/dts/actions/s900-bubblegum-96.dts create mode 100644 arch/arm64/boot/dts/actions/s900.dtsi
arch/arm64/boot/dts/Makefile +1 -0
@@ -1,3 +1,4 @@ +dts-dirs += actions dts-dirs += al dts-dirs += allwinner dts-dirs += altera
arch/arm64/boot/dts/actions/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +dtb-$(CONFIG_ARCH_ACTIONS) += s900-bubblegum-96.dtb + +always := $(dtb-y) +subdir-y := $(dts-dirs) +clean-files := *.dtb
arch/arm64/boot/dts/actions/s900-bubblegum-96.dts new file +31 -0
@@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017 Andreas F?rber + * + * SPDX-License-Identifier: (GPL-2.0+ OR MIT) + */ + +/dts-v1/; + +#include "s900.dtsi" + +/ { + compatible = "ucrobotics,bubblegum-96", "actions,s900"; + model = "Bubblegum-96"; + + aliases { + serial5 = &uart5; + }; + + chosen { + stdout-path = "serial5:115200n8"; + }; + + memory at 0 { + device_type = "memory"; + reg = <0x0 0x0 0x0 0x80000000>; + }; +}; + +&uart5 { + status = "okay"; +};
arch/arm64/boot/dts/actions/s900.dtsi new file +109 -0
109 lines not on this page · raw message
Signature · 1 line
2.10.2
Andreas Färber
maintainerRFC v2 14/17 MAINTAINERS: Add Actions Semi Owl section
In reply to Andreas Färber---
v2: new
MAINTAINERS | 10 ++++++++++ 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
@@ -1026,6 +1026,16 @@ S: Maintained F: drivers/amba/ F: include/linux/amba/bus.h +ARM/ACTIONS SEMI ARCHITECTURE +M: Andreas F?rber <[email protected]> +L: linux-arm-kernel at lists.infradead.org (moderated for non-subscribers) +S: Maintained +N: owl +F: arch/arm/mach-actions/ +F: arch/arm/boot/dts/s500* +F: arch/arm64/boot/dts/actions/ +F: Documentation/devicetree/bindings/arm/actions.txt + ARM/ADS SPHERE MACHINE SUPPORT M: Lennert Buytenhek <[email protected]> L: linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 15/17 tty: serial: owl: Implement console driver
In reply to Andreas FärberImplement serial console driver to complement earlycon.
Based on LeMaker linux-actions tree.
---
v2: new
drivers/tty/serial/Kconfig | 4 +- drivers/tty/serial/owl-uart.c | 574 ++++++++++++++++++++++++++++++++++++++- include/uapi/linux/serial_core.h | 3 + 3 files changed, 578 insertions(+), 3 deletions(-)
drivers/tty/serial/Kconfig +2 -2
@@ -1678,7 +1678,7 @@ config SERIAL_MVEBU_CONSOLE Otherwise, say 'N'. config SERIAL_OWL - bool "Actions Semi Owl serial port support" + tristate "Actions Semi Owl serial port support" depends on ARCH_ACTIONS || COMPILE_TEST select SERIAL_CORE help
@@ -1694,7 +1694,7 @@ config SERIAL_OWL_CONSOLE default y help Say 'Y' here if you wish to use Actions Semiconductor S500/S900 UART - as the system console. Only earlycon is implemented currently. + as the system console. endmenu
drivers/tty/serial/owl-uart.c +573 -1
617 lines not on this page · raw message
include/uapi/linux/serial_core.h +3 -0
@@ -271,4 +271,7 @@/* MPS2 UART */ #define PORT_MPS2UART 116 +/* Actions Semi Owl UART */ +#define PORT_OWL 117 +#endif /* _UAPILINUX_SERIAL_CORE_H */
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 16/17 ARM64: dts: actions: s900-bubblegum-96: Add fake uart5 clk
In reply to Andreas FärberGive the serial driver a fixed-clock as input for baudrate 115200.
---
v2: new
arch/arm64/boot/dts/actions/s900-bubblegum-96.dts | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/actions/s900-bubblegum-96.dts +7 -0
@@ -24,8 +24,15 @@ device_type = "memory"; reg = <0x0 0x0 0x0 0x80000000>; }; + + uart5_clk: uart5-clk { + compatible = "fixed-clock"; + clock-frequency = <921600>; + #clock-cells = <0>; + }; }; &uart5 { status = "okay"; + clocks = <&uart5_clk>; };
Signature · 1 line
2.10.2
Andreas Färber
maintainerPATCH v2 17/17 ARM: dts: s500-guitar-bb-rev-b: Add fake uart3 clock
In reply to Andreas FärberAdd a fixed-clock for baudrate 115200.
---
v2: new
arch/arm/boot/dts/s500-guitar-bb-rev-b.dts | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/boot/dts/s500-guitar-bb-rev-b.dts +7 -0
@@ -19,8 +19,15 @@ chosen { stdout-path = "serial3:115200n8"; }; + + uart3_clk: uart3-clk { + compatible = "fixed-clock"; + clock-frequency = <921600>; + #clock-cells = <0>; + }; }; &uart3 { status = "okay"; + clocks = <&uart3_clk>; };
Signature · 1 line
2.10.2
Andreas Färber
maintainerRe: [RFC v2 03/17] dt-bindings: timer: Document Owl timer
In reply to Andreas FärberAm 24.02.2017 um 04:40 schrieb Andreas F?rber:
Quoted 5 lines
The Actions Semi S500 SoC contains a timer block with two timers.
Signed-off-by Andreas F?rber <[email protected]>---
v2: new
Sorry, script error: nothing particularly RFC here.
Regards,
Andreas
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg)
Andreas Färber
maintainerRe: [RFC v2 13/17] ARM64: dts: Add Actions Semi S900 and Bubblegum-96
In reply to Andreas FärberAm 24.02.2017 um 04:40 schrieb Andreas F?rber:
Quoted 14 lines
Cc 96boards at ucrobotics.comSigned-off-by Andreas F?rber <[email protected]>---
v1 -> v2:
* Reworded subject
* Added memory at 0 node for Bubblegum-96 (Mark)
* Filled in reserved-memory sub-node for Bubblegum-96 (Mark)
* Added arm-pmu interrupt-affinity property (Mark)
* Changed second GIC reg size0x1000->0x2000for Bubblegum-96 (Mark)
* UpdatedARCH_OWLtoARCH_ACTIONS(Arnd)
* Renameds900-bubblegum96.dtstos900-bubblegum-96.dts
* Adopted "actions" vendor prefix
* Droppedirq.hinclude
* Adopted SPDX-License-Identifier (Rob)
Sorry, not this patch but the tty patches 15ff/17 should've been RFC.
Regards,
Andreas
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg)
Re: [PATCH v2 04/17] clocksource: Add Owl timer
In reply to Andreas FärberQuoted 5 lines · Andreas F?rber
Implement clocksource and clockevents for Actions Semi S500.
Based on LeMaker linux-actions tree.
Signed-off-by Andreas F?rber <[email protected]>
As this is a new driver, please give some technical information about the driver itself and a pointer to documentation if it is publicly available.
[ ... ]
drivers/clocksource/owl-timer.c line 33
Quoted 8 lines
drivers/clocksource/owl-timer.c new file +8
-0+#define OWL_T0_CMP 0x0c +#define OWL_T0_VAL 0x10 +#define OWL_T1_CTL 0x14 +#define OWL_T1_CMP 0x18 +#define OWL_T1_VAL 0x1c + +#define OWL_Tx_CTL_INTEN (1 << 1) +#define OWL_Tx_CTL_EN (1 << 2)
s/(1 << 1)/BIT(1)/
s/(1 << 2)/BIT(2)/
Quoted 36 lines
drivers/clocksource/owl-timer.c new file +36
-0+ +static void __iomem *owl_timer_base; + +static u64 notrace owl_timer_sched_read(void) +{ +return (u64 )readl (owl_timer_base +OWL_T0_VAL ); +} + +static int owl_timer_set_state_shutdown (struct clock_event_device *evt) +{ +writel (0 , owl_timer_base +OWL_T1_CTL ); + +return 0 ; +} + +static int owl_timer_set_state_oneshot (struct clock_event_device *evt) +{ +writel (0 , owl_timer_base +OWL_T1_CTL ); +writel (0 , owl_timer_base +OWL_T1_VAL ); +writel (0 , owl_timer_base +OWL_T1_CMP ); + +return 0 ; +} + +static int owl_timer_tick_resume (struct clock_event_device *evt) +{ +return 0 ; +} + +static int owl_timer_set_next_event (unsigned long evt, +struct clock_event_device *ev) +{ +writel (0 , owl_timer_base +OWL_T1_CTL ); + +writel (0 , owl_timer_base +OWL_T1_VAL ); +writel (evt, owl_timer_base +OWL_T1_CMP );
drivers/clocksource/owl-timer.c line 79
Quoted 10 lines
drivers/clocksource/owl-timer.c new file +10
-0+ +writel (OWL_Tx_CTL_EN | OWL_Tx_CTL_INTEN, owl_timer_base +OWL_T1_CTL ); + +return 0 ; +} + +static struct clock_event_device owl_clockevent = { + .name ="owl_tick" , + .rating =200 , + .features =CLOCK_EVT_FEAT_ONESHOT ,
Did you consider adding CLOCK_EVT_FEAT_DYNIRQ ?
Quoted 15 lines
drivers/clocksource/owl-timer.c new file +15
-0+ .set_state_shutdown = owl_timer_set_state_shutdown, + .set_state_oneshot = owl_timer_set_state_oneshot, + .tick_resume = owl_timer_tick_resume, + .set_next_event = owl_timer_set_next_event, +}; + +static irqreturn_t owl_timer_interrupt (int irq,void *dev_id) +{ +struct clock_event_device *evt = (struct clock_event_device *)dev_id; + + evt->event_handler (evt); + +return IRQ_HANDLED ; +} +
drivers/clocksource/owl-timer.c line 104
Quoted 10 lines
drivers/clocksource/owl-timer.c new file +10
-0+static struct irqaction owl_timer_irq = { + .name ="owl-timer" , + .flags =IRQF_TIMER , + .handler = owl_timer_interrupt, + .dev_id = &owl_clockevent, +}; + +static int __init owl_timer_init (struct device_node *node) +{ +const unsigned long rate =24000000 ;
Use DT, either use clock-frequency or a clock ref.
drivers/clocksource/owl-timer.c line 110
Quoted 6 lines
drivers/clocksource/owl-timer.c new file +6
-0+int irq1, ret; + + owl_timer_base =of_io_request_and_map (node,0 ,"owl-timer" ); +if (IS_ERR (owl_timer_base)) { +pr_err ("Can't map timer registers" ); +return -ENXIO ;
Why not PTR_ERR(owl_timer_base) ?
drivers/clocksource/owl-timer.c line 122
Quoted 12 lines
drivers/clocksource/owl-timer.c new file +12
-0+ } + + irq1 =irq_of_parse_and_map (node,1 ); +if (irq1 <=0 ) { +pr_err ("Can't parse timer1 IRQ" ); +return -EINVAL ; + } + +writel (0 , owl_timer_base +OWL_T0_CTL ); +writel (0 , owl_timer_base +OWL_T0_VAL ); +writel (0 , owl_timer_base +OWL_T0_CMP ); +writel (OWL_Tx_CTL_EN, owl_timer_base +OWL_T0_CTL );
Please factor out these calls into a function.
Quoted 4 lines
drivers/clocksource/owl-timer.c new file +4
-0+ +sched_clock_register (owl_timer_sched_read,32 , rate); +clocksource_mmio_init (owl_timer_base +OWL_T0_VAL , node->name, + rate,200 ,32 , clocksource_mmio_readl_up);
drivers/clocksource/owl-timer.c line 136
Quoted 10 lines
drivers/clocksource/owl-timer.c new file +10
-0+ +writel (0 , owl_timer_base +OWL_T1_CTL ); +writel (0 , owl_timer_base +OWL_T1_VAL ); +writel (0 , owl_timer_base +OWL_T1_CMP ); + + ret =setup_irq (irq1, &owl_timer_irq); +if (ret) { +pr_warn ("failed to setup irq %d\n" , irq1); +return ret; + }
s/setup_irq/request_irq/
drivers/clocksource/owl-timer.c line 146
Quoted 10 lines
drivers/clocksource/owl-timer.c new file +10
-0+ + owl_clockevent.cpumask =cpumask_of (0 ); + owl_clockevent.irq = irq1; + +clockevents_config_and_register (&owl_clockevent, rate, +0xf ,0xffffffff ); + +return 0 ; +} +CLOCKSOURCE_OF_DECLARE (owl,"actions,owl-timer" , owl_timer_init);
Thanks !
-- Daniel
Signature · 5 lines
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Andreas Färber
maintainerRe: [PATCH v2 04/17] clocksource: Add Owl timer
Am 24.02.2017 um 23:29 schrieb Daniel Lezcano:
Quoted 9 lines · Andreas F?rber
Quoted 5 lines
Implement clocksource and clockevents for Actions Semi S500.
Based on LeMaker linux-actions tree.
Signed-off-by Andreas F?rber <[email protected]>As this is a new driver, please give some technical information about the driver itself and a pointer to documentation if it is publicly available.
What technical information would that be? Which of the timers we use as clock source vs. clock events?
The only public documentation beyond the source tree mentioned is here:
http://www.lemaker.org/product-guitar-download-29.html (section 3.4)
Quoted 5 lines
drivers/clocksource/owl-timer.c line 33
Quoted 2 lines
drivers/clocksource/owl-timer.c new file +2
-0+#define OWL_Tx_CTL_INTEN (1 << 1) +#define OWL_Tx_CTL_EN (1 << 2)s/(1 << 1)/BIT(1)/
s/(1 << 2)/BIT(2)/
OK
Quoted 40 lines
Quoted 40 lines
drivers/clocksource/owl-timer.c new file +40
-0+ +static void __iomem *owl_timer_base; + +static u64 notrace owl_timer_sched_read(void) +{ +return (u64 )readl (owl_timer_base +OWL_T0_VAL ); +} + +static int owl_timer_set_state_shutdown (struct clock_event_device *evt) +{ +writel (0 , owl_timer_base +OWL_T1_CTL ); + +return 0 ; +} + +static int owl_timer_set_state_oneshot (struct clock_event_device *evt) +{ +writel (0 , owl_timer_base +OWL_T1_CTL ); +writel (0 , owl_timer_base +OWL_T1_VAL ); +writel (0 , owl_timer_base +OWL_T1_CMP ); + +return 0 ; +} + +static int owl_timer_tick_resume (struct clock_event_device *evt) +{ +return 0 ; +} + +static int owl_timer_set_next_event (unsigned long evt, +struct clock_event_device *ev) +{ +writel (0 , owl_timer_base +OWL_T1_CTL ); + +writel (0 , owl_timer_base +OWL_T1_VAL ); +writel (evt, owl_timer_base +OWL_T1_CMP ); + +writel (OWL_Tx_CTL_EN | OWL_Tx_CTL_INTEN, owl_timer_base +OWL_T1_CTL ); + +return 0 ;
Quoted 8 lines
drivers/clocksource/owl-timer.c line 79
Quoted 6 lines
drivers/clocksource/owl-timer.c new file +6
-0+} + +static struct clock_event_device owl_clockevent = { + .name ="owl_tick" , + .rating =200 , + .features =CLOCK_EVT_FEAT_ONESHOT ,Did you consider adding
CLOCK_EVT_FEAT_DYNIRQ?
No, it was not present downstream. Got a good example?
Quoted 19 lines
Quoted 19 lines
drivers/clocksource/owl-timer.c new file +19
-0+ .set_state_shutdown = owl_timer_set_state_shutdown, + .set_state_oneshot = owl_timer_set_state_oneshot, + .tick_resume = owl_timer_tick_resume, + .set_next_event = owl_timer_set_next_event, +}; + +static irqreturn_t owl_timer_interrupt (int irq,void *dev_id) +{ +struct clock_event_device *evt = (struct clock_event_device *)dev_id; + + evt->event_handler (evt); + +return IRQ_HANDLED ; +} + +static struct irqaction owl_timer_irq = { + .name ="owl-timer" , + .flags =IRQF_TIMER , + .handler = owl_timer_interrupt,
Quoted 8 lines
drivers/clocksource/owl-timer.c line 104
Quoted 6 lines
drivers/clocksource/owl-timer.c new file +6
-0+ .dev_id = &owl_clockevent, +}; + +static int __init owl_timer_init (struct device_node *node) +{ +const unsigned long rate =24000000 ;Use DT, either use clock-frequency or a clock ref.
Are clk drivers really available at this point? clock-frequency sounds more promising.
Quoted 8 lines
drivers/clocksource/owl-timer.c line 110
Quoted 6 lines
drivers/clocksource/owl-timer.c new file +6
-0+int irq1, ret; + + owl_timer_base =of_io_request_and_map (node,0 ,"owl-timer" ); +if (IS_ERR (owl_timer_base)) { +pr_err ("Can't map timer registers" ); +return -ENXIO ;Why not
PTR_ERR(owl_timer_base)?
Only one in-tree driver (sun5i) matches such an expression. Will change.
Quoted 6 lines
Quoted 6 lines
drivers/clocksource/owl-timer.c new file +6
-0+ } + + irq1 =irq_of_parse_and_map (node,1 ); +if (irq1 <=0 ) { +pr_err ("Can't parse timer1 IRQ" ); +return -EINVAL ;
Quoted 8 lines
drivers/clocksource/owl-timer.c line 122
Quoted 6 lines
drivers/clocksource/owl-timer.c new file +6
-0+ } + +writel (0 , owl_timer_base +OWL_T0_CTL ); +writel (0 , owl_timer_base +OWL_T0_VAL ); +writel (0 , owl_timer_base +OWL_T0_CMP ); +writel (OWL_Tx_CTL_EN, owl_timer_base +OWL_T0_CTL );Please factor out these calls into a function.
Do you have something in particular in mind? Maybe ..._reset() for the first three?
Quoted 8 lines
Quoted 8 lines
drivers/clocksource/owl-timer.c new file +8
-0+ +sched_clock_register (owl_timer_sched_read,32 , rate); +clocksource_mmio_init (owl_timer_base +OWL_T0_VAL , node->name, + rate,200 ,32 , clocksource_mmio_readl_up); + +writel (0 , owl_timer_base +OWL_T1_CTL ); +writel (0 , owl_timer_base +OWL_T1_VAL ); +writel (0 , owl_timer_base +OWL_T1_CMP );
Quoted 8 lines
drivers/clocksource/owl-timer.c line 136
Quoted 6 lines
drivers/clocksource/owl-timer.c new file +6
-0+ + ret =setup_irq (irq1, &owl_timer_irq); +if (ret) { +pr_warn ("failed to setup irq %d\n" , irq1); +return ret; + }s/setup_irq/request_irq/
Care to explain? setup_irq has 32 hits vs. 28 for request_irq.
Quoted 10 lines
drivers/clocksource/owl-timer.c line 146
Quoted 10 lines
drivers/clocksource/owl-timer.c new file +10
-0+ + owl_clockevent.cpumask =cpumask_of (0 ); + owl_clockevent.irq = irq1; + +clockevents_config_and_register (&owl_clockevent, rate, +0xf ,0xffffffff ); + +return 0 ; +} +CLOCKSOURCE_OF_DECLARE (owl,"actions,owl-timer" , owl_timer_init);
Do you spot anything functionally wrong in this driver? Despite adding this new driver, I am only getting the following additional earlycon output:
[ 0.000029] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns [ 0.007888] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns [ 0.017748] Console: colour dummy device 80x30 [ 0.022243] Calibrating delay loop... [ 0.030895] random: fast init done [ 0.231021] random: crng init done
For S900 I'm using the generic timer instead.
Thanks for your review,
Andreas
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg)
Andreas Färber
maintainerRe: [PATCH v2 10/17] ARM: dts: Add Actions Semi S500 and LeMaker Guitar
In reply to Andreas FärberAm 24.02.2017 um 04:40 schrieb Andreas F?rber:
arch/arm/boot/dts/s500.dtsi line 95
Quoted 3 lines
arch/arm/boot/dts/s500.dtsi new file +3
-0+ uart2: serial at b0124000 { + compatible = "actions,s500-uart", "actions,owl-uart"; + reg = <0xb0126000 0x2000>;
Wrong reg offset.
Quoted 10 lines
arch/arm/boot/dts/s500.dtsi new file +10
-0+ interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + uart3: serial at b0126000 { + compatible = "actions,s500-uart", "actions,owl-uart"; + reg = <0xb0126000 0x2000>; + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + };
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg)
Re: [PATCH v2 04/17] clocksource: Add Owl timer
In reply to Andreas FärberQuoted 6 lines · Andreas F?rber
Am 24.02.2017 um 23:29 schrieb Daniel Lezcano:
Quoted 5 lines · Andreas F?rber
Quoted 4 lines
Implement clocksource and clockevents for Actions Semi S500.
Based on LeMaker linux-actions tree.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Andreas F?rber <[email protected]>As this is a new driver, please give some technical information about the driver itself and a pointer to documentation if it is publicly available.
What technical information would that be? Which of the timers we use as clock source vs. clock events?
Have a look at commit 07862c1 and e4a6b37 as reference.
Quoted 12 lines
The only public documentation beyond the source tree mentioned is here:
http://www.lemaker.org/product-guitar-download-29.html (section 3.4)
Quoted 5 lines
drivers/clocksource/owl-timer.c line 33
Quoted 2 lines
drivers/clocksource/owl-timer.c new file +2
-0+#define OWL_Tx_CTL_INTEN (1 << 1) +#define OWL_Tx_CTL_EN (1 << 2)s/(1 << 1)/BIT(1)/
s/(1 << 2)/BIT(2)/OK
[ ... ]
Quoted 8 lines
Quoted 6 lines
drivers/clocksource/owl-timer.c line 79
Quoted 4 lines
drivers/clocksource/owl-timer.c new file +4
-0+static struct clock_event_device owl_clockevent = { + .name ="owl_tick" , + .rating =200 , + .features =CLOCK_EVT_FEAT_ONESHOT ,Did you consider adding
CLOCK_EVT_FEAT_DYNIRQ?No, it was not present downstream. Got a good example?
https://lwn.net/Articles/541000/
Quoted 28 lines
Quoted 19 lines
Quoted 19 lines
drivers/clocksource/owl-timer.c new file +19
-0+ .set_state_shutdown = owl_timer_set_state_shutdown, + .set_state_oneshot = owl_timer_set_state_oneshot, + .tick_resume = owl_timer_tick_resume, + .set_next_event = owl_timer_set_next_event, +}; + +static irqreturn_t owl_timer_interrupt (int irq,void *dev_id) +{ +struct clock_event_device *evt = (struct clock_event_device *)dev_id; + + evt->event_handler (evt); + +return IRQ_HANDLED ; +} + +static struct irqaction owl_timer_irq = { + .name ="owl-timer" , + .flags =IRQF_TIMER , + .handler = owl_timer_interrupt,Quoted 8 lines
drivers/clocksource/owl-timer.c line 104
Quoted 6 lines
drivers/clocksource/owl-timer.c new file +6
-0+ .dev_id = &owl_clockevent, +}; + +static int __init owl_timer_init (struct device_node *node) +{ +const unsigned long rate =24000000 ;Use DT, either use clock-frequency or a clock ref.
Quoted 2 lines
Are clk drivers really available at this point? clock-frequency sounds more promising.
Yes they are. Have a look at the other drivers.
Quoted 10 lines
Quoted 8 lines
drivers/clocksource/owl-timer.c line 110
Quoted 6 lines
drivers/clocksource/owl-timer.c new file +6
-0+int irq1, ret; + + owl_timer_base =of_io_request_and_map (node,0 ,"owl-timer" ); +if (IS_ERR (owl_timer_base)) { +pr_err ("Can't map timer registers" ); +return -ENXIO ;Why not
PTR_ERR(owl_timer_base)?Only one in-tree driver (sun5i) matches such an expression. Will change.
[ ... ]
Quoted 4 lines
Quoted 1 line
Please factor out these calls into a function.
Do you have something in particular in mind? Maybe ..._reset() for the first three?
Yes.
Quoted 17 lines
Quoted 8 lines
Quoted 8 lines
drivers/clocksource/owl-timer.c new file +8
-0+ +sched_clock_register (owl_timer_sched_read,32 , rate); +clocksource_mmio_init (owl_timer_base +OWL_T0_VAL , node->name, + rate,200 ,32 , clocksource_mmio_readl_up); + +writel (0 , owl_timer_base +OWL_T1_CTL ); +writel (0 , owl_timer_base +OWL_T1_VAL ); +writel (0 , owl_timer_base +OWL_T1_CMP );Quoted 8 lines
drivers/clocksource/owl-timer.c line 136
Quoted 6 lines
drivers/clocksource/owl-timer.c new file +6
-0+ + ret =setup_irq (irq1, &owl_timer_irq); +if (ret) { +pr_warn ("failed to setup irq %d\n" , irq1); +return ret; + }s/setup_irq/request_irq/
Quoted 1 line
Care to explain?
setup_irqhas 32 hits vs. 28 forrequest_irq.
The function setup_irq takes an irqaction as parameter. That forces all the drivers to declare a structure, so for a multiple platforms support (aka single kernel image), there are multiple structures declaration for nothing. The function request_irq allocates the structure and then call setup_irq.
So now, request_irq is used in place of setup_irq.
Quoted 23 lines
Quoted 10 lines
drivers/clocksource/owl-timer.c line 146
Quoted 10 lines
drivers/clocksource/owl-timer.c new file +10
-0+ + owl_clockevent.cpumask =cpumask_of (0 ); + owl_clockevent.irq = irq1; + +clockevents_config_and_register (&owl_clockevent, rate, +0xf ,0xffffffff ); + +return 0 ; +} +CLOCKSOURCE_OF_DECLARE (owl,"actions,owl-timer" , owl_timer_init);Do you spot anything functionally wrong in this driver? Despite adding this new driver, I am only getting the following additional earlycon output:
[ 0.000029] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns [ 0.007888] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns [ 0.017748] Console: colour dummy device 80x30 [ 0.022243] Calibrating delay loop... [ 0.030895] random: fast init done [ 0.231021] random: crng init done
Quoted 1 line
For S900 I'm using the generic timer instead.
I don't get the issue, can you elaborate ?
Thanks
-- Daniel
Signature · 5 lines
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Andreas Färber
maintainerRe: [PATCH v2 04/17] clocksource: Add Owl timer
Am 25.02.2017 um 22:59 schrieb Daniel Lezcano:
Quoted 10 lines · Andreas F?rber
Quoted 9 lines
Am 24.02.2017 um 23:29 schrieb Daniel Lezcano:
Quoted 7 lines · Andreas F?rber
drivers/clocksource/owl-timer.c line 79
Quoted 4 lines
drivers/clocksource/owl-timer.c new file +4
-0+static struct clock_event_device owl_clockevent = { + .name ="owl_tick" , + .rating =200 , + .features =CLOCK_EVT_FEAT_ONESHOT ,Did you consider adding
CLOCK_EVT_FEAT_DYNIRQ?
Quoted 3 lines
Quoted 1 line
No, it was not present downstream. Got a good example?
Looking at your current Nomadik code, it seems I can literally should just add this flag (done), without needing to implement any new hooks.
On a related topic, how do we determine the cpumask? Downstream and some in-tree drivers use cpumask_of(0), others use cpu_possible_mask.
Quoted 12 lines
Quoted 12 lines
Do you spot anything functionally wrong in this driver? Despite adding this new driver, I am only getting the following additional earlycon output:
[ 0.000029] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns [ 0.007888] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns [ 0.017748] Console: colour dummy device 80x30 [ 0.022243] Calibrating delay loop... [ 0.030895] random: fast init done [ 0.231021] random: crng init done
Quoted 3 lines
Quoted 1 line
For S900 I'm using the generic timer instead.
I don't get the issue, can you elaborate ?
Found it myself: I forgot to clear the interrupt pending bit in the interrupt handler routine.
+ writel(OWL_Tx_CTL_PD, owl_timer_base + OWL_T1_CTL);
Now it goes past this point, initializes the real serial driver and boots up to not finding the rootfs:
[ 0.000032] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns [ 0.007898] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns [ 0.017886] Console: colour dummy device 80x30 [ 0.022386] Calibrating delay loop... 405.50 BogoMIPS (lpj=2027520) [ 0.083523] pid_max: default: 32768 minimum: 301
...
Regards,
Andreas
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg)
Re: [PATCH v2 04/17] clocksource: Add Owl timer
Quoted 13 lines · Andreas F?rber
Am 25.02.2017 um 22:59 schrieb Daniel Lezcano:
Quoted 12 lines · Andreas F?rber
Quoted 10 lines
Am 24.02.2017 um 23:29 schrieb Daniel Lezcano:
Quoted 7 lines · Andreas F?rber
drivers/clocksource/owl-timer.c line 79
Quoted 4 lines
drivers/clocksource/owl-timer.c new file +4
-0+static struct clock_event_device owl_clockevent = { + .name ="owl_tick" , + .rating =200 , + .features =CLOCK_EVT_FEAT_ONESHOT ,Did you consider adding
CLOCK_EVT_FEAT_DYNIRQ?No, it was not present downstream. Got a good example?
Quoted 7 lines
Quoted 1 line
Looking at your current Nomadik code, it seems I can literally should just add this flag (done), without needing to implement any new hooks.
On a related topic, how do we determine the cpumask? Downstream and some in-tree drivers use
cpumask_of(0), others usecpu_possible_mask.
If you specify the CLOCK_EVT_FEAT_DYNIRQ, the cpumask is not important as it will be changed dynamically.
Otherwise, cpumask_of(0) is often the default because it concentrates the wakeup on a single cpu, allowing the other cpus to go to deep idle state and if there are two clusters, it allows to have a cluster idle state. That results on a better energy saving.
The usage of cpu_possible_mask will randomly wakeup any cpu.
Quoted 24 lines
Quoted 12 lines
Quoted 12 lines
Do you spot anything functionally wrong in this driver? Despite adding this new driver, I am only getting the following additional earlycon output:
[ 0.000029] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns [ 0.007888] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns [ 0.017748] Console: colour dummy device 80x30 [ 0.022243] Calibrating delay loop... [ 0.030895] random: fast init done [ 0.231021] random: crng init doneQuoted 3 lines
Quoted 1 line
For S900 I'm using the generic timer instead.
I don't get the issue, can you elaborate ?
Found it myself: I forgot to clear the interrupt pending bit in the interrupt handler routine.
+
writel(OWL_Tx_CTL_PD, owl_timer_base + OWL_T1_CTL);Now it goes past this point, initializes the real serial driver and boots up to not finding the rootfs:
Quoted 6 lines
[ 0.000032] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns [ 0.007898] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns [ 0.017886] Console: colour dummy device 80x30 [ 0.022386] Calibrating delay loop... 405.50 BogoMIPS (lpj=2027520)
May be you should also consider using register_current_timer_delay() instead of jiffies based delay loops.
Quoted 1 line
[ 0.083523] pid_max: default: 32768 minimum: 301
Signature · 5 lines
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Andreas Färber
maintainerRe: [RFC v2 03/17] dt-bindings: timer: Document Owl timer
In reply to Andreas FärberAm 24.02.2017 um 04:40 schrieb Andreas F?rber:
Quoted 22 lines
The Actions Semi S500 SoC contains a timer block with two timers.
Signed-off-by Andreas F?rber <[email protected]>---
v2: new.../devicetree/bindings/timer/actions,owl-timer.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/actions,owl-timer.txtDocumentation/devicetree/bindings/timer/actions,owl-timer.txt new file +6
-0@@ -0,0 +1,16 @@ +Actions Semi Owl Timer + +Required properties: +- compatible : "actions,owl-timer" +- reg : Offset and length of the register set for the device. +- interrupts : Should contain two timer interrupts.
Documentation/devicetree/bindings/timer/actions,owl-timer.txt line 16
Quoted 10 lines
Documentation/devicetree/bindings/timer/actions,owl-timer.txt new file +10
-0+ + +Example: + + timer at b0168000 { + compatible = "actions,owl-timer"; + reg = <0xb0168000 0x100>; + interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; + };
I need to modify these bindings for upcoming v3 in the following ways:
* "actions,s500-timer", "actions,owl-timer" to deal with S500 vs. S900 differences while keeping a single driver registration (or would two registrations be preferred, dropping the second compatible? they do share a common subset)
* Use named interrupts to deal with 2x 2Hz + 2x Timer vs. 4x Timer for complete hardware description
Regards,
Andreas
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg)
Andreas Färber
maintainerRe: [PATCH v2 01/17] dt-bindings: Add vendor prefix for Actions Semi
In reply to Andreas FärberAm 24.02.2017 um 04:40 schrieb Andreas F?rber:
Quoted 16 lines
Actions Semiconductor was listed on NASDAQ as ACTS until Dec 16, 2016.
Cc mp-cs at actions-semi.comSigned-off-by Andreas F?rber <[email protected]>---
v1 -> v2:
* Reverted from "acts" to "actions" (cf. IAP140 "mrvl" vs. "marvell")Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)Documentation/devicetree/bindings/vendor-prefixes.txt +0
-0
Documentation/devicetree/bindings/vendor-prefixes.txt using them to avoid name-space collisions. · line 9
Quoted 4 lines
Documentation/devicetree/bindings/vendor-prefixes.txt +1
-0@@ -6,6 +6,7 @@ using them to avoid name-space collisions. abcn Abracon Corporation abilis Abilis Systems active-semi Active-Semi International Inc +actions Actions Semiconductor Co., Ltd.
If the use of "actions" gets ack'ed, I realize it should move one line up.
Regards,
Andreas
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg)
Re: [PATCH v2 01/17] dt-bindings: Add vendor prefix for Actions Semi
Quoted 12 lines · Andreas F?rber
Am 24.02.2017 um 04:40 schrieb Andreas F?rber:
Quoted 11 lines
Actions Semiconductor was listed on NASDAQ as ACTS until Dec 16, 2016.
Cc mp-cs at actions-semi.comSigned-off-by Andreas F?rber <[email protected]>---
v1 -> v2:
* Reverted from "acts" to "actions" (cf. IAP140 "mrvl" vs. "marvell")Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
Quoted 11 lines
Documentation/devicetree/bindings/vendor-prefixes.txt using them to avoid name-space collisions. · line 9
Quoted 9 lines
Documentation/devicetree/bindings/vendor-prefixes.txt +1
-0@@ -6,6 +6,7 @@ using them to avoid name-space collisions. abcn Abracon Corporation abilis Abilis Systems active-semi Active-Semi International Inc +actions Actions Semiconductor Co., Ltd.If the use of "actions" gets ack'ed, I realize it should move one line up.
With that fix,
Re: [PATCH v2 02/17] dt-bindings: arm: Document Actions Semi S500
In reply to Andreas FärberQuoted 4 lines · Andreas F?rber
The Actions Semi S500 is a quad-core ARM Cortex-A9 SoC. The LeMaker Guitar is an SODIMM-format module with that SoC.
Signed-off-by Andreas F?rber <[email protected]>
Quoted 8 lines
---
v1 -> v2:
* Adopted "actions" vendor prefix
* Extended textDocumentation/devicetree/bindings/arm/actions.txt | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/actions.txt
Rob Herring
maintainerRe: [RFC v2 03/17] dt-bindings: timer: Document Owl timer
In reply to Andreas FärberQuoted 36 lines · Andreas F?rber
Am 24.02.2017 um 04:40 schrieb Andreas F?rber:
Quoted 22 lines
The Actions Semi S500 SoC contains a timer block with two timers.
Signed-off-by Andreas F?rber <[email protected]>---
v2: new.../devicetree/bindings/timer/actions,owl-timer.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/actions,owl-timer.txtDocumentation/devicetree/bindings/timer/actions,owl-timer.txt new file +6
-0@@ -0,0 +1,16 @@ +Actions Semi Owl Timer + +Required properties: +- compatible : "actions,owl-timer" +- reg : Offset and length of the register set for the device. +- interrupts : Should contain two timer interrupts.Documentation/devicetree/bindings/timer/actions,owl-timer.txt line 16
Quoted 10 lines
Documentation/devicetree/bindings/timer/actions,owl-timer.txt new file +10
-0+ + +Example: + + timer at b0168000 { + compatible = "actions,owl-timer"; + reg = <0xb0168000 0x100>; + interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; + };I need to modify these bindings for upcoming v3 in the following ways:
Quoted 4 lines
* "actions,s500-timer", "actions,owl-timer" to deal with S500 vs. S900 differences while keeping a single driver registration (or would two registrations be preferred, dropping the second compatible? they do share a common subset)
The former is fine.
Quoted 3 lines
* Use named interrupts to deal with 2x 2Hz + 2x Timer vs. 4x Timer for complete hardware description
The compatible should imply this difference.
Rob
Re: [PATCH v2 07/17] dt-bindings: serial: Document Actions Semi Owl UARTs
In reply to Andreas FärberQuoted 10 lines · Andreas F?rber
This UART is found on S500 and S900 SoCs.
Signed-off-by Andreas F?rber <[email protected]>---
v1 -> v2:
* Adopted "actions" vendor prefix.../devicetree/bindings/serial/actions,owl-uart.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Documentation/devicetree/bindings/serial/actions,owl-uart.txt
Re: [PATCH v2 11/17] dt-bindings: Add vendor prefix for uCRobotics
In reply to Andreas FärberQuoted 7 lines · Andreas F?rber
Cc 96boards at ucrobotics.comSigned-off-by Andreas F?rber <[email protected]>---
v1 -> v2: unchangedDocumentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
Re: [PATCH v2 12/17] dt-bindings: arm: Document Actions Semi S900
In reply to Andreas FärberQuoted 5 lines · Andreas F?rber
The Actions Semi S900 is a quad-core ARM Cortex-A53 SoC.
The Bubblegum-96 is a 96Boards Consumer Edition compliant board (4/96).Cc 96boards at ucrobotics.comSigned-off-by Andreas F?rber <[email protected]>
Quoted 7 lines
---
v1 -> v2:
* Adopted "actions" vendor prefix
* Extended textDocumentation/devicetree/bindings/arm/actions.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
Jonathan Corbet
maintainerRe: [PATCH v2 09/17] Documentation: kernel-parameters: Document owl earlycon
In reply to Andreas FärberDocumentation/admin-guide/kernel-parameters.txt line 951
Quoted 6 lines · On Fri, 24 Feb 2017 04:40:47 +0100 Andreas F?rber <[email protected]> wrote:
Documentation/admin-guide/kernel-parameters.txt +6
-0+ owl,<addr> + Start an early, polled-mode console on an Owl serial + port at the specified address. The serial port must + already be setup and configured. Options are not yet + supported. +
Apologies, I'm just getting around to looking at this.
Is there any chance of getting a version of it that (1) has a proper changelog, and (2) better describes the applicability of this option. Presumably if I don't know what an "Owl serial port" is I don't need it, but maybe a phrase saying where such ports might be found would be helpful here?
Thanks,
jon
Andreas Färber
maintainerRe: [PATCH v2 09/17] Documentation: kernel-parameters: Document owl earlycon
Am 03.03.2017 um 23:46 schrieb Jonathan Corbet:
Quoted 12 lines
Documentation/admin-guide/kernel-parameters.txt line 951
Quoted 6 lines · On Fri, 24 Feb 2017 04:40:47 +0100 Andreas F?rber <[email protected]> wrote:
Documentation/admin-guide/kernel-parameters.txt +6
-0+ owl,<addr> + Start an early, polled-mode console on an Owl serial + port at the specified address. The serial port must + already be setup and configured. Options are not yet + supported. +Apologies, I'm just getting around to looking at this.
Quoted 5 lines
Is there any chance of getting a version of it that (1) has a proper changelog, and (2) better describes the applicability of this option. Presumably if I don't know what an "Owl serial port" is I don't need it, but maybe a phrase saying where such ports might be found would be helpful here?
Note that there is already a v3 of this patch.
Both v2 and v3 do have a changelog, indicating that nothing changed here between versions. Did you mean commit message, and if so what would you like to see added exactly?
Did you notice that most earlycon options are described like this? pl011, my meson, msm, lantiq all just repeat the driver name. In this case Owl is a family of Actions Semiconductor SoCs that are newly being enabled in this series - I can add the vendor name to the text, but no idea what else to say about "applicability"...
While at it, it is really ugly for both users and contributors that there is no consistent (e.g., alphabetical) order of these options.
Regards,
Andreas
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg)