From patchwork Fri Feb 22 19:34:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 10826851 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 4F30D1575 for ; Fri, 22 Feb 2019 19:35:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D5CD32985 for ; Fri, 22 Feb 2019 19:35:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 315FA32BE3; Fri, 22 Feb 2019 19:35:36 +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 C2A1832985 for ; Fri, 22 Feb 2019 19:35:35 +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=WmL4cJ0gQLQY7vGKBvvIgV51+XLtCMiL7UM0XklR1Tw=; b=P3nEWXCzP44mK8 tdipV0+s1h5M51cMw2jRSlAruLw+s3N4m7N85YGHNXkFvEN2rEKbg5qXQMDzuDbRpCaDu887+4PST mb0HvCJ0KlmAQmPiQLbgjLi+lZKU8gXzT7MCBRNjMRrEhfGC9kLL7UqanfUPyKid/iIHXdUqZSEfG A1lCrZdTt/12RQI3WBVs0XKdUZltpwt7zIGc2BzcemMcMieLqNVIdkts4Fq7uT+pDG7WxH0DP3kec /rPNNpFDdoJ5K2ttg+FEj8OpU9BGJWFFcV5pgck4dtQ2RnjzRoEL4e1Upl2SCJtbILRuSbvA6NIJF y8Hpa3to/qqSpdWIea+g==; 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 1gxGbd-0003Mb-Vv; Fri, 22 Feb 2019 19:35:33 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gxGba-0003M4-Sq for linux-arm-kernel@lists.infradead.org; Fri, 22 Feb 2019 19:35:32 +0000 Received: by mail-pf1-x441.google.com with SMTP id q17so1533300pfh.10 for ; Fri, 22 Feb 2019 11:35:30 -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=kQL1EEwK6NnKOtdqQG3M+wi9O2P4+a93b/SQspi5YpM=; b=vT16gM5ZTxafYJKSY/CZLt9eDn/xKofhq9tFBjdOdBmOFMldCGELC551mfl64cIPIK AeOcAGDVWLHbh8rp4kuxI9i/aGpn4NtTgWOvHA+/Kwbun7f6sdbiMqL5oOHkh7Cn2wMZ r/dmhxykwAlqLpa2MYfSPnSpoR3VnX1i/HTeaf/49P8MkJyhCGdYb/fkY8yfIetbwtRQ 6/XnJ1KGaOmOSImLOfIBCZCDFYmZAhkmeS76Ngjm4wTAwSbpsP79ONvsApJkHaJnUUjB 5FFluIOg3noIgJmmuBbjZnwanibpwa7YhIoOOYS7ia3kx+nX0y6CJJRzp4xh84mhv4XR oByQ== 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=kQL1EEwK6NnKOtdqQG3M+wi9O2P4+a93b/SQspi5YpM=; b=LbFpecs1qz44Ph06hZwGiWJXqpH6P+Zw+fK4vmEb7LJDON8XbQcYfD/Rr8wvTjta94 VvC/NKcjnaHNevR4VMMwwQ6RiiIgWP2yko/5z421/9ABR2cOeW/kIQ59d1T9H3zPfA4z 5Dw8XonZjOZnG/Ts42g9cNCYY2+QwNkRzX0HFAOnrquXgPIABCzM6xlr1owOo5X4NvJZ DgfFqD5V7JICrJP4QinsAz8XGHYuitZv62HzlOdaw+hVWxX0BwRs4LrvVTsCN0K/ins0 rwlypiZbNAaXiM/ETSqsRSlirXFkRzdfw3xF+zRWZltbqN5/LHWAOw41irosgF3mvJQ9 O5Ww== X-Gm-Message-State: AHQUAub5NGA2dVoY8Hq281HvakOa6W5x298ithF84phk7mNdLlP9f5pD 91at00uPitgRu+kVAbTSQIA= X-Google-Smtp-Source: AHgI3IZk1RyZfWQsi57vD/JQ+++CuTk7M8IdMsDCyG7m7fXk7Z4QFTqvrTr09JY1LNM7ATZ+jrjStA== X-Received: by 2002:aa7:9090:: with SMTP id i16mr5683573pfa.85.1550864129743; Fri, 22 Feb 2019 11:35:29 -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 e21sm7687190pfh.45.2019.02.22.11.35.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Feb 2019 11:35:29 -0800 (PST) From: Dmitry Osipenko To: Russell King , Thierry Reding , Jonathan Hunter , Robert Yang , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v6 0/7] Support Trusted Foundations firmware on Tegra30 Date: Fri, 22 Feb 2019 22:34:19 +0300 Message-Id: <20190222193426.10747-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-20190222_113530_988544_C5147281 X-CRM114-Status: GOOD ( 15.12 ) 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: v6: - One patch got messed up accidentally in v5, this is fixed now. - Squashed "Support L2 cache maintenance done via firmware" patch into the "Add firmware calls..." patch. - The l2x0_init() firmware callback is now invoked unconditionally because it is always a NO-OP on T114+ and is a NO-OP on T20/30 if firmware node is missed in device-tree, hence there is no need to check the machine's DT compatible as it was done in the previous versions of the series. v5: - Fixed machine hanging on disabling D-cache during suspend, turned out there are slight variations in behaviour between firmware version in regards to cache-management. Thanks to Robert Yang for reporting the problem and helping with the solution. 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 (7): 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: Add firmware calls required for suspend-resume on Tegra30 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 | 49 +++++++++++++ arch/arm/mach-tegra/reset-handler.S | 50 +++++++++++--- 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 | 14 ++-- arch/arm/mach-tegra/tegra.c | 2 + 11 files changed, 207 insertions(+), 22 deletions(-)