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: 6011381 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 46C90BF90F for ; Sat, 14 Mar 2015 11:53:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6EA55201B4 for ; Sat, 14 Mar 2015 11:53:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 87B6B2017E for ; Sat, 14 Mar 2015 11:53:53 +0000 (UTC) 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=BPTXPJ0MbIMtCP8/qQPMNTTGNmPOOJka2hzJDUmDr1U=; b=W7YZ4NqzUnrZQgNkLGTIS149L4hodomFXcx/HUQOi0QakPPdVJ0/DtFOOPUn4VGZGj qXXBUKLuXswtoZQUcP0rJ6BJ2jd7KCIukrxJNQERA41ZAoxBxYdiqbJUPYYnoPZOqx2p sx/VTeGdTeYlLkKF/0zKDsOuot+iQBfmeDiXLqRc128Zb6CvSqV6XhT6Ac+YfLMpmZVi XczJQvJiwweOJrHMmTGe5loHVtMsHOOTOcoh7MohH6iULIv5w5SUX5sW7RSpkQcOuDoU f7QzQ8m65w+5DjlLtFKVe9krTnK3u7rRQ+T7eJSO5pS5w1vvSsnly52MIYIcUKMgis5w s/9g== X-Gm-Message-State: ALoCoQk/A1+KACKXkND18Hp3SGt7cZtvOazTFxd0I1w5jJoS5UhsQ/6bJakeekiZEFugY5OmM32Q 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-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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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