From patchwork Thu Aug 30 18:04:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 10582505 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 8C344174A for ; Thu, 30 Aug 2018 18:06:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E4A328581 for ; Thu, 30 Aug 2018 18:06:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7198D2C384; Thu, 30 Aug 2018 18:06:35 +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,RCVD_IN_DNSWL_NONE 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 7753A28581 for ; Thu, 30 Aug 2018 18:06:34 +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=msEZoY2kyePTjw7/sxA9FGYh3hlR38YLW+6dOeX+c1c=; b=eYuT8hi+mlhDhjsq1HpXdGdM5f AkQe0JCxXu324iUmkWm8INkkchAWnDnbsbMnwGSCEOqc1l5G7Dym6yYIhIUUBinf54nplhwUACPgs MRgCv8Na1WYb71QsPILF8immRr2S7dqzRQ7svOaVJ3lAMa6ZyDCIN+NmXuVQIcJHw0aVV5RFjatA0 x4F/TmmED2ZGBRlDII6syBfvPfXlVhcsA72IfatJBglVt64Ou8vDhajoZ8xA6eWwK8yd0CFPDTz1W unoksaNY8HUfy7+MoC2qGO46uYhmpEmpshbhOa8uTF4jpZrsXmI8KOvZNC4mKtWdm75Z6IIWDF4+R KOLYsZQA==; 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 1fvRKm-0000Op-LW; Thu, 30 Aug 2018 18:06:20 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvRK2-0008Tx-1H for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 18:05:35 +0000 Received: by mail-lj1-x244.google.com with SMTP id j19-v6so8009527ljc.7 for ; Thu, 30 Aug 2018 11:05: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=bqXBzGttmLbwA1tWVcC4ztFYtQ17JkPgOJF7TeCjrQM=; b=M44SoKfTQYxXncRXe+sQpbpCcP6pB/OL8hJhMfpeIkPLnG7cMvIJkNOM3KpfbP2Koj sGsNxr7iIgyeBaaCHE3MSuhUu24lBDY+9T3DU0nRSiIVsN1X8lc8lOKVZV1kWXEGfZ39 O/462rzfb66PswKqggEJDr4L8+p4W0U5kU31haTIUJBX8Is05loSZOAcxMqyHXKkY+BM +7jzPXmMwM0uvUxpV/GAeXFJRrx5DbWlAsYRV+qvkb2joqab0gvdWK5OIcwWOQW15JCo UgbulB/EmgR3PF/dpYzj9YSdpCTQLcQiAhjfVm7LATQImbZuLqHLJd4kJOyiDu6/9r3r mtLA== 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=bqXBzGttmLbwA1tWVcC4ztFYtQ17JkPgOJF7TeCjrQM=; b=I5tuAHyPhf3StCviGZGzqbot5ZW+d6qfR8nZGXM1uZLqL2ZS9V42S3idO3neVPJJiY Qv6yJE9TduZO2B/V0XJQ5RibIoJO9ldLLQLo5QxtUzzNbEvc7o5f1lD+4kNMx+N9+HQK qutv3TzHOLih1jdHo8UcEMx6PLC5q6Dxbv1BC1v7QrUJVJqJhO3y//MvilK9g2Fzru+/ hW6qpce2odmlZeK2MgEqW8qeX+BNaBUuDKALzgG5pCGuv0L3+pzTBNHtQoNYIxx+KRVb Cn9ez1StXPuLiCXY0rPy0Fmsa6jqD44p1ywyh2p3eUYxGdAd3j9Rqtq3GadpSfVp3Rls imUw== X-Gm-Message-State: APzg51CqJR4osvd6U0QwAC2kbaxd2q7uGef6S9XRlDx9JZCTP+z80wnL hFmPo4pvs0X6SMBZ5W4A17E= X-Google-Smtp-Source: ANB0VdbxonLX3/tHfylXGtFG76UKRY87tiyShDKVhxYJyauhL0lsJJ3vB2b1tqj3CTwHtyBLN/rknQ== X-Received: by 2002:a2e:990b:: with SMTP id v11-v6mr7955986lji.87.1535652325589; Thu, 30 Aug 2018 11:05:25 -0700 (PDT) Received: from localhost.localdomain (109-252-90-13.nat.spd-mgts.ru. [109.252.90.13]) by smtp.gmail.com with ESMTPSA id 13-v6sm1420789lfy.87.2018.08.30.11.05.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 11:05:24 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Russell King Subject: [PATCH v3 4/8] ARM: tegra: Setup L2 cache using Trusted Foundations firmware Date: Thu, 30 Aug 2018 21:04:17 +0300 Message-Id: <20180830180421.6415-5-digetx@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180830180421.6415-1-digetx@gmail.com> References: <20180830180421.6415-1-digetx@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_110534_092539_4340B78E X-CRM114-Status: GOOD ( 13.96 ) 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 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 Tegra30 L2 cache should 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 | 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(); }