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=duqNLC4G; spf=pass (domain: linaro.org, ip: 209.85.221.65, mailfrom: ard.biesheuvel@linaro.org) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by groups.io with SMTP; Wed, 29 May 2019 05:50:31 -0700 Received: by mail-wr1-f65.google.com with SMTP id h1so1705343wro.4 for ; Wed, 29 May 2019 05:50:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QJdgm3x7L/ZO5ckOx10BApwt5v1RapcddnDcCchMe38=; b=duqNLC4GUDNmzspuDbbzSxU3iRf4Jawz3ASqVoDN3bruTNf0KfXb/Qxm6h0gUOIYx9 m5l+87TFeT9nSpa8L0Q9rGZT5HcaIR6Vj7ToZt2FJ5tP+M1KvaJ06iu5Gj2uxiBWZo3k nOBFF+QqTdJ6RgIUyCIDAo/onJPPALbJG7fYVXSF55pCpPeHKYEhFtJVwRBihGEw+1Xx I9VpsFWzzSjsOdxSxB/tVsklMMI80M4LqhhRLH1d4x8z1TYbTw6l0AotkINbTX/e1yqh pzTClux7hT2+rrQMSf2OTrvC7oEZXJVEBUAYc3CygV9ciygBS9bDdYz8Id5OMRZRU6gN GXrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QJdgm3x7L/ZO5ckOx10BApwt5v1RapcddnDcCchMe38=; b=g7npBv8puINksI829yjo10VisSQYuhFr7a4fcGBcDLSo9nn2W4meL9r4CzyTvpbN4u bhxyUAFOJtj39pSbmV8JgXfoEhu9knzh3IjbRWs0U7YntPiUZgy4JSuJUnjjFFbXGvJ+ kA2zUI8kh3uboFw8esU9bpzVWqkDDPjjVLF5iCSDOmNgM92RLo4PMCgkXRguJyQHgcKF JcirwT6lRR85IBwkz8bB6xfF03wI8uRWLIM6L+uEPuOsWiFwwk0lQhyXAF9GAYtLFZG1 TA0k6RQngxA08MCQThL7LBo8vv4+Za+a1sv47+9pKmQwJw3RlHPgacDIr+giU1gPO6ey qOrg== X-Gm-Message-State: APjAAAUDM4AG0AO3/b//2KqRH2JtBipyMYpZcx5iSN48GGB+bWW2CVY5 Eqwjk+hbEw8bydveCReI1sMy0CN3Zol3Lg== X-Google-Smtp-Source: APXvYqwHoKxefZ1/t6Lt7KGJf8YksS6ZABu9eKErxG7VytbCnEDAcuDdXv1vT+52XJbSm2ytz8meuQ== X-Received: by 2002:adf:9c0a:: with SMTP id f10mr13138052wrc.248.1559134229218; Wed, 29 May 2019 05:50:29 -0700 (PDT) Return-Path: Received: from sudo.home ([2a01:cb1d:112:6f00:c225:e9ff:fe2e:ea8]) by smtp.gmail.com with ESMTPSA id l18sm18112608wrv.38.2019.05.29.05.50.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 May 2019 05:50:28 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: leif.lindholm@linaro.org, masahisa.kojima@linaro.org, Ard Biesheuvel Subject: [PATCH edk2-platforms 3/5] Platform/Secure96Dxe: redefine LS connector CS as platform property Date: Wed, 29 May 2019 14:50:19 +0200 Message-Id: <20190529125021.28308-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190529125021.28308-1-ard.biesheuvel@linaro.org> References: <20190529125021.28308-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 + #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