get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2195671,
    "url": "http://patchwork.ozlabs.org/api/patches/2195671/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/35ddf2fe394ee55c66f349dc5cc33fe1dda8f864.1770825377.git.michal.simek@amd.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": "<35ddf2fe394ee55c66f349dc5cc33fe1dda8f864.1770825377.git.michal.simek@amd.com>",
    "list_archive_url": null,
    "date": "2026-02-11T15:56:23",
    "name": "[v8,4/4] efi_vars: Implement SPI Flash store",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "9db55644ef9055f6536e6c58fdf36339eb59dd46",
    "submitter": {
        "id": 84271,
        "url": "http://patchwork.ozlabs.org/api/people/84271/?format=api",
        "name": "Michal Simek",
        "email": "michal.simek@amd.com"
    },
    "delegate": {
        "id": 96103,
        "url": "http://patchwork.ozlabs.org/api/users/96103/?format=api",
        "username": "apalos",
        "first_name": "Ilias",
        "last_name": "Apalodimas",
        "email": "apalos@gmail.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/35ddf2fe394ee55c66f349dc5cc33fe1dda8f864.1770825377.git.michal.simek@amd.com/mbox/",
    "series": [
        {
            "id": 491869,
            "url": "http://patchwork.ozlabs.org/api/series/491869/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=491869",
            "date": "2026-02-11T15:56:20",
            "name": "efi_vars: Implement SPI Flash storage for EFI",
            "version": 8,
            "mbox": "http://patchwork.ozlabs.org/series/491869/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2195671/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2195671/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 (1024-bit key;\n unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256\n header.s=selector1 header.b=xSy07bny;\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=quarantine dis=none) header.from=amd.com",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=amd.com header.i=@amd.com header.b=\"xSy07bny\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=amd.com",
            "phobos.denx.de;\n spf=fail smtp.mailfrom=michal.simek@amd.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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fB33Y56DJz1xtr\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 02:57:29 +1100 (AEDT)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 7E37E83D9C;\n\tWed, 11 Feb 2026 16:57:05 +0100 (CET)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 9AA5F83DA7; Wed, 11 Feb 2026 16:57:04 +0100 (CET)",
            "from BN1PR04CU002.outbound.protection.outlook.com\n (mail-eastus2azlp170100001.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c110::1])\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 68E8483015\n for <u-boot@lists.denx.de>; Wed, 11 Feb 2026 16:57:01 +0100 (CET)",
            "from BLAPR03CA0138.namprd03.prod.outlook.com (2603:10b6:208:32e::23)\n by LV3PR12MB9409.namprd12.prod.outlook.com (2603:10b6:408:21d::16)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9611.10; Wed, 11 Feb\n 2026 15:56:49 +0000",
            "from BL02EPF0002992B.namprd02.prod.outlook.com\n (2603:10b6:208:32e:cafe::1) by BLAPR03CA0138.outlook.office365.com\n (2603:10b6:208:32e::23) with Microsoft SMTP Server (version=TLS1_3,\n cipher=TLS_AES_256_GCM_SHA384) id 15.20.9611.10 via Frontend Transport; Wed,\n 11 Feb 2026 15:56:48 +0000",
            "from satlexmb08.amd.com (165.204.84.17) by\n BL02EPF0002992B.mail.protection.outlook.com (10.167.249.56) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.9611.8 via Frontend Transport; Wed, 11 Feb 2026 15:56:49 +0000",
            "from satlexmb10.amd.com (10.181.42.219) by satlexmb08.amd.com\n (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 11 Feb\n 2026 09:56:49 -0600",
            "from satlexmb07.amd.com (10.181.42.216) by satlexmb10.amd.com\n (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 11 Feb\n 2026 09:56:48 -0600",
            "from localhost (10.180.168.240) by satlexmb07.amd.com\n (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17 via Frontend\n Transport; Wed, 11 Feb 2026 09:56:47 -0600"
        ],
        "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,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2",
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=aXm/kNsD9HQcdtCsxK+eXP/Ex0/TxJuOhXFp3cOgUXG7bruLRrwdIAAg/88leY+QHgmv8sblfz1kp6+914de4KZTyBzpEFWhA4jEN95msOVEp8LtEHAOPsQKcyK7w8abpYsgkLYgm5QCX0qci6mjs/51ECQo6NkIXZgBOSD4isZNkwCrnxR3o4rtAdrX63+wF+xEgLrZZlCV5wI4zK57hZ8s12b5oYSs928mRYg8nXdb40dsHmOLRW6Yz2Uc2CDOJ3ujD/x5pSlM9XhRcogSLu++DV69ZO0fybzayd02AtDRFuSq8Myz2SYNx14RppxjPRRE5G+DdWuuukT3f2zlCw==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=YEycBmpFkj/+Fy9dLQEL1QujKrYgbBi+ItNYWtlx+zs=;\n b=EI8t9NQCjLuw79seVo0WWEpxDtSfTxvyiXAc1r/DuJ0BRfObaBksIYoILZIwGr485IG5zLhmzFfNT/HLaM2m8t4y+0Unp59HaAR0Xj2ieSYOFGirig10ntMtdK4uk3oQDThtKhzEZAXsJYrNIPR8aa0LSZ29+H9jZi0kpVbrkVcScWvLyA9+PkzuM9zHvzxuKM4lUaAPuJIWYlSj9lfICBeagilWTBe7c8lCJuA/sk1GFVXML8k58LgEZmBXh5tCGnGX0kp1xk6P0415dhtrPf9t+mWbPm+wH9q+HJGuHaL9oQnASJBwOdvxtN5DC7C2XblMowC21aAjkZnJMwh7cQ==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 165.204.84.17) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=amd.com;\n dmarc=pass (p=quarantine sp=quarantine pct=100) action=none\n header.from=amd.com; dkim=none (message not signed); arc=none (0)",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=YEycBmpFkj/+Fy9dLQEL1QujKrYgbBi+ItNYWtlx+zs=;\n b=xSy07bny8AgEN7A03l+D+PqXTQM6MuECqAugoBT1MZyDCVhoapdC1+2bKN/7fClPWlUybFoaXs5KHpxPZ+mv/BZj+MasEsKQhXUjFaiVDg7+CdncDrILC0VQwemt0R6UrZzoWPeZqSYH4g2uaIdYdXu+infws6E2Slojo0Ai+fY=",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 165.204.84.17)\n smtp.mailfrom=amd.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=amd.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of amd.com designates\n 165.204.84.17 as permitted sender) receiver=protection.outlook.com;\n client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C",
        "From": "Michal Simek <michal.simek@amd.com>",
        "To": "<u-boot@lists.denx.de>, <git@amd.com>",
        "CC": "Shantur Rathore <i@shantur.com>, Neil Armstrong\n <neil.armstrong@linaro.org>, Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Heinrich Schuchardt <xypron.glpk@gmx.de>, Jonathan Humphreys\n <j-humphreys@ti.com>, Simon Glass <sjg@chromium.org>, Sughosh Ganu\n <sughosh.ganu@arm.com>, Tom Rini <trini@konsulko.com>, \"Ying-Chun Liu\n (PaulLiu)\" <paul.liu@linaro.org>",
        "Subject": "[PATCH v8 4/4] efi_vars: Implement SPI Flash store",
        "Date": "Wed, 11 Feb 2026 16:56:23 +0100",
        "Message-ID": "\n <35ddf2fe394ee55c66f349dc5cc33fe1dda8f864.1770825377.git.michal.simek@amd.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<cover.1770825377.git.michal.simek@amd.com>",
        "References": "<cover.1770825377.git.michal.simek@amd.com>",
        "MIME-Version": "1.0",
        "X-Developer-Signature": "v=1; a=openpgp-sha256; l=7198; i=michal.simek@amd.com;\n h=from:subject:message-id; bh=Xe29ciy68ajdRTTX00FTuxkLGH7EBTbCc+CKfZIfGI0=;\n b=owGbwMvMwCG2mv3fB7+vgl8ZT6slMWT2LFsfb7jyRM31e8pcrx2+3Z8S05l70qpw7m5VKQHbx\n c5v+LYGdpSyMIhxMMiKKbJMZ9JxWPPt2lKx5ZH5MHNYmUCGMHBxCsBEXj9jZGjLOvwsaPr+6btn\n 6v+q9C1SsOHJltA77cmyP+BlRfWGC9cY/pnInK/2WrjhqQVnpIlT4rH7MwP4/y7ufTb97ibhiav\n WnmEHAA==",
        "X-Developer-Key": "i=michal.simek@amd.com; a=openpgp;\n fpr=67350C9BF5CCEE9B5364356A377C7F21FE3D1F91",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "BL02EPF0002992B:EE_|LV3PR12MB9409:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "8f373510-98fa-47d2-9c67-08de69862a9c",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;\n ARA:13230040|82310400026|7416014|376014|1800799024|36860700013|13003099007;",
        "X-Microsoft-Antispam-Message-Info": "\n dVX7XMvxEMn5NYRwrN+rupDYA3Pd0Kps5hMbo2ktxFgzn0uAURbyf5SV8PysxCuPasmZUHm59yH2sV8ODxTNbE7yI1AzFIe0kxwYwxxjNdWOc/PBqG/RBc4SjciEiVGkTQf7GI+ANBWnJProSBFwQfauBc8UICbGLMtrHdhFRXyFd3QoPkwdrfYD3ezGp2k0E120Oq4KgCEtU48K3KhCqIDmpqljjYn6+FTA7exVnH3V5cE6sxIhfoC/YmDm8FtABPhg7zA5NW/pss8iWb8RYGaKC75zUMSJoW3tUVgvZRUXywzS3l6z2OUeVS4eZ7wuHNw5Mg16Ynb1H8ba57xHY9SsgGo1TpkU6k1N2LxSxecRmzy4BeW5MMvEMEFneb5+PpirKBB21J8bzF2j2HwxTwwSzgC6SDVwAXM89nDhMn+clo6Y/i93L54JqARRcsCn3EW8c2nWkmfPuPFWYiE3gD6uB8eZxfxRU9PY1BxMcfxEhHxBUKCLuvw9fxqriz9LiETZKRHAoFdQS8TKMCoaBY1bKDuYb6czrScfWOxpdYP9yhXLispl2leGSbn6htgle3/MupEZf+t0CiguEx3eBxXHByMxpWWwzgPMVH2edFtniwXfjy1QnNJFoRTTpi4iulYDvtuniLOH1Z+Vs5zYwLzcD1Kg8+b5Wf8CiPnxwaFThhzlrvSCPWaJjhvi8uxeSyZCP0cwKIVGd97k9p8JU0uNPnM4Coc8k+rZEHE1Z7YB9/rdhSiA/IVgGJJKsffAsoBagyxFmKzJ3P6kvADuUXOT/OD22iIKEn6wtVgLjbs0i2Tgsk0s/HgrHthZcNxSynn9Z2WlvVby8PLpnGhNSN5p7HwqAE+JZX+sQ+f0YOlKGzyXxQhDlbQl288D/YjrxTfYKVshmO+RQBO3/VcyDoE+DSVBrijPoKDOYYAeRVg5HZBAdHNX2tmkUZagBRLIkTfDPHcbthPVqOph8Q7uft9bJjWdb+rnHOzOZdZPIHpuon5UQAeHLMq97bZqU5uvQdwuhL41fs3frC9Aw3BhgOBO4qTqphqT7X6Z1X9wFbN1WF9Utgh8nVNsepjKRk7/ypWua7Kr/i4Ve5uN0D3mhRPKGLi6veG8YMG3RLe/jPcnIjpB2CSbgxlKCOVB6/WIBqWH4EwyvZ5qPO/jaNZXjLPIpKILLrPxgjF7bxemVTkATGNJmchmDA5QhjCWgZck6UEHEWZSeOcEWAVcFLioll9spO2Vn7BRaa8AuS1688wAHpkNqSxsn0FhJfrG6iR3W3aotwZkib8ZSYTYQjSMdZtaA/6sKYJ1xZObKo659PYizxsvK7DilCnvi91NmQKTMLz920FmqpRqWTA8sWzB25LJkZsGH5rJbGhms1He2l4M2eGlNssL+muP9mGkBijCd+LcTXhIea9a12i0vwb7D8eDdaqrv3vAeLWVgG5+m8dIyD8vLgja/5XJ1jQEGrPmXsp4yhNPKbg4o8frCzAukP6b0p27oUo4axv8hDJqK6s3nsKko+K/duXb+IBC7BfVmJQjdQxoDQLGImm0ZQ8/3MxuDH2u9z/Je3LuB0ZZnh5dDSfMB14wZU47nZFX7z1pdtH2sHQBWnclFeRlCD76nmjoD5yAekpVWdATNbkuJLM=",
        "X-Forefront-Antispam-Report": "CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:satlexmb08.amd.com; PTR:InfoDomainNonexistent; CAT:NONE;\n SFS:(13230040)(82310400026)(7416014)(376014)(1800799024)(36860700013)(13003099007);\n DIR:OUT; SFP:1101;",
        "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1",
        "X-MS-Exchange-AntiSpam-MessageData-0": "\n tyZjzGdBlnLEMB+cPpR/nyq4pNrJ5XktZM/dvBZEuob1bSXyA2otd1126NZ/E/BVNFCU62uKP7gcVPI/k+5SQMMhoXq7owGGl1K4ZlFf2PYY3pzCYyJbBkC5ug6HYSDjQl8wbMyDE4erps2xj97MNfR9bdvY2A0m6xf45KUiZhKXe1FpfzR8ULsmhDnUJ+enahutrQ0T5qmGNFCgjGR5rZP6Ps5+WaM9L7qujsAJ3FvPjyEPJ6u+FBVB3AJreVa6vb7lkPJiiRt9beCENJ3D4tB899D06BBk9xjPNrNx5WxlCjiJ9HPxG2nYlfEN70MLqT5HoxcwQtlcUpa2RjC7ASuB25rdlXwCIs6bD0vId+mbfi9G+JFPI55H7DK+uqrjZ6/TTJEhtUdMana5TL/E1e71h2xuSBYwAW5vQ/WDOOqOE4VeaJaaznY4U8KIlQVC",
        "X-OriginatorOrg": "amd.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "11 Feb 2026 15:56:49.4188 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 8f373510-98fa-47d2-9c67-08de69862a9c",
        "X-MS-Exchange-CrossTenant-Id": "3dd8961f-e488-4e60-8e11-a82d994e183d",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17];\n Helo=[satlexmb08.amd.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n BL02EPF0002992B.namprd02.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "LV3PR12MB9409",
        "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: Shantur Rathore <i@shantur.com>\n\nCurrently U-Boot uses ESP as storage for EFI variables.\nDevices with SPI Flash are used for storing environment with this\ncommit we allow EFI variables to be stored on SPI Flash.\n\nhttps://github.com/rhboot/efivar\nis not updated to support this location that's why you can mimic it by\nrunning:\ndd if=/sys/firmware/efi/efivars/VarToFile-b2ac5fc9-92b7-4acd-aeac-11e818c3130c \\\n   of=/tmp/vars skip=4 bs=1\nflashcp /tmp/vars /dev/mtdX\n\nwhere mtdX should match location defined by\nCONFIG_EFI_VARIABLE_SF_OFFSET/CONFIG_EFI_VAR_BUF_SIZE.\n\nSigned-off-by: Shantur Rathore <i@shantur.com>\nSigned-off-by: Michal Simek <michal.simek@amd.com>\nTested-by: Neil Armstrong <neil.armstrong@linaro.org> # on AML-S905D3-CC\nAcked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>\n\n---\n\nChanges in v8:\n- Add missing EFI_VARIABLE_SF_STORE dependency to EFI_VARIABLE_SF_DEVICE_INDEX\n\nChanges in v7:\n- sed -i 's/efi_var_from/efi_var_from_storage/g'\n\nChanges in v6:\n- sed -i 's/efi_var_read/efi_var_from/g'\n- sed -i 's/efi_var_write/efi_var_to_storage/g'\n\nChanges in v4:\n- Extend Kconfig description\n- Extend commit message and describe efivar missing part\n- use unify methods for reading/writing variable\n\nChanges in v3:\n- Fixed compiler warnings.\n\nChanges in v2:\n- Refactored efi_var_file to move common parts out as requested\n- Changed ifdefs to use CONFIG_IS_DEFINED\n- Fixed typos\n\n lib/efi_loader/Kconfig      | 35 +++++++++++++-\n lib/efi_loader/Makefile     |  1 +\n lib/efi_loader/efi_var_sf.c | 92 +++++++++++++++++++++++++++++++++++++\n 3 files changed, 127 insertions(+), 1 deletion(-)\n create mode 100644 lib/efi_loader/efi_var_sf.c",
    "diff": "diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig\nindex 579eed658801..0f6f927ddaf1 100644\n--- a/lib/efi_loader/Kconfig\n+++ b/lib/efi_loader/Kconfig\n@@ -124,6 +124,24 @@ config EFI_VARIABLE_FILE_STORE\n \t  Select this option if you want non-volatile UEFI variables to be\n \t  stored as file /ubootefi.var on the EFI system partition.\n \n+config EFI_VARIABLE_SF_STORE\n+\tbool \"Store non-volatile UEFI variables in SPI Flash\"\n+\tdepends on SPI_FLASH\n+\thelp\n+\t  Select this option if you want non-volatile UEFI variables to be\n+\t  stored in SPI Flash.\n+\n+\t  Define CONFIG_EFI_VARIABLE_SF_OFFSET as offset in SPI Flash to use as\n+\t  the storage for variables. CONFIG_EFI_VAR_BUF_SIZE defines the space\n+\t  needed.\n+\n+\t  Note that SPI Flash devices have a limited number of program/erase\n+\t  cycles. Frequent updates to UEFI variables may cause excessive wear\n+\t  and can permanently damage the flash device, particularly on SPI NAND\n+\t  or low-end SPI NOR parts without wear leveling. This option should be\n+\t  used with care on such systems, and is not recommended for platforms\n+\t  where UEFI variables are updated frequently.\n+\n config EFI_MM_COMM_TEE\n \tbool \"UEFI variables storage service via the trusted world\"\n \tdepends on OPTEE\n@@ -153,7 +171,7 @@ endchoice\n \n config EFI_RT_VOLATILE_STORE\n \tbool \"Allow variable runtime services in volatile storage (e.g RAM)\"\n-\tdepends on EFI_VARIABLE_FILE_STORE\n+\tdepends on EFI_VARIABLE_FILE_STORE || EFI_VARIABLE_SF_STORE\n \thelp\n \t  When EFI variables are stored on file we don't allow SetVariableRT,\n \t  since the OS doesn't know how to write that file. At the same time\n@@ -194,6 +212,21 @@ config FFA_SHARED_MM_BUF_ADDR\n \t  the MM SP in secure world.\n \t  It is assumed that the MM SP knows the address of the shared MM communication buffer.\n \n+config EFI_VARIABLE_SF_OFFSET\n+\thex \"EFI variables in SPI flash offset\"\n+\tdepends on EFI_VARIABLE_SF_STORE\n+\thelp\n+\t  Offset from the start of the SPI Flash where EFI variables will be stored.\n+\t  This should be aligned to the sector size of SPI Flash.\n+\n+config EFI_VARIABLE_SF_DEVICE_INDEX\n+\tint \"Device Index for target SPI Flash\"\n+\tdepends on EFI_VARIABLE_SF_STORE\n+\tdefault 0\n+\thelp\n+\t  The index of SPI Flash device used for storing EFI variables. This would be\n+\t  needed if there are more than 1 SPI Flash devices available to use.\n+\n config EFI_VARIABLES_PRESEED\n \tbool \"Initial values for UEFI variables\"\n \tdepends on !COMPILE_TEST\ndiff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile\nindex ca1775eb03be..d73ad43951b1 100644\n--- a/lib/efi_loader/Makefile\n+++ b/lib/efi_loader/Makefile\n@@ -54,6 +54,7 @@ obj-y += efi_variable_tee.o\n else\n obj-y += efi_variable.o\n obj-$(CONFIG_EFI_VARIABLE_FILE_STORE) += efi_var_file.o\n+obj-$(CONFIG_EFI_VARIABLE_SF_STORE) += efi_var_sf.o\n obj-$(CONFIG_EFI_VARIABLES_PRESEED) += efi_var_seed.o\n endif\n obj-y += efi_watchdog.o\ndiff --git a/lib/efi_loader/efi_var_sf.c b/lib/efi_loader/efi_var_sf.c\nnew file mode 100644\nindex 000000000000..61d68f7c5c94\n--- /dev/null\n+++ b/lib/efi_loader/efi_var_sf.c\n@@ -0,0 +1,92 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/*\n+ * SPI Flash interface for UEFI variables\n+ *\n+ * Copyright (c) 2023, Shantur Rathore\n+ * Copyright (C) 2026, Advanced Micro Devices, Inc.\n+ */\n+\n+#define LOG_CATEGORY LOGC_EFI\n+\n+#include <efi_loader.h>\n+#include <efi_variable.h>\n+#include <spi_flash.h>\n+#include <dm.h>\n+\n+efi_status_t efi_var_to_storage(void)\n+{\n+\tefi_status_t ret;\n+\tstruct efi_var_file *buf;\n+\tloff_t len;\n+\tstruct udevice *sfdev;\n+\n+\tret = efi_var_collect(&buf, &len, EFI_VARIABLE_NON_VOLATILE);\n+\tif (len > EFI_VAR_BUF_SIZE) {\n+\t\tlog_err(\"EFI var buffer length more than target SPI Flash size\");\n+\t\tret = EFI_OUT_OF_RESOURCES;\n+\t\tgoto error;\n+\t}\n+\n+\tlog_debug(\"%s - Got buffer to write buf->len : %d\\n\", __func__, buf->length);\n+\n+\tif (ret != EFI_SUCCESS)\n+\t\tgoto error;\n+\n+\tret = uclass_get_device(UCLASS_SPI_FLASH, CONFIG_EFI_VARIABLE_SF_DEVICE_INDEX, &sfdev);\n+\tif (ret)\n+\t\tgoto error;\n+\n+\tret = spi_flash_erase_dm(sfdev, CONFIG_EFI_VARIABLE_SF_OFFSET, EFI_VAR_BUF_SIZE);\n+\tlog_debug(\"%s - Erased SPI Flash offset %x\\n\", __func__, CONFIG_EFI_VARIABLE_SF_OFFSET);\n+\tif (ret)\n+\t\tgoto error;\n+\n+\tret = spi_flash_write_dm(sfdev, CONFIG_EFI_VARIABLE_SF_OFFSET, len, buf);\n+\tlog_debug(\"%s - Wrote buffer to SPI Flash : %ld\\n\", __func__, ret);\n+\n+\tif (ret)\n+\t\tgoto error;\n+\n+\tret = EFI_SUCCESS;\n+error:\n+\tif (ret)\n+\t\tlog_err(\"Failed to persist EFI variables in SF\\n\");\n+\tfree(buf);\n+\treturn ret;\n+}\n+\n+efi_status_t efi_var_from_storage(void)\n+{\n+\tstruct efi_var_file *buf;\n+\tefi_status_t ret;\n+\tstruct udevice *sfdev;\n+\n+\tbuf = calloc(1, EFI_VAR_BUF_SIZE);\n+\tif (!buf) {\n+\t\tlog_err(\"%s - Unable to allocate buffer\\n\", __func__);\n+\t\treturn EFI_OUT_OF_RESOURCES;\n+\t}\n+\n+\tret = uclass_get_device(UCLASS_SPI_FLASH, 0, &sfdev);\n+\tif (ret)\n+\t\tgoto error;\n+\n+\tret = spi_flash_read_dm(sfdev, CONFIG_EFI_VARIABLE_SF_OFFSET,\n+\t\t\t\tEFI_VAR_BUF_SIZE, buf);\n+\n+\tlog_debug(\"%s - read buffer buf->length: %x\\n\", __func__, buf->length);\n+\n+\tif (ret || buf->length < sizeof(struct efi_var_file)) {\n+\t\tlog_err(\"%s - buffer read from SPI Flash isn't valid\\n\", __func__);\n+\t\tgoto error;\n+\t}\n+\n+\tret = efi_var_restore(buf, false);\n+\tif (ret != EFI_SUCCESS)\n+\t\tlog_err(\"%s - Unable to restore EFI variables from buffer\\n\", __func__);\n+\n+\tret = EFI_SUCCESS;\n+error:\n+\tfree(buf);\n+\treturn ret;\n+}\n",
    "prefixes": [
        "v8",
        "4/4"
    ]
}