incorporate arch migrations into spinor

This commit is contained in:
bunnie 2025-05-11 12:32:29 +08:00
parent ee22ff783c
commit 8a74ed6078
2 changed files with 5 additions and 6 deletions

View file

@ -16,6 +16,7 @@ susres = { package = "xous-api-susres", version = "0.9.63" }
trng = { path = "../trng" }
com = { path = "../com" }
llio = { path = "../llio" }
precursor-hal = { path = "../../libs/precursor-hal" }
rkyv = { version = "0.8.8", default-features = false, features = [
"std",

View file

@ -7,6 +7,7 @@ use std::collections::HashSet;
use api::*;
use num_traits::*;
use precursor_hal::board::*;
use xous::{msg_blocking_scalar_unpack, msg_scalar_unpack};
use xous_ipc::Buffer;
@ -929,10 +930,9 @@ fn main() -> ! {
let mut wr = buffer.to_original::<WriteRegion, _>().unwrap();
let mut authorized = true;
if let Some(st) = soc_token {
if staging_write_protect
&& ((wr.start >= xous::SOC_REGION_LOC) && (wr.start < xous::LOADER_LOC))
if staging_write_protect && ((wr.start >= SOC_REGION_LOC) && (wr.start < LOADER_LOC))
|| !staging_write_protect
&& ((wr.start >= xous::SOC_REGION_LOC) && (wr.start < xous::SOC_STAGING_GW_LOC))
&& ((wr.start >= SOC_REGION_LOC) && (wr.start < SOC_STAGING_GW_LOC))
{
// if only the holder of the ID that matches the SoC token can write to the SOC flash
// area other areas are not as strictly controlled because
@ -972,9 +972,7 @@ fn main() -> ! {
let mut wr = buffer.to_original::<BulkErase, _>().unwrap();
// bounds check to within the PDDB region for bulk erases. Please use standard patching for
// other regions.
let authorized = if (wr.start >= xous::PDDB_LOC)
&& ((wr.start + wr.len) <= (xous::PDDB_LOC + xous::PDDB_LEN))
{
let authorized = if (wr.start >= PDDB_LOC) && ((wr.start + wr.len) <= (PDDB_LOC + PDDB_LEN)) {
true
} else {
false