From patchwork Sun May 20 10:15:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 10413337 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 5B3B4602A0 for ; Sun, 20 May 2018 10:17:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B54228714 for ; Sun, 20 May 2018 10:17:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FB5B28724; Sun, 20 May 2018 10:17:00 +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 A210A28714 for ; Sun, 20 May 2018 10:16:59 +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=oQ6zGNeWNJgnRiKKarZPi9lYEkk+tlyAf3oMgc7vyPI=; b=EBk1AI3KgTS56Rda/9dhtuu5oz dWI652zs9lgXdZQW/XZBdaWdJhP1mGUqU5ilh41IvmpyuWh7NPIrz7vWBeGKNce2E5pP3V9lrYERu mzXK5bud0RnqXcENbofy3lZ1Xadsxq31S7SrjdNGk+pXs4hgBpBxOPk2v0KEhxB0lActnAKJzJNYt 8x7dUOJpfitRxElNZhrxe0BkQEf3yabk0Jy/O3LNu3p+VPqAMYekkixKSu/dEMPAaHMRasxbABcXS 9qBRSITqVj5PYxyDs5ds0wUxHUz9vS++QmrnRRxewmZ89HAqtrE+xZ39dhvxXX0l+Sh6EbK1Pgfjf 34zGGvLQ==; 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 1fKLOX-0008FG-9k; Sun, 20 May 2018 10:16:53 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fKLOE-00081L-OQ for linux-arm-kernel@lists.infradead.org; Sun, 20 May 2018 10:16:36 +0000 Received: by mail-lf0-x243.google.com with SMTP id w202-v6so19830425lff.12 for ; Sun, 20 May 2018 03:16:26 -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=XVXY9aVjwfEaBDrxkxQesIgLVl2iH1Y1fqjsyC6fDoA=; b=WN462ouM1aZF7bDMADDnx6QwDm0q/NoJA3xtNlCITT4GZQk/IfZCaO2CeacszNT3pk FNMaOo5jRsKH4302QhsdXxlbcyrkNJu3A1R6+50LTMTfE8ENh+z1QeRMcZT2gRuFsH5K 8pu2X7eMD4zG0xp5EzDFABcXG6oQJHUzoYSHowrVKANIudzTsbY2dA7GIS/iRY/8C/KZ OavWCSKIfSJU4W0NTJNNnx1+Q1dw+AGaWgIaWyHxOLTVNhcW5m23jiYb4kzEtXulBIWV JuAEH/4T+QnUkXrpyz/NlkpaaWkKxSmoDhIhX9rH7aiBJNYNKvemQI4FITJ6R4ZxCmZZ vG9g== 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=XVXY9aVjwfEaBDrxkxQesIgLVl2iH1Y1fqjsyC6fDoA=; b=mkyv2l1E+dAAR86rxWOSCiYLujblA1ICGgFGllbJ8PDaLg3DIBUAr4Zl8Xc33Rxsji w0v6URzQmAz9FPZeBYpDcPfhoGeM+edEoUDfLwJ/AUXDLLNYRftiittFp1aAjK3h7tt5 ww0wvupYMtf8+qtxbZSMl955jRcmwaq10bzDE88q+ifbAZdQiepRuXBBG829U4hu8QhE d4PjmlWx10V3yypnzzEPHhZNEZ3PJcJ1JPfGzbVWtTqJ9ku2nzCPKPhBm8BKtQi+e2cu bbBnmRdxSlG97IngPWvjcIAgdfYArxIRVSxYOxHqLQsxNt5y/SvIFMqWnlrysHo2Iuuy 2psg== X-Gm-Message-State: ALKqPwfUQGZZxf7c8YJjmnV7ofbNspZM7/Hvjp++SKNbRDyeC8Trztgw XDBClQEc56AswTJPwz0Jw6o= X-Google-Smtp-Source: AB8JxZox15mn8sIIR2QkI/G1zr+Gv0nhYPTsd1ume+k8CU6wab22xWqioiUhr1YBhkpqRCm8MLYj9A== X-Received: by 2002:a19:9855:: with SMTP id a82-v6mr19871789lfe.87.1526811384933; Sun, 20 May 2018 03:16:24 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 May 2018 03:16:24 -0700 (PDT) From: Dmitry Osipenko To: Russell King , Thierry Reding , Jonathan Hunter Subject: [PATCH v1 3/5] ARM: tegra: Setup L2 cache using Trusted Foundations firmware Date: Sun, 20 May 2018 13:15:40 +0300 Message-Id: <20180520101542.12206-4-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_031634_808865_A62A33FC X-CRM114-Status: GOOD ( 12.37 ) 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 On Tegra20/30 L2 cache must be initialized using firmware call if CPU is running in insecure mode. Initialize L2 cache and setup the outer-cache callbacks in early boot using the firmware API. Signed-off-by: Dmitry Osipenko --- arch/arm/mach-tegra/tegra.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c index f9587be48235..590b1cf1a8c4 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,23 @@ 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_2x_SOC) && + of_machine_is_compatible("nvidia,tegra20")) + call_firmware_op(l2x0_init); + + 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(); }