From patchwork Sun Mar 29 12:22:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2071 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786965; bh=jDLbi4vUDqgYmy/Rpy2+W3PcUPtnjl9UQI3pSysmanc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=HDEC3sLyWA8OksOLxlrE9rAvMn4kIR0JCcLkg34LQuglZWwELbHvj/CeOqG9+XqI3 hNYC89BPdPzVA+GR7ZvV7LfT7bcO0hUBQUPRrkRPMpduWIHkBFx5EKaq7a48OWwEa4 SsprVHaB/rPr47oOIXlTR79IH4nFNIV2lLZC9teTND2UDQEQznKg8zBDI113JrIcuK ECyzIGZELBd1WVXz1lNjkJ+gMqte1CbA338KnDZjt0JPF/Mg5OtOkw0cBCoT0XnpdF Ftw5WCHGro6BXStpRo4jUVFZZmF/E1XpuSAkHwRZY0xnqCH9vud6lTv/R0cY5VqKuq YN2dP+WE6/TAg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F35926A2CD for ; Sun, 29 Mar 2026 06:22:45 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id blKsc8cXwDGa for ; Sun, 29 Mar 2026 06:22:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786965; bh=jDLbi4vUDqgYmy/Rpy2+W3PcUPtnjl9UQI3pSysmanc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=HDEC3sLyWA8OksOLxlrE9rAvMn4kIR0JCcLkg34LQuglZWwELbHvj/CeOqG9+XqI3 hNYC89BPdPzVA+GR7ZvV7LfT7bcO0hUBQUPRrkRPMpduWIHkBFx5EKaq7a48OWwEa4 SsprVHaB/rPr47oOIXlTR79IH4nFNIV2lLZC9teTND2UDQEQznKg8zBDI113JrIcuK ECyzIGZELBd1WVXz1lNjkJ+gMqte1CbA338KnDZjt0JPF/Mg5OtOkw0cBCoT0XnpdF Ftw5WCHGro6BXStpRo4jUVFZZmF/E1XpuSAkHwRZY0xnqCH9vud6lTv/R0cY5VqKuq YN2dP+WE6/TAg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E11FB6A2C7 for ; Sun, 29 Mar 2026 06:22:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786964; bh=GLjF/X/EGRxSVXGzqD/G8usr9eVxiNqu9TgTUAfvqtk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SNfTovu2c3RAs0Rdkbh83BKOWXAGwyddHQLAYTp9Jgx1ObdQmAdiBpVUohps9uWUV e7PcML4v4Vs/WIo3RRLJhD7rNCc8zDcz1unIIur0L3RBcfGYnKZoybnmBoIrL/PRNt wA4WAAOXUJl0xenSMhG8vKgOwyDzu3zNqHspFHFr5gXuxNW1GFahszzcmzV+uAIyNK G0+/hduSlz/aUFgyvO4OgKvQq1EjwGMExZzah95qZ2hf7e4S4ij8SZVLGsSQ/JN6Kv YeKQsBmoCeoDIU9x8ParD8QBmxd2H75Egh0XGc6kO3Cl2bsAGbL4RJToh9PdJmqB5/ 5OH3Z8vl9xUpw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7D7506A2BF; Sun, 29 Mar 2026 06:22:44 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id AWDcaUMAA4NF; Sun, 29 Mar 2026 06:22:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786960; bh=stVOhQHgRUEdDMEXz5qwc396QWVd4/ynkqbN5jEuJ/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pcghf1HRW1iPAyB1x3JfeLJyZBkDeLW2BkRex82Yhzdgu1BvmMgQxpPyUteIvJump cCuK0o1u2o6DsjuXMv+fqTMIwlQMvRBVzBHw04NGxRTOmKMp7NySLto5K4WxeZhVbF YFd6OGhQtoKcX+YLvQ4JvauwFq7d8eR3quB9rQ9NKeszFIU6zY3jBCXSrcrjsoulYs NBOSInW0P+P4S1JF1xW0oA2UpBPPduy0eZQ9Vn8sKqYtOiQGFjjyALFKFrrR7Vmz6B kItIRAAuYgWBXKkEsaKOWjouQ5h9tKitccHIvCFYSd2UeKCrhsyd4RGMcFkoiVI0ZT HTRudCFRa7eHQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3CF9C6A269; Sun, 29 Mar 2026 06:22:40 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Sun, 29 Mar 2026 06:22:16 -0600 Message-ID: <20260329122222.3533806-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260329122222.3533806-1-sjg@u-boot.org> References: <20260329122222.3533806-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ZR66M3TCLBLTSY2GPPAZD2FBB6YIS4IC X-Message-ID-Hash: ZR66M3TCLBLTSY2GPPAZD2FBB6YIS4IC X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 1/4] vbe: abrec: Use unique log_msg_ret() tag for blk_get_from_parent() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Both abrec_read_bootflow_fw() and abrec_load_from_image() use the "med" tag for their blk_get_from_parent() call, making it impossible to distinguish which function is returning the error. Change the one in abrec_load_from_image() to "blk" so the two call sites can be told apart. Signed-off-by: Simon Glass --- boot/vbe_abrec_fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/vbe_abrec_fw.c b/boot/vbe_abrec_fw.c index b3786da8477..eb22ee43495 100644 --- a/boot/vbe_abrec_fw.c +++ b/boot/vbe_abrec_fw.c @@ -249,7 +249,7 @@ static int abrec_load_from_image(struct spl_image_info *image, return log_msg_ret("vdv", ret); ret = blk_get_from_parent(media, &blk); if (ret) - return log_msg_ret("med", ret); + return log_msg_ret("blk", ret); if (xpl_phase() == PHASE_TPL) { ulong offset, size; From patchwork Sun Mar 29 12:22:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2072 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786968; bh=xpfv7kjUwVToT3ucJZmtfNptyUtFviDRDoVgEuXxnug=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Uaa+WsehJ5uaUQ52YkybYSXPFyUrvd1U9y3AYRlli76NxologYToDiQDiq0no41FE quV5nvGpBKiiD3NCatq/H/LeHi6EEwHKlgMYfRcnR1AYoeZAKtmtDREYav76ugkcMt 1Dk9um7wBiT6ahIppzVKzVXDaB/5fNQkXyrwwPrB7M6DLf7KBM9k+1ev1/Zd1udH70 ijlOl6RDxFcBjWGTMUwK8e1q4j+3mCAkBbZRW4dLvjdtBJaKT2Op094iSRD2/gYfxw IlJFeXrVEudceLdzt3pt0vT6Ld7Fjezw8ajUAXzF/vKjL3c7wqcHhLOwklgWBf8z99 3TTYf/07Zymgw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9EDE06A2D8 for ; Sun, 29 Mar 2026 06:22:48 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id YN63vQfs6Hu2 for ; Sun, 29 Mar 2026 06:22:48 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786966; bh=xpfv7kjUwVToT3ucJZmtfNptyUtFviDRDoVgEuXxnug=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pWVoMOLVSVarAPzb9VeTZbjLSXbM4DvxyifpIAOmJX+d65nmzrTI5F5GEaXpo3lef Fgg+ZJqgBNul9D/knZC0buU33ZFpPTryckl5gkt4bab39Z3/uZUYyOWDbqKUNipYTU VHMmznRK2otlhVLBL1S/iKmpA4FIb7lK6Xd2HhkrJFldZhCUZarXUm9CElq8qUrnl2 Y+/PUzAOD5zW2K4WHmvLME+jNzQ+ZMDNUnhkVHAfwGYZ9smrep08Hy4/PiF3ElSO3l UT0JovvAK0tt4QETZeiXlyUwt1UloEmu742o01BGgBRK5Ik8klrkS7PmBihYJlK1yQ 3ImfVuC40o00w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8CDCE6A269 for ; Sun, 29 Mar 2026 06:22:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786965; bh=zN4ahVpqM6vZSwD+/qwqajAJuy3MXyGY5VBRzp2q8/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bz36BfcOs7VslILeWp5L6kwxZUzl6Y6lz5EF8svQ/hxhsZa/jiPws/DWnUdTgiGHK 4vKqQY9VBF2zGc+ibyjDrXToC/6JVHwU+AfU9S5VOp8pLHdSyVvWJZFobk/lboP1bQ K3uZIC3e6UHjENX47bfTzRjiVT+G/AeFqWsMbq/e4DSi1IIP2A5nhFIn2MBwe920cU R5hobTkt0lyEIJbnmNf/y2x361ymkpBztpiF0DlkzPtpV9hJ6P0hE5qtZ5rjChwVQT 4gUD7q2T8EuCFGfz3EuH/qEq8tw4xWAYC+FsEcPutU5My9qYpVVD0xEdAhLoKqtVM3 xsyOKA96sthbQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 330046A2BF; Sun, 29 Mar 2026 06:22:45 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id meAVzLz5RV80; Sun, 29 Mar 2026 06:22:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786964; bh=b4sYf3NtwlzBnFGxJgEAZrHnZdYZkLqqHWaTqBbQn6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YjVoGmwLWQmnNTCUmDRzXSbS584vohD5leMnWhCJxwUpr4kbiT7PcZ3cca6v+jYS+ 10CRLdBnubMBRSr7aMa02/qfVOU7GiG/t3Rg9Q4QiYkjbfnBUh6doDm72VW1ySszBN sZEjAdU+kua2ihuxdgAZBAOSPatqGk0ChCJlu463pZLlAlpWSXgkK5tECN/U5SIxaO fMofbBCMDQNe9ZZBHtMXVFDcN79qQeV4LSy3t+Unwyo0cpJx0CtspYAUldCWo1tNuv 7YWT/tDCfaxkG5KOjR+/wODr8T3i/wAuXYBY/isJXlyrTx+LY8y8KsQkIEPr40RqaV r5Bt0Ly4GYlUA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BB1A06A269; Sun, 29 Mar 2026 06:22:44 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Sun, 29 Mar 2026 06:22:17 -0600 Message-ID: <20260329122222.3533806-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260329122222.3533806-1-sjg@u-boot.org> References: <20260329122222.3533806-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UEYX44JUYVBEFLOPZ4246CBMJJFCP32W X-Message-ID-Hash: UEYX44JUYVBEFLOPZ4246CBMJJFCP32W X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 2/4] bloblist: Add tag for MMC clock rate handoff List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add BLOBLISTT_U_BOOT_MMC_CLK to allow passing the MMC source clock rate between boot phases. This is needed when a phase configures the clock (e.g. TPL with the CLK framework) but a later phase must use the same rate without CLK support (e.g. VPL). Signed-off-by: Simon Glass --- common/bloblist.c | 1 + include/bloblist.h | 1 + 2 files changed, 2 insertions(+) diff --git a/common/bloblist.c b/common/bloblist.c index e5fa67b0f71..1f2ca5f25ef 100644 --- a/common/bloblist.c +++ b/common/bloblist.c @@ -64,6 +64,7 @@ static struct tag_name { { BLOBLISTT_VBE, "VBE" }, { BLOBLISTT_U_BOOT_VIDEO, "SPL video handoff" }, { BLOBLISTT_EFI_LOG, "EFI-call log" }, + { BLOBLISTT_U_BOOT_MMC_CLK, "MMC clock" }, /* BLOBLISTT_VENDOR_AREA */ }; diff --git a/include/bloblist.h b/include/bloblist.h index e04dbc15fef..9620f041469 100644 --- a/include/bloblist.h +++ b/include/bloblist.h @@ -154,6 +154,7 @@ enum bloblist_tag_t { BLOBLISTT_VBE = 0xfff001, /* VBE per-phase state */ BLOBLISTT_U_BOOT_VIDEO = 0xfff002, /* Video info from SPL */ BLOBLISTT_EFI_LOG = 0xfff003, /* Log of EFI calls */ + BLOBLISTT_U_BOOT_MMC_CLK = 0xfff004, /* MMC clock rate */ }; /** From patchwork Sun Mar 29 12:22:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2073 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786969; bh=2SFJNYRLoStolvpjSwJMARXo3mblhA8DXDKnzI598DQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fywOeqzaAgKmNufqzCVUXWh4TzXdoklN5JQM4vMu2EHVhQoL2u1u/zRZQzNe/6qxg Z99eSS6yn5KpHBEbJ3Gd1OkbdrQcD37TYGE2OknaR4/zmUF2Ie63XKIhsB3V07f5Zy NEnwgKPvXWd8Xsqg4oNj4Z6LCl4tlgPIusQrQXFPWwQv4N0qh6u5d+8+waWAno+vRr wL5cN1+JNrE92+frP/nWlzq7JHBiN9pKuN36zramNlgmiG3xABXOK2b7PabisaHq6J TvxnzKH6ZicZosayqPpdAvm2myiTiy9ii5SNQ60niT6751YZyNWI1mgy29T5x+ZCZa voaGCLGG6hx+g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 239FA6A2D9 for ; Sun, 29 Mar 2026 06:22:49 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id GPupeBHqjs8q for ; Sun, 29 Mar 2026 06:22:49 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786968; bh=2SFJNYRLoStolvpjSwJMARXo3mblhA8DXDKnzI598DQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Jy/7RI0fgyO/UgA4vm3ReuYNvPQVRe0AjAtBmXGwN+Z3ZNRc9wtH/C9OBnvXzGw+y lxEkSW9F4p6smagXPOYE+FdHvyCTrNxpPd36i+GHQit+FCNhOkGSBMlVKW/sN9VieU W4k3MOWDyw37zdwA9RCqTMeNW429ZLV8HKtY4LmfVSYvErDTKYoq/PWqLTAY9pH/7q GVtNE2p0RRqPr1jAGxB459sw9OOJ4vAwW2rqIhf5I8+0eHfmXbKaL5LEx99mUaD7Bk YExRH5mPUQ3uwQNUqU3c3rGk8OsbJn1f3SmILehVltclpVtjjXT6SUzcJZAYL5ABkz aCXhvzxNg3jPQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7C8466A2D0 for ; Sun, 29 Mar 2026 06:22:48 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786966; bh=ZW3LcT/1D2nLbP44fDbn/4knD2EyEDXdN52v1w/EFWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iAjcHNOVo+Pqy8tcrKtTyCApLLMtrFPVzNf8Bd/JEagqgRJlHxX0Svx4hCitoq7Ik /PFjvhfh2jV+j10ZGsZDC59eEIGhMwlVpxxNCIpXYkEJvBMtiGjNvsa6YPvkjNNADe IBXbqDBVkvyo3IDQQvsaV8WueUrl4yQfOam2yPIPrsmh/FlRX4w7LU6mBcEf59LBRl TbBlaiPPkJwLPsHuN/iHTfhh4c8UcvIyvnU7grMdK5xjqhxYVCDjcPCbFkgIRPmTT8 Mb4zRh5lt8cSHRKmRNH8ZJEocnf4tav8+PYqW1/X1TkQghzux5/om1t6HGPNZ8lfCB KqSAff+qSUxNA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0B8086A2C7; Sun, 29 Mar 2026 06:22:46 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 4Q58MhFg4Hzd; Sun, 29 Mar 2026 06:22:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786965; bh=Qm1Rr+jh1Xn1ixG6mL5iLEMC8p5LaXDpgGj9kQ7QHEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L8smIZiLFy0PRFXwViHVq75kQYMppr3YSpy0qwN4/tuw5zL5OCQtHflcOfPS58MBD uCQlwOGGYC6U95YywwxaV8EVmYA/1i3LPoljEEMDTd4vQTNjF/ArLNS7phu0vaJj/h xUrQDls47zCqIpOmXS57ltqad3jLQ8AhLEZRSDoKkVadB4/BcarcJL9iARUOwtYLKg Au3pRhb2G4jxrRW+7PpmDzgegFqouCke7GMFmbWf21gsyxAtKxjK4DWzP+v88G5R6G WYvdfeX8vDR6L3jXjEinbdYCNWtgmi2fHtMmqUmFL+fJ8TEvHY9as8LM/BF+W8ttnl FCl0TCjLTjJ0A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 70F1C6A269; Sun, 29 Mar 2026 06:22:45 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Sun, 29 Mar 2026 06:22:18 -0600 Message-ID: <20260329122222.3533806-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260329122222.3533806-1-sjg@u-boot.org> References: <20260329122222.3533806-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 76EZJ3OH2IPH6OXMU2AI5PPHFDK64PJC X-Message-ID-Hash: 76EZJ3OH2IPH6OXMU2AI5PPHFDK64PJC X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 3/4] mmc: rockchip_dw_mmc: Pass clock rate via bloblist List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When the CLK framework is not available (e.g. in VPL), the DW MMC driver cannot set the source clock rate, so get_mmc_clk() returns the requested frequency. The DW MMC core then uses bypass mode (divider=0), running the bus at whatever rate the CRU is configured to from a previous phase. If that rate is high (e.g. 50 MHz from a data transfer), card enumeration at 400 KHz fails. Fix this by saving the clock rate to the bloblist when CLK is available, and reading it back when CLK is not. This allows the DW MMC core to calculate the correct clock divider based on the actual source clock rate configured by the previous boot phase. This is controlled by a new CONFIG_MMC_DW_ROCKCHIP_CLK_HANDOFF Kconfig option. Signed-off-by: Simon Glass --- drivers/mmc/Kconfig | 9 +++++++++ drivers/mmc/rockchip_dw_mmc.c | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index 4c46df0ffb8..01d7025ce4d 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -292,6 +292,15 @@ config MMC_DW_ROCKCHIP SD 3.0, SDIO 3.0 and MMC 4.5 and supports common eMMC chips as well as removeable SD and micro-SD cards. +config MMC_DW_ROCKCHIP_CLK_HANDOFF + bool "Pass MMC clock rate between boot phases via bloblist" + depends on MMC_DW_ROCKCHIP && BLOBLIST + help + When enabled, the DW MMC source clock rate is saved to the + bloblist after being configured. A later boot phase that lacks + CLK support can read this rate and use it to calculate the + correct clock divider, rather than assuming bypass mode. + config MMC_SDHCI_ADI bool "ADI SD/MMC controller support" depends on ARCH_SC5XX diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c index 7a72abaa38a..be6436dbe7d 100644 --- a/drivers/mmc/rockchip_dw_mmc.c +++ b/drivers/mmc/rockchip_dw_mmc.c @@ -3,6 +3,7 @@ * Copyright (c) 2013 Google, Inc */ +#include #include #include #include @@ -50,8 +51,38 @@ static uint rockchip_dwmmc_get_mmc_clk(struct dwmci_host *host, uint freq) ret = clk_set_rate(&priv->clk, freq); if (ret < 0) { + /* + * If CLK is not available (e.g. VPL), use the rate saved + * by the previous phase via bloblist. The CRU is still + * configured from that phase, so the DW MMC core can + * calculate the correct clock divider. + */ + if (!CONFIG_IS_ENABLED(CLK) && + IS_ENABLED(CONFIG_MMC_DW_ROCKCHIP_CLK_HANDOFF)) { + u32 *ratep; + + ratep = bloblist_find(BLOBLISTT_U_BOOT_MMC_CLK, + sizeof(*ratep)); + if (ratep) + return *ratep; + } debug("%s: err=%d\n", __func__, ret); - return 0; + return freq; + } + + /* Save the source clock rate for the next phase */ + if (IS_ENABLED(CONFIG_XPL_BUILD) && + IS_ENABLED(CONFIG_MMC_DW_ROCKCHIP_CLK_HANDOFF)) { + u32 *ratep; + + ratep = bloblist_ensure(BLOBLISTT_U_BOOT_MMC_CLK, + sizeof(*ratep)); + if (ratep) { + ulong rate = clk_get_rate(&priv->clk); + + if (!IS_ERR_VALUE(rate)) + *ratep = rate; + } } return freq; From patchwork Sun Mar 29 12:22:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2074 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786971; bh=9YhuHffrPSjasiEqfBWtzvNW9bHHtiFHcpN65a3/pc0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=JH5LsNE0NAC+voNxOrJDcbmUUbcvQJuerqbDkSKLxltaef1tyYCYfrwdl+k25vyMx 0CZyVjsfjbvKpzgLkA7fQLNJDe4IWAHHPpqizyP/skPTvxn7x7YkFWSTgzNc5xHJLh MALfRzlIQ0/Cs8eglnRAFf4XTD34tL6ZJeXvZS5R1GG9XkJZKPxC23qOrX5I1nzZ4J mQH2gqsukEpU4DuGJYLklezPRwua+XNfSoF10MJj6qFvoMEH5uaZQnjMMXTKQ5t1cp NqP9lyQefUNkX89HgDrqTfO1eoB6PLcSluUmFtKpkVWvTw9nV3YFcnxMIjbkIP4qq3 sdTP+wkBu4xNw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8F9E06A2D5 for ; Sun, 29 Mar 2026 06:22:51 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id wyamUb-UCmta for ; Sun, 29 Mar 2026 06:22:51 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786970; bh=9YhuHffrPSjasiEqfBWtzvNW9bHHtiFHcpN65a3/pc0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=qKJh9hVVPamql+x/mwp5raNsn63SnnTAvNlcqxNcS6V5kHjaQFyBuDgqIjxA6wq68 DiMBbENDd5gvV9GG7C/yFGmVekiP4OHrUo8oXyw5chJZ2zNbMX4sP3fOQaiBXyJ2sJ 3mL9j94EaxI78yZk4cboB5VCKWOBAgxuc6vVGAczfmHbVG0lMPThXNck2YXQyUlEBh n2gXBvbZftBTVrA0XHO1M8gJiPJCC6lokrjj27I4pAPAYNRHNRmM5teEYuA0tVwgS2 RdDCH6KMKTf0/UkDgPRyqOvnFnS4TaF2vrvsc/4OgC2TnIjuEVjUdKwkXlVKRKfDHw jHJkBSlVvvv5Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A1B436A2C7 for ; Sun, 29 Mar 2026 06:22:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786968; bh=v+aI0rZ9lB0PEwxKjgUP1loRMz/2AOUqL7jre6stb2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tm5Lbjv//mdrcjbpXyskVpVtoAlpUzPJiz4e58+CN6pJW0uWVfHweDf253V7fQ3fl ZM7sTeLf2153ejoV0TcvJaSSIrqAxHFqlJp+OkaLRwK90WJaUQgiKyOWSpIiUcxgBx e3m99IHsI7BsdgdUvG49TzATXlPVtqZ0pi2cyOQgSDkyg/lmr4pDv9kgLBEKia/XVg dFKqlc2KOTiEto7CEmur/twCGspMsWEot1lFkeC2QaGz4v6NKeyBQE3pgVH3gAUJTC TNSX3sJbgyTM5hqGDiYNmE8VmSVbCfc3hX71Dej8BYIn3AT5hLVkWrXZjlIVVPS/pD igYQ+IqWteqrA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BC5C36A2DA; Sun, 29 Mar 2026 06:22:48 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id mDUNVk0OURVm; Sun, 29 Mar 2026 06:22:48 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774786966; bh=2NpzSySuotjJ7zmB+bWQ8RQKJiXdDmHS3ejdoRd7/lE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UHsfITUZ1iP7/nmFhu0fGeBgtUfApfdF1IJGdYEQboKSvzy8gHyvWJpB5sL/AuQf9 ulmyMnZDm/RiU1zx8rIWD7L19cm8yYcG/W9MIhnrpkhpHb6zTWgBbi0PJ4NJHDtR15 xNP4WMWbjBpniCjJUv0HA6XRSVJm4d90trTcB0frIoh5axrL3zFgpUJjp74SimyPAb iZKg6Ah1wyFR1D5Hq80NVwNxi20I4X+SXA86aT4WkuDJTNMk7OX7p39gJVGW1pj5vU bHPsnKGp+IwZPTWmruizAtX+GVJluhGnAgbUByt4NL0RpA+MjMNPMLgjKaaV0mTMmd +/rhZAjNOw8fA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4C0046A2D2; Sun, 29 Mar 2026 06:22:46 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Sun, 29 Mar 2026 06:22:19 -0600 Message-ID: <20260329122222.3533806-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260329122222.3533806-1-sjg@u-boot.org> References: <20260329122222.3533806-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BTDC2YVLJCO5TMSAFJCHFJDSLATDRBIT X-Message-ID-Hash: BTDC2YVLJCO5TMSAFJCHFJDSLATDRBIT X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 4/4] rk3399-generic-ddr3: Enable MMC clock-rate handoff List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Enable CONFIG_MMC_DW_ROCKCHIP_CLK_HANDOFF so that VPL can read the source clock rate from the bloblist and calculate the correct DW MMC clock divider for card enumeration. Signed-off-by: Simon Glass --- configs/rk3399-generic-ddr3_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/rk3399-generic-ddr3_defconfig b/configs/rk3399-generic-ddr3_defconfig index 2849889bb8e..0d8cc45be80 100644 --- a/configs/rk3399-generic-ddr3_defconfig +++ b/configs/rk3399-generic-ddr3_defconfig @@ -74,6 +74,7 @@ CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y CONFIG_MMC_DW=y CONFIG_MMC_DW_ROCKCHIP=y +CONFIG_MMC_DW_ROCKCHIP_CLK_HANDOFF=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_SDMA=y CONFIG_MMC_SDHCI_ROCKCHIP=y