get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1613118/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1613118,
    "url": "http://patchwork.ozlabs.org/api/patches/1613118/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20220404163311.5853-1-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": "<20220404163311.5853-1-pali@kernel.org>",
    "list_archive_url": null,
    "date": "2022-04-04T16:33:11",
    "name": "mmc: fsl_esdhc_spl: pre-PBL: implement redundancy support",
    "commit_ref": "0980cbba7b3cdec23bafb9cf6dbedc22979a38a1",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "aaec505e3fe8beb2ffc89facfb4c7d5a8745288c",
    "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/20220404163311.5853-1-pali@kernel.org/mbox/",
    "series": [
        {
            "id": 293453,
            "url": "http://patchwork.ozlabs.org/api/series/293453/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=293453",
            "date": "2022-04-04T16:33:11",
            "name": "mmc: fsl_esdhc_spl: pre-PBL: implement redundancy support",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/293453/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1613118/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1613118/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=LjN9bdM7;\n\tdkim-atps=neutral",
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=\"LjN9bdM7\";\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\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\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 4KXGYt0Pnvz9sFy\n\tfor <incoming@patchwork.ozlabs.org>; Tue,  5 Apr 2022 02:33:53 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 42B7881DD3;\n\tMon,  4 Apr 2022 18:33:51 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 03E0E83678; Mon,  4 Apr 2022 18:33:50 +0200 (CEST)",
            "from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75])\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 CF98781B5C\n for <u-boot@lists.denx.de>; Mon,  4 Apr 2022 18:33:42 +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 ams.source.kernel.org (Postfix) with ESMTPS id 7B66FB8101C;\n Mon,  4 Apr 2022 16:33:42 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 28BA7C2BBE4;\n Mon,  4 Apr 2022 16:33:41 +0000 (UTC)",
            "by pali.im (Postfix)\n id D2A6D768; Mon,  4 Apr 2022 18:33:38 +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=1649090021;\n bh=je2cEw52fewgZHno9Ec+o2/SXeoRL2EyVgstQVn7xsM=;\n h=From:To:Cc:Subject:Date:From;\n b=LjN9bdM7dmS3jpqVfnEG7P8iU5tnkS2cwG0et4H5532zpyReHS1FSAJKJo5xiG8v9\n 1l7mNBmZuXV5NNtsJV4Fy0HoucRt7RowdHoMigwdbIbNCpl+iOlI5KgJiJeZHM50YU\n 0Am4215/RozkVae67iY5OT4VNqFhsM6lyudD0THiwa4NUkPah9iGcPWtX4qsjFe7I0\n uO6zmCB5PVw7uQ89yxmQk8Eifcd3rkv9MK6ntM/AR1NK8YktLgiA8cHi7UwQOdbca3\n 6Mwk8RAcS9LBXnPk3Ngmr7P6cUt+PUzM9aKkiREubn4JIMqfnr6FTCNtmXMyYv118O\n 8mVbVqmZ24iuA==",
        "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] mmc: fsl_esdhc_spl: pre-PBL: implement redundancy support",
        "Date": "Mon,  4 Apr 2022 18:33:11 +0200",
        "Message-Id": "<20220404163311.5853-1-pali@kernel.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "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": "QorIQ pre-PBL BootROM scans first 24 SD card sectors (each with fixed 512\nbytes length) for boot signature. Implement same redundancy behavior in\nfsl_esdhc_spl driver to allow loading proper U-Boot when boot sector is not\nthe first one.\n\nSigned-off-by: Pali Rohár <pali@kernel.org>\n---\n drivers/mmc/fsl_esdhc_spl.c | 25 ++++++++++++++++++-------\n 1 file changed, 18 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c\nindex 0146a231b221..ea8f4cd66964 100644\n--- a/drivers/mmc/fsl_esdhc_spl.c\n+++ b/drivers/mmc/fsl_esdhc_spl.c\n@@ -20,7 +20,6 @@\n #define ESDHC_BOOT_IMAGE_ADDR\t0x50\n #define MBRDBR_BOOT_SIG_55\t0x1fe\n #define MBRDBR_BOOT_SIG_AA\t0x1ff\n-#define CONFIG_CFG_DATA_SECTOR\t0\n \n \n void mmc_spl_load_image(uint32_t offs, unsigned int size, void *vdst)\n@@ -62,11 +61,13 @@ void __noreturn mmc_boot(void)\n #ifndef CONFIG_FSL_CORENET\n \tuchar *tmp_buf;\n \tu32 blklen;\n+\tu32 blk_off;\n \tuchar val;\n #ifndef CONFIG_SPL_FSL_PBL\n \tu32 val32;\n #endif\n \tuint i, byte_num;\n+\tu32 sector;\n #endif\n \tu32 offset, code_len;\n \tstruct mmc *mmc;\n@@ -86,30 +87,37 @@ void __noreturn mmc_boot(void)\n \toffset = CONFIG_SYS_MMC_U_BOOT_OFFS;\n #else\n \tblklen = mmc->read_bl_len;\n+\tif (blklen < 512)\n+\t\tblklen = 512;\n \ttmp_buf = malloc(blklen);\n \tif (!tmp_buf) {\n \t\tputs(\"spl: malloc memory failed!!\\n\");\n \t\thang();\n \t}\n+\n+\tsector = 0;\n+again:\n \tmemset(tmp_buf, 0, blklen);\n \n \t/*\n \t* Read source addr from sd card\n \t*/\n-\terr = mmc->block_dev.block_read(&mmc->block_dev,\n-\t\t\t\t\tCONFIG_CFG_DATA_SECTOR, 1, tmp_buf);\n+\tblk_start = (sector * 512) / mmc->read_bl_len;\n+\tblk_off = (sector * 512) % mmc->read_bl_len;\n+\tblk_cnt = DIV_ROUND_UP(512,  mmc->read_bl_len);\n+\terr = mmc->block_dev.block_read(&mmc->block_dev, blk_start, blk_cnt, tmp_buf);\n \tif (err != 1) {\n \t\tputs(\"spl: mmc read failed!!\\n\");\n \t\thang();\n \t}\n \n #ifdef CONFIG_SPL_FSL_PBL\n-\tval = *(tmp_buf + MBRDBR_BOOT_SIG_55);\n+\tval = *(tmp_buf + blk_off + MBRDBR_BOOT_SIG_55);\n \tif (0x55 != val) {\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+\tval = *(tmp_buf + blk_off + MBRDBR_BOOT_SIG_AA);\n \tif (0xAA != val) {\n \t\tputs(\"spl: mmc MBR/DBR signature is not valid!!\\n\");\n \t\thang();\n@@ -123,10 +131,13 @@ void __noreturn mmc_boot(void)\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\tval = *(tmp_buf + blk_off + ESDHC_BOOT_SIGNATURE_OFF + i);\n \t\tval32 = (val32 << 8) + val;\n \t}\n \tif (val32 != ESDHC_BOOT_SIGNATURE) {\n+\t\t/* BOOT signature may be on the first 24 sectors (each being 512 bytes) */\n+\t\tif (++sector < 24)\n+\t\t\tgoto again;\n \t\tputs(\"spl: mmc BOOT signature is not valid!!\\n\");\n \t\thang();\n \t}\n@@ -135,7 +146,7 @@ void __noreturn mmc_boot(void)\n \tbyte_num = 4;\n \toffset = 0;\n \tfor (i = 0; i < byte_num; i++) {\n-\t\tval = *(tmp_buf + ESDHC_BOOT_IMAGE_ADDR + i);\n+\t\tval = *(tmp_buf + blk_off + ESDHC_BOOT_IMAGE_ADDR + i);\n \t\toffset = (offset << 8) + val;\n \t}\n \toffset += CONFIG_SYS_MMC_U_BOOT_OFFS;\n",
    "prefixes": []
}