spinor: add discriminants to api calls

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2022-06-27 15:27:15 +08:00
parent 7aae6dcab9
commit 4410c2a1b3

View file

@ -11,28 +11,28 @@ pub const SPINOR_BULK_ERASE_SIZE: u32 = 0x1_0000; // this is the bulk erase size
#[derive(num_derive::FromPrimitive, num_derive::ToPrimitive, Debug)] #[derive(num_derive::FromPrimitive, num_derive::ToPrimitive, Debug)]
pub(crate) enum Opcode { pub(crate) enum Opcode {
/// writes are split into multiple transactions. Must acquire exclusive rights before initiation /// writes are split into multiple transactions. Must acquire exclusive rights before initiation
AcquireExclusive, AcquireExclusive = 0,
ReleaseExclusive, ReleaseExclusive = 1,
/// a special token is reserved for writing to the SoC region, only one service is allowed to do that /// a special token is reserved for writing to the SoC region, only one service is allowed to do that
RegisterSocToken, RegisterSocToken = 2,
/// the SocToken holder can allow for writes to the staging area by other processes /// the SocToken holder can allow for writes to the staging area by other processes
SetStagingWriteProtect, SetStagingWriteProtect = 3,
ClearStagingWriteProtect, ClearStagingWriteProtect = 4,
/// program a region. Erase is accomplished by calling WriteRegion with all 0xFF's as data. /// program a region. Erase is accomplished by calling WriteRegion with all 0xFF's as data.
WriteRegion, WriteRegion = 5,
/// bulk erase a region. Has fewer safety checks, used for accelerating the bulk clear of the PDDB for init. /// bulk erase a region. Has fewer safety checks, used for accelerating the bulk clear of the PDDB for init.
BulkErase, BulkErase = 6,
/// allow the susres manager to prevent new ops from happening during a suspend /// allow the susres manager to prevent new ops from happening during a suspend
AcquireSuspendLock, AcquireSuspendLock = 7,
ReleaseSuspendLock, ReleaseSuspendLock = 8,
/// intra-thread messages for suspend and resume /// intra-thread messages for suspend and resume
SuspendInner, SuspendInner = 9,
ResumeInner, ResumeInner = 10,
/// internal interrupt handler ops /// internal interrupt handler ops
EccError, EccError = 11,
} }
// Erase/Write are uninterruptable operations. Split suspend/resume // Erase/Write are uninterruptable operations. Split suspend/resume
// into a separate server to asynchronously manage this. // into a separate server to asynchronously manage this.