From patchwork Fri Aug 7 03:18:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6964821 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 29441C05AC for ; Fri, 7 Aug 2015 03:18:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0991A206D5 for ; Fri, 7 Aug 2015 03:18:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1AD67206B2 for ; Fri, 7 Aug 2015 03:18:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752825AbbHGDS2 (ORCPT ); Thu, 6 Aug 2015 23:18:28 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:65392 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752657AbbHGDS1 (ORCPT ); Thu, 6 Aug 2015 23:18:27 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 07 Aug 2015 12:18:26 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id CEC8A49008; Fri, 7 Aug 2015 12:18:26 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id C7B39480A3; Fri, 7 Aug 2015 12:18:26 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id AF28D48014; Fri, 7 Aug 2015 12:18:26 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id NAJ15805; Fri, 7 Aug 2015 12:18:26 +0900 X-IronPort-AV: E=Sophos;i="5.15,626,1432566000"; d="scan'";a="191978566" Received: from mail-hk1lp0125.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.125]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 07 Aug 2015 12:18:25 +0900 Received: from SIXPR06MB0605.apcprd06.prod.outlook.com (10.160.237.147) by SIXPR06MB142.apcprd06.prod.outlook.com (10.242.148.16) with Microsoft SMTP Server (TLS) id 15.1.225.19; Fri, 7 Aug 2015 03:18:24 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by SIXPR06MB0605.apcprd06.prod.outlook.com (10.160.237.147) with Microsoft SMTP Server (TLS) id 15.1.225.19; Fri, 7 Aug 2015 03:18:23 +0000 Message-ID: <87si7vdc21.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 11/16 v5][RFC] Local: Hack: enable SCIF2 without using PFC User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") To: Simon , Geert Uytterhoeven CC: YOSHIYUKI ITO , Magnus , Linux-SH , Gaku Inami , shimoda , munakata , komatsu , goda Date: Fri, 7 Aug 2015 03:18:23 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR06CA0021.apcprd06.prod.outlook.com (25.164.91.31) To SIXPR06MB0605.apcprd06.prod.outlook.com (25.160.237.147) X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB0605; 2:cDcC6PzDffD+KU/qKZ6ihUYlx7NZ9rgn9PlDFi/yvtgyhfu4hx1skLkxB9lRcp88wWagnDPMIPPCtgFiiEPIxA9M5pm39EtB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xDJi9rxMbc9idWKmMPqO4K+keNNbIIkM0/lJqRjy7lIhlK3GnWox58ICAnPC2pCM1+2WtBYa8iBgR+rgOHK5hLbh7pI2b4BN9; 4:bbagEmz2MoHRshyzO/oMnx/hP87ccuPv6VkiNmBHbffkGyoKMkznnKsSoT3s61K1mzIl8T3avvFFrg/0A5z5jeZbcT+W9qqsTi4I2/9ZsLVO3bJxcJm0eCC+7X7e8RC3PY5PDBn/vQk0JibWuFA96AZ5RrJeEvY4zyByvfLvo2VIlgtcKy+jt7xBUonUUZirkMMlVF9b5WKBU7I2Tas4rSekhiH3iJg3wtibAq96fL+7dxCQrN8eookL8yG9EAhLPSJlKXlLAfILRoIKiL0AjszovAm3mIcOTas/L3xD4Xc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:SIXPR06MB0605; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB0605; X-Forefront-PRVS: 066153096A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(19580395003)(92566002)(107886002)(53416004)(81156007)(5001960100002)(77156002)(64706001)(5001770100001)(97736004)(50466002)(106356001)(5001830100001)(47776003)(86362001)(19580405001)(66066001)(62966003)(42186005)(23726002)(33646002)(5001860100001)(46102003)(4001540100001)(229853001)(122386002)(40100003)(87976001)(105586002)(83506001)(36756003)(69596002)(54356999)(4001350100001)(50986999)(46406003)(68736005)(77096005)(101416001)(189998001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB0605; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SIXPR06MB0605; 23:plqsFdCIMwMfwO3l54tLeOzrs770zOczs3BvS/i2A?= =?us-ascii?Q?2bwWUiFaRx9fRXzHmzQQZdGs9P061x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go6FCNfrmxDlE46T/7TnToK+5KNhKLOIZ7n3uTM2Qtgc9Y8bdq5thsd8ri?= =?us-ascii?Q?Tds/aNj/P4jKkmQ3Hq4lcRVdo3c5k51C80aRb5CB7s1RfKHprUDXFhn8Y9CP?= =?us-ascii?Q?sXx3FZxk4P04pMs+La4QbF8YfZL+O5knr4L9EUH55Rw0KAWWRQUbjsY9/0r+?= =?us-ascii?Q?hd131Nj9dE3imtd8qQyeaBJMch+YY3zagggbT4asKl736XlNSPhA7jrvrXog?= =?us-ascii?Q?jLevZTr70DOA3k=3D?= X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB0605; 5:BE9BXWS262HGfJ19Srov4unAR92neOUgYuls44pU+frOfO3m/b4F8uqblJ2AlXkUb8mXhMNTELAlZcB2CXBMbKy9wm8JaiDaBnHwy3BTJSrcQV2eHVFMmVN2HzHE6a1/YytEgY9eyRocmXLutq5gQg==; 24:TGtiCH3KZ/CbVZcvyGCExp4aticpWamG0iU4bPU3cIXNWqKwXKSSh8Sil5nTYbUb6VLCvcR6P8KcchbQaV7G9Gl69SrlWuUfUU+gkC3VfPc=; 20:0bUuWR4Qc2b0BhyooROhuA3rYr79eRaatlo5+hPFSXFiwTKlMz+12RzavSJdqvMhW21oQg47pLZTvXFwAQb7rNtiJexuIJujv6Bpm0lqMd2c/F2HWVjrXBlabMr5BW6ZSBavUAMCxht0YSXuXx5N/3GlQC2Dh0WPZ4+0lhtTyus= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2015 03:18:23.7221 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB0605 X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB142; 2:wCljT0OCqBHO0fqOzVCijjw/fvRM1M9X1NiJPNZfUxrWxI6X5CaydWMkh34ootkC7+zpNUF0FGg5cgOB8p8e3GTTXkF0swMqm86E39cNP0vt3hp+SpXRGWyUNBZUnouEgHIVo7ujoUUFrpsIlo+K1ifbYPlUfbItsnUNzpzvJXo=; 3:TP0WTXGzsRVlNroO1lj3d0OBNsS9O3wyKrvAwSwFHYXa0W/iGxvXpKD1JSA9KBpj8rDVrLR1SHLxQPPClifWK11U+rhNCB9lNdaN1VB/9Km2WBANg1LBqidkxcfwwDAKzNUjtBlLonHNi8+Ks6x6Vw==; 25:7PtdPrOwi7Y/cnMHhmnT1k5eGTn9apNmSJ0A5NSO7rm9Qgv/jX/3385WUnbSTn6mDb4yjrEETvXPsHXgJG7t8ilBEPJoDjGGnxd610KfcBGWexp5N8W8em8/GfXcdCZj0YMidYIDjF5eAvl+w7rzeLanI+CrK0WeLMsyMhbe5rqOSZcS1OrXjmMC5Gzg/YscHdFSFLgtz0siOPA1hjRR7XWaGlaXxGmK2RlKf+OOqupTrlycipzz8PYFBuPlgX6J6kW/eCf8GexwO1DRHPcCEA==; 23:B/p5pc2HLcB0nhUOpiRws9l8ioIoWPa2VLs8HRcxcYhjNtyK4RKsAqsnF+U0du3dzzYPLpsFoTs+SNwV9iQCyYqYiW4PkTpgZKoVYxwOcQl86hpnRuLbrQu2sMV1jayqvLdlgVvmF67Lt9PMi4+sncM+6XhjGs/x2RTeCftDYWU76712kTvhrDiuGgxyzH0jYr0sUpqxBKexeXcG7pNPnxKjOXzut9V4XC3Xz2MS+3H+iOYN/9U3eZ0gqNQkpGZM X-OriginatorOrg: renesas.com Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Gaku Inami Since PFC is not supported yet, this patch manually enables SCIF2 pin Signed-off-by: Gaku Inami Signed-off-by: Takeshi Kihara --- v4 -> v5 - no change drivers/clk/shmobile/clk-rcar-gen3.c | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/drivers/clk/shmobile/clk-rcar-gen3.c b/drivers/clk/shmobile/clk-rcar-gen3.c index 098caac..a5edc7b 100644 --- a/drivers/clk/shmobile/clk-rcar-gen3.c +++ b/drivers/clk/shmobile/clk-rcar-gen3.c @@ -119,6 +119,47 @@ static const struct cpg_pll_config cpg_pll_configs[16] __initconst = { * Initialization */ +/* + * Pin Function Controller (PFC) definitions. + * TODO: Should move to appropriate header. + */ +#define PFC_BASE 0xe6060000 +#define PFC_PMMR 0x0 /* LSI Multiplexed Pin Setting Mask Register */ +#define PFC_GPSR5 0x114 /* GPIO/peripheral function select register 5 */ +#define PFC_IPSR12 0x230 /* Peripheral function select register 12 */ +#define PFC_MOD_SEL1 0x504 /* Module select register 1 */ +#define PFC_SIZE 0x1000 + +/* + * Initialize PFC for SCIF2. + * TODO: Should move to appropriate source. + */ +void InitScif2PinFunction(void) +{ + void __iomem *pfc_base; + u32 data; + + pfc_base = ioremap_nocache(PFC_BASE, PFC_SIZE); + BUG_ON(!pfc_base); + + data = ioread32(pfc_base + PFC_MOD_SEL1); + data &= ~BIT(12); + iowrite32(~data, pfc_base + PFC_PMMR); + iowrite32(data, pfc_base + PFC_MOD_SEL1); + + data = ioread32(pfc_base + PFC_IPSR12); + data &= ~0x000000ff; //IP12[7:4]=4'b0000, IP12[3:0]=4'b0000 + iowrite32(~data, pfc_base + PFC_PMMR); + iowrite32(data, pfc_base + PFC_IPSR12); + + data = ioread32(pfc_base + PFC_GPSR5); + data |= 0x00000c00; //GP5[11],GP5[10] + iowrite32(~data, pfc_base + PFC_PMMR); + iowrite32(data, pfc_base + PFC_GPSR5); + + iounmap(pfc_base); +} + static u32 cpg_mode __initdata; static struct clk * __init @@ -177,6 +218,7 @@ static void __init rcar_gen3_cpg_clocks_init(struct device_node *np) unsigned int i; int num_clks; + InitScif2PinFunction(); cpg_mode = rcar_gen3_read_mode_pins(); num_clks = of_property_count_strings(np, "clock-output-names");