[PATCH v1 0/8] bootcount: introduce GPT-backed bootcount device

dmukhin at ford.com dmukhin at ford.com
Fri Jun 5 05:38:59 CEST 2026


This series adds new GPT-backed bootcount device with
ChromiumOS-inspired counters/flags logic [1].

Patch 1 is ChromiumOS-style 16-bit flags manipulation routines

Patch 2-5 introduce extension to existing 'gpt' command allowing
          the user to update top 16 bits of selected GPT PTE flags
          manually.

Patch 6 introduces the new bootcount device with compatible
        "u-boot,bootcount-gpt"

Patch 7 allow U-Boot running as a coreboot payload, to use new
        bootcount-gpt device.

Patch 8 excludes bootcount-gpt from being used in autoboot code path
        to allow custom bootflow logic.

[1] https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/master/cgpt

Denis Mukhin (8):
  cros: add common helpers for GPT flags
  disk: efi: introduce {read,write}_disk_flags
  test: disk: coverage for {read,write}_disk_flags
  cmd: gpt: enable extension to manipulate GPT PTE attributes
  configs: sandbox: enable GPT flags extension
  bootcount: gpt: introduce GPT-backed bootcount device
  bootcount: gpt: ensure coreboot payload enables DM_BOOTCOUNT
  bootcount: gate bootcount_{inc,error}() behind
    !CONFIG_DM_BOOTCOUNT_GPT

 cmd/Kconfig                       |   8 ++
 cmd/gpt.c                         |  97 ++++++++++++++++++++
 configs/sandbox_defconfig         |   1 +
 disk/part_efi.c                   | 141 +++++++++++++++++++++++++++-
 drivers/bootcount/Kconfig         |  10 +-
 drivers/bootcount/Makefile        |   1 +
 drivers/bootcount/bootcount-gpt.c | 140 ++++++++++++++++++++++++++++
 include/bootcount.h               |   3 +-
 include/cros_flags.h              |  74 +++++++++++++++
 include/part.h                    |  24 +++++
 test/dm/Makefile                  |   2 +-
 test/dm/gpt-flags.c               | 148 ++++++++++++++++++++++++++++++
 12 files changed, 641 insertions(+), 8 deletions(-)
 create mode 100644 drivers/bootcount/bootcount-gpt.c
 create mode 100644 include/cros_flags.h
 create mode 100644 test/dm/gpt-flags.c

-- 
2.54.0



More information about the U-Boot mailing list