From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.groups.io with SMTP id smtpd.web11.15119.1621230692581213960 for ; Sun, 16 May 2021 22:51:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=jtOGw4GG; spf=pass (domain: linaro.org, ip: 209.85.221.45, mailfrom: etienne.carriere@linaro.org) Received: by mail-wr1-f45.google.com with SMTP id y14so2906457wrm.13 for ; Sun, 16 May 2021 22:51:32 -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; bh=SEikWwQ3LVjS5sw7tZhc6tdgtCNokHYK3drZX9W3Ckc=; b=jtOGw4GG7u8Zsz5KPRm8m15FMHrDjl9MPb7K9e514vZWFxHb1Hatrp33AslU5Pe8R3 YHGX+CnnN+elDQ8rxgJUDH75bnIH/11bZEumTCXDQwbsQAALlqrhbkV3/ZK14Jo2SSb/ 0Vm4PbXA3EJ1i59jaQUayp5oWNCSu6jaUbhA54Zs+cCJWSTfq7gICUpPxx8RMOnXJ3zz j/06WPIzbM0YPCi+UMr1KhLYkrA8EY4FT69f0PPV0PvfWkULuquHq3q6dgZRzPXpBEk0 vt9FkMt0nZ0MV83VLNq7FsDBEzJtRkRGlCWjyRqDTw7ui4E1i6NEl0CEda+xV9yq56dY cg9Q== 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; bh=SEikWwQ3LVjS5sw7tZhc6tdgtCNokHYK3drZX9W3Ckc=; b=ESiU3udwwY1kkeDM6qNCwZUz5pmgqAc1Juu+Bq5Z7GAdXzcjmo/59aHyeWDU1s8qr8 Wb3aNH8GtJDzxifgqOgdVL+cn+ImYyJhmfd2peYWioGn30qQWmeImAlhIRxvVSu/+LHZ oBnaSLmSNTf695fTkxPiyrOMDFWtnqvk1D9JhTxDLATq8d3QSJdgxsX2d53fLukiYbXu HAnR+SRlS6JJWuscVLqVwIqN5ljWC+Ju9px7VUduCwCB6Vqx6ukrFrRyICR9NDDT/GQa HKWAvUIxYwULHs8eVprAlVH7hPF4c9IxVTBc3PZhBei5i39gooj5AvXzsBbr36+ZRWa7 DHIA== X-Gm-Message-State: AOAM533sFAq5/9UcPn3D1+3970ovXqYW0M123aK2LlJr5eBYzfRr1Z/e vm+X+bCC/7gPRuCXpiQxiXT3FnnLtWKncJNR X-Google-Smtp-Source: ABdhPJwIFLVTvEUIhe29qb9+wvcH0NaclS/X1LatUmDeElXZ+SlmgXv1dtyM+55E4y1322cgSur7vw== X-Received: by 2002:a5d:40cd:: with SMTP id b13mr16633570wrq.356.1621230691141; Sun, 16 May 2021 22:51:31 -0700 (PDT) Return-Path: Received: from lmecxl0524.lme.st.com (2a01cb058b850800452ff0effb46d5f4.ipv6.abo.wanadoo.fr. [2a01:cb05:8b85:800:452f:f0ef:fb46:d5f4]) by smtp.gmail.com with ESMTPSA id a23sm82660wrc.22.2021.05.16.22.51.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 May 2021 22:51:30 -0700 (PDT) From: "Etienne Carriere" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Ilias Apalodimas , Leif Lindholm , Sami Mujawar , Sughosh Ganu , Thomas Abraham , Etienne Carriere Subject: [edk2-platforms][PATCH v2 4/6] Drivers/OpTee: Add Aarch32 SVC IDs for 32bit Arm targets Date: Mon, 17 May 2021 07:50:45 +0200 Message-Id: <20210517055047.30814-4-etienne.carriere@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210517055047.30814-1-etienne.carriere@linaro.org> References: <20210517055047.30814-1-etienne.carriere@linaro.org> Add SMCCC function IDs for RPMB read/write service on 32bit architectures. Define generic SP_SVC_RPMB_READ/SP_SVC_RPMB_WRITE IDs for native target architecture (32b or 64b). Changes OpTeeRpmbFvb.c to use architecture agnostic macro ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ for 32b and 64b support. Cc: Ard Biesheuvel Cc: Ilias Apalodimas Cc: Leif Lindholm Cc: Sami Mujawar Signed-off-by: Etienne Carriere --- Changes since v1: - Use _AARCH64 (resp. _AARCH32) suffix instead of _64 (resp. _32) in the added macros. --- Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c | 2 +- Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c index 5197c95abd..6eb19bed0e 100644 --- a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c +++ b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c @@ -68,7 +68,7 @@ ReadWriteRpmb ( ZeroMem (&SvcArgs, sizeof (SvcArgs)); - SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64; + SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ; SvcArgs.Arg1 = mStorageId; SvcArgs.Arg2 = 0; SvcArgs.Arg3 = SvcAct; diff --git a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h index c17fc287ef..9c2a4ea6a5 100644 --- a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h +++ b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h @@ -13,8 +13,20 @@ contract between OP-TEE and EDK2. For more details check core/arch/arm/include/kernel/stmm_sp.h in OP-TEE **/ -#define SP_SVC_RPMB_READ 0xC4000066 -#define SP_SVC_RPMB_WRITE 0xC4000067 +#define SP_SVC_RPMB_READ_AARCH64 0xC4000066 +#define SP_SVC_RPMB_WRITE_AARCH64 0xC4000067 + +#define SP_SVC_RPMB_READ_AARCH32 0x84000066 +#define SP_SVC_RPMB_WRITE_AARCH32 0x84000067 + +#ifdef MDE_CPU_AARCH64 +#define SP_SVC_RPMB_READ SP_SVC_RPMB_READ_AARCH64 +#define SP_SVC_RPMB_WRITE SP_SVC_RPMB_WRITE_AARCH64 +#endif +#ifdef MDE_CPU_ARM +#define SP_SVC_RPMB_READ SP_SVC_RPMB_READ_AARCH32 +#define SP_SVC_RPMB_WRITE SP_SVC_RPMB_WRITE_AARCH32 +#endif #define FLASH_SIGNATURE SIGNATURE_32 ('r', 'p', 'm', 'b') #define INSTANCE_FROM_FVB_THIS(a) CR (a, MEM_INSTANCE, FvbProtocol, \ -- 2.17.1