Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/965484/?format=api
{ "id": 965484, "url": "http://patchwork.ozlabs.org/api/patches/965484/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20180903144711.31585-13-jens.wiklander@linaro.org/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20180903144711.31585-13-jens.wiklander@linaro.org>", "list_archive_url": null, "date": "2018-09-03T14:47:03", "name": "[U-Boot,v3,12/20] tee: optee: support AVB trusted application", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "d4cbdd5f8b34d4f6aff274c2b2a60917d75171fb", "submitter": { "id": 66201, "url": "http://patchwork.ozlabs.org/api/people/66201/?format=api", "name": "Jens Wiklander", "email": "jens.wiklander@linaro.org" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20180903144711.31585-13-jens.wiklander@linaro.org/mbox/", "series": [ { "id": 63875, "url": "http://patchwork.ozlabs.org/api/series/63875/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=63875", "date": "2018-09-03T14:46:51", "name": "AVB using OP-TEE", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/63875/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/965484/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/965484/checks/", "tags": {}, "related": [], "headers": { "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;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=linaro.org", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"DZ+nR3FH\"; dkim-atps=neutral" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 423tK53gTMz9s4Z\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 4 Sep 2018 00:54:17 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid 42358C21E16; Mon, 3 Sep 2018 14:53:22 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 6BF52C21E77;\n\tMon, 3 Sep 2018 14:47:53 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid BC219C21EBB; Mon, 3 Sep 2018 14:47:44 +0000 (UTC)", "from mail-lf1-f67.google.com (mail-lf1-f67.google.com\n\t[209.85.167.67])\n\tby lists.denx.de (Postfix) with ESMTPS id 3EDBDC21EB9\n\tfor <u-boot@lists.denx.de>; Mon, 3 Sep 2018 14:47:37 +0000 (UTC)", "by mail-lf1-f67.google.com with SMTP id r4-v6so620940lff.12\n\tfor <u-boot@lists.denx.de>; Mon, 03 Sep 2018 07:47:37 -0700 (PDT)", "from jax.ideon.se ([85.235.10.227])\n\tby smtp.gmail.com with ESMTPSA id\n\tw18-v6sm3343431ljd.73.2018.09.03.07.47.35\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 03 Sep 2018 07:47:35 -0700 (PDT)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=HKRdv0vIuma6DXsuxi4vmfMTcUGzLZl5eXvJIao3sRA=;\n\tb=DZ+nR3FHxgYra7PZLUeVA7i1L0ivgvmU8Kkxrv23V3cCc/FCdNuwx/xrtAm0yHfJHL\n\t0R1IiJJVb/MvDhF/Sct/28vaHQnW4hdCNTN2ATeFsEmBnwJXuHFtnACEi9lkbKf7CWc8\n\tIDKgAnMYAFqWkQg3i5Z/+2Wfm097dDlJP3iN8=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=HKRdv0vIuma6DXsuxi4vmfMTcUGzLZl5eXvJIao3sRA=;\n\tb=UnmYKLJ1Q9z6iKkt3hoFB1j7f4hS2EZLs9+C/UhoCinaZazUgqyaj7Bl6lAXY6RvfT\n\t/NK0QlkSFiVnC6Al5rpFFmb5B9rpaW/rSFHPFUrg313oLyER7FDD+VTIIWJ6p2n9lfyj\n\t/kdtGvaFleYJcyXtYFXN56npMLy6B7dHJd/bhxKBniDRwm9MrPRdo10GJsy1QT/0uz3F\n\terR7VhrNIoZWBnoQKKbw0/MEYvQ2BojhBWXj9Ld9w07gKOfXHtxrByeY/WzocZt4xPKX\n\tFoT+LeyLyU0veQfo4uHTz/p6objMogQg8sInPoRSklhz48RPFqFq3h16BXPO8I6nGGLx\n\taksw==", "X-Gm-Message-State": "APzg51AyspnADPbKc9kTRG0ODRghzPDk6JyxasbGL2++/kVIBeSkFPnP\n\trqJing+AYoQcJiII0WpXAELqNY2IA/M=", "X-Google-Smtp-Source": "ANB0VdYKlaK4gOY/+uNfSrmzzpIrlwrt0MhlHuCD9uKutlxT4EfCj0qUE6Bk5C8k9HlKmEZgQ2m5fg==", "X-Received": "by 2002:a19:655d:: with SMTP id\n\tc29-v6mr6099906lfj.138.1535986056365; \n\tMon, 03 Sep 2018 07:47:36 -0700 (PDT)", "From": "Jens Wiklander <jens.wiklander@linaro.org>", "To": "u-boot@lists.denx.de", "Date": "Mon, 3 Sep 2018 16:47:03 +0200", "Message-Id": "<20180903144711.31585-13-jens.wiklander@linaro.org>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20180903144711.31585-1-jens.wiklander@linaro.org>", "References": "<20180903144711.31585-1-jens.wiklander@linaro.org>", "Cc": "Tom Rini <trini@konsulko.com>, Pierre Aubert <p.aubert@staubli.com>", "Subject": "[U-Boot] [PATCH v3 12/20] tee: optee: support AVB trusted\n\tapplication", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.18", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<http://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>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>" }, "content": "Adds configuration option OPTEE_TA_AVB and a header file describing the\ninterface to the Android Verified Boot 2.0 (AVB) trusted application\nprovided by OP-TEE.\n\nTested-by: Igor Opaniuk <igor.opaniuk@linaro.org>\nReviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>\nSigned-off-by: Jens Wiklander <jens.wiklander@linaro.org>\n---\n MAINTAINERS | 1 +\n drivers/tee/optee/Kconfig | 16 +++++++++++++\n drivers/tee/tee-uclass.c | 24 +++++++++++++++++++\n include/tee.h | 38 ++++++++++++++++++++++++++++++\n include/tee/optee_ta_avb.h | 48 ++++++++++++++++++++++++++++++++++++++\n 5 files changed, 127 insertions(+)\n create mode 100644 include/tee/optee_ta_avb.h", "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 7458c606ee92..cb36c45d74ea 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -576,6 +576,7 @@ M:\tJens Wiklander <jens.wiklander@linaro.org>\n S:\tMaintained\n F:\tdrivers/tee/\n F:\tinclude/tee.h\n+F:\tinclude/tee/\n \n UBI\n M:\tKyungmin Park <kmpark@infradead.org>\ndiff --git a/drivers/tee/optee/Kconfig b/drivers/tee/optee/Kconfig\nindex 7484e6fea114..dbfa7846a30f 100644\n--- a/drivers/tee/optee/Kconfig\n+++ b/drivers/tee/optee/Kconfig\n@@ -9,3 +9,19 @@ config OPTEE\n \t mechanism. This driver can request services from OP-TEE, but also\n \t handle Remote Procedure Calls (RPC) from OP-TEE needed to\n \t execute a service. For more information see: https://www.op-tee.org\n+\n+if OPTEE\n+\n+menu \"OP-TEE options\"\n+\n+config OPTEE_TA_AVB\n+\tbool \"Support AVB TA\"\n+\tdefault y\n+\thelp\n+\t Enables support for the AVB Trusted Application (TA) in OP-TEE.\n+\t The TA can support the \"avb\" subcommands \"read_rb\", \"write\"rb\"\n+\t and \"is_unlocked\".\n+\n+endmenu\n+\n+endif\ndiff --git a/drivers/tee/tee-uclass.c b/drivers/tee/tee-uclass.c\nindex 1bee54ebf4af..abb88c0fee53 100644\n--- a/drivers/tee/tee-uclass.c\n+++ b/drivers/tee/tee-uclass.c\n@@ -207,3 +207,27 @@ UCLASS_DRIVER(tee) = {\n \t.pre_probe = tee_pre_probe,\n \t.pre_remove = tee_pre_remove,\n };\n+\n+void tee_optee_ta_uuid_from_octets(struct tee_optee_ta_uuid *d,\n+\t\t\t\t const u8 s[TEE_UUID_LEN])\n+{\n+\td->time_low = ((u32)s[0] << 24) | ((u32)s[1] << 16) |\n+\t\t ((u32)s[2] << 8) | s[3],\n+\td->time_mid = ((u32)s[4] << 8) | s[5];\n+\td->time_hi_and_version = ((u32)s[6] << 8) | s[7];\n+\tmemcpy(d->clock_seq_and_node, s + 8, sizeof(d->clock_seq_and_node));\n+}\n+\n+void tee_optee_ta_uuid_to_octets(u8 d[TEE_UUID_LEN],\n+\t\t\t\t const struct tee_optee_ta_uuid *s)\n+{\n+\td[0] = s->time_low >> 24;\n+\td[1] = s->time_low >> 16;\n+\td[2] = s->time_low >> 8;\n+\td[3] = s->time_low;\n+\td[4] = s->time_mid >> 8;\n+\td[5] = s->time_mid;\n+\td[6] = s->time_hi_and_version >> 8;\n+\td[7] = s->time_hi_and_version;\n+\tmemcpy(d + 8, s->clock_seq_and_node, sizeof(s->clock_seq_and_node));\n+}\ndiff --git a/include/tee.h b/include/tee.h\nindex b86dbec257b4..98b1c9cc693a 100644\n--- a/include/tee.h\n+++ b/include/tee.h\n@@ -49,6 +49,22 @@\n #define TEE_ORIGIN_TRUSTED_APP\t\t0x00000004\n \n struct udevice;\n+\n+/**\n+ * struct tee_optee_ta_uuid - OP-TEE Trusted Application (TA) UUID format\n+ *\n+ * Used to identify an OP-TEE TA and define suitable to initialize structs\n+ * of this format is distributed with the interface of the TA. The\n+ * individual fields of this struct doesn't have any special meaning in\n+ * OP-TEE. See RFC4122 for details on the format.\n+ */\n+struct tee_optee_ta_uuid {\n+\tu32 time_low;\n+\tu16 time_mid;\n+\tu16 time_hi_and_version;\n+\tu8 clock_seq_and_node[8];\n+};\n+\n /**\n * struct tee_shm - memory shared with the TEE\n * @dev:\tThe TEE device\n@@ -333,4 +349,26 @@ int tee_close_session(struct udevice *dev, u32 session);\n int tee_invoke_func(struct udevice *dev, struct tee_invoke_arg *arg,\n \t\t uint num_param, struct tee_param *param);\n \n+/**\n+ * tee_optee_ta_uuid_from_octets() - Converts to struct tee_optee_ta_uuid\n+ * @d:\tDestination struct\n+ * @s:\tSource UUID octets\n+ *\n+ * Conversion to a struct tee_optee_ta_uuid represantion from binary octet\n+ * representation.\n+ */\n+void tee_optee_ta_uuid_from_octets(struct tee_optee_ta_uuid *d,\n+\t\t\t\t const u8 s[TEE_UUID_LEN]);\n+\n+/**\n+ * tee_optee_ta_uuid_to_octets() - Converts from struct tee_optee_ta_uuid\n+ * @d:\tDestination UUID octets\n+ * @s:\tSource struct\n+ *\n+ * Conversion from a struct tee_optee_ta_uuid represantion to binary octet\n+ * representation.\n+ */\n+void tee_optee_ta_uuid_to_octets(u8 d[TEE_UUID_LEN],\n+\t\t\t\t const struct tee_optee_ta_uuid *s);\n+\n #endif /* __TEE_H */\ndiff --git a/include/tee/optee_ta_avb.h b/include/tee/optee_ta_avb.h\nnew file mode 100644\nindex 000000000000..074386af19a1\n--- /dev/null\n+++ b/include/tee/optee_ta_avb.h\n@@ -0,0 +1,48 @@\n+/* SPDX-License-Identifier: BSD-2-Clause */\n+/* Copyright (c) 2018, Linaro Limited */\n+\n+#ifndef __TA_AVB_H\n+#define __TA_AVB_H\n+\n+#define TA_AVB_UUID { 0x023f8f1a, 0x292a, 0x432b, \\\n+\t\t { 0x8f, 0xc4, 0xde, 0x84, 0x71, 0x35, 0x80, 0x67 } }\n+\n+#define TA_AVB_MAX_ROLLBACK_LOCATIONS\t256\n+\n+/*\n+ * Gets the rollback index corresponding to the given rollback index slot.\n+ *\n+ * in\tparams[0].value.a:\trollback index slot\n+ * out\tparams[1].value.a:\tupper 32 bits of rollback index\n+ * out\tparams[1].value.b:\tlower 32 bits of rollback index\n+ */\n+#define TA_AVB_CMD_READ_ROLLBACK_INDEX\t0\n+\n+/*\n+ * Updates the rollback index corresponding to the given rollback index slot.\n+ *\n+ * Will refuse to update a slot with a lower value.\n+ *\n+ * in\tparams[0].value.a:\trollback index slot\n+ * in\tparams[1].value.a:\tupper 32 bits of rollback index\n+ * in\tparams[1].value.b:\tlower 32 bits of rollback index\n+ */\n+#define TA_AVB_CMD_WRITE_ROLLBACK_INDEX\t1\n+\n+/*\n+ * Gets the lock state of the device.\n+ *\n+ * out\tparams[0].value.a:\tlock state\n+ */\n+#define TA_AVB_CMD_READ_LOCK_STATE\t2\n+\n+/*\n+ * Sets the lock state of the device.\n+ *\n+ * If the lock state is changed all rollback slots will be reset to 0\n+ *\n+ * in\tparams[0].value.a:\tlock state\n+ */\n+#define TA_AVB_CMD_WRITE_LOCK_STATE\t3\n+\n+#endif /* __TA_AVB_H */\n", "prefixes": [ "U-Boot", "v3", "12/20" ] }