get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2196499,
    "url": "http://patchwork.ozlabs.org/api/patches/2196499/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260214045703.28051-11-hs@nabladev.com/",
    "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": "<20260214045703.28051-11-hs@nabladev.com>",
    "list_archive_url": null,
    "date": "2026-02-14T04:57:02",
    "name": "[v2,10/11] siemens: capricorn: rework bootcmd environment variables",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "de72ef9b2a701d3df6ff2eee887ec52cf8ab02c4",
    "submitter": {
        "id": 91409,
        "url": "http://patchwork.ozlabs.org/api/people/91409/?format=api",
        "name": "Heiko Schocher",
        "email": "hs@nabladev.com"
    },
    "delegate": {
        "id": 151988,
        "url": "http://patchwork.ozlabs.org/api/users/151988/?format=api",
        "username": "festevam",
        "first_name": "Fabio",
        "last_name": "Estevam",
        "email": "festevam@gmail.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260214045703.28051-11-hs@nabladev.com/mbox/",
    "series": [
        {
            "id": 492160,
            "url": "http://patchwork.ozlabs.org/api/series/492160/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=492160",
            "date": "2026-02-14T04:56:52",
            "name": "imx8qxp: siemens: small board updates",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/492160/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2196499/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2196499/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=nabladev.com header.i=@nabladev.com header.a=rsa-sha256\n header.s=dkim header.b=XJ/e9w+4;\n\tdkim-atps=neutral",
            "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=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=nabladev.com",
            "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=nabladev.com header.i=@nabladev.com\n header.b=\"XJ/e9w+4\";\n\tdkim-atps=neutral",
            "phobos.denx.de; dmarc=pass (p=reject dis=none)\n header.from=nabladev.com",
            "phobos.denx.de; spf=pass smtp.mailfrom=hs@nabladev.com"
        ],
        "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 (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fCcJ15nkQz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 14 Feb 2026 15:58:41 +1100 (AEDT)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 57F0783EC6;\n\tSat, 14 Feb 2026 05:57:20 +0100 (CET)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 4C78F83EC0; Sat, 14 Feb 2026 05:57:19 +0100 (CET)",
            "from mx.nabladev.com (mx.nabladev.com [178.251.229.89])\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 3D26683DE4\n for <u-boot@lists.denx.de>; Sat, 14 Feb 2026 05:57:17 +0100 (CET)",
            "from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon)\n with ESMTPSA id 72F00108D1C; Sat, 14 Feb 2026 05:57:16 +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,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=nabladev.com;\n s=dkim; t=1771045036; h=from:subject:date:message-id:to:cc:mime-version:\n content-transfer-encoding:in-reply-to:references;\n bh=m+0oDXEetuCYk6TebJWFI+oWgske5Il21qft+Yw32as=;\n b=XJ/e9w+4bjsV5m1QdGi+CrgZsleEWaPu43UXJSYVZgiajubc1g1+XNndyBAn1pPP4/tI86\n 5bVH70uzQFEJiDdaBrTF90KohxISsC8Xdicqqs41ea7bJ/1JYJ0J5U0O/UDtHjvLdhEc0h\n fNpbluw29oeF3fmV7CkSbf6Ja671ziHNsnj88qCWhT6Nf8kzz/O/elF+MH0Afj1xX0iCqw\n 7RS6mfMlC4CC2u+VzKe5ZMdZc2G/u9auK5NAE6630HJYdVwIOsd3wTgQwJLgSjQVGjWW0h\n bELqjnVsODRl2KKRObhjO1vkVBSnLCYQYwWSShhPKqhdExxyCD2S5aHmdr/OOA==",
        "From": "Heiko Schocher <hs@nabladev.com>",
        "To": "U-Boot Mailing List <u-boot@lists.denx.de>",
        "Cc": "Fabio Estevam <festevam@gmail.com>, Peng Fan <peng.fan@oss.nxp.com>,\n Adrian Freihofer <adrian.freihofer@siemens.com>,\n Peng Fan <peng.fan@nxp.com>, Heiko Schocher <hs@nabladev.com>,\n Alexander Sverdlin <alexander.sverdlin@siemens.com>,\n Tom Rini <trini@konsulko.com>,\n Walter Schweizer <walter.schweizer@siemens.com>",
        "Subject": "[PATCH v2 10/11] siemens: capricorn: rework bootcmd environment\n variables",
        "Date": "Sat, 14 Feb 2026 05:57:02 +0100",
        "Message-Id": "<20260214045703.28051-11-hs@nabladev.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20260214045703.28051-1-hs@nabladev.com>",
        "References": "<20260214045703.28051-1-hs@nabladev.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Last-TLS-Session-Version": "TLSv1.3",
        "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": "From: Adrian Freihofer <adrian.freihofer@siemens.com>\n\nRework the boot state machine to a significantly simpler and more\nrobust implementation. The basic idea is to revert to the previous\npartition whenever an issue is detected during the boot process.\n\n- Broken SPL\n\n  If one of the two SPLs does not boot, the ROM code of the i.MX8 SoC\n  automatically starts the second SPL from the second boot partition.\n  For example, if the system's active partition is A but the SPL from\n  partition A is broken, the ROM code automatically uses the SPL/u-boot\n  from partition B.\n  Proceeding with this boot procedure would lead to booting the kernel/\n  rootfs from partition A, which could potentially successfully boot\n  the system and allow the user to apply the firmware update with the\n  broken SPL again. This would lead to a non-bootable system because\n  the second update would overwrite the last working bootloader.\n  To prevent such situations, zigzag boots are detected and the system\n  reverts to the previous partition rather than booting the kernel/rootfs\n  from the currently active partition. Detecting zigzag boots is done\n  via the new fallback variable.\n\n  To make this state machine even more consistent, the partitionset_active\n  variable is no longer used to determine the active partition during\n  boot. Instead, the active partition is always read from the eMMC\n  partconf registers.\n  For backward compatibility, the partitionset_active variable is still\n  updated whenever a partition switch occurs. However, u-boot no longer\n  relies on this variable, as it could potentially be out of sync with\n  the actual partition state, leading to situations where the ROM code\n  of the i.MX8 SoC would be out of sync with u-boot.\n\n- Broken kernel, initramfs or rootfs\n\n  If the upgrade_available variable is set, u-boot counts the number of\n  consecutive boots via the bootcount variable. If the bootcount exceeds\n  the bootlimit variable, u-boot starts the altbootcmd instead of the\n  bootcmd. Previously, this logic was bypassed by assigning the regular\n  bootcmd to altbootcmd. Now, the altbootcmd is used to revert to the\n  previous partition when the bootlimit is exceeded.\n\nThe netdev variable is changed to eth0 by default. This is what the FEC\ndriver uses on Capricorn boards. For devices with switches and DSA\nsubsystems in use, the netdev should be set accordingly by additional\nlogic in the environment or u-boot code. This is not part of this commit.\n\nSigned-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>\nReviewed-by: Peng Fan <peng.fan@nxp.com>\n\nSigned-off-by: Heiko Schocher <hs@nabladev.com>\n---\nIgnore checkpatch warning:\nboard/siemens/capricorn/capricorn_default.env:4: warning: line length of 118 exceeds 100 columns\nboard/siemens/capricorn/capricorn_default.env:37: warning: line length of 130 exceeds 100 columns\nboard/siemens/capricorn/capricorn_default.env:40: warning: line length of 321 exceeds 100 columns\n\nChanges in v2:\nAdded Acked-by from Peng, fixed typo in commit message\nAdded small fixes in Environment from Adrian: It fixes a serious bug which\nAdrian detect. It occurs when a broken firmware is applied as a downgrade.\nThe old bootloader ended up in an endless reboot boot loop. With this fix\nalso the old bootloader is able to reject the update and recover. Also\nslightly reworked bootcmd.\n\n board/siemens/capricorn/capricorn_default.env | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/board/siemens/capricorn/capricorn_default.env b/board/siemens/capricorn/capricorn_default.env\nindex cf5bd09a4da..64bab7d10bb 100644\n--- a/board/siemens/capricorn/capricorn_default.env\n+++ b/board/siemens/capricorn/capricorn_default.env\n@@ -1,17 +1,17 @@\n-altbootcmd=run bootcmd\n+terminate_upgrade=bootcount reset; setenv upgrade_available 0\n+altbootcmd=run terminate_upgrade; run toggle_partition\n baudrate=115200\n bootcmd=run flash_self;reset;\n bootdelay=3\n bootdir=targetdir/rootfs/boot\n bootlimit=3\n-check_upgrade=if test ${upgrade_available} -eq 1; then echo  upgrade_available is set; if test ${bootcount} -gt ${bootlimit}; then setenv upgrade_available 0;echo toggle partition;run toggle_partition;fi;fi;\n cntr_addr=0x88000000\n cntr_file=os_cntr_signed.bin\n console=ttyLP2\n dtb_name_default=default\n ethprime=eth1\n fdt_addr=0x83000000\n-flash_self=run mmc_boot\n+flash_self=if test -n \"$fallback\"; then echo \"fallback: $fallback\"; run terminate_upgrade; run toggle_partition; else run mmc_boot; fi\n flash_self_test=setenv testargs test loglevel=3 systemd.unit=test.target; run mmc_boot\n hostname=capricorn\n initrd_addr=0x83100000\n@@ -19,13 +19,13 @@ initrd_high=0xffffffffffffffff\n ip_method=none\n kernel_name=Image\n loadaddr=0x80400000\n-mmc_boot=run set_bootargs;run check_upgrade; run set_partition;run set_bootargs_mmc;run mmc_load_bootfiles\n+mmc_boot=run set_bootargs; run set_partition;run set_bootargs_mmc;run mmc_load_bootfiles\n mmc_boot_fit=ext4load mmc 0:${mmc_part_nr} 0x88000000 boot/fitImage;if test -n ${A};then setenv bootargs ${bootargs} rootfs_sig=${sig_a};fi;if test -n ${B};then setenv bootargs ${bootargs} rootfs_sig=${sig_b};fi;bootm 0x88000000#conf-${dtb_name}.dtb;bootm 0x88000000\n mmc_boot_image=ext4load mmc 0:${mmc_part_nr} ${fdt_addr} boot/${dtb_name}.dtb;if test $? -eq 1;then ext4load mmc 0:${mmc_part_nr} ${fdt_addr} boot/${dtb_name_default}.dtb;fi; ext4load mmc 0:${mmc_part_nr} ${loadaddr} boot/${kernel_name}; booti ${loadaddr} - ${fdt_addr}\n mmc_load_bootfiles=echo -n Loading from eMMC ...; if test -e mmc 0:${mmc_part_nr} boot/fitImage; then echo fit; setenv fdt_high; setenv initrd_high; run mmc_boot_fit; else echo image; run mmc_boot_image; fi\n net_nfs=wdt dev scu-wdt; wdt stop; echo Booting from network ...; run set_bootargs_net; tftpboot ${loadaddr} ${bootdir}/${kernel_name}; printenv bootargs; if test ${kernel_name} = fitImage; then setenv fdt_high; setenv initrd_high; bootm ${loadaddr}#conf-${dtb_name}.dtb; else tftpboot ${fdt_addr} ${serverip}:${bootdir}/${dtb_name}.dtb; if test $? -eq 1; then echo Loading default.dtb!; tftpboot ${fdt_addr} ${serverip}:${bootdir}/${dtb_name_default}.dtb; fi; booti ${loadaddr} - ${fdt_addr}; fi\n net_unfs=setenv nfsopts vers=3,udp,rsize=4096,wsize=4096,nolock,port=3049,mountport=3048 rw; run net_nfs\n-netdev=lan0\n+netdev=eth0\n nfsopts=vers=3,udp,rsize=4096,wsize=4096,nolock rw\n partitionset_active=A\n rootfs_name=/dev/mmcblk0\n@@ -34,9 +34,9 @@ script_file=u-boot-commands.img\n set_bootargs_mmc=setenv bootargs ${bootargs} root=${mmc_active_vol} ro rootdelay=1 rootwait rootfstype=ext4 ip=${ip_method}\n set_bootargs_net=run set_bootargs; if test ${kernel_name} = fitImage; then setenv loadaddr 0x88000000; fi; setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off\n set_bootargs=setenv bootargs console=${console},${baudrate} target_env=${target_env} ${testargs} ${optargs}\n-set_partition=setenv ${partitionset_active} true;if test -n ${A}; then setenv mmc_part_nr 1;fi;if test -n ${B}; then setenv mmc_part_nr 2;fi;setenv mmc_active_vol ${rootfs_name}p${mmc_part_nr}\n+set_partition=mmc partconf 0 v_mmc_part_nr; setenv mmc_part_nr $v_mmc_part_nr; setenv mmc_active_vol ${rootfs_name}p$v_mmc_part_nr\n tftp_run_script=tftpboot ${kernel_loadaddr} ${serverip}:${script_file};if test $? -eq 0;then source ${kernel_loadaddr};fi\n-toggle_partition=setenv ${partitionset_active} true; if test -n ${A}; then setenv partitionset_active B; mmc partconf 0 1 2 0; env delete A; fi; if test -n ${B}; then setenv partitionset_active A; mmc partconf 0 1 1 0; env delete B; fi;saveenv; reset\n+toggle_partition=mmc partconf 0 v_mmc_part_nr; if test $v_mmc_part_nr -eq 1; then mmc partconf 0 1 2 0; setenv partitionset_active B; elif test $v_mmc_part_nr -eq 2; then mmc partconf 0 1 1 0; setenv partitionset_active A; else echo error mmc_part_nr $v_mmc_part_nr; fi; saveenv; reset\n upgrade_available=0\n emmc_dev=0\n sd_dev=1\n",
    "prefixes": [
        "v2",
        "10/11"
    ]
}