From patchwork Tue May 13 09:17:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varadarajan Narayanan X-Patchwork-Id: 2084894 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=jqBYwHI7; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4ZxWB45xzKz1yYx for ; Tue, 13 May 2025 19:18:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EBFBD81DD6; Tue, 13 May 2025 11:18:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=quicinc.com 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=quicinc.com header.i=@quicinc.com header.b="jqBYwHI7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7698381DD6; Tue, 13 May 2025 11:18:58 +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,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 20748800C1 for ; Tue, 13 May 2025 11:18:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=quic_varada@quicinc.com Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54D91qXA012064; Tue, 13 May 2025 09:18:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= rw9zFR2+9Z8OdB5WclhKEVOJcMJOu33vMqp0i98+R9w=; b=jqBYwHI7TeFhU3d3 4uLLaolRsM+k9FjU3e7slf+H3hXK14meAfUpWgCbCztH8pIfV4HeDcRTN9v83EMs 9LOuk6+wSoo7Qm4KQE3S2eA9Bs6p+kU+ayOQvBfJ1GNknXIbcfiIl2q91BMV+nvd 1jccZ69FGFT+5CayJ8OzPutYZKSN0/SOaeMrGDcLg0/GDCDH/CV56aP22qPE3KfU 6NDwZG65KikpFxDOdmBXiO21iboqQpXep84WgLbQjODfJityvZJyetJNQR/cgM9p mg30zpoZjpVK7ywvZwuqv6kYT9PmWvf+Bh76sOvwczTcQXYhhhSs28JtjIEphoB+ WOKcAg== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46kc3mv11y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 May 2025 09:18:28 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 54D9IScU018548 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 May 2025 09:18:28 GMT Received: from hu-varada-blr.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 13 May 2025 02:18:23 -0700 From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 1/5] disk: part: implement generic function part_get_info_by_uuid() Date: Tue, 13 May 2025 14:47:06 +0530 Message-ID: <20250513091710.3719292-2-quic_varada@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250513091710.3719292-1-quic_varada@quicinc.com> References: <20250513091710.3719292-1-quic_varada@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: -ByvhmfVs1bDK_uxU4lnrz3NDzvMypmw X-Proofpoint-GUID: -ByvhmfVs1bDK_uxU4lnrz3NDzvMypmw X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTEzMDA4OCBTYWx0ZWRfX+FGuS/edV4/r G+KcBTRGHzD5nxNyfQE9L0+jBcNgey4rcxX/1nhsD/HiQZcBXRrKHH21lFE1aqp9kjdLhz0DC5L AFCsBqCSoHKHS6S1+ElkLdBGF839OCnxU39AhqtHPHQ3jZMS4iaeFFnOhr96BmNZYuNON108OJ9 Vfk6yOMimFmoHh+YoaWfyHhGmLVYy5tZe8WfTF/0IHSNsV8BuZhdjFh/4onI0wuNKGQZCL8tJud 4nOv0g/d8A/l9CzHDQYKRI8ulSG1h5VrRwexkKkZIqsZTJa7katkyMjnyxsQY+gV1xCHy5oHW9Z N0Ki9k/vH9HgzHXY3m0IRHvZUOiVdIuYr9Sgpuwy9TlKlGBOeNM5DCnV+FOsM/YYm5BtD79YXY8 5iFlSRYgKQNApG+zy+uy3S6eGmKO1o2uwjWGZ/L7eh2saQEa2P/wLtL12WMVmtiPPQuQptYw X-Authority-Analysis: v=2.4 cv=afhhnQot c=1 sm=1 tr=0 ts=68230e64 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=E-TnPL4q6OkJPdRbN5YA:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-12_07,2025-05-09_01,2025-02-21_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 spamscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2504070000 definitions=main-2505130088 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean Add function to search for a partition by UUID as partition names may not be unique. Signed-off-by: Varadarajan Narayanan --- v4: Use if (!CONFIG_IS_ENABLED(PARTITION_UUIDS)) instead of '#if' Not breaking from the for loop if '->get_info()' returns non-zero to have similar behaviour as in part_get_info_by_name(). --- disk/part.c | 39 +++++++++++++++++++++++++++++++++++++++ include/part.h | 20 ++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/disk/part.c b/disk/part.c index 303178161c0..8eefda39d7b 100644 --- a/disk/part.c +++ b/disk/part.c @@ -698,6 +698,45 @@ int part_get_info_by_name(struct blk_desc *desc, const char *name, return -ENOENT; } +int part_get_info_by_uuid(struct blk_desc *desc, const char *uuid, + struct disk_partition *info) +{ + struct part_driver *part_drv; + int ret; + int i; + + if (!CONFIG_IS_ENABLED(PARTITION_UUIDS)) + return -ENOENT; + + part_drv = part_driver_lookup_type(desc); + if (!part_drv) + return -1; + + if (!part_drv->get_info) { + log_debug("## Driver %s does not have the get_info() method\n", + part_drv->name); + return -ENOSYS; + } + + for (i = 1; i < part_drv->max_entries; i++) { + ret = part_drv->get_info(desc, i, info); + if (ret != 0) { + /* + * Partition with this index can't be obtained, but + * further partitions might be, so keep checking. + */ + continue; + } + + if (!strncasecmp(uuid, disk_partition_uuid(info), UUID_STR_LEN)) { + /* matched */ + return i; + } + } + + return -ENOENT; +} + /** * Get partition info from device number and partition name. * diff --git a/include/part.h b/include/part.h index fcb3c13dea4..3e6eb0ec33f 100644 --- a/include/part.h +++ b/include/part.h @@ -315,6 +315,20 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str, int part_get_info_by_name(struct blk_desc *desc, const char *name, struct disk_partition *info); +/** + * part_get_info_by_uuid() - Search for a partition by uuid + * among all available registered partitions + * + * @desc: block device descriptor + * @uuid: the specified table entry uuid + * @info: the disk partition info + * + * Return: the partition number on match (starting on 1), -ENOENT on no match, + * otherwise error + */ +int part_get_info_by_uuid(struct blk_desc *desc, const char *uuid, + struct disk_partition *info); + /** * part_get_info_by_dev_and_name_or_num() - Get partition info from dev number * and part name, or dev number and @@ -386,6 +400,12 @@ static inline int part_get_info_by_name(struct blk_desc *desc, const char *name, return -ENOENT; } +static inline int part_get_info_by_uuid(struct blk_desc *desc, const char *uuid, + struct disk_partition *info) +{ + return -ENOENT; +} + static inline int part_get_info_by_dev_and_name_or_num(const char *dev_iface, const char *dev_part_str, From patchwork Tue May 13 09:17:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varadarajan Narayanan X-Patchwork-Id: 2084897 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=mTPKDuY7; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4ZxWB93ST6z1yXB for ; Tue, 13 May 2025 19:18:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3DD9182A0A; Tue, 13 May 2025 11:19:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=quicinc.com 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=quicinc.com header.i=@quicinc.com header.b="mTPKDuY7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 100D7800C1; Tue, 13 May 2025 11:18:59 +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,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 D311482998 for ; Tue, 13 May 2025 11:18:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=quic_varada@quicinc.com Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54D9Dena011768; Tue, 13 May 2025 09:18:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= LMCLV1THVUw3wgAzrEVnfngwijvqZN/PQv2YsST3Y1Y=; b=mTPKDuY7xp+EmV72 SmiwnstvsBDU7R1PdzxkunDe4E7Lfw+D9nll8bASbh63Kt85eUvmcc3LFzqeuZ3q Ovxl17pjl5k6HAQNCLPoAva9gD5nbLmoWp+gJegfGx5x2pu2cd+XhJ8oNEeuRglt h6g4PaY9gRnasF4k5PPNYoYK8x1hFXSjQemnNha+EnB75iAt5ErLoAzC3Uq4W1Zr fedzmZz3YNkd2AOCFnu02SMLud7ueGpCBmD9pWLHJfUXLdFppzg59LIXZSzKXVEz qHWXQN2T7p1Y3ncyOFqzKKigqat9beRgYezCO5fR36MFdSivmTGLNZN7+LolbXsV 0jiL5g== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46kc3mv129-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 May 2025 09:18:33 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 54D9IXQt018664 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 May 2025 09:18:33 GMT Received: from hu-varada-blr.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 13 May 2025 02:18:28 -0700 From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 2/5] scsi: Implement get_blk() function Date: Tue, 13 May 2025 14:47:07 +0530 Message-ID: <20250513091710.3719292-3-quic_varada@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250513091710.3719292-1-quic_varada@quicinc.com> References: <20250513091710.3719292-1-quic_varada@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: STHrIaYK4-C1vByE4r5Zh8JbCl-GP1yY X-Proofpoint-GUID: STHrIaYK4-C1vByE4r5Zh8JbCl-GP1yY X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTEzMDA4OCBTYWx0ZWRfX6SYLrf6/IMOM Xt8j3OgYhgwLHFuRqxpeKBGGAXadys4AZYlmhjKVd2Wy+poYKyNdoKSQnTIQg6iom73LmrSW/jS Nmfj+GwxPfKoozYXI9n7BPSbkxxSfiG0surchyC/uIwMMHzo/hfRc6oBmZNa7FTfd+Bx9pleoos zKxgROoLGY4wr9WM+uaq/rdWkiAvRy3zWLMsv7Xk47NjtNG4swKHLmrgQH9mL2ex26Yu8CxIFOB qnRriy7SAo61psB3AIGErn1C25d1wo1fMyeWQ3qQSo/U5+EhIivoI1nkCg6wsc8KoreX3HQ2RBc Q7gnPg+5ASkastEBK5jSMD5y9rq6xc1GjYlnBJm7h4UYxO0ZeM0aSypjHSDd3YFI6mgU8GvOHUt oUIRKyCMj4o9UOGwddJqSz1iitJ8ZS33GH+dwrL1jSU3Kez5XrHehvAFEndyFao1k76IADev X-Authority-Analysis: v=2.4 cv=afhhnQot c=1 sm=1 tr=0 ts=68230e69 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=KeAuS3ePNnYHWw_nrfAA:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-12_07,2025-05-09_01,2025-02-21_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 spamscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2504070000 definitions=main-2505130088 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean Add a function to obtain the block device for SCSI. Signed-off-by: Varadarajan Narayanan --- v3: * s/scsi_get_blk/scsi_get_blk_by_uuid * s/partition_name/uuid --- drivers/scsi/scsi-uclass.c | 30 ++++++++++++++++++++++++++++++ include/scsi.h | 10 ++++++++++ 2 files changed, 40 insertions(+) diff --git a/drivers/scsi/scsi-uclass.c b/drivers/scsi/scsi-uclass.c index 1ee8236c05c..3eb6069649f 100644 --- a/drivers/scsi/scsi-uclass.c +++ b/drivers/scsi/scsi-uclass.c @@ -10,7 +10,9 @@ #define LOG_CATEGORY UCLASS_SCSI +#include #include +#include #include int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb) @@ -23,6 +25,34 @@ int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb) return ops->exec(dev, pccb); } +int scsi_get_blk_by_uuid(const char *uuid, + struct blk_desc **blk_desc_ptr, + struct disk_partition *part_info_ptr) +{ + static int is_scsi_scanned; + struct blk_desc *blk; + int i, ret; + + if (!is_scsi_scanned) { + scsi_scan(false /* no verbose */); + is_scsi_scanned = 1; + } + + for (i = 0; i < blk_find_max_devnum(UCLASS_SCSI) + 1; i++) { + ret = blk_get_desc(UCLASS_SCSI, i, &blk); + if (ret) + continue; + + ret = part_get_info_by_uuid(blk, uuid, part_info_ptr); + if (ret > 0) { + *blk_desc_ptr = blk; + return 0; + } + } + + return -1; +} + int scsi_bus_reset(struct udevice *dev) { struct scsi_ops *ops = scsi_get_ops(dev); diff --git a/include/scsi.h b/include/scsi.h index ab53b47b58f..8d6c5116419 100644 --- a/include/scsi.h +++ b/include/scsi.h @@ -351,6 +351,16 @@ int scsi_scan(bool verbose); */ int scsi_scan_dev(struct udevice *dev, bool verbose); +/** + * scsi_get_blk_by_uuid() - Provides SCSI partition information. + * + * @uuid: UUID of the partition for fetching its info + * @blk_desc_ptr: Provides the blk descriptor + * @part_info_ptr: Provides partition info + */ +int scsi_get_blk_by_uuid(const char *uuid, struct blk_desc **blk_desc_ptr, + struct disk_partition *part_info_ptr); + #define SCSI_IDENTIFY 0xC0 /* not used */ /* Hardware errors */ From patchwork Tue May 13 09:17:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varadarajan Narayanan X-Patchwork-Id: 2084898 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=PmShhhRU; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4ZxWBM3ygWz1yXB for ; Tue, 13 May 2025 19:19:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9CEED829E7; Tue, 13 May 2025 11:19:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=quicinc.com 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=quicinc.com header.i=@quicinc.com header.b="PmShhhRU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6E1F5800C1; Tue, 13 May 2025 11:19:02 +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,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 35D25829E4 for ; Tue, 13 May 2025 11:19:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=quic_varada@quicinc.com Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54D667nH030207; Tue, 13 May 2025 09:18:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 3odDkCKvEoXRxpN8QhVGQklhazALHDpYFVJe4egpqUc=; b=PmShhhRUHW1SOxzT fWQgKrWasCgf1go2x1M7NQDFMnQ8LmmsZ0rpO9LUe4XowagVzJDZZQIsW6mPpLiJ tu4QEuCzxwu2lntX+uglDTM5XkIusc7DQpv2dp9128QKIFTtpEuLJQp3Ebm7ro7Q mTORoN+PV33A6swggefDt7Wml3VE10s9wfXUbeQtP3Mt4Kqr9o/HzIiZflC5uWmO Uc9n/KyCsShgQ9BnbPnMjkhnTH5XMAxDC6Xy3snPXAscZnbLNLkZJQWa7LspQ1DW LkbxLW1ZIimzcV2swbGzCSus+6huj+P0Xu6glyuGcRIUU+g71RtkVaXSlDy4p0jg +aVJbw== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46hx4k76tr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 May 2025 09:18:39 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 54D9IcKI026148 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 May 2025 09:18:38 GMT Received: from hu-varada-blr.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 13 May 2025 02:18:33 -0700 From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 3/5] env: Add support for storing env variables in SCSI devices Date: Tue, 13 May 2025 14:47:08 +0530 Message-ID: <20250513091710.3719292-4-quic_varada@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250513091710.3719292-1-quic_varada@quicinc.com> References: <20250513091710.3719292-1-quic_varada@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Authority-Analysis: v=2.4 cv=ReqQC0tv c=1 sm=1 tr=0 ts=68230e6f cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=XyhusxJ8NkhsuqipcxUA:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: Bm8fPypUWOd8FdmXUi--bwLvpay8WrtQ X-Proofpoint-ORIG-GUID: Bm8fPypUWOd8FdmXUi--bwLvpay8WrtQ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTEzMDA4OCBTYWx0ZWRfX++/wXWFgXL3p kNbQnWwIfEaKjLb1qG651lD8zuBLC8bYsd8t8YlJGUdlknXkgB9963KppDlMaxavGYul6QTI2T5 zlPQE28avt1t2LyP/Zyjo8CS7jxRlwFpxPYtUNi76QFz0s6YY489fg/t27pH7uZmPOxepG9EvuP b1+8uv48F8OF6trBrqc0mXrNmeMrVZ6e4NcByAj2CzhK7P8a2fiLn/X0b2gTEdRa8zlEiWEZ7QW YU+C8rHd/DOWLYUh4GZUxMN4eGUxKwHW15UmPD/+ZTUpAJwl4TSFfuXZnMSxBzvEA4okl43Bygt qW410lw3AfPh7drv8q528se+rWJJE0hmMYLIAaMMPkMTW6Hce1WFpP0j8NB/KRrizuAqxPnn+j2 ItCnpIa7gWfUOrR5a/lP7Wq4Co26cCDrbw/jIh+g4/Ml0JwKndpD/9owGYLyaFEYWz5NBQop X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-12_07,2025-05-09_01,2025-02-21_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 spamscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 adultscore=0 malwarescore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2504070000 definitions=main-2505130088 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean Allow SCSI to be able to store environment variables. Signed-off-by: Varadarajan Narayanan --- v3: s/SCSI_ENV_PART/SCSI_ENV_PART_UUID --- env/Kconfig | 15 +++++- env/Makefile | 1 + env/env.c | 3 ++ env/scsi.c | 115 +++++++++++++++++++++++++++++++++++++++++ include/env_internal.h | 1 + 5 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 env/scsi.c diff --git a/env/Kconfig b/env/Kconfig index 9f5ec44601e..9081f7099b7 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -74,7 +74,7 @@ config ENV_IS_DEFAULT !ENV_IS_IN_MMC && !ENV_IS_IN_NAND && \ !ENV_IS_IN_NVRAM && !ENV_IS_IN_ONENAND && \ !ENV_IS_IN_REMOTE && !ENV_IS_IN_SPI_FLASH && \ - !ENV_IS_IN_UBI && !ENV_IS_IN_MTD + !ENV_IS_IN_UBI && !ENV_IS_IN_MTD && !ENV_IS_IN_SCSI select ENV_IS_NOWHERE config ENV_IS_NOWHERE @@ -297,6 +297,13 @@ config ENV_IS_IN_NAND Currently, CONFIG_ENV_OFFSET_REDUND is not supported when using CONFIG_ENV_OFFSET_OOB. +config ENV_IS_IN_SCSI + bool "Environment in an SCSI device" + depends on SCSI + help + Define this if you have an SCSI device which you want to use for the + environment. + config ENV_RANGE hex "Length of the region in which the environment can be written" depends on ENV_IS_IN_NAND @@ -731,6 +738,12 @@ config ENV_MMC_USE_DT The 2 defines CONFIG_ENV_OFFSET, CONFIG_ENV_OFFSET_REDUND are not used as fallback. +config SCSI_ENV_PART_UUID + string "SCSI partition UUID for saving environment" + depends on ENV_IS_IN_SCSI + help + UUID of the SCSI partition that you want to store the environment in. + config USE_DEFAULT_ENV_FILE bool "Create default environment from file" help diff --git a/env/Makefile b/env/Makefile index 3b9c71d5681..d11b87702c1 100644 --- a/env/Makefile +++ b/env/Makefile @@ -28,5 +28,6 @@ obj-$(CONFIG_$(PHASE_)ENV_IS_IN_NAND) += nand.o obj-$(CONFIG_$(PHASE_)ENV_IS_IN_SPI_FLASH) += sf.o obj-$(CONFIG_$(PHASE_)ENV_IS_IN_MTD) += mtd.o obj-$(CONFIG_$(PHASE_)ENV_IS_IN_FLASH) += flash.o +obj-$(CONFIG_$(PHASE_)ENV_IS_IN_SCSI) += scsi.o CFLAGS_embedded.o := -Wa,--no-warn -DENV_CRC=$(shell tools/envcrc 2>/dev/null) diff --git a/env/env.c b/env/env.c index dbaeedc3c3b..7a9c96b4078 100644 --- a/env/env.c +++ b/env/env.c @@ -46,6 +46,9 @@ static enum env_location env_locations[] = { #ifdef CONFIG_ENV_IS_IN_MMC ENVL_MMC, #endif +#ifdef CONFIG_ENV_IS_IN_SCSI + ENVL_SCSI, +#endif #ifdef CONFIG_ENV_IS_IN_NAND ENVL_NAND, #endif diff --git a/env/scsi.c b/env/scsi.c new file mode 100644 index 00000000000..207717e17b1 --- /dev/null +++ b/env/scsi.c @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2008-2011 Freescale Semiconductor, Inc. + */ + +/* #define DEBUG */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; +static env_t envbuf; + +struct env_scsi_info { + struct blk_desc *blk; + struct disk_partition part; + int count; +}; + +static struct env_scsi_info env_part; + +static inline struct env_scsi_info *env_scsi_get_part(void) +{ + struct env_scsi_info *ep = &env_part; + + if (scsi_get_blk_by_uuid(CONFIG_SCSI_ENV_PART_UUID, &ep->blk, &ep->part)) + return NULL; + + ep->count = CONFIG_ENV_SIZE / ep->part.blksz; + + return ep; +} + +static int env_scsi_save(void) +{ + struct env_scsi_info *ep = env_scsi_get_part(); + int ret; + + if (!ep) + return -ENOENT; + + ret = env_export(&envbuf); + if (ret) + return ret; + + if (blk_dwrite(ep->blk, ep->part.start, ep->count, &envbuf) != ep->count) + return -EIO; + + return 0; +} + +static int env_scsi_erase(void) +{ + struct env_scsi_info *ep = env_scsi_get_part(); + + if (!ep) + return -ENOENT; + + return (int)blk_derase(ep->blk, ep->part.start, ep->count); +} + +#if defined(ENV_IS_EMBEDDED) +static int env_scsi_load(void) +{ + return 0; +} +#else +static int env_scsi_load(void) +{ + struct env_scsi_info *ep = env_scsi_get_part(); + int ret; + + if (!ep) { + env_set_default(CONFIG_SCSI_ENV_PART_UUID " partition not found", 0); + return -ENOENT; + } + + if (blk_dread(ep->blk, ep->part.start, ep->count, &envbuf) != ep->count) { + env_set_default(CONFIG_SCSI_ENV_PART_UUID " partition read failed", 0); + return -EIO; + } + + ret = env_import((char *)&envbuf, 1, H_EXTERNAL); + if (ret) { + debug("ENV import failed\n"); + env_set_default("Cannot load environment", 0); + } else { + gd->env_addr = (ulong)envbuf.data; + } + + return ret; +} +#endif + +U_BOOT_ENV_LOCATION(scsi) = { + .location = ENVL_SCSI, + ENV_NAME("SCSI") + .load = env_scsi_load, +#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_XPL_BUILD) + .save = env_save_ptr(env_scsi_save), + .erase = ENV_ERASE_PTR(env_scsi_erase), +#endif +}; diff --git a/include/env_internal.h b/include/env_internal.h index ee939ba4293..75b46d0bcb0 100644 --- a/include/env_internal.h +++ b/include/env_internal.h @@ -115,6 +115,7 @@ enum env_location { ENVL_SPI_FLASH, ENVL_MTD, ENVL_UBI, + ENVL_SCSI, ENVL_NOWHERE, ENVL_COUNT, From patchwork Tue May 13 09:17:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varadarajan Narayanan X-Patchwork-Id: 2084900 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=Uz2W1tuz; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4ZxWBY6vyvz1yXB for ; Tue, 13 May 2025 19:19:17 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F400682A59; Tue, 13 May 2025 11:19:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=quicinc.com 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=quicinc.com header.i=@quicinc.com header.b="Uz2W1tuz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 860CE82A1C; Tue, 13 May 2025 11:19:08 +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,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 0470182991 for ; Tue, 13 May 2025 11:19:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=quic_varada@quicinc.com Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54D6h0AO007509; Tue, 13 May 2025 09:18:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= x9SifL0YCmO2W6i6i22EiR6/GrwQxZJg89WHWobgBIY=; b=Uz2W1tuzGmM49ujX ADaNzHqcxNEpu/zhXI+BWo3pKacUN9lGx+r7kAKBTuZGmS1bC55HU4/BRWwxM/QQ NLSHEDGhhkgE8MhhZVhypsDNEKwBVvEJdrrPfbKL2oLCOE/hmwvzxFD2+iMI9Us0 Qt2QvWiHvbT/RyGl+sU7UMLCexx6tjVfjyES+tUWyClDSysA3XKUAlB3PzhiKTOt 9PvN5toLtBkSjoyw7XsoV0L1MRjext1xodIPQhIhjUJNseYzgecMlkPBMOrVH8vq rNdPtKEcIHOibWDFvustAbA0aiZN2pmLIPXaJBjA8UXO5eQ7Dg9l3in2GXdI8HO/ sUUPOg== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46hv5qffgq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 May 2025 09:18:44 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 54D9Ih9B026625 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 May 2025 09:18:43 GMT Received: from hu-varada-blr.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 13 May 2025 02:18:38 -0700 From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 4/5] doc: board/qualcomm: document iq9 building and flashing Date: Tue, 13 May 2025 14:47:09 +0530 Message-ID: <20250513091710.3719292-5-quic_varada@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250513091710.3719292-1-quic_varada@quicinc.com> References: <20250513091710.3719292-1-quic_varada@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Authority-Analysis: v=2.4 cv=DqtW+H/+ c=1 sm=1 tr=0 ts=68230e74 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=EUspDBNiAAAA:8 a=NEAV23lmAAAA:8 a=COk6AnOGAAAA:8 a=fZOVrP4WiPEGLte6-pUA:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: 17fNqTt7NSkw1R_V_x-O4k1h4BCs3GAb X-Proofpoint-GUID: 17fNqTt7NSkw1R_V_x-O4k1h4BCs3GAb X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTEzMDA4OCBTYWx0ZWRfX5LHemEdMsFiN Lem8uQlVQIb3nx/z+EYcVtEQx8WwXkmOcVsWKgGegl9iuU/7Ym5+K8PkBet3dh56SGf3b8RTQd9 br5G5RWZkU/hdrfVJB4e1zeprwFrSLrRggzJ9OoJp14vxsmEnZjU76Yi8s/zPqgeyRfYwGE7gy+ icIKse4N1u0gvP+N3pgp2kFOq+5eGYnNhB1UiM7TuwthWe1qlNeziM6TdqmAfYCiGn0gV48Rblj GKjYuFihSUZkDc5V6Lofqq5EqnVKi35wn2LKGTvoahlL0a9QCGPjyFyau7zFI2aFqfOgVjYy/Bv AtfnUdoOsl6hpTqlnoCNxvabyWHYxi4puuUrRd3h+rdRVhx/N1Mf75G/YNTvF9Pc0Rk1DZxCeMr 2BSsndChN3h47LWdsRvjJ2M4tVx+G3eLriaPcyq9F6g3/88YBpdrcscs9jESMSNM3dDioKYk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-12_07,2025-05-09_01,2025-02-21_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 phishscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2504070000 definitions=main-2505130088 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean The steps are similar to other boards. Minor difference in the way environment variables are stored. Signed-off-by: Varadarajan Narayanan --- doc/board/qualcomm/iq9.rst | 62 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 doc/board/qualcomm/iq9.rst diff --git a/doc/board/qualcomm/iq9.rst b/doc/board/qualcomm/iq9.rst new file mode 100644 index 00000000000..bc89f286add --- /dev/null +++ b/doc/board/qualcomm/iq9.rst @@ -0,0 +1,62 @@ +.. SPDX-License-Identifier: GPL-2.0+ +.. sectionauthor:: Caleb Connolly + +Qualcomm Dragonwing IQ9 Series +============================== + +The Dragonwing IQ9 Series delivers unmatched on-device AI performance for the +most demanding industrial applications, as well as available built-in safety +features and design flexibility for high-compute, powerefficient performance +capable of handling heavy workloads in extreme environments. More information +can be found on `Qualcomm's product page`_. + +U-Boot can be used as a replacement for Qualcomm's original EDK2 bootloader by +flashing it directly to the uefi_a (or _b) partition. + +.. _Qualcomm's product page: https://docs.qualcomm.com/bundle/publicresource/87-83840-1_REV_A_Qualcomm_IQ9_Series_Product_Brief.pdf + +Installation +------------ +First, setup ``CROSS_COMPILE`` for aarch64. Then, build U-Boot for ``qcm6490``:: + + $ export CROSS_COMPILE= + $ make qcs9100_defconfig + $ make -j8 + +This will build ``u-boot.elf`` in the configured output directory. + +Although the RB3 Gen 2 does not have secure boot set up by default, +the firmware still expects firmware ELF images to be "signed". The signature +does not provide any security in this case, but it provides the firmware with +some required metadata. + +To "sign" ``u-boot.elf`` you can use e.g. `qtestsign`_:: + + $ qtestsign -v6 aboot -o u-boot.mbn u-boot.elf + +Then install the resulting ``u-boot.mbn`` to the ``uefi_a`` partition +on your device with ``fastboot flash uefi_a u-boot.mbn``. + +U-Boot should be running after a reboot (``fastboot reboot``). + +Note that fastboot is not yet supported in U-Boot on this board, as a result, +to flash back the original firmware, or new versoins of the U-Boot, EDL mode +must be used. This can be accessed by pressing the EDL mode button as described +in the Qualcomm Linux documentation. A tool like bkerler's `edl`_ can be used +for flashing with the firehose loader binary appropriate for the board. + +Environment Variables +--------------------- +* The environment can be stored and retrieved directly from UFS partitions. + +* Environment variable partition details + + UUID: 71cb9cd0-acf1-b6cb-ad91-be9572fe11a9 + +* Relevant config options + + CONFIG_ENV_IS_IN_SCSI + CONFIG_SCSI_ENV_PART_UUID + +.. _qtestsign: https://github.com/msm8916-mainline/qtestsign +.. _edl: https://github.com/bkerler/edl From patchwork Tue May 13 09:17:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varadarajan Narayanan X-Patchwork-Id: 2084902 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=Z0uijZmy; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4ZxWBm6Vt4z1yXB for ; Tue, 13 May 2025 19:19:28 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 55B5982AAF; Tue, 13 May 2025 11:19:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=quicinc.com 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=quicinc.com header.i=@quicinc.com header.b="Z0uijZmy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DB1C682A8D; Tue, 13 May 2025 11:19:10 +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,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 A444F82991 for ; Tue, 13 May 2025 11:19:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=quic_varada@quicinc.com Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54D7Ejl6028406; Tue, 13 May 2025 09:18:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 6dZJX0/oV+WQiq6e7CGUJ9KrddPfvsAIqRd2/rJ5FRY=; b=Z0uijZmyJES7Lo2G Xf1abykSl8E2rhRMe+3e0nCt5HABrsjfRj9N4byQsoifJJe7wqSov2ZM7wCR52Z9 x1BPkVoKBROMPrnjGGNc4QI8KlnASWffpwL1sTQmgg0vB/gFxXvErrEoCZAXsnEn fSDGzTNA5n3L0sKoUQbNvGO0p3v05nyPJismITbFGUSLH9jGaNPkZMVadYpUzRSF drzSwx9rKnjeqjSPh5Q56kQx78DDf7x/tun6+wQD9cxXyScou90UZsJQmjZsiQeE krjwCWu+X6k36nGoPKrjwpkbuOBWj6xHk9xI7fjUWbygPLhJxDjn83xbemGkJG4k fO9DgQ== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46hwt976rb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 May 2025 09:18:49 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 54D9Imop019335 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 May 2025 09:18:48 GMT Received: from hu-varada-blr.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 13 May 2025 02:18:43 -0700 From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 5/5] configs: qcs9100: Enable env in SCSI Date: Tue, 13 May 2025 14:47:10 +0530 Message-ID: <20250513091710.3719292-6-quic_varada@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250513091710.3719292-1-quic_varada@quicinc.com> References: <20250513091710.3719292-1-quic_varada@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTEzMDA4OCBTYWx0ZWRfX+kXU7rT2ExVw 8SZDKXIjws0bxuWctTbBNCtbfrpC6V4ETX4tSwRsyfEfRYNuCjbiZ5Z1Z0sxQJrIB+AZvTTiKjW gStVABBYj1lECRGpJF2y8BtZNLu9EROMwFtbkbYATfm0nQcgypXAD3zGdPrvexG7UUiQZozKN3l xAecsYOynPNZpjuibrGIpLvFyuYb+2aJfWrd76yB9VrbAdx/BCkR6NcKrZZbNaGxQMDD23+54EW 69rFH+5DlRvAnaazTcDgxCDhC/EmiULfJSS7YhSqdKO1/Tx85fQQe/CE9MoHpqQGgHx6Bi9fvE2 DWO9udOe8i22xfV8DNx+3ZDXIWw/EWQNcIBZXJAPrRDFrth/4mW8mFJhIIT59VE0SRWWSH4NnB7 kl7H4lFlMhAL2jZYWgt1/YGoD5tYgi/s0yr9u5+CkAIlWS7r7L5BgkhCEUNlAgszYhRLDjUV X-Proofpoint-ORIG-GUID: 0kYjzLLibF5bz-pJp9cCR4KtgCFHm5RR X-Proofpoint-GUID: 0kYjzLLibF5bz-pJp9cCR4KtgCFHm5RR X-Authority-Analysis: v=2.4 cv=a58w9VSF c=1 sm=1 tr=0 ts=68230e79 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=1vbZ9Er4auZhERsSQ9EA:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-12_07,2025-05-09_01,2025-02-21_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=797 malwarescore=0 clxscore=1015 impostorscore=0 mlxscore=0 spamscore=0 bulkscore=0 adultscore=0 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2504070000 definitions=main-2505130088 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean Enable CONFIG_ENV_IS_IN_SCSI to store environment variables in SCSI. Set env variables partition UUID as seen in qcs9100 based boards. Signed-off-by: Varadarajan Narayanan Reviewed-by: Casey Connolly > --- --- v3: s/CONFIG_SCSI_ENV_PART/CONFIG_SCSI_ENV_PART_UUID --- configs/qcs9100_defconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configs/qcs9100_defconfig b/configs/qcs9100_defconfig index 10ff4d25398..cd48973599b 100644 --- a/configs/qcs9100_defconfig +++ b/configs/qcs9100_defconfig @@ -14,5 +14,8 @@ CONFIG_DEBUG_UART_CLOCK=14745600 # Address where U-Boot will be loaded CONFIG_TEXT_BASE=0xaf000000 CONFIG_REMAKE_ELF=y - CONFIG_DEFAULT_DEVICE_TREE="qcom/qcs9100-ride-r3" +CONFIG_ENV_IS_IN_SCSI=y +CONFIG_SCSI_ENV_PART_UUID="71cb9cd0-acf1-b6cb-ad91-be9572fe11a9" +# CONFIG_ENV_IS_DEFAULT is not set +# CONFIG_ENV_IS_NOWHERE is not set