From patchwork Mon Feb 18 00:17:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 10817245 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 EC09013B5 for ; Mon, 18 Feb 2019 00:19:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8D2D29EF4 for ; Mon, 18 Feb 2019 00:19:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB02429EFA; Mon, 18 Feb 2019 00:19:28 +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 7134629EF4 for ; Mon, 18 Feb 2019 00:19:28 +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: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:In-Reply-To:References: List-Owner; bh=iO1qUYq3DDywu8sHTA9qjOG1JQKGV7LRk6DUVSjGvVc=; b=bF1ntePu6oC3D8 vC3Vky2zbrVuxyImd2puRPXJreBVkK9W482u67Wed98ipdiG9aV57Rn5spiu+tWVaDEe6UJstOu45 /TahzJgqWzZkk9ETVwI6/es6KAbqE7fR5c/DHmYKJJhuMiKlCaGSSox19fV2c0KdGrxGivwN39Yv+ rhr/OgCIdlXnHZSwlDsDASyAqJMBvFifBYAIUqfaLYasjSVZN/o8kMTkC/C1rVxB+O6MD5wsvjotf T6uEUxvNWjGttpKqfr5nYcTympBGMWU3XEKv5ZIlKJb3Sf51gt4sKEy5AyvCMIAfMsPW23KUQQFul iHUCY7GQAr0TfQumT45w==; 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 1gvWed-0001KG-PM; Mon, 18 Feb 2019 00:19:27 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gvWeW-0001AS-VV for linux-arm-kernel@lists.infradead.org; Mon, 18 Feb 2019 00:19:23 +0000 Received: by mail-pg1-x543.google.com with SMTP id q206so7527850pgq.4 for ; Sun, 17 Feb 2019 16:19:20 -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:mime-version :content-transfer-encoding; bh=KbRr2RYMR54b7AhSan9xsBEduDl7IIBORSvu485az7g=; b=k5bIBUI5CFOxVPWatAXvBfSEsDsHuEBJNQEx2EXO53ONtwXca5aNp0R6O3lnwRrknC 87o7BFl8F89mybGy7xdYmdVuLJm/G6NgL1Sm/qL2lwZRNv6peuZ42pdMTBcxE7E6U44S XP5vIkRqVYH0eXy3Eagp97c9ZQScYdw9iaFrExKu00llQWisNimIlFxPV45qlILovM/V Y5/DRAlvMRMQS34ha//lHWpRsAZshvx0PSLa3kisSyuSthB8rOAol4gGyXRYxTw5pT0f Ng+FK1t1RvnffCy3AqE6nMc//YLZJleIL9gjlaJXvPNq1d2o3im7VJ4mgCg+nzKYszTG 4b7A== 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:mime-version :content-transfer-encoding; bh=KbRr2RYMR54b7AhSan9xsBEduDl7IIBORSvu485az7g=; b=eBGd7kBMD7CAoGROQ4sQ8rZ3TqGG1NcNtNucd5d54605GxKdm8U1ceeje6VqErxgkt J4ogF5zXyAdQdQUC1hAie3mM0e0FOezskVp160Ls03XIU0FsRp4o7PjUZt79ljXHV2tT LXr+WoXnSz74Jl+KL/c5VsKu0GZOpG7vAbP8rxKxa37XYQzkukiNgjeGfvYnYSJ//Q9p pD+9WAi5OmcIQ5XIrefxAKP1ZAiTOF83vemTkhGkGFZdl+da8WT/F5NgmiG80sFKVZkw +3OECawJVt3ApftJNY3UJH/xawb47l3N0aZrJjecmG+SFPrVTWxeFvAZ9VF8tIhwc2CC aqaw== X-Gm-Message-State: AHQUAuYBZgFL2iSmWbCVi1EOPFnJnF2y+hQ/qlKJlo7auIF/P4AVW9KK 62vBdZvZlK7tEhmLVySl7wI= X-Google-Smtp-Source: AHgI3IZjeEEDkocnHoB3ynLb3cTG5WtWPet77NkvY7hg3MhJUltqkvEt+kKOQI6amQQRIozvQWGmcg== X-Received: by 2002:a62:ea09:: with SMTP id t9mr22353524pfh.228.1550449159620; Sun, 17 Feb 2019 16:19:19 -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 s73sm31518071pfi.124.2019.02.17.16.19.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Feb 2019 16:19:18 -0800 (PST) From: Dmitry Osipenko To: Russell King , Thierry Reding , Jonathan Hunter , Robert Yang , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v4 0/8] Support Trusted Foundations firmware on Tegra30 Date: Mon, 18 Feb 2019 03:17:18 +0300 Message-Id: <20190218001726.16785-1-digetx@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190217_161921_507689_F8E9BF65 X-CRM114-Status: GOOD ( 13.48 ) 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 Hello, This patchset adds support for the Trusted Foundations firmware on NVIDIA Tegra30. Pretty much all of Tegra30 consumer devices have that firmware and upstream kernel can't boot on those devices without the firmware support. Changelog: v4: - Fixed Thumb2-kernel hanging on Tegra20, turned out it was not a good idea to switch CPU into Thumb2 mode right after jumping into the reset handler. - Moved LP2-mode-set firmware call invocation to a later stage to better replicate what downstream kernel does. This change was suggested by Robert Yang and fixes system hang on Ouya game console. - Added references to the original work made by Michał Mirosław into commit messages of the relevant patches. v3: - Implemented suspend-resume support. - Reworked arm/firmware/trusted_foundations.c a tad. Now cache is getting properly initialized, cache enabling / disabling is supported. v2: - The "Don't apply CPU erratas in insecure mode" patch got some cleanup, in particular resolved the messiness in __tegra_cpu_reset_handler_data. - Added a comment to tf_cache_write_sec(), justifying the warning message. Dmitry Osipenko (8): ARM: trusted_foundations: Implement L2 cache initialization callback ARM: trusted_foundations: Make prepare_idle call to take mode argument ARM: trusted_foundations: Provide information about whether firmware is registered ARM: tegra: Set up L2 cache using Trusted Foundations firmware ARM: tegra: Don't apply CPU erratas in insecure mode ARM: tegra: Always boot CPU in ARM-mode ARM: tegra: Support L2 cache maintenance done via firmware ARM: tegra: Add firmware calls required for suspend-resume arch/arm/firmware/trusted_foundations.c | 80 +++++++++++++++++++++- arch/arm/include/asm/firmware.h | 2 +- arch/arm/include/asm/trusted_foundations.h | 13 ++++ arch/arm/mach-tegra/cpuidle-tegra114.c | 3 +- arch/arm/mach-tegra/pm.c | 50 ++++++++++++++ arch/arm/mach-tegra/reset-handler.S | 52 ++++++++++---- arch/arm/mach-tegra/reset.c | 3 + arch/arm/mach-tegra/reset.h | 9 ++- arch/arm/mach-tegra/sleep-tegra20.S | 4 ++ arch/arm/mach-tegra/sleep.S | 11 +-- arch/arm/mach-tegra/tegra.c | 10 +++ 11 files changed, 214 insertions(+), 23 deletions(-)