Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2160096/?format=api
{ "id": 2160096, "url": "http://patchwork.ozlabs.org/api/patches/2160096/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20251101123401.110681-2-root@infi.wang/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20251101123401.110681-2-root@infi.wang>", "list_archive_url": null, "date": "2025-11-01T12:31:34", "name": "[v5,1/2] net: phy: aquantia: refactor firmware upload helpers", "commit_ref": "322b056116f8641b4ea9b1445873153358dac78d", "pull_url": null, "state": "accepted", "archived": false, "hash": "7a9473b8f3ee0a0d7dae71b37dd1067ffc567205", "submitter": { "id": 91745, "url": "http://patchwork.ozlabs.org/api/people/91745/?format=api", "name": "Beiyan Yun", "email": "root@infi.wang" }, "delegate": { "id": 157425, "url": "http://patchwork.ozlabs.org/api/users/157425/?format=api", "username": "jforissier", "first_name": "Jerome", "last_name": "Forissier", "email": "jerome.forissier@linaro.org" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20251101123401.110681-2-root@infi.wang/mbox/", "series": [ { "id": 480568, "url": "http://patchwork.ozlabs.org/api/series/480568/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=480568", "date": "2025-11-01T12:31:33", "name": "net: phy: aquantia: Switch to generic firmware loader", "version": 5, "mbox": "http://patchwork.ozlabs.org/series/480568/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2160096/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2160096/checks/", "tags": {}, "related": [], "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=infi.wang header.i=@infi.wang header.a=rsa-sha256\n header.s=sig1 header.b=JrGpTMst;\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=infi.wang", "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=infi.wang header.i=@infi.wang header.b=\"JrGpTMst\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=infi.wang", "phobos.denx.de; spf=pass smtp.mailfrom=root@infi.wang" ], "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 server-signature ECDSA (secp384r1))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4czHNT1FhMz1yHs\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 1 Nov 2025 23:34:33 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 5B72383A5C;\n\tSat, 1 Nov 2025 13:34:27 +0100 (CET)", "by phobos.denx.de (Postfix, from userid 109)\n id D109183A1B; Sat, 1 Nov 2025 13:34:25 +0100 (CET)", "from outbound.pv.icloud.com\n (p-west1-cluster4-host6-snip4-10.eps.apple.com [57.103.65.251])\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 C949D83A5C\n for <u-boot@lists.denx.de>; Sat, 1 Nov 2025 13:34:23 +0100 (CET)", "from outbound.pv.icloud.com (unknown [127.0.0.2])\n by p00-icloudmta-asmtp-us-west-1a-100-percent-4 (Postfix) with ESMTPS id\n D4B1B18013A1; Sat, 1 Nov 2025 12:34:19 +0000 (UTC)", "from debian.. (unknown [17.56.9.36])\n by p00-icloudmta-asmtp-us-west-1a-100-percent-4 (Postfix) with ESMTPSA id\n 286EB18013A8; Sat, 1 Nov 2025 12:34:16 +0000 (UTC)" ], "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_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2", "Dkim-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=infi.wang; s=sig1;\n bh=XXQTMNOzUPOXliKBI8omXIcmtVSKXZbfKn7vdudqa1E=;\n h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme;\n b=JrGpTMstfRV4WZN7or1ttknFCJXCKXvmv9jHUclebfPz79s+zByVf5vCEKs0/y8W5JNZHrkMGjVbOIsEVcbmO22xuOyqJCeYpyPrEREodC66/Ru67GQ4+a5yUI/aa0vDzmzKPDLVaMJOeNpgf14I4kYDRo+Ifvfv2B4DiGZ9LtLUMlKNEIl5UUjwJUisNsq71ub9x6p4FPeFCrOLjLrWVXkwhnSYDrNlSWjI2jARoVAiNzktWDKvNt4eJwhZPEDQJQbe+F3V6tI2/F+/+O/+ZToo2viRfpNe+92BeiztqX9jhvma/HB+X60q5ZrxHWH83e+rQnM4lYzgDg1qhKY33w==", "mail-alias-created-date": "1549370554000", "From": "Beiyan Yun <root@infi.wang>", "To": "u-boot@lists.denx.de", "Cc": "Tom Rini <trini@konsulko.com>, Yao Zi <ziyao@disroot.org>,\n Marek Vasut <marek.vasut+renesas@mailbox.org>, Beiyan Yun <root@infi.wang>,\n Jerome Forissier <jerome.forissier@linaro.org>,\n Joe Hershberger <joe.hershberger@ni.com>,\n Ramon Fried <rfried.dev@gmail.com>,\n Siddharth Vadapalli <s-vadapalli@ti.com>", "Subject": "[PATCH v5 1/2] net: phy: aquantia: refactor firmware upload helpers", "Date": "Sat, 1 Nov 2025 20:31:34 +0800", "Message-ID": "<20251101123401.110681-2-root@infi.wang>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<20251101123401.110681-1-root@infi.wang>", "References": "<20251101123401.110681-1-root@infi.wang>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Proofpoint-ORIG-GUID": "JXQEm3yoXgdC1C7FAhlP_ZywXSKcqr8j", "X-Proofpoint-GUID": "JXQEm3yoXgdC1C7FAhlP_ZywXSKcqr8j", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjUxMTAxMDEwNyBTYWx0ZWRfX5YUHqD/m+tGT\n ksWiG+M5CJdQrL2eVbic1KE98wKf8zcjxmXFVZet8Ne+npuoXbkBGiSP/buXPOckW/tezpLd2Pq\n +75u72eJgY7K1X1u5wN8fmulLmTKFO4DjbhQJdJLSVYmxGP+QAV98Ux+uwILHvE7wd+0Lq8cXPe\n gL8wxu3eUMetCOWRj5OKlI2NIHPlAjaEiQjCbm5ccWeZbvTmGitKZ1sWLEAUorGwLRJ2WVFUj8J\n H4AO3G3rKAmBVdqwX2pEk20vCxtLi8EXA+unIYAx8dhbPXyOkC+N0A0gHNxPwYTG6xCwD3xno=", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49\n definitions=2025-11-01_02,2025-10-29_03,2025-10-01_01", "X-Proofpoint-Spam-Details": "rule=notspam policy=default score=0 malwarescore=0\n mlxscore=0 mlxlogscore=999 clxscore=1030\n phishscore=0 spamscore=0\n adultscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx\n scancount=1 engine=8.22.0-2506270000 definitions=main-2511010107", "X-JNJ": "\n AAAAAAAB941vIeXaCQJ+iKY22O0BvZu4fa9IuQ4YTYz6vROiuWhLLDAiR/NK2EeO8GUSMHP/StDYYdDObwPaNiCBPUbIwZcomtI5OwovqmKiTckXlc7t5NVS/ntHhoIikEO/vHx5Fa4N1tq+w3nteJzE2z93T+buAA7ymNc9p+ZC8TLj1Q52kCHDvkvmO0GsvHKTZeQKcYLrX1DJybqW91VLD+5B0vrivX+Fjb6K3qKlirm6d+rz0O8Pqevg9oBWULnSljBMcWF/qAwtuGUL++8+aa//5mRbPkXLNCuy1O6r/sXH2kbADZ9LE7H0Qf/0WMzB1UTl8CNi/4roaLFzUL0eJq4kcmgMITmiLKwoyd+MOjMiKuCZmopwwMYI4DB6+f+7YSWVQWmvt6DiG6a/vcqu88ZNMaWKTHCZhp1IEB4QlHLDBgXjT/NSg3xufRhhKYcrA7xHhobXo3vnpv+jDvPw/EryPN20aF7jk9vSjAd2iJBanvV2b/fQBlcrpwI1guFWT8wjGA41Kf/XLARjrtGxeyJ8YYzVkXIt0myz1fr0IzauI/vLoG01LoAlzsC6Ft46HcyFQ1OX1xiIkMLeTu9RHIah4AKn4MkeKHkVWU8MI29FdXGCA9tok8SeDWwsL6BcGAQMrgPnaAfEfyy149JSGR5v8iaIzPSYwBz+wE+b/TdfdAt+BVkPYSmKkQIxvf1pszuDaf9uAuorjSJ8hIxU21ldIih5bkQiaWJgyzrZvjJuA0tm", "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": "Split `aquantia_upload_firmware` into `aquantia_upload_firmware`\nand `aquantia_do_upload_firmware` to prepare for fwloader change.\n\nSigned-off-by: Beiyan Yun <root@infi.wang>\n\n---\n\nChanges in v5:\n- Minor refactor\n\nChanges in v4:\n- New\n\n drivers/net/phy/aquantia.c | 37 +++++++++++++++++++++++++------------\n 1 file changed, 25 insertions(+), 12 deletions(-)", "diff": "diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c\nindex 903fcd667f6..fc2476fb038 100644\n--- a/drivers/net/phy/aquantia.c\n+++ b/drivers/net/phy/aquantia.c\n@@ -218,27 +218,26 @@ static u32 unpack_u24(const u8 *data)\n \treturn (data[2] << 16) + (data[1] << 8) + data[0];\n }\n \n-static int aquantia_upload_firmware(struct phy_device *phydev)\n+static int aquantia_do_upload_firmware(struct phy_device *phydev,\n+\t\t\t\t\tconst u8 *addr, size_t fw_length)\n {\n \tint ret;\n-\tu8 *addr = NULL;\n-\tsize_t fw_length = 0;\n \tu16 calculated_crc, read_crc;\n \tchar version[VERSION_STRING_SIZE];\n \tu32 primary_offset, iram_offset, iram_size, dram_offset, dram_size;\n \tconst struct fw_header *header;\n \n-\tret = aquantia_read_fw(&addr, &fw_length);\n-\tif (ret != 0)\n-\t\treturn ret;\n+\tif (!addr || !fw_length) {\n+\t\tprintf(\"%s: Invalid firmware data\\n\", phydev->dev->name);\n+\t\treturn -EINVAL;\n+\t}\n \n-\tread_crc = (addr[fw_length - 2] << 8) | addr[fw_length - 1];\n+\tread_crc = (addr[fw_length - 2] << 8) | addr[fw_length - 1];\n \tcalculated_crc = crc16_ccitt(0, addr, fw_length - 2);\n \tif (read_crc != calculated_crc) {\n \t\tprintf(\"%s bad firmware crc: file 0x%04x calculated 0x%04x\\n\",\n \t\t phydev->dev->name, read_crc, calculated_crc);\n-\t\tret = -EINVAL;\n-\t\tgoto done;\n+\t\treturn -EINVAL;\n \t}\n \n \t/* Find the DRAM and IRAM sections within the firmware file. */\n@@ -268,14 +267,14 @@ static int aquantia_upload_firmware(struct phy_device *phydev)\n \tret = aquantia_load_memory(phydev, DRAM_BASE_ADDR, &addr[dram_offset],\n \t\t\t\t dram_size);\n \tif (ret != 0)\n-\t\tgoto done;\n+\t\treturn ret;\n \n \tdebug(\"loading iram 0x%08x from offset=%d size=%d\\n\",\n \t IRAM_BASE_ADDR, iram_offset, iram_size);\n \tret = aquantia_load_memory(phydev, IRAM_BASE_ADDR, &addr[iram_offset],\n \t\t\t\t iram_size);\n \tif (ret != 0)\n-\t\tgoto done;\n+\t\treturn ret;\n \n \t/* make sure soft reset and low power mode are clear */\n \tphy_write(phydev, MDIO_MMD_VEND1, GLOBAL_STANDARD_CONTROL, 0);\n@@ -289,8 +288,22 @@ static int aquantia_upload_firmware(struct phy_device *phydev)\n \tphy_write(phydev, MDIO_MMD_VEND1, UP_CONTROL, UP_RUN_STALL_OVERRIDE);\n \n \tprintf(\"%s firmware loading done.\\n\", phydev->dev->name);\n-done:\n+\treturn 0;\n+}\n+\n+static int aquantia_upload_firmware(struct phy_device *phydev)\n+{\n+\tint ret;\n+\tu8 *addr = NULL;\n+\tsize_t fw_length = 0;\n+\n+\tret = aquantia_read_fw(&addr, &fw_length);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n+\tret = aquantia_do_upload_firmware(phydev, addr, fw_length);\n \tfree(addr);\n+\n \treturn ret;\n }\n #else\n", "prefixes": [ "v5", "1/2" ] }