Skip to content

flash: allow extra tool flags (e.g. dpcmd --vcc 1800) #381

Description

@llogen

Is your feature request related to a problem? Please describe.

dpcmd has three distinct write operations and the module hardcodes one of them:

flag dpcmd name behaviour
-u --auto read, compare, erase only the differing sectors, program those
-z --batch blank-check, erase the entire chip, program the whole file from 0
-p --prog program without erasing

The module always uses -u. That is a sensible default, but -z is what you want for a known-good full image or a chip in an unknown state, and -p when the flash was erased separately. There is no way to pick, and the current choice is stated only in a code comment.

Describe the solution you'd like

with:
  tool: dpcmd
  writeMode: batch     # auto (default) | batch | prog
  • Unset resolves to auto, so existing configs are unchanged.
  • flashrom/flashprog always use -w and have no equivalent; setting writeMode for them should be a config error rather than silently ignored.
  • Document the modes and the generated command line per tool in pkg/module/flash/README.md.

Describe alternatives you've considered

A generic args: [...] passthrough. Rejected: the modes are mutually exclusive operations, so -z passed that way would collide with the -u the module already emits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions