From patchwork Fri Feb 22 17:59:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 10826773 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB8C5922 for ; Fri, 22 Feb 2019 18:05:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8AED329C3 for ; Fri, 22 Feb 2019 18:05:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD14332A7B; Fri, 22 Feb 2019 18:05:43 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 755AD329C3 for ; Fri, 22 Feb 2019 18:05:43 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=7WPvb8eTWBGVkUpINCwVjNSoRGFiesrw1+lu4TIgLxU=; b=jjfSDyYEfMW6qv 6EPUE7yzbS1Bifbh5I/Eu68csfDRtIuwSkISELCmQgEAe2i66MfHMa5WmbjjYHdj7sl2DGv2dpwkZ VWmBrBKjjT7MvT0q7TQvwpdBWkyfwIiPLW8WbHM0HvBWco4syrC7UpDCXzuAEE50tld24WQb/9kcs UTCy9jMXqtF2DDg6M5jHlxsoG5KqvdHuulewNpuhp6PLmr4A104B+H9QjCac7KF0ogwOG6GX0Emye ti5yDnLCHr1T+Pjtj+Tcm11zc4AWg3uHiYCuBXdAnIqgYxsGm5kPOwPAA/y7zC7MzY6vmOkPlN5N8 cyUetQuwlTXUP1A1CXyA==; 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 1gxFCf-0000aZ-U9; Fri, 22 Feb 2019 18:05:41 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gxFBb-0006k2-UY for linux-arm-kernel@lists.infradead.org; Fri, 22 Feb 2019 18:04:37 +0000 Received: by mail-lf1-x143.google.com with SMTP id n15so2398332lfe.5 for ; Fri, 22 Feb 2019 10:04:35 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=AfjyKjJ4BPDlX5QQ+sFj1fRVuO9lVs7F3NH6shrTHtY=; b=Jr0jW989CtnvJYdr1+6TMimzDMHDAAoVRF14ZqAkbS+ynaSGXeM6MSV5Bkf53zo2sw cMcwDUVWDVkiUEtylnj+/O5tMTpvjcf4Rso0toLQr2iI9qoNbBLW/AtXg/PQMZyEe/4/ EuQIHPIK4bBPh9MxEyyZLWLTS6bxhB70LMR9ucLfoGUZz0s2gqYG7XyaGMQxi9caGboz LTNntrRG9p2a/67XywcEtIC+NQH3CpVFC57sGgsOdA4MByGq/0nU6gALCPNIFm+n8k7I Ork95E6D+AX9YyWnHvHE0smBSThsaKRVD/oYZjBbXFIUIsmb18mNDWUfy37vlO71D9Qu 7Lsw== 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:mime-version:content-transfer-encoding; bh=AfjyKjJ4BPDlX5QQ+sFj1fRVuO9lVs7F3NH6shrTHtY=; b=ZLIRadPYevjoXVx6u2Z1wNb5wtH2IN/b2am5GtcLhA9QYRew1e3aFKYOjm2yvmbMka Wk8u4zfCfZwyBx3bim2ZWfZ8caFzDJWQywUGuhi0NavzTejr6XhEH9y8SYbwRVpa9/HN j04UjilDLFXke9oQnr01nJxr89MHTYni+ePnRqOMAyVAIbQRE5+olCpoTpifDZJG60ls u5g663u3Lg4ke+txnwfkVGcpu3oceHLSQ1BKz5PGHDPsu0QcBcD/fvG1iew6zgHQ1jv+ T3plBrY6ApE3wqJ2fi3CPrOCcMXTiSeVoQj6Y/cgPNkaVSiOAV8mM6LTvxww0Nb1aqyf yImA== X-Gm-Message-State: AHQUAuYm2WPBuwt6hb6VqfaC4T8+6kShfA3/3p+pe7qIKtaoby5Y7lqv z60mX7+ztfr79nqyyAkplVmlASpw X-Google-Smtp-Source: AHgI3IaJEsj3kn9P0hVwEv0sUqUfRwmR3ypjSmWOVPZXz4x78Cav6WUvuG8rxDGy31MSk1v3oRIJjg== X-Received: by 2002:ac2:424e:: with SMTP id m14mr3232954lfl.4.1550858673926; Fri, 22 Feb 2019 10:04:33 -0800 (PST) Received: from localhost.localdomain (ppp91-79-175-49.pppoe.mtu-net.ru. [91.79.175.49]) by smtp.gmail.com with ESMTPSA id j12sm721202lfg.47.2019.02.22.10.04.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Feb 2019 10:04:33 -0800 (PST) From: Dmitry Osipenko To: Russell King , Thierry Reding , Jonathan Hunter , Robert Yang , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v5 4/8] ARM: tegra: Set up L2 cache using Trusted Foundations firmware Date: Fri, 22 Feb 2019 20:59:22 +0300 Message-Id: <20190222175926.23366-5-digetx@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190222175926.23366-1-digetx@gmail.com> References: <20190222175926.23366-1-digetx@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190222_100435_980875_C7CE4CD2 X-CRM114-Status: GOOD ( 14.03 ) 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, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 On Tegra30 L2 cache should be initialized using firmware call if CPU is running in insecure mode. Initialize L2 cache and set up the outer-cache callbacks early during boot using the firmware API. Signed-off-by: Dmitry Osipenko --- arch/arm/mach-tegra/tegra.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c index f9587be48235..67d8ae60ac67 100644 --- a/arch/arm/mach-tegra/tegra.c +++ b/arch/arm/mach-tegra/tegra.c @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -70,9 +71,18 @@ u32 tegra_uart_config[3] = { 0, }; +static void __init tegra_trusted_foundations_l2x0_cache_init(void) +{ + if (IS_ENABLED(CONFIG_CACHE_L2X0) && + IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) && + of_machine_is_compatible("nvidia,tegra30")) + call_firmware_op(l2x0_init); +} + static void __init tegra_init_early(void) { of_register_trusted_foundations(); + tegra_trusted_foundations_l2x0_cache_init(); tegra_cpu_reset_handler_init(); }