depthcharge.register
The depthcharge.register subpackage provides register access functionality.
Bear in mind that not all registers will be accessible, given that some subset will be tainted by virtue of executing code in an attempt to read them. This is intended only for retrieving special register values, such as that reserved for U-Boot’s global data structure pointer.
Base Classes
- class depthcharge.register.RegisterReader(ctx, **_kwargs)
Base class for
Operationimplementations used to read device registers.- read(register: str) int
Read a value from the target device register, specified by name. Note that registers can be obtained using
depthcharge.Architecture.
- _setup()
RegisterReadersubclasses shall override this method to perform any necessary setup or preparation.
- _teardown()
RegisterReadersubclasses shall override this method to perform any necessary deinitialization actions.
- _read(register: str, info) int
Subclasses of RegisterReader are required to implement the _read() method, which performs the specific operation.
The subclass receives both the validated register name.
- class depthcharge.register.DataAbortRegisterReader(ctx, **kwargs)
This is a type of
RegisterReaderthat triggers a Data Abort on ARM targets and parses the crash output to retrieve a register value.For these to work, the system must automatically reset upon crash, and allow re-entry into the console. Subclasses must set the
crash_or_reboot=Trueproperty in their private_requireddictionary in order to exclude the operation when a user has indicated that this should not be permitted.A da_crash_addr keyword argument can passed to constructors in order to specify the memory address to access in order to induce a data abort. It defaults to an architecture-specific value. This value can be overridden by a DEPTHCHARGE_DA_ADDR environment variable.
- _trigger_data_abort() str
Subclasses must implement this method.
It should trigger a data abort and return the crash dump text printed to the terminal. This class will take care of parsing it accordingly.
Implementations
DataAbortRegisterReader
- class depthcharge.register.CRC32CrashRegisterReader(ctx, **kwargs)
This is a
DataAbortRegisterReaderthat uses thecrc32console command to trigger the Data Abort used to read registers.
- class depthcharge.register.FDTCrashRegisterReader(ctx, **kwargs)
This is a
DataAbortRegisterReaderthat uses thefdtconsole command to trigger the Data Abort used to read registers.
- class depthcharge.register.ItestCrashRegisterReader(ctx, **kwargs)
This is a
DataAbortRegisterReaderthat uses theitestconsole command to trigger the Data Abort used to read registers.
- class depthcharge.register.MdCrashRegisterReader(ctx, **kwargs)
A
DataAbortRegisterReaderthat uses themd.lconsole command to trigger a Data Abort.
- class depthcharge.register.MmCrashRegisterReader(ctx, **kwargs)
A
DataAbortRegisterReaderthat uses themm.lconsole command to trigger a Data Abort.
- class depthcharge.register.MwCrashRegisterReader(ctx, **kwargs)
A
DataAbortRegisterReaderthat uses themm.lconsole command to trigger a Data Abort.
- class depthcharge.register.NmCrashRegisterReader(ctx, **kwargs)
A
DataAbortRegisterReaderthat uses thenm.lconsole command to trigger a Data Abort.
- class depthcharge.register.SetexprCrashRegisterReader(ctx, **kwargs)
This is a
DataAbortRegisterReaderthat uses thesetexprconsole command to trigger the Data Abort used to read registers.