From patchwork Thu Aug 6 08:07:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6957091 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 E8F7CC05AC for ; Thu, 6 Aug 2015 08:08:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 103CE2068E for ; Thu, 6 Aug 2015 08:08:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0AC6720692 for ; Thu, 6 Aug 2015 08:08:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754689AbbHFII3 (ORCPT ); Thu, 6 Aug 2015 04:08:29 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:24054 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932153AbbHFIH6 (ORCPT ); Thu, 6 Aug 2015 04:07:58 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 06 Aug 2015 17:07:57 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 44899479C6; Thu, 6 Aug 2015 17:07:57 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 467D52806E; Thu, 6 Aug 2015 17:07:57 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 40E5B2806D; Thu, 6 Aug 2015 17:07:57 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id TAE30849; Thu, 6 Aug 2015 17:07:57 +0900 X-IronPort-AV: E=Sophos;i="5.15,622,1432566000"; d="scan'";a="193108578" Received: from mail-hk2apc01lp0213.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.213]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 06 Aug 2015 17:07:56 +0900 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 HK2PR06MB0594.apcprd06.prod.outlook.com (10.161.187.145) with Microsoft SMTP Server (TLS) id 15.1.225.19; Thu, 6 Aug 2015 08:07:55 +0000 Message-ID: <87lhdoyh9p.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 08/13 v4][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 In-Reply-To: <87wpx8yhhm.wl%kuninori.morimoto.gx@renesas.com> References: <87wpx8yhhm.wl%kuninori.morimoto.gx@renesas.com> Date: Thu, 6 Aug 2015 08:07:55 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: KAWPR01CA0045.jpnprd01.prod.outlook.com (25.165.48.155) To HK2PR06MB0594.apcprd06.prod.outlook.com (25.161.187.145) X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0594; 2:7n8t3oVwkeKa+eCwO2ot8Zd55d3lXVYv5II53DCXSrQUZ3BTojhnTa5zXAOTPHprIdwII3iHNCegggq6oUm2ZTKn8WRzKqZmdd3eOHu8U5XQP3/aPNEL932bY5udO6Ju6Jj+ePYjPOLUMWQz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OYGZsP+OdwP6pDSgJqKJKbJfm1vtEcpAbVpfxknIIZxfz8WlmB/YDfWfj9gDmZwKlLL9EyXuj7LVYHqYpgmhp+pshZ5Vke9kknASYY87qLiSbO4HEjXYVHq14+fgqUP1ItM794NiXmmIm+dtZsr/1lxS0g0F43Q5r5WH98gBzFJuGV/wg71p0Ct0YALaZMniof7njVbvySnP9pdY43lOx3BEbLVQX/FqjdtsfhO6Rrm4fTVKaOhIz9DdZSnnsE2niFJQdqLDbZOUZtGEnv9BexvUM0+SUvhlNMASJHD5kc= 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:HK2PR06MB0594; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB0594; X-Forefront-PRVS: 06607E485E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(4001540100001)(33646002)(189998001)(83506001)(101416001)(50466002)(77096005)(5001770100001)(5001860100001)(68736005)(105586002)(81156007)(106356001)(229853001)(5001830100001)(69596002)(76176999)(87976001)(107886002)(97736004)(54356999)(5001960100002)(50986999)(23726002)(2950100001)(86362001)(92566002)(36756003)(46102003)(42186005)(4001350100001)(47776003)(46406003)(122386002)(64706001)(19580405001)(66066001)(53416004)(62966003)(19580395003)(77156002)(40100003)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0594; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR06MB0594; 23:TZwUK49bwsLSB56u2mSfynASEJcnklHKiM5KfMQVQ?= =?us-ascii?Q?NoALzUICldd4jc0fv7KO6ipo2rTtT3Mxd0AAVP6GZTfHOfaSbdrGiWwXqtWq?= =?us-ascii?Q?SAeb3jXhMkyV0glJbMcCjhFAkQphiGAZJR8zngrwr+L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3F4fDz2wvIm435lkbBcZXedW9ZtUCt4San8hz/MSYkcKkeo?= =?us-ascii?Q?gJP5iQdPwqm/jJjprZXmUGVyoz9BI3Xy3tjL2ERpsi2RVSwtBLHd6s/dm0Cj?= =?us-ascii?Q?jv3jDVZQnMkvQoumgjJbvOkO6rp/2rlHlH2nQSpIK4U8JE7ILu2Iif0fv7qf?= =?us-ascii?Q?9xJpj/uGtGMcVLVXhVYoxhCB7XoYfuV/mxPMJCiC6JEtyBSIeZPDaJxBQ=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0594; 5:AHDBAyVp8wks2Fyr+3xJ4in9byQWOKQWvyJkdvVZaEcb/9rJECgDa2OZeQs8Rx9/Srvi1xHhKlCOMsfUUb+wvGZKNx1mJcVTb+FKivNKYNP+WJv7vWCyDJbiLsG3bjLk9JEqbTT/RHIHlUn27HyOmw==; 24:x3YiqFq1zjRBqQ2tzMwPoEkSfByvhiYInASaWrIkWCjXcncFpsRE300+Ej/9G89/LkCVswcey3871jsd2lQ4ISm5/bicqupatEXNSwZxSGk=; 20:Lyecrl5s2NW1IchXoDZpaXThQrFEY/6SEZs63A3SLO45XYmCOmLOj2qA9NjnzSH2FhPCf4vfHjeORiyWrk3y95toGQJJ1/ZRWMMFIp4Eh8oNtrpx6fr6vaG53w0oaAjI511US9HVp6SAOdPIyb9uFZIMAq9jykoUZQ0QuQzWcsg= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2015 08:07:55.0972 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0594 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 --- v3 -> v4 - new patch 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");