From patchwork Thu Jun 26 04:05:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 32518 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7964A20DCC for ; Thu, 26 Jun 2014 04:08:29 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id lx4sf16581982iec.4 for ; Wed, 25 Jun 2014 21:08:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=9dYxaOA3NvsEqWUctHwH6atGk94TBPDLE8gqyizQ8/g=; b=SbW2vdM2M2+LlLsE6FIo8xDNcj5NBLpWJ6GNV4uIZhXNikXQZ5qcu+lQHd6SgN+ls9 IC2GtT67rDoG43rYb/yy9JhzONXjg20153YG0jBtZKPryWhzgiquIG+i4XsXwLMJYb/G HTy6VrXXP6cm/sI37XQ0VXW0rDb2NGUFLagI1cYOHHUnjehBteCnC2o81mqaCtYFZRCE kQF9M0Xc428l+OgMKpI5yj2wQbdbL+M0iUiKH53p60NL2w4gfBCuLGINnj70Km9sDHgr sqQfSs5GOjF/PHX+9ThaiHOyBytt0KvO0Fsrplly1RSHU0ko6lyaLHSAy/gs/2/FZzPg s+ZA== X-Gm-Message-State: ALoCoQk/Sii4HNPkRCMn05TITVw1CK/GdBgv4SS1zG5BbdDvXkZSJbsnKh8S4LS1CMSY3Tls25N8 X-Received: by 10.43.67.67 with SMTP id xt3mr6315602icb.23.1403755708985; Wed, 25 Jun 2014 21:08:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.36.36 with SMTP id o33ls65905qgo.76.gmail; Wed, 25 Jun 2014 21:08:28 -0700 (PDT) X-Received: by 10.220.92.193 with SMTP id s1mr10818972vcm.34.1403755708835; Wed, 25 Jun 2014 21:08:28 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id uk3si3639556vec.102.2014.06.25.21.08.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 25 Jun 2014 21:08:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ik5so2907624vcb.35 for ; Wed, 25 Jun 2014 21:08:28 -0700 (PDT) X-Received: by 10.58.229.162 with SMTP id sr2mr10612201vec.15.1403755708733; Wed, 25 Jun 2014 21:08:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp1119vcb; Wed, 25 Jun 2014 21:08:28 -0700 (PDT) X-Received: by 10.66.255.67 with SMTP id ao3mr17618468pad.25.1403755707129; Wed, 25 Jun 2014 21:08:27 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id sy3si7974266pab.158.2014.06.25.21.08.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jun 2014 21:08:27 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X00xI-00075p-21; Thu, 26 Jun 2014 04:06:36 +0000 Received: from mail-pb0-f47.google.com ([209.85.160.47]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X00xB-00071d-48 for linux-arm-kernel@lists.infradead.org; Thu, 26 Jun 2014 04:06:29 +0000 Received: by mail-pb0-f47.google.com with SMTP id up15so2574868pbc.6 for ; Wed, 25 Jun 2014 21:06:07 -0700 (PDT) X-Received: by 10.66.136.131 with SMTP id qa3mr17381389pab.77.1403755567709; Wed, 25 Jun 2014 21:06:07 -0700 (PDT) Received: from localhost.localdomain ([140.206.182.114]) by mx.google.com with ESMTPSA id z3sm27916184pas.15.2014.06.25.21.06.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Jun 2014 21:06:06 -0700 (PDT) From: Haojian Zhuang To: yanhaifeng@gmail.com, xuwei5@hisilicon.com, arnd@arndb.de, olof@lixom.net, linux-arm-kernel@lists.infradead.org, khilman@kernel.org, jchxue@gmail.com Subject: [PATCH v4 1/8] ARM: hisi: store reboot reg in global variable Date: Thu, 26 Jun 2014 12:05:40 +0800 Message-Id: <1403755547-623-2-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1403755547-623-1-git-send-email-haojian.zhuang@linaro.org> References: <1403755547-623-1-git-send-email-haojian.zhuang@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140625_210629_228921_900DB160 X-CRM114-Status: GOOD ( 11.29 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.47 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.47 listed in wl.mailspike.net] Cc: Haojian Zhuang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: haojian.zhuang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Avoid to parse DT in restart() function. Parsing these in init_late() instead. Signed-off-by: Haojian Zhuang --- arch/arm/mach-hisi/hisilicon.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-hisi/hisilicon.c b/arch/arm/mach-hisi/hisilicon.c index 741faf3..a2387bc 100644 --- a/arch/arm/mach-hisi/hisilicon.c +++ b/arch/arm/mach-hisi/hisilicon.c @@ -45,33 +45,38 @@ static struct map_desc hi3620_io_desc[] __initdata = { }, }; +static void __iomem *sysctrl_base; +static u32 reboot_offset; + static void __init hi3620_map_io(void) { debug_ll_io_init(); iotable_init(hi3620_io_desc, ARRAY_SIZE(hi3620_io_desc)); } -static void hi3xxx_restart(enum reboot_mode mode, const char *cmd) +static void __init hi3xxx_init_late(void) { struct device_node *np; - void __iomem *base; - int offset; np = of_find_compatible_node(NULL, NULL, "hisilicon,sysctrl"); if (!np) { pr_err("failed to find hisilicon,sysctrl node\n"); return; } - base = of_iomap(np, 0); - if (!base) { + sysctrl_base = of_iomap(np, 0); + if (!sysctrl_base) { pr_err("failed to map address in hisilicon,sysctrl node\n"); return; } - if (of_property_read_u32(np, "reboot-offset", &offset) < 0) { + if (of_property_read_u32(np, "reboot-offset", &reboot_offset) < 0) { pr_err("failed to find reboot-offset property\n"); return; } - writel_relaxed(0xdeadbeef, base + offset); +} + +static void hi3xxx_restart(enum reboot_mode mode, const char *cmd) +{ + writel_relaxed(0xdeadbeef, sysctrl_base + reboot_offset); while (1) cpu_do_idle(); @@ -85,6 +90,7 @@ static const char *hi3xxx_compat[] __initconst = { DT_MACHINE_START(HI3620, "Hisilicon Hi3620 (Flattened Device Tree)") .map_io = hi3620_map_io, .dt_compat = hi3xxx_compat, + .init_late = hi3xxx_init_late, .smp = smp_ops(hi3xxx_smp_ops), .restart = hi3xxx_restart, MACHINE_END