{"id":2224882,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2224882/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260419-type-v3-3-ec49acd6870e@oss.qualcomm.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.1/projects/18/?format=json","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},"msgid":"<20260419-type-v3-3-ec49acd6870e@oss.qualcomm.com>","date":"2026-04-19T10:24:05","name":"[v3,3/5] env: scsi: Add support for partition type GUID based environment","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"962a28f02bdb8366fb20f855a142df9b90c91b09","submitter":{"id":90810,"url":"http://patchwork.ozlabs.org/api/1.1/people/90810/?format=json","name":"Balaji Selvanathan","email":"balaji.selvanathan@oss.qualcomm.com"},"delegate":{"id":3651,"url":"http://patchwork.ozlabs.org/api/1.1/users/3651/?format=json","username":"trini","first_name":"Tom","last_name":"Rini","email":"trini@ti.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260419-type-v3-3-ec49acd6870e@oss.qualcomm.com/mbox/","series":[{"id":500492,"url":"http://patchwork.ozlabs.org/api/1.1/series/500492/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=500492","date":"2026-04-19T10:24:02","name":"Add partition type GUID support for environment","version":3,"mbox":"http://patchwork.ozlabs.org/series/500492/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2224882/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2224882/checks/","tags":{},"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=i9VW1fBp;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=exnIz6Du;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=oss.qualcomm.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com\n header.b=\"i9VW1fBp\";\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.b=\"exnIz6Du\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=none (p=none dis=none)\n header.from=oss.qualcomm.com","phobos.denx.de; spf=pass\n smtp.mailfrom=balaji.selvanathan@oss.qualcomm.com"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fz4Vp0NJwz1yD4\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 19 Apr 2026 20:24:50 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id B236B83B99;\n\tSun, 19 Apr 2026 12:24:47 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 7439F842B7; Sun, 19 Apr 2026 12:24:46 +0200 (CEST)","from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com\n [205.220.168.131])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 0356A839D9\n for <u-boot@lists.denx.de>; Sun, 19 Apr 2026 12:24:43 +0200 (CEST)","from pps.filterd (m0279863.ppops.net [127.0.0.1])\n by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63J0QvCn1885502\n for <u-boot@lists.denx.de>; Sun, 19 Apr 2026 10:24:42 GMT","from mail-pl1-f199.google.com (mail-pl1-f199.google.com\n [209.85.214.199])\n by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dm261tc00-1\n (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n for <u-boot@lists.denx.de>; Sun, 19 Apr 2026 10:24:42 +0000 (GMT)","by mail-pl1-f199.google.com with SMTP id\n d9443c01a7336-2b2e91add2aso17399525ad.1\n for <u-boot@lists.denx.de>; Sun, 19 Apr 2026 03:24:42 -0700 (PDT)","from hu-bselvana-blr.qualcomm.com\n (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19])\n by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b5fab0caf1sm72754675ad.42.2026.04.19.03.24.32\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 19 Apr 2026 03:24:40 -0700 (PDT)"],"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,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n cc:content-transfer-encoding:content-type:date:from:in-reply-to\n :message-id:mime-version:references:subject:to; s=qcppdkim1; bh=\n 4uuU3PLF8tPqUhV5YHbCgKz97GXzUgN3eDnojZX/8W8=; b=i9VW1fBppi2l+hcm\n vl0X2smOQI7LzQjkqbbGdPUVdjxwlU02tqgE41FR7M+K6FIYMZovcNpIWt+MxluI\n 8N/K7kcYvHJdmDADrUBCUFwqkH+KFfT83kCVqL0mrzoMVrix3y7YpLGkN4grAGml\n oMUi75zyI0qEs83ECjc5H9Xw99Zjs7C+0Cxu+E1/5TYQAQIci0mDB31apPQPji21\n HuRXY5I/NOntfaBbXQGAcSzBTJcB5I0uo2XqBxUWL1FANt8B+jy2Kh9mALynObsK\n sEmGkZctH85uJkn8THHeowSHmZYsJ6w56QDnM5JYYb/OxVYaSXYGWDce9nQSxVmZ\n 2x6QIg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oss.qualcomm.com; s=google; t=1776594281; x=1777199081; darn=lists.denx.de;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:from:to:cc:subject:date:message-id\n :reply-to; bh=4uuU3PLF8tPqUhV5YHbCgKz97GXzUgN3eDnojZX/8W8=;\n b=exnIz6DukUBI8sbSn0WoIq9D20+Nx9oa6W70pJVLuwjWi24eKj0Iw2BzSsn5EbyIaE\n inT/WNnkQCFQ9ROLRabkLq11Mtq60QU6LVhbGmUBLEc2YMEoib4ya/owrMCxhWtBJjnb\n 7JG0M1+Nw0WVA0qvWfmFxotl6UsAED9eDP/DA75VdRHWubg1bfAobYOU0iooIyTN6IeX\n 8Cd6TOPYaRMue6Yb7KITn9pMthLQ8BswD7pQ7qGq2cYcWXn20XkndN9oxKYyo9n9m1Xw\n 2XSQvmmxugZJpq9d73GFT8WOaDGiqDSiCS7xjFqpHMk2tsDi5yhMzE9PvoRq5cskfFhA\n fUvw=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776594281; x=1777199081;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=4uuU3PLF8tPqUhV5YHbCgKz97GXzUgN3eDnojZX/8W8=;\n b=AzigMGxsM0DotSjSpNr3pOlMmQLdBOAxPrPwNd30cJf4uTyhrnb/0fF0JSSetuBQXE\n yuOegN/HNqysg7Bwy7PXoCE10J5y3Gh1c1P6w3Uby1aIGG6nXvLgkhe9ZxMAzq1VvVkV\n nViV3hlv2WnTn9IimZfOyq6ETSHIrcxP5DndoTcSwWkEIbHJt/vkD+Xg7SEv9qyarlg/\n iuQfehKsP5/TIYbMGuiZp/dCAlBhIVi9Vq3Lf1ysdgCSlSAHHoyZLjhr+ed4dg/nPfst\n ru4aT5aT3nSgIs362CLn+kqPVQEW+GgB9iBIUPjJQTwKaVqU65S/QgOZlbFshbyhc8RQ\n Hdhw==","X-Gm-Message-State":"AOJu0Yx3mnNUjoWl59yUpLW/GPbyUScZ6g/zrE2ZmeFfDSX6LKr/kfG0\n nT3jLGrEkmo61lPsjaV6cNMt9/8nbGcAJQPmqzUlox36wPDh597Wdg+n0Na2BZ6yF9LonRY4Ox4\n zqmUep30jddQVq5hGpG/NotXUqeSbwEsbdspBlbGPtMvI7+giOFnSrATQ","X-Gm-Gg":"AeBDievclUNu+eezkZCJuYh2yz5f1TSWw2hCCXssuJfkvdQGjIaiFfnvM7l5YBKKNzA\n Hspzhx2volFmxK5vcNwNqnFYUwDkv3rX1NHrLMNbPqOlYmC/1EPZmwB00PcLOHq0xPsrxoXJGDx\n N1c0RO6p3GyjjtoISXgsG8t+lzQbDvBGYQcGMTaPpiVu6WzKk8ASonJIrnQ+0/KXR7Ho59G0vcq\n JfMcLR+7qMuh72FoYbElFEAH5tJEKeaoW+Mt/qIKeBWnaQsmZ0VYHtnOt/mXghMJSW4VqmKKwLW\n MowKxAaSJK5+Y7vNdFH5eFJxd3wq1J0Ha98wV2a8MepaitJ/N4FXpLcb7V8UglpabZNmB2jus7w\n n+SjV+dh8vj+zKyT62efXmwx8XrqlpNwo69anXQUMqIhkM9uoEz+nJsk5zTKYADaE9o0bMRTIiQ\n jHdA+5ygoInHT46SYtujT+dnobV2Qsvm7sW0rpvBlzS6LrqjT/rBVIBWgbXQ8s","X-Received":["by 2002:a17:903:487:b0:2b2:49a7:a5bc with SMTP id\n d9443c01a7336-2b5f9f534e4mr74306045ad.39.1776594280976;\n Sun, 19 Apr 2026 03:24:40 -0700 (PDT)","by 2002:a17:903:487:b0:2b2:49a7:a5bc with SMTP id\n d9443c01a7336-2b5f9f534e4mr74305825ad.39.1776594280466;\n Sun, 19 Apr 2026 03:24:40 -0700 (PDT)"],"From":"Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>","Date":"Sun, 19 Apr 2026 15:54:05 +0530","Subject":"[PATCH v3 3/5] env: scsi: Add support for partition type GUID\n based environment","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20260419-type-v3-3-ec49acd6870e@oss.qualcomm.com>","References":"<20260419-type-v3-0-ec49acd6870e@oss.qualcomm.com>","In-Reply-To":"<20260419-type-v3-0-ec49acd6870e@oss.qualcomm.com>","To":"u-boot@lists.denx.de, Sumit Garg <sumit.garg@kernel.org>,\n u-boot-qcom@groups.io","Cc":"Tom Rini <trini@konsulko.com>, Quentin Schulz <quentin.schulz@cherry.de>,\n  Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Javier Tia <javier.tia@linaro.org>,\n Varadarajan Narayanan <quic_varada@quicinc.com>,\n Rasmus Villemoes <ravi@prevas.dk>,\n Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>,\n Javier Martinez Canillas <javierm@redhat.com>,\n Miquel Raynal <miquel.raynal@bootlin.com>,\n =?utf-8?q?Jo=C3=A3o_Marcos_Costa?= <joaomarcos.costa@bootlin.com>,\n Tien Fong Chee <tien.fong.chee@altera.com>,\n Richard Genoud <richard.genoud@bootlin.com>,\n Jan Kiszka <jan.kiszka@siemens.com>, David Lechner <dlechner@baylibre.com>,\n Casey Connolly <casey.connolly@linaro.org>,\n Simon Glass <simon.glass@canonical.com>,\n Marek Vasut <marek.vasut+renesas@mailbox.org>,\n Christian Marangi <ansuelsmth@gmail.com>, Michael Walle <mwalle@kernel.org>,\n Sumit Garg <sumit.garg@oss.qualcomm.com>,\n Neil Armstrong <neil.armstrong@linaro.org>,\n Aswin Murugan <aswin.murugan@oss.qualcomm.com>,\n Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>,\n Simon Glass <sjg@chromium.org>,\n Mattijs Korpershoek <mkorpershoek@kernel.org>,\n Jerome Forissier <jerome.forissier@arm.com>,\n Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>","X-Mailer":"b4 0.14.3","X-Developer-Signature":"v=1; a=ed25519-sha256; t=1776594245; l=6857;\n i=balaji.selvanathan@oss.qualcomm.com; s=20260213; h=from:subject:message-id;\n bh=ptaZIRl8Fd1wFSG4SCuaGj53b/GoACj6FU/OIW5q6cc=;\n b=Rn7UBp/b6RZNpghC/a+2YNDNRy+MEeYpRc6k9BKDJ+wNmL1zbTobQPTWYpDVkdMCgOLvoab0P\n E3yKeOqScuyDWu72LnSmLEJxQAnf85PdWJB8k0obBZuTbdHPbfxDRrx","X-Developer-Key":"i=balaji.selvanathan@oss.qualcomm.com; a=ed25519;\n pk=CDpYiUU3SH7KGEtsBvY2tBGPiWfMxqWJF0p2LftOfnc=","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDE5MDEwOCBTYWx0ZWRfX6/kExViKOSlb\n r6KH8AFEpQyIpa2Rz3oLEZz8E1jxNsQj0DraSUAs+TS1UKLIvu3fMNrjDo+6iz4esW9l1sC1soT\n L27wW2838M0f/pb8Ji/Ouf8KtwNCKfwC0zzSjPcM2koYXT8gOqljUjzEnmpqWjEDkky0y/4tSfW\n J0nvuN0XYkQs8+v9Ak+WQGLmSKmZvKz/TvW8npTx2JldUhRdx4QtEKuCR6BLOS6zbrEBFo1qRjj\n HK7jXPquBLWEBjdyb5NlbXwtF8g4LgdpTzI1wR7Ry+6oQZRbKY2Cda9SsG7HiAUbq/ZgLJO7YnB\n hxscpIGtlw+mFLiF4kyP7hyUr77/aVtbAm3cqiZIbc+LQDDFRSDV1rP92KjpQpGq0tSVuX8zmOU\n s0WnF6xfFu2FENcaPyIuTadf3uFJp8s2psg4ws/WG8BtT9V0HPwFDLqQJn4Vq3qcbunUq9S06oh\n 8Y9M7Y2tX/GUMV0dyAQ==","X-Authority-Analysis":"v=2.4 cv=dcywG3Xe c=1 sm=1 tr=0 ts=69e4ad6a cx=c_pps\n a=JL+w9abYAAE89/QcEU+0QA==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17\n a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10\n a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22\n a=EUspDBNiAAAA:8 a=ol_ERQdGGk5JG7MUTbIA:9 a=QEXdDO2ut3YA:10\n a=324X-CrmTo6CU4MGRt3R:22","X-Proofpoint-ORIG-GUID":"BFiLqSlZthOq4rO9zDwtpRV9yJpA6r-6","X-Proofpoint-GUID":"BFiLqSlZthOq4rO9zDwtpRV9yJpA6r-6","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-19_03,2026-04-17_04,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n adultscore=0 bulkscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0\n suspectscore=0 phishscore=0 malwarescore=0 priorityscore=1501 spamscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190108","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <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>,\n <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.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"Add support for locating SCSI environment partition using GPT type\nGUID instead of unique UUID. This enables the saveenv command to\nwork with partitions identified by their type rather than unique\nidentifiers, providing flexibility for systems where partition\nUUIDs may vary across devices but types remain constant.\n\nIntroduce a Kconfig choice statement to select between three partition\nlookup methods. The choice provides mutually exclusive options:\nENV_SCSI_PART_USE_UUID (default), ENV_SCSI_PART_USE_TYPE_GUID, and\nENV_SCSI_PART_USE_HW. The corresponding string configs depend on their\nrespective selection method, creating a clear configuration structure.\n\nIntroduce CONFIG_ENV_SCSI_PART_TYPE_GUID configuration option that\nallows specifying a partition type GUID for environment storage.\nWhen SCSI_ENV_PART_USE_TYPE_GUID is enabled, the environment subsystem\nuses the type GUID based lookup method via\nscsi_get_blk_by_type_guid() to find the first matching partition.\n\nRefactor env/scsi.c to use compile-time preprocessor conditionals\ninstead of runtime string checks. Replace the previous logic that\nchecked if CONFIG_ENV_SCSI_PART_UUID was empty with explicit #if/#elif\nbranches for each method.\n\nElevate hardware partition selection from an implicit fallback to an\nexplicit choice (ENV_SCSI_PART_USE_HW), improving configuration clarity.\nMove ENV_SCSI_HW_PARTITION to depend on this new option.\n\nSigned-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>\n---\nChanges in v3:\n- Introduce a new choice config: ENV_SCSI_PART_USE_HW for\n  ENV_SCSI_HW_PARTITION\n- Refactor env_scsi_get_part and env_scsi_load functions based\n  on the choice configs\n\nChanges in v2:\n- Introduce a Kconfig choice config to select between UUID-based\nand type GUID-based partition lookup methods.\n---\n env/Kconfig | 51 +++++++++++++++++++++++++++++++++++++++++++--------\n env/scsi.c  | 45 +++++++++++++++++++++++++++------------------\n 2 files changed, 70 insertions(+), 26 deletions(-)","diff":"diff --git a/env/Kconfig b/env/Kconfig\nindex 7abd82ab6f3..d5d956cb4ce 100644\n--- a/env/Kconfig\n+++ b/env/Kconfig\n@@ -780,10 +780,51 @@ config ENV_MMC_USE_DT\n \t  The 2 defines CONFIG_ENV_OFFSET, CONFIG_ENV_OFFSET_REDUND\n \t  are not used as fallback.\n \n+choice\n+\tprompt \"SCSI partition selection method\"\n+\tdepends on ENV_IS_IN_SCSI\n+\tdefault ENV_SCSI_PART_USE_UUID\n+\thelp\n+\t  Select the method to identify the SCSI partition for environment storage.\n+\n+config ENV_SCSI_PART_USE_UUID\n+\tbool \"Use partition UUID\"\n+\thelp\n+\t  Use the partition's unique UUID to identify the SCSI partition\n+\t  for environment storage.\n+\n+config ENV_SCSI_PART_USE_TYPE_GUID\n+\tbool \"Use partition type GUID\"\n+\thelp\n+\t  Use the partition type GUID to identify the SCSI partition\n+\t  for environment storage. The first partition matching the\n+\t  specified type GUID will be used.\n+\n+config ENV_SCSI_PART_USE_HW\n+\tbool \"Use hardware partition number\"\n+\thelp\n+\t  Use the hardware device number to identify the SCSI device\n+\t  for environment storage.\n+\n+endchoice\n+\n+config ENV_SCSI_PART_UUID\n+\tstring \"SCSI partition UUID for saving environment\"\n+\tdepends on ENV_SCSI_PART_USE_UUID\n+\thelp\n+\t  UUID of the SCSI partition that you want to store the environment in.\n+\n+config ENV_SCSI_PART_TYPE_GUID\n+\tstring \"SCSI partition type GUID for saving environment\"\n+\tdepends on ENV_SCSI_PART_USE_TYPE_GUID\n+\thelp\n+\t  Type GUID of the SCSI partition to store the environment in.\n+\t  Uses the first partition matching this type GUID.\n+\n config ENV_SCSI_HW_PARTITION\n \tstring \"SCSI hardware partition number\"\n-\tdepends on ENV_IS_IN_SCSI\n-\tdefault 0\n+\tdepends on ENV_SCSI_PART_USE_HW\n+\tdefault \"0\"\n \thelp\n \t  SCSI hardware partition device number on the platform where the\n \t  environment is stored.  Note that this is not related to any software\n@@ -791,12 +832,6 @@ config ENV_SCSI_HW_PARTITION\n \t  partition 0 or the first boot partition, which is 1 or some other defined\n \t  partition.\n \n-config ENV_SCSI_PART_UUID\n-\tstring \"SCSI partition UUID for saving environment\"\n-\tdepends on ENV_IS_IN_SCSI\n-\thelp\n-\t  UUID of the SCSI partition that you want to store the environment in.\n-\n config ENV_USE_DEFAULT_ENV_TEXT_FILE\n \tbool \"Create default environment from file\"\n \tdepends on !COMPILE_TEST\ndiff --git a/env/scsi.c b/env/scsi.c\nindex 91a6c430302..abb8b0a1dfd 100644\n--- a/env/scsi.c\n+++ b/env/scsi.c\n@@ -41,14 +41,19 @@ static inline struct env_scsi_info *env_scsi_get_part(void)\n \t\tis_scsi_scanned = true;\n \t}\n \n-\tif (CONFIG_ENV_SCSI_PART_UUID[0] == '\\0') {\n-\t\tif (blk_get_device_part_str(\"scsi\", CONFIG_ENV_SCSI_HW_PARTITION,\n-\t\t\t\t\t    &ep->blk, &ep->part, true))\n-\t\t\treturn NULL;\n-\t} else {\n-\t\tif (scsi_get_blk_by_uuid(CONFIG_ENV_SCSI_PART_UUID, &ep->blk, &ep->part))\n-\t\t\treturn NULL;\n-\t}\n+#if defined(CONFIG_ENV_SCSI_PART_USE_TYPE_GUID)\n+\tif (scsi_get_blk_by_type_guid(CONFIG_ENV_SCSI_PART_TYPE_GUID, &ep->blk, &ep->part))\n+\t\treturn NULL;\n+\n+#elif defined(CONFIG_ENV_SCSI_PART_USE_UUID)\n+\tif (scsi_get_blk_by_uuid(CONFIG_ENV_SCSI_PART_UUID, &ep->blk, &ep->part))\n+\t\treturn NULL;\n+\n+#elif defined(CONFIG_ENV_SCSI_PART_USE_HW)\n+\tif (blk_get_device_part_str(\"scsi\", CONFIG_ENV_SCSI_HW_PARTITION,\n+\t\t\t\t    &ep->blk, &ep->part, true))\n+\t\treturn NULL;\n+#endif\n \n \tep->count = CONFIG_ENV_SIZE / ep->part.blksz;\n \n@@ -95,20 +100,24 @@ static int env_scsi_load(void)\n \tint ret;\n \n \tif (!ep) {\n-\t\tif (CONFIG_ENV_SCSI_PART_UUID[0] == '\\0')\n-\t\t\tenv_set_default(\"SCSI partition \" CONFIG_ENV_SCSI_HW_PARTITION \" not found\", 0);\n-\t\telse\n-\t\t\tenv_set_default(CONFIG_ENV_SCSI_PART_UUID \" partition not found\", 0);\n-\n+#if defined(CONFIG_ENV_SCSI_PART_USE_TYPE_GUID)\n+\t\tenv_set_default(CONFIG_ENV_SCSI_PART_TYPE_GUID \" partition not found\", 0);\n+#elif defined(CONFIG_ENV_SCSI_PART_USE_UUID)\n+\t\tenv_set_default(CONFIG_ENV_SCSI_PART_UUID \" partition not found\", 0);\n+#elif defined(CONFIG_ENV_SCSI_PART_USE_HW)\n+\t\tenv_set_default(\"SCSI partition \" CONFIG_ENV_SCSI_HW_PARTITION \" not found\", 0);\n+#endif\n \t\treturn -ENOENT;\n \t}\n \n \tif (blk_dread(ep->blk, ep->part.start, ep->count, &envbuf) != ep->count) {\n-\t\tif (CONFIG_ENV_SCSI_PART_UUID[0] == '\\0')\n-\t\t\tenv_set_default(\"SCSI partition \" CONFIG_ENV_SCSI_HW_PARTITION \" read failed\", 0);\n-\t\telse\n-\t\t\tenv_set_default(CONFIG_ENV_SCSI_PART_UUID \" partition read failed\", 0);\n-\n+#if defined(CONFIG_ENV_SCSI_PART_USE_TYPE_GUID)\n+\t\tenv_set_default(CONFIG_ENV_SCSI_PART_TYPE_GUID \" partition read failed\", 0);\n+#elif defined(CONFIG_ENV_SCSI_PART_USE_UUID)\n+\t\tenv_set_default(CONFIG_ENV_SCSI_PART_UUID \" partition read failed\", 0);\n+#elif defined(CONFIG_ENV_SCSI_PART_USE_HW)\n+\t\tenv_set_default(\"SCSI partition \" CONFIG_ENV_SCSI_HW_PARTITION \" read failed\", 0);\n+#endif\n \t\treturn -EIO;\n \t}\n \n","prefixes":["v3","3/5"]}