From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=s7kZNhiS; spf=pass (domain: linaro.org, ip: 209.85.128.66, mailfrom: leif.lindholm@linaro.org) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by groups.io with SMTP; Wed, 29 May 2019 06:06:57 -0700 Received: by mail-wm1-f66.google.com with SMTP id e19so4276355wme.1 for ; Wed, 29 May 2019 06:06:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FdJUH6bE1oSAOfJrwuwZrQ7S4g+xoNq0Wr2yK/bQ1nw=; b=s7kZNhiSFLgokg6oDYqgvGxbPYobjZ0sJ+kPdYe+gNQu7bT4xL9ytD5Gk+Geih1bs6 TBO2oLREO5vA+Kb6O4G1Jx7uMyRE6lvYt6Svtt6AeVZCjCczgtCXw+i2tnh1Rd/GUe1D nnrJu9unUiE88r3qTXL7EplB+L/Az0nkgPqx/3JzallV8X4Wkhy1RGJYYGfARdhLfGPO X5nIhOAVV5hwMXtt5HfzYznVANFbAPq+jUCluSQtlZDqMEoJMeNgiZxsSrp4406S8Jzu Ox/ld58ZF8nUZrZMhXigDHEFDni8vI4k3+a4eoVywZlG8spv+NPftUpqw1SxE33kuDMI bzzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FdJUH6bE1oSAOfJrwuwZrQ7S4g+xoNq0Wr2yK/bQ1nw=; b=kYW5MXZHkWcHIp1VOplzdS4A3WCrF3j/zk3WJT1iQt/DyeI8tu21vzAEgxGqqpnHhw Vs+QCwtcea+GYKz3BQX67BY+WGhk1wj8vu4CzXxxRRblC/2Wh7m2qAUPFEQNcfbi23DP Dgzk/p6eIyEVaEMn/ID13YHe42E/XodzY7xpzTZKFcqqncmqnaH0K7pu2TFYmp+1Tyd2 2v+B3QBJiqabFReqV7Qk/Yeli8Gjoh+vStO5qnxyK8H/Agqa0tPioPB20t4z/UM58wbP zFdIkJujYX6eB8LjN/y30jVw891bzBgSThDhXQ2QAJ5ibbExwubqEWirhpzyx07bk3rq oSkw== X-Gm-Message-State: APjAAAXZRZ1En4bH4vov6tANw7ZIZHMPFo/pGkXLHMT7utoHNZMKaE46 NdPgfM7uEZ2jpXj1Qzcppi88+lU5m5k= X-Google-Smtp-Source: APXvYqxqfDLPJmdT2O3tgWVue/RJ27qgyY7py0QeNhfwz9EcrurBwymb5vPEin94OErZAFyiaNT6/Q== X-Received: by 2002:a1c:4e19:: with SMTP id g25mr6846674wmh.156.1559135214654; Wed, 29 May 2019 06:06:54 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id p13sm5983324wmb.23.2019.05.29.06.06.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 May 2019 06:06:53 -0700 (PDT) Date: Wed, 29 May 2019 14:06:52 +0100 From: "Leif Lindholm" To: devel@edk2.groups.io, ard.biesheuvel@linaro.org Cc: masahisa.kojima@linaro.org Subject: Re: [edk2-devel] [PATCH edk2-platforms 3/5] Platform/Secure96Dxe: redefine LS connector CS as platform property Message-ID: <20190529130652.pkfzeo5xbcotypaf@bivouac.eciton.net> References: <20190529125021.28308-1-ard.biesheuvel@linaro.org> <20190529125021.28308-4-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20190529125021.28308-4-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, May 29, 2019 at 02:50:19PM +0200, Ard Biesheuvel wrote: > As opposed to the Secure96's I2C peripherals, whose bus addresses are > properties of the peripherals themselves, the SPI CS address of the > TPM is a property of the platform that incorporates the LS connector. > > So tweak the macros that emit the CS values and related properties > to put it under the control of the platform that incorporates the > driver. > > Signed-off-by: Ard Biesheuvel > --- > Platform/96Boards/Secure96Dxe/Secure96.dts | 2 +- > Platform/96Boards/Secure96Dxe/Secure96.h | 11 ++++++++--- > 2 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/Platform/96Boards/Secure96Dxe/Secure96.dts b/Platform/96Boards/Secure96Dxe/Secure96.dts > index d066fcb1933c..0d7d9b3900a4 100644 > --- a/Platform/96Boards/Secure96Dxe/Secure96.dts > +++ b/Platform/96Boards/Secure96Dxe/Secure96.dts > @@ -39,7 +39,7 @@ > __overlay__ { > INFINEON_SLB9670_DT_NODENAME { > compatible = "infineon,slb9670"; > - reg = ; > + reg = ; > spi-max-frequency = <22500000>; > }; > }; > diff --git a/Platform/96Boards/Secure96Dxe/Secure96.h b/Platform/96Boards/Secure96Dxe/Secure96.h > index c34fc5eea046..1d8bf4159209 100644 > --- a/Platform/96Boards/Secure96Dxe/Secure96.h > +++ b/Platform/96Boards/Secure96Dxe/Secure96.h > @@ -1,6 +1,6 @@ > /** @file > > - Copyright (c) 2018, Linaro, Ltd. All rights reserved.
> + Copyright (c) 2018-2019, Linaro, Ltd. All rights reserved.
> > SPDX-License-Identifier: BSD-2-Clause-Patent > **/ > @@ -8,14 +8,19 @@ > #ifndef _SECURE96_H_ > #define _SECURE96_H_ > > +#define __CONCAT(a,b) a ## b > + Urgh. We badly need to properly add some official macros for this. You could possibly use __CONCATENATE from Base.h. For new macros, we really should avoid leading _. / Leif > #define ATSHA204A_SLAVE_ADDRESS 0x60 > #define ATSHA204A_DT_NODENAME atsha204a@60 > > #define ATECC508A_SLAVE_ADDRESS 0x51 > #define ATECC508A_DT_NODENAME atecc508a@51 > > -#define INFINEON_SLB9670_SPI_CS 0x0 > -#define INFINEON_SLB9670_DT_NODENAME tpm@0 > +#define INFINEON_SLB9670_DT_NODENAME __CONCAT(tpm@,SECURE96_SPI0_CS) > + > +#ifndef SECURE96_SPI0_CS > +#define SECURE96_SPI0_CS 0 > +#endif > > #ifndef SECURE96_ACPI_GPIO > #define SECURE96_ACPI_GPIO "\\_SB.GPIO" > -- > 2.20.1 > > > >