From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24C0EC433E6 for ; Thu, 11 Mar 2021 20:10:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B704264F8D for ; Thu, 11 Mar 2021 20:10:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230286AbhCKUJu (ORCPT ); Thu, 11 Mar 2021 15:09:50 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:41985 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbhCKUJq (ORCPT ); Thu, 11 Mar 2021 15:09:46 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4DxKmR5bXsz1qs38; Thu, 11 Mar 2021 21:09:43 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4DxKmR3gKNz1qr4s; Thu, 11 Mar 2021 21:09:43 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id xdvMXdWRZ0pI; Thu, 11 Mar 2021 21:09:41 +0100 (CET) X-Auth-Info: 4h4LNEsJBJd7/MPZriIKyOYb+MfyZ+tSGG76SXiY4q8= Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 11 Mar 2021 21:09:41 +0100 (CET) Subject: Re: [Linux-stm32] [PATCH v2 00/14] Introduce STM32MP1 RCC in secured mode To: Alexandre TORGUE , Ahmad Fatoum , Alexandre TORGUE , "Alex G." , Gabriel FERNANDEZ - foss , Michael Turquette , Stephen Boyd , Rob Herring , Maxime Coquelin , Philipp Zabel , Etienne CARRIERE Cc: "devicetree@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-clk@vger.kernel.org" References: <20210126090120.19900-1-gabriel.fernandez@foss.st.com> <2e04f814-b694-119d-fe8a-13e6df129536@gmail.com> <463dafed-ec60-cd9a-33d2-ba118a6af629@foss.st.com> From: Marek Vasut Message-ID: <58d107c4-eb3d-e49a-8377-007b6f21baf4@denx.de> Date: Thu, 11 Mar 2021 21:09:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/11/21 7:10 PM, Alexandre TORGUE wrote: > Hi Guys > > On 3/11/21 5:11 PM, Marek Vasut wrote: >> On 3/11/21 3:41 PM, Ahmad Fatoum wrote: >>> Hello, >> >> Hi, >> >>> On 11.03.21 15:02, Alexandre TORGUE wrote: >>>> On 3/11/21 12:43 PM, Marek Vasut wrote: >>>>> On 3/11/21 9:08 AM, Alexandre TORGUE wrote: >>>>>> 1- Break the current ABI: as soon as those patches are merged, >>>>>> stm32mp157c-dk2.dtb will impose to use >>>>>> A tf-a for scmi clocks. For people using u-boot spl, the will have >>>>>> to create their own "no-secure" devicetree. >>>>> >>>>> NAK, this breaks existing boards and existing setups, e.g. DK2 that >>>>> does not use ATF. >>>>> >>>>>> 2-As you suggest, create a new "secure" dtb per boards (Not my >>>>>> wish for maintenance perspectives). >>>>> >>>>> I agree with Alex (G) that the "secure" option should be opt-in. >>>>> That way existing setups remain working and no extra requirements >>>>> are imposed on MP1 users. Esp. since as far as I understand this, >>>>> the "secure" part isn't really about security, but rather about >>>>> moving clock configuration from Linux to some firmware blob. >>>>> >>>>>> 3- Keep kernel device tree as they are and applied this secure >>>>>> layer (scmi clocks phandle) thanks to dtbo in >>>>>> U-boot. >>>>> >>>>> Is this really better than >>>>> #include "stm32mp15xx-enable-secure-stuff.dtsi" >>>>> in a board DT ? Because that is how I imagine the opt-in "secure" >>>>> option could work. >>>>> >>>> >>>> Discussing with Patrick about u-boot, we could use dtbo application >>>> thanks to extlinux.conf. BUT it it will not prevent other case (i.e. >>>> TF-A which jump directly in kernel@). So the "least worst" solution >>>> is to create a new "stm32mp1257c-scmi-dk2 board which will overload >>>> clock entries with a scmi phandle (as proposed by Alex). >>> >>> I raised this issue before with your colleagues. I still believe the >>> correct way >>> would be for the TF-A to pass down either a device tree or an overlay >>> with the >>> actual settings in use, e.g.: >>> >>>    - Clocks/Resets done via SCMI >>>    - Reserved memory regions >>> >>> If TF-A directly boots Linux, it can apply the overlay itself, >>> otherwise it's >>> passed down to SSBL that applies it before booting Linux. >> >> That sounds good and it is something e.g. R-Car already does, it >> merges DT fragment from prior stages at U-Boot level and then passes >> the result to Linux. >> >> So on ST hardware, the same could very well happen and it would work >> for both non-ATF / ATF / ATF+TEE options. > > Even this solution sounds good but we are currently not able to do it in > our TF-A/u-boot so not feasible for the moment. Why not ? U-Boot is perfectly capable of merging prior stage DT and DT loaded from elsewhere. See R-Car3 for example. > So we have to find a > solution for now. Create a new dtb can be this solution. Our internal > strategy is to use scmi on our official ST board. It will be a really > drawback to include a "no-scmi.dtsi" in DH boards (for example) and to > create a stm32mp157c-noscmi-dk2.dts ? I would highly prefer the SCMI to be opt-in, not opt-out. But still, isn't it possible to auto-detect the board configuration in Linux and pick the clock enumeration based on that automatically ?