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 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5AEADC54EED for ; Tue, 24 Jan 2023 22:45:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 98D7E856CB; Tue, 24 Jan 2023 23:45:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="LM+CPNZy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8BBDB85670; Tue, 24 Jan 2023 23:45:19 +0100 (CET) Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 74F1D85695 for ; Tue, 24 Jan 2023 23:45:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-ej1-x62c.google.com with SMTP id vw16so43030301ejc.12 for ; Tue, 24 Jan 2023 14:45:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2OOJFqAfihB96FL8nSRpNIz9YCFnjrTcTH/3ZOC8tVc=; b=LM+CPNZyFnjcXR056PNN3b44B2Z17K2kMD5dXCJoAHpPir3GYQ0FpZbiLmkHvvG33k 21jfmZXq6AFCOc/aX5RL2m9enRR3h0w0szIGwu7tEyekKOsu/eTIZUgY4CDlQL442W2w 2DHaMUfpGkBRLB0smMhV6pPWEZggwryqBic0w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2OOJFqAfihB96FL8nSRpNIz9YCFnjrTcTH/3ZOC8tVc=; b=IBkOqTncK4zMfq/FlegTF8DbKD5Q0Yry1+ESfpDJM9Ll0lepAMzywEcRa6ne9B2CyP gJSZmF9LGJzzWc1APjU6ZBnlPq4EPzkrV+1ZXUVBo8Fc7m7ZXI+aijNDtQIm3tW/pOli EeH/7pTbQ/9f7TZjbqlWuxOPPUH82naawkdyHMaoMO3HTfCiXAl3SxUr7xuaV1EhdCjR ZgTX+pI/vhd5XQX9zgrpZnjYXT05cXbH/jo6UY96jqFi8UhN1UdjpOubPtDLZ8tYv9X9 2PzX6cUJc8vAt4HLSoMY0dYRG77haXQ6hvXALxHZFISFCAbI27jjADz+Kg4Nb83FW39B Jtyw== X-Gm-Message-State: AFqh2ko3uVgHTqWX98pkVxpisIqipf450F3XrSQ9i72bpUsroLRDqId2 tSIkM6Pbf99xAmRPHxGiaty38Sr6f7PDgJtJZuqK3A== X-Google-Smtp-Source: AMrXdXvDHZjZWVdbSiOcvsOm2tfmd5fzu0PhbOHuAbc2Gm0IR77/yrhhQruEYdSqXt3flIiOhFu0XYc5s27SF5fMYWs= X-Received: by 2002:a17:906:abcd:b0:86e:55f5:4c2d with SMTP id kq13-20020a170906abcd00b0086e55f54c2dmr3475190ejb.172.1674600315663; Tue, 24 Jan 2023 14:45:15 -0800 (PST) MIME-Version: 1.0 References: <20230118124923.GB631605@bill-the-cat> <20230118135932.GC631605@bill-the-cat> <20230119163157.GA18384@e121910.cambridge.arm.com> <20230124155619.GA31552@e121910.cambridge.arm.com> In-Reply-To: <20230124155619.GA31552@e121910.cambridge.arm.com> From: Simon Glass Date: Tue, 24 Jan 2023 15:44:31 -0700 Message-ID: Subject: Re: [PATCH v8 03/10] arm_ffa: introduce Arm FF-A low-level driver To: Abdellatif El Khlifi Cc: Rob Herring , trini@konsulko.com, achin.gupta@arm.com, xueliang.zhong@arm.com, Drew.Reed@arm.com, sudeep.holla@arm.com, jens.wiklander@linaro.org, ilias.apalodimas@linaro.org, nd@arm.com, u-boot@lists.denx.de Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Hi Abdellatif, On Tue, 24 Jan 2023 at 08:56, Abdellatif El Khlifi wrote: > > On Mon, Jan 23, 2023 at 09:32:28AM -0700, Simon Glass wrote: > > Hi Rob, > > > > On Mon, 23 Jan 2023 at 08:13, Rob Herring wrote: > > > > > > On Fri, Jan 20, 2023 at 4:04 PM Simon Glass wrote: > > > > > > > > Hi Rob, > > > > > > > > On Thu, 19 Jan 2023 at 11:11, Rob Herring wrote: > > > > > > > > > > On Thu, Jan 19, 2023 at 10:41 AM Simon Glass wrote: > > > > > > > > > > > > Hi Abdellatif, > > > > > > > > > > > > On Thu, 19 Jan 2023 at 09:32, Abdellatif El Khlifi > > > > > > wrote: > > > > > > > > > > > > > > On Wed, Jan 18, 2023 at 08:59:32AM -0500, Tom Rini wrote: > > > > > > > > On Wed, Jan 18, 2023 at 01:46:54PM +0000, Sudeep Holla wrote: > > > > > > > > > On Wed, Jan 18, 2023 at 12:49 PM Tom Rini wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I guess the problem comes down to, can we have one discovery method that > > > > > > > > > > everyone shares, or do we have to let everyone invent a new discovery > > > > > > > > > > method every time? > > > > > > > > > > > > > > > > > > > > > > > > > > > No one needs to invent any discovery method every time if the firmware > > > > > > > > > specification > > > > > > > > > provides one and as Rob mentioned many times in the thread, all new firmware > > > > > > > > > specification must provide one and we are trying to make sure that is > > > > > > > > > the case with all new > > > > > > > > > specs from Arm. > > > > > > > > > > > > > > > > > > > > > > > > > > > > FF-A, Op-tee, U-Boot, coreboot, barebox (and > > > > > > > > > > everyone else I'm unintentionally forgetting) could just discover these > > > > > > > > > > things via device tree. > > > > > > > > > > > > > > > > > > > > > > > > > > > I leave that to the individual projects to decide and agree but > > > > > > > > > fundamentally if > > > > > > > > > the specification provides a way to discover, not sure why we are even > > > > > > > > > discussing > > > > > > > > > an alternative method here. > > > > > > > > > > > > > > > > > > > > > > > > > > > > Or, we could all write our own code to perform > > > > > > > > > > the discovery. > > > > > > > > > > > > > > > > > > > > > > > > > > > For what reason ? I can understand if there is no discovery mechanism but > > > > > > > > > that's not the > > > > > > > > > case in $subject. > > > > > > > > > > > > > > > > > > > > > > > > > > > > And when RISC-V comes along with similar functionality, > > > > > > > > > > we could probe their device tree and see they've implemented the same > > > > > > > > > > concept, but a little differently, but still have the discovery portion > > > > > > > > > > be in the device tree. To which it sounds like your answer is "not in > > > > > > > > > > the device tree". > > > > > > > > > > > > > > > > > > > > > > > > > > > > I see U-boot seem to have made a decision to create DT node for each and > > > > > > > > > everything > > > > > > > > > that needs to be added to DM which seems bit unfortunate but I don't > > > > > > > > > understand the > > > > > > > > > history/motive/background for it but I respect the decision if it is > > > > > > > > > already made. > > > > > > > > > > > > > > > > > > These firmware interfaces are standard on all Arm platforms and can be > > > > > > > > > discovered > > > > > > > > > based on PSCI/SMCCC. Not using the same and use DT node needs unnecessary > > > > > > > > > addition of DT nodes for all the f/w i/f on all the platforms that need the > > > > > > > > > support when > > > > > > > > > one can be just discovered. > > > > > > > > > > > > > > > > > > Sorry for the sudden appearance on this thread, I was avoiding getting into > > > > > > > > > this but thought > > > > > > > > > I will at least express my opinion and also the way the firmware > > > > > > > > > specifications from Arm is > > > > > > > > > expected to be evolved from now on. With that I will leave it to you and > > > > > > > > > other U-boot > > > > > > > > > maintainers and the community in general to decide the right course in this > > > > > > > > > case. > > > > > > > > > > > > > > > > To be clear, if the position is that "this is what everyone else will > > > > > > > > use, really" then yes, we'll follow this in U-Boot. > > > > > > > > > > > > > > Hi Simon, Tom, > > > > > > > > > > > > > > The FF-A transport is a SW bus and is not associated to any HW peripheral or > > > > > > > undiscoverable base address. > > > > > > > > > > > > > > There is only 1 way of discovering the FF-A bus and it's through the FF-A SW > > > > > > > interfaces. The FF-A spec [1] describes this in details. > > > > > > > > > > > > Can you add a DT node for the 'FF-A SW interfaces' and attach some > > > > > > sort of top-level driver to that? Perhaps simple-bus, or your own > > > > > > thing? You don't need to add compatible strings for subnodes (devices > > > > > > that are discoverable within that). > > > > > > > > > > We already have that. It's just called 'arm,psci'. FF-A is not the > > > > > top-level thing. SMCCC is. That's unfortunately called PSCI in DT > > > > > because SMCCC grew out of PSCI. Evolution is ugly... > > > > > > > > > > It's like this: > > > > > > > > > > SMCCC > > > > > +--PSCI > > > > > +--TRNG > > > > > +--FF-A > > > > > +--SCMI (sometimes) > > > > > +--OP-TEE > > > > > +--...Whatever Arm comes up with next... > > > > > > > > OK well that sounds OK. > > > > > > > > So what is the problem here? We have an SMCCC top-level thing in the > > > > DT and everything else can be bound from that, right? Are people on > > > > this thread not aware of this...or am I still missing something? > > > > > > > > Can you point to the SMCCC driver in U-Boot? Is this > > > > bind_smccc_features(), i.w.c. it looks like it does what I want...why > > > > does this thread exist? > > > > > > I imagine the u-boot structure for all this has evolved like the > > > bindings where each feature was developed independently. From my brief > > > look at it, initialization of all the above features would need to be > > > reworked to work as described. > > > > OK, then perhaps this is making more sense to me now. > > > > Abdellatif, can you please look at the above? We should have one > > top-level node in the DT and have that driver bind the child devices. > > > > Regards, > > Simon > > Hi Simon, Rob, > > I'd like to suggest the creation of a root node called arm_smccc as shown below. > > This node is the parent of all nodes using SMC calls like FF-A, PSCI, optee, ... > > The first child to be integrated in the arm_smccc root node is FF-A. Hopefully, in the future the other features such as PSCI could be integrated under arm_smccc as well. > > Th root node looks like this: > > firmware { > arm_smccc { > > compatible = "arm,smccc-1.2"; > > arm_ffa { > compatible = "arm,ffa"; > method = "smc"; > }; > > psci { > compatible = "arm,psci"; > method = "smc"; > }; > > optee { > compatible = "linaro,optee-tz"; > method = "smc"; > }; > > }; > }; > > What do you think guys ? LGTM, thanks. Regards, Simon