From patchwork Sat Oct 5 14:39:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 2991321 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 70B10BF924 for ; Sat, 5 Oct 2013 14:40:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99F902022A for ; Sat, 5 Oct 2013 14:40:38 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7F1A20184 for ; Sat, 5 Oct 2013 14:40:33 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VST1a-0004Kf-8X; Sat, 05 Oct 2013 14:40:06 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VST1T-0002BZ-71; Sat, 05 Oct 2013 14:39:59 +0000 Received: from top.free-electrons.com ([176.31.233.9] helo=mail.free-electrons.com) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VST1H-00029a-95 for linux-arm-kernel@lists.infradead.org; Sat, 05 Oct 2013 14:39:49 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id 08E008F0; Sat, 5 Oct 2013 16:39:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (189.58.26.109.rev.sfr.net [109.26.58.189]) by mail.free-electrons.com (Postfix) with ESMTPSA id C1177891; Sat, 5 Oct 2013 16:39:32 +0200 (CEST) From: Maxime Ripard To: p.zabel@pengutronix.de Subject: [PATCH 3/4] ARM: sunxi: Register the A31 reset IP in init_time Date: Sat, 5 Oct 2013 16:39:19 +0200 Message-Id: <1380983960-11087-4-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1380983960-11087-1-git-send-email-maxime.ripard@free-electrons.com> References: <1380983960-11087-1-git-send-email-maxime.ripard@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131005_103947_556519_68CDFEDA X-CRM114-Status: GOOD ( 10.60 ) X-Spam-Score: -1.9 (-) Cc: Emilio Lopez , linux-sunxi@googlegroups.com, kevin.z.m.zh@gmail.com, sunny@allwinnertech.com, shuge@allwinnertech.com, Maxime Ripard , 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-Virus-Scanned: ClamAV using ClamSMTP The A31 has a reset IP that maintains a few other IPs in reset by default. Among these IPs are the UARTs, and most notably the timers. We thus need to register the reset driver before initializing the timers so that the reset timer can use the reset framework. Signed-off-by: Maxime Ripard --- arch/arm/mach-sunxi/sunxi.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c index f184f6c..db4dff1 100644 --- a/arch/arm/mach-sunxi/sunxi.c +++ b/arch/arm/mach-sunxi/sunxi.c @@ -142,9 +142,29 @@ static const char * const sun6i_board_dt_compat[] = { NULL, }; +static const struct of_device_id sun6i_reset_dt_ids[] = { + { .compatible = "allwinner,sun6i-a31-ahb1-reset", }, + { .compatible = "allwinner,sun6i-a31-apb1-reset", }, + { .compatible = "allwinner,sun6i-a31-apb2-reset", }, + { /* sentinel */ } +}; + +extern void __init sun6i_reset_init(struct device_node *np); +static void __init sun6i_timer_init(void) +{ + struct device_node *np; + + sunxi_init_clocks(); + + for_each_matching_node(np, sun6i_reset_dt_ids) + sun6i_reset_init(np); + + clocksource_of_init(); +} + DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family") .init_machine = sunxi_dt_init, - .init_time = sunxi_timer_init, + .init_time = sun6i_timer_init, .dt_compat = sun6i_board_dt_compat, .restart = sun6i_restart, MACHINE_END