Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to ignore already-set bits in otp set command #175

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

will-v-pi
Copy link

This adds a way to set bits in an OTP row, without having to specify a field - for example for the page lock rows

Allows you to workaround this (for example)

$ picotool otp set crit1 0x1
ROW 0x0040  OLD_VALUE=0x000000: OTP_DATA_CRIT1
        "Page 1 critical boot flags (RBIT-8)"
$ picotool otp set crit1 0x2
ROW 0x0040  OLD_VALUE=0x000001: OTP_DATA_CRIT1
        "Page 1 critical boot flags (RBIT-8)"
ERROR: Cannot clear bits in OTP row(s): current value 000001, new value 000002

using the -s argument

$ picotool otp set crit1 0x2 -s
ROW 0x0040  OLD_VALUE=0x000001: OTP_DATA_CRIT1
        "Page 1 critical boot flags (RBIT-8)"
$ picotool otp get crit1
ROW 0x0040: OTP_DATA_CRIT1
        "Page 1 critical boot flags (RBIT-8)"

    VALUE 0x000003

    field GLITCH_DETECTOR_SENS (bits 5-6) = 0
        "Increase the sensitivity of the glitch detectors from their default."
    field GLITCH_DETECTOR_ENABLE (bit 4) = 0
        "Arm the glitch detectors to reset the system if an abnormal clock/power event is observed."
    field BOOT_ARCH (bit 3) = 0
        "Set the default boot architecture, 0=ARM 1=RISC-V. Ignored if ARM_DISABLE, RISCV_DISABLE or SECURE_BOOT_ENABLE is set."
    field DEBUG_DISABLE (bit 2) = 0
        "Disable all debug access"
    field SECURE_DEBUG_DISABLE (bit 1) = 1
        "Disable Secure debug access"
    field SECURE_BOOT_ENABLE (bit 0) = 1
        "Enable boot signature enforcement, and permanently disable the RISC-V cores."

Fixes #137

@will-v-pi will-v-pi added this to the 2.1.0 milestone Nov 12, 2024
@will-v-pi will-v-pi linked an issue Nov 12, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to OR values into non ECC rows
1 participant