Message ID | 20210325093036.3270101-31-peng.fan@oss.nxp.com |
---|---|
State | Accepted |
Commit | 45f39e9fb70dc8a9cb17135d2146de402494a59e |
Delegated to: | Stefano Babic |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-NXP1-onmicrosoft-com header.b=NXqHGmxX; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F5g4l15TDz9s1l for <incoming@patchwork.ozlabs.org>; Thu, 25 Mar 2021 20:37:42 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 86B6082979; Thu, 25 Mar 2021 10:34:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=oss.nxp.com 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=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="NXqHGmxX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 404B682843; Thu, 25 Mar 2021 10:33:14 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02on0611.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe05::611]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 00E9382786 for <u-boot@lists.denx.de>; Thu, 25 Mar 2021 10:33:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=oss.nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BsQAZwzOvHdLVjhy+gL7VDu7+NyqH9zgLYrexQC4IaoeZEHqIu0q0p8Eag147CbwDoeZk8DVjywuzFj+pCYleRS6cUEWL8qn52jbCrJV3OPKYcF+CG3P0cJYoTzIadQ5/1a8WIDHOW/06tYrdXjbu/rIq53XZTrXkxcHuGFwr3/UsnfddtNTzNS/tEo1dAxGHwquvrmpgs5Ml93Xa8aumQchkRuAHUVX9mIcIdssZCaqyGkkAOz3YG0uLXqILm4MMrWd678/lhc0ZKWQgLoO1INW+7JhwQPpF0y/cGqUhhNYhwulcKWbwZxB8FLS300IwjDMngGD+KIvAuY7Smscdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x5nc5VWw5blieKcLWpGm7SZB7edugkfcE3vTyvxpYpU=; b=fMgDAhSiF6uRs6N9q1BETTCVuwbEygOn1A3EyHjJoJY8P7ktPDVp2ku0s4l6f4B7JXc1l9x8APDK2M9VwNFs388xKmw2LHpblZ+mVGTYxJczDWpiP+etm/vMYwWG089F5UYluMNluh00p+zh11K/JF6Yp8YUN8EtVcfxCe3u66YkUmeHRBzQDzJbVLu+XPAyNf9kBxraTx3auA/cpJu+fpQcoJfcor9ROj1VuGRqyBm+SBgUyDCMbEYBQcS56Z8zmjzm8aH+HV87G1jlcwdEzV5XMY2jdna88CsYLROgxhgj4NTboFjFnksaj6jgeOgT7hG8oHGWeCHhymJ+sz/yFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x5nc5VWw5blieKcLWpGm7SZB7edugkfcE3vTyvxpYpU=; b=NXqHGmxXzEy8ejMAlLOhOmr/TLKPGAwCcJDkKo1pVj18DKNQ0E6HI+87pOJcSqQDBIT3q0r69mXirEY15n2D0OULPHkTpwDmF0AVQiqaBb1IgCqRBegqCIqe5L25lvvXOr6Au0aBAOrSmDUDIgrsxN4gze+kfQUcd1pMoWrBVAM= Authentication-Results: denx.de; dkim=none (message not signed) header.d=none;denx.de; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB9PR04MB8316.eurprd04.prod.outlook.com (2603:10a6:10:246::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24; Thu, 25 Mar 2021 09:33:09 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3955.025; Thu, 25 Mar 2021 09:33:09 +0000 From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com> To: sbabic@denx.de, festevam@gmail.com Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Aymen Sghaier <aymen.sghaier@nxp.com>, Peng Fan <peng.fan@nxp.com> Subject: [PATCH 30/37] crypto: caam: Add secure memory vid 3 support Date: Thu, 25 Mar 2021 17:30:29 +0800 Message-Id: <20210325093036.3270101-31-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210325093036.3270101-1-peng.fan@oss.nxp.com> References: <20210325093036.3270101-1-peng.fan@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR0302CA0021.apcprd03.prod.outlook.com (2603:1096:202::31) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR0302CA0021.apcprd03.prod.outlook.com (2603:1096:202::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.16 via Frontend Transport; Thu, 25 Mar 2021 09:33:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ea972c3c-0ad9-4fbf-308b-08d8ef7100ba X-MS-TrafficTypeDiagnostic: DB9PR04MB8316: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <DB9PR04MB83160885BB74A4EA71893126C9629@DB9PR04MB8316.eurprd04.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:2512; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HPeCw3dLnYzMdTZgR48mPkAXxp/psUf2IPbQ9mYd4kgJRjO2W5WlOt1ltKLf/zBo8swAtyVyW57AJjeLRp4Ae5t+uPjwR/E+d+aoLfK4b5oXUZABewKeSmQGE+/Y3dzrESNVuUZYz4qNIT8sxmS7fiAp1ma/ZY6mkAokOWO+LOFZlsPztiwW7M8PurI8CHieq69BObpuXhUiTD5YQAGFvTxxUWj5hVIFIeF12e4iUohV5J5qZUQd3RMZuukzp0kks5bFQUOzoJCZfEA+fiDVIZznV9kuXHNubw23R/hfX3i6v2ECj7mBmBo2Q78xtHgPNM8zGlyWMhOp5SzWWjIeK/i1SBEHQK26uLoJKUDim9Rbw7wYhXcGEV3wPXYETdXOK4AHxQQAWTRreMit5NEqmZNOSfCAM7Jg/EyGlKyULiSk64zAOWNQJp9N9C/ty4Cd7W1RsaD35ugxBqf6W+UEZ2OxcQ8Xdvh5s/7sS3emAeKFYFi6DX2rJomYztPosh3bCAhiOTh3vY6cQ8SsuzHIZWu/7e8ifSeCvyafdi9Ej2ke4ED9c3khLhM3d07uIuWEop6EdRnfKoDwxkeK+0zkFzn2NukODvIJtpmcV6Zpj2TJ9EzQU7Pav0CZ6JAvw2qEEsEYAcCpGlqMOfM9QtQXrzdSwrJUjhmekZXuToP7a6gVMqv9qDPUpuy01Ws478Wl X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(346002)(396003)(39860400002)(366004)(376002)(26005)(6512007)(2616005)(186003)(86362001)(1076003)(6486002)(83380400001)(69590400012)(956004)(6666004)(16526019)(38100700001)(5660300002)(8936002)(52116002)(66946007)(478600001)(8676002)(4326008)(316002)(54906003)(66476007)(66556008)(6506007)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: k+/VA354Cs9fXPLjw7+iA15MXxiGKNa8GPatHTO2kBtvInlxuKRnCuh5a/Pfl1yoUv8cnJqH+o3/Jdv2p+oKz/wLAtRxYrAWd2tNP/bJfNq1CKf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wvJ1GvU56zm43DsjOotdTQympT7qCguER6ZbI8u3xrSwBlNnsJfvGGSyI1rwwv/g+gALUhEflqKTIUSnfXv8BF5Jt2+XJYjATmFPotiqrJ879fhRWKN79zxV7Yg9tsvuAIMTt8nt88qcRveZlrz2GrwK6/8QEnbxBYEZMkKm3ALUSM6a64A== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea972c3c-0ad9-4fbf-308b-08d8ef7100ba X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2021 09:33:09.8418 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: T3tv4oFoI01JEV3sQyCx/dV13CgiL9wEnYT8stWGfM+7kacMv75CoyK7vxX2X+QRVM4eYaoB9s6kOQ0kakhZsA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8316 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean |
Series |
imx: hab/caam new feature and update
|
expand
|
diff --git a/include/fsl_sec.h b/include/fsl_sec.h index dca0dd0328..09ce916297 100644 --- a/include/fsl_sec.h +++ b/include/fsl_sec.h @@ -276,7 +276,8 @@ struct sg_entry { #define SM_V2_OFFSET 0xa00 /*Secure Memory Versioning */ #define SMVID_V2 0x20105 -#define SM_VERSION(x) (x < SMVID_V2 ? 1 : 2) +#define SM_VERSION(x) ({typeof(x) _x = x; \ + _x < SMVID_V2 ? 1 : (_x < 0x20300 ? 2 : 3); }) #define SM_OFFSET(x) (x == 1 ? SM_V1_OFFSET : SM_V2_OFFSET) /* CAAM Job Ring 0 Registers */ /* Secure Memory Partition Owner register */ @@ -303,8 +304,10 @@ struct sg_entry { #define SM_CMD(v) (v == 1 ? 0x0 : 0x1E4) #define SM_STATUS(v) (v == 1 ? 0x8 : 0x1EC) #define SM_PERM(v) (v == 1 ? 0x10 : 0x4) -#define SM_GROUP2(v) (v == 1 ? 0x14 : 0x8) -#define SM_GROUP1(v) (v == 1 ? 0x18 : 0xC) +#define SM_GROUP2(v) ({typeof(v) _v = v; \ + _v == 1 ? 0x14 : (_v == 2 ? 0x8 : 0xC); }) +#define SM_GROUP1(v) ({typeof(v) _v = v; \ + _v == 1 ? 0x18 : (_v == 2 ? 0xC : 0x8); }) #define CMD_PAGE_ALLOC 0x1 #define CMD_PAGE_DEALLOC 0x2 #define CMD_PART_DEALLOC 0x3 @@ -322,10 +325,15 @@ struct sg_entry { #define SEC_MEM_PAGE2 (CAAM_ARB_BASE_ADDR + 0x2000) #define SEC_MEM_PAGE3 (CAAM_ARB_BASE_ADDR + 0x3000) -#define JR_MID 2 /* Matches ROM configuration */ -#define KS_G1 (1 << JR_MID) /* CAAM only */ -#define PERM 0x0000B008 /* Clear on release, lock SMAP - * lock SMAG group 1 Blob */ +#ifdef CONFIG_IMX8M +#define JR_MID (1) /* Matches ATF configuration */ +#define KS_G1 (0x10000 << JR_MID) /* CAAM only */ +#define PERM (0xB080) /* CSP, SMAP_LCK, SMAG_LCK, G1_BLOB */ +#else +#define JR_MID (2) /* Matches ROM configuration */ +#define KS_G1 BIT(JR_MID) /* CAAM only */ +#define PERM (0xB008) /* CSP, SMAP_LCK, SMAG_LCK, G1_BLOB */ +#endif /* CONFIG_IMX8M */ /* HAB WRAPPED KEY header */ #define WRP_HDR_SIZE 0x08