From patchwork Thu Jun 30 14:16:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 9208333 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 6C6A36075F for ; Thu, 30 Jun 2016 14:47:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C33B28673 for ; Thu, 30 Jun 2016 14:47:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 512852867D; Thu, 30 Jun 2016 14:47:26 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E2C2428673 for ; Thu, 30 Jun 2016 14:47:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIdDx-0004vT-0y; Thu, 30 Jun 2016 14:45:49 +0000 Received: from kirsty.vergenet.net ([202.4.237.240]) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIco6-00069k-Ib for linux-arm-kernel@lists.infradead.org; Thu, 30 Jun 2016 14:19:09 +0000 Received: from penelope.kanocho.kobe.vergenet.net (unknown [130.37.168.194]) by kirsty.vergenet.net (Postfix) with ESMTPSA id 1C5FA25BF17; Fri, 1 Jul 2016 00:17:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1467296254; bh=aYi921phS3mXNCoysTMRYykru8SLUNnO8UriwxLlQUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bdiSOjYD1v9XkPDq8awYhHCJFMYTwm+w8KkP7zrRaepzaONtx3PSlFt3/P56dZKc+ eCtvTcSOtf9yTUIbuWBYrFrdQSQsganZ3OWho5Shlqo77myr2irbHHITk8k8FmO44m kQRHANbmSniL1lVi1FBsi+gToSnDMzArOm5I4IBk= Received: by penelope.kanocho.kobe.vergenet.net (Postfix, from userid 7100) id 2442B62179; Thu, 30 Jun 2016 16:16:13 +0200 (CEST) From: Simon Horman To: linux-renesas-soc@vger.kernel.org Subject: [PATCH 3/5] soc: renesas: rcar-sysc: Make rcar_sysc_init() init the PM domains Date: Thu, 30 Jun 2016 16:16:10 +0200 Message-Id: X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160630_071907_284466_96F50B33 X-CRM114-Status: GOOD ( 10.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Simon Horman , Magnus Damm , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Geert Uytterhoeven Let rcar_sysc_init() trigger initialization of the SYSC PM domains from DT if called before the early_initcall. On failure, it falls back to mapping the passed register block, as before. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- drivers/soc/renesas/rcar-sysc.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c index 59a8152681a5..68d6856c9d3c 100644 --- a/drivers/soc/renesas/rcar-sysc.c +++ b/drivers/soc/renesas/rcar-sysc.c @@ -164,15 +164,6 @@ static bool rcar_sysc_power_is_off(const struct rcar_sysc_ch *sysc_ch) return false; } -void __iomem *rcar_sysc_init(phys_addr_t base) -{ - rcar_sysc_base = ioremap_nocache(base, PAGE_SIZE); - if (!rcar_sysc_base) - panic("unable to ioremap R-Car SYSC hardware block\n"); - - return rcar_sysc_base; -} - struct rcar_sysc_pd { struct generic_pm_domain genpd; struct rcar_sysc_ch ch; @@ -328,6 +319,9 @@ static int __init rcar_sysc_pd_init(void) unsigned int i; int error; + if (rcar_sysc_base) + return 0; + np = of_find_matching_node_and_match(NULL, rcar_sysc_matches, &match); if (!np) return -ENODEV; @@ -405,3 +399,11 @@ out_put: return error; } early_initcall(rcar_sysc_pd_init); + +void __iomem * __init rcar_sysc_init(phys_addr_t base) +{ + if (rcar_sysc_pd_init()) + rcar_sysc_base = ioremap_nocache(base, PAGE_SIZE); + + return rcar_sysc_base; +}