Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1612676/?format=api
{ "id": 1612676, "url": "http://patchwork.ozlabs.org/api/patches/1612676/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20220402221701.18498-2-pali@kernel.org/", "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": "<20220402221701.18498-2-pali@kernel.org>", "list_archive_url": null, "date": "2022-04-02T22:16:59", "name": "[1/3] mmc: fsl_esdhc_spl: pre-PBL: check for BOOT signature instead of MBR/DBR", "commit_ref": "0f58f033d410e91466723bb288d555c710de49fc", "pull_url": null, "state": "accepted", "archived": false, "hash": "f9943d9dec10edc373d87d9397f45a1cfe1d183b", "submitter": { "id": 78810, "url": "http://patchwork.ozlabs.org/api/people/78810/?format=api", "name": "Pali Rohár", "email": "pali@kernel.org" }, "delegate": { "id": 87636, "url": "http://patchwork.ozlabs.org/api/users/87636/?format=api", "username": "priyankajain", "first_name": "Priyanka", "last_name": "Jain", "email": "priyanka.jain@nxp.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20220402221701.18498-2-pali@kernel.org/mbox/", "series": [ { "id": 293276, "url": "http://patchwork.ozlabs.org/api/series/293276/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=293276", "date": "2022-04-02T22:16:59", "name": "mmc: fsl_esdhc_spl: Fix booting P2020 from SD card", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/293276/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1612676/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1612676/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "bilbo.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=To154ymt;\n\tdkim-atps=neutral", "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=<UNKNOWN>)", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=kernel.org", "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=kernel.org header.i=@kernel.org header.b=\"To154ymt\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=kernel.org", "phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org" ], "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 RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby bilbo.ozlabs.org (Postfix) with ESMTPS id 4KWBHD0m2vz9sFv\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 3 Apr 2022 08:17:27 +1000 (AEST)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 2A2AF83986;\n\tSun, 3 Apr 2022 00:17:23 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id 5743983986; Sun, 3 Apr 2022 00:17:21 +0200 (CEST)", "from dfw.source.kernel.org (dfw.source.kernel.org\n [IPv6:2604:1380:4641:c500::1])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id B88AE8395A\n for <u-boot@lists.denx.de>; Sun, 3 Apr 2022 00:17:18 +0200 (CEST)", "from smtp.kernel.org (relay.kernel.org [52.25.139.140])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by dfw.source.kernel.org (Postfix) with ESMTPS id 6FCBE60A2A;\n Sat, 2 Apr 2022 22:17:17 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id AC806C340F3;\n Sat, 2 Apr 2022 22:17:16 +0000 (UTC)", "by pali.im (Postfix)\n id 0F7B5FE8; Sun, 3 Apr 2022 00:17:14 +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,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,\n SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no\n version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1648937836;\n bh=O24u464c08TLGEq1DedeusJZR9cY7pPCX1RnI3FAsOY=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=To154ymtCLvQoguljDwc+CaoODOdb+HKOPeNdllzEj8MDUNmT6QOkNpD0G5lwke3Z\n pq2BOlG3chFQHuKzLfTGPU7mue1A+bujco48GviLG/nxeMLqQu9B41IL3Ge1jEIY2p\n CakrN2r9DU0zEpYna1wzZV4KLrSb6/dEW1tATFx+eOeUHbN5Fnh+4lBP74KP0V/IW2\n jgfKXEscLOjlWLoYNMt3xGYSHrGsgqQjvSZBKh2ygFfWM10hJM3QVA6oh/kgpI+FOF\n YMqyhaNhLN7rwQ8O2lJw5UTB5MZPiaz4LqGULOFBQXpuvGCMGe9aVpaFbkZQFjrL4O\n BHVKF1Eywja0g==", "From": "=?utf-8?q?Pali_Roh=C3=A1r?= <pali@kernel.org>", "To": "Priyanka Jain <priyanka.jain@nxp.com>, Peng Fan <peng.fan@nxp.com>,\n Jaehoon Chung <jh80.chung@samsung.com>", "Cc": "u-boot@lists.denx.de", "Subject": "[PATCH 1/3] mmc: fsl_esdhc_spl: pre-PBL: check for BOOT signature\n instead of MBR/DBR", "Date": "Sun, 3 Apr 2022 00:16:59 +0200", "Message-Id": "<20220402221701.18498-2-pali@kernel.org>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20220402221701.18498-1-pali@kernel.org>", "References": "<20220402221701.18498-1-pali@kernel.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "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.5 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "Pre-PBL BootROMs (MPC8536E, MPC8569E, P2020, P1011, P1012, P1013, P1020,\nP1021, P1022) require custom BOOT signature on sector 0 and MBR/DBR\nsignature is not required at all.\n\nSo add check for BOOT signature and remove check for MBR/DBR.\n\nThis allows U-Boot SPL to load proper U-Boot on pre-PBL BootROMs platforms\nalso from SD cards which do not have MBR/DBR signature on sector 0.\n\nSigned-off-by: Pali Rohár <pali@kernel.org>\n---\n drivers/mmc/fsl_esdhc_spl.c | 27 +++++++++++++++++++++++++--\n 1 file changed, 25 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c\nindex bee76572ac6c..109f558dcad3 100644\n--- a/drivers/mmc/fsl_esdhc_spl.c\n+++ b/drivers/mmc/fsl_esdhc_spl.c\n@@ -14,6 +14,8 @@\n * on SDCard, so we must read the MBR to get the start address and code\n * length of the u-boot image, then calculate the address of the env.\n */\n+#define ESDHC_BOOT_SIGNATURE_OFF 0x40\n+#define ESDHC_BOOT_SIGNATURE\t0x424f4f54\n #define ESDHC_BOOT_IMAGE_SIZE\t0x48\n #define ESDHC_BOOT_IMAGE_ADDR\t0x50\n #define MBRDBR_BOOT_SIG_55\t0x1fe\n@@ -61,6 +63,9 @@ void __noreturn mmc_boot(void)\n \tuchar *tmp_buf;\n \tu32 blklen;\n \tuchar val;\n+#ifndef CONFIG_SPL_FSL_PBL\n+\tu32 val32;\n+#endif\n \tuint i, byte_num;\n #endif\n \tu32 offset, code_len;\n@@ -94,16 +99,34 @@ void __noreturn mmc_boot(void)\n \t\thang();\n \t}\n \n+#ifdef CONFIG_SPL_FSL_PBL\n \tval = *(tmp_buf + MBRDBR_BOOT_SIG_55);\n \tif (0x55 != val) {\n-\t\tputs(\"spl: mmc signature is not valid!!\\n\");\n+\t\tputs(\"spl: mmc MBR/DBR signature is not valid!!\\n\");\n \t\thang();\n \t}\n \tval = *(tmp_buf + MBRDBR_BOOT_SIG_AA);\n \tif (0xAA != val) {\n-\t\tputs(\"spl: mmc signature is not valid!!\\n\");\n+\t\tputs(\"spl: mmc MBR/DBR signature is not valid!!\\n\");\n \t\thang();\n \t}\n+#else\n+\t/*\n+\t * Booting from On-Chip ROM (eSDHC or eSPI), Document Number: AN3659, Rev. 2, 06/2012.\n+\t * Pre-PBL BootROMs (MPC8536E, MPC8569E, P2020, P1011, P1012, P1013, P1020, P1021, P1022)\n+\t * require custom BOOT signature on sector 0 and MBR/DBR signature is not required at all.\n+\t */\n+\tbyte_num = 4;\n+\tval32 = 0;\n+\tfor (i = 0; i < byte_num; i++) {\n+\t\tval = *(tmp_buf + ESDHC_BOOT_SIGNATURE_OFF + i);\n+\t\tval32 = (val32 << 8) + val;\n+\t}\n+\tif (val32 != ESDHC_BOOT_SIGNATURE) {\n+\t\tputs(\"spl: mmc BOOT signature is not valid!!\\n\");\n+\t\thang();\n+\t}\n+#endif\n \n \tbyte_num = 4;\n \toffset = 0;\n", "prefixes": [ "1/3" ] }