Skip to contentSkip to conversation

Adding NPS400 drivers

PATCH Superseded Noam Camus 2 participants 5 messages Feb 1, 2016

Subsystems (4)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Noam Camus

author
#0 lore raw

cover Adding NPS400 drivers

From: Noam Camus <[email protected]>

General summay:
Both drivers are now apart of previous basic patch set of new platform for ARC. The rest is now can be seen at ARC srctree:
https://git.kernel.org/cgit/linux/kernel/git/vgupta/arc.git/

Now ARC is supporting DT for clockevents and the interrupt controller ARC uses irq domain handling.

Compare to last version now clocksource driver do not include clockevent registration since NPS400 can use ARC generic driver.

Compare to last version now irqchip driver sets domain as default since it is the root domain. Also mapping of IPI is done in this driver.

Last thing is that drivers can be build cleanly for i386 (still runs only for ARC)
Note: in order to build we need to merge drivers into srctree which includes new header:
soc/nps/common.h
This header is part of patch set applied to ARC srctree.

Regards,
Noam Camus

Noam Camus (2):
clocksource: Add NPS400 timers driver
irqchip: add nps Internal and external irqchips

 .../interrupt-controller/ezchip,nps400-ic.txt      |   17 +++
 .../bindings/timer/ezchip,nps400-timer.txt         |   15 ++
 drivers/clocksource/Kconfig                        |    7 +
 drivers/clocksource/Makefile                       |    1 +
 drivers/clocksource/timer-nps.c                    |   84 +++++++++++
 drivers/irqchip/Kconfig                            |    6 +
 drivers/irqchip/Makefile                           |    1 +
 drivers/irqchip/irq-eznps.c                        |  151 ++++++++++++++++++++
 8 files changed, 282 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/ezchip,nps400-ic.txt
 create mode 100644 Documentation/devicetree/bindings/timer/ezchip,nps400-timer.txt
 create mode 100644 drivers/clocksource/timer-nps.c
 create mode 100644 drivers/irqchip/irq-eznps.c
author
#1 lore raw

PATCH 1/2 clocksource: Add NPS400 timers driver

From: Noam Camus <[email protected]>

Add internal tick generator which is shared by all cores. Each cluster of cores view it through dedicated address. This is used for SMP system where all CPUs synced by same clock source.

Signed-off-by Noam Camus <noamc at ezchip.com>
Cc Daniel Lezcano <daniel.lezcano at linaro.org>
Cc Rob Herring <robh+dt at kernel.org>
Cc Thomas Gleixner <tglx at linutronix.de>
Cc John Stultz <john.stultz at linaro.org>
---
 .../bindings/timer/ezchip,nps400-timer.txt         |   15 ++++
 drivers/clocksource/Kconfig                        |    7 ++
 drivers/clocksource/Makefile                       |    1 +
 drivers/clocksource/timer-nps.c                    |   84 ++++++++++++++++++++
 4 files changed, 107 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/timer/ezchip,nps400-timer.txt
 create mode 100644 drivers/clocksource/timer-nps.c
Documentation/devicetree/bindings/timer/ezchip,nps400-timer.txt new file +15 -0
new file mode 100644
index 0000000..c8c03d7
@@ -0,0 +1,15 @@
+NPS Network Processor
+
+Required properties:
+
+- compatible :	should be "ezchip,nps400-timer"
+
+Clocks required for compatible = "ezchip,nps400-timer":
+- clocks : Must contain a single entry describing the clock input
+
+Example:
+
+timer {
+	compatible = "ezchip,nps400-timer";
+	clocks = <&sysclk>;
+};
drivers/clocksource/Kconfig +7 -0
index 2eb5f0e..859e83d 100644
@@ -132,6 +132,13 @@ config CLKSRC_TI_32K
 	  This option enables support for Texas Instruments 32.768 Hz clocksource
 	  available on many OMAP-like platforms.
 
+config CLKSRC_NPS
+	bool "NPS400 clocksource driver" if COMPILE_TEST
+	select CLKSRC_OF if OF
+	help
+	  NPS400 clocksource support.
+	  Got 64 bit counter with update rate up to 1000MHz.
+
 config CLKSRC_STM32
 	bool "Clocksource for STM32 SoCs" if !ARCH_STM32
 	depends on OF && ARM && (ARCH_STM32 || COMPILE_TEST)
drivers/clocksource/Makefile +1 -0
index 56bd16e..056cffd 100644
@@ -46,6 +46,7 @@ obj-$(CONFIG_CLKSRC_QCOM)	+= qcom-timer.o
 obj-$(CONFIG_MTK_TIMER)		+= mtk_timer.o
 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_ARM_ARCH_TIMER)		+= arm_arch_timer.o
 obj-$(CONFIG_ARM_GLOBAL_TIMER)		+= arm_global_timer.o
drivers/clocksource/timer-nps.c new file +84 -0

84 lines not on this page · raw message

Signature · 1 line
1.7.1
#2 lore raw

Re: [PATCH 1/2] clocksource: Add NPS400 timers driver

reproduce:

Hi Noam,

[auto build test ERROR on tip/irq/core]
[also build test ERROR on v4.5-rc2 next-20160201]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Noam-Camus/clocksource-Add-NPS400-timers-driver/20160202-032620
config: i386-allmodconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

>> drivers/clocksource/timer-nps.c:24:28: fatal error: soc/nps/common.h: No such file or directory

compilation terminated.

vim +24 drivers/clocksource/timer-nps.c

    18	#include <linux/clocksource.h>
    19	#include <linux/clockchips.h>
    20	#include <linux/clk.h>
    21	#include <linux/of.h>
    22	#include <linux/of_irq.h>
    23	#include <linux/cpu.h>
  > 24	#include <soc/nps/common.h>
    25	
    26	#define NPS_MSU_TICK_LOW	0xC8
    27	#define NPS_CLUSTER_OFFSET	8

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 52576 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-snps-arc/attachments/20160202/03f98bf3/attachment-0001.obj>

author
#3 lore raw

PATCH 2/2 irqchip: add nps Internal and external irqchips

In reply to Noam Camus

From: Noam Camus <[email protected]>

Adding EZchip NPS400 support.
NPS internal interrupts are internally handled at Multi Thread Manager (MTM) that is signaled for deactivating an interrupt.
External interrupts is handled also at Global Interrupt Controller (GIC) e.g. serial and network devices.

Signed-off-by Noam Camus <noamc at ezchip.com>
Cc Thomas Gleixner <tglx at linutronix.de>
Cc Jason Cooper <jason at lakedaemon.net>
Cc Marc Zyngier <marc.zyngier at arm.com>
---
 .../interrupt-controller/ezchip,nps400-ic.txt      |   17 +++
 drivers/irqchip/Kconfig                            |    6 +
 drivers/irqchip/Makefile                           |    1 +
 drivers/irqchip/irq-eznps.c                        |  151 ++++++++++++++++++++
 4 files changed, 175 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/ezchip,nps400-ic.txt
 create mode 100644 drivers/irqchip/irq-eznps.c
Documentation/devicetree/bindings/interrupt-controller/ezchip,nps400-ic.txt new file +17 -0
new file mode 100644
index 0000000..888b2b9
@@ -0,0 +1,17 @@
+EZchip NPS Interrupt Controller
+
+Required properties:
+
+- compatible : should be "ezchip,nps400-ic"
+- interrupt-controller : Identifies the node as an interrupt controller
+- #interrupt-cells : Specifies the number of cells needed to encode an
+  interrupt source. The value shall be 1.
+
+
+Example:
+
+intc: interrupt-controller {
+	compatible = "ezchip,nps400-ic";
+	interrupt-controller;
+	#interrupt-cells = <1>;
+};
drivers/irqchip/Kconfig +6 -0
index 4d7294e..bc5e775 100644
@@ -193,3 +193,9 @@ config IRQ_MXS
 	def_bool y if MACH_ASM9260 || ARCH_MXS
 	select IRQ_DOMAIN
 	select STMP_DEVICE
+
+config EZNPS_GIC
+	bool "NPS400 Global Interrupt Manager (GIM)"
+	select IRQ_DOMAIN
+	help
+	  Support the EZchip NPS400 global interrupt controller
drivers/irqchip/Makefile +1 -0
index 177f78f..1390142 100644
@@ -55,3 +55,4 @@ obj-$(CONFIG_RENESAS_H8S_INTC)		+= irq-renesas-h8s.o
 obj-$(CONFIG_ARCH_SA1100)		+= irq-sa11x0.o
 obj-$(CONFIG_INGENIC_IRQ)		+= irq-ingenic.o
 obj-$(CONFIG_IMX_GPCV2)			+= irq-imx-gpcv2.o
+obj-$(CONFIG_EZNPS_GIC)			+= irq-eznps.o
drivers/irqchip/irq-eznps.c new file +151 -0

151 lines not on this page · raw message

Signature · 1 line
1.7.1
#4 lore raw

Re: [PATCH 2/2] irqchip: add nps Internal and external irqchips

reproduce:

Hi Noam,

[auto build test ERROR on tip/irq/core]
[cannot apply to v4.5-rc2 next-20160201]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Noam-Camus/clocksource-Add-NPS400-timers-driver/20160202-032620
config: i386-allmodconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

>> drivers/irqchip/irq-eznps.c:22:28: fatal error: soc/nps/common.h: No such file or directory

compilation terminated.

vim +22 drivers/irqchip/irq-eznps.c

    16	
    17	#include <linux/interrupt.h>
    18	#include <linux/module.h>
    19	#include <linux/of.h>
    20	#include <linux/irqdomain.h>
    21	#include <linux/irqchip.h>
  > 22	#include <soc/nps/common.h>
    23	
    24	#undef NR_CPU_IRQS
    25	#define NR_CPU_IRQS	8  /* number of interrupt lines of NPS400 CPU */

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 52584 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-snps-arc/attachments/20160202/c4a3dfd6/attachment-0001.obj>