From patchwork Fri Oct 1 05:02:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515021 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp455312jaf; Thu, 30 Sep 2021 22:10:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpUxQ+wJ2dAbhlGGwH6X5ynHoEpLKazCXp+DNrGHOg6Qormfdp9GipwB6exhbK2mnPX7DC X-Received: by 2002:a50:d802:: with SMTP id o2mr11615510edj.331.1633065058373; Thu, 30 Sep 2021 22:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633065058; cv=none; d=google.com; s=arc-20160816; b=r+qCLfkJgeJ3AVJeJ+A87noz5um+IiXxmZvbtU6yUmCmY3OqM1P96Gnm4uo6TjaXLp 94OFSGR7UBe8BKYpVPxW9rGEACLTCRETVUOLDZR5XF+h5+BBGGrno1dIbMISRLStO/es 2yXj4vXvJSAhY3xSkD2UaMkqww5S3Xc8hiOS9v61AT2TrBdFVfk1APAlLtmMaAIJKTZz BYuVHuD7NFvXErFambO1OFqclRb3LFt1KpUp2+Tf4iOgSu8PKCK5IKxFNQiqgq+XZiGe TfscOglzVh/y3I4cRJ9x7xmIkJAWEs0/xhGgvj4z4e8U3EHgY53a2UwJ33bD0HN4Q0yo eeXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+HwM0pXE5H//wzI2I7f49WFGakpJIBZDqVibn5c+sFg=; b=nTGOaDRzpW7caU04pS/T+GRq1RgJ0imHRXY4cl3/nusYJuA/0hO15Ql9tS/sUtd1FQ QHJ8z4NbNinnssRPScCNLS4lVzRN5ImRcvh321+Ps/dJ7NJyhGnJqYdnrkckagtFt6t2 Ofgc63J1ELfOOJWjMN5WB1vHOHia40urgzwasBojkmsHXjPl/fYVjls7XID0c7PWZ5dv Mrx2BH9zVm7u3TUUjlKA5j1yFlI4/1oqV3Eu34VfY2zVpRd6jnKh6pumbUwj1ZJc5kyL khU2oqhgAKUEfMtOB1eZ0DutVu1EFbfxZpjzc1KFCUfvhqDS3YDzTyzggqaqObS65riQ 2irQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YNawTooh; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id c38si4169477edf.98.2021.09.30.22.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:10:58 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YNawTooh; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B9C888350F; Fri, 1 Oct 2021 07:06:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="YNawTooh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3970E834AA; Fri, 1 Oct 2021 07:05:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4A80983476 for ; Fri, 1 Oct 2021 07:05:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pf1-x42d.google.com with SMTP id m26so6912565pff.3 for ; Thu, 30 Sep 2021 22:05:24 -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=+HwM0pXE5H//wzI2I7f49WFGakpJIBZDqVibn5c+sFg=; b=YNawToohiCmGGY1BirGcljeyb3xnp8cDFoQ8OMXz28xpAzawUPBgoOpocq1jGojcrN QW/bd/xwV1cetRSirTahsU/JJzrTyXLyc3PT17/BRLRYVa/7GR4LU8+9V+aIJCVPcpcZ ieqf13I9cqxtvt2nZw/rIRL+W12Pf+ZWNtInW0DPMJ4ySUrWmFk1/cKYqJVnhHWhCLKb f0pnz7pilGPMTSdtFZC17vTYhIB0ayQOleQxZlr+D4fkaeL1c7tiaQ92rGDhkQ15Q02V 2cqE6MWUPAOSmmeg98Pfn/EgmLZAm80zCU9uLeoHK9jtlELQWo6hAPYdfs25yyeRc5/+ WDdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+HwM0pXE5H//wzI2I7f49WFGakpJIBZDqVibn5c+sFg=; b=TfVc6uDEtjUFYmGffz9wsENwhm998z9h0mYXZatQodEru6LfzttTV/P53GQg86fuvZ 3icnM90LMdG06xyONf/+Hu8skQkL/bKUX3fQIfJFTDizWI43v3q3K2kUDxheb0kbWBMg P4wTQ0iWYxHmU7dzXuaeqGI+PmD8Xyve+PE/B8aponvKNPj+3PswGpDvLkNkd2uyRvB3 SxrlGXET9k6Ozzsjt/cWwLvM7NXpfdTT1YqR4v4stAPAFt/kRzXAg5YtZZ0Gu/D4Fuj6 W18msck3VWgZSqacJMm2JuAfnp1nAFSMJn4H/DBoLPah2lVRoP/FTrUUwNBSosYfRvdQ le+w== X-Gm-Message-State: AOAM530/29AlFnq8WJOT/51IZ8ItCluXrH15wMKbwasf97pbMmtO0EVw KdlpcD+/rV1a/9J1MTCcp6o4UA== X-Received: by 2002:a62:750e:0:b0:44b:bd38:52cb with SMTP id q14-20020a62750e000000b0044bbd3852cbmr7943914pfc.57.1633064722415; Thu, 30 Sep 2021 22:05:22 -0700 (PDT) Received: from localhost.localdomain (122-100-26-52m5.mineo.jp. [122.100.26.52]) by smtp.gmail.com with ESMTPSA id z8sm4615113pgc.53.2021.09.30.22.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:05:21 -0700 (PDT) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org, ilias.apalodimas@linaro.org Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [RFC 22/22] efi_selftest: block device: adjust dp for a test disk Date: Fri, 1 Oct 2021 14:02:28 +0900 Message-Id: <20211001050228.55183-45-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001050228.55183-1-takahiro.akashi@linaro.org> References: <20211001050228.55183-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Due to efi_disk-dm integration, the resultant device path for a test disk got slightly changed, with efi_root contained as the first component. Signed-off-by: AKASHI Takahiro --- lib/efi_selftest/efi_selftest_block_device.c | 26 ++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) -- 2.33.0 diff --git a/lib/efi_selftest/efi_selftest_block_device.c b/lib/efi_selftest/efi_selftest_block_device.c index 15f03751ac87..cac76249e6b4 100644 --- a/lib/efi_selftest/efi_selftest_block_device.c +++ b/lib/efi_selftest/efi_selftest_block_device.c @@ -30,6 +30,9 @@ static const efi_guid_t guid_device_path = EFI_DEVICE_PATH_PROTOCOL_GUID; static const efi_guid_t guid_simple_file_system_protocol = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID; static const efi_guid_t guid_file_system_info = EFI_FILE_SYSTEM_INFO_GUID; +static efi_guid_t guid_uboot = + EFI_GUID(0xe61d73b9, 0xa384, 0x4acc, \ + 0xae, 0xab, 0x82, 0xe8, 0x28, 0xf3, 0x62, 0x8b); static efi_guid_t guid_vendor = EFI_GUID(0xdbca4c98, 0x6cb0, 0x694d, 0x08, 0x72, 0x81, 0x9c, 0x65, 0x0c, 0xb7, 0xb8); @@ -206,25 +209,44 @@ static int setup(const efi_handle_t handle, ret = boottime->allocate_pool(EFI_LOADER_DATA, sizeof(struct efi_device_path_vendor) + + sizeof(struct efi_device_path_vendor) + + sizeof(u8) + sizeof(struct efi_device_path), (void **)&dp); if (ret != EFI_SUCCESS) { efi_st_error("Out of memory\n"); return EFI_ST_FAILURE; } + /* first part */ vendor_node.dp.type = DEVICE_PATH_TYPE_HARDWARE_DEVICE; vendor_node.dp.sub_type = DEVICE_PATH_SUB_TYPE_VENDOR; vendor_node.dp.length = sizeof(struct efi_device_path_vendor); - boottime->copy_mem(&vendor_node.guid, &guid_vendor, + boottime->copy_mem(&vendor_node.guid, &guid_uboot, sizeof(efi_guid_t)); boottime->copy_mem(dp, &vendor_node, sizeof(struct efi_device_path_vendor)); + + /* second part */ + vendor_node.dp.type = DEVICE_PATH_TYPE_HARDWARE_DEVICE; + vendor_node.dp.sub_type = DEVICE_PATH_SUB_TYPE_VENDOR; + vendor_node.dp.length = sizeof(struct efi_device_path_vendor) + 1; + + boottime->copy_mem(&vendor_node.guid, &guid_vendor, + sizeof(efi_guid_t)); + boottime->copy_mem((char *)dp + sizeof(struct efi_device_path_vendor), + &vendor_node, + sizeof(struct efi_device_path_vendor)); + /* vendor_data[0] */ + *((char *)dp + sizeof(struct efi_device_path_vendor) * 2) = 0; + end_node.type = DEVICE_PATH_TYPE_END; end_node.sub_type = DEVICE_PATH_SUB_TYPE_END; end_node.length = sizeof(struct efi_device_path); - boottime->copy_mem((char *)dp + sizeof(struct efi_device_path_vendor), + boottime->copy_mem((char *)dp + sizeof(struct efi_device_path_vendor) + + sizeof(struct efi_device_path_vendor) + + sizeof(u8), &end_node, sizeof(struct efi_device_path)); ret = boottime->install_protocol_interface(&disk_handle, &guid_device_path,