From patchwork Tue Jun 28 14:10:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 9203341 X-Patchwork-Delegate: horms@verge.net.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 78D0F608A6 for ; Tue, 28 Jun 2016 14:10:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A59128603 for ; Tue, 28 Jun 2016 14:10:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EE4128607; Tue, 28 Jun 2016 14:10:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C75D285F9 for ; Tue, 28 Jun 2016 14:10:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752413AbcF1OK4 (ORCPT ); Tue, 28 Jun 2016 10:10:56 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:49231 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752410AbcF1OKt (ORCPT ); Tue, 28 Jun 2016 10:10:49 -0400 Received: from ayla.of.borg ([84.193.137.253]) by baptiste.telenet-ops.be with bizsmtp id CEAk1t00F5UCtCs01EAkw6; Tue, 28 Jun 2016 16:10:48 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1bHtiu-0002dN-8o; Tue, 28 Jun 2016 16:10:44 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1bHtiu-0002Dm-89; Tue, 28 Jun 2016 16:10:44 +0200 From: Geert Uytterhoeven To: Simon Horman , Magnus Damm Cc: Mark Rutland , Lorenzo Pieralisi , Keita Kobayashi , Laurent Pinchart , Sergei Shtylyov , linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 05/13] soc: renesas: rcar-sysc: Improve SYSC interrupt config in legacy wrapper Date: Tue, 28 Jun 2016 16:10:34 +0200 Message-Id: <1467123042-8468-6-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467123042-8468-1-git-send-email-geert+renesas@glider.be> References: <1467123042-8468-1-git-send-email-geert+renesas@glider.be> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Align SYSC interrupt configuration in the legacy wrapper with the DT version: - Mask SYSC interrupt sources before enabling them (doesn't matter much as they're disabled at the GIC level anyway), - Make sure not to clear reserved SYSCIMR bits that were set before. Signed-off-by: Geert Uytterhoeven Reviewed-by: Ulrich Hecht --- v5: - Add Reviewed-by, v4: - New. --- drivers/soc/renesas/rcar-sysc.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c index 22f0d646225c444e..65c8e1eb90c09bb3 100644 --- a/drivers/soc/renesas/rcar-sysc.c +++ b/drivers/soc/renesas/rcar-sysc.c @@ -402,12 +402,25 @@ early_initcall(rcar_sysc_pd_init); void __init rcar_sysc_init(phys_addr_t base, u32 syscier) { + u32 syscimr; + if (!rcar_sysc_pd_init()) return; rcar_sysc_base = ioremap_nocache(base, PAGE_SIZE); - /* enable all interrupt sources, but do not use interrupt handler */ + /* + * Mask all interrupt sources to prevent the CPU from receiving them. + * Make sure not to clear reserved bits that were set before. + */ + syscimr = ioread32(rcar_sysc_base + SYSCIMR); + syscimr |= syscier; + pr_debug("%s: syscimr = 0x%08x\n", __func__, syscimr); + iowrite32(syscimr, rcar_sysc_base + SYSCIMR); + + /* + * SYSC needs all interrupt sources enabled to control power. + */ + pr_debug("%s: syscier = 0x%08x\n", __func__, syscier); iowrite32(syscier, rcar_sysc_base + SYSCIER); - iowrite32(0, rcar_sysc_base + SYSCIMR); }