get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1745893,
    "url": "http://patchwork.ozlabs.org/api/patches/1745893/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20230221201925.9644-13-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": "<20230221201925.9644-13-pali@kernel.org>",
    "list_archive_url": null,
    "date": "2023-02-21T20:18:38",
    "name": "[RFC,u-boot-mvebu,12/59] arm: mvebu: spl: Fix support for loading U-Boot proper from SD card",
    "commit_ref": "913d7561c071e4051c2474bfb53775cd70865a46",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "f58642208e7acd5762c5f2687ec8e805046af0cc",
    "submitter": {
        "id": 78810,
        "url": "http://patchwork.ozlabs.org/api/people/78810/?format=api",
        "name": "Pali Rohár",
        "email": "pali@kernel.org"
    },
    "delegate": {
        "id": 1696,
        "url": "http://patchwork.ozlabs.org/api/users/1696/?format=api",
        "username": "stroese",
        "first_name": "Stefan",
        "last_name": "Roese",
        "email": "sr@denx.de"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20230221201925.9644-13-pali@kernel.org/mbox/",
    "series": [
        {
            "id": 343058,
            "url": "http://patchwork.ozlabs.org/api/series/343058/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=343058",
            "date": "2023-02-21T20:18:27",
            "name": "arm: mvebu: Various fixes",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/343058/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1745893/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1745893/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 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>)",
            "legolas.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=WMEv8MXV;\n\tdkim-atps=neutral",
            "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=\"WMEv8MXV\";\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 ECDSA (P-384))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4PLrXb6Bqmz23j7\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Feb 2023 07:31:11 +1100 (AEDT)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 58EFA85AD7;\n\tTue, 21 Feb 2023 21:23:59 +0100 (CET)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 7E26E85ADA; Tue, 21 Feb 2023 21:23:35 +0100 (CET)",
            "from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n bits)) (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 5364D85AD7\n for <u-boot@lists.denx.de>; Tue, 21 Feb 2023 21:22:44 +0100 (CET)",
            "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 3A38A611C0;\n Tue, 21 Feb 2023 20:22:33 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id B8B3AC433AA;\n Tue, 21 Feb 2023 20:22:32 +0000 (UTC)",
            "by pali.im (Postfix)\n id 512322793; Tue, 21 Feb 2023 21:22:29 +0100 (CET)"
        ],
        "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 autolearn=ham autolearn_force=no version=3.4.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1677010953;\n bh=9Ya9PEJXwfigye31Wgk/4XGXzUrOjwsDalFB2GGJbzI=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=WMEv8MXVahFcznUhJlf7wzNUEDuLeMT9x/YiXpJK2R/Pd8LHl01xf4TV3wvO6mDxh\n of7/v7XcefaqojIElgF98FsBGYD/GUhCOLqJSV6QDGXtWqyJLhqRQkcdov426vOxue\n FYUwz6LSRXhsKPsPZK7PovBXmb/yUAPmTWqjRJt/CfbOdGHeaM9Imd2GTnMHDRgQMF\n GMlHaAT5rn6pAE2zra5+0mmKWrKjnsLMgUuKwSKULHxPtyDwobg0s1tzk7Ihsz+MaU\n RkW4LGtp1/Wh6dQwMHHGSaPVyAAc9gziJDkheMD3pjmCBqALmHFZgXwP92087BKXmf\n 4K2PWwRt7ESFA==",
        "From": "=?utf-8?q?Pali_Roh=C3=A1r?= <pali@kernel.org>",
        "To": "u-boot@lists.denx.de",
        "Cc": "Stefan Roese <sr@denx.de>, Tony Dinh <mibodhi@gmail.com>,\n Josua Mayer <josua@solid-run.com>",
        "Subject": "[PATCH RFC u-boot-mvebu 12/59] arm: mvebu: spl: Fix support for\n loading U-Boot proper from SD card",
        "Date": "Tue, 21 Feb 2023 21:18:38 +0100",
        "Message-Id": "<20230221201925.9644-13-pali@kernel.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20230221201925.9644-1-pali@kernel.org>",
        "References": "<20230221201925.9644-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.6 at phobos.denx.de",
        "X-Virus-Status": "Clean"
    },
    "content": "Marvell BootROM loads MMC image from sector 0 (HW boot or data partition)\nand SD image from sector 1.\n\nSo for SD card booting it is needed to not use constant CONFIG MMC options\nand instead of them it is needed to define functions spl_mmc_boot_mode()\nspl_mmc_get_uboot_raw_sector() which determinate offsets at SPL runtime\nbased on MMC or SD card.\n\nCalculation of SD card sector expects following values:\nCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0\nCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0\n\nFixes: 2226ca173486 (\"arm: mvebu: Load U-Boot proper binary in SPL code based on kwbimage header\")\nSigned-off-by: Pali Rohár <pali@kernel.org>\n---\n arch/arm/mach-mvebu/Kconfig |  1 +\n arch/arm/mach-mvebu/spl.c   | 40 ++++++++++++++++++++++++++++---------\n 2 files changed, 32 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig\nindex 5303b1cbb965..2863babefbe3 100644\n--- a/arch/arm/mach-mvebu/Kconfig\n+++ b/arch/arm/mach-mvebu/Kconfig\n@@ -331,6 +331,7 @@ config MVEBU_SPL_BOOT_DEVICE_MMC\n \timply SPL_LIBDISK_SUPPORT\n \timply SPL_MMC\n \tselect SUPPORT_EMMC_BOOT if SPL_MMC\n+\tselect SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR if SPL_MMC\n \tselect SPL_BOOTROM_SUPPORT\n \n config MVEBU_SPL_BOOT_DEVICE_SATA\ndiff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c\nindex 0a809e91349c..02528e025d8c 100644\n--- a/arch/arm/mach-mvebu/spl.c\n+++ b/arch/arm/mach-mvebu/spl.c\n@@ -33,14 +33,27 @@\n #endif\n \n /*\n- * When loading U-Boot via SPL from eMMC (in Marvell terminology SDIO), the\n- * kwbimage main header is stored at sector 0. U-Boot SPL needs to parse this\n- * header and figure out at which sector the U-Boot proper binary is stored.\n- * Partition booting is therefore not supported and CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR\n- * and CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET need to point to the\n- * kwbimage main header.\n+ * When loading U-Boot via SPL from eMMC, the kwbimage main header is stored at\n+ * sector 0 and either on HW boot partition or on data partition. Choice of HW\n+ * partition depends on what is configured in eMMC EXT_CSC register.\n+ * When loading U-Boot via SPL from SD card, the kwbimage main header is stored\n+ * at sector 1.\n+ * Therefore MBR/GPT partition booting, fixed sector number and fixed eMMC HW\n+ * partition number are unsupported due to limitation of Marvell BootROM.\n+ * Correct sector number must be determined as runtime in mvebu SPL code based\n+ * on the detected boot source. Otherwise U-Boot SPL would not be able to load\n+ * U-Boot proper.\n+ * Runtime mvebu SPL sector calculation code expects:\n+ * - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0\n+ * - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0\n  */\n #ifdef CONFIG_SPL_MMC\n+#ifdef CONFIG_SYS_MMCSD_FS_BOOT\n+#error CONFIG_SYS_MMCSD_FS_BOOT is unsupported\n+#endif\n+#ifdef CONFIG_SYS_MMCSD_FS_BOOT_PARTITION\n+#error CONFIG_SYS_MMCSD_FS_BOOT_PARTITION is unsupported\n+#endif\n #ifdef CONFIG_SUPPORT_EMMC_BOOT_OVERRIDE_PART_CONFIG\n #error CONFIG_SUPPORT_EMMC_BOOT_OVERRIDE_PART_CONFIG is unsupported\n #endif\n@@ -50,10 +63,14 @@\n #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION\n #error CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is unsupported\n #endif\n-#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR) && CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR != 0\n+#ifndef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR\n+#error CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR must be enabled for SD/eMMC boot support\n+#endif\n+#if !defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR) || \\\n+    CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR != 0\n #error CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR must be set to 0\n #endif\n-#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET) && \\\n+#if !defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET) || \\\n     CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET != 0\n #error CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET must be set to 0\n #endif\n@@ -104,7 +121,12 @@ struct kwbimage_main_hdr_v1 {\n #ifdef CONFIG_SPL_MMC\n u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)\n {\n-\treturn MMCSD_MODE_EMMCBOOT;\n+\treturn IS_SD(mmc) ? MMCSD_MODE_RAW : MMCSD_MODE_EMMCBOOT;\n+}\n+unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc,\n+\t\t\t\t\t   unsigned long raw_sect)\n+{\n+\treturn IS_SD(mmc) ? 1 : 0;\n }\n #endif\n \n",
    "prefixes": [
        "RFC",
        "u-boot-mvebu",
        "12/59"
    ]
}