otp

package
v0.0.0-...-dec27cd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2024 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Overview

Package otp provides support for One-Time-Programmable (OTP) fuses read and write operations.

WARNING: Fusing SoC OTPs is an **irreversible** action that permanently fuses values on the device. This means that any errors in the process, or lost fused data such as cryptographic key material, might result in a **bricked** device.

The use of this package is therefore **at your own risk**.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlowNVMEM

func BlowNVMEM(devicePath string, f *fusemap.FuseMap, name string, val []byte) (res []byte, addr uint32, off int, bitLen int, err error)

BlowNVMEM a fuse through Linux NVMEM subsystem framework, returns the input value converted as required for the fusing operation as well as the written address. The name argument could be a register or an individual OTP fuse.

An empty NVMEM device path is allowed to simulate the operation and test returned values.

The value parameter is interpreted as a big-endian value, please note that certain tools, such as the ones creating the `SRK_HASH` for secure boot purposes, typically prepare their output in little-endian format.

WARNING: Fusing SoC OTPs is an **irreversible** action that permanently fuses values on the device. This means that any errors in the process, or lost fused data such as cryptographic key material, might result in a **bricked** device.

The use of this function is therefore **at your own risk**.

func ReadNVMEM

func ReadNVMEM(devicePath string, f *fusemap.FuseMap, name string) (res []byte, addr uint32, off int, bitLen int, err error)

ReadNVMEM reads a register or fuse through Linux NVMEM subsystem framework. The name argument could be a register or an individual OTP fuse.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL