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: 10413345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4C8E602A0 for ; Sun, 20 May 2018 10:18:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A23F128714 for ; Sun, 20 May 2018 10:18:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94E6E28724; Sun, 20 May 2018 10:18:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2B2EF28714 for ; Sun, 20 May 2018 10:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=gR47EznlieZ6IKrJYa/990b2fxWJIMo5D5OXfO4ybn8=; b=lidh5BrrZIL70lJQtk67daIJwL x00eWG1+rn6EC9TWzFw9tBj5XUiKqCIX0A94IcfGumKBnYsjr9GoABNezH8eeiHcd4G5kGsuUU//R lGN8rC/A6WV42uOsSiwb7+GoofrBmtJjVC5njTj6MkUOJj6RVaWQK0/k8g+xvksdEYPCgbyu+kNzs +1q374lmkh1qXCCar2XxMPnJWHsoAtaAGfhgnG46vkJ0TixasvPqJrPRTEevw2UBSyE7WTyvEDGm0 lzIeccyyInHZ8nCXvGFvhTPPDFqx9yyqviHG/C0Tv7gJm97KoZ/KksCgV76+gmeyPb6WBS90aJIx8 n/Tm1UiQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fKLPT-0000S7-Lk; Sun, 20 May 2018 10:17:51 +0000 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fKLOF-00081H-5b for linux-arm-kernel@lists.infradead.org; Sun, 20 May 2018 10:16:37 +0000 Received: by mail-lf0-x241.google.com with SMTP id w202-v6so19830371lff.12 for ; Sun, 20 May 2018 03:16:24 -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=iyra6kO2DQ6fMQ4Xm0DOGhIGIuyGJzqOWz4lb1PfratJW2+7FJwF9W5EJhUS5PRzB+ lx/Ji+uD7c5VZXtKnOt8TcUKurMajmuK2/FFlDDWfjFQi7S+pLGaztykCHERlo7PChoR NSwzheMwxwoA7E40sCQk9Oc18EwpDiR/ghP5YaDl231CAmf4dHM3fHG4OaAjEPJ0uEhk ZWz4JSuDm8hFDB5O0LQZQ8MV9pAkU/nr8u0Wn1nRrDQh4vS4ewSTH3TxSjl8CHXGmVQ9 +wfoZhwExVzDOrp1hlcrPS0y2F8/ODX13j9fZ7/BHwHXEKa97FGF0JoBki++dp613CAE Ghbw== X-Gm-Message-State: ALKqPwfGezJcV+k8n+xDVtVQKXAGhm8LCuZfqi18zCkFqI2B+SbtoW1h RaJSiCZmwVnz4FAmrFNJNsc= 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180520_031635_203338_9B1F6042 X-CRM114-Status: GOOD ( 12.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, Peter Geis , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= 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 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)