Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/965488/?format=api
{ "id": 965488, "url": "http://patchwork.ozlabs.org/api/patches/965488/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20180903144711.31585-17-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-17-jens.wiklander@linaro.org>", "list_archive_url": null, "date": "2018-09-03T14:47:07", "name": "[U-Boot,v3,16/20] test: tee: test TEE uclass", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "0fc680778d836b9692c3057583c265d5c0547c9d", "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-17-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/965488/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/965488/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=\"W04cEQ5R\"; dkim-atps=neutral" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 423tMB2ntpz9s4Z\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 4 Sep 2018 00:56:06 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid D17A2C21E89; Mon, 3 Sep 2018 14:55:04 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 89EC2C21EB4;\n\tMon, 3 Sep 2018 14:48:03 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid DC954C21F21; Mon, 3 Sep 2018 14:47:49 +0000 (UTC)", "from mail-lj1-f178.google.com (mail-lj1-f178.google.com\n\t[209.85.208.178])\n\tby lists.denx.de (Postfix) with ESMTPS id A512BC21D72\n\tfor <u-boot@lists.denx.de>; Mon, 3 Sep 2018 14:47:43 +0000 (UTC)", "by mail-lj1-f178.google.com with SMTP id 203-v6so640705ljj.13\n\tfor <u-boot@lists.denx.de>; Mon, 03 Sep 2018 07:47:43 -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.41\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 03 Sep 2018 07:47:42 -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=T_DKIM_INVALID\n\tautolearn=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=FcKSr3CcUrmQby50WWO6yYfiPcftKiNgb0CZ3KdNkSM=;\n\tb=W04cEQ5R0O6c/H5ZjEpU6uxqeboIhz1b4vC4LUHawR8Veq5f0ij50TF1EiRyXFN/Hb\n\tgj9QNr2aXcX6LuRTwyX9ocKm3g+g1iJCJ3qwpy8bAD5rlM6pHzTGb5aXCKAh112ngOqQ\n\tgHOJvyfopK9Hk9QaL8p4bpKldsYW5RaKhajgM=", "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=FcKSr3CcUrmQby50WWO6yYfiPcftKiNgb0CZ3KdNkSM=;\n\tb=tmoL6lKfhiMzTdd55uTcvmFeP7YTGQUPAb/+Hdu4w8JMYJ2HxQnUvJfiVH1lNIhG59\n\trBHlNWajchxNF09CaAACpuw2N7g6om22rby58ou1TkJDcWH6Qo/a0KZMi4V3LZ7ewQLX\n\t63Q2iTcwVAXrOHdjLpHnnAHur+HA0NuunzJla8olbI7U2ZTUPJF98Tli996TnWCH1z+8\n\tDQY9biVZb9yQNQgyYXmVTWrPPwymydUUni2Htk1L6fj2i7ZHQVefjm4sblBqKtKap3/p\n\tWd2hk0N84/JK/gzt80s1ZXQeuCxqsu1jz3+aGTt0zdMN3QVSi0PLZ1ncZsjvY/x1mlc/\n\t5jLw==", "X-Gm-Message-State": "APzg51DFtBAfrQzbNFoDqZRv8UvT3O+m6EPDxuF3JiJPOMJ2Huvzg+Qq\n\tEt5ggvZvX984Lg3gUhqxwq+nn9XODXM=", "X-Google-Smtp-Source": "ANB0VdY3ROUO14RnczTIPC45eE59pczrOTcUGSErLtGUhkOuHC0BXAQ2ebXoHscZYBoVX87bQjyHqg==", "X-Received": "by 2002:a2e:8098:: with SMTP id\n\ti24-v6mr17489911ljg.36.1535986062807; \n\tMon, 03 Sep 2018 07:47:42 -0700 (PDT)", "From": "Jens Wiklander <jens.wiklander@linaro.org>", "To": "u-boot@lists.denx.de", "Date": "Mon, 3 Sep 2018 16:47:07 +0200", "Message-Id": "<20180903144711.31585-17-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 16/20] test: tee: test TEE uclass", "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": "Tests the TEE uclass with a sandbox tee driver.\n\nReviewed-by: Simon Glass <sjg@chromium.org>\nSigned-off-by: Jens Wiklander <jens.wiklander@linaro.org>\n---\n test/dm/Makefile | 1 +\n test/dm/tee.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 99 insertions(+)\n create mode 100644 test/dm/tee.c", "diff": "diff --git a/test/dm/Makefile b/test/dm/Makefile\nindex d2ed96c61533..272374b92fb0 100644\n--- a/test/dm/Makefile\n+++ b/test/dm/Makefile\n@@ -44,4 +44,5 @@ obj-$(CONFIG_DM_VIDEO) += video.o\n obj-$(CONFIG_ADC) += adc.o\n obj-$(CONFIG_SPMI) += spmi.o\n obj-$(CONFIG_WDT) += wdt.o\n+obj-$(CONFIG_TEE) += tee.o\n endif\ndiff --git a/test/dm/tee.c b/test/dm/tee.c\nnew file mode 100644\nindex 000000000000..ab1c7da9d2d3\n--- /dev/null\n+++ b/test/dm/tee.c\n@@ -0,0 +1,98 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/*\n+ * Copyright (C) 2018 Linaro Limited\n+ */\n+\n+#include <common.h>\n+#include <dm.h>\n+#include <dm/test.h>\n+#include <sandboxtee.h>\n+#include <tee.h>\n+#include <test/ut.h>\n+#include <tee/optee_ta_avb.h>\n+\n+static int open_session(struct udevice *dev, u32 *session)\n+{\n+\tstruct tee_open_session_arg arg;\n+\tconst struct tee_optee_ta_uuid uuid = TA_AVB_UUID;\n+\tint rc;\n+\n+\tmemset(&arg, 0, sizeof(arg));\n+\ttee_optee_ta_uuid_to_octets(arg.uuid, &uuid);\n+\trc = tee_open_session(dev, &arg, 0, NULL);\n+\tif (rc)\n+\t\treturn rc;\n+\tif (arg.ret)\n+\t\treturn -EIO;\n+\t*session = arg.session;\n+\n+\treturn 0;\n+}\n+\n+static int invoke_func(struct udevice *dev, u32 session)\n+{\n+\tstruct tee_param param = { .attr = TEE_PARAM_ATTR_TYPE_VALUE_OUTPUT };\n+\tstruct tee_invoke_arg arg;\n+\n+\tmemset(&arg, 0, sizeof(arg));\n+\targ.session = session;\n+\targ.func = TA_AVB_CMD_READ_LOCK_STATE;\n+\n+\tif (tee_invoke_func(dev, &arg, 1, ¶m) || arg.ret)\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n+static int match(struct tee_version_data *vers, const void *data)\n+{\n+\treturn vers->gen_caps & TEE_GEN_CAP_GP;\n+}\n+\n+static int dm_test_tee(struct unit_test_state *uts)\n+{\n+\tstruct tee_version_data vers;\n+\tstruct udevice *dev;\n+\tstruct sandbox_tee_state *state;\n+\tu32 session;\n+\tint rc;\n+\tu8 data[128];\n+\tstruct tee_shm *reg_shm;\n+\tstruct tee_shm *alloc_shm;\n+\n+\tdev = tee_find_device(NULL, match, NULL, &vers);\n+\tut_assert(dev);\n+\tstate = dev_get_priv(dev);\n+\tut_assert(!state->session);\n+\n+\trc = open_session(dev, &session);\n+\tut_assert(!rc);\n+\tut_assert(session == state->session);\n+\n+\trc = invoke_func(dev, session);\n+\tut_assert(!rc);\n+\n+\trc = tee_close_session(dev, session);\n+\tut_assert(!rc);\n+\tut_assert(!state->session);\n+\n+\tut_assert(!state->num_shms);\n+\trc = tee_shm_register(dev, data, sizeof(data), 0, ®_shm);\n+\tut_assert(!rc);\n+\tut_assert(state->num_shms == 1);\n+\n+\trc = tee_shm_alloc(dev, 256, 0, &alloc_shm);\n+\tut_assert(!rc);\n+\tut_assert(state->num_shms == 2);\n+\n+\tut_assert(tee_shm_is_registered(reg_shm, dev));\n+\tut_assert(tee_shm_is_registered(alloc_shm, dev));\n+\n+\ttee_shm_free(reg_shm);\n+\ttee_shm_free(alloc_shm);\n+\tut_assert(!state->num_shms);\n+\n+\treturn 0;\n+}\n+\n+DM_TEST(dm_test_tee, DM_TESTF_SCAN_FDT);\n", "prefixes": [ "U-Boot", "v3", "16/20" ] }