* [PATCH v2 00/29] Add OF support to the sh-sci serial port driver
@ 2013-11-10 3:33 Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 01/29] serial: sh-sci: Sort headers alphabetically Laurent Pinchart
` (29 more replies)
0 siblings, 30 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt, devicetree
Hello,
This is the second version of the patch set adds device tree bindings for the
sh sci serial port devices and adds OF parsing to the sh-sci driver.
The bindings are based on Bastian Hecht's proposal (see
http://www.spinics.net/lists/arm-kernel/msg228129.html). The approach taken
here is more minimalistic: instead of describing all hardware characteristics
that vary between the SCI device revisions in DT (such as registers layout),
that information is stored in the driver and selected based on the compatible
property value. Only SCI revisions used on ARM devices are supported through
DT, as DT support for SuperH is nowhere down the line.
Patches 01/29 to 06/29 clean up the sh-sci driver. Patches 07/29 to 27/29
replace memory and interrupt resources passed through platform data with
platform resources. Beside replacing a custom mechanism with a standard one,
it will also make the DT parsing code simpler as resource allocation will be
shared between DT and non-DT code paths. Finally, patches 28/29 to 29/29 add
OF parsing to the sh-sci driver and create DT bindings documentation.
The patches have been test on a Lager board (r8a7790-based). Support for other
SoCs will be added as needed. Note that all current Renesas ARM SoCs seem to
be compatible with the generic (H)SCI(F)(AB) devices, but the plan is for
their DT bindings to list the SoC-specific version in case incompatibilities
are found later.
Patch 08/29 ("serial: sh-sci: Support resources passed through platform
resources") is the only dependency of the arch/arm and arch/sh patches present
in this series. As it's too late to get it in v3.13, Simon will need a stable
branch of the linux serial tree with that patch included.
Changes compared to v1:
- Patches 04/29 to 27/29 have been added
- Multi-interrupt support has been removed from the DT bindings as they don't
support any SoC requiring multi-interrupt yet
Cc: devicetree@vger.kernel.org
Bastian Hecht (1):
serial: sh-sci: Add OF support
Laurent Pinchart (28):
serial: sh-sci: Sort headers alphabetically
serial: sh-sci: Remove baud rate calculation algorithm 5
serial: sh-sci: Simplify baud rate calculation algorithms
serial: sh-sci: Remove duplicate interrupt check in verify port op
serial: sh-sci: Set the UPF_FIXED_PORT flag
serial: sh-sci: Don't check IRQ in verify port operation
serial: sh-sci: Support resources passed through platform resources
ARM: shmobile: sh7372: Use macros to declare SCIF devices
ARM: shmobile: sh73a0: Use macros to declare SCIF devices
ARM: shmobile: r8a7740: Use macros to declare SCIF devices
ARM: shmobile: r8a7779: Use macros to declare SCIF devices
ARM: shmobile: r7s72100: Don't define SCIF platform data in an array
ARM: shmobile: r8a73a4: Don't define SCIF platform data in an array
ARM: shmobile: r8a7778: Don't define SCIF platform data in an array
ARM: shmobile: r8a7790: Don't define SCIF platform data in an array
ARM: shmobile: r8a7791: Don't define SCIF platform data in an array
ARM: shmobile: sh7372: Declare SCIF register base and IRQ as resources
ARM: shmobile: sh73a0: Declare SCIF register base and IRQ as resources
ARM: shmobile: r7s72100: Declare SCIF register base and IRQ as
resources
ARM: shmobile: r8a73a4: Declare SCIF register base and IRQ as
resources
ARM: shmobile: r8a7740: Declare SCIF register base and IRQ as
resources
ARM: shmobile: r8a7778: Declare SCIF register base and IRQ as
resources
ARM: shmobile: r8a7779: Declare SCIF register base and IRQ as
resources
ARM: shmobile: r8a7790: Declare SCIF register base and IRQ as
resources
ARM: shmobile: r8a7791: Declare SCIF register base and IRQ as
resources
sh: Declare SCIF register base and IRQ as resources
serial: sh-sci: Remove platform data mapbase and irqs fields
serial: sh-sci: Add device tree bindings documentation
.../bindings/serial/renesas,sci-serial.txt | 42 ++++
arch/arm/mach-shmobile/setup-r7s72100.c | 63 +++---
arch/arm/mach-shmobile/setup-r8a73a4.c | 65 +++---
arch/arm/mach-shmobile/setup-r8a7740.c | 196 +++--------------
arch/arm/mach-shmobile/setup-r8a7778.c | 45 ++--
arch/arm/mach-shmobile/setup-r8a7779.c | 129 +++--------
arch/arm/mach-shmobile/setup-r8a7790.c | 117 +++++-----
arch/arm/mach-shmobile/setup-r8a7791.c | 130 +++++------
arch/arm/mach-shmobile/setup-sh7372.c | 161 +++-----------
arch/arm/mach-shmobile/setup-sh73a0.c | 192 +++--------------
arch/sh/kernel/cpu/sh2/setup-sh7619.c | 27 ++-
arch/sh/kernel/cpu/sh2a/setup-mxg.c | 9 +-
arch/sh/kernel/cpu/sh2a/setup-sh7201.c | 72 +++++--
arch/sh/kernel/cpu/sh2a/setup-sh7203.c | 36 +++-
arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 36 +++-
arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 96 +++++++--
arch/sh/kernel/cpu/sh2a/setup-sh7269.c | 96 +++++++--
arch/sh/kernel/cpu/sh3/setup-sh7705.c | 18 +-
arch/sh/kernel/cpu/sh3/setup-sh770x.c | 27 ++-
arch/sh/kernel/cpu/sh3/setup-sh7710.c | 18 +-
arch/sh/kernel/cpu/sh3/setup-sh7720.c | 18 +-
arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 15 +-
arch/sh/kernel/cpu/sh4/setup-sh7750.c | 18 +-
arch/sh/kernel/cpu/sh4/setup-sh7760.c | 58 +++--
arch/sh/kernel/cpu/sh4a/setup-sh7343.c | 36 +++-
arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 9 +-
arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 27 ++-
arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 54 +++--
arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 54 +++--
arch/sh/kernel/cpu/sh4a/setup-sh7734.c | 66 ++++--
arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 27 ++-
arch/sh/kernel/cpu/sh4a/setup-sh7763.c | 27 ++-
arch/sh/kernel/cpu/sh4a/setup-sh7770.c | 90 ++++++--
arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 18 +-
arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 54 +++--
arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 82 +++++--
arch/sh/kernel/cpu/sh4a/setup-shx3.c | 45 ++--
arch/sh/kernel/cpu/sh5/setup-sh5.c | 11 +-
drivers/tty/serial/sh-sci.c | 238 ++++++++++++++++-----
include/linux/serial_sci.h | 35 +--
40 files changed, 1443 insertions(+), 1114 deletions(-)
create mode 100644 Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v2 01/29] serial: sh-sci: Sort headers alphabetically
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 02/29] serial: sh-sci: Remove baud rate calculation algorithm 5 Laurent Pinchart
` (28 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
This helps locating duplicates.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/tty/serial/sh-sci.c | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 5377502..280753f 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -23,35 +23,35 @@
#undef DEBUG
-#include <linux/module.h>
+#include <linux/clk.h>
+#include <linux/console.h>
+#include <linux/ctype.h>
+#include <linux/cpufreq.h>
+#include <linux/delay.h>
+#include <linux/dmaengine.h>
+#include <linux/dma-mapping.h>
+#include <linux/err.h>
#include <linux/errno.h>
-#include <linux/sh_dma.h>
-#include <linux/timer.h>
+#include <linux/gpio.h>
+#include <linux/init.h>
#include <linux/interrupt.h>
-#include <linux/tty.h>
-#include <linux/tty_flip.h>
-#include <linux/serial.h>
-#include <linux/major.h>
-#include <linux/string.h>
-#include <linux/sysrq.h>
#include <linux/ioport.h>
+#include <linux/major.h>
+#include <linux/module.h>
#include <linux/mm.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/console.h>
-#include <linux/platform_device.h>
-#include <linux/serial_sci.h>
#include <linux/notifier.h>
+#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
-#include <linux/cpufreq.h>
-#include <linux/clk.h>
-#include <linux/ctype.h>
-#include <linux/err.h>
-#include <linux/dmaengine.h>
-#include <linux/dma-mapping.h>
#include <linux/scatterlist.h>
+#include <linux/serial.h>
+#include <linux/serial_sci.h>
+#include <linux/sh_dma.h>
#include <linux/slab.h>
-#include <linux/gpio.h>
+#include <linux/string.h>
+#include <linux/sysrq.h>
+#include <linux/timer.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
#ifdef CONFIG_SUPERH
#include <asm/sh_bios.h>
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 02/29] serial: sh-sci: Remove baud rate calculation algorithm 5
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 01/29] serial: sh-sci: Sort headers alphabetically Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 03/29] serial: sh-sci: Simplify baud rate calculation algorithms Laurent Pinchart
` (27 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
The algorithm isn't used, remove it.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/tty/serial/sh-sci.c | 2 --
include/linux/serial_sci.h | 1 -
2 files changed, 3 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 280753f..2fc1a0e 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1820,8 +1820,6 @@ static unsigned int sci_scbrr_calc(unsigned int algo_id, unsigned int bps,
return (((freq * 2) + 16 * bps) / (16 * bps) - 1);
case SCBRR_ALGO_4:
return (((freq * 2) + 16 * bps) / (32 * bps) - 1);
- case SCBRR_ALGO_5:
- return (((freq * 1000 / 32) / bps) - 1);
}
/* Warn, but use a safe default */
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index d340497..803068d 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -15,7 +15,6 @@ enum {
SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */
SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */
SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */
- SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */
SCBRR_ALGO_6, /* HSCIF variable sample rate algorithm */
};
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 03/29] serial: sh-sci: Simplify baud rate calculation algorithms
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 01/29] serial: sh-sci: Sort headers alphabetically Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 02/29] serial: sh-sci: Remove baud rate calculation algorithm 5 Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 04/29] serial: sh-sci: Remove duplicate interrupt check in verify port op Laurent Pinchart
` (26 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Rewrite the baud rate register value calculations in easier to read
forms. The computed value isn't modified.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/tty/serial/sh-sci.c | 8 ++++----
include/linux/serial_sci.h | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 2fc1a0e..91ce9214b 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1813,13 +1813,13 @@ static unsigned int sci_scbrr_calc(unsigned int algo_id, unsigned int bps,
{
switch (algo_id) {
case SCBRR_ALGO_1:
- return ((freq + 16 * bps) / (16 * bps) - 1);
+ return freq / (16 * bps);
case SCBRR_ALGO_2:
- return ((freq + 16 * bps) / (32 * bps) - 1);
+ return DIV_ROUND_CLOSEST(freq, 32 * bps) - 1;
case SCBRR_ALGO_3:
- return (((freq * 2) + 16 * bps) / (16 * bps) - 1);
+ return freq / (8 * bps);
case SCBRR_ALGO_4:
- return (((freq * 2) + 16 * bps) / (32 * bps) - 1);
+ return DIV_ROUND_CLOSEST(freq, 16 * bps) - 1;
}
/* Warn, but use a safe default */
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index 803068d..eb787d4 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -11,10 +11,10 @@
#define SCIx_NOT_SUPPORTED (-1)
enum {
- SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */
- SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */
- SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */
- SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */
+ SCBRR_ALGO_1, /* clk / (16 * bps) */
+ SCBRR_ALGO_2, /* DIV_ROUND_CLOSEST(clk, 32 * bps) - 1 */
+ SCBRR_ALGO_3, /* clk / (8 * bps) */
+ SCBRR_ALGO_4, /* DIV_ROUND_CLOSEST(clk, 16 * bps) - 1 */
SCBRR_ALGO_6, /* HSCIF variable sample rate algorithm */
};
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 04/29] serial: sh-sci: Remove duplicate interrupt check in verify port op
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (2 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 03/29] serial: sh-sci: Simplify baud rate calculation algorithms Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 05/29] serial: sh-sci: Set the UPF_FIXED_PORT flag Laurent Pinchart
` (25 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
The driver checks if the interrupt number is greater than nr_irqs and
returns an error in that case. The same check is already performed by
the caller, remove it.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
drivers/tty/serial/sh-sci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 91ce9214b..73b329380 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2115,7 +2115,7 @@ static int sci_verify_port(struct uart_port *port, struct serial_struct *ser)
{
struct sci_port *s = to_sci_port(port);
- if (ser->irq != s->cfg->irqs[SCIx_TXI_IRQ] || ser->irq > nr_irqs)
+ if (ser->irq != s->cfg->irqs[SCIx_TXI_IRQ])
return -EINVAL;
if (ser->baud_base < 2400)
/* No paper tape reader for Mitch.. */
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 05/29] serial: sh-sci: Set the UPF_FIXED_PORT flag
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (3 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 04/29] serial: sh-sci: Remove duplicate interrupt check in verify port op Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 06/29] serial: sh-sci: Don't check IRQ in verify port operation Laurent Pinchart
` (24 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
The base address, IRQ and baud rate generator parent clock rate can't be
changed by userspace. Mark the port as fixed.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
drivers/tty/serial/sh-sci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 73b329380..47b0ee6 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2243,7 +2243,7 @@ static int sci_init_single(struct platform_device *dev,
port->mapbase = p->mapbase;
port->type = p->type;
- port->flags = p->flags;
+ port->flags = UPF_FIXED_PORT | p->flags;
port->regshift = p->regshift;
/*
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 06/29] serial: sh-sci: Don't check IRQ in verify port operation
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (4 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 05/29] serial: sh-sci: Set the UPF_FIXED_PORT flag Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 07/29] serial: sh-sci: Support resources passed through platform resources Laurent Pinchart
` (23 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
The IRQ number can't be modified by the user as the port is fixed.
There's no need to check the new IRQ number as it will be ignored by the
core.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
drivers/tty/serial/sh-sci.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 47b0ee6..b0c9d24 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2113,10 +2113,6 @@ static void sci_config_port(struct uart_port *port, int flags)
static int sci_verify_port(struct uart_port *port, struct serial_struct *ser)
{
- struct sci_port *s = to_sci_port(port);
-
- if (ser->irq != s->cfg->irqs[SCIx_TXI_IRQ])
- return -EINVAL;
if (ser->baud_base < 2400)
/* No paper tape reader for Mitch.. */
return -EINVAL;
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 07/29] serial: sh-sci: Support resources passed through platform resources
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (5 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 06/29] serial: sh-sci: Don't check IRQ in verify port operation Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 08/29] ARM: shmobile: sh7372: Use macros to declare SCIF devices Laurent Pinchart
` (22 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Memory and IRQ resources are currently passed to the driver through
platform data. Support passing them through the standard platform
resources mechanism instead. This deprecates platform data resources.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
drivers/tty/serial/sh-sci.c | 65 ++++++++++++++++++++++++++++++++++-----------
include/linux/serial_sci.h | 8 +++---
2 files changed, 53 insertions(+), 20 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index b0c9d24..c5abe5c 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -74,6 +74,7 @@ struct sci_port {
/* Function clock */
struct clk *fclk;
+ int irqs[SCIx_NR_IRQS];
char *irqstr[SCIx_NR_IRQS];
char *gpiostr[SCIx_NR_FNS];
@@ -1075,19 +1076,19 @@ static int sci_request_irq(struct sci_port *port)
for (i = j = 0; i < SCIx_NR_IRQS; i++, j++) {
struct sci_irq_desc *desc;
- unsigned int irq;
+ int irq;
if (SCIx_IRQ_IS_MUXED(port)) {
i = SCIx_MUX_IRQ;
irq = up->irq;
} else {
- irq = port->cfg->irqs[i];
+ irq = port->irqs[i];
/*
* Certain port types won't support all of the
* available interrupt sources.
*/
- if (unlikely(!irq))
+ if (unlikely(irq < 0))
continue;
}
@@ -1112,7 +1113,7 @@ static int sci_request_irq(struct sci_port *port)
out_noirq:
while (--i >= 0)
- free_irq(port->cfg->irqs[i], port);
+ free_irq(port->irqs[i], port);
out_nomem:
while (--j >= 0)
@@ -1130,16 +1131,16 @@ static void sci_free_irq(struct sci_port *port)
* IRQ first.
*/
for (i = 0; i < SCIx_NR_IRQS; i++) {
- unsigned int irq = port->cfg->irqs[i];
+ int irq = port->irqs[i];
/*
* Certain port types won't support all of the available
* interrupt sources.
*/
- if (unlikely(!irq))
+ if (unlikely(irq < 0))
continue;
- free_irq(port->cfg->irqs[i], port);
+ free_irq(port->irqs[i], port);
kfree(port->irqstr[i]);
if (SCIx_IRQ_IS_MUXED(port)) {
@@ -1655,7 +1656,7 @@ static void rx_timer_fn(unsigned long arg)
if (port->type = PORT_SCIFA || port->type = PORT_SCIFB) {
scr &= ~0x4000;
- enable_irq(s->cfg->irqs[1]);
+ enable_irq(s->irqs[SCIx_RXI_IRQ]);
}
serial_port_out(port, SCSCR, scr | SCSCR_RIE);
dev_dbg(port->dev, "DMA Rx timed out\n");
@@ -2145,11 +2146,12 @@ static struct uart_ops sci_uart_ops = {
};
static int sci_init_single(struct platform_device *dev,
- struct sci_port *sci_port,
- unsigned int index,
- struct plat_sci_port *p)
+ struct sci_port *sci_port, unsigned int index,
+ struct plat_sci_port *p, bool early)
{
struct uart_port *port = &sci_port->port;
+ const struct resource *res;
+ unsigned int i;
int ret;
sci_port->cfg = p;
@@ -2158,6 +2160,38 @@ static int sci_init_single(struct platform_device *dev,
port->iotype = UPIO_MEM;
port->line = index;
+ if (dev->num_resources) {
+ /* Device has resources, use them. */
+ res = platform_get_resource(dev, IORESOURCE_MEM, 0);
+ if (res = NULL)
+ return -ENOMEM;
+
+ port->mapbase = res->start;
+
+ for (i = 0; i < ARRAY_SIZE(sci_port->irqs); ++i)
+ sci_port->irqs[i] = platform_get_irq(dev, i);
+
+ /* The SCI generates several interrupts. They can be muxed
+ * together or connected to different interrupt lines. In the
+ * muxed case only one interrupt resource is specified. In the
+ * non-muxed case three or four interrupt resources are
+ * specified, as the BRI interrupt is optional.
+ */
+ if (sci_port->irqs[0] < 0)
+ return -ENXIO;
+
+ if (sci_port->irqs[1] < 0) {
+ sci_port->irqs[1] = sci_port->irqs[0];
+ sci_port->irqs[2] = sci_port->irqs[0];
+ sci_port->irqs[3] = sci_port->irqs[0];
+ }
+ } else {
+ /* No resources, use old-style platform data. */
+ port->mapbase = p->mapbase;
+ for (i = 0; i < ARRAY_SIZE(sci_port->irqs); ++i)
+ sci_port->irqs[i] = p->irqs[i] ? p->irqs[i] : -ENXIO;
+ }
+
switch (p->type) {
case PORT_SCIFB:
port->fifosize = 256;
@@ -2182,7 +2216,7 @@ static int sci_init_single(struct platform_device *dev,
return ret;
}
- if (dev) {
+ if (!early) {
sci_port->iclk = clk_get(&dev->dev, "sci_ick");
if (IS_ERR(sci_port->iclk)) {
sci_port->iclk = clk_get(&dev->dev, "peripheral_clk");
@@ -2237,7 +2271,6 @@ static int sci_init_single(struct platform_device *dev,
p->error_mask |= (1 << p->overrun_bit);
}
- port->mapbase = p->mapbase;
port->type = p->type;
port->flags = UPF_FIXED_PORT | p->flags;
port->regshift = p->regshift;
@@ -2249,7 +2282,7 @@ static int sci_init_single(struct platform_device *dev,
*
* For the muxed case there's nothing more to do.
*/
- port->irq = p->irqs[SCIx_RXI_IRQ];
+ port->irq = sci_port->irqs[SCIx_RXI_IRQ];
port->irqflags = 0;
port->serial_in = sci_serial_in;
@@ -2381,7 +2414,7 @@ static int sci_probe_earlyprintk(struct platform_device *pdev)
early_serial_console.index = pdev->id;
- sci_init_single(NULL, &sci_ports[pdev->id], pdev->id, cfg);
+ sci_init_single(pdev, &sci_ports[pdev->id], pdev->id, cfg, true);
serial_console_setup(&early_serial_console, early_serial_buf);
@@ -2448,7 +2481,7 @@ static int sci_probe_single(struct platform_device *dev,
return -EINVAL;
}
- ret = sci_init_single(dev, sciport, index, p);
+ ret = sci_init_single(dev, sciport, index, p, false);
if (ret)
return ret;
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index eb787d4..68cf0bf 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -107,10 +107,10 @@ enum {
}
#define SCIx_IRQ_IS_MUXED(port) \
- ((port)->cfg->irqs[SCIx_ERI_IRQ] = \
- (port)->cfg->irqs[SCIx_RXI_IRQ]) || \
- ((port)->cfg->irqs[SCIx_ERI_IRQ] && \
- !(port)->cfg->irqs[SCIx_RXI_IRQ])
+ ((port)->irqs[SCIx_ERI_IRQ] = \
+ (port)->irqs[SCIx_RXI_IRQ]) || \
+ ((port)->irqs[SCIx_ERI_IRQ] && \
+ ((port)->irqs[SCIx_RXI_IRQ] < 0))
/*
* SCI register subset common for all port types.
* Not all registers will exist on all parts.
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 08/29] ARM: shmobile: sh7372: Use macros to declare SCIF devices
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (6 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 07/29] serial: sh-sci: Support resources passed through platform resources Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 09/29] ARM: shmobile: sh73a0: " Laurent Pinchart
` (21 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Replace copy-n-paste SCIF platform data and device declaration with a
macro. This reduces the amount of code and improves readability.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-sh7372.c | 156 ++++++----------------------------
1 file changed, 25 insertions(+), 131 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index 3118783..77627dd 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -86,138 +86,32 @@ void __init sh7372_pinmux_init(void)
platform_device_register(&sh7372_pfc_device);
}
-/* SCIFA0 */
-static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xe6c40000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { evt2irq(0x0c00), evt2irq(0x0c00),
- evt2irq(0x0c00), evt2irq(0x0c00) },
-};
-
-static struct platform_device scif0_device = {
- .name = "sh-sci",
- .id = 0,
- .dev = {
- .platform_data = &scif0_platform_data,
- },
-};
-
-/* SCIFA1 */
-static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xe6c50000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { evt2irq(0x0c20), evt2irq(0x0c20),
- evt2irq(0x0c20), evt2irq(0x0c20) },
-};
-
-static struct platform_device scif1_device = {
- .name = "sh-sci",
- .id = 1,
- .dev = {
- .platform_data = &scif1_platform_data,
- },
-};
-
-/* SCIFA2 */
-static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xe6c60000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { evt2irq(0x0c40), evt2irq(0x0c40),
- evt2irq(0x0c40), evt2irq(0x0c40) },
-};
-
-static struct platform_device scif2_device = {
- .name = "sh-sci",
- .id = 2,
- .dev = {
- .platform_data = &scif2_platform_data,
- },
-};
-
-/* SCIFA3 */
-static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xe6c70000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { evt2irq(0x0c60), evt2irq(0x0c60),
- evt2irq(0x0c60), evt2irq(0x0c60) },
-};
-
-static struct platform_device scif3_device = {
- .name = "sh-sci",
- .id = 3,
- .dev = {
- .platform_data = &scif3_platform_data,
- },
-};
-
-/* SCIFA4 */
-static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xe6c80000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { evt2irq(0x0d20), evt2irq(0x0d20),
- evt2irq(0x0d20), evt2irq(0x0d20) },
-};
-
-static struct platform_device scif4_device = {
- .name = "sh-sci",
- .id = 4,
- .dev = {
- .platform_data = &scif4_platform_data,
- },
-};
-
-/* SCIFA5 */
-static struct plat_sci_port scif5_platform_data = {
- .mapbase = 0xe6cb0000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { evt2irq(0x0d40), evt2irq(0x0d40),
- evt2irq(0x0d40), evt2irq(0x0d40) },
-};
-
-static struct platform_device scif5_device = {
- .name = "sh-sci",
- .id = 5,
- .dev = {
- .platform_data = &scif5_platform_data,
- },
-};
-
-/* SCIFB */
-static struct plat_sci_port scif6_platform_data = {
- .mapbase = 0xe6c30000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFB,
- .irqs = { evt2irq(0x0d60), evt2irq(0x0d60),
- evt2irq(0x0d60), evt2irq(0x0d60) },
-};
+/* SCIF */
+#define SH7372_SCIF(scif_type, index, baseaddr, irq) \
+static struct plat_sci_port scif##index##_platform_data = { \
+ .type = scif_type, \
+ .mapbase = baseaddr, \
+ .flags = UPF_BOOT_AUTOCONF, \
+ .irqs = SCIx_IRQ_MUXED(irq), \
+ .scbrr_algo_id = SCBRR_ALGO_4, \
+ .scscr = SCSCR_RE | SCSCR_TE, \
+}; \
+ \
+static struct platform_device scif##index##_device = { \
+ .name = "sh-sci", \
+ .id = index, \
+ .dev = { \
+ .platform_data = &scif##index##_platform_data, \
+ }, \
+}
-static struct platform_device scif6_device = {
- .name = "sh-sci",
- .id = 6,
- .dev = {
- .platform_data = &scif6_platform_data,
- },
-};
+SH7372_SCIF(PORT_SCIFA, 0, 0xe6c40000, evt2irq(0x0c00));
+SH7372_SCIF(PORT_SCIFA, 1, 0xe6c50000, evt2irq(0x0c20));
+SH7372_SCIF(PORT_SCIFA, 2, 0xe6c60000, evt2irq(0x0c40));
+SH7372_SCIF(PORT_SCIFA, 3, 0xe6c70000, evt2irq(0x0c60));
+SH7372_SCIF(PORT_SCIFA, 4, 0xe6c80000, evt2irq(0x0d20));
+SH7372_SCIF(PORT_SCIFA, 5, 0xe6cb0000, evt2irq(0x0d40));
+SH7372_SCIF(PORT_SCIFB, 6, 0xe6c30000, evt2irq(0x0d60));
/* CMT */
static struct sh_timer_config cmt2_platform_data = {
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 09/29] ARM: shmobile: sh73a0: Use macros to declare SCIF devices
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (7 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 08/29] ARM: shmobile: sh7372: Use macros to declare SCIF devices Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 10/29] ARM: shmobile: r8a7740: " Laurent Pinchart
` (20 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Replace copy-n-paste SCIF platform data and device declaration with a
macro. This reduces the amount of code and improves readability.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-sh73a0.c | 187 +++++-----------------------------
1 file changed, 27 insertions(+), 160 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index 65151c4..9c94f34 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -71,167 +71,34 @@ void __init sh73a0_pinmux_init(void)
ARRAY_SIZE(pfc_resources));
}
-static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xe6c40000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { gic_spi(72), gic_spi(72),
- gic_spi(72), gic_spi(72) },
-};
-
-static struct platform_device scif0_device = {
- .name = "sh-sci",
- .id = 0,
- .dev = {
- .platform_data = &scif0_platform_data,
- },
-};
-
-static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xe6c50000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { gic_spi(73), gic_spi(73),
- gic_spi(73), gic_spi(73) },
-};
-
-static struct platform_device scif1_device = {
- .name = "sh-sci",
- .id = 1,
- .dev = {
- .platform_data = &scif1_platform_data,
- },
-};
-
-static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xe6c60000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { gic_spi(74), gic_spi(74),
- gic_spi(74), gic_spi(74) },
-};
-
-static struct platform_device scif2_device = {
- .name = "sh-sci",
- .id = 2,
- .dev = {
- .platform_data = &scif2_platform_data,
- },
-};
-
-static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xe6c70000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { gic_spi(75), gic_spi(75),
- gic_spi(75), gic_spi(75) },
-};
-
-static struct platform_device scif3_device = {
- .name = "sh-sci",
- .id = 3,
- .dev = {
- .platform_data = &scif3_platform_data,
- },
-};
-
-static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xe6c80000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { gic_spi(78), gic_spi(78),
- gic_spi(78), gic_spi(78) },
-};
-
-static struct platform_device scif4_device = {
- .name = "sh-sci",
- .id = 4,
- .dev = {
- .platform_data = &scif4_platform_data,
- },
-};
-
-static struct plat_sci_port scif5_platform_data = {
- .mapbase = 0xe6cb0000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { gic_spi(79), gic_spi(79),
- gic_spi(79), gic_spi(79) },
-};
-
-static struct platform_device scif5_device = {
- .name = "sh-sci",
- .id = 5,
- .dev = {
- .platform_data = &scif5_platform_data,
- },
-};
-
-static struct plat_sci_port scif6_platform_data = {
- .mapbase = 0xe6cc0000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { gic_spi(156), gic_spi(156),
- gic_spi(156), gic_spi(156) },
-};
-
-static struct platform_device scif6_device = {
- .name = "sh-sci",
- .id = 6,
- .dev = {
- .platform_data = &scif6_platform_data,
- },
-};
-
-static struct plat_sci_port scif7_platform_data = {
- .mapbase = 0xe6cd0000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = { gic_spi(143), gic_spi(143),
- gic_spi(143), gic_spi(143) },
-};
-
-static struct platform_device scif7_device = {
- .name = "sh-sci",
- .id = 7,
- .dev = {
- .platform_data = &scif7_platform_data,
- },
-};
-
-static struct plat_sci_port scif8_platform_data = {
- .mapbase = 0xe6c30000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFB,
- .irqs = { gic_spi(80), gic_spi(80),
- gic_spi(80), gic_spi(80) },
-};
+/* SCIF */
+#define SH73A0_SCIF(scif_type, index, baseaddr, irq) \
+static struct plat_sci_port scif##index##_platform_data = { \
+ .type = scif_type, \
+ .mapbase = baseaddr, \
+ .flags = UPF_BOOT_AUTOCONF, \
+ .irqs = SCIx_IRQ_MUXED(irq), \
+ .scbrr_algo_id = SCBRR_ALGO_4, \
+ .scscr = SCSCR_RE | SCSCR_TE, \
+}; \
+ \
+static struct platform_device scif##index##_device = { \
+ .name = "sh-sci", \
+ .id = index, \
+ .dev = { \
+ .platform_data = &scif##index##_platform_data, \
+ }, \
+}
-static struct platform_device scif8_device = {
- .name = "sh-sci",
- .id = 8,
- .dev = {
- .platform_data = &scif8_platform_data,
- },
-};
+SH73A0_SCIF(PORT_SCIFA, 0, 0xe6c40000, gic_spi(72));
+SH73A0_SCIF(PORT_SCIFA, 1, 0xe6c50000, gic_spi(73));
+SH73A0_SCIF(PORT_SCIFA, 2, 0xe6c60000, gic_spi(74));
+SH73A0_SCIF(PORT_SCIFA, 3, 0xe6c70000, gic_spi(75));
+SH73A0_SCIF(PORT_SCIFA, 4, 0xe6c80000, gic_spi(78));
+SH73A0_SCIF(PORT_SCIFA, 5, 0xe6cb0000, gic_spi(79));
+SH73A0_SCIF(PORT_SCIFA, 6, 0xe6cc0000, gic_spi(156));
+SH73A0_SCIF(PORT_SCIFA, 7, 0xe6cd0000, gic_spi(143));
+SH73A0_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(80));
static struct sh_timer_config cmt10_platform_data = {
.name = "CMT10",
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 10/29] ARM: shmobile: r8a7740: Use macros to declare SCIF devices
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (8 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 09/29] ARM: shmobile: sh73a0: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 11/29] ARM: shmobile: r8a7779: " Laurent Pinchart
` (19 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Replace copy-n-paste SCIF platform data and device declaration with a
macro. This reduces the amount of code and improves readability.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r8a7740.c | 191 +++++----------------------------
1 file changed, 29 insertions(+), 162 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index b7d4b2c..8778b57 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -203,167 +203,34 @@ static struct platform_device irqpin3_device = {
},
};
-/* SCIFA0 */
-static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xe6c40000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(gic_spi(100)),
-};
-
-static struct platform_device scif0_device = {
- .name = "sh-sci",
- .id = 0,
- .dev = {
- .platform_data = &scif0_platform_data,
- },
-};
-
-/* SCIFA1 */
-static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xe6c50000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(gic_spi(101)),
-};
-
-static struct platform_device scif1_device = {
- .name = "sh-sci",
- .id = 1,
- .dev = {
- .platform_data = &scif1_platform_data,
- },
-};
-
-/* SCIFA2 */
-static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xe6c60000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(gic_spi(102)),
-};
-
-static struct platform_device scif2_device = {
- .name = "sh-sci",
- .id = 2,
- .dev = {
- .platform_data = &scif2_platform_data,
- },
-};
-
-/* SCIFA3 */
-static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xe6c70000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(gic_spi(103)),
-};
-
-static struct platform_device scif3_device = {
- .name = "sh-sci",
- .id = 3,
- .dev = {
- .platform_data = &scif3_platform_data,
- },
-};
-
-/* SCIFA4 */
-static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xe6c80000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(gic_spi(104)),
-};
-
-static struct platform_device scif4_device = {
- .name = "sh-sci",
- .id = 4,
- .dev = {
- .platform_data = &scif4_platform_data,
- },
-};
-
-/* SCIFA5 */
-static struct plat_sci_port scif5_platform_data = {
- .mapbase = 0xe6cb0000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(gic_spi(105)),
-};
-
-static struct platform_device scif5_device = {
- .name = "sh-sci",
- .id = 5,
- .dev = {
- .platform_data = &scif5_platform_data,
- },
-};
-
-/* SCIFA6 */
-static struct plat_sci_port scif6_platform_data = {
- .mapbase = 0xe6cc0000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(gic_spi(106)),
-};
-
-static struct platform_device scif6_device = {
- .name = "sh-sci",
- .id = 6,
- .dev = {
- .platform_data = &scif6_platform_data,
- },
-};
-
-/* SCIFA7 */
-static struct plat_sci_port scif7_platform_data = {
- .mapbase = 0xe6cd0000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(gic_spi(107)),
-};
-
-static struct platform_device scif7_device = {
- .name = "sh-sci",
- .id = 7,
- .dev = {
- .platform_data = &scif7_platform_data,
- },
-};
-
-/* SCIFB */
-static struct plat_sci_port scifb_platform_data = {
- .mapbase = 0xe6c30000,
- .flags = UPF_BOOT_AUTOCONF,
- .scscr = SCSCR_RE | SCSCR_TE,
- .scbrr_algo_id = SCBRR_ALGO_4,
- .type = PORT_SCIFB,
- .irqs = SCIx_IRQ_MUXED(gic_spi(108)),
-};
+/* SCIF */
+#define R8A7740_SCIF(scif_type, index, baseaddr, irq) \
+static struct plat_sci_port scif##index##_platform_data = { \
+ .type = scif_type, \
+ .mapbase = baseaddr, \
+ .flags = UPF_BOOT_AUTOCONF, \
+ .irqs = SCIx_IRQ_MUXED(irq), \
+ .scbrr_algo_id = SCBRR_ALGO_4, \
+ .scscr = SCSCR_RE | SCSCR_TE, \
+}; \
+ \
+static struct platform_device scif##index##_device = { \
+ .name = "sh-sci", \
+ .id = index, \
+ .dev = { \
+ .platform_data = &scif##index##_platform_data, \
+ }, \
+}
-static struct platform_device scifb_device = {
- .name = "sh-sci",
- .id = 8,
- .dev = {
- .platform_data = &scifb_platform_data,
- },
-};
+R8A7740_SCIF(PORT_SCIFA, 0, 0xe6c40000, gic_spi(100));
+R8A7740_SCIF(PORT_SCIFA, 1, 0xe6c50000, gic_spi(101));
+R8A7740_SCIF(PORT_SCIFA, 2, 0xe6c60000, gic_spi(102));
+R8A7740_SCIF(PORT_SCIFA, 3, 0xe6c70000, gic_spi(103));
+R8A7740_SCIF(PORT_SCIFA, 4, 0xe6c80000, gic_spi(104));
+R8A7740_SCIF(PORT_SCIFA, 5, 0xe6cb0000, gic_spi(105));
+R8A7740_SCIF(PORT_SCIFA, 6, 0xe6cc0000, gic_spi(106));
+R8A7740_SCIF(PORT_SCIFA, 7, 0xe6cd0000, gic_spi(107));
+R8A7740_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(108));
/* CMT */
static struct sh_timer_config cmt10_platform_data = {
@@ -528,7 +395,7 @@ static struct platform_device *r8a7740_devices_dt[] __initdata = {
&scif5_device,
&scif6_device,
&scif7_device,
- &scifb_device,
+ &scif8_device,
&cmt10_device,
};
@@ -981,7 +848,7 @@ void __init r8a7740_add_standard_devices(void)
rmobile_add_device_to_domain("A3SP", &scif5_device);
rmobile_add_device_to_domain("A3SP", &scif6_device);
rmobile_add_device_to_domain("A3SP", &scif7_device);
- rmobile_add_device_to_domain("A3SP", &scifb_device);
+ rmobile_add_device_to_domain("A3SP", &scif8_device);
rmobile_add_device_to_domain("A3SP", &i2c1_device);
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 11/29] ARM: shmobile: r8a7779: Use macros to declare SCIF devices
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (9 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 10/29] ARM: shmobile: r8a7740: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 12/29] ARM: shmobile: r7s72100: Don't define SCIF platform data in an array Laurent Pinchart
` (18 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Replace copy-n-paste SCIF platform data and device declaration with a
macro. This reduces the amount of code and improves readability.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r8a7779.c | 124 +++++++--------------------------
1 file changed, 24 insertions(+), 100 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 51a43c5..79cdb8a 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -188,107 +188,31 @@ void __init r8a7779_pinmux_init(void)
ARRAY_SIZE(r8a7779_pinctrl_devices));
}
-static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xffe40000,
- .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
- .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
- .scbrr_algo_id = SCBRR_ALGO_2,
- .type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(gic_iid(0x78)),
-};
-
-static struct platform_device scif0_device = {
- .name = "sh-sci",
- .id = 0,
- .dev = {
- .platform_data = &scif0_platform_data,
- },
-};
-
-static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xffe41000,
- .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
- .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
- .scbrr_algo_id = SCBRR_ALGO_2,
- .type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(gic_iid(0x79)),
-};
-
-static struct platform_device scif1_device = {
- .name = "sh-sci",
- .id = 1,
- .dev = {
- .platform_data = &scif1_platform_data,
- },
-};
-
-static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xffe42000,
- .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
- .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
- .scbrr_algo_id = SCBRR_ALGO_2,
- .type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(gic_iid(0x7a)),
-};
-
-static struct platform_device scif2_device = {
- .name = "sh-sci",
- .id = 2,
- .dev = {
- .platform_data = &scif2_platform_data,
- },
-};
-
-static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xffe43000,
- .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
- .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
- .scbrr_algo_id = SCBRR_ALGO_2,
- .type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(gic_iid(0x7b)),
-};
-
-static struct platform_device scif3_device = {
- .name = "sh-sci",
- .id = 3,
- .dev = {
- .platform_data = &scif3_platform_data,
- },
-};
-
-static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xffe44000,
- .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
- .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
- .scbrr_algo_id = SCBRR_ALGO_2,
- .type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(gic_iid(0x7c)),
-};
-
-static struct platform_device scif4_device = {
- .name = "sh-sci",
- .id = 4,
- .dev = {
- .platform_data = &scif4_platform_data,
- },
-};
-
-static struct plat_sci_port scif5_platform_data = {
- .mapbase = 0xffe45000,
- .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
- .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
- .scbrr_algo_id = SCBRR_ALGO_2,
- .type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(gic_iid(0x7d)),
-};
+/* SCIF */
+#define R8A7779_SCIF(index, baseaddr, irq) \
+static struct plat_sci_port scif##index##_platform_data = { \
+ .type = PORT_SCIF, \
+ .mapbase = baseaddr, \
+ .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
+ .irqs = SCIx_IRQ_MUXED(irq), \
+ .scbrr_algo_id = SCBRR_ALGO_2, \
+ .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, \
+}; \
+ \
+static struct platform_device scif##index##_device = { \
+ .name = "sh-sci", \
+ .id = index, \
+ .dev = { \
+ .platform_data = &scif##index##_platform_data, \
+ }, \
+}
-static struct platform_device scif5_device = {
- .name = "sh-sci",
- .id = 5,
- .dev = {
- .platform_data = &scif5_platform_data,
- },
-};
+R8A7779_SCIF(0, 0xffe40000, gic_iid(0x78));
+R8A7779_SCIF(1, 0xffe41000, gic_iid(0x79));
+R8A7779_SCIF(2, 0xffe42000, gic_iid(0x7a));
+R8A7779_SCIF(3, 0xffe43000, gic_iid(0x7b));
+R8A7779_SCIF(4, 0xffe44000, gic_iid(0x7c));
+R8A7779_SCIF(5, 0xffe45000, gic_iid(0x7d));
/* TMU */
static struct sh_timer_config tmu00_platform_data = {
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 12/29] ARM: shmobile: r7s72100: Don't define SCIF platform data in an array
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (10 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 11/29] ARM: shmobile: r8a7779: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 18:35 ` Sergei Shtylyov
2013-11-10 3:33 ` [PATCH v2 13/29] ARM: shmobile: r8a73a4: " Laurent Pinchart
` (17 subsequent siblings)
29 siblings, 1 reply; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
The SCIF driver is transitioning to platform resources. Board code will
thus need to define an array of resources for each SCIF device. This is
incompatible with the macro-based SCIF platform data definition as an
array. Rework the macro to define platform data as individual
structures.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r7s72100.c | 49 +++++++++++++++------------------
1 file changed, 22 insertions(+), 27 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c
index d4eb509..dbcbb81 100644
--- a/arch/arm/mach-shmobile/setup-r7s72100.c
+++ b/arch/arm/mach-shmobile/setup-r7s72100.c
@@ -27,8 +27,8 @@
#include <mach/r7s72100.h>
#include <asm/mach/arch.h>
-#define SCIF_DATA(index, baseaddr, irq) \
-[index] = { \
+#define R7S72100_SCIF(index, baseaddr, irq) \
+static const struct plat_sci_port scif##index##_platform_data = { \
.type = PORT_SCIF, \
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE, \
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
@@ -39,35 +39,30 @@
.irqs = { irq + 1, irq + 2, irq + 3, irq }, \
}
-enum { SCIF0, SCIF1, SCIF2, SCIF3, SCIF4, SCIF5, SCIF6, SCIF7 };
+R7S72100_SCIF(0, 0xe8007000, gic_iid(221));
+R7S72100_SCIF(1, 0xe8007800, gic_iid(225));
+R7S72100_SCIF(2, 0xe8008000, gic_iid(229));
+R7S72100_SCIF(3, 0xe8008800, gic_iid(233));
+R7S72100_SCIF(4, 0xe8009000, gic_iid(237));
+R7S72100_SCIF(5, 0xe8009800, gic_iid(241));
+R7S72100_SCIF(6, 0xe800a000, gic_iid(245));
+R7S72100_SCIF(7, 0xe800a800, gic_iid(249));
-static const struct plat_sci_port scif[] __initconst = {
- SCIF_DATA(SCIF0, 0xe8007000, gic_iid(221)), /* SCIF0 */
- SCIF_DATA(SCIF1, 0xe8007800, gic_iid(225)), /* SCIF1 */
- SCIF_DATA(SCIF2, 0xe8008000, gic_iid(229)), /* SCIF2 */
- SCIF_DATA(SCIF3, 0xe8008800, gic_iid(233)), /* SCIF3 */
- SCIF_DATA(SCIF4, 0xe8009000, gic_iid(237)), /* SCIF4 */
- SCIF_DATA(SCIF5, 0xe8009800, gic_iid(241)), /* SCIF5 */
- SCIF_DATA(SCIF6, 0xe800a000, gic_iid(245)), /* SCIF6 */
- SCIF_DATA(SCIF7, 0xe800a800, gic_iid(249)), /* SCIF7 */
-};
-
-static inline void r7s72100_register_scif(int idx)
-{
- platform_device_register_data(&platform_bus, "sh-sci", idx, &scif[idx],
- sizeof(struct plat_sci_port));
-}
+#define r7s72100_register_scif(index) \
+ platform_device_register_data(&platform_bus, "sh-sci", index, \
+ &scif##index##_platform_data, \
+ sizeof(scif##index##_platform_data))
void __init r7s72100_add_dt_devices(void)
{
- r7s72100_register_scif(SCIF0);
- r7s72100_register_scif(SCIF1);
- r7s72100_register_scif(SCIF2);
- r7s72100_register_scif(SCIF3);
- r7s72100_register_scif(SCIF4);
- r7s72100_register_scif(SCIF5);
- r7s72100_register_scif(SCIF6);
- r7s72100_register_scif(SCIF7);
+ r7s72100_register_scif(0);
+ r7s72100_register_scif(1);
+ r7s72100_register_scif(2);
+ r7s72100_register_scif(3);
+ r7s72100_register_scif(4);
+ r7s72100_register_scif(5);
+ r7s72100_register_scif(6);
+ r7s72100_register_scif(7);
}
void __init r7s72100_init_early(void)
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 13/29] ARM: shmobile: r8a73a4: Don't define SCIF platform data in an array
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (11 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 12/29] ARM: shmobile: r7s72100: Don't define SCIF platform data in an array Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 14/29] ARM: shmobile: r8a7778: " Laurent Pinchart
` (16 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
The SCIF driver is transitioning to platform resources. Board code will
thus need to define an array of resources for each SCIF device. This is
incompatible with the macro-based SCIF platform data definition as an
array. Rework the macro to define platform data as individual
structures.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r8a73a4.c | 58 +++++++++++++++-------------------
1 file changed, 26 insertions(+), 32 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c
index cc94b64..605298b 100644
--- a/arch/arm/mach-shmobile/setup-r8a73a4.c
+++ b/arch/arm/mach-shmobile/setup-r8a73a4.c
@@ -40,41 +40,35 @@ void __init r8a73a4_pinmux_init(void)
ARRAY_SIZE(pfc_resources));
}
-#define SCIF_COMMON(scif_type, baseaddr, irq) \
+#define R8A73A4_SCIF(scif_type, _scscr, index, baseaddr, irq) \
+static struct plat_sci_port scif##index##_platform_data = { \
.type = scif_type, \
.mapbase = baseaddr, \
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
.scbrr_algo_id = SCBRR_ALGO_4, \
- .irqs = SCIx_IRQ_MUXED(irq)
-
-#define SCIFA_DATA(index, baseaddr, irq) \
-[index] = { \
- SCIF_COMMON(PORT_SCIFA, baseaddr, irq), \
- .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE0, \
+ .scscr = _scscr, \
+ .irqs = SCIx_IRQ_MUXED(irq), \
}
-#define SCIFB_DATA(index, baseaddr, irq) \
-[index] = { \
- SCIF_COMMON(PORT_SCIFB, baseaddr, irq), \
- .scscr = SCSCR_RE | SCSCR_TE, \
-}
+#define R8A73A4_SCIFA(index, baseaddr, irq) \
+ R8A73A4_SCIF(PORT_SCIFA, SCSCR_RE | SCSCR_TE | SCSCR_CKE0, \
+ index, baseaddr, irq)
-enum { SCIFA0, SCIFA1, SCIFB0, SCIFB1, SCIFB2, SCIFB3 };
+#define R8A73A4_SCIFB(index, baseaddr, irq) \
+ R8A73A4_SCIF(PORT_SCIFB, SCSCR_RE | SCSCR_TE, \
+ index, baseaddr, irq)
-static const struct plat_sci_port scif[] = {
- SCIFA_DATA(SCIFA0, 0xe6c40000, gic_spi(144)), /* SCIFA0 */
- SCIFA_DATA(SCIFA1, 0xe6c50000, gic_spi(145)), /* SCIFA1 */
- SCIFB_DATA(SCIFB0, 0xe6c20000, gic_spi(148)), /* SCIFB0 */
- SCIFB_DATA(SCIFB1, 0xe6c30000, gic_spi(149)), /* SCIFB1 */
- SCIFB_DATA(SCIFB2, 0xe6ce0000, gic_spi(150)), /* SCIFB2 */
- SCIFB_DATA(SCIFB3, 0xe6cf0000, gic_spi(151)), /* SCIFB3 */
-};
+R8A73A4_SCIFA(0, 0xe6c40000, gic_spi(144)); /* SCIFA0 */
+R8A73A4_SCIFA(1, 0xe6c50000, gic_spi(145)); /* SCIFA1 */
+R8A73A4_SCIFB(2, 0xe6c20000, gic_spi(148)); /* SCIFB0 */
+R8A73A4_SCIFB(3, 0xe6c30000, gic_spi(149)); /* SCIFB1 */
+R8A73A4_SCIFB(4, 0xe6ce0000, gic_spi(150)); /* SCIFB2 */
+R8A73A4_SCIFB(5, 0xe6cf0000, gic_spi(151)); /* SCIFB3 */
-static inline void r8a73a4_register_scif(int idx)
-{
- platform_device_register_data(&platform_bus, "sh-sci", idx, &scif[idx],
- sizeof(struct plat_sci_port));
-}
+#define r8a73a4_register_scif(index) \
+ platform_device_register_data(&platform_bus, "sh-sci", index, \
+ &scif##index##_platform_data, \
+ sizeof(scif##index##_platform_data))
static const struct renesas_irqc_config irqc0_data = {
.irq_base = irq_pin(0), /* IRQ0 -> IRQ31 */
@@ -192,12 +186,12 @@ static struct resource cmt10_resources[] = {
void __init r8a73a4_add_dt_devices(void)
{
- r8a73a4_register_scif(SCIFA0);
- r8a73a4_register_scif(SCIFA1);
- r8a73a4_register_scif(SCIFB0);
- r8a73a4_register_scif(SCIFB1);
- r8a73a4_register_scif(SCIFB2);
- r8a73a4_register_scif(SCIFB3);
+ r8a73a4_register_scif(0);
+ r8a73a4_register_scif(1);
+ r8a73a4_register_scif(2);
+ r8a73a4_register_scif(3);
+ r8a73a4_register_scif(4);
+ r8a73a4_register_scif(5);
r8a7790_register_cmt(10);
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 14/29] ARM: shmobile: r8a7778: Don't define SCIF platform data in an array
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (12 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 13/29] ARM: shmobile: r8a73a4: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 15/29] ARM: shmobile: r8a7790: " Laurent Pinchart
` (15 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
The SCIF driver is transitioning to platform resources. Board code will
thus need to define an array of resources for each SCIF device. This is
incompatible with the macro-based SCIF platform data definition as an
array. Rework the macro to define platform data as individual
structures.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r8a7778.c | 36 ++++++++++++++++++----------------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index 03fcc59..37ce2df 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -44,8 +44,8 @@
#include <asm/hardware/cache-l2x0.h>
/* SCIF */
-#define SCIF_INFO(baseaddr, irq) \
-{ \
+#define R8A7778_SCIF(index, baseaddr, irq) \
+static struct plat_sci_port scif##index##_platform_data = { \
.mapbase = baseaddr, \
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, \
@@ -54,14 +54,17 @@
.irqs = SCIx_IRQ_MUXED(irq), \
}
-static struct plat_sci_port scif_platform_data[] __initdata = {
- SCIF_INFO(0xffe40000, gic_iid(0x66)),
- SCIF_INFO(0xffe41000, gic_iid(0x67)),
- SCIF_INFO(0xffe42000, gic_iid(0x68)),
- SCIF_INFO(0xffe43000, gic_iid(0x69)),
- SCIF_INFO(0xffe44000, gic_iid(0x6a)),
- SCIF_INFO(0xffe45000, gic_iid(0x6b)),
-};
+R8A7778_SCIF(0, 0xffe40000, gic_iid(0x66));
+R8A7778_SCIF(1, 0xffe41000, gic_iid(0x67));
+R8A7778_SCIF(2, 0xffe42000, gic_iid(0x68));
+R8A7778_SCIF(3, 0xffe43000, gic_iid(0x69));
+R8A7778_SCIF(4, 0xffe44000, gic_iid(0x6a));
+R8A7778_SCIF(5, 0xffe45000, gic_iid(0x6b));
+
+#define r8a7778_register_scif(index) \
+ platform_device_register_data(&platform_bus, "sh-sci", index, \
+ &scif##index##_platform_data, \
+ sizeof(scif##index##_platform_data))
/* TMU */
static struct resource sh_tmu0_resources[] __initdata = {
@@ -287,8 +290,6 @@ static void __init r8a7778_register_hspi(int id)
void __init r8a7778_add_dt_devices(void)
{
- int i;
-
#ifdef CONFIG_CACHE_L2X0
void __iomem *base = ioremap_nocache(0xf0100000, 0x1000);
if (base) {
@@ -300,11 +301,12 @@ void __init r8a7778_add_dt_devices(void)
}
#endif
- for (i = 0; i < ARRAY_SIZE(scif_platform_data); i++)
- platform_device_register_data(&platform_bus, "sh-sci", i,
- &scif_platform_data[i],
- sizeof(struct plat_sci_port));
-
+ r8a7778_register_scif(0);
+ r8a7778_register_scif(1);
+ r8a7778_register_scif(2);
+ r8a7778_register_scif(3);
+ r8a7778_register_scif(4);
+ r8a7778_register_scif(5);
r8a7778_register_tmu(0);
r8a7778_register_tmu(1);
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 15/29] ARM: shmobile: r8a7790: Don't define SCIF platform data in an array
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (13 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 14/29] ARM: shmobile: r8a7778: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 16/29] ARM: shmobile: r8a7791: " Laurent Pinchart
` (14 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
The SCIF driver is transitioning to platform resources. Board code will
thus need to define an array of resources for each SCIF device. This is
incompatible with the macro-based SCIF platform data definition as an
array. Rework the macro to define platform data as individual
structures.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r8a7790.c | 112 +++++++++++++++------------------
1 file changed, 49 insertions(+), 63 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 3543c3b..8344743 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -78,61 +78,47 @@ void __init r8a7790_pinmux_init(void)
r8a7790_register_gpio(5);
}
-#define SCIF_COMMON(scif_type, baseaddr, irq) \
- .type = scif_type, \
- .mapbase = baseaddr, \
- .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
- .irqs = SCIx_IRQ_MUXED(irq)
-
-#define SCIFA_DATA(index, baseaddr, irq) \
-[index] = { \
- SCIF_COMMON(PORT_SCIFA, baseaddr, irq), \
- .scbrr_algo_id = SCBRR_ALGO_4, \
- .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE0, \
+#define __R8A7790_SCIF(scif_type, _scscr, algo, index, baseaddr, irq) \
+static struct plat_sci_port scif##index##_platform_data = { \
+ .type = scif_type, \
+ .mapbase = baseaddr, \
+ .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
+ .scbrr_algo_id = algo, \
+ .scscr = _scscr, \
+ .irqs = SCIx_IRQ_MUXED(irq), \
}
-#define SCIFB_DATA(index, baseaddr, irq) \
-[index] = { \
- SCIF_COMMON(PORT_SCIFB, baseaddr, irq), \
- .scbrr_algo_id = SCBRR_ALGO_4, \
- .scscr = SCSCR_RE | SCSCR_TE, \
-}
-
-#define SCIF_DATA(index, baseaddr, irq) \
-[index] = { \
- SCIF_COMMON(PORT_SCIF, baseaddr, irq), \
- .scbrr_algo_id = SCBRR_ALGO_2, \
- .scscr = SCSCR_RE | SCSCR_TE, \
-}
-
-#define HSCIF_DATA(index, baseaddr, irq) \
-[index] = { \
- SCIF_COMMON(PORT_HSCIF, baseaddr, irq), \
- .scbrr_algo_id = SCBRR_ALGO_6, \
- .scscr = SCSCR_RE | SCSCR_TE, \
-}
-
-enum { SCIFA0, SCIFA1, SCIFB0, SCIFB1, SCIFB2, SCIFA2, SCIF0, SCIF1,
- HSCIF0, HSCIF1 };
-
-static const struct plat_sci_port scif[] __initconst = {
- SCIFA_DATA(SCIFA0, 0xe6c40000, gic_spi(144)), /* SCIFA0 */
- SCIFA_DATA(SCIFA1, 0xe6c50000, gic_spi(145)), /* SCIFA1 */
- SCIFB_DATA(SCIFB0, 0xe6c20000, gic_spi(148)), /* SCIFB0 */
- SCIFB_DATA(SCIFB1, 0xe6c30000, gic_spi(149)), /* SCIFB1 */
- SCIFB_DATA(SCIFB2, 0xe6ce0000, gic_spi(150)), /* SCIFB2 */
- SCIFA_DATA(SCIFA2, 0xe6c60000, gic_spi(151)), /* SCIFA2 */
- SCIF_DATA(SCIF0, 0xe6e60000, gic_spi(152)), /* SCIF0 */
- SCIF_DATA(SCIF1, 0xe6e68000, gic_spi(153)), /* SCIF1 */
- HSCIF_DATA(HSCIF0, 0xe62c0000, gic_spi(154)), /* HSCIF0 */
- HSCIF_DATA(HSCIF1, 0xe62c8000, gic_spi(155)), /* HSCIF1 */
-};
-
-static inline void r8a7790_register_scif(int idx)
-{
- platform_device_register_data(&platform_bus, "sh-sci", idx, &scif[idx],
- sizeof(struct plat_sci_port));
-}
+#define R8A7790_SCIF(index, baseaddr, irq) \
+ __R8A7790_SCIF(PORT_SCIF, SCSCR_RE | SCSCR_TE, \
+ SCBRR_ALGO_2, index, baseaddr, irq)
+
+#define R8A7790_SCIFA(index, baseaddr, irq) \
+ __R8A7790_SCIF(PORT_SCIFA, SCSCR_RE | SCSCR_TE | SCSCR_CKE0, \
+ SCBRR_ALGO_4, index, baseaddr, irq)
+
+#define R8A7790_SCIFB(index, baseaddr, irq) \
+ __R8A7790_SCIF(PORT_SCIFB, SCSCR_RE | SCSCR_TE, \
+ SCBRR_ALGO_4, index, baseaddr, irq)
+
+#define R8A7790_HSCIF(index, baseaddr, irq) \
+ __R8A7790_SCIF(PORT_HSCIF, SCSCR_RE | SCSCR_TE, \
+ SCBRR_ALGO_6, index, baseaddr, irq)
+
+R8A7790_SCIFA(0, 0xe6c40000, gic_spi(144)); /* SCIFA0 */
+R8A7790_SCIFA(1, 0xe6c50000, gic_spi(145)); /* SCIFA1 */
+R8A7790_SCIFB(2, 0xe6c20000, gic_spi(148)); /* SCIFB0 */
+R8A7790_SCIFB(3, 0xe6c30000, gic_spi(149)); /* SCIFB1 */
+R8A7790_SCIFB(4, 0xe6ce0000, gic_spi(150)); /* SCIFB2 */
+R8A7790_SCIFA(5, 0xe6c60000, gic_spi(151)); /* SCIFA2 */
+R8A7790_SCIF(6, 0xe6e60000, gic_spi(152)); /* SCIF0 */
+R8A7790_SCIF(7, 0xe6e68000, gic_spi(153)); /* SCIF1 */
+R8A7790_HSCIF(8, 0xe62c0000, gic_spi(154)); /* HSCIF0 */
+R8A7790_HSCIF(9, 0xe62c8000, gic_spi(155)); /* HSCIF1 */
+
+#define r8a7790_register_scif(index) \
+ platform_device_register_data(&platform_bus, "sh-sci", index, \
+ &scif##index##_platform_data, \
+ sizeof(scif##index##_platform_data))
static const struct renesas_irqc_config irqc0_data __initconst = {
.irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
@@ -185,16 +171,16 @@ static const struct resource cmt00_resources[] __initconst = {
void __init r8a7790_add_dt_devices(void)
{
- r8a7790_register_scif(SCIFA0);
- r8a7790_register_scif(SCIFA1);
- r8a7790_register_scif(SCIFB0);
- r8a7790_register_scif(SCIFB1);
- r8a7790_register_scif(SCIFB2);
- r8a7790_register_scif(SCIFA2);
- r8a7790_register_scif(SCIF0);
- r8a7790_register_scif(SCIF1);
- r8a7790_register_scif(HSCIF0);
- r8a7790_register_scif(HSCIF1);
+ r8a7790_register_scif(0);
+ r8a7790_register_scif(1);
+ r8a7790_register_scif(2);
+ r8a7790_register_scif(3);
+ r8a7790_register_scif(4);
+ r8a7790_register_scif(5);
+ r8a7790_register_scif(6);
+ r8a7790_register_scif(7);
+ r8a7790_register_scif(8);
+ r8a7790_register_scif(9);
r8a7790_register_cmt(00);
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 16/29] ARM: shmobile: r8a7791: Don't define SCIF platform data in an array
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (14 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 15/29] ARM: shmobile: r8a7790: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 17/29] ARM: shmobile: sh7372: Declare SCIF register base and IRQ as resources Laurent Pinchart
` (13 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
The SCIF driver is transitioning to platform resources. Board code will
thus need to define an array of resources for each SCIF device. This is
incompatible with the macro-based SCIF platform data definition as an
array. Rework the macro to define platform data as individual
structures.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r8a7791.c | 125 ++++++++++++++-------------------
1 file changed, 52 insertions(+), 73 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c
index 59dd442..8eb9373 100644
--- a/arch/arm/mach-shmobile/setup-r8a7791.c
+++ b/arch/arm/mach-shmobile/setup-r8a7791.c
@@ -84,66 +84,45 @@ void __init r8a7791_pinmux_init(void)
r8a7791_register_gpio(7);
}
-#define SCIF_COMMON(scif_type, baseaddr, irq) \
- .type = scif_type, \
- .mapbase = baseaddr, \
- .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
- .irqs = SCIx_IRQ_MUXED(irq)
-
-#define SCIFA_DATA(index, baseaddr, irq) \
-[index] = { \
- SCIF_COMMON(PORT_SCIFA, baseaddr, irq), \
- .scbrr_algo_id = SCBRR_ALGO_4, \
- .scscr = SCSCR_RE | SCSCR_TE, \
+#define __R8A7791_SCIF(scif_type, algo, index, baseaddr, irq) \
+static struct plat_sci_port scif##index##_platform_data = { \
+ .type = scif_type, \
+ .mapbase = baseaddr, \
+ .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
+ .scbrr_algo_id = algo, \
+ .scscr = SCSCR_RE | SCSCR_TE, \
+ .irqs = SCIx_IRQ_MUXED(irq), \
}
-#define SCIFB_DATA(index, baseaddr, irq) \
-[index] = { \
- SCIF_COMMON(PORT_SCIFB, baseaddr, irq), \
- .scbrr_algo_id = SCBRR_ALGO_4, \
- .scscr = SCSCR_RE | SCSCR_TE, \
-}
-
-#define SCIF_DATA(index, baseaddr, irq) \
-[index] = { \
- SCIF_COMMON(PORT_SCIF, baseaddr, irq), \
- .scbrr_algo_id = SCBRR_ALGO_2, \
- .scscr = SCSCR_RE | SCSCR_TE, \
-}
-
-#define HSCIF_DATA(index, baseaddr, irq) \
-[index] = { \
- SCIF_COMMON(PORT_HSCIF, baseaddr, irq), \
- .scbrr_algo_id = SCBRR_ALGO_6, \
- .scscr = SCSCR_RE | SCSCR_TE, \
-}
-
-enum { SCIFA0, SCIFA1, SCIFB0, SCIFB1, SCIFB2, SCIFA2, SCIF0, SCIF1,
- SCIF2, SCIF3, SCIF4, SCIF5, SCIFA3, SCIFA4, SCIFA5 };
-
-static const struct plat_sci_port scif[] __initconst = {
- SCIFA_DATA(SCIFA0, 0xe6c40000, gic_spi(144)), /* SCIFA0 */
- SCIFA_DATA(SCIFA1, 0xe6c50000, gic_spi(145)), /* SCIFA1 */
- SCIFB_DATA(SCIFB0, 0xe6c20000, gic_spi(148)), /* SCIFB0 */
- SCIFB_DATA(SCIFB1, 0xe6c30000, gic_spi(149)), /* SCIFB1 */
- SCIFB_DATA(SCIFB2, 0xe6ce0000, gic_spi(150)), /* SCIFB2 */
- SCIFA_DATA(SCIFA2, 0xe6c60000, gic_spi(151)), /* SCIFA2 */
- SCIF_DATA(SCIF0, 0xe6e60000, gic_spi(152)), /* SCIF0 */
- SCIF_DATA(SCIF1, 0xe6e68000, gic_spi(153)), /* SCIF1 */
- SCIF_DATA(SCIF2, 0xe6e58000, gic_spi(22)), /* SCIF2 */
- SCIF_DATA(SCIF3, 0xe6ea8000, gic_spi(23)), /* SCIF3 */
- SCIF_DATA(SCIF4, 0xe6ee0000, gic_spi(24)), /* SCIF4 */
- SCIF_DATA(SCIF5, 0xe6ee8000, gic_spi(25)), /* SCIF5 */
- SCIFA_DATA(SCIFA3, 0xe6c70000, gic_spi(29)), /* SCIFA3 */
- SCIFA_DATA(SCIFA4, 0xe6c78000, gic_spi(30)), /* SCIFA4 */
- SCIFA_DATA(SCIFA5, 0xe6c80000, gic_spi(31)), /* SCIFA5 */
-};
-
-static inline void r8a7791_register_scif(int idx)
-{
- platform_device_register_data(&platform_bus, "sh-sci", idx, &scif[idx],
- sizeof(struct plat_sci_port));
-}
+#define R8A7791_SCIF(index, baseaddr, irq) \
+ __R8A7791_SCIF(PORT_SCIF, SCBRR_ALGO_2, index, baseaddr, irq)
+
+#define R8A7791_SCIFA(index, baseaddr, irq) \
+ __R8A7791_SCIF(PORT_SCIFA, SCBRR_ALGO_4, index, baseaddr, irq)
+
+#define R8A7791_SCIFB(index, baseaddr, irq) \
+ __R8A7791_SCIF(PORT_SCIFB, SCBRR_ALGO_4, index, baseaddr, irq)
+
+R8A7791_SCIFA(0, 0xe6c40000, gic_spi(144)); /* SCIFA0 */
+R8A7791_SCIFA(1, 0xe6c50000, gic_spi(145)); /* SCIFA1 */
+R8A7791_SCIFB(2, 0xe6c20000, gic_spi(148)); /* SCIFB0 */
+R8A7791_SCIFB(3, 0xe6c30000, gic_spi(149)); /* SCIFB1 */
+R8A7791_SCIFB(4, 0xe6ce0000, gic_spi(150)); /* SCIFB2 */
+R8A7791_SCIFA(5, 0xe6c60000, gic_spi(151)); /* SCIFA2 */
+R8A7791_SCIF(6, 0xe6e60000, gic_spi(152)); /* SCIF0 */
+R8A7791_SCIF(7, 0xe6e68000, gic_spi(153)); /* SCIF1 */
+R8A7791_SCIF(8, 0xe6e58000, gic_spi(22)); /* SCIF2 */
+R8A7791_SCIF(9, 0xe6ea8000, gic_spi(23)); /* SCIF3 */
+R8A7791_SCIF(10, 0xe6ee0000, gic_spi(24)); /* SCIF4 */
+R8A7791_SCIF(11, 0xe6ee8000, gic_spi(25)); /* SCIF5 */
+R8A7791_SCIFA(12, 0xe6c70000, gic_spi(29)); /* SCIFA3 */
+R8A7791_SCIFA(13, 0xe6c78000, gic_spi(30)); /* SCIFA4 */
+R8A7791_SCIFA(14, 0xe6c80000, gic_spi(31)); /* SCIFA5 */
+
+#define r8a7791_register_scif(index) \
+ platform_device_register_data(&platform_bus, "sh-sci", index, \
+ &scif##index##_platform_data, \
+ sizeof(scif##index##_platform_data))
static const struct sh_timer_config cmt00_platform_data __initconst = {
.name = "CMT00",
@@ -191,21 +170,21 @@ static struct resource irqc0_resources[] = {
void __init r8a7791_add_dt_devices(void)
{
- r8a7791_register_scif(SCIFA0);
- r8a7791_register_scif(SCIFA1);
- r8a7791_register_scif(SCIFB0);
- r8a7791_register_scif(SCIFB1);
- r8a7791_register_scif(SCIFB2);
- r8a7791_register_scif(SCIFA2);
- r8a7791_register_scif(SCIF0);
- r8a7791_register_scif(SCIF1);
- r8a7791_register_scif(SCIF2);
- r8a7791_register_scif(SCIF3);
- r8a7791_register_scif(SCIF4);
- r8a7791_register_scif(SCIF5);
- r8a7791_register_scif(SCIFA3);
- r8a7791_register_scif(SCIFA4);
- r8a7791_register_scif(SCIFA5);
+ r8a7791_register_scif(0);
+ r8a7791_register_scif(1);
+ r8a7791_register_scif(2);
+ r8a7791_register_scif(3);
+ r8a7791_register_scif(4);
+ r8a7791_register_scif(5);
+ r8a7791_register_scif(6);
+ r8a7791_register_scif(7);
+ r8a7791_register_scif(8);
+ r8a7791_register_scif(9);
+ r8a7791_register_scif(10);
+ r8a7791_register_scif(11);
+ r8a7791_register_scif(12);
+ r8a7791_register_scif(13);
+ r8a7791_register_scif(14);
r8a7791_register_cmt(00);
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 17/29] ARM: shmobile: sh7372: Declare SCIF register base and IRQ as resources
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (15 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 16/29] ARM: shmobile: r8a7791: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 18/29] ARM: shmobile: sh73a0: " Laurent Pinchart
` (12 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Passing the register base address and IRQ through platform data is
deprecated. Use resources instead.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-sh7372.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index 77627dd..798f8ac 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -90,16 +90,21 @@ void __init sh7372_pinmux_init(void)
#define SH7372_SCIF(scif_type, index, baseaddr, irq) \
static struct plat_sci_port scif##index##_platform_data = { \
.type = scif_type, \
- .mapbase = baseaddr, \
.flags = UPF_BOOT_AUTOCONF, \
- .irqs = SCIx_IRQ_MUXED(irq), \
.scbrr_algo_id = SCBRR_ALGO_4, \
.scscr = SCSCR_RE | SCSCR_TE, \
}; \
\
+static struct resource scif##index##_resources[] = { \
+ DEFINE_RES_MEM(baseaddr, 0x100), \
+ DEFINE_RES_IRQ(irq), \
+}; \
+ \
static struct platform_device scif##index##_device = { \
.name = "sh-sci", \
.id = index, \
+ .resource = scif##index##_resources, \
+ .num_resources = ARRAY_SIZE(scif##index##_resources), \
.dev = { \
.platform_data = &scif##index##_platform_data, \
}, \
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 18/29] ARM: shmobile: sh73a0: Declare SCIF register base and IRQ as resources
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (16 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 17/29] ARM: shmobile: sh7372: Declare SCIF register base and IRQ as resources Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 19/29] ARM: shmobile: r7s72100: " Laurent Pinchart
` (11 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Passing the register base address and IRQ through platform data is
deprecated. Use resources instead.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-sh73a0.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index 9c94f34..55ed98f 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -75,16 +75,21 @@ void __init sh73a0_pinmux_init(void)
#define SH73A0_SCIF(scif_type, index, baseaddr, irq) \
static struct plat_sci_port scif##index##_platform_data = { \
.type = scif_type, \
- .mapbase = baseaddr, \
.flags = UPF_BOOT_AUTOCONF, \
- .irqs = SCIx_IRQ_MUXED(irq), \
.scbrr_algo_id = SCBRR_ALGO_4, \
.scscr = SCSCR_RE | SCSCR_TE, \
}; \
\
+static struct resource scif##index##_resources[] = { \
+ DEFINE_RES_MEM(baseaddr, 0x100), \
+ DEFINE_RES_IRQ(irq), \
+}; \
+ \
static struct platform_device scif##index##_device = { \
.name = "sh-sci", \
.id = index, \
+ .resource = scif##index##_resources, \
+ .num_resources = ARRAY_SIZE(scif##index##_resources), \
.dev = { \
.platform_data = &scif##index##_platform_data, \
}, \
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 19/29] ARM: shmobile: r7s72100: Declare SCIF register base and IRQ as resources
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (17 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 18/29] ARM: shmobile: sh73a0: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 20/29] ARM: shmobile: r8a73a4: " Laurent Pinchart
` (10 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Passing the register base address and IRQ through platform data is
deprecated. Use resources instead.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r7s72100.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c
index dbcbb81..d47d20e 100644
--- a/arch/arm/mach-shmobile/setup-r7s72100.c
+++ b/arch/arm/mach-shmobile/setup-r7s72100.c
@@ -35,9 +35,15 @@ static const struct plat_sci_port scif##index##_platform_data = { \
.scbrr_algo_id = SCBRR_ALGO_2, \
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE | \
SCSCR_REIE, \
- .mapbase = baseaddr, \
- .irqs = { irq + 1, irq + 2, irq + 3, irq }, \
-}
+}; \
+ \
+static struct resource scif##index##_resources[] = { \
+ DEFINE_RES_MEM(baseaddr, 0x100), \
+ DEFINE_RES_IRQ(irq + 1), \
+ DEFINE_RES_IRQ(irq + 2), \
+ DEFINE_RES_IRQ(irq + 3), \
+ DEFINE_RES_IRQ(irq), \
+} \
R7S72100_SCIF(0, 0xe8007000, gic_iid(221));
R7S72100_SCIF(1, 0xe8007800, gic_iid(225));
@@ -49,7 +55,9 @@ R7S72100_SCIF(6, 0xe800a000, gic_iid(245));
R7S72100_SCIF(7, 0xe800a800, gic_iid(249));
#define r7s72100_register_scif(index) \
- platform_device_register_data(&platform_bus, "sh-sci", index, \
+ platform_device_register_resndata(&platform_bus, "sh-sci", index, \
+ scif##index##_resources, \
+ ARRAY_SIZE(scif##index##_resources), \
&scif##index##_platform_data, \
sizeof(scif##index##_platform_data))
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 20/29] ARM: shmobile: r8a73a4: Declare SCIF register base and IRQ as resources
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (18 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 19/29] ARM: shmobile: r7s72100: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 21/29] ARM: shmobile: r8a7740: " Laurent Pinchart
` (9 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Passing the register base address and IRQ through platform data is
deprecated. Use resources instead.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r8a73a4.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c
index 605298b..ef32ce2 100644
--- a/arch/arm/mach-shmobile/setup-r8a73a4.c
+++ b/arch/arm/mach-shmobile/setup-r8a73a4.c
@@ -43,11 +43,14 @@ void __init r8a73a4_pinmux_init(void)
#define R8A73A4_SCIF(scif_type, _scscr, index, baseaddr, irq) \
static struct plat_sci_port scif##index##_platform_data = { \
.type = scif_type, \
- .mapbase = baseaddr, \
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
.scbrr_algo_id = SCBRR_ALGO_4, \
.scscr = _scscr, \
- .irqs = SCIx_IRQ_MUXED(irq), \
+}; \
+ \
+static struct resource scif##index##_resources[] = { \
+ DEFINE_RES_MEM(baseaddr, 0x100), \
+ DEFINE_RES_IRQ(irq), \
}
#define R8A73A4_SCIFA(index, baseaddr, irq) \
@@ -66,9 +69,11 @@ R8A73A4_SCIFB(4, 0xe6ce0000, gic_spi(150)); /* SCIFB2 */
R8A73A4_SCIFB(5, 0xe6cf0000, gic_spi(151)); /* SCIFB3 */
#define r8a73a4_register_scif(index) \
- platform_device_register_data(&platform_bus, "sh-sci", index, \
- &scif##index##_platform_data, \
- sizeof(scif##index##_platform_data))
+ platform_device_register_resndata(&platform_bus, "sh-sci", index, \
+ scif##index##_resources, \
+ ARRAY_SIZE(scif##index##_resources), \
+ &scif##index##_platform_data, \
+ sizeof(scif##index##_platform_data))
static const struct renesas_irqc_config irqc0_data = {
.irq_base = irq_pin(0), /* IRQ0 -> IRQ31 */
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 21/29] ARM: shmobile: r8a7740: Declare SCIF register base and IRQ as resources
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (19 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 20/29] ARM: shmobile: r8a73a4: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 22/29] ARM: shmobile: r8a7778: " Laurent Pinchart
` (8 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Passing the register base address and IRQ through platform data is
deprecated. Use resources instead.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r8a7740.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 8778b57..81a4366 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -207,16 +207,21 @@ static struct platform_device irqpin3_device = {
#define R8A7740_SCIF(scif_type, index, baseaddr, irq) \
static struct plat_sci_port scif##index##_platform_data = { \
.type = scif_type, \
- .mapbase = baseaddr, \
.flags = UPF_BOOT_AUTOCONF, \
- .irqs = SCIx_IRQ_MUXED(irq), \
.scbrr_algo_id = SCBRR_ALGO_4, \
.scscr = SCSCR_RE | SCSCR_TE, \
}; \
\
+static struct resource scif##index##_resources[] = { \
+ DEFINE_RES_MEM(baseaddr, 0x100), \
+ DEFINE_RES_IRQ(irq), \
+}; \
+ \
static struct platform_device scif##index##_device = { \
.name = "sh-sci", \
.id = index, \
+ .resource = scif##index##_resources, \
+ .num_resources = ARRAY_SIZE(scif##index##_resources), \
.dev = { \
.platform_data = &scif##index##_platform_data, \
}, \
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 22/29] ARM: shmobile: r8a7778: Declare SCIF register base and IRQ as resources
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (20 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 21/29] ARM: shmobile: r8a7740: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 23/29] ARM: shmobile: r8a7779: " Laurent Pinchart
` (7 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Passing the register base address and IRQ through platform data is
deprecated. Use resources instead.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r8a7778.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index 37ce2df..d492c2c 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -46,12 +46,15 @@
/* SCIF */
#define R8A7778_SCIF(index, baseaddr, irq) \
static struct plat_sci_port scif##index##_platform_data = { \
- .mapbase = baseaddr, \
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, \
.scbrr_algo_id = SCBRR_ALGO_2, \
.type = PORT_SCIF, \
- .irqs = SCIx_IRQ_MUXED(irq), \
+}; \
+ \
+static struct resource scif##index##_resources[] = { \
+ DEFINE_RES_MEM(baseaddr, 0x100), \
+ DEFINE_RES_IRQ(irq), \
}
R8A7778_SCIF(0, 0xffe40000, gic_iid(0x66));
@@ -62,9 +65,11 @@ R8A7778_SCIF(4, 0xffe44000, gic_iid(0x6a));
R8A7778_SCIF(5, 0xffe45000, gic_iid(0x6b));
#define r8a7778_register_scif(index) \
- platform_device_register_data(&platform_bus, "sh-sci", index, \
- &scif##index##_platform_data, \
- sizeof(scif##index##_platform_data))
+ platform_device_register_resndata(&platform_bus, "sh-sci", index, \
+ scif##index##_resources, \
+ ARRAY_SIZE(scif##index##_resources), \
+ &scif##index##_platform_data, \
+ sizeof(scif##index##_platform_data))
/* TMU */
static struct resource sh_tmu0_resources[] __initdata = {
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 23/29] ARM: shmobile: r8a7779: Declare SCIF register base and IRQ as resources
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (21 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 22/29] ARM: shmobile: r8a7778: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 24/29] ARM: shmobile: r8a7790: " Laurent Pinchart
` (6 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Passing the register base address and IRQ through platform data is
deprecated. Use resources instead.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r8a7779.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 79cdb8a..2ca72ff 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -192,16 +192,21 @@ void __init r8a7779_pinmux_init(void)
#define R8A7779_SCIF(index, baseaddr, irq) \
static struct plat_sci_port scif##index##_platform_data = { \
.type = PORT_SCIF, \
- .mapbase = baseaddr, \
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
- .irqs = SCIx_IRQ_MUXED(irq), \
.scbrr_algo_id = SCBRR_ALGO_2, \
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, \
}; \
\
+static struct resource scif##index##_resources[] = { \
+ DEFINE_RES_MEM(baseaddr, 0x100), \
+ DEFINE_RES_IRQ(irq), \
+}; \
+ \
static struct platform_device scif##index##_device = { \
.name = "sh-sci", \
.id = index, \
+ .resource = scif##index##_resources, \
+ .num_resources = ARRAY_SIZE(scif##index##_resources), \
.dev = { \
.platform_data = &scif##index##_platform_data, \
}, \
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 24/29] ARM: shmobile: r8a7790: Declare SCIF register base and IRQ as resources
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (22 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 23/29] ARM: shmobile: r8a7779: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 25/29] ARM: shmobile: r8a7791: " Laurent Pinchart
` (5 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Passing the register base address and IRQ through platform data is
deprecated. Use resources instead.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r8a7790.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 8344743..70bb553 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -81,11 +81,14 @@ void __init r8a7790_pinmux_init(void)
#define __R8A7790_SCIF(scif_type, _scscr, algo, index, baseaddr, irq) \
static struct plat_sci_port scif##index##_platform_data = { \
.type = scif_type, \
- .mapbase = baseaddr, \
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
.scbrr_algo_id = algo, \
.scscr = _scscr, \
- .irqs = SCIx_IRQ_MUXED(irq), \
+}; \
+ \
+static struct resource scif##index##_resources[] = { \
+ DEFINE_RES_MEM(baseaddr, 0x100), \
+ DEFINE_RES_IRQ(irq), \
}
#define R8A7790_SCIF(index, baseaddr, irq) \
@@ -116,9 +119,11 @@ R8A7790_HSCIF(8, 0xe62c0000, gic_spi(154)); /* HSCIF0 */
R8A7790_HSCIF(9, 0xe62c8000, gic_spi(155)); /* HSCIF1 */
#define r8a7790_register_scif(index) \
- platform_device_register_data(&platform_bus, "sh-sci", index, \
- &scif##index##_platform_data, \
- sizeof(scif##index##_platform_data))
+ platform_device_register_resndata(&platform_bus, "sh-sci", index, \
+ scif##index##_resources, \
+ ARRAY_SIZE(scif##index##_resources), \
+ &scif##index##_platform_data, \
+ sizeof(scif##index##_platform_data))
static const struct renesas_irqc_config irqc0_data __initconst = {
.irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 25/29] ARM: shmobile: r8a7791: Declare SCIF register base and IRQ as resources
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (23 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 24/29] ARM: shmobile: r8a7790: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 26/29] sh: " Laurent Pinchart
` (4 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Passing the register base address and IRQ through platform data is
deprecated. Use resources instead.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/arm/mach-shmobile/setup-r8a7791.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c
index 8eb9373..557db8f 100644
--- a/arch/arm/mach-shmobile/setup-r8a7791.c
+++ b/arch/arm/mach-shmobile/setup-r8a7791.c
@@ -87,11 +87,14 @@ void __init r8a7791_pinmux_init(void)
#define __R8A7791_SCIF(scif_type, algo, index, baseaddr, irq) \
static struct plat_sci_port scif##index##_platform_data = { \
.type = scif_type, \
- .mapbase = baseaddr, \
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
.scbrr_algo_id = algo, \
.scscr = SCSCR_RE | SCSCR_TE, \
- .irqs = SCIx_IRQ_MUXED(irq), \
+}; \
+ \
+static struct resource scif##index##_resources[] = { \
+ DEFINE_RES_MEM(baseaddr, 0x100), \
+ DEFINE_RES_IRQ(irq), \
}
#define R8A7791_SCIF(index, baseaddr, irq) \
@@ -120,9 +123,11 @@ R8A7791_SCIFA(13, 0xe6c78000, gic_spi(30)); /* SCIFA4 */
R8A7791_SCIFA(14, 0xe6c80000, gic_spi(31)); /* SCIFA5 */
#define r8a7791_register_scif(index) \
- platform_device_register_data(&platform_bus, "sh-sci", index, \
- &scif##index##_platform_data, \
- sizeof(scif##index##_platform_data))
+ platform_device_register_resndata(&platform_bus, "sh-sci", index, \
+ scif##index##_resources, \
+ ARRAY_SIZE(scif##index##_resources), \
+ &scif##index##_platform_data, \
+ sizeof(scif##index##_platform_data))
static const struct sh_timer_config cmt00_platform_data __initconst = {
.name = "CMT00",
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 26/29] sh: Declare SCIF register base and IRQ as resources
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (24 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 25/29] ARM: shmobile: r8a7791: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 27/29] serial: sh-sci: Remove platform data mapbase and irqs fields Laurent Pinchart
` (3 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Passing the register base address and IRQ through platform data is
deprecated. Use resources instead.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
arch/sh/kernel/cpu/sh2/setup-sh7619.c | 27 +++++++---
arch/sh/kernel/cpu/sh2a/setup-mxg.c | 9 +++-
arch/sh/kernel/cpu/sh2a/setup-sh7201.c | 72 +++++++++++++++++++------
arch/sh/kernel/cpu/sh2a/setup-sh7203.c | 36 ++++++++++---
arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 36 ++++++++++---
arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 96 ++++++++++++++++++++++++++++------
arch/sh/kernel/cpu/sh2a/setup-sh7269.c | 96 ++++++++++++++++++++++++++++------
arch/sh/kernel/cpu/sh3/setup-sh7705.c | 18 +++++--
arch/sh/kernel/cpu/sh3/setup-sh770x.c | 27 +++++++---
arch/sh/kernel/cpu/sh3/setup-sh7710.c | 18 +++++--
arch/sh/kernel/cpu/sh3/setup-sh7720.c | 18 +++++--
arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 15 ++++--
arch/sh/kernel/cpu/sh4/setup-sh7750.c | 18 +++++--
arch/sh/kernel/cpu/sh4/setup-sh7760.c | 58 +++++++++++++-------
arch/sh/kernel/cpu/sh4a/setup-sh7343.c | 36 ++++++++++---
arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 9 +++-
arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 27 +++++++---
arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 54 ++++++++++++++-----
arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 54 ++++++++++++++-----
arch/sh/kernel/cpu/sh4a/setup-sh7734.c | 66 ++++++++++++++++-------
arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 27 +++++++---
arch/sh/kernel/cpu/sh4a/setup-sh7763.c | 27 +++++++---
arch/sh/kernel/cpu/sh4a/setup-sh7770.c | 90 ++++++++++++++++++++++++-------
arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 18 +++++--
arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 54 ++++++++++++++-----
arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 82 ++++++++++++++++++++++-------
arch/sh/kernel/cpu/sh4a/setup-shx3.c | 45 ++++++++++------
arch/sh/kernel/cpu/sh5/setup-sh5.c | 11 +++-
28 files changed, 883 insertions(+), 261 deletions(-)
diff --git a/arch/sh/kernel/cpu/sh2/setup-sh7619.c b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
index 4df4d4f..1a4fe7c 100644
--- a/arch/sh/kernel/cpu/sh2/setup-sh7619.c
+++ b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
@@ -61,51 +61,66 @@ static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, NULL,
NULL, prio_registers, NULL);
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xf8400000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(88),
+};
+
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xf8400000, 0x100),
+ DEFINE_RES_IRQ(88),
};
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xf8410000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(92),
+};
+
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xf8410000, 0x100),
+ DEFINE_RES_IRQ(92),
};
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xf8420000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(96),
+};
+
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xf8420000, 0x100),
+ DEFINE_RES_IRQ(96),
};
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh2a/setup-mxg.c b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
index f7f1cf2..9bdc611 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-mxg.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
@@ -199,17 +199,22 @@ static struct platform_device mtu2_2_device = {
};
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xff804000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(220),
+};
+
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xff804000, 0x100),
+ DEFINE_RES_IRQ(220),
};
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
index 7b84785..7585c4e 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
@@ -178,136 +178,176 @@ static DECLARE_INTC_DESC(intc_desc, "sh7201", vectors, groups,
mask_registers, prio_registers, NULL);
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xfffe8000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(180),
+};
+
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xfffe8000, 0x100),
+ DEFINE_RES_IRQ(180),
};
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xfffe8800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(184),
+};
+
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xfffe8800, 0x100),
+ DEFINE_RES_IRQ(184),
};
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xfffe9000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(188),
+};
+
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xfffe9000, 0x100),
+ DEFINE_RES_IRQ(188),
};
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xfffe9800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(192),
+};
+
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xfffe9800, 0x100),
+ DEFINE_RES_IRQ(192),
};
static struct platform_device scif3_device = {
.name = "sh-sci",
.id = 3,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
};
static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xfffea000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(196),
+};
+
+static struct resource scif4_resources[] = {
+ DEFINE_RES_MEM(0xfffea000, 0x100),
+ DEFINE_RES_IRQ(196),
};
static struct platform_device scif4_device = {
.name = "sh-sci",
.id = 4,
+ .resource = scif4_resources,
+ .num_resources = ARRAY_SIZE(scif4_resources),
.dev = {
.platform_data = &scif4_platform_data,
},
};
static struct plat_sci_port scif5_platform_data = {
- .mapbase = 0xfffea800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(200),
+};
+
+static struct resource scif5_resources[] = {
+ DEFINE_RES_MEM(0xfffea800, 0x100),
+ DEFINE_RES_IRQ(200),
};
static struct platform_device scif5_device = {
.name = "sh-sci",
.id = 5,
+ .resource = scif5_resources,
+ .num_resources = ARRAY_SIZE(scif5_resources),
.dev = {
.platform_data = &scif5_platform_data,
},
};
static struct plat_sci_port scif6_platform_data = {
- .mapbase = 0xfffeb000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(204),
+};
+
+static struct resource scif6_resources[] = {
+ DEFINE_RES_MEM(0xfffeb000, 0x100),
+ DEFINE_RES_IRQ(204),
};
static struct platform_device scif6_device = {
.name = "sh-sci",
.id = 6,
+ .resource = scif6_resources,
+ .num_resources = ARRAY_SIZE(scif6_resources),
.dev = {
.platform_data = &scif6_platform_data,
},
};
static struct plat_sci_port scif7_platform_data = {
- .mapbase = 0xfffeb800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(208),
+};
+
+static struct resource scif7_resources[] = {
+ DEFINE_RES_MEM(0xfffeb800, 0x100),
+ DEFINE_RES_IRQ(208),
};
static struct platform_device scif7_device = {
.name = "sh-sci",
.id = 7,
+ .resource = scif7_resources,
+ .num_resources = ARRAY_SIZE(scif7_resources),
.dev = {
.platform_data = &scif7_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
index bfc33f6..f2a9baa 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
@@ -174,76 +174,96 @@ static DECLARE_INTC_DESC(intc_desc, "sh7203", vectors, groups,
mask_registers, prio_registers, NULL);
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xfffe8000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(192),
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xfffe8000, 0x100),
+ DEFINE_RES_IRQ(192),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xfffe8800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(196),
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xfffe8800, 0x100),
+ DEFINE_RES_IRQ(196),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xfffe9000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(200),
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xfffe9000, 0x100),
+ DEFINE_RES_IRQ(200),
+};
+
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xfffe9800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(204),
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xfffe9800, 0x100),
+ DEFINE_RES_IRQ(204),
+};
+
static struct platform_device scif3_device = {
.name = "sh-sci",
.id = 3,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
index a501074..fc7cacd 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
@@ -134,68 +134,88 @@ static DECLARE_INTC_DESC(intc_desc, "sh7206", vectors, groups,
mask_registers, prio_registers, NULL);
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xfffe8000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(240),
+};
+
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xfffe8000, 0x100),
+ DEFINE_RES_IRQ(240),
};
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xfffe8800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(244),
+};
+
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xfffe8800, 0x100),
+ DEFINE_RES_IRQ(244),
};
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xfffe9000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(248),
+};
+
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xfffe9000, 0x100),
+ DEFINE_RES_IRQ(248),
};
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xfffe9800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(252),
+};
+
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xfffe9800, 0x100),
+ DEFINE_RES_IRQ(252),
};
static struct platform_device scif3_device = {
.name = "sh-sci",
.id = 3,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7264.c b/arch/sh/kernel/cpu/sh2a/setup-sh7264.c
index ce5c1b5..00edbda 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7264.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7264.c
@@ -226,152 +226,216 @@ static DECLARE_INTC_DESC(intc_desc, "sh7264", vectors, groups,
mask_registers, prio_registers, NULL);
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xfffe8000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 233, 234, 235, 232 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xfffe8000, 0x100),
+ DEFINE_RES_IRQ(233),
+ DEFINE_RES_IRQ(234),
+ DEFINE_RES_IRQ(235),
+ DEFINE_RES_IRQ(232),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xfffe8800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 237, 238, 239, 236 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xfffe8800, 0x100),
+ DEFINE_RES_IRQ(237),
+ DEFINE_RES_IRQ(238),
+ DEFINE_RES_IRQ(239),
+ DEFINE_RES_IRQ(236),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xfffe9000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 241, 242, 243, 240 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xfffe9000, 0x100),
+ DEFINE_RES_IRQ(241),
+ DEFINE_RES_IRQ(242),
+ DEFINE_RES_IRQ(243),
+ DEFINE_RES_IRQ(240),
+};
+
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xfffe9800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 245, 246, 247, 244 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xfffe9800, 0x100),
+ DEFINE_RES_IRQ(245),
+ DEFINE_RES_IRQ(246),
+ DEFINE_RES_IRQ(247),
+ DEFINE_RES_IRQ(244),
+};
+
static struct platform_device scif3_device = {
.name = "sh-sci",
.id = 3,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
};
static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xfffea000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 249, 250, 251, 248 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif4_resources[] = {
+ DEFINE_RES_MEM(0xfffea000, 0x100),
+ DEFINE_RES_IRQ(249),
+ DEFINE_RES_IRQ(250),
+ DEFINE_RES_IRQ(251),
+ DEFINE_RES_IRQ(248),
+};
+
static struct platform_device scif4_device = {
.name = "sh-sci",
.id = 4,
+ .resource = scif4_resources,
+ .num_resources = ARRAY_SIZE(scif4_resources),
.dev = {
.platform_data = &scif4_platform_data,
},
};
static struct plat_sci_port scif5_platform_data = {
- .mapbase = 0xfffea800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 253, 254, 255, 252 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif5_resources[] = {
+ DEFINE_RES_MEM(0xfffea800, 0x100),
+ DEFINE_RES_IRQ(253),
+ DEFINE_RES_IRQ(254),
+ DEFINE_RES_IRQ(255),
+ DEFINE_RES_IRQ(252),
+};
+
static struct platform_device scif5_device = {
.name = "sh-sci",
.id = 5,
+ .resource = scif5_resources,
+ .num_resources = ARRAY_SIZE(scif5_resources),
.dev = {
.platform_data = &scif5_platform_data,
},
};
static struct plat_sci_port scif6_platform_data = {
- .mapbase = 0xfffeb000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 257, 258, 259, 256 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif6_resources[] = {
+ DEFINE_RES_MEM(0xfffeb000, 0x100),
+ DEFINE_RES_IRQ(257),
+ DEFINE_RES_IRQ(258),
+ DEFINE_RES_IRQ(259),
+ DEFINE_RES_IRQ(256),
+};
+
static struct platform_device scif6_device = {
.name = "sh-sci",
.id = 6,
+ .resource = scif6_resources,
+ .num_resources = ARRAY_SIZE(scif6_resources),
.dev = {
.platform_data = &scif6_platform_data,
},
};
static struct plat_sci_port scif7_platform_data = {
- .mapbase = 0xfffeb800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 261, 262, 263, 260 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif7_resources[] = {
+ DEFINE_RES_MEM(0xfffeb800, 0x100),
+ DEFINE_RES_IRQ(261),
+ DEFINE_RES_IRQ(262),
+ DEFINE_RES_IRQ(263),
+ DEFINE_RES_IRQ(260),
+};
+
static struct platform_device scif7_device = {
.name = "sh-sci",
.id = 7,
+ .resource = scif7_resources,
+ .num_resources = ARRAY_SIZE(scif7_resources),
.dev = {
.platform_data = &scif7_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7269.c b/arch/sh/kernel/cpu/sh2a/setup-sh7269.c
index e82ae9d..5cdbaac 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7269.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7269.c
@@ -248,152 +248,216 @@ static DECLARE_INTC_DESC(intc_desc, "sh7269", vectors, groups,
mask_registers, prio_registers, NULL);
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xe8007000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 259, 260, 261, 258 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xe8007000, 0x100),
+ DEFINE_RES_IRQ(259),
+ DEFINE_RES_IRQ(260),
+ DEFINE_RES_IRQ(261),
+ DEFINE_RES_IRQ(258),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xe8007800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 263, 264, 265, 262 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xe8007800, 0x100),
+ DEFINE_RES_IRQ(263),
+ DEFINE_RES_IRQ(264),
+ DEFINE_RES_IRQ(265),
+ DEFINE_RES_IRQ(262),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xe8008000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 267, 268, 269, 266 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xe8008000, 0x100),
+ DEFINE_RES_IRQ(267),
+ DEFINE_RES_IRQ(268),
+ DEFINE_RES_IRQ(269),
+ DEFINE_RES_IRQ(266),
+};
+
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xe8008800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 271, 272, 273, 270 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xe8008800, 0x100),
+ DEFINE_RES_IRQ(271),
+ DEFINE_RES_IRQ(272),
+ DEFINE_RES_IRQ(273),
+ DEFINE_RES_IRQ(270),
+};
+
static struct platform_device scif3_device = {
.name = "sh-sci",
.id = 3,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
};
static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xe8009000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 275, 276, 277, 274 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif4_resources[] = {
+ DEFINE_RES_MEM(0xe8009000, 0x100),
+ DEFINE_RES_IRQ(275),
+ DEFINE_RES_IRQ(276),
+ DEFINE_RES_IRQ(277),
+ DEFINE_RES_IRQ(274),
+};
+
static struct platform_device scif4_device = {
.name = "sh-sci",
.id = 4,
+ .resource = scif4_resources,
+ .num_resources = ARRAY_SIZE(scif4_resources),
.dev = {
.platform_data = &scif4_platform_data,
},
};
static struct plat_sci_port scif5_platform_data = {
- .mapbase = 0xe8009800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 279, 280, 281, 278 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif5_resources[] = {
+ DEFINE_RES_MEM(0xe8009800, 0x100),
+ DEFINE_RES_IRQ(279),
+ DEFINE_RES_IRQ(280),
+ DEFINE_RES_IRQ(281),
+ DEFINE_RES_IRQ(278),
+};
+
static struct platform_device scif5_device = {
.name = "sh-sci",
.id = 5,
+ .resource = scif5_resources,
+ .num_resources = ARRAY_SIZE(scif5_resources),
.dev = {
.platform_data = &scif5_platform_data,
},
};
static struct plat_sci_port scif6_platform_data = {
- .mapbase = 0xe800a000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 283, 284, 285, 282 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif6_resources[] = {
+ DEFINE_RES_MEM(0xe800a000, 0x100),
+ DEFINE_RES_IRQ(283),
+ DEFINE_RES_IRQ(284),
+ DEFINE_RES_IRQ(285),
+ DEFINE_RES_IRQ(282),
+};
+
static struct platform_device scif6_device = {
.name = "sh-sci",
.id = 6,
+ .resource = scif6_resources,
+ .num_resources = ARRAY_SIZE(scif6_resources),
.dev = {
.platform_data = &scif6_platform_data,
},
};
static struct plat_sci_port scif7_platform_data = {
- .mapbase = 0xe800a800,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 287, 288, 289, 286 },
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif7_resources[] = {
+ DEFINE_RES_MEM(0xe800a800, 0x100),
+ DEFINE_RES_IRQ(287),
+ DEFINE_RES_IRQ(288),
+ DEFINE_RES_IRQ(289),
+ DEFINE_RES_IRQ(286),
+};
+
static struct platform_device scif7_device = {
.name = "sh-sci",
.id = 7,
+ .resource = scif7_resources,
+ .num_resources = ARRAY_SIZE(scif7_resources),
.dev = {
.platform_data = &scif7_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7705.c b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
index 03e4c96..10dd0a0 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7705.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
@@ -70,39 +70,49 @@ static DECLARE_INTC_DESC(intc_desc, "sh7705", vectors, NULL,
NULL, prio_registers, NULL);
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xa4410000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TIE | SCSCR_RIE | SCSCR_TE |
SCSCR_RE | SCSCR_CKE1 | SCSCR_CKE0,
.scbrr_algo_id = SCBRR_ALGO_4,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)),
.ops = &sh770x_sci_port_ops,
.regtype = SCIx_SH7705_SCIF_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xa4410000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x900)),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xa4400000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TIE | SCSCR_RIE | SCSCR_TE | SCSCR_RE,
.scbrr_algo_id = SCBRR_ALGO_4,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x880)),
.ops = &sh770x_sci_port_ops,
.regtype = SCIx_SH7705_SCIF_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xa4400000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x880)),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
index ba26cd9..d5541b0 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
@@ -109,20 +109,25 @@ static struct platform_device rtc_device = {
};
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xfffffe80,
.port_reg = 0xa4000136,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TE | SCSCR_RE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCI,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x4e0)),
.ops = &sh770x_sci_port_ops,
.regshift = 1,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xfffffe80, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x4e0)),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
@@ -131,19 +136,24 @@ static struct platform_device scif0_device = {
defined(CONFIG_CPU_SUBTYPE_SH7707) || \
defined(CONFIG_CPU_SUBTYPE_SH7709)
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xa4000150,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TE | SCSCR_RE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)),
.ops = &sh770x_sci_port_ops,
.regtype = SCIx_SH3_SCIF_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xa4000150, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x900)),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
@@ -152,20 +162,25 @@ static struct platform_device scif1_device = {
#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \
defined(CONFIG_CPU_SUBTYPE_SH7709)
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xa4000140,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TE | SCSCR_RE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_IRDA,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x880)),
.ops = &sh770x_sci_port_ops,
.regshift = 1,
};
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xa4000140, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x880)),
+};
+
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
index 93c9c5e..de229f5 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
@@ -98,36 +98,46 @@ static struct platform_device rtc_device = {
};
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xa4400000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TE | SCSCR_RE | SCSCR_REIE |
SCSCR_CKE1 | SCSCR_CKE0,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x880)),
+};
+
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xa4400000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x880)),
};
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xa4410000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TE | SCSCR_RE | SCSCR_REIE |
SCSCR_CKE1 | SCSCR_CKE0,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)),
+};
+
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xa4410000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x900)),
};
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7720.c b/arch/sh/kernel/cpu/sh3/setup-sh7720.c
index 42d991f..ca83581 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7720.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7720.c
@@ -52,38 +52,48 @@ static struct platform_device rtc_device = {
};
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xa4430000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE,
.scbrr_algo_id = SCBRR_ALGO_4,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)),
.ops = &sh7720_sci_port_ops,
.regtype = SCIx_SH7705_SCIF_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xa4430000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc00)),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xa4438000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE,
.scbrr_algo_id = SCBRR_ALGO_4,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)),
.ops = &sh7720_sci_port_ops,
.regtype = SCIx_SH7705_SCIF_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xa4438000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc20)),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
index 2a5320a..0fc6a10 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
@@ -17,20 +17,25 @@
#include <linux/io.h>
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xffe80000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { evt2irq(0x700),
- evt2irq(0x720),
- evt2irq(0x760),
- evt2irq(0x740) },
+};
+
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xffe80000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x700)),
+ DEFINE_RES_IRQ(evt2irq(0x720)),
+ DEFINE_RES_IRQ(evt2irq(0x760)),
+ DEFINE_RES_IRQ(evt2irq(0x740)),
};
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
index 04a4551..5613c15 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
@@ -38,36 +38,46 @@ static struct platform_device rtc_device = {
};
static struct plat_sci_port sci_platform_data = {
- .mapbase = 0xffe00000,
.port_reg = 0xffe0001C,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TE | SCSCR_RE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCI,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x4e0)),
.regshift = 2,
};
+static struct resource sci_resources[] = {
+ DEFINE_RES_MEM(0xffe00000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x4e0)),
+};
+
static struct platform_device sci_device = {
.name = "sh-sci",
.id = 0,
+ .resource = sci_resources,
+ .num_resources = ARRAY_SIZE(sci_resources),
.dev = {
.platform_data = &sci_platform_data,
},
};
static struct plat_sci_port scif_platform_data = {
- .mapbase = 0xffe80000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_TE | SCSCR_RE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x700)),
+};
+
+static struct resource scif_resources[] = {
+ DEFINE_RES_MEM(0xffe80000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x700)),
};
static struct platform_device scif_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif_resources,
+ .num_resources = ARRAY_SIZE(scif_resources),
.dev = {
.platform_data = &scif_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7760.c b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
index 98e075a..a83e6f5 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7760.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
@@ -128,83 +128,103 @@ static DECLARE_INTC_DESC(intc_desc_irq, "sh7760-irq", vectors_irq, groups,
mask_registers, prio_registers, NULL);
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xfe600000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { evt2irq(0x880),
- evt2irq(0x8a0),
- evt2irq(0x8e0),
- evt2irq(0x8c0) },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xfe600000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x880)),
+ DEFINE_RES_IRQ(evt2irq(0x8a0)),
+ DEFINE_RES_IRQ(evt2irq(0x8e0)),
+ DEFINE_RES_IRQ(evt2irq(0x8c0)),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xfe610000,
.flags = UPF_BOOT_AUTOCONF,
.type = PORT_SCIF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
- .irqs = { evt2irq(0xb00),
- evt2irq(0xb20),
- evt2irq(0xb60),
- evt2irq(0xb40) },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xfe610000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xb00)),
+ DEFINE_RES_IRQ(evt2irq(0xb20)),
+ DEFINE_RES_IRQ(evt2irq(0xb60)),
+ DEFINE_RES_IRQ(evt2irq(0xb40)),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xfe620000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { evt2irq(0xb80),
- evt2irq(0xba0),
- evt2irq(0xbe0),
- evt2irq(0xbc0) },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xfe620000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xb80)),
+ DEFINE_RES_IRQ(evt2irq(0xba0)),
+ DEFINE_RES_IRQ(evt2irq(0xbe0)),
+ DEFINE_RES_IRQ(evt2irq(0xbc0)),
+};
+
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xfe480000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCI,
- .irqs = { evt2irq(0xc00),
- evt2irq(0xc20),
- evt2irq(0xc40), },
.regshift = 2,
};
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xfe480000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc00)),
+ DEFINE_RES_IRQ(evt2irq(0xc20)),
+ DEFINE_RES_IRQ(evt2irq(0xc40)),
+};
+
static struct platform_device scif3_device = {
.name = "sh-sci",
.id = 3,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
index b91ea83..8b45f67 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
@@ -18,68 +18,88 @@
/* Serial */
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xffe00000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)),
+};
+
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xffe00000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc00)),
};
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xffe10000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)),
+};
+
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xffe10000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc20)),
};
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xffe20000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc40)),
+};
+
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xffe20000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc40)),
};
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xffe30000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc60)),
+};
+
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xffe30000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc60)),
};
static struct platform_device scif3_device = {
.name = "sh-sci",
.id = 3,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
index 0bd09d5..317f710 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
@@ -20,18 +20,23 @@
#include <asm/clock.h>
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xffe00000,
.port_reg = 0xa405013e,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)),
+};
+
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xffe00000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc00)),
};
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index 6a868b0..6aeebb5 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -179,57 +179,72 @@ struct platform_device dma_device = {
/* Serial */
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xffe00000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)),
.ops = &sh7722_sci_port_ops,
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xffe00000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc00)),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xffe10000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)),
.ops = &sh7722_sci_port_ops,
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xffe10000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc20)),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xffe20000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc40)),
.ops = &sh7722_sci_port_ops,
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
};
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xffe20000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc40)),
+};
+
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
index 28d6fd8..521a09e 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
@@ -23,111 +23,141 @@
/* Serial */
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xffe00000,
.port_reg = 0xa4050160,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)),
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xffe00000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc00)),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xffe10000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)),
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xffe10000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc20)),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xffe20000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc40)),
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
};
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xffe20000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc40)),
+};
+
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xa4e30000,
.flags = UPF_BOOT_AUTOCONF,
.port_reg = SCIx_NOT_SUPPORTED,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_3,
.type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)),
+};
+
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xa4e30000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x900)),
};
static struct platform_device scif3_device = {
.name = "sh-sci",
.id = 3,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
};
static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xa4e40000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_3,
.type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xd00)),
+};
+
+static struct resource scif4_resources[] = {
+ DEFINE_RES_MEM(0xa4e40000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xd00)),
};
static struct platform_device scif4_device = {
.name = "sh-sci",
.id = 4,
+ .resource = scif4_resources,
+ .num_resources = ARRAY_SIZE(scif4_resources),
.dev = {
.platform_data = &scif4_platform_data,
},
};
static struct plat_sci_port scif5_platform_data = {
- .mapbase = 0xa4e50000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_3,
.type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xfa0)),
+};
+
+static struct resource scif5_resources[] = {
+ DEFINE_RES_MEM(0xa4e50000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xfa0)),
};
static struct platform_device scif5_device = {
.name = "sh-sci",
.id = 5,
+ .resource = scif5_resources,
+ .num_resources = ARRAY_SIZE(scif5_resources),
.dev = {
.platform_data = &scif5_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index 26b74c2..fb0a237 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -290,111 +290,141 @@ static struct platform_device dma1_device = {
/* Serial */
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xffe00000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc00)),
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xffe00000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc00)),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xffe10000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc20)),
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xffe10000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc20)),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xffe20000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xc40)),
.regtype = SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
};
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xffe20000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xc40)),
+};
+
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xa4e30000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE,
.scbrr_algo_id = SCBRR_ALGO_3,
.type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)),
+};
+
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xa4e30000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x900)),
};
static struct platform_device scif3_device = {
.name = "sh-sci",
.id = 3,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
};
static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xa4e40000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE,
.scbrr_algo_id = SCBRR_ALGO_3,
.type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xd00)),
+};
+
+static struct resource scif4_resources[] = {
+ DEFINE_RES_MEM(0xa4e40000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xd00)),
};
static struct platform_device scif4_device = {
.name = "sh-sci",
.id = 4,
+ .resource = scif4_resources,
+ .num_resources = ARRAY_SIZE(scif4_resources),
.dev = {
.platform_data = &scif4_platform_data,
},
};
static struct plat_sci_port scif5_platform_data = {
- .mapbase = 0xa4e50000,
.port_reg = SCIx_NOT_SUPPORTED,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE,
.scbrr_algo_id = SCBRR_ALGO_3,
.type = PORT_SCIFA,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xfa0)),
+};
+
+static struct resource scif5_resources[] = {
+ DEFINE_RES_MEM(0xa4e50000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xfa0)),
};
static struct platform_device scif5_device = {
.name = "sh-sci",
.id = 5,
+ .resource = scif5_resources,
+ .num_resources = ARRAY_SIZE(scif5_resources),
.dev = {
.platform_data = &scif5_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7734.c b/arch/sh/kernel/cpu/sh4a/setup-sh7734.c
index f799971..bedf8fb 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7734.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7734.c
@@ -25,108 +25,138 @@
/* SCIF */
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xFFE40000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x8C0)),
.regtype = SCIx_SH4_SCIF_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xffe40000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x8c0)),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
- .id = 0,
+ .id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xFFE41000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x8E0)),
.regtype = SCIx_SH4_SCIF_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xffe41000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x8e0)),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
- .id = 1,
+ .id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xFFE42000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x900)),
.regtype = SCIx_SH4_SCIF_REGTYPE,
};
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xffe42000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x900)),
+};
+
static struct platform_device scif2_device = {
.name = "sh-sci",
- .id = 2,
+ .id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xFFE43000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x920)),
.regtype = SCIx_SH4_SCIF_REGTYPE,
};
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xffe43000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x920)),
+};
+
static struct platform_device scif3_device = {
.name = "sh-sci",
- .id = 3,
+ .id = 3,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
};
static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xFFE44000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x940)),
.regtype = SCIx_SH4_SCIF_REGTYPE,
};
+static struct resource scif4_resources[] = {
+ DEFINE_RES_MEM(0xffe44000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x940)),
+};
+
static struct platform_device scif4_device = {
.name = "sh-sci",
- .id = 4,
+ .id = 4,
+ .resource = scif4_resources,
+ .num_resources = ARRAY_SIZE(scif4_resources),
.dev = {
.platform_data = &scif4_platform_data,
},
};
static struct plat_sci_port scif5_platform_data = {
- .mapbase = 0xFFE43000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x960)),
.regtype = SCIx_SH4_SCIF_REGTYPE,
};
+static struct resource scif5_resources[] = {
+ DEFINE_RES_MEM(0xffe43000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x960)),
+};
+
static struct platform_device scif5_device = {
.name = "sh-sci",
- .id = 5,
+ .id = 5,
+ .resource = scif5_resources,
+ .num_resources = ARRAY_SIZE(scif5_resources),
.dev = {
.platform_data = &scif5_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
index 9079a0f..6b8d0e6 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
@@ -24,51 +24,66 @@
#include <cpu/sh7757.h>
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xfe4b0000, /* SCIF2 */
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x700)),
+};
+
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xfe4b0000, 0x100), /* SCIF2 */
+ DEFINE_RES_IRQ(evt2irq(0x700)),
};
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xfe4c0000, /* SCIF3 */
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xb80)),
+};
+
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xfe4c0000, 0x100), /* SCIF3 */
+ DEFINE_RES_IRQ(evt2irq(0xb80)),
};
static struct platform_device scif3_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
};
static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xfe4d0000, /* SCIF4 */
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xF00)),
+};
+
+static struct resource scif4_resources[] = {
+ DEFINE_RES_MEM(0xfe4d0000, 0x100), /* SCIF4 */
+ DEFINE_RES_IRQ(evt2irq(0xf00)),
};
static struct platform_device scif4_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif4_resources,
+ .num_resources = ARRAY_SIZE(scif4_resources),
.dev = {
.platform_data = &scif4_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
index 1686aca..940505c 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
@@ -19,54 +19,69 @@
#include <linux/usb/ohci_pdriver.h>
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xffe00000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x700)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xffe00000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x700)),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xffe08000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xb80)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xffe08000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xb80)),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xffe10000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xf00)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xffe10000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xf00)),
+};
+
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
index 256ea7a..f9c04de 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
@@ -16,170 +16,220 @@
#include <linux/io.h>
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xff923000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x9a0)),
+};
+
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xff923000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x9a0)),
};
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xff924000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x9c0)),
+};
+
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xff924000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x9c0)),
};
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xff925000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x9e0)),
+};
+
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xff925000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x9e0)),
};
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xff926000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xa00)),
+};
+
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xff926000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xa00)),
};
static struct platform_device scif3_device = {
.name = "sh-sci",
.id = 3,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
};
static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xff927000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xa20)),
+};
+
+static struct resource scif4_resources[] = {
+ DEFINE_RES_MEM(0xff927000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xa20)),
};
static struct platform_device scif4_device = {
.name = "sh-sci",
.id = 4,
+ .resource = scif4_resources,
+ .num_resources = ARRAY_SIZE(scif4_resources),
.dev = {
.platform_data = &scif4_platform_data,
},
};
static struct plat_sci_port scif5_platform_data = {
- .mapbase = 0xff928000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xa40)),
+};
+
+static struct resource scif5_resources[] = {
+ DEFINE_RES_MEM(0xff928000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xa40)),
};
static struct platform_device scif5_device = {
.name = "sh-sci",
.id = 5,
+ .resource = scif5_resources,
+ .num_resources = ARRAY_SIZE(scif5_resources),
.dev = {
.platform_data = &scif5_platform_data,
},
};
static struct plat_sci_port scif6_platform_data = {
- .mapbase = 0xff929000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xa60)),
+};
+
+static struct resource scif6_resources[] = {
+ DEFINE_RES_MEM(0xff929000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xa60)),
};
static struct platform_device scif6_device = {
.name = "sh-sci",
.id = 6,
+ .resource = scif6_resources,
+ .num_resources = ARRAY_SIZE(scif6_resources),
.dev = {
.platform_data = &scif6_platform_data,
},
};
static struct plat_sci_port scif7_platform_data = {
- .mapbase = 0xff92a000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xa80)),
+};
+
+static struct resource scif7_resources[] = {
+ DEFINE_RES_MEM(0xff92a000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xa80)),
};
static struct platform_device scif7_device = {
.name = "sh-sci",
.id = 7,
+ .resource = scif7_resources,
+ .num_resources = ARRAY_SIZE(scif7_resources),
.dev = {
.platform_data = &scif7_platform_data,
},
};
static struct plat_sci_port scif8_platform_data = {
- .mapbase = 0xff92b000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xaa0)),
+};
+
+static struct resource scif8_resources[] = {
+ DEFINE_RES_MEM(0xff92b000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xaa0)),
};
static struct platform_device scif8_device = {
.name = "sh-sci",
.id = 8,
+ .resource = scif8_resources,
+ .num_resources = ARRAY_SIZE(scif8_resources),
.dev = {
.platform_data = &scif8_platform_data,
},
};
static struct plat_sci_port scif9_platform_data = {
- .mapbase = 0xff92c000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xac0)),
+};
+
+static struct resource scif9_resources[] = {
+ DEFINE_RES_MEM(0xff92c000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xac0)),
};
static struct platform_device scif9_device = {
.name = "sh-sci",
.id = 9,
+ .resource = scif9_resources,
+ .num_resources = ARRAY_SIZE(scif9_resources),
.dev = {
.platform_data = &scif9_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
index de45b70..227f8f4 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
@@ -18,36 +18,46 @@
#include <cpu/dma-register.h>
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xffe00000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x700)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xffe00000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x700)),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xffe10000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0xb80)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xffe10000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0xb80)),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
index 0968ecb..b9f64c1 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
@@ -20,108 +20,138 @@
#include <cpu/dma-register.h>
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xffea0000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x700)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xffea0000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x700)),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xffeb0000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x780)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xffeb0000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x780)),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xffec0000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x980)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xffec0000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x980)),
+};
+
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xffed0000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x9a0)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xffed0000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x9a0)),
+};
+
static struct platform_device scif3_device = {
.name = "sh-sci",
.id = 3,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
};
static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xffee0000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x9c0)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif4_resources[] = {
+ DEFINE_RES_MEM(0xffee0000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x9c0)),
+};
+
static struct platform_device scif4_device = {
.name = "sh-sci",
.id = 4,
+ .resource = scif4_resources,
+ .num_resources = ARRAY_SIZE(scif4_resources),
.dev = {
.platform_data = &scif4_platform_data,
},
};
static struct plat_sci_port scif5_platform_data = {
- .mapbase = 0xffef0000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x9e0)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif5_resources[] = {
+ DEFINE_RES_MEM(0xffef0000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x9e0)),
+};
+
static struct platform_device scif5_device = {
.name = "sh-sci",
.id = 5,
+ .resource = scif5_resources,
+ .num_resources = ARRAY_SIZE(scif5_resources),
.dev = {
.platform_data = &scif5_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index ab52d4d..92b95ce 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -28,21 +28,26 @@
#include <asm/mmzone.h>
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xffea0000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = { evt2irq(0x700),
- evt2irq(0x720),
- evt2irq(0x760),
- evt2irq(0x740) },
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xffea0000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x700)),
+ DEFINE_RES_IRQ(evt2irq(0x720)),
+ DEFINE_RES_IRQ(evt2irq(0x760)),
+ DEFINE_RES_IRQ(evt2irq(0x740)),
+};
+
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
@@ -52,90 +57,124 @@ static struct platform_device scif0_device = {
* The rest of these all have multiplexed IRQs
*/
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xffeb0000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x780)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xffeb0000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x780)),
+};
+
+static struct resource scif1_demux_resources[] = {
+ DEFINE_RES_MEM(0xffeb0000, 0x100),
+ /* Placeholders, see sh7786_devices_setup() */
+ DEFINE_RES_IRQ(0),
+ DEFINE_RES_IRQ(0),
+ DEFINE_RES_IRQ(0),
+ DEFINE_RES_IRQ(0),
+};
+
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xffec0000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x840)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xffec0000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x840)),
+};
+
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
};
static struct plat_sci_port scif3_platform_data = {
- .mapbase = 0xffed0000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x860)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif3_resources[] = {
+ DEFINE_RES_MEM(0xffed0000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x860)),
+};
+
static struct platform_device scif3_device = {
.name = "sh-sci",
.id = 3,
+ .resource = scif3_resources,
+ .num_resources = ARRAY_SIZE(scif3_resources),
.dev = {
.platform_data = &scif3_platform_data,
},
};
static struct plat_sci_port scif4_platform_data = {
- .mapbase = 0xffee0000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x880)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif4_resources[] = {
+ DEFINE_RES_MEM(0xffee0000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x880)),
+};
+
static struct platform_device scif4_device = {
.name = "sh-sci",
.id = 4,
+ .resource = scif4_resources,
+ .num_resources = ARRAY_SIZE(scif4_resources),
.dev = {
.platform_data = &scif4_platform_data,
},
};
static struct plat_sci_port scif5_platform_data = {
- .mapbase = 0xffef0000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
.scbrr_algo_id = SCBRR_ALGO_1,
.type = PORT_SCIF,
- .irqs = SCIx_IRQ_MUXED(evt2irq(0x8a0)),
.regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
};
+static struct resource scif5_resources[] = {
+ DEFINE_RES_MEM(0xffef0000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x8a0)),
+};
+
static struct platform_device scif5_device = {
.name = "sh-sci",
.id = 5,
+ .resource = scif5_resources,
+ .num_resources = ARRAY_SIZE(scif5_resources),
.dev = {
.platform_data = &scif5_platform_data,
},
@@ -1037,13 +1076,16 @@ static int __init sh7786_devices_setup(void)
*/
irq = intc_irq_lookup(sh7786_intc_desc.name, TXI1);
if (irq > 0) {
- scif1_platform_data.irqs[SCIx_TXI_IRQ] = irq;
- scif1_platform_data.irqs[SCIx_ERI_IRQ] + scif1_demux_resources[1].start intc_irq_lookup(sh7786_intc_desc.name, ERI1);
- scif1_platform_data.irqs[SCIx_BRI_IRQ] - intc_irq_lookup(sh7786_intc_desc.name, BRI1);
- scif1_platform_data.irqs[SCIx_RXI_IRQ] + scif1_demux_resources[2].start intc_irq_lookup(sh7786_intc_desc.name, RXI1);
+ scif1_demux_resources[3].start = irq;
+ scif1_demux_resources[4].start + intc_irq_lookup(sh7786_intc_desc.name, BRI1);
+
+ scif1_device.resource = scif1_demux_resources;
+ scif1_device.num_resources = ARRAY_SIZE(scif1_demux_resources);
}
ret = platform_add_devices(sh7786_early_devices,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
index 688f7ed..4d65be9 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
@@ -28,60 +28,75 @@
* all rather than adding infrastructure to hack around it.
*/
static struct plat_sci_port scif0_platform_data = {
- .mapbase = 0xffc30000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { evt2irq(0x700),
- evt2irq(0x720),
- evt2irq(0x760),
- evt2irq(0x740) },
+};
+
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(0xffc30000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x700)),
+ DEFINE_RES_IRQ(evt2irq(0x720)),
+ DEFINE_RES_IRQ(evt2irq(0x760)),
+ DEFINE_RES_IRQ(evt2irq(0x740)),
};
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
};
static struct plat_sci_port scif1_platform_data = {
- .mapbase = 0xffc40000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { evt2irq(0x780),
- evt2irq(0x7a0),
- evt2irq(0x7e0),
- evt2irq(0x7c0) },
+};
+
+static struct resource scif1_resources[] = {
+ DEFINE_RES_MEM(0xffc40000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x780)),
+ DEFINE_RES_IRQ(evt2irq(0x7a0)),
+ DEFINE_RES_IRQ(evt2irq(0x7e0)),
+ DEFINE_RES_IRQ(evt2irq(0x7c0)),
};
static struct platform_device scif1_device = {
.name = "sh-sci",
.id = 1,
+ .resource = scif1_resources,
+ .num_resources = ARRAY_SIZE(scif1_resources),
.dev = {
.platform_data = &scif1_platform_data,
},
};
static struct plat_sci_port scif2_platform_data = {
- .mapbase = 0xffc60000,
.flags = UPF_BOOT_AUTOCONF,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { evt2irq(0x880),
- evt2irq(0x8a0),
- evt2irq(0x8e0),
- evt2irq(0x8c0) },
+};
+
+static struct resource scif2_resources[] = {
+ DEFINE_RES_MEM(0xffc60000, 0x100),
+ DEFINE_RES_IRQ(evt2irq(0x880)),
+ DEFINE_RES_IRQ(evt2irq(0x8a0)),
+ DEFINE_RES_IRQ(evt2irq(0x8e0)),
+ DEFINE_RES_IRQ(evt2irq(0x8c0)),
};
static struct platform_device scif2_device = {
.name = "sh-sci",
.id = 2,
+ .resource = scif2_resources,
+ .num_resources = ARRAY_SIZE(scif2_resources),
.dev = {
.platform_data = &scif2_platform_data,
},
diff --git a/arch/sh/kernel/cpu/sh5/setup-sh5.c b/arch/sh/kernel/cpu/sh5/setup-sh5.c
index 18419f1..64b0981 100644
--- a/arch/sh/kernel/cpu/sh5/setup-sh5.c
+++ b/arch/sh/kernel/cpu/sh5/setup-sh5.c
@@ -17,17 +17,24 @@
#include <asm/addrspace.h>
static struct plat_sci_port scif0_platform_data = {
- .mapbase = PHYS_PERIPHERAL_BLOCK + 0x01030000,
.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
.scbrr_algo_id = SCBRR_ALGO_2,
.type = PORT_SCIF,
- .irqs = { 39, 40, 42, 0 },
+};
+
+static struct resource scif0_resources[] = {
+ DEFINE_RES_MEM(PHYS_PERIPHERAL_BLOCK + 0x01030000, 0x100),
+ DEFINE_RES_IRQ(39),
+ DEFINE_RES_IRQ(40),
+ DEFINE_RES_IRQ(42),
};
static struct platform_device scif0_device = {
.name = "sh-sci",
.id = 0,
+ .resource = scif0_resources,
+ .num_resources = ARRAY_SIZE(scif0_resources),
.dev = {
.platform_data = &scif0_platform_data,
},
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 27/29] serial: sh-sci: Remove platform data mapbase and irqs fields
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (25 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 26/29] sh: " Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 28/29] serial: sh-sci: Add device tree bindings documentation Laurent Pinchart
` (2 subsequent siblings)
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
The fields are not used anymore by board files, remove them.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
drivers/tty/serial/sh-sci.c | 60 +++++++++++++++++++++++++--------------------
include/linux/serial_sci.h | 26 --------------------
2 files changed, 34 insertions(+), 52 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index c5abe5c..6bb1e8f 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -59,6 +59,23 @@
#include "sh-sci.h"
+/* Offsets into the sci_port->irqs array */
+enum {
+ SCIx_ERI_IRQ,
+ SCIx_RXI_IRQ,
+ SCIx_TXI_IRQ,
+ SCIx_BRI_IRQ,
+ SCIx_NR_IRQS,
+
+ SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */
+};
+
+#define SCIx_IRQ_IS_MUXED(port) \
+ ((port)->irqs[SCIx_ERI_IRQ] = \
+ (port)->irqs[SCIx_RXI_IRQ]) || \
+ ((port)->irqs[SCIx_ERI_IRQ] && \
+ ((port)->irqs[SCIx_RXI_IRQ] < 0))
+
struct sci_port {
struct uart_port port;
@@ -2160,36 +2177,27 @@ static int sci_init_single(struct platform_device *dev,
port->iotype = UPIO_MEM;
port->line = index;
- if (dev->num_resources) {
- /* Device has resources, use them. */
- res = platform_get_resource(dev, IORESOURCE_MEM, 0);
- if (res = NULL)
- return -ENOMEM;
+ res = platform_get_resource(dev, IORESOURCE_MEM, 0);
+ if (res = NULL)
+ return -ENOMEM;
- port->mapbase = res->start;
+ port->mapbase = res->start;
- for (i = 0; i < ARRAY_SIZE(sci_port->irqs); ++i)
- sci_port->irqs[i] = platform_get_irq(dev, i);
+ for (i = 0; i < ARRAY_SIZE(sci_port->irqs); ++i)
+ sci_port->irqs[i] = platform_get_irq(dev, i);
- /* The SCI generates several interrupts. They can be muxed
- * together or connected to different interrupt lines. In the
- * muxed case only one interrupt resource is specified. In the
- * non-muxed case three or four interrupt resources are
- * specified, as the BRI interrupt is optional.
- */
- if (sci_port->irqs[0] < 0)
- return -ENXIO;
+ /* The SCI generates several interrupts. They can be muxed together or
+ * connected to different interrupt lines. In the muxed case only one
+ * interrupt resource is specified. In the non-muxed case three or four
+ * interrupt resources are specified, as the BRI interrupt is optional.
+ */
+ if (sci_port->irqs[0] < 0)
+ return -ENXIO;
- if (sci_port->irqs[1] < 0) {
- sci_port->irqs[1] = sci_port->irqs[0];
- sci_port->irqs[2] = sci_port->irqs[0];
- sci_port->irqs[3] = sci_port->irqs[0];
- }
- } else {
- /* No resources, use old-style platform data. */
- port->mapbase = p->mapbase;
- for (i = 0; i < ARRAY_SIZE(sci_port->irqs); ++i)
- sci_port->irqs[i] = p->irqs[i] ? p->irqs[i] : -ENXIO;
+ if (sci_port->irqs[1] < 0) {
+ sci_port->irqs[1] = sci_port->irqs[0];
+ sci_port->irqs[2] = sci_port->irqs[0];
+ sci_port->irqs[3] = sci_port->irqs[0];
}
switch (p->type) {
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index 68cf0bf..620cb57 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -58,17 +58,6 @@ enum {
/* HSSRR HSCIF */
#define HSCIF_SRE 0x8000
-/* Offsets into the sci_port->irqs array */
-enum {
- SCIx_ERI_IRQ,
- SCIx_RXI_IRQ,
- SCIx_TXI_IRQ,
- SCIx_BRI_IRQ,
- SCIx_NR_IRQS,
-
- SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */
-};
-
/* Offsets into the sci_port->gpios array */
enum {
SCIx_SCK,
@@ -98,19 +87,6 @@ enum {
SCIx_NR_REGTYPES,
};
-#define SCIx_IRQ_MUXED(irq) \
-{ \
- [SCIx_ERI_IRQ] = (irq), \
- [SCIx_RXI_IRQ] = (irq), \
- [SCIx_TXI_IRQ] = (irq), \
- [SCIx_BRI_IRQ] = (irq), \
-}
-
-#define SCIx_IRQ_IS_MUXED(port) \
- ((port)->irqs[SCIx_ERI_IRQ] = \
- (port)->irqs[SCIx_RXI_IRQ]) || \
- ((port)->irqs[SCIx_ERI_IRQ] && \
- ((port)->irqs[SCIx_RXI_IRQ] < 0))
/*
* SCI register subset common for all port types.
* Not all registers will exist on all parts.
@@ -139,8 +115,6 @@ struct plat_sci_port_ops {
* Platform device specific platform_data struct
*/
struct plat_sci_port {
- unsigned long mapbase; /* resource base */
- unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */
unsigned int gpios[SCIx_NR_FNS]; /* SCK, RXD, TXD, CTS, RTS */
unsigned int type; /* SCI / SCIF / IRDA / HSCIF */
upf_t flags; /* UPF_* flags */
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 28/29] serial: sh-sci: Add device tree bindings documentation
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (26 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 27/29] serial: sh-sci: Remove platform data mapbase and irqs fields Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-10 18:07 ` Sergei Shtylyov
2013-11-11 9:40 ` Mark Rutland
2013-11-10 3:33 ` [PATCH v2 29/29] serial: sh-sci: Add OF support Laurent Pinchart
2013-11-19 1:55 ` [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Simon Horman
29 siblings, 2 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt, devicetree
Document the device tree bindings for the sci serial port devices.
Cc: devicetree@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
---
.../bindings/serial/renesas,sci-serial.txt | 42 ++++++++++++++++++++++
1 file changed, 42 insertions(+)
create mode 100644 Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
diff --git a/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
new file mode 100644
index 0000000..66d3bca
--- /dev/null
+++ b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
@@ -0,0 +1,42 @@
+* Renesas SH-Mobile Serial Communication Interface
+
+Required properties:
+
+ - compatible: one of the following types (scif, scifa, scifb, hscif).
+
+ - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.
+ - "renesas,scifa-r8a7790" for R8A7790 (R-Car H2) SCIFA compatible UART.
+ - "renesas,scifb-r8a7790" for R8A7790 (R-Car H2) SCIFB compatible UART.
+ - "renesas,hscif-r8a7790" for R8A7790 (R-Car H2) HSCIF compatible UART.
+ - "renesas,scif-generic" for generic SCIF compatible UART.
+ - "renesas,scifa-generic" for generic SCIFA compatible UART.
+ - "renesas,scifb-generic" for generic SCIFB compatible UART.
+ - "renesas,hscif-generic" for generic HSCIF compatible UART.
+
+ When compatible with the generic version, nodes must also list the
+ SoC-specific version corresponding to the platform.
+
+ - reg: Base address and length of the memory resource used by the UART.
+
+ - interrupt-parent: Reference to the parent interrupt controller.
+ - interrupts: Interrupt number.
+
+ - clocks: Reference to the SCIx UART interface clock.
+ - clock-names: Should be "sci_ick".
+
+Note: Each enabled SCIx UART should have an alias correctly numbered in the
+"aliases" node.
+
+Example:
+ aliases {
+ serial0 = &scifa0;
+ };
+
+ scifa0: serial@e6c40000 {
+ compatible = "renesas,scifa-r8a7790", "renesas,scifa-generic";
+ reg = <0 0xe6c40000 0 64>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 144 4>;
+ clocks = <&mstp2_clks 4>;
+ clock-names = "sci_ick";
+ };
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [PATCH v2 29/29] serial: sh-sci: Add OF support
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (27 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 28/29] serial: sh-sci: Add device tree bindings documentation Laurent Pinchart
@ 2013-11-10 3:33 ` Laurent Pinchart
2013-11-19 1:55 ` [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Simon Horman
29 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-10 3:33 UTC (permalink / raw)
To: linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
From: Bastian Hecht <hechtb@gmail.com>
Extend the driver to with support for SCIx device tree bindings. A
minimal set of features is supported, additional properties can be added
later should the need to describe more device features arise.
Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/tty/serial/sh-sci.c | 107 ++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 104 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 6bb1e8f..ca1c453 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -40,6 +40,7 @@
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/notifier.h>
+#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/scatterlist.h>
@@ -2472,6 +2473,89 @@ static int sci_remove(struct platform_device *dev)
return 0;
}
+struct sci_port_info {
+ unsigned int type;
+ unsigned int regtype;
+ unsigned int brr_algo;
+};
+
+static const struct of_device_id of_sci_match[] = {
+ {
+ .compatible = "renesas,scif-generic",
+ .data = (void *)&(const struct sci_port_info) {
+ .type = PORT_SCIF,
+ .regtype = SCIx_SH4_SCIF_REGTYPE,
+ .brr_algo = SCBRR_ALGO_2,
+ },
+ }, {
+ .compatible = "renesas,scifa-generic",
+ .data = (void *)&(const struct sci_port_info) {
+ .type = PORT_SCIFA,
+ .regtype = SCIx_SCIFA_REGTYPE,
+ .brr_algo = SCBRR_ALGO_4,
+ },
+ }, {
+ .compatible = "renesas,scifb-generic",
+ .data = (void *)&(const struct sci_port_info) {
+ .type = PORT_SCIFB,
+ .regtype = SCIx_SCIFB_REGTYPE,
+ .brr_algo = SCBRR_ALGO_4,
+ },
+ }, {
+ .compatible = "renesas,hscif-generic",
+ .data = (void *)&(const struct sci_port_info) {
+ .type = PORT_HSCIF,
+ .regtype = SCIx_HSCIF_REGTYPE,
+ .brr_algo = SCBRR_ALGO_6,
+ },
+ }, {
+ /* Terminator */
+ },
+};
+MODULE_DEVICE_TABLE(of, of_sci_match);
+
+static struct plat_sci_port *
+sci_parse_dt(struct platform_device *pdev, unsigned int *dev_id)
+{
+ struct device_node *np = pdev->dev.of_node;
+ const struct of_device_id *match;
+ const struct sci_port_info *info;
+ struct plat_sci_port *p;
+ int id;
+
+ if (!IS_ENABLED(CONFIG_OF) || !np)
+ return NULL;
+
+ match = of_match_node(of_sci_match, pdev->dev.of_node);
+ if (!match)
+ return NULL;
+
+ info = match->data;
+
+ p = devm_kzalloc(&pdev->dev, sizeof(struct plat_sci_port), GFP_KERNEL);
+ if (!p) {
+ dev_err(&pdev->dev, "failed to allocate DT config data\n");
+ return NULL;
+ }
+
+ /* Get the line number for the aliases node. */
+ id = of_alias_get_id(np, "serial");
+ if (id < 0) {
+ dev_err(&pdev->dev, "failed to get alias id (%d)\n", id);
+ return NULL;
+ }
+
+ *dev_id = id;
+
+ p->flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
+ p->type = info->type;
+ p->regtype = info->regtype;
+ p->scscr = SCSCR_RE | SCSCR_TE;
+ p->scbrr_algo_id = info->brr_algo;
+
+ return p;
+}
+
static int sci_probe_single(struct platform_device *dev,
unsigned int index,
struct plat_sci_port *p,
@@ -2504,8 +2588,9 @@ static int sci_probe_single(struct platform_device *dev,
static int sci_probe(struct platform_device *dev)
{
- struct plat_sci_port *p = dev_get_platdata(&dev->dev);
- struct sci_port *sp = &sci_ports[dev->id];
+ struct plat_sci_port *p;
+ struct sci_port *sp;
+ unsigned int dev_id;
int ret;
/*
@@ -2516,9 +2601,24 @@ static int sci_probe(struct platform_device *dev)
if (is_early_platform_device(dev))
return sci_probe_earlyprintk(dev);
+ if (dev->dev.of_node) {
+ p = sci_parse_dt(dev, &dev_id);
+ if (p = NULL)
+ return -EINVAL;
+ } else {
+ p = dev->dev.platform_data;
+ if (p = NULL) {
+ dev_err(&dev->dev, "no platform data supplied\n");
+ return -EINVAL;
+ }
+
+ dev_id = dev->id;
+ }
+
+ sp = &sci_ports[dev_id];
platform_set_drvdata(dev, sp);
- ret = sci_probe_single(dev, dev->id, p, sp);
+ ret = sci_probe_single(dev, dev_id, p, sp);
if (ret)
return ret;
@@ -2570,6 +2670,7 @@ static struct platform_driver sci_driver = {
.name = "sh-sci",
.owner = THIS_MODULE,
.pm = &sci_dev_pm_ops,
+ .of_match_table = of_match_ptr(of_sci_match),
},
};
--
1.8.1.5
^ permalink raw reply related [flat|nested] 41+ messages in thread
* Re: [PATCH v2 28/29] serial: sh-sci: Add device tree bindings documentation
2013-11-10 3:33 ` [PATCH v2 28/29] serial: sh-sci: Add device tree bindings documentation Laurent Pinchart
@ 2013-11-10 18:07 ` Sergei Shtylyov
2013-11-11 2:39 ` Laurent Pinchart
2013-11-11 9:40 ` Mark Rutland
1 sibling, 1 reply; 41+ messages in thread
From: Sergei Shtylyov @ 2013-11-10 18:07 UTC (permalink / raw)
To: Laurent Pinchart, linux-sh
Cc: linux-serial, Bastian Hecht, Paul Mundt, devicetree
On 10-11-2013 7:33, Laurent Pinchart wrote:
> Document the device tree bindings for the sci serial port devices.
> Cc: devicetree@vger.kernel.org
Hm, why are you not CCing a bunch of people responsible for the DT
bindings maintenance that scripts/get_maintainer.pl should yield?
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Acked-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> .../bindings/serial/renesas,sci-serial.txt | 42 ++++++++++++++++++++++
> 1 file changed, 42 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> diff --git a/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> new file mode 100644
> index 0000000..66d3bca
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> @@ -0,0 +1,42 @@
> +* Renesas SH-Mobile Serial Communication Interface
> +
> +Required properties:
> +
> + - compatible: one of the following types (scif, scifa, scifb, hscif).
> +
> + - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.
> + - "renesas,scifa-r8a7790" for R8A7790 (R-Car H2) SCIFA compatible UART.
> + - "renesas,scifb-r8a7790" for R8A7790 (R-Car H2) SCIFB compatible UART.
> + - "renesas,hscif-r8a7790" for R8A7790 (R-Car H2) HSCIF compatible UART.
> + - "renesas,scif-generic" for generic SCIF compatible UART.
> + - "renesas,scifa-generic" for generic SCIFA compatible UART.
> + - "renesas,scifb-generic" for generic SCIFB compatible UART.
> + - "renesas,hscif-generic" for generic HSCIF compatible UART.
> +
> + When compatible with the generic version, nodes must also list the
> + SoC-specific version corresponding to the platform.
Which are not all specified here?
> +
> + - reg: Base address and length of the memory resource used by the UART.
> +
> + - interrupt-parent: Reference to the parent interrupt controller.
This is not a required property. It can be specified in the parent node.
> + - interrupts: Interrupt number.
s/number/specifier/
> +
> + - clocks: Reference to the SCIx UART interface clock.
> + - clock-names: Should be "sci_ick".
> +
> +Note: Each enabled SCIx UART should have an alias correctly numbered in the
> +"aliases" node.
> +
> +Example:
> + aliases {
> + serial0 = &scifa0;
> + };
> +
> + scifa0: serial@e6c40000 {
> + compatible = "renesas,scifa-r8a7790", "renesas,scifa-generic";
> + reg = <0 0xe6c40000 0 64>;
> + interrupt-parent = <&gic>;
> + interrupts = <0 144 4>;
> + clocks = <&mstp2_clks 4>;
> + clock-names = "sci_ick";
> + };
WBR, Sergei
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v2 12/29] ARM: shmobile: r7s72100: Don't define SCIF platform data in an array
2013-11-10 3:33 ` [PATCH v2 12/29] ARM: shmobile: r7s72100: Don't define SCIF platform data in an array Laurent Pinchart
@ 2013-11-10 18:35 ` Sergei Shtylyov
2013-11-11 2:41 ` Laurent Pinchart
0 siblings, 1 reply; 41+ messages in thread
From: Sergei Shtylyov @ 2013-11-10 18:35 UTC (permalink / raw)
To: Laurent Pinchart, linux-sh; +Cc: linux-serial, Bastian Hecht, Paul Mundt
Hello.
On 10-11-2013 7:33, Laurent Pinchart wrote:
> The SCIF driver is transitioning to platform resources. Board code will
> thus need to define an array of resources for each SCIF device. This is
> incompatible with the macro-based SCIF platform data definition as an
> array. Rework the macro to define platform data as individual
> structures.
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
> arch/arm/mach-shmobile/setup-r7s72100.c | 49 +++++++++++++++------------------
> 1 file changed, 22 insertions(+), 27 deletions(-)
> diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c
> index d4eb509..dbcbb81 100644
> --- a/arch/arm/mach-shmobile/setup-r7s72100.c
> +++ b/arch/arm/mach-shmobile/setup-r7s72100.c
[...]
> @@ -39,35 +39,30 @@
[...]
> -static inline void r7s72100_register_scif(int idx)
> -{
> - platform_device_register_data(&platform_bus, "sh-sci", idx, &scif[idx],
> - sizeof(struct plat_sci_port));
> -}
> +#define r7s72100_register_scif(index) \
> + platform_device_register_data(&platform_bus, "sh-sci", index, \
> + &scif##index##_platform_data, \
> + sizeof(scif##index##_platform_data))
Not sure why you changes the indentation here, it was alright before the
patch.
WBR, Sergei
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v2 28/29] serial: sh-sci: Add device tree bindings documentation
2013-11-10 18:07 ` Sergei Shtylyov
@ 2013-11-11 2:39 ` Laurent Pinchart
0 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-11 2:39 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Laurent Pinchart, linux-sh, linux-serial, Bastian Hecht,
Paul Mundt, devicetree
Hi Sergei,
On Sunday 10 November 2013 22:07:16 Sergei Shtylyov wrote:
> On 10-11-2013 7:33, Laurent Pinchart wrote:
> > Document the device tree bindings for the sci serial port devices.
> >
> > Cc: devicetree@vger.kernel.org
>
> Hm, why are you not CCing a bunch of people responsible for the DT bindings
> maintenance that scripts/get_maintainer.pl should yield?
Because they're subscribed to the devicetree list, and they're already
overwhelmed with e-mails.
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
> > Acked-by: Simon Horman <horms+renesas@verge.net.au>
> > ---
> >
> > .../bindings/serial/renesas,sci-serial.txt | 42 ++++++++++++++++
> > 1 file changed, 42 insertions(+)
> > create mode 100644
> > Documentation/devicetree/bindings/serial/renesas,sci-serial.txt>
> > diff --git
> > a/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> > b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt new
> > file mode 100644
> > index 0000000..66d3bca
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> > @@ -0,0 +1,42 @@
> > +* Renesas SH-Mobile Serial Communication Interface
> > +
> > +Required properties:
> > +
> > + - compatible: one of the following types (scif, scifa, scifb, hscif).
> > +
> > + - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.
> > + - "renesas,scifa-r8a7790" for R8A7790 (R-Car H2) SCIFA compatible
> > UART.
> > + - "renesas,scifb-r8a7790" for R8A7790 (R-Car H2) SCIFB compatible
> > UART.
> > + - "renesas,hscif-r8a7790" for R8A7790 (R-Car H2) HSCIF compatible
> > UART.
> > + - "renesas,scif-generic" for generic SCIF compatible UART.
> > + - "renesas,scifa-generic" for generic SCIFA compatible UART.
> > + - "renesas,scifb-generic" for generic SCIFB compatible UART.
> > + - "renesas,hscif-generic" for generic HSCIF compatible UART.
> > +
> > + When compatible with the generic version, nodes must also list the
> > + SoC-specific version corresponding to the platform.
>
> Which are not all specified here?
The r8a7790-specific versions are. Other SoCs will be added later when ported
to SCIF DT.
> > +
> > + - reg: Base address and length of the memory resource used by the UART.
> > +
> > + - interrupt-parent: Reference to the parent interrupt controller.
>
> This is not a required property. It can be specified in the parent node.
But in practice it isn't for the SCIF devices.
Given that we'll soon get a new way to specify interrupts, I think I'll just
reference the corresponding DT bindings document when it will be updated
instead of documenting all possibilities here.
> > + - interrupts: Interrupt number.
>
> s/number/specifier/
I'll fix that.
>
> > +
> > + - clocks: Reference to the SCIx UART interface clock.
> > + - clock-names: Should be "sci_ick".
> > +
> > +Note: Each enabled SCIx UART should have an alias correctly numbered in
> > the +"aliases" node.
> > +
> > +Example:
> > + aliases {
> > + serial0 = &scifa0;
> > + };
> > +
> > + scifa0: serial@e6c40000 {
> > + compatible = "renesas,scifa-r8a7790", "renesas,scifa-generic";
> > + reg = <0 0xe6c40000 0 64>;
> > + interrupt-parent = <&gic>;
> > + interrupts = <0 144 4>;
> > + clocks = <&mstp2_clks 4>;
> > + clock-names = "sci_ick";
> > + };
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v2 12/29] ARM: shmobile: r7s72100: Don't define SCIF platform data in an array
2013-11-10 18:35 ` Sergei Shtylyov
@ 2013-11-11 2:41 ` Laurent Pinchart
0 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-11 2:41 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Laurent Pinchart, linux-sh, linux-serial, Bastian Hecht,
Paul Mundt
Hi Sergei,
On Sunday 10 November 2013 22:35:36 Sergei Shtylyov wrote:
> Hello.
>
> On 10-11-2013 7:33, Laurent Pinchart wrote:
> > The SCIF driver is transitioning to platform resources. Board code will
> > thus need to define an array of resources for each SCIF device. This is
> > incompatible with the macro-based SCIF platform data definition as an
> > array. Rework the macro to define platform data as individual
> > structures.
> >
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
> > ---
> >
> > arch/arm/mach-shmobile/setup-r7s72100.c | 49
> > +++++++++++++++------------------ 1 file changed, 22 insertions(+), 27
> > deletions(-)
> >
> > diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c
> > b/arch/arm/mach-shmobile/setup-r7s72100.c index d4eb509..dbcbb81 100644
> > --- a/arch/arm/mach-shmobile/setup-r7s72100.c
> > +++ b/arch/arm/mach-shmobile/setup-r7s72100.c
>
> [...]
>
> > @@ -39,35 +39,30 @@
>
> [...]
>
> > -static inline void r7s72100_register_scif(int idx)
> > -{
> > - platform_device_register_data(&platform_bus, "sh-sci", idx,
&scif[idx],
> > - sizeof(struct plat_sci_port));
> > -}
> > +#define r7s72100_register_scif(index) \
> > + platform_device_register_data(&platform_bus, "sh-sci", index,
\
> > + &scif##index##_platform_data, \
> > + sizeof(scif##index##_platform_data))
>
> Not sure why you changes the indentation here, it was alright before the
> patch.
No reason, that's a mistake, I'll fix it. Thank you for pointing it out.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v2 28/29] serial: sh-sci: Add device tree bindings documentation
2013-11-10 3:33 ` [PATCH v2 28/29] serial: sh-sci: Add device tree bindings documentation Laurent Pinchart
2013-11-10 18:07 ` Sergei Shtylyov
@ 2013-11-11 9:40 ` Mark Rutland
2013-11-11 13:26 ` Laurent Pinchart
1 sibling, 1 reply; 41+ messages in thread
From: Mark Rutland @ 2013-11-11 9:40 UTC (permalink / raw)
To: Laurent Pinchart
Cc: linux-sh@vger.kernel.org, linux-serial@vger.kernel.org,
Bastian Hecht, Paul Mundt, devicetree@vger.kernel.org
Hi Laurent,
I have a few comments.
On Sun, Nov 10, 2013 at 03:33:40AM +0000, Laurent Pinchart wrote:
> Document the device tree bindings for the sci serial port devices.
>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Acked-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> .../bindings/serial/renesas,sci-serial.txt | 42 ++++++++++++++++++++++
> 1 file changed, 42 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
>
> diff --git a/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> new file mode 100644
> index 0000000..66d3bca
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> @@ -0,0 +1,42 @@
> +* Renesas SH-Mobile Serial Communication Interface
> +
> +Required properties:
> +
> + - compatible: one of the following types (scif, scifa, scifb, hscif).
Minor nit, but would be nice to have "Should contain one of the
following:". We might have future variants whereby the compatible string
will actually be a string list.
> +
> + - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.
> + - "renesas,scifa-r8a7790" for R8A7790 (R-Car H2) SCIFA compatible UART.
> + - "renesas,scifb-r8a7790" for R8A7790 (R-Car H2) SCIFB compatible UART.
> + - "renesas,hscif-r8a7790" for R8A7790 (R-Car H2) HSCIF compatible UART.
> + - "renesas,scif-generic" for generic SCIF compatible UART.
> + - "renesas,scifa-generic" for generic SCIFA compatible UART.
> + - "renesas,scifb-generic" for generic SCIFB compatible UART.
> + - "renesas,hscif-generic" for generic HSCIF compatible UART.
Is the "-generic" suffix necessary? Why not just "renesas,scif" etc?
> +
> + When compatible with the generic version, nodes must also list the
> + SoC-specific version corresponding to the platform.
Presumably the SoC-specific version should come first; it would be nice
to note that.
> +
> + - reg: Base address and length of the memory resource used by the UART.
I assume by memory resource you mean the memory-mapped registers?
Resource sounds like Linux-internal nomenclature leaking.
> +
> + - interrupt-parent: Reference to the parent interrupt controller.
I don't think this is strictly necessary. It's implicit by default and
can be added optionally when a system is wired in a complex way. As it's
a completely standard optional property I'm not even sure it needs to be
documented.
> + - interrupts: Interrupt number.
Minor nit: "Should contain an interrupt-specifier for ..."
I saw the cover mentioned multiple interrupts. Which logical interrupt
output of the device are you expecting here?
> +
> + - clocks: Reference to the SCIx UART interface clock.
Minor nit: s/Reference to/A phandle + clock-specifier pair for/
> + - clock-names: Should be "sci_ick".
As we're using clock-names, it would be nicer still to define clocks in
terms of clock-names so as to make it easier to update the document in
future and make the expected use of clock-names clearer:
- clocks: Should contain a phandle + clock-specifier pair for each entry
in clock-names.
- clock-names: Should contain "sci_ick".
> +
> +Note: Each enabled SCIx UART should have an alias correctly numbered in the
> +"aliases" node.
> +
> +Example:
> + aliases {
> + serial0 = &scifa0;
> + };
> +
> + scifa0: serial@e6c40000 {
> + compatible = "renesas,scifa-r8a7790", "renesas,scifa-generic";
> + reg = <0 0xe6c40000 0 64>;
> + interrupt-parent = <&gic>;
> + interrupts = <0 144 4>;
> + clocks = <&mstp2_clks 4>;
> + clock-names = "sci_ick";
> + };
Otherwise this looks good to me.
Thanks,
Mark.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v2 28/29] serial: sh-sci: Add device tree bindings documentation
2013-11-11 9:40 ` Mark Rutland
@ 2013-11-11 13:26 ` Laurent Pinchart
2013-11-11 15:48 ` Mark Rutland
0 siblings, 1 reply; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-11 13:26 UTC (permalink / raw)
To: Mark Rutland
Cc: Laurent Pinchart, linux-sh@vger.kernel.org,
linux-serial@vger.kernel.org, Bastian Hecht, Paul Mundt,
devicetree@vger.kernel.org
Hi Mark,
Thank you for the quick and detailed review.
On Monday 11 November 2013 09:40:39 Mark Rutland wrote:
> Hi Laurent,
>
> I have a few comments.
>
> On Sun, Nov 10, 2013 at 03:33:40AM +0000, Laurent Pinchart wrote:
> > Document the device tree bindings for the sci serial port devices.
> >
> > Cc: devicetree@vger.kernel.org
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
> > Acked-by: Simon Horman <horms+renesas@verge.net.au>
> > ---
> >
> > .../bindings/serial/renesas,sci-serial.txt | 42 +++++++++++++++++
> > 1 file changed, 42 insertions(+)
> > create mode 100644
> > Documentation/devicetree/bindings/serial/renesas,sci-serial.txt>
> > diff --git
> > a/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> > b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt new
> > file mode 100644
> > index 0000000..66d3bca
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> > @@ -0,0 +1,42 @@
> > +* Renesas SH-Mobile Serial Communication Interface
> > +
> > +Required properties:
> > +
> > + - compatible: one of the following types (scif, scifa, scifb, hscif).
>
> Minor nit, but would be nice to have "Should contain one of the
> following:". We might have future variants whereby the compatible string
> will actually be a string list.
Sure, I can do that.
> > +
> > + - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.
> > + - "renesas,scifa-r8a7790" for R8A7790 (R-Car H2) SCIFA compatible
> > UART. + - "renesas,scifb-r8a7790" for R8A7790 (R-Car H2) SCIFB
> > compatible UART. + - "renesas,hscif-r8a7790" for R8A7790 (R-Car H2)
> > HSCIF compatible UART. + - "renesas,scif-generic" for generic SCIF
> > compatible UART.
> > + - "renesas,scifa-generic" for generic SCIFA compatible UART.
> > + - "renesas,scifb-generic" for generic SCIFB compatible UART.
> > + - "renesas,hscif-generic" for generic HSCIF compatible UART.
>
> Is the "-generic" suffix necessary? Why not just "renesas,scif" etc?
You're right, I'll remove the suffix.
> > +
> > + When compatible with the generic version, nodes must also list the
> > + SoC-specific version corresponding to the platform.
>
> Presumably the SoC-specific version should come first; it would be nice
> to note that.
Indeed, I'll do so.
> > +
> > + - reg: Base address and length of the memory resource used by the UART.
>
> I assume by memory resource you mean the memory-mapped registers?
> Resource sounds like Linux-internal nomenclature leaking.
I'll fix it as well, although we could decide on a definition of "resource"
that isn't Linux-specific :-)
> > +
> > + - interrupt-parent: Reference to the parent interrupt controller.
>
> I don't think this is strictly necessary. It's implicit by default and
> can be added optionally when a system is wired in a complex way. As it's
> a completely standard optional property I'm not even sure it needs to be
> documented.
>
> > + - interrupts: Interrupt number.
>
> Minor nit: "Should contain an interrupt-specifier for ..."
>
> I saw the cover mentioned multiple interrupts. Which logical interrupt
> output of the device are you expecting here?
SCI devices come in several flavours, with individual interrupt sources wired
up to different interrupt lines, or multiplexed all together. As the DT
bindings support the later only at the moment, there's only a single interrupt
to handle.
Should we come up with a standard way of saying in the bindings that a device
uses the interrupt bindings defined in interrupt-controller/interrupts.txt ?
This will become even more important with the interrupts-extended property, we
don't want every DT bindings document to detail all possible way to specify
interrupts.
> > +
> > + - clocks: Reference to the SCIx UART interface clock.
>
> Minor nit: s/Reference to/A phandle + clock-specifier pair for/
>
> > + - clock-names: Should be "sci_ick".
>
> As we're using clock-names, it would be nicer still to define clocks in
> terms of clock-names so as to make it easier to update the document in
> future and make the expected use of clock-names clearer:
>
> - clocks: Should
"Should", or "must" ?
> contain a phandle + clock-specifier pair for each entry
> in clock-names.
>
> - clock-names: Should contain "sci_ick".
Shouldn't that be
"Should contain "sci_ick" for the SCIx UART interface clock."
? Otherwise the bindings wouldn't tell which clock the clocks property should
reference.
> > +
> > +Note: Each enabled SCIx UART should have an alias correctly numbered in
> > the +"aliases" node.
> > +
> > +Example:
> > + aliases {
> > + serial0 = &scifa0;
> > + };
> > +
> > + scifa0: serial@e6c40000 {
> > + compatible = "renesas,scifa-r8a7790", "renesas,scifa-generic";
> > + reg = <0 0xe6c40000 0 64>;
> > + interrupt-parent = <&gic>;
> > + interrupts = <0 144 4>;
> > + clocks = <&mstp2_clks 4>;
> > + clock-names = "sci_ick";
> > + };
>
> Otherwise this looks good to me.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v2 28/29] serial: sh-sci: Add device tree bindings documentation
2013-11-11 13:26 ` Laurent Pinchart
@ 2013-11-11 15:48 ` Mark Rutland
2013-11-12 13:56 ` Laurent Pinchart
0 siblings, 1 reply; 41+ messages in thread
From: Mark Rutland @ 2013-11-11 15:48 UTC (permalink / raw)
To: Laurent Pinchart, grant.likely
Cc: Laurent Pinchart, linux-sh@vger.kernel.org,
linux-serial@vger.kernel.org, Bastian Hecht, Paul Mundt,
devicetree@vger.kernel.org
On Mon, Nov 11, 2013 at 01:26:11PM +0000, Laurent Pinchart wrote:
> Hi Mark,
>
> Thank you for the quick and detailed review.
>
> On Monday 11 November 2013 09:40:39 Mark Rutland wrote:
> > Hi Laurent,
> >
> > I have a few comments.
> >
> > On Sun, Nov 10, 2013 at 03:33:40AM +0000, Laurent Pinchart wrote:
> > > Document the device tree bindings for the sci serial port devices.
> > >
> > > Cc: devicetree@vger.kernel.org
> > > Signed-off-by: Laurent Pinchart
> > > <laurent.pinchart+renesas@ideasonboard.com>
> > > Acked-by: Simon Horman <horms+renesas@verge.net.au>
> > > ---
> > >
> > > .../bindings/serial/renesas,sci-serial.txt | 42 +++++++++++++++++
> > > 1 file changed, 42 insertions(+)
> > > create mode 100644
> > > Documentation/devicetree/bindings/serial/renesas,sci-serial.txt>
> > > diff --git
> > > a/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> > > b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt new
> > > file mode 100644
> > > index 0000000..66d3bca
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> > > @@ -0,0 +1,42 @@
> > > +* Renesas SH-Mobile Serial Communication Interface
> > > +
> > > +Required properties:
> > > +
> > > + - compatible: one of the following types (scif, scifa, scifb, hscif).
> >
> > Minor nit, but would be nice to have "Should contain one of the
> > following:". We might have future variants whereby the compatible string
> > will actually be a string list.
>
> Sure, I can do that.
>
> > > +
> > > + - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.
> > > + - "renesas,scifa-r8a7790" for R8A7790 (R-Car H2) SCIFA compatible
> > > UART. + - "renesas,scifb-r8a7790" for R8A7790 (R-Car H2) SCIFB
> > > compatible UART. + - "renesas,hscif-r8a7790" for R8A7790 (R-Car H2)
> > > HSCIF compatible UART. + - "renesas,scif-generic" for generic SCIF
> > > compatible UART.
> > > + - "renesas,scifa-generic" for generic SCIFA compatible UART.
> > > + - "renesas,scifb-generic" for generic SCIFB compatible UART.
> > > + - "renesas,hscif-generic" for generic HSCIF compatible UART.
> >
> > Is the "-generic" suffix necessary? Why not just "renesas,scif" etc?
>
> You're right, I'll remove the suffix.
>
> > > +
> > > + When compatible with the generic version, nodes must also list the
> > > + SoC-specific version corresponding to the platform.
> >
> > Presumably the SoC-specific version should come first; it would be nice
> > to note that.
>
> Indeed, I'll do so.
>
> > > +
> > > + - reg: Base address and length of the memory resource used by the UART.
> >
> > I assume by memory resource you mean the memory-mapped registers?
> > Resource sounds like Linux-internal nomenclature leaking.
>
> I'll fix it as well, although we could decide on a definition of "resource"
> that isn't Linux-specific :-)
We could, I guess. For the moment I'd prefer to point out that these are
MMIO registers :)
>
> > > +
> > > + - interrupt-parent: Reference to the parent interrupt controller.
> >
> > I don't think this is strictly necessary. It's implicit by default and
> > can be added optionally when a system is wired in a complex way. As it's
> > a completely standard optional property I'm not even sure it needs to be
> > documented.
> >
> > > + - interrupts: Interrupt number.
> >
> > Minor nit: "Should contain an interrupt-specifier for ..."
> >
> > I saw the cover mentioned multiple interrupts. Which logical interrupt
> > output of the device are you expecting here?
>
> SCI devices come in several flavours, with individual interrupt sources wired
> up to different interrupt lines, or multiplexed all together. As the DT
> bindings support the later only at the moment, there's only a single interrupt
> to handle.
Ok. If the binding just covers the muxed interrupt for now that's fine.
We can add interrupt-names later when we support multiple interrupts
(and fall back to assuming muxed when no interrupt-names property is
present).
>
> Should we come up with a standard way of saying in the bindings that a device
> uses the interrupt bindings defined in interrupt-controller/interrupts.txt ?
> This will become even more important with the interrupts-extended property, we
> don't want every DT bindings document to detail all possible way to specify
> interrupts.
It would certainly be nice to have a standard way of doing just that.
I'd hope that with the schema work going on that would fall into place
automatically, so perhaps it's not worth doing now.
>
> > > +
> > > + - clocks: Reference to the SCIx UART interface clock.
> >
> > Minor nit: s/Reference to/A phandle + clock-specifier pair for/
> >
> > > + - clock-names: Should be "sci_ick".
> >
> > As we're using clock-names, it would be nicer still to define clocks in
> > terms of clock-names so as to make it easier to update the document in
> > future and make the expected use of clock-names clearer:
> >
> > - clocks: Should
>
> "Should", or "must" ?
I don't expect the format of clocks and the relationship to clock-names
to change, so "must" is likely more appropriate. I'm just too used to
writing "should"...
>
> > contain a phandle + clock-specifier pair for each entry
> > in clock-names.
> >
> > - clock-names: Should contain "sci_ick".
>
> Shouldn't that be
>
> "Should contain "sci_ick" for the SCIx UART interface clock."
>
> ? Otherwise the bindings wouldn't tell which clock the clocks property should
> reference.
Yes, that sounds much better.
Cheers,
Mark.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v2 28/29] serial: sh-sci: Add device tree bindings documentation
2013-11-11 15:48 ` Mark Rutland
@ 2013-11-12 13:56 ` Laurent Pinchart
0 siblings, 0 replies; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-12 13:56 UTC (permalink / raw)
To: Mark Rutland
Cc: grant.likely, Laurent Pinchart, linux-sh@vger.kernel.org,
linux-serial@vger.kernel.org, Bastian Hecht, Paul Mundt,
devicetree@vger.kernel.org
Hi Mark,
On Monday 11 November 2013 15:48:49 Mark Rutland wrote:
> On Mon, Nov 11, 2013 at 01:26:11PM +0000, Laurent Pinchart wrote:
> > Hi Mark,
> >
> > Thank you for the quick and detailed review.
> >
> > On Monday 11 November 2013 09:40:39 Mark Rutland wrote:
> > > Hi Laurent,
> > >
> > > I have a few comments.
> > >
> > > On Sun, Nov 10, 2013 at 03:33:40AM +0000, Laurent Pinchart wrote:
> > > > Document the device tree bindings for the sci serial port devices.
> > > >
> > > > Cc: devicetree@vger.kernel.org
> > > > Signed-off-by: Laurent Pinchart
> > > > <laurent.pinchart+renesas@ideasonboard.com>
> > > > Acked-by: Simon Horman <horms+renesas@verge.net.au>
> > > > ---
> > > >
> > > > .../bindings/serial/renesas,sci-serial.txt | 42 +++++++++++++
> > > > 1 file changed, 42 insertions(+)
> > > > create mode 100644
> > > > Documentation/devicetree/bindings/serial/renesas,sci-serial.txt>
> > > >
> > > > diff --git
> > > > a/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> > > > b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt new
> > > > file mode 100644
> > > > index 0000000..66d3bca
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
> > > > @@ -0,0 +1,42 @@
> > > > +* Renesas SH-Mobile Serial Communication Interface
> > > > +
> > > > +Required properties:
> > > > +
> > > > + - compatible: one of the following types (scif, scifa, scifb,
> > > > hscif).
> > >
> > > Minor nit, but would be nice to have "Should contain one of the
> > > following:". We might have future variants whereby the compatible string
> > > will actually be a string list.
> >
> > Sure, I can do that.
> >
> > > > +
> > > > + - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible
> > > > UART.
> > > > + - "renesas,scifa-r8a7790" for R8A7790 (R-Car H2) SCIFA compatible
> > > > UART. + - "renesas,scifb-r8a7790" for R8A7790 (R-Car H2) SCIFB
> > > > compatible UART. + - "renesas,hscif-r8a7790" for R8A7790 (R-Car H2)
> > > > HSCIF compatible UART. + - "renesas,scif-generic" for generic SCIF
> > > > compatible UART.
> > > > + - "renesas,scifa-generic" for generic SCIFA compatible UART.
> > > > + - "renesas,scifb-generic" for generic SCIFB compatible UART.
> > > > + - "renesas,hscif-generic" for generic HSCIF compatible UART.
> > >
> > > Is the "-generic" suffix necessary? Why not just "renesas,scif" etc?
> >
> > You're right, I'll remove the suffix.
> >
> > > > +
> > > > + When compatible with the generic version, nodes must also list
> > > > the
> > > > + SoC-specific version corresponding to the platform.
> > >
> > > Presumably the SoC-specific version should come first; it would be nice
> > > to note that.
> >
> > Indeed, I'll do so.
> >
> > > > +
> > > > + - reg: Base address and length of the memory resource used by the
> > > > UART.
> > >
> > > I assume by memory resource you mean the memory-mapped registers?
> > > Resource sounds like Linux-internal nomenclature leaking.
> >
> > I'll fix it as well, although we could decide on a definition of
> > "resource" that isn't Linux-specific :-)
>
> We could, I guess. For the moment I'd prefer to point out that these are
> MMIO registers :)
>
> > > > +
> > > > + - interrupt-parent: Reference to the parent interrupt controller.
> > >
> > > I don't think this is strictly necessary. It's implicit by default and
> > > can be added optionally when a system is wired in a complex way. As it's
> > > a completely standard optional property I'm not even sure it needs to be
> > > documented.
> > >
> > > > + - interrupts: Interrupt number.
> > >
> > > Minor nit: "Should contain an interrupt-specifier for ..."
> > >
> > > I saw the cover mentioned multiple interrupts. Which logical interrupt
> > > output of the device are you expecting here?
> >
> > SCI devices come in several flavours, with individual interrupt sources
> > wired up to different interrupt lines, or multiplexed all together. As
> > the DT bindings support the later only at the moment, there's only a
> > single interrupt to handle.
>
> Ok. If the binding just covers the muxed interrupt for now that's fine.
> We can add interrupt-names later when we support multiple interrupts
> (and fall back to assuming muxed when no interrupt-names property is
> present).
That was my plan, good.
> > Should we come up with a standard way of saying in the bindings that a
> > device uses the interrupt bindings defined in
> > interrupt-controller/interrupts.txt ? This will become even more
> > important with the interrupts-extended property, we don't want every DT
> > bindings document to detail all possible way to specify interrupts.
>
> It would certainly be nice to have a standard way of doing just that.
> I'd hope that with the schema work going on that would fall into place
> automatically, so perhaps it's not worth doing now.
Fine with me.
> > > > +
> > > > + - clocks: Reference to the SCIx UART interface clock.
> > >
> > > Minor nit: s/Reference to/A phandle + clock-specifier pair for/
> > >
> > > > + - clock-names: Should be "sci_ick".
> > >
> > > As we're using clock-names, it would be nicer still to define clocks in
> > > terms of clock-names so as to make it easier to update the document in
> > > future and make the expected use of clock-names clearer:
> > >
> > > - clocks: Should
> >
> > "Should", or "must" ?
>
> I don't expect the format of clocks and the relationship to clock-names
> to change, so "must" is likely more appropriate. I'm just too used to
> writing "should"...
Are "Should" and "Must" to be interpreted as described in
http://tools.ietf.org/html/rfc2119 ?
1. MUST This word, or the terms "REQUIRED" or "SHALL", mean that the
definition is an absolute requirement of the specification.
3. SHOULD This word, or the adjective "RECOMMENDED", mean that there
may exist valid reasons in particular circumstances to ignore a
particular item, but the full implications must be understood and
carefully weighed before choosing a different course.
If so, shouldn't we use "Must" in most places ?
> > > contain a phandle + clock-specifier pair for each entry
> > >
> > > in clock-names.
> > >
> > > - clock-names: Should contain "sci_ick".
> >
> > Shouldn't that be
> >
> > "Should contain "sci_ick" for the SCIx UART interface clock."
> >
> > ? Otherwise the bindings wouldn't tell which clock the clocks property
> > should reference.
>
> Yes, that sounds much better.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v2 00/29] Add OF support to the sh-sci serial port driver
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
` (28 preceding siblings ...)
2013-11-10 3:33 ` [PATCH v2 29/29] serial: sh-sci: Add OF support Laurent Pinchart
@ 2013-11-19 1:55 ` Simon Horman
2013-11-19 13:12 ` Laurent Pinchart
29 siblings, 1 reply; 41+ messages in thread
From: Simon Horman @ 2013-11-19 1:55 UTC (permalink / raw)
To: Laurent Pinchart
Cc: linux-sh, linux-serial, Bastian Hecht, Paul Mundt, devicetree
On Sun, Nov 10, 2013 at 04:33:12AM +0100, Laurent Pinchart wrote:
> Hello,
>
> This is the second version of the patch set adds device tree bindings for the
> sh sci serial port devices and adds OF parsing to the sh-sci driver.
>
> The bindings are based on Bastian Hecht's proposal (see
> http://www.spinics.net/lists/arm-kernel/msg228129.html). The approach taken
> here is more minimalistic: instead of describing all hardware characteristics
> that vary between the SCI device revisions in DT (such as registers layout),
> that information is stored in the driver and selected based on the compatible
> property value. Only SCI revisions used on ARM devices are supported through
> DT, as DT support for SuperH is nowhere down the line.
>
> Patches 01/29 to 06/29 clean up the sh-sci driver.
It seems to me that these could be queued up by Greg.
Let me know if you would like me to pass them on to him.
I'm quite happy for you to do that yourself. Or to wait.
Its entirely up to you.
In any case for those patches:
Acked-by: Simon Horman <horms+renesas@verge.net.au>
> Patches 07/29 to 27/29
> replace memory and interrupt resources passed through platform data with
> platform resources. Beside replacing a custom mechanism with a standard one,
> it will also make the DT parsing code simpler as resource allocation will be
> shared between DT and non-DT code paths.
> Finally, patches 28/29 to 29/29 add
> OF parsing to the sh-sci driver and create DT bindings documentation.
29 is awaiting devicetree review and 28 makes little sense
before that happens. Right?
> The patches have been test on a Lager board (r8a7790-based). Support for other
> SoCs will be added as needed. Note that all current Renesas ARM SoCs seem to
> be compatible with the generic (H)SCI(F)(AB) devices, but the plan is for
> their DT bindings to list the SoC-specific version in case incompatibilities
> are found later.
>
> Patch 08/29 ("serial: sh-sci: Support resources passed through platform
> resources") is the only dependency of the arch/arm and arch/sh patches present
> in this series. As it's too late to get it in v3.13, Simon will need a stable
> branch of the linux serial tree with that patch included.
That is patch 7 not 8, right?
Do all of the shmobile patches depends on that patch?
I would be happy to take some earlier if practical.
>
> Changes compared to v1:
>
> - Patches 04/29 to 27/29 have been added
> - Multi-interrupt support has been removed from the DT bindings as they don't
> support any SoC requiring multi-interrupt yet
>
> Cc: devicetree@vger.kernel.org
>
> Bastian Hecht (1):
> serial: sh-sci: Add OF support
>
> Laurent Pinchart (28):
> serial: sh-sci: Sort headers alphabetically
> serial: sh-sci: Remove baud rate calculation algorithm 5
> serial: sh-sci: Simplify baud rate calculation algorithms
> serial: sh-sci: Remove duplicate interrupt check in verify port op
> serial: sh-sci: Set the UPF_FIXED_PORT flag
> serial: sh-sci: Don't check IRQ in verify port operation
> serial: sh-sci: Support resources passed through platform resources
> ARM: shmobile: sh7372: Use macros to declare SCIF devices
> ARM: shmobile: sh73a0: Use macros to declare SCIF devices
> ARM: shmobile: r8a7740: Use macros to declare SCIF devices
> ARM: shmobile: r8a7779: Use macros to declare SCIF devices
> ARM: shmobile: r7s72100: Don't define SCIF platform data in an array
> ARM: shmobile: r8a73a4: Don't define SCIF platform data in an array
> ARM: shmobile: r8a7778: Don't define SCIF platform data in an array
> ARM: shmobile: r8a7790: Don't define SCIF platform data in an array
> ARM: shmobile: r8a7791: Don't define SCIF platform data in an array
> ARM: shmobile: sh7372: Declare SCIF register base and IRQ as resources
> ARM: shmobile: sh73a0: Declare SCIF register base and IRQ as resources
> ARM: shmobile: r7s72100: Declare SCIF register base and IRQ as
> resources
> ARM: shmobile: r8a73a4: Declare SCIF register base and IRQ as
> resources
> ARM: shmobile: r8a7740: Declare SCIF register base and IRQ as
> resources
> ARM: shmobile: r8a7778: Declare SCIF register base and IRQ as
> resources
> ARM: shmobile: r8a7779: Declare SCIF register base and IRQ as
> resources
> ARM: shmobile: r8a7790: Declare SCIF register base and IRQ as
> resources
> ARM: shmobile: r8a7791: Declare SCIF register base and IRQ as
> resources
> sh: Declare SCIF register base and IRQ as resources
> serial: sh-sci: Remove platform data mapbase and irqs fields
> serial: sh-sci: Add device tree bindings documentation
>
> .../bindings/serial/renesas,sci-serial.txt | 42 ++++
> arch/arm/mach-shmobile/setup-r7s72100.c | 63 +++---
> arch/arm/mach-shmobile/setup-r8a73a4.c | 65 +++---
> arch/arm/mach-shmobile/setup-r8a7740.c | 196 +++--------------
> arch/arm/mach-shmobile/setup-r8a7778.c | 45 ++--
> arch/arm/mach-shmobile/setup-r8a7779.c | 129 +++--------
> arch/arm/mach-shmobile/setup-r8a7790.c | 117 +++++-----
> arch/arm/mach-shmobile/setup-r8a7791.c | 130 +++++------
> arch/arm/mach-shmobile/setup-sh7372.c | 161 +++-----------
> arch/arm/mach-shmobile/setup-sh73a0.c | 192 +++--------------
> arch/sh/kernel/cpu/sh2/setup-sh7619.c | 27 ++-
> arch/sh/kernel/cpu/sh2a/setup-mxg.c | 9 +-
> arch/sh/kernel/cpu/sh2a/setup-sh7201.c | 72 +++++--
> arch/sh/kernel/cpu/sh2a/setup-sh7203.c | 36 +++-
> arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 36 +++-
> arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 96 +++++++--
> arch/sh/kernel/cpu/sh2a/setup-sh7269.c | 96 +++++++--
> arch/sh/kernel/cpu/sh3/setup-sh7705.c | 18 +-
> arch/sh/kernel/cpu/sh3/setup-sh770x.c | 27 ++-
> arch/sh/kernel/cpu/sh3/setup-sh7710.c | 18 +-
> arch/sh/kernel/cpu/sh3/setup-sh7720.c | 18 +-
> arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 15 +-
> arch/sh/kernel/cpu/sh4/setup-sh7750.c | 18 +-
> arch/sh/kernel/cpu/sh4/setup-sh7760.c | 58 +++--
> arch/sh/kernel/cpu/sh4a/setup-sh7343.c | 36 +++-
> arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 9 +-
> arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 27 ++-
> arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 54 +++--
> arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 54 +++--
> arch/sh/kernel/cpu/sh4a/setup-sh7734.c | 66 ++++--
> arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 27 ++-
> arch/sh/kernel/cpu/sh4a/setup-sh7763.c | 27 ++-
> arch/sh/kernel/cpu/sh4a/setup-sh7770.c | 90 ++++++--
> arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 18 +-
> arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 54 +++--
> arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 82 +++++--
> arch/sh/kernel/cpu/sh4a/setup-shx3.c | 45 ++--
> arch/sh/kernel/cpu/sh5/setup-sh5.c | 11 +-
> drivers/tty/serial/sh-sci.c | 238 ++++++++++++++++-----
> include/linux/serial_sci.h | 35 +--
> 40 files changed, 1443 insertions(+), 1114 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
>
> --
> Regards,
>
> Laurent Pinchart
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v2 00/29] Add OF support to the sh-sci serial port driver
2013-11-19 1:55 ` [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Simon Horman
@ 2013-11-19 13:12 ` Laurent Pinchart
2013-11-20 0:18 ` Simon Horman
0 siblings, 1 reply; 41+ messages in thread
From: Laurent Pinchart @ 2013-11-19 13:12 UTC (permalink / raw)
To: Simon Horman
Cc: Laurent Pinchart, linux-sh, linux-serial, Bastian Hecht,
Paul Mundt, devicetree
Hi Simon,
On Tuesday 19 November 2013 10:55:39 Simon Horman wrote:
> On Sun, Nov 10, 2013 at 04:33:12AM +0100, Laurent Pinchart wrote:
> > Hello,
> >
> > This is the second version of the patch set adds device tree bindings for
> > the sh sci serial port devices and adds OF parsing to the sh-sci driver.
> >
> > The bindings are based on Bastian Hecht's proposal (see
> > http://www.spinics.net/lists/arm-kernel/msg228129.html). The approach
> > taken here is more minimalistic: instead of describing all hardware
> > characteristics that vary between the SCI device revisions in DT (such as
> > registers layout), that information is stored in the driver and selected
> > based on the compatible property value. Only SCI revisions used on ARM
> > devices are supported through DT, as DT support for SuperH is nowhere
> > down the line.
> >
> > Patches 01/29 to 06/29 clean up the sh-sci driver.
>
> It seems to me that these could be queued up by Greg.
> Let me know if you would like me to pass them on to him.
> I'm quite happy for you to do that yourself. Or to wait.
> Its entirely up to you.
>
> In any case for those patches:
>
> Acked-by: Simon Horman <horms+renesas@verge.net.au>
Thank you. I'll resend the series with the DT bindings updated for r8a7791 and
will ask Greg to pick the patches up and provide a stable branch with patches
01/29 to 07/29.
> > Patches 07/29 to 27/29 replace memory and interrupt resources passed
> > through platform data with platform resources. Beside replacing a custom
> > mechanism with a standard one, it will also make the DT parsing code
> > simpler as resource allocation will be shared between DT and non-DT code
> > paths. Finally, patches 28/29 to 29/29 add OF parsing to the sh-sci driver
> > and create DT bindings documentation.
>
> 29 is awaiting devicetree review and 28 makes little sense before that
> happens. Right?
Correct.
> > The patches have been test on a Lager board (r8a7790-based). Support for
> > other SoCs will be added as needed. Note that all current Renesas ARM
> > SoCs seem to be compatible with the generic (H)SCI(F)(AB) devices, but
> > the plan is for their DT bindings to list the SoC-specific version in
> > case incompatibilities are found later.
> >
> > Patch 08/29 ("serial: sh-sci: Support resources passed through platform
> > resources") is the only dependency of the arch/arm and arch/sh patches
> > present in this series. As it's too late to get it in v3.13, Simon will
> > need a stable branch of the linux serial tree with that patch included.
>
> That is patch 7 not 8, right?
Yes, sorry.
> Do all of the shmobile patches depends on that patch?
Yes they do.
> I would be happy to take some earlier if practical.
>
> > Changes compared to v1:
> >
> > - Patches 04/29 to 27/29 have been added
> > - Multi-interrupt support has been removed from the DT bindings as they
> > don't support any SoC requiring multi-interrupt yet
> >
> > Cc: devicetree@vger.kernel.org
> >
> > Bastian Hecht (1):
> > serial: sh-sci: Add OF support
> >
> > Laurent Pinchart (28):
> > serial: sh-sci: Sort headers alphabetically
> > serial: sh-sci: Remove baud rate calculation algorithm 5
> > serial: sh-sci: Simplify baud rate calculation algorithms
> > serial: sh-sci: Remove duplicate interrupt check in verify port op
> > serial: sh-sci: Set the UPF_FIXED_PORT flag
> > serial: sh-sci: Don't check IRQ in verify port operation
> > serial: sh-sci: Support resources passed through platform resources
> > ARM: shmobile: sh7372: Use macros to declare SCIF devices
> > ARM: shmobile: sh73a0: Use macros to declare SCIF devices
> > ARM: shmobile: r8a7740: Use macros to declare SCIF devices
> > ARM: shmobile: r8a7779: Use macros to declare SCIF devices
> > ARM: shmobile: r7s72100: Don't define SCIF platform data in an array
> > ARM: shmobile: r8a73a4: Don't define SCIF platform data in an array
> > ARM: shmobile: r8a7778: Don't define SCIF platform data in an array
> > ARM: shmobile: r8a7790: Don't define SCIF platform data in an array
> > ARM: shmobile: r8a7791: Don't define SCIF platform data in an array
> > ARM: shmobile: sh7372: Declare SCIF register base and IRQ as resources
> > ARM: shmobile: sh73a0: Declare SCIF register base and IRQ as resources
> > ARM: shmobile: r7s72100: Declare SCIF register base and IRQ as
> > resources
> > ARM: shmobile: r8a73a4: Declare SCIF register base and IRQ as
> > resources
> > ARM: shmobile: r8a7740: Declare SCIF register base and IRQ as
> > resources
> > ARM: shmobile: r8a7778: Declare SCIF register base and IRQ as
> > resources
> > ARM: shmobile: r8a7779: Declare SCIF register base and IRQ as
> > resources
> > ARM: shmobile: r8a7790: Declare SCIF register base and IRQ as
> > resources
> > ARM: shmobile: r8a7791: Declare SCIF register base and IRQ as
> > resources
> >
> > sh: Declare SCIF register base and IRQ as resources
> > serial: sh-sci: Remove platform data mapbase and irqs fields
> > serial: sh-sci: Add device tree bindings documentation
> >
> > .../bindings/serial/renesas,sci-serial.txt | 42 ++++
> > arch/arm/mach-shmobile/setup-r7s72100.c | 63 +++---
> > arch/arm/mach-shmobile/setup-r8a73a4.c | 65 +++---
> > arch/arm/mach-shmobile/setup-r8a7740.c | 196 +++-------------
> > arch/arm/mach-shmobile/setup-r8a7778.c | 45 ++--
> > arch/arm/mach-shmobile/setup-r8a7779.c | 129 +++--------
> > arch/arm/mach-shmobile/setup-r8a7790.c | 117 +++++-----
> > arch/arm/mach-shmobile/setup-r8a7791.c | 130 +++++------
> > arch/arm/mach-shmobile/setup-sh7372.c | 161 +++-----------
> > arch/arm/mach-shmobile/setup-sh73a0.c | 192 +++-------------
> > arch/sh/kernel/cpu/sh2/setup-sh7619.c | 27 ++-
> > arch/sh/kernel/cpu/sh2a/setup-mxg.c | 9 +-
> > arch/sh/kernel/cpu/sh2a/setup-sh7201.c | 72 +++++--
> > arch/sh/kernel/cpu/sh2a/setup-sh7203.c | 36 +++-
> > arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 36 +++-
> > arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 96 +++++++--
> > arch/sh/kernel/cpu/sh2a/setup-sh7269.c | 96 +++++++--
> > arch/sh/kernel/cpu/sh3/setup-sh7705.c | 18 +-
> > arch/sh/kernel/cpu/sh3/setup-sh770x.c | 27 ++-
> > arch/sh/kernel/cpu/sh3/setup-sh7710.c | 18 +-
> > arch/sh/kernel/cpu/sh3/setup-sh7720.c | 18 +-
> > arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 15 +-
> > arch/sh/kernel/cpu/sh4/setup-sh7750.c | 18 +-
> > arch/sh/kernel/cpu/sh4/setup-sh7760.c | 58 +++--
> > arch/sh/kernel/cpu/sh4a/setup-sh7343.c | 36 +++-
> > arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 9 +-
> > arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 27 ++-
> > arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 54 +++--
> > arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 54 +++--
> > arch/sh/kernel/cpu/sh4a/setup-sh7734.c | 66 ++++--
> > arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 27 ++-
> > arch/sh/kernel/cpu/sh4a/setup-sh7763.c | 27 ++-
> > arch/sh/kernel/cpu/sh4a/setup-sh7770.c | 90 ++++++--
> > arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 18 +-
> > arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 54 +++--
> > arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 82 +++++--
> > arch/sh/kernel/cpu/sh4a/setup-shx3.c | 45 ++--
> > arch/sh/kernel/cpu/sh5/setup-sh5.c | 11 +-
> > drivers/tty/serial/sh-sci.c | 238 +++++++++++++---
> > include/linux/serial_sci.h | 35 +--
> > 40 files changed, 1443 insertions(+), 1114 deletions(-)
> > create mode 100644
> > Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v2 00/29] Add OF support to the sh-sci serial port driver
2013-11-19 13:12 ` Laurent Pinchart
@ 2013-11-20 0:18 ` Simon Horman
0 siblings, 0 replies; 41+ messages in thread
From: Simon Horman @ 2013-11-20 0:18 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Laurent Pinchart, linux-sh, linux-serial, Bastian Hecht,
Paul Mundt, devicetree
On Tue, Nov 19, 2013 at 02:12:43PM +0100, Laurent Pinchart wrote:
> Hi Simon,
>
> On Tuesday 19 November 2013 10:55:39 Simon Horman wrote:
> > On Sun, Nov 10, 2013 at 04:33:12AM +0100, Laurent Pinchart wrote:
> > > Hello,
> > >
> > > This is the second version of the patch set adds device tree bindings for
> > > the sh sci serial port devices and adds OF parsing to the sh-sci driver.
> > >
> > > The bindings are based on Bastian Hecht's proposal (see
> > > http://www.spinics.net/lists/arm-kernel/msg228129.html). The approach
> > > taken here is more minimalistic: instead of describing all hardware
> > > characteristics that vary between the SCI device revisions in DT (such as
> > > registers layout), that information is stored in the driver and selected
> > > based on the compatible property value. Only SCI revisions used on ARM
> > > devices are supported through DT, as DT support for SuperH is nowhere
> > > down the line.
> > >
> > > Patches 01/29 to 06/29 clean up the sh-sci driver.
> >
> > It seems to me that these could be queued up by Greg.
> > Let me know if you would like me to pass them on to him.
> > I'm quite happy for you to do that yourself. Or to wait.
> > Its entirely up to you.
> >
> > In any case for those patches:
> >
> > Acked-by: Simon Horman <horms+renesas@verge.net.au>
>
> Thank you. I'll resend the series with the DT bindings updated for r8a7791 and
> will ask Greg to pick the patches up and provide a stable branch with patches
> 01/29 to 07/29.
Thanks, that sounds great.
^ permalink raw reply [flat|nested] 41+ messages in thread
end of thread, other threads:[~2013-11-20 0:18 UTC | newest]
Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-10 3:33 [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 01/29] serial: sh-sci: Sort headers alphabetically Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 02/29] serial: sh-sci: Remove baud rate calculation algorithm 5 Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 03/29] serial: sh-sci: Simplify baud rate calculation algorithms Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 04/29] serial: sh-sci: Remove duplicate interrupt check in verify port op Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 05/29] serial: sh-sci: Set the UPF_FIXED_PORT flag Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 06/29] serial: sh-sci: Don't check IRQ in verify port operation Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 07/29] serial: sh-sci: Support resources passed through platform resources Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 08/29] ARM: shmobile: sh7372: Use macros to declare SCIF devices Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 09/29] ARM: shmobile: sh73a0: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 10/29] ARM: shmobile: r8a7740: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 11/29] ARM: shmobile: r8a7779: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 12/29] ARM: shmobile: r7s72100: Don't define SCIF platform data in an array Laurent Pinchart
2013-11-10 18:35 ` Sergei Shtylyov
2013-11-11 2:41 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 13/29] ARM: shmobile: r8a73a4: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 14/29] ARM: shmobile: r8a7778: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 15/29] ARM: shmobile: r8a7790: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 16/29] ARM: shmobile: r8a7791: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 17/29] ARM: shmobile: sh7372: Declare SCIF register base and IRQ as resources Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 18/29] ARM: shmobile: sh73a0: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 19/29] ARM: shmobile: r7s72100: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 20/29] ARM: shmobile: r8a73a4: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 21/29] ARM: shmobile: r8a7740: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 22/29] ARM: shmobile: r8a7778: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 23/29] ARM: shmobile: r8a7779: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 24/29] ARM: shmobile: r8a7790: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 25/29] ARM: shmobile: r8a7791: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 26/29] sh: " Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 27/29] serial: sh-sci: Remove platform data mapbase and irqs fields Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 28/29] serial: sh-sci: Add device tree bindings documentation Laurent Pinchart
2013-11-10 18:07 ` Sergei Shtylyov
2013-11-11 2:39 ` Laurent Pinchart
2013-11-11 9:40 ` Mark Rutland
2013-11-11 13:26 ` Laurent Pinchart
2013-11-11 15:48 ` Mark Rutland
2013-11-12 13:56 ` Laurent Pinchart
2013-11-10 3:33 ` [PATCH v2 29/29] serial: sh-sci: Add OF support Laurent Pinchart
2013-11-19 1:55 ` [PATCH v2 00/29] Add OF support to the sh-sci serial port driver Simon Horman
2013-11-19 13:12 ` Laurent Pinchart
2013-11-20 0:18 ` Simon Horman
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).