From patchwork Tue Feb 11 20:34:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3631941 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 67E98BF418 for ; Tue, 11 Feb 2014 20:40:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C6832015D for ; Tue, 11 Feb 2014 20:40:35 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3235420142 for ; Tue, 11 Feb 2014 20:40:34 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDK7C-0005Ci-45; Tue, 11 Feb 2014 20:39:34 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDK2J-00039D-60; Tue, 11 Feb 2014 20:34:31 +0000 Received: from perceval.ideasonboard.com ([95.142.166.194]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDK2D-00033h-2l for linux-arm-kernel@lists.infradead.org; Tue, 11 Feb 2014 20:34:29 +0000 Received: from avalon.ideasonboard.com (unknown [91.178.227.55]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 123E6363CD; Tue, 11 Feb 2014 21:32:39 +0100 (CET) From: Laurent Pinchart To: linux-sh@vger.kernel.org Subject: [PATCH v4 2/2] ARM: shmobile: koelsch: Enable SCIF0 and SCIF1 serial ports in DT Date: Tue, 11 Feb 2014 21:34:38 +0100 Message-Id: <1392150878-10436-3-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392150878-10436-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> References: <1392150878-10436-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140211_153425_440021_AC39A7A0 X-CRM114-Status: GOOD ( 14.18 ) X-Spam-Score: -2.5 (--) Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP SCIF0 and SCIF1 are used as debug serial ports. Enable them and configure pinmuxing appropriately. We can now remove the clkdev registration hack for SCIF devices from the Koelsch reference board file. As a side effect of switching to DT-based serial port instantiation, ttySC6 and ttySC7 get renamed to ttySC0 and ttySC1. As the device tree source if now shared between koelsch and koelsch-reference, we need to update the serial ports in C code as well. Signed-off-by: Laurent Pinchart --- arch/arm/boot/dts/r8a7791-koelsch.dts | 24 ++++++++++++++--- arch/arm/mach-shmobile/board-koelsch-reference.c | 18 ++----------- arch/arm/mach-shmobile/clock-r8a7791.c | 24 ++++++++--------- arch/arm/mach-shmobile/setup-r8a7791.c | 34 ++++++++++++------------ 4 files changed, 51 insertions(+), 49 deletions(-) diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts index d4b9bba..42fd5eb 100644 --- a/arch/arm/boot/dts/r8a7791-koelsch.dts +++ b/arch/arm/boot/dts/r8a7791-koelsch.dts @@ -17,8 +17,13 @@ model = "Koelsch"; compatible = "renesas,koelsch", "renesas,r8a7791"; + aliases { + serial0 = &scif0; + serial1 = &scif1; + }; + chosen { - bootargs = "console=ttySC6,115200 ignore_loglevel rw root=/dev/nfs ip=dhcp"; + bootargs = "console=ttySC0,115200 ignore_loglevel rw root=/dev/nfs ip=dhcp"; }; memory@40000000 { @@ -109,9 +114,6 @@ }; &pfc { - pinctrl-0 = <&scif0_pins &scif1_pins>; - pinctrl-names = "default"; - scif0_pins: serial0 { renesas,groups = "scif0_data_d"; renesas,function = "scif0"; @@ -132,6 +134,20 @@ status = "okay"; }; +&scif0 { + pinctrl-0 = <&scif0_pins>; + pinctrl-names = "default"; + + status = "okay"; +}; + +&scif1 { + pinctrl-0 = <&scif1_pins>; + pinctrl-names = "default"; + + status = "okay"; +}; + &spi { pinctrl-0 = <&qspi_pins>; pinctrl-names = "default"; diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c index feb8d97..46879d6 100644 --- a/arch/arm/mach-shmobile/board-koelsch-reference.c +++ b/arch/arm/mach-shmobile/board-koelsch-reference.c @@ -32,24 +32,10 @@ static void __init koelsch_add_standard_devices(void) { #ifdef CONFIG_COMMON_CLK /* - * This is a really crude hack to provide clkdev support to the SCIF - * and CMT devices until they get moved to DT. + * This is a really crude hack to provide clkdev support to the CMT + * device until they get moved to DT. */ - static const char * const scif_names[] = { - "scifa0", "scifa1", "scifb0", "scifb1", "scifb2", "scifa2", - "scif0", "scif1", "scif2", "scif3", "scif4", "scif5", "scifa3", - "scifa4", "scifa5", - }; struct clk *clk; - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(scif_names); ++i) { - clk = clk_get(NULL, scif_names[i]); - if (!IS_ERR(clk)) { - clk_register_clkdev(clk, NULL, "sh-sci.%u", i); - clk_put(clk); - } - } clk = clk_get(NULL, "cmt0"); if (!IS_ERR(clk)) { diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c index c8227b3..fc9248d 100644 --- a/arch/arm/mach-shmobile/clock-r8a7791.c +++ b/arch/arm/mach-shmobile/clock-r8a7791.c @@ -209,18 +209,18 @@ static struct clk_lookup lookups[] = { CLKDEV_ICK_ID("lvds.0", "rcar-du-r8a7791", &mstp_clks[MSTP726]), CLKDEV_ICK_ID("du.0", "rcar-du-r8a7791", &mstp_clks[MSTP724]), CLKDEV_ICK_ID("du.1", "rcar-du-r8a7791", &mstp_clks[MSTP723]), - CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ - CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */ - CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP206]), /* SCIFB0 */ - CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP207]), /* SCIFB1 */ - CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP216]), /* SCIFB2 */ - CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP202]), /* SCIFA2 */ - CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP721]), /* SCIF0 */ - CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]), /* SCIF1 */ - CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP719]), /* SCIF2 */ - CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP718]), /* SCIF3 */ - CLKDEV_DEV_ID("sh-sci.10", &mstp_clks[MSTP715]), /* SCIF4 */ - CLKDEV_DEV_ID("sh-sci.11", &mstp_clks[MSTP714]), /* SCIF5 */ + CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP721]), /* SCIF0 */ + CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP720]), /* SCIF1 */ + CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP719]), /* SCIF2 */ + CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP718]), /* SCIF3 */ + CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP715]), /* SCIF4 */ + CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP714]), /* SCIF5 */ + CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP204]), /* SCIFA0 */ + CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP203]), /* SCIFA1 */ + CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB0 */ + CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP207]), /* SCIFB1 */ + CLKDEV_DEV_ID("sh-sci.10", &mstp_clks[MSTP216]), /* SCIFB2 */ + CLKDEV_DEV_ID("sh-sci.11", &mstp_clks[MSTP202]), /* SCIFA2 */ CLKDEV_DEV_ID("sh-sci.12", &mstp_clks[MSTP1105]), /* SCIFA3 */ CLKDEV_DEV_ID("sh-sci.13", &mstp_clks[MSTP1106]), /* SCIFA4 */ CLKDEV_DEV_ID("sh-sci.14", &mstp_clks[MSTP1107]), /* SCIFA5 */ diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c index e28404e..605f4cf 100644 --- a/arch/arm/mach-shmobile/setup-r8a7791.c +++ b/arch/arm/mach-shmobile/setup-r8a7791.c @@ -105,18 +105,18 @@ static struct resource scif##index##_resources[] = { \ #define R8A7791_SCIFB(index, baseaddr, irq) \ __R8A7791_SCIF(PORT_SCIFB, 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_SCIF(0, 0xe6e60000, gic_spi(152)); /* SCIF0 */ +R8A7791_SCIF(1, 0xe6e68000, gic_spi(153)); /* SCIF1 */ +R8A7791_SCIF(2, 0xe6e58000, gic_spi(22)); /* SCIF2 */ +R8A7791_SCIF(3, 0xe6ea8000, gic_spi(23)); /* SCIF3 */ +R8A7791_SCIF(4, 0xe6ee0000, gic_spi(24)); /* SCIF4 */ +R8A7791_SCIF(5, 0xe6ee8000, gic_spi(25)); /* SCIF5 */ +R8A7791_SCIFA(6, 0xe6c40000, gic_spi(144)); /* SCIFA0 */ +R8A7791_SCIFA(7, 0xe6c50000, gic_spi(145)); /* SCIFA1 */ +R8A7791_SCIFB(8, 0xe6c20000, gic_spi(148)); /* SCIFB0 */ +R8A7791_SCIFB(9, 0xe6c30000, gic_spi(149)); /* SCIFB1 */ +R8A7791_SCIFB(10, 0xe6ce0000, gic_spi(150)); /* SCIFB2 */ +R8A7791_SCIFA(11, 0xe6c60000, gic_spi(151)); /* SCIFA2 */ R8A7791_SCIFA(12, 0xe6c70000, gic_spi(29)); /* SCIFA3 */ R8A7791_SCIFA(13, 0xe6c78000, gic_spi(30)); /* SCIFA4 */ R8A7791_SCIFA(14, 0xe6c80000, gic_spi(31)); /* SCIFA5 */ @@ -185,6 +185,11 @@ static const struct resource thermal_resources[] __initconst = { void __init r8a7791_add_dt_devices(void) { + r8a7791_register_cmt(00); +} + +void __init r8a7791_add_standard_devices(void) +{ r8a7791_register_scif(0); r8a7791_register_scif(1); r8a7791_register_scif(2); @@ -200,11 +205,6 @@ void __init r8a7791_add_dt_devices(void) r8a7791_register_scif(12); r8a7791_register_scif(13); r8a7791_register_scif(14); - r8a7791_register_cmt(00); -} - -void __init r8a7791_add_standard_devices(void) -{ r8a7791_add_dt_devices(); r8a7791_register_irqc(0); r8a7791_register_thermal();