From patchwork Sat Mar 14 11:49:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 45812 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 833D2214BF for ; Sat, 14 Mar 2015 11:53:17 +0000 (UTC) Received: by lbiz11 with SMTP id z11sf20528870lbi.2 for ; Sat, 14 Mar 2015 04:53:16 -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:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=FeDKDfXG6vByxjo2NH8aodoiPh7IpRAeZW0q8quX9IM=; b=WiYwCb6Uf5aDjOIM8jlwSIJ8NyIG4smZGL0Llq8IKSryHYRGBS2uU+Z623xlrAQqHJ fhxq2xJpguoDhgfQMUv2+ifznsvFMCJtOwioNuB6B6eMRiSTqAa8ZNLDsqwGnELl0RjP yxiTbTu5y7UOxon6AQV7FuLYUDA4B2W78X/kgZZmZ03aqEEP7kNPOf16qqDCdxaZsJSz i2u/Ojx2C3EwBmXdSXvKiMgSNZ84XD7A+lD1lgHdwfXhk6dn6F0EOPHIQrPyb8EdEVGo 41WMiWucISXf0TCOgoK70gVagooNyz/vYWhF6nnl+AHS/05PV5NfqlWLsShgPlcpY0dz YT4Q== X-Gm-Message-State: ALoCoQnQlcpesl41432QBlOY0A7mVUatzhXoQaRozLq/xp0QwfvVxjTahjISwUtSkIzCAj/6N+6C X-Received: by 10.112.41.131 with SMTP id f3mr8098830lbl.20.1426333996364; Sat, 14 Mar 2015 04:53:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.4 with SMTP id f4ls429062lah.18.gmail; Sat, 14 Mar 2015 04:53:15 -0700 (PDT) X-Received: by 10.112.167.4 with SMTP id zk4mr45416305lbb.74.1426333995972; Sat, 14 Mar 2015 04:53:15 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id r6si3371679laa.53.2015.03.14.04.53.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Mar 2015 04:53:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lagg8 with SMTP id g8so8018203lag.1 for ; Sat, 14 Mar 2015 04:53:15 -0700 (PDT) X-Received: by 10.152.22.67 with SMTP id b3mr46173318laf.117.1426333995436; Sat, 14 Mar 2015 04:53:15 -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.112.35.133 with SMTP id h5csp1477736lbj; Sat, 14 Mar 2015 04:53:14 -0700 (PDT) X-Received: by 10.70.44.100 with SMTP id d4mr113344297pdm.36.1426333993703; Sat, 14 Mar 2015 04:53:13 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id x14si9467643pas.1.2015.03.14.04.53.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Mar 2015 04:53:13 -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 1YWkbd-0003hK-Gp; Sat, 14 Mar 2015 11:51:49 +0000 Received: from mail-pd0-f173.google.com ([209.85.192.173]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YWkab-00039w-1q for linux-arm-kernel@lists.infradead.org; Sat, 14 Mar 2015 11:50:45 +0000 Received: by pdbni2 with SMTP id ni2so10882525pdb.1 for ; Sat, 14 Mar 2015 04:50:22 -0700 (PDT) X-Received: by 10.66.161.161 with SMTP id xt1mr113541245pab.35.1426333822466; Sat, 14 Mar 2015 04:50:22 -0700 (PDT) Received: from localhost.localdomain ([107.6.112.156]) by mx.google.com with ESMTPSA id ov5sm7365488pdb.91.2015.03.14.04.50.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 14 Mar 2015 04:50:21 -0700 (PDT) From: Jun Nie To: linux-arm-kernel@lists.infradead.org, mturquette@linaro.org, linux@arm.linux.org.uk, shawn.guo@linaro.org, jun.nie@linaro.org, zte-lt@lists.linaro.org Subject: [PATCH 04/10] ARM: zx: add initial L2CC initialization Date: Sat, 14 Mar 2015 19:49:39 +0800 Message-Id: <1426333785-3952-5-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426333785-3952-1-git-send-email-jun.nie@linaro.org> References: <1426333785-3952-1-git-send-email-jun.nie@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150314_045045_140123_0FD02E89 X-CRM114-Status: UNSURE ( 9.30 ) X-CRM114-Notice: Please train this message. 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.192.173 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.173 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 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: jun.nie@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.215.52 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 Add an initial L2 Cache controller initialization. Signed-off-by: Jun Nie --- arch/arm/mach-zx/zx296702.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/arch/arm/mach-zx/zx296702.c b/arch/arm/mach-zx/zx296702.c index fdd7961..9c055ea 100644 --- a/arch/arm/mach-zx/zx296702.c +++ b/arch/arm/mach-zx/zx296702.c @@ -7,9 +7,52 @@ * published by the Free Software Foundation. */ +#include +#include +#include + +#include #include #include +#include "core.h" + +static void __init zx_l2x0_init(void) +{ + void __iomem *base; + struct device_node *np; + unsigned int val; + + np = of_find_compatible_node(NULL, NULL, "arm,pl310-cache"); + if (!np) + goto out; + + base = of_iomap(np, 0); + if (!base) { + of_node_put(np); + goto out; + } + + val = readl_relaxed(base + L310_PREFETCH_CTRL); + val |= 0x70800000; + writel_relaxed(val, base + L310_PREFETCH_CTRL); + + writel_relaxed(L310_DYNAMIC_CLK_GATING_EN | L310_STNDBY_MODE_EN, + base + L310_POWER_CTRL); + + iounmap(base); + of_node_put(np); + +out: + l2x0_of_init(0x7c433C01, 0x8000c3fe); +} + +static void __init zx296702_init_machine(void) +{ + zx_l2x0_init(); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); +} + static const char *zx296702_dt_compat[] __initconst = { "zte,zx296702", NULL, @@ -17,4 +60,5 @@ static const char *zx296702_dt_compat[] __initconst = { DT_MACHINE_START(ZX, "ZTE ZX296702 (Device Tree)") .dt_compat = zx296702_dt_compat, + .init_machine = zx296702_init_machine, MACHINE_END