linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Qiang Zhao <qiang.zhao@nxp.com>, Li Yang <leoyang.li@nxp.com>,
	Christophe Leroy <christophe.leroy@c-s.fr>
Cc: linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Scott Wood <oss@buserror.net>,
	Valentin Longchamp <valentin.longchamp@keymile.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: [PATCH v2 07/23] soc: fsl: qe: merge qe_ic.h into qe_ic.c
Date: Fri, 25 Oct 2019 14:40:42 +0200	[thread overview]
Message-ID: <20191025124058.22580-8-linux@rasmusvillemoes.dk> (raw)
In-Reply-To: <20191025124058.22580-1-linux@rasmusvillemoes.dk>

The local qe_ic.h header is only used by qe_ic.c, so merge its
contents into the .c file. This is preparation for moving the driver
to drivers/irqchip/. It also avoids confusion between this header and
the one at include/soc/fsl/qe/qe_ic.h, which is included from a number
of places (qe_ic.c among others).

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/soc/fsl/qe/qe_ic.c |  91 ++++++++++++++++++++++++++++++-
 drivers/soc/fsl/qe/qe_ic.h | 108 -------------------------------------
 2 files changed, 90 insertions(+), 109 deletions(-)
 delete mode 100644 drivers/soc/fsl/qe/qe_ic.h

diff --git a/drivers/soc/fsl/qe/qe_ic.c b/drivers/soc/fsl/qe/qe_ic.c
index d420492b4c23..7b1870d2866a 100644
--- a/drivers/soc/fsl/qe/qe_ic.c
+++ b/drivers/soc/fsl/qe/qe_ic.c
@@ -26,7 +26,96 @@
 #include <asm/io.h>
 #include <soc/fsl/qe/qe_ic.h>
 
-#include "qe_ic.h"
+#define NR_QE_IC_INTS		64
+
+/* QE IC registers offset */
+#define QEIC_CICR		0x00
+#define QEIC_CIVEC		0x04
+#define QEIC_CRIPNR		0x08
+#define QEIC_CIPNR		0x0c
+#define QEIC_CIPXCC		0x10
+#define QEIC_CIPYCC		0x14
+#define QEIC_CIPWCC		0x18
+#define QEIC_CIPZCC		0x1c
+#define QEIC_CIMR		0x20
+#define QEIC_CRIMR		0x24
+#define QEIC_CICNR		0x28
+#define QEIC_CIPRTA		0x30
+#define QEIC_CIPRTB		0x34
+#define QEIC_CRICR		0x3c
+#define QEIC_CHIVEC		0x60
+
+/* Interrupt priority registers */
+#define CIPCC_SHIFT_PRI0	29
+#define CIPCC_SHIFT_PRI1	26
+#define CIPCC_SHIFT_PRI2	23
+#define CIPCC_SHIFT_PRI3	20
+#define CIPCC_SHIFT_PRI4	13
+#define CIPCC_SHIFT_PRI5	10
+#define CIPCC_SHIFT_PRI6	7
+#define CIPCC_SHIFT_PRI7	4
+
+/* CICR priority modes */
+#define CICR_GWCC		0x00040000
+#define CICR_GXCC		0x00020000
+#define CICR_GYCC		0x00010000
+#define CICR_GZCC		0x00080000
+#define CICR_GRTA		0x00200000
+#define CICR_GRTB		0x00400000
+#define CICR_HPIT_SHIFT		8
+#define CICR_HPIT_MASK		0x00000300
+#define CICR_HP_SHIFT		24
+#define CICR_HP_MASK		0x3f000000
+
+/* CICNR */
+#define CICNR_WCC1T_SHIFT	20
+#define CICNR_ZCC1T_SHIFT	28
+#define CICNR_YCC1T_SHIFT	12
+#define CICNR_XCC1T_SHIFT	4
+
+/* CRICR */
+#define CRICR_RTA1T_SHIFT	20
+#define CRICR_RTB1T_SHIFT	28
+
+/* Signal indicator */
+#define SIGNAL_MASK		3
+#define SIGNAL_HIGH		2
+#define SIGNAL_LOW		0
+
+struct qe_ic {
+	/* Control registers offset */
+	u32 __iomem *regs;
+
+	/* The remapper for this QEIC */
+	struct irq_domain *irqhost;
+
+	/* The "linux" controller struct */
+	struct irq_chip hc_irq;
+
+	/* VIRQ numbers of QE high/low irqs */
+	unsigned int virq_high;
+	unsigned int virq_low;
+};
+
+/*
+ * QE interrupt controller internal structure
+ */
+struct qe_ic_info {
+	/* Location of this source at the QIMR register */
+	u32	mask;
+
+	/* Mask register offset */
+	u32	mask_reg;
+
+	/*
+	 * For grouped interrupts sources - the interrupt code as
+	 * appears at the group priority register
+	 */
+	u8	pri_code;
+
+	/* Group priority register offset */
+	u32	pri_reg;
+};
 
 static DEFINE_RAW_SPINLOCK(qe_ic_lock);
 
diff --git a/drivers/soc/fsl/qe/qe_ic.h b/drivers/soc/fsl/qe/qe_ic.h
deleted file mode 100644
index 29b4d768e4a8..000000000000
--- a/drivers/soc/fsl/qe/qe_ic.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * drivers/soc/fsl/qe/qe_ic.h
- *
- * QUICC ENGINE Interrupt Controller Header
- *
- * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved.
- *
- * Author: Li Yang <leoli@freescale.com>
- * Based on code from Shlomi Gridish <gridish@freescale.com>
- */
-#ifndef _POWERPC_SYSDEV_QE_IC_H
-#define _POWERPC_SYSDEV_QE_IC_H
-
-#include <soc/fsl/qe/qe_ic.h>
-
-#define NR_QE_IC_INTS		64
-
-/* QE IC registers offset */
-#define QEIC_CICR		0x00
-#define QEIC_CIVEC		0x04
-#define QEIC_CRIPNR		0x08
-#define QEIC_CIPNR		0x0c
-#define QEIC_CIPXCC		0x10
-#define QEIC_CIPYCC		0x14
-#define QEIC_CIPWCC		0x18
-#define QEIC_CIPZCC		0x1c
-#define QEIC_CIMR		0x20
-#define QEIC_CRIMR		0x24
-#define QEIC_CICNR		0x28
-#define QEIC_CIPRTA		0x30
-#define QEIC_CIPRTB		0x34
-#define QEIC_CRICR		0x3c
-#define QEIC_CHIVEC		0x60
-
-/* Interrupt priority registers */
-#define CIPCC_SHIFT_PRI0	29
-#define CIPCC_SHIFT_PRI1	26
-#define CIPCC_SHIFT_PRI2	23
-#define CIPCC_SHIFT_PRI3	20
-#define CIPCC_SHIFT_PRI4	13
-#define CIPCC_SHIFT_PRI5	10
-#define CIPCC_SHIFT_PRI6	7
-#define CIPCC_SHIFT_PRI7	4
-
-/* CICR priority modes */
-#define CICR_GWCC		0x00040000
-#define CICR_GXCC		0x00020000
-#define CICR_GYCC		0x00010000
-#define CICR_GZCC		0x00080000
-#define CICR_GRTA		0x00200000
-#define CICR_GRTB		0x00400000
-#define CICR_HPIT_SHIFT		8
-#define CICR_HPIT_MASK		0x00000300
-#define CICR_HP_SHIFT		24
-#define CICR_HP_MASK		0x3f000000
-
-/* CICNR */
-#define CICNR_WCC1T_SHIFT	20
-#define CICNR_ZCC1T_SHIFT	28
-#define CICNR_YCC1T_SHIFT	12
-#define CICNR_XCC1T_SHIFT	4
-
-/* CRICR */
-#define CRICR_RTA1T_SHIFT	20
-#define CRICR_RTB1T_SHIFT	28
-
-/* Signal indicator */
-#define SIGNAL_MASK		3
-#define SIGNAL_HIGH		2
-#define SIGNAL_LOW		0
-
-struct qe_ic {
-	/* Control registers offset */
-	u32 __iomem *regs;
-
-	/* The remapper for this QEIC */
-	struct irq_domain *irqhost;
-
-	/* The "linux" controller struct */
-	struct irq_chip hc_irq;
-
-	/* VIRQ numbers of QE high/low irqs */
-	unsigned int virq_high;
-	unsigned int virq_low;
-};
-
-/*
- * QE interrupt controller internal structure
- */
-struct qe_ic_info {
-	/* Location of this source at the QIMR register */
-	u32	mask;
-
-	/* Mask register offset */
-	u32	mask_reg;
-
-	/*
-	 * For grouped interrupts sources - the interrupt code as
-	 * appears at the group priority register
-	 */
-	u8	pri_code;
-
-	/* Group priority register offset */
-	u32	pri_reg;
-};
-
-#endif /* _POWERPC_SYSDEV_QE_IC_H */
-- 
2.23.0


  parent reply	other threads:[~2019-10-25 12:41 UTC|newest]

Thread overview: 120+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 12:52 [PATCH 0/7] towards QE support on ARM Rasmus Villemoes
2019-10-18 12:52 ` [PATCH 1/7] soc: fsl: qe: remove space-before-tab Rasmus Villemoes
2019-10-18 12:57   ` Christophe Leroy
2019-10-18 12:52 ` [PATCH 2/7] soc: fsl: qe: drop volatile qualifier of struct qe_ic::regs Rasmus Villemoes
2019-10-18 13:01   ` Christophe Leroy
2019-10-18 12:52 ` [PATCH 3/7] soc: fsl: qe: avoid ppc-specific io accessors Rasmus Villemoes
2019-10-22 15:01   ` Christophe Leroy
2019-10-23  7:08     ` Rasmus Villemoes
2019-10-18 12:52 ` [PATCH 4/7] soc: fsl: qe: replace spin_event_timeout by readx_poll_timeout_atomic Rasmus Villemoes
2019-10-18 16:08   ` Christoph Hellwig
2019-10-24  8:32     ` Rasmus Villemoes
2019-10-30  0:36       ` Michael Ellerman
2019-10-18 12:52 ` [PATCH 5/7] serial: make SERIAL_QE depend on PPC32 Rasmus Villemoes
2019-10-18 12:52 ` [PATCH 6/7] serial: ucc_uart.c: explicitly include asm/cpm.h Rasmus Villemoes
2019-10-18 12:52 ` [PATCH 7/7] soc/fsl/qe/qe.h: remove include of asm/cpm.h Rasmus Villemoes
2019-10-18 20:16 ` [PATCH 0/7] towards QE support on ARM Leo Li
2019-10-18 20:52   ` Rasmus Villemoes
2019-10-18 21:52     ` Li Yang
2019-10-21  8:44       ` Rasmus Villemoes
2019-10-21 22:11         ` Li Yang
2019-10-22  2:24           ` Qiang Zhao
2019-10-22 10:17             ` Rasmus Villemoes
2019-10-23  2:52               ` Qiang Zhao
2019-10-24 20:02                 ` Li Yang
2019-10-22 10:12           ` Rasmus Villemoes
2019-10-22 15:06 ` Christophe Leroy
2019-10-25 12:40 ` [PATCH v2 00/23] QUICC Engine " Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 01/23] soc: fsl: qe: remove space-before-tab Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 02/23] soc: fsl: qe: drop volatile qualifier of struct qe_ic::regs Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 03/23] soc: fsl: qe: avoid ppc-specific io accessors Rasmus Villemoes
2019-10-29  7:43     ` Christophe Leroy
2019-10-29  8:43       ` ppc: inlining iowrite32be and friends (was: Re: [PATCH v2 03/23] soc: fsl: qe: avoid ppc-specific io accessors) Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 04/23] soc: fsl: qe: replace spin_event_timeout by readx_poll_timeout_atomic Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 05/23] soc: fsl: qe: qe.c: guard use of pvr_version_is() with CONFIG_PPC32 Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 06/23] soc: fsl: qe: avoid tail comments in qe_ic.h Rasmus Villemoes
2019-10-25 12:40   ` Rasmus Villemoes [this message]
2019-10-30 10:24     ` [PATCH v2 07/23] soc: fsl: qe: merge qe_ic.h into qe_ic.c Christophe Leroy
2019-10-25 12:40   ` [PATCH v2 08/23] soc: fsl: qe: drop unneeded #includes Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 09/23] soc: fsl: qe: move qe_ic_cascade_* functions to qe_ic.c Rasmus Villemoes
2019-10-30 10:45     ` Christophe Leroy
2019-10-25 12:40   ` [PATCH v2 10/23] soc: fsl: qe: use qe_ic_cascade_{low,high}_mpic also on 83xx Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 11/23] soc: fsl: qe: rename qe_ic_cascade_low_mpic -> qe_ic_cascade_low Rasmus Villemoes
2019-10-30 10:47     ` Christophe Leroy
2019-10-25 12:40   ` [PATCH v2 12/23] soc: fsl: qe: drop assign-only high_active in qe_ic_init Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 13/23] soc: fsl: qe: remove pointless sysfs registration in qe_ic.c Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 14/23] soc: fsl: qe: move calls of qe_ic_init out of arch/powerpc/ Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 15/23] powerpc/83xx: remove mpc83xx_ipic_and_qe_init_IRQ Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 16/23] powerpc/85xx: remove mostly pointless mpc85xx_qe_init() Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 17/23] soc: fsl: qe: make qe_ic_cascade_* static Rasmus Villemoes
2019-10-30 10:50     ` Christophe Leroy
2019-10-30 12:52       ` Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 18/23] soc: fsl: qe: remove unused qe_ic_set_* functions Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 19/23] net: ethernet: freescale: make UCC_GETH explicitly depend on PPC32 Rasmus Villemoes
2019-10-30 10:55     ` Christophe Leroy
2019-10-25 12:40   ` [PATCH v2 20/23] serial: make SERIAL_QE " Rasmus Villemoes
2019-10-29 22:44     ` Leo Li
2019-10-29 22:50       ` Rasmus Villemoes
2019-10-30 10:56     ` Christophe Leroy
2019-10-25 12:40   ` [PATCH v2 21/23] serial: ucc_uart.c: explicitly include asm/cpm.h Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 22/23] soc/fsl/qe/qe.h: remove include of asm/cpm.h Rasmus Villemoes
2019-10-25 12:40   ` [PATCH v2 23/23] soc: fsl: qe: remove PPC32 dependency from CONFIG_QUICC_ENGINE Rasmus Villemoes
2019-10-28 14:17     ` kbuild test robot
2019-10-28 14:49     ` kbuild test robot
2019-10-29  0:50     ` kbuild test robot
2019-11-01 12:41 ` [PATCH v3 00/36] QUICC Engine support on ARM Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 01/36] soc: fsl: qe: remove space-before-tab Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 02/36] soc: fsl: qe: drop volatile qualifier of struct qe_ic::regs Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 03/36] soc: fsl: qe: rename qe_(clr/set/clrset)bit* helpers Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 04/36] soc: fsl: qe: introduce qe_io{read,write}* wrappers Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 05/36] soc: fsl: qe: avoid ppc-specific io accessors Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 06/36] soc: fsl: qe: replace spin_event_timeout by readx_poll_timeout_atomic Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 07/36] soc: fsl: qe: qe.c: guard use of pvr_version_is() with CONFIG_PPC32 Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 08/36] soc: fsl: qe: drop unneeded #includes Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 09/36] soc: fsl: qe: drop assign-only high_active in qe_ic_init Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 10/36] soc: fsl: qe: remove pointless sysfs registration in qe_ic.c Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 11/36] soc: fsl: qe: use qe_ic_cascade_{low,high}_mpic also on 83xx Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 12/36] soc: fsl: qe: move calls of qe_ic_init out of arch/powerpc/ Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 13/36] powerpc/83xx: remove mpc83xx_ipic_and_qe_init_IRQ Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 14/36] powerpc/85xx: remove mostly pointless mpc85xx_qe_init() Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 15/36] soc: fsl: qe: move qe_ic_cascade_* functions to qe_ic.c Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 16/36] soc: fsl: qe: rename qe_ic_cascade_low_mpic -> qe_ic_cascade_low Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 17/36] soc: fsl: qe: remove unused qe_ic_set_* functions Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 18/36] soc: fsl: qe: don't use NO_IRQ in qe_ic.c Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 19/36] soc: fsl: qe: make qe_ic_get_{low,high}_irq static Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 20/36] soc: fsl: qe: simplify qe_ic_init() Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 21/36] soc: fsl: qe: merge qe_ic.h headers into qe_ic.c Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 22/36] soc: fsl: qe: qe.c: use of_property_read_* helpers Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 23/36] soc: fsl: qe: qe_io.c: don't open-code of_parse_phandle() Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 24/36] soc: fsl: qe: qe_io.c: access device tree property using be32_to_cpu Rasmus Villemoes
2019-11-01 12:41   ` [PATCH v3 25/36] soc: fsl: qe: qe_io.c: use of_property_read_u32() in par_io_init() Rasmus Villemoes
2019-11-01 12:42   ` [PATCH v3 26/36] soc: fsl: move cpm.h from powerpc/include/asm to include/soc/fsl Rasmus Villemoes
2019-11-01 16:18     ` Christophe Leroy
2019-11-01 16:59       ` Scott Wood
2019-11-01 12:42   ` [PATCH v3 27/36] soc/fsl/qe/qe.h: update include path for cpm.h Rasmus Villemoes
2019-11-01 12:42   ` [PATCH v3 28/36] serial: ucc_uart: explicitly include soc/fsl/cpm.h Rasmus Villemoes
2019-11-01 16:19     ` Christophe Leroy
2019-11-04  7:38       ` Rasmus Villemoes
2019-11-01 12:42   ` [PATCH v3 29/36] serial: ucc_uart: replace ppc-specific IO accessors Rasmus Villemoes
2019-11-01 12:42   ` [PATCH v3 30/36] serial: ucc_uart: factor out soft_uart initialization Rasmus Villemoes
2019-11-01 12:42   ` [PATCH v3 31/36] serial: ucc_uart: stub out soft_uart_init for !CONFIG_PPC32 Rasmus Villemoes
2019-11-01 16:27     ` Christophe Leroy
2019-11-04  8:03       ` Rasmus Villemoes
2019-11-01 12:42   ` [PATCH v3 32/36] serial: ucc_uart: use of_property_read_u32() in ucc_uart_probe() Rasmus Villemoes
2019-11-01 12:42   ` [PATCH v3 33/36] serial: ucc_uart: access __be32 field using be32_to_cpu Rasmus Villemoes
2019-11-01 12:42   ` [PATCH v3 34/36] net: ethernet: freescale: make UCC_GETH explicitly depend on PPC32 Rasmus Villemoes
2019-11-01 12:42   ` [PATCH v3 35/36] net/wan: make FSL_UCC_HDLC " Rasmus Villemoes
2019-11-01 16:29     ` Christophe Leroy
2019-11-01 22:31       ` Leo Li
2019-11-04  8:38         ` Rasmus Villemoes
2019-11-04 20:56           ` Li Yang
2019-11-05 22:46             ` Rasmus Villemoes
2019-11-05 23:46               ` Li Yang
2019-11-05  6:16           ` Qiang Zhao
2019-11-06  7:56             ` Rasmus Villemoes
2019-11-01 12:42   ` [PATCH v3 36/36] soc: fsl: qe: remove PPC32 dependency from CONFIG_QUICC_ENGINE Rasmus Villemoes
2019-11-02 17:39     ` kbuild test robot
2019-11-14 23:26     ` kbuild test robot
2019-11-14 23:26     ` [RFC PATCH] soc: fsl: qe: qe_uart_set_mctrl() can be static kbuild test robot
2019-11-15 13:31     ` [PATCH v3 36/36] soc: fsl: qe: remove PPC32 dependency from CONFIG_QUICC_ENGINE kbuild test robot
2019-11-15 13:42       ` Rasmus Villemoes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191025124058.22580-8-linux@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=christophe.leroy@c-s.fr \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=oss@buserror.net \
    --cc=qiang.zhao@nxp.com \
    --cc=valentin.longchamp@keymile.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).