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 6AEF1ECAAD8 for ; Fri, 16 Sep 2022 20:18:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EDF02849AB; Fri, 16 Sep 2022 22:18:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="EjQO6HwU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 501EE84BB1; Fri, 16 Sep 2022 22:18:38 +0200 (CEST) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (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 C5A1E84991 for ; Fri, 16 Sep 2022 22:18:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ej1-x631.google.com with SMTP id dv25so51861076ejb.12 for ; Fri, 16 Sep 2022 13:18:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=SuZmbI9q2xzXvlDF/FqmrztbEt3UyGvfSn3my6AoAdg=; b=EjQO6HwUXa6MTkkje7XHG/BW11Zj7DFdGUef1J2Ez1sXBOHzPK3l4G2fP1ew8NzF7w 3QBWuAfJM5ODvsTafI7vjFES+XbxSqo2pRWIYtiw6D/BYX+PnMAfcoJBRUpb6Jp9vUy6 FUbil8+cgMqzhR7qwvjAy+IsovYWfH2nIT+/yUiKNj2KaQnXLKQSaBIrklw9Im8uXZSB IkMdhS+P9h/J0sLZlMg3fPXQIk6FtZ4A8x+N6G6JEGUYlaYnzXCJd3djsfFlRiXCxvFt KIeenHZGLPd1a98+V9XABwA9CBNbe/NcDPRr8DDeTxIspj4s81ZhkQNu0+mXtJF0h6E/ ZuNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=SuZmbI9q2xzXvlDF/FqmrztbEt3UyGvfSn3my6AoAdg=; b=d78I02JgPZqwEpVHgcY7Ugwt69K888h2oZsV7goi6ZibGaKALUsBDhNjx+AytlLPue VxhaS+O1KfbRoHoSCKhB/n2LxuV8nDREt0/+IKpEfyL7MaMbxNqESwYGZIAKFALvut9S xHOjfcXIj6TLCoSlbzHRqf4zn4mJDNXfx6zvt7V5zBKqGbEZZoFMlzZIxxZyi4bfddhi YhfPJmAC1jEBOyb5AAS3pplq+zQ8fz+GMs3gh9AtzalUVK37nM3dyt0qEbzYbjXC1D4n MGDKkA5IZZ02e54BHiFlBWopP8rBxN8oc1FlunOJ1D09PPibujgNYfubkD3xqRhGlitM dEBQ== X-Gm-Message-State: ACrzQf0owniABBgFl6U6IiEQKYOmEnMOEBAsEBj5ZS6jZZONl1H+6tn/ qjB1Vlt1L+6DlXkZiQuw9SSBrQ== X-Google-Smtp-Source: AMsMyM7KvkrIrw9nOIsebb5+s3JdoHnrb5e0fKfvfpxDWwBNU7j0KwFao9YLnXKnyLMVBh/54z9ONQ== X-Received: by 2002:a17:907:2672:b0:734:a952:439a with SMTP id ci18-20020a170907267200b00734a952439amr4506962ejc.539.1663359515361; Fri, 16 Sep 2022 13:18:35 -0700 (PDT) Received: from hera ([46.103.15.185]) by smtp.gmail.com with ESMTPSA id 17-20020a170906329100b007742cf42836sm10978112ejw.144.2022.09.16.13.18.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 13:18:34 -0700 (PDT) Date: Fri, 16 Sep 2022 23:18:32 +0300 From: Ilias Apalodimas To: Simon Glass Cc: U-Boot Mailing List , Etienne Carriere , Jens Wiklander , Patrick Delaunay Subject: Re: [PATCH v4] tee: optee: rework TA bus scanning code Message-ID: References: <20220906093703.35658-1-ilias.apalodimas@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Simon, > > > > > > > > > > > > Late versions of OP-TEE support a pseudo bus. TAs that behave as > > > > > > hardware blocks (e.g TPM, RNG etc) present themselves on a bus which we can > > > > > > scan. Unfortunately U-Boot doesn't support that yet. It's worth noting > > > > > > that we already have a workaround for RNG. The details are in > > > > > > commit 70812bb83da6 ("tee: optee: bind rng optee driver") > > > > > > > > > > > > So let's add a list of devices based on U-Boot Kconfig options that we will > > > > > > scan until we properly implement the tee-bus functionality. > > > > > > > > > > > > While at it change the behaviour of the tee core itself wrt to device > > > > > > binding. If some device binding fails, print a warning instead of > > > > > > disabling OP-TEE. > > > > > > > > > > > > Signed-off-by: Ilias Apalodimas > > > > > > Reviewed-by: Jens Wiklander > > > > > > Reviewed-by: Etienne Carriere > > > > > > --- > > > > > > Changes since v3: > > > > > > - Use NULL instead of a child ptr on device_bind_driver(), since it's not > > > > > > really needed > > > > > > - Changed the style of the optee_bus_probe[] definition to > > > > > > {.drv_name = xxx, .dev_name = yyy } > > > > > > > > > > > > Changes since v2: > > > > > > - Fixed typo on driver name ftpm-tee -> ftpm_tee > > > > > > > > > > > > Changes since v1: > > > > > > - remove a macro and use ARRAY_SIZE directly > > > > > > drivers/tee/optee/core.c | 24 +++++++++++++++++++----- > > > > > > 1 file changed, 19 insertions(+), 5 deletions(-) > > > > > > [...] > > > > Some things *are* working without a DT entry. You had similar > > concerns on FF-A (where you requested a DT node again) and people gave > > the exact same response. As long as a bus is scanable in any way, > > it's preferable to than adding a DT entry. Moreover this code does > > not prevent anyone from adding a DT entry. > > > > To make things even worse if the TA is compiled as 'scanable' and has > > a DT entry, it might cause issues down the road when being probed by > > the kernel. So really this is just a patch that makes u-boot behave > > and plug in properly to the rest of the ecosystem > > Calling device_bind() is supposed to be used in extremis. I don't see > any scanning of an OP-TEE bus here. I just see it binding two child > devices which are hard-coded in U-Boot. What am I missing? The commit description describes the current state of U-Boot > > This appears to be a Linaro binding, so you should be able to update > it easily enough. Linaro binding? The DT is governed by a spec, we commit everything upstream there. OTOH I still don't see what we need to put in there. As we discussed this is a bus that can be used to scan devices. Thanks /Ilias > > Regards, > Simon