From patchwork Sun May 20 10:15:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 917121 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qhTEdQMr"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40pdBB1ZfBz9s4b for ; Sun, 20 May 2018 20:17:05 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750928AbeETKQ0 (ORCPT ); Sun, 20 May 2018 06:16:26 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:36105 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750994AbeETKQY (ORCPT ); Sun, 20 May 2018 06:16:24 -0400 Received: by mail-lf0-f68.google.com with SMTP id e9-v6so2950354lfb.3; Sun, 20 May 2018 03:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=u1bBVtqIQGM51uSDXY5XNBbPmjT3486DCJXPsPmqVX0=; b=qhTEdQMrtF7l0daXYZ8JOsP4P+LAt6YnIsSyGpcDiewjM5j9AS+YmutBscT1Y+ca6f XptDtHCubHdnO4AIT183dQJzArq6LPGBmDXtfEq0lpUupZ5hX1N5MJD4PjJKQFQi0sO7 mx85WNelD5LjAjCCgB0/ma1lqvuWsZnmk7txABuKJQd3TZ7QIroAzK9d7i4frYlU5tFG zStcvXtKUOppWRYPex5ROScK6FnzzDcCJg/kb3bDE3gqjx3bIzC9OIMVBaEbHtuY9H9V fFJkJyJnQE+xDDG1uSUi3squDG/FRVe77rSyO+tZ0eNxD3EZClHZWUA+GvYM7u0IEj9o nDIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=u1bBVtqIQGM51uSDXY5XNBbPmjT3486DCJXPsPmqVX0=; b=OUdKmpaK3mSXY/2WlpB/OP1ssuCZRyh+H4997pYxDj8CKrifB8eccNZaH1pbv6wSeB aBmyZ6RoSz56LPxj71FSuIaebYZVGhZQuJwdRPsMEpW+RI7Gexa7lnoIkhxTx+jkdoCg +lk72FYoXTlUpoDvL4W25I3ZePwhE9JI82jGOgQvs+2EApGSaUHXV11iMa/Izak4Jdl7 gEHdlf2wz4ZjzBfmxbQPjL0CYZtRHl58dFIAoYkadSqcjki9IcoZggCBv5DcU415qiKP hE7Y7bGfJGHOj0y20TIQkqFrcjhzOlfAppW8iAIWG1wtE+KHsN5ibDZMd+N1bT4SwCQS +MCw== X-Gm-Message-State: ALKqPwcfdY3S50GCqD1kTKLCml8LqYoPtF28TQsKbplfi7SHcSJ0HIPn gzRt8FwnjaPY6YMC4NYOUXGKK88y X-Google-Smtp-Source: AB8JxZrj05WW0ppBkeYIxoqWZd2uZ6dsw14+Jf+UJ5xg0uCRAIrbtAcmIHf7FRHLGV+yvo0AyGinyw== X-Received: by 2002:a2e:1082:: with SMTP id 2-v6mr9525858ljq.9.1526811383132; Sun, 20 May 2018 03:16:23 -0700 (PDT) Received: from localhost.localdomain (109-252-91-60.nat.spd-mgts.ru. [109.252.91.60]) by smtp.gmail.com with ESMTPSA id p18-v6sm2627836lfd.91.2018.05.20.03.16.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 May 2018 03:16:22 -0700 (PDT) From: Dmitry Osipenko To: Russell King , Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peter Geis , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v1 1/5] ARM: trusted_foundations: Implement L2 cache initialization callback Date: Sun, 20 May 2018 13:15:38 +0300 Message-Id: <20180520101542.12206-2-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180520101542.12206-1-digetx@gmail.com> References: <20180520101542.12206-1-digetx@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Implement L2 cache initialization firmware callback that should be invoked early in boot to enable cache HW. Signed-off-by: Dmitry Osipenko --- arch/arm/firmware/trusted_foundations.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/arch/arm/firmware/trusted_foundations.c b/arch/arm/firmware/trusted_foundations.c index 3fb1b5a1dce9..198ce5c75ca0 100644 --- a/arch/arm/firmware/trusted_foundations.c +++ b/arch/arm/firmware/trusted_foundations.c @@ -18,8 +18,13 @@ #include #include #include +#include #include +#define TF_CACHE_MAINT 0xfffff100 + +#define TF_CACHE_INIT 1 + #define TF_SET_CPU_BOOT_ADDR_SMC 0xfffff200 #define TF_CPU_PM 0xfffffffc @@ -63,9 +68,27 @@ static int tf_prepare_idle(void) return 0; } +#ifdef CONFIG_CACHE_L2X0 +static void tf_cache_write_sec(unsigned long val, unsigned int reg) +{ + pr_warn("%s: Ignoring write [0x%x]: 0x%08lx\n", __func__, reg, val); +} + +static int tf_init_cache(void) +{ + outer_cache.write_sec = tf_cache_write_sec; + tf_generic_smc(TF_CACHE_MAINT, TF_CACHE_INIT, 0); + + return 0; +} +#endif /* CONFIG_CACHE_L2X0 */ + static const struct firmware_ops trusted_foundations_ops = { .set_cpu_boot_addr = tf_set_cpu_boot_addr, .prepare_idle = tf_prepare_idle, +#ifdef CONFIG_CACHE_L2X0 + .l2x0_init = tf_init_cache, +#endif }; void register_trusted_foundations(struct trusted_foundations_platform_data *pd)