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 EBDF2C4332F for ; Mon, 19 Dec 2022 19:21:46 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 06FB58540B; Mon, 19 Dec 2022 20:21:42 +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="iGZcvXha"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 219F0853DD; Mon, 19 Dec 2022 20:21:40 +0100 (CET) Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) (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 13F2B83A08 for ; Mon, 19 Dec 2022 20:21:37 +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-yw1-x1136.google.com with SMTP id 00721157ae682-3b5d9050e48so140897607b3.2 for ; Mon, 19 Dec 2022 11:21:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=lZKPWZNpSbybRL+3hMXy+kPer/8FV841tqkPgCrTKu8=; b=iGZcvXhaqf1p9PCfHredyCrMUKkernjO2LEvZnKIZIen74r4aCayOE2tkEmyryN92j +NwZqjNnkEjZRMbxeHAD9gh5QmgJBpxbtdPQSjqL3GVWKgmOKTnSOkPUhbdhOzgBPIaa DZPkavAvafUGlCI6GKJRHWDzoAffkx3kcDKHE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=lZKPWZNpSbybRL+3hMXy+kPer/8FV841tqkPgCrTKu8=; b=5Ru9titbO7eEUTzMsYORLXUCpyL1HgsT2E91NTce3CC2eco8YoMyrjNrALATQ35a1L RYBR95w1gKvSw7xM9y3beKVwRnkzc0B23Ml0bM1p2V799I7MFnEO7XaoqOOzdchdPcfM GgDG6pe0WOCRxQ1cmAYxZ3htnF8YP8pOoxfOW1TS9D9564LbHbcZe3oe/4/rFwIj0l/R Rsibgfr1uAB2LHkXCm0KJZIo4iXj/LDHxZ70nlGTK86lI/Bpa0UEYjNhO9oZHEW5jNwb c3q3k/pvWmrmbiFy83xLYVJ8XNZrcFPq4mUhbqV5/LXSsUQR5J2mhPrPLjgmWb1wEHR9 fnPw== X-Gm-Message-State: AFqh2kp5PUEepiDaVRFpIJ1JFAZkGkhkWlsfknoD4NegG+QF8K7x69UE B+v2OkkEYaUlt970rHTtURybVSRTDEN5+L28FOElhQ== X-Google-Smtp-Source: AMrXdXt94aTpLT0zJAm/6FQUdaNL/zqq4dltq4DfIl0GK6E45kKwguoQh1u1Y+40D0/9ShQKa2frcNf/cpjhLD4EHuY= X-Received: by 2002:a05:690c:f:b0:370:22fc:82fd with SMTP id bc15-20020a05690c000f00b0037022fc82fdmr928028ywb.279.1671477695526; Mon, 19 Dec 2022 11:21:35 -0800 (PST) MIME-Version: 1.0 References: <20221107192055.21669-1-abdellatif.elkhlifi@arm.com> <20221122131751.22747-1-abdellatif.elkhlifi@arm.com> <20221122131751.22747-4-abdellatif.elkhlifi@arm.com> <20221124132115.GA393@e121910.cambridge.arm.com> <20221219111251.GA22370@e121910.cambridge.arm.com> In-Reply-To: <20221219111251.GA22370@e121910.cambridge.arm.com> From: Simon Glass Date: Mon, 19 Dec 2022 12:20:35 -0700 Message-ID: Subject: Re: [PATCH v8 03/10] arm_ffa: introduce Arm FF-A low-level driver To: Abdellatif El Khlifi Cc: ilias.apalodimas@linaro.org, jens.wiklander@linaro.org, robh@kernel.org, achin.gupta@arm.com, trini@konsulko.com, xueliang.zhong@arm.com, nd@arm.com, u-boot@lists.denx.de Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Mon, 19 Dec 2022 at 04:12, Abdellatif El Khlifi wrote: > > On Mon, Dec 05, 2022 at 09:49:30AM -0600, Rob Herring wrote: > > On Sun, Dec 4, 2022 at 1:22 PM Simon Glass wrote: > > > > > > Hi Rob, > > > > > > On Tue, 29 Nov 2022 at 05:22, Rob Herring wrote: > > > > > > > > On Fri, Nov 25, 2022 at 3:18 PM Simon Glass wrot= e: > > > > > > > > > > Hi Abdellatif, > > > > > > > > > > On Thu, 24 Nov 2022 at 06:21, Abdellatif El Khlifi wrote: > > > > > > > > > > > > On Tue, Nov 22, 2022 at 07:09:16PM -0700, Simon Glass wrote: > > > > > > > should be called 'priov' and should beHi Abdellatif, > > > > > > > > > > > > > > > > > [..] > > > > > > > > > > > > > +/** > > > > > > > > + * ffa_device_get - create, bind and probe the arm_ffa dev= ice > > > > > > > > + * @pdev: the address of a device pointer (to be filled wh= en the arm_ffa bus device is created > > > > > > > > + * successfully) > > > > > > > > + * > > > > > > > > + * This function makes sure the arm_ffa device is > > > > > > > > + * created, bound to this driver, probed and ready to use. > > > > > > > > + * Arm FF-A transport is implemented through a single U-Bo= ot > > > > > > > > + * device managing the FF-A bus (arm_ffa). > > > > > > > > + * > > > > > > > > + * Return: > > > > > > > > + * > > > > > > > > + * 0 on success. Otherwise, failure > > > > > > > > + */ > > > > > > > > +int ffa_device_get(struct udevice **pdev) > > > > > > > > +{ > > > > > > > > + int ret; > > > > > > > > + struct udevice *dev =3D NULL; > > > > > > > > + > > > > > > > > + ret =3D device_bind(dm_root(), DM_DRIVER_GET(arm_ff= a), FFA_DRV_NAME, NULL, ofnode_null(), > > > > > > > > + &dev); > > > > > > > > > > > > > > Please add a DT binding. Even if only temporary, we need some= thing for this. > > > > > > > > > > > > Thanks for the feedback. I'm happy to address all the comments. > > > > > > > > > > > > Regarding DT binding and FF-A discovery. We agreed with Linaro = and Rob Herring > > > > > > about the following: > > > > > > > > > > > > - DT is only for what we failed to make discoverable. For hardw= are, we're stuck > > > > > > with it. We shouldn't repeat that for software interfaces. Th= is approach is > > > > > > already applied in the FF-A kernel driver which comes with no= DT support and > > > > > > discovers the bus with bus_register() API [1]. > > > > > > > > > > This may be the UEFI view, but it is not how U-Boot works. This i= s not something we are 'stuck' with. It is how we define what is present on= a device. This is how the PCI bus works in U-Boot. It is best practice in = U-Boot to use the device tree to make this things visible and configurable.= Unlike with Linux there is no other way to provide configuration needed by= these devices. > > > > > > > > Where do you get UEFI out of this? > > > > > > I assume it was UEFI as there was no discussion about this in U-Boot. > > > Which firmware project was consulted about this? > > > > > > > > > > > It is the discoverability of hardware that is fixed (and we are stu= ck > > > > with). We can't change hardware. The disoverability may be PCI > > > > VID/PID, USB device descriptors, or nothing. We only use DT when th= ose > > > > are not sufficient. For a software interface, there is no reason to > > > > make them non-discoverable as the interface can be fixed (at least = for > > > > new things like FF-A). > > > > > > Here I am talking about the controller itself, the top-level node in > > > the device tree. For PCI this is a device tree node and it should be > > > the same here. So I am not saying that the devices on the bus need to > > > be in the device tree (that can be optional, but may be useful in som= e > > > situations where it is status and known). > > > > Sure, the PCI host bridges are not discoverable, have a bunch of > > resources, and do need to be in DT. The downstream devices only do if > > they have extra resources such as when a device is soldered down on a > > board rather than a standard slot. > > > > > We need something like: > > > > > > ff-a { > > > compatible =3D "something"; > > > }; > > > > > > I don't know what mechanism is actually used to communicate with it, > > > but that will be enough to get the top-level driver started. > > > > There's discovery of FF-A itself and then discovery of FF-A features > > (e.g. partitions). Both of those are discoverable without DT. The > > first is done by checking the SMCCC version, then checking for FF-A > > presence and features. Putting this into DT is redundant. Worse, what > > if they disagree? > > Hi Simon, > > Do you agree with Rob, Ilias and myself that it makes more sense > FF-A bus is discovered without a DT node and following the same approach = as > Linux ? (FF-A bus doesn't have a HW controller and is a purely SW bus, > no configuration/description needed at DT level). > > Your suggestions are always welcome. I'm sorry I don't agree with that. It does need a compatible string, like PCI has. You can just add it in U-Boot if Linux won't accept the binding. Rob, if you are here I think the U-Boot DM bindings seem to have stalled. What is needed to get these in? Regards, Simon