mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
cleanup more turds left over during the bringup of suspend/resume
This commit is contained in:
parent
48074b626b
commit
46fe3885dc
9 changed files with 83 additions and 231 deletions
|
|
@ -3,7 +3,7 @@
|
|||
<device schemaVersion="1.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="CMSIS-SVD.xsd" >
|
||||
<vendor>litex</vendor>
|
||||
<name>SOC</name>
|
||||
<description><![CDATA[Litex SoC 2021-04-29 02:33:22]]></description>
|
||||
<description><![CDATA[Litex SoC 2021-04-30 23:37:05]]></description>
|
||||
|
||||
<addressUnitBits>8</addressUnitBits>
|
||||
<width>32</width>
|
||||
|
|
@ -1070,10 +1070,10 @@ register to disable individual events.]]></description>
|
|||
<register>
|
||||
<name>GIT_GITREV</name>
|
||||
<description><![CDATA[First 32-bits of the git revision. This documentation was built from git rev
|
||||
``d738663a``, so this value is 3610797626, which should be enough to check out
|
||||
``79550678``, so this value is 2035615352, which should be enough to check out
|
||||
the exact git version used to build this firmware.]]></description>
|
||||
<addressOffset>0x0014</addressOffset>
|
||||
<resetValue>0xd738663a</resetValue>
|
||||
<resetValue>0x79550678</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
|
|
@ -1090,7 +1090,7 @@ the exact git version used to build this firmware.]]></description>
|
|||
is ``1``, then the repository this was built from has one additional commit
|
||||
beyond the tag indicated in `MAJOR`, `MINOR`, and `REVISION`.]]></description>
|
||||
<addressOffset>0x0018</addressOffset>
|
||||
<resetValue>0x02</resetValue>
|
||||
<resetValue>0x03</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
|
|
@ -2376,51 +2376,9 @@ register to disable individual events.]]></description>
|
|||
<value>9</value>
|
||||
</interrupt>
|
||||
</peripheral>
|
||||
<peripheral>
|
||||
<name>RESUMEKICKER</name>
|
||||
<baseAddress>0xF0013000</baseAddress>
|
||||
<groupName>RESUMEKICKER</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
<name>KICKER</name>
|
||||
<addressOffset>0x0000</addressOffset>
|
||||
<resetValue>0x00</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
<name>kick</name>
|
||||
<msb>0</msb>
|
||||
<bitRange>[0:0]</bitRange>
|
||||
<lsb>0</lsb>
|
||||
<description><![CDATA[Write a `1` to trigger the SusRes software interrupt]]></description>
|
||||
</field>
|
||||
</fields>
|
||||
</register>
|
||||
<register>
|
||||
<name>STATE</name>
|
||||
<addressOffset>0x0004</addressOffset>
|
||||
<resetValue>0x00</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
<name>resume</name>
|
||||
<msb>0</msb>
|
||||
<bitRange>[0:0]</bitRange>
|
||||
<lsb>0</lsb>
|
||||
<description><![CDATA[A replica of the `resume` field in SusRes]]></description>
|
||||
</field>
|
||||
</fields>
|
||||
</register>
|
||||
</registers>
|
||||
<addressBlock>
|
||||
<offset>0</offset>
|
||||
<size>0x8</size>
|
||||
<usage>registers</usage>
|
||||
</addressBlock>
|
||||
</peripheral>
|
||||
<peripheral>
|
||||
<name>POWER</name>
|
||||
<baseAddress>0xF0014000</baseAddress>
|
||||
<baseAddress>0xF0013000</baseAddress>
|
||||
<groupName>POWER</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -2569,7 +2527,7 @@ reset fashion]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>SPINOR</name>
|
||||
<baseAddress>0xF0015000</baseAddress>
|
||||
<baseAddress>0xF0014000</baseAddress>
|
||||
<groupName>SPINOR</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -2850,7 +2808,7 @@ checked]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>KEYBOARD</name>
|
||||
<baseAddress>0xF0016000</baseAddress>
|
||||
<baseAddress>0xF0015000</baseAddress>
|
||||
<groupName>KEYBOARD</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3108,7 +3066,7 @@ again until the interrupt is serviced.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>KEYINJECT</name>
|
||||
<baseAddress>0xF0017000</baseAddress>
|
||||
<baseAddress>0xF0016000</baseAddress>
|
||||
<groupName>KEYINJECT</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3144,14 +3102,14 @@ inject too fast.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>SEED</name>
|
||||
<baseAddress>0xF0018000</baseAddress>
|
||||
<baseAddress>0xF0017000</baseAddress>
|
||||
<groupName>SEED</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
<name>SEED1</name>
|
||||
<description><![CDATA[Bits 32-63 of `SEED_SEED`. Seed used for the build]]></description>
|
||||
<addressOffset>0x0000</addressOffset>
|
||||
<resetValue>0x676324b6</resetValue>
|
||||
<resetValue>0x1cbd6891</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
|
|
@ -3166,7 +3124,7 @@ inject too fast.]]></description>
|
|||
<name>SEED0</name>
|
||||
<description><![CDATA[Bits 0-31 of `SEED_SEED`.]]></description>
|
||||
<addressOffset>0x0004</addressOffset>
|
||||
<resetValue>0x57ada412</resetValue>
|
||||
<resetValue>0x3d2e31ed</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
|
|
@ -3186,7 +3144,7 @@ inject too fast.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>KEYROM</name>
|
||||
<baseAddress>0xF0019000</baseAddress>
|
||||
<baseAddress>0xF0018000</baseAddress>
|
||||
<groupName>KEYROM</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3228,7 +3186,7 @@ inject too fast.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>AUDIO</name>
|
||||
<baseAddress>0xF001A000</baseAddress>
|
||||
<baseAddress>0xF0019000</baseAddress>
|
||||
<groupName>AUDIO</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3600,7 +3558,7 @@ I2S_FORMAT.I2S_STANDARD is I2S standard]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>TRNG_KERNEL</name>
|
||||
<baseAddress>0xF001B000</baseAddress>
|
||||
<baseAddress>0xF001A000</baseAddress>
|
||||
<groupName>TRNG_KERNEL</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3736,7 +3694,7 @@ I2S_FORMAT.I2S_STANDARD is I2S standard]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>TRNG_SERVER</name>
|
||||
<baseAddress>0xF001C000</baseAddress>
|
||||
<baseAddress>0xF001B000</baseAddress>
|
||||
<groupName>TRNG_SERVER</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -4068,7 +4026,7 @@ to max field size]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>TRNG</name>
|
||||
<baseAddress>0xF001D000</baseAddress>
|
||||
<baseAddress>0xF001C000</baseAddress>
|
||||
<groupName>TRNG</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -4381,7 +4339,7 @@ VCCBRAM (V) = ``Value`` x 3 / 4096.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>SHA512</name>
|
||||
<baseAddress>0xF001E000</baseAddress>
|
||||
<baseAddress>0xF001D000</baseAddress>
|
||||
<groupName>SHA512</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -4876,7 +4834,7 @@ in bits]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>ENGINE</name>
|
||||
<baseAddress>0xF001F000</baseAddress>
|
||||
<baseAddress>0xF001E000</baseAddress>
|
||||
<groupName>ENGINE</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5105,7 +5063,7 @@ exactly reflects the binary layout of an Engine instruction.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>JTAG</name>
|
||||
<baseAddress>0xF0020000</baseAddress>
|
||||
<baseAddress>0xF001F000</baseAddress>
|
||||
<groupName>JTAG</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5163,7 +5121,7 @@ exactly reflects the binary layout of an Engine instruction.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>WDT</name>
|
||||
<baseAddress>0xF0021000</baseAddress>
|
||||
<baseAddress>0xF0020000</baseAddress>
|
||||
<groupName>WDT</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5323,7 +5281,7 @@ register to disable individual events.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>D11CTIME</name>
|
||||
<baseAddress>0xF0022000</baseAddress>
|
||||
<baseAddress>0xF0021000</baseAddress>
|
||||
<groupName>D11CTIME</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5365,7 +5323,7 @@ register to disable individual events.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>IDENTIFIER_MEM</name>
|
||||
<baseAddress>0xF0023000</baseAddress>
|
||||
<baseAddress>0xF0022000</baseAddress>
|
||||
<groupName>IDENTIFIER_MEM</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5392,7 +5350,7 @@ register to disable individual events.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>TIMER0</name>
|
||||
<baseAddress>0xF0024000</baseAddress>
|
||||
<baseAddress>0xF0023000</baseAddress>
|
||||
<groupName>TIMER0</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ pub extern "C" fn trap_handler(
|
|||
|
||||
use crate::arch::exception::RiscvException;
|
||||
let ex = RiscvException::from_regs(sc.bits(), sepc::read(), stval::read());
|
||||
println!("ex: {:?}", ex);
|
||||
// println!("ex: {:?}", ex);
|
||||
if sc.is_exception() {
|
||||
// If the CPU tries to store, look for a "reserved page" and provide
|
||||
// it with one if necessary.
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ _start:
|
|||
allows a Xous interrupt context to run, which allows the Xous return-from-interrupt
|
||||
handler to set up the remainder of the resume tasks.
|
||||
*/
|
||||
// Restore a default stack pointer
|
||||
// Restore a default stack pointer - used by interrupt handlers and considered temporary/smashable
|
||||
li sp, 0xfffefffc
|
||||
|
||||
// setup sie [ssoft, sext]. This corresponds to bits 1 and 9, or 0b10_0000_0010
|
||||
|
|
|
|||
|
|
@ -1079,7 +1079,7 @@ fn boot_sequence(args: KernelArguments, _signature: u32) -> ! {
|
|||
read_initial_config(&mut cfg);
|
||||
|
||||
// check to see if we are recovering from a clean suspend or not
|
||||
let (clean, was_forced_suspend) = check_resume(&mut cfg);
|
||||
let (clean, was_forced_suspend, susres_pid) = check_resume(&mut cfg);
|
||||
|
||||
if !clean {
|
||||
// cold boot path
|
||||
|
|
@ -1188,7 +1188,7 @@ fn boot_sequence(args: KernelArguments, _signature: u32) -> ! {
|
|||
println!("0x{:08x}", (*backup_args)[i]);
|
||||
}
|
||||
}
|
||||
let satp = ((*backup_args)[3] as usize) & 0x803F_FFFF | (10 << 22);
|
||||
let satp = ((*backup_args)[3] as usize) & 0x803F_FFFF | (((susres_pid as usize) & 0x1FF) << 22);
|
||||
//let satp = (*backup_args)[3];
|
||||
println!("Adjusting SATP to the sures process. Was: 0x{:08x} now: 0x{:08x}", (*backup_args)[3], satp);
|
||||
|
||||
|
|
@ -1212,7 +1212,7 @@ fn boot_sequence(args: KernelArguments, _signature: u32) -> ! {
|
|||
}
|
||||
}
|
||||
|
||||
fn check_resume(cfg: &mut BootConfig) -> (bool, bool) {
|
||||
fn check_resume(cfg: &mut BootConfig) -> (bool, bool, u32) {
|
||||
use utralib::generated::*;
|
||||
const WORDS_PER_SECTOR: usize = 128;
|
||||
const NUM_SECTORS: usize = 8;
|
||||
|
|
@ -1229,14 +1229,17 @@ fn check_resume(cfg: &mut BootConfig) -> (bool, bool) {
|
|||
let mut clean = true;
|
||||
let mut hashbuf: [u32; WORDS_PER_SECTOR - 1] = [0; WORDS_PER_SECTOR - 1];
|
||||
let mut index: usize = 0;
|
||||
let mut pid: u32 = 0;
|
||||
for sector in 0..NUM_SECTORS {
|
||||
for i in 0..hashbuf.len() {
|
||||
hashbuf[i] = unsafe{(*marker)[index * WORDS_PER_SECTOR + i]};
|
||||
}
|
||||
// sector 0 contains the boot seeds, which we replace with our own as read out from our FPGA before computing the hash
|
||||
// it also contains the PID of the suspend/resume process manager, which we need to inject into the SATP
|
||||
if sector == 0 {
|
||||
hashbuf[1] = seed0;
|
||||
hashbuf[2] = seed1;
|
||||
pid = hashbuf[3];
|
||||
}
|
||||
let hash = crate::murmur3::murmur3_32(&hashbuf, 0);
|
||||
if hash != unsafe{(*marker)[(index+1) * WORDS_PER_SECTOR - 1]} {
|
||||
|
|
@ -1252,7 +1255,7 @@ fn check_resume(cfg: &mut BootConfig) -> (bool, bool) {
|
|||
unsafe{(*marker)[i] = 0;}
|
||||
}
|
||||
|
||||
(clean, was_forced_suspend)
|
||||
(clean, was_forced_suspend, pid)
|
||||
}
|
||||
|
||||
fn phase_1(cfg: &mut BootConfig) {
|
||||
|
|
@ -1382,6 +1385,6 @@ pub fn phase_2(cfg: &mut BootConfig) {
|
|||
cfg.runtime_page_tracker.len()
|
||||
);
|
||||
// mark pages used by suspend/resume according to their needs
|
||||
cfg.runtime_page_tracker[cfg.sram_size / PAGE_SIZE - 1] = 1; // loader stack -- do not touch as it contains kerner args
|
||||
cfg.runtime_page_tracker[cfg.sram_size / PAGE_SIZE - 2] = 0; // clean suspend page
|
||||
cfg.runtime_page_tracker[cfg.sram_size / PAGE_SIZE - 1] = 1; // claim the loader stack -- do not allow tampering, as it contains backup kernel args
|
||||
cfg.runtime_page_tracker[cfg.sram_size / PAGE_SIZE - 2] = 0; // allow clean suspend page to be mapped in Xous
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<device schemaVersion="1.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="CMSIS-SVD.xsd" >
|
||||
<vendor>litex</vendor>
|
||||
<name>SOC</name>
|
||||
<description><![CDATA[Litex SoC 2021-04-29 02:33:22]]></description>
|
||||
<description><![CDATA[Litex SoC 2021-04-30 23:37:05]]></description>
|
||||
|
||||
<addressUnitBits>8</addressUnitBits>
|
||||
<width>32</width>
|
||||
|
|
@ -1070,10 +1070,10 @@ register to disable individual events.]]></description>
|
|||
<register>
|
||||
<name>GIT_GITREV</name>
|
||||
<description><![CDATA[First 32-bits of the git revision. This documentation was built from git rev
|
||||
``d738663a``, so this value is 3610797626, which should be enough to check out
|
||||
``79550678``, so this value is 2035615352, which should be enough to check out
|
||||
the exact git version used to build this firmware.]]></description>
|
||||
<addressOffset>0x0014</addressOffset>
|
||||
<resetValue>0xd738663a</resetValue>
|
||||
<resetValue>0x79550678</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
|
|
@ -1090,7 +1090,7 @@ the exact git version used to build this firmware.]]></description>
|
|||
is ``1``, then the repository this was built from has one additional commit
|
||||
beyond the tag indicated in `MAJOR`, `MINOR`, and `REVISION`.]]></description>
|
||||
<addressOffset>0x0018</addressOffset>
|
||||
<resetValue>0x02</resetValue>
|
||||
<resetValue>0x03</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
|
|
@ -2376,51 +2376,9 @@ register to disable individual events.]]></description>
|
|||
<value>9</value>
|
||||
</interrupt>
|
||||
</peripheral>
|
||||
<peripheral>
|
||||
<name>RESUMEKICKER</name>
|
||||
<baseAddress>0xF0013000</baseAddress>
|
||||
<groupName>RESUMEKICKER</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
<name>KICKER</name>
|
||||
<addressOffset>0x0000</addressOffset>
|
||||
<resetValue>0x00</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
<name>kick</name>
|
||||
<msb>0</msb>
|
||||
<bitRange>[0:0]</bitRange>
|
||||
<lsb>0</lsb>
|
||||
<description><![CDATA[Write a `1` to trigger the SusRes software interrupt]]></description>
|
||||
</field>
|
||||
</fields>
|
||||
</register>
|
||||
<register>
|
||||
<name>STATE</name>
|
||||
<addressOffset>0x0004</addressOffset>
|
||||
<resetValue>0x00</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
<name>resume</name>
|
||||
<msb>0</msb>
|
||||
<bitRange>[0:0]</bitRange>
|
||||
<lsb>0</lsb>
|
||||
<description><![CDATA[A replica of the `resume` field in SusRes]]></description>
|
||||
</field>
|
||||
</fields>
|
||||
</register>
|
||||
</registers>
|
||||
<addressBlock>
|
||||
<offset>0</offset>
|
||||
<size>0x8</size>
|
||||
<usage>registers</usage>
|
||||
</addressBlock>
|
||||
</peripheral>
|
||||
<peripheral>
|
||||
<name>POWER</name>
|
||||
<baseAddress>0xF0014000</baseAddress>
|
||||
<baseAddress>0xF0013000</baseAddress>
|
||||
<groupName>POWER</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -2569,7 +2527,7 @@ reset fashion]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>SPINOR</name>
|
||||
<baseAddress>0xF0015000</baseAddress>
|
||||
<baseAddress>0xF0014000</baseAddress>
|
||||
<groupName>SPINOR</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -2850,7 +2808,7 @@ checked]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>KEYBOARD</name>
|
||||
<baseAddress>0xF0016000</baseAddress>
|
||||
<baseAddress>0xF0015000</baseAddress>
|
||||
<groupName>KEYBOARD</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3108,7 +3066,7 @@ again until the interrupt is serviced.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>KEYINJECT</name>
|
||||
<baseAddress>0xF0017000</baseAddress>
|
||||
<baseAddress>0xF0016000</baseAddress>
|
||||
<groupName>KEYINJECT</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3144,14 +3102,14 @@ inject too fast.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>SEED</name>
|
||||
<baseAddress>0xF0018000</baseAddress>
|
||||
<baseAddress>0xF0017000</baseAddress>
|
||||
<groupName>SEED</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
<name>SEED1</name>
|
||||
<description><![CDATA[Bits 32-63 of `SEED_SEED`. Seed used for the build]]></description>
|
||||
<addressOffset>0x0000</addressOffset>
|
||||
<resetValue>0x676324b6</resetValue>
|
||||
<resetValue>0x1cbd6891</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
|
|
@ -3166,7 +3124,7 @@ inject too fast.]]></description>
|
|||
<name>SEED0</name>
|
||||
<description><![CDATA[Bits 0-31 of `SEED_SEED`.]]></description>
|
||||
<addressOffset>0x0004</addressOffset>
|
||||
<resetValue>0x57ada412</resetValue>
|
||||
<resetValue>0x3d2e31ed</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
|
|
@ -3186,7 +3144,7 @@ inject too fast.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>KEYROM</name>
|
||||
<baseAddress>0xF0019000</baseAddress>
|
||||
<baseAddress>0xF0018000</baseAddress>
|
||||
<groupName>KEYROM</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3228,7 +3186,7 @@ inject too fast.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>AUDIO</name>
|
||||
<baseAddress>0xF001A000</baseAddress>
|
||||
<baseAddress>0xF0019000</baseAddress>
|
||||
<groupName>AUDIO</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3600,7 +3558,7 @@ I2S_FORMAT.I2S_STANDARD is I2S standard]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>TRNG_KERNEL</name>
|
||||
<baseAddress>0xF001B000</baseAddress>
|
||||
<baseAddress>0xF001A000</baseAddress>
|
||||
<groupName>TRNG_KERNEL</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3736,7 +3694,7 @@ I2S_FORMAT.I2S_STANDARD is I2S standard]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>TRNG_SERVER</name>
|
||||
<baseAddress>0xF001C000</baseAddress>
|
||||
<baseAddress>0xF001B000</baseAddress>
|
||||
<groupName>TRNG_SERVER</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -4068,7 +4026,7 @@ to max field size]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>TRNG</name>
|
||||
<baseAddress>0xF001D000</baseAddress>
|
||||
<baseAddress>0xF001C000</baseAddress>
|
||||
<groupName>TRNG</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -4381,7 +4339,7 @@ VCCBRAM (V) = ``Value`` x 3 / 4096.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>SHA512</name>
|
||||
<baseAddress>0xF001E000</baseAddress>
|
||||
<baseAddress>0xF001D000</baseAddress>
|
||||
<groupName>SHA512</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -4876,7 +4834,7 @@ in bits]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>ENGINE</name>
|
||||
<baseAddress>0xF001F000</baseAddress>
|
||||
<baseAddress>0xF001E000</baseAddress>
|
||||
<groupName>ENGINE</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5105,7 +5063,7 @@ exactly reflects the binary layout of an Engine instruction.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>JTAG</name>
|
||||
<baseAddress>0xF0020000</baseAddress>
|
||||
<baseAddress>0xF001F000</baseAddress>
|
||||
<groupName>JTAG</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5163,7 +5121,7 @@ exactly reflects the binary layout of an Engine instruction.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>WDT</name>
|
||||
<baseAddress>0xF0021000</baseAddress>
|
||||
<baseAddress>0xF0020000</baseAddress>
|
||||
<groupName>WDT</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5323,7 +5281,7 @@ register to disable individual events.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>D11CTIME</name>
|
||||
<baseAddress>0xF0022000</baseAddress>
|
||||
<baseAddress>0xF0021000</baseAddress>
|
||||
<groupName>D11CTIME</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5365,7 +5323,7 @@ register to disable individual events.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>IDENTIFIER_MEM</name>
|
||||
<baseAddress>0xF0023000</baseAddress>
|
||||
<baseAddress>0xF0022000</baseAddress>
|
||||
<groupName>IDENTIFIER_MEM</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5392,7 +5350,7 @@ register to disable individual events.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>TIMER0</name>
|
||||
<baseAddress>0xF0024000</baseAddress>
|
||||
<baseAddress>0xF0023000</baseAddress>
|
||||
<groupName>TIMER0</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -95,8 +95,6 @@ mod implementation {
|
|||
os_timer: utralib::CSR<u32>,
|
||||
/// memory region for the "clean suspend" marker
|
||||
marker: xous::MemoryRange,
|
||||
/// loader stack region -- this data is dirtied on every resume; claim it in this process so no others accidentally use it
|
||||
//loader_stack: xous::MemoryRange,
|
||||
/// backing store for the ticktimer value
|
||||
stored_time: Option<u64>,
|
||||
/// so we can access the build seed and detect if the FPGA image was changed on us
|
||||
|
|
@ -135,12 +133,6 @@ mod implementation {
|
|||
4096,
|
||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||
).expect("couldn't map clean suspend page");
|
||||
/*let loader_stack = xous::syscall::map_memory(
|
||||
xous::MemoryAddress::new(0x40FFF000), // this is a special, hard-coded location
|
||||
None,
|
||||
4096,
|
||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||
).expect("couldn't map clean suspend page");*/
|
||||
let seed_csr = xous::syscall::map_memory(
|
||||
xous::MemoryAddress::new(utra::seed::HW_SEED_BASE),
|
||||
None,
|
||||
|
|
@ -161,7 +153,6 @@ mod implementation {
|
|||
os_timer: CSR::new(ostimer_csr.as_mut_ptr() as *mut u32),
|
||||
stored_time: None,
|
||||
marker,
|
||||
//loader_stack,
|
||||
seed_csr: CSR::new(seed_csr.as_mut_ptr() as *mut u32),
|
||||
reboot_csr: CSR::new(reboot_csr.as_mut_ptr() as *mut u32),
|
||||
};
|
||||
|
|
@ -184,12 +175,6 @@ mod implementation {
|
|||
// note to self: don't use log:: here because we're upstream of logging being initialized
|
||||
assert!(unsafe{(*check_marker)[words]} == 0, "marker had non-zero entry!");
|
||||
}
|
||||
/*
|
||||
// clear the loader stack, mostly to get rid of unused code warnings
|
||||
let stack = loader_stack.as_ptr() as *mut [u32; 1024];
|
||||
for words in 0..1024 {
|
||||
unsafe{(*stack)[words] = 0;}
|
||||
}*/
|
||||
|
||||
xous::claim_interrupt(
|
||||
utra::susres::SUSRES_IRQ,
|
||||
|
|
@ -284,6 +269,7 @@ mod implementation {
|
|||
*/
|
||||
let seed0 = self.seed_csr.r(utra::seed::SEED0);
|
||||
let seed1 = self.seed_csr.r(utra::seed::SEED1);
|
||||
let pid = xous::process::id() as u32;
|
||||
let range = WORDS_PER_PAGE / RANGES;
|
||||
let mut index: usize = 0;
|
||||
for &e in entropy.iter() {
|
||||
|
|
@ -305,6 +291,7 @@ mod implementation {
|
|||
}
|
||||
unsafe{(*marker)[index + 1] = seed0};
|
||||
unsafe{(*marker)[index + 2] = seed1};
|
||||
unsafe{(*marker)[index + 3] = pid};
|
||||
}
|
||||
let mut hashbuf: [u32; WORDS_PER_PAGE / RANGES - 1] = [0; WORDS_PER_PAGE / RANGES - 1];
|
||||
for i in 0..hashbuf.len() {
|
||||
|
|
@ -316,13 +303,6 @@ mod implementation {
|
|||
index += range;
|
||||
}
|
||||
|
||||
|
||||
// clear the loader stack, for no particular reason other than to be vengeful.
|
||||
/*let stack = self.loader_stack.as_ptr() as *mut [u32; 1024];
|
||||
for words in 0..1024 {
|
||||
unsafe{(*stack)[words] = 0;}
|
||||
}*/
|
||||
|
||||
println!("Triggering suspend interrupt");
|
||||
// trigger an interrupt to process the final suspend bits
|
||||
self.csr.wfo(utra::susres::INTERRUPT_INTERRUPT, 1);
|
||||
|
|
@ -371,11 +351,6 @@ mod implementation {
|
|||
self.csr.wo(utra::susres::CONTROL, 0);
|
||||
println!("Ticktimer and OS timer now running");
|
||||
|
||||
// clear the loader stack, for no other reason other than to be vengeful
|
||||
/*let stack = self.loader_stack.as_ptr() as *mut [u32; 1024];
|
||||
for words in 0..1024 {
|
||||
unsafe{(*stack)[words] = 0;}
|
||||
}*/
|
||||
} else {
|
||||
panic!("Can't resume because the ticktimer value was not saved properly before suspend!")
|
||||
};
|
||||
|
|
|
|||
|
|
@ -493,7 +493,7 @@ fn xmain() -> ! {
|
|||
let mut sleep_heap: BinaryHeap<SleepRequest, U32, Min> = BinaryHeap::new();
|
||||
|
||||
log_server::init_wait().unwrap();
|
||||
log::set_max_level(log::LevelFilter::Trace);
|
||||
log::set_max_level(log::LevelFilter::Info);
|
||||
info!("my PID is {}", xous::process::id());
|
||||
|
||||
let ticktimer_server = xous::create_server_with_address(b"ticktimer-server")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<device schemaVersion="1.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="CMSIS-SVD.xsd" >
|
||||
<vendor>litex</vendor>
|
||||
<name>SOC</name>
|
||||
<description><![CDATA[Litex SoC 2021-04-29 02:33:22]]></description>
|
||||
<description><![CDATA[Litex SoC 2021-04-30 23:37:05]]></description>
|
||||
|
||||
<addressUnitBits>8</addressUnitBits>
|
||||
<width>32</width>
|
||||
|
|
@ -1070,10 +1070,10 @@ register to disable individual events.]]></description>
|
|||
<register>
|
||||
<name>GIT_GITREV</name>
|
||||
<description><![CDATA[First 32-bits of the git revision. This documentation was built from git rev
|
||||
``d738663a``, so this value is 3610797626, which should be enough to check out
|
||||
``79550678``, so this value is 2035615352, which should be enough to check out
|
||||
the exact git version used to build this firmware.]]></description>
|
||||
<addressOffset>0x0014</addressOffset>
|
||||
<resetValue>0xd738663a</resetValue>
|
||||
<resetValue>0x79550678</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
|
|
@ -1090,7 +1090,7 @@ the exact git version used to build this firmware.]]></description>
|
|||
is ``1``, then the repository this was built from has one additional commit
|
||||
beyond the tag indicated in `MAJOR`, `MINOR`, and `REVISION`.]]></description>
|
||||
<addressOffset>0x0018</addressOffset>
|
||||
<resetValue>0x02</resetValue>
|
||||
<resetValue>0x03</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
|
|
@ -2376,51 +2376,9 @@ register to disable individual events.]]></description>
|
|||
<value>9</value>
|
||||
</interrupt>
|
||||
</peripheral>
|
||||
<peripheral>
|
||||
<name>RESUMEKICKER</name>
|
||||
<baseAddress>0xF0013000</baseAddress>
|
||||
<groupName>RESUMEKICKER</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
<name>KICKER</name>
|
||||
<addressOffset>0x0000</addressOffset>
|
||||
<resetValue>0x00</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
<name>kick</name>
|
||||
<msb>0</msb>
|
||||
<bitRange>[0:0]</bitRange>
|
||||
<lsb>0</lsb>
|
||||
<description><![CDATA[Write a `1` to trigger the SusRes software interrupt]]></description>
|
||||
</field>
|
||||
</fields>
|
||||
</register>
|
||||
<register>
|
||||
<name>STATE</name>
|
||||
<addressOffset>0x0004</addressOffset>
|
||||
<resetValue>0x00</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
<name>resume</name>
|
||||
<msb>0</msb>
|
||||
<bitRange>[0:0]</bitRange>
|
||||
<lsb>0</lsb>
|
||||
<description><![CDATA[A replica of the `resume` field in SusRes]]></description>
|
||||
</field>
|
||||
</fields>
|
||||
</register>
|
||||
</registers>
|
||||
<addressBlock>
|
||||
<offset>0</offset>
|
||||
<size>0x8</size>
|
||||
<usage>registers</usage>
|
||||
</addressBlock>
|
||||
</peripheral>
|
||||
<peripheral>
|
||||
<name>POWER</name>
|
||||
<baseAddress>0xF0014000</baseAddress>
|
||||
<baseAddress>0xF0013000</baseAddress>
|
||||
<groupName>POWER</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -2569,7 +2527,7 @@ reset fashion]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>SPINOR</name>
|
||||
<baseAddress>0xF0015000</baseAddress>
|
||||
<baseAddress>0xF0014000</baseAddress>
|
||||
<groupName>SPINOR</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -2850,7 +2808,7 @@ checked]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>KEYBOARD</name>
|
||||
<baseAddress>0xF0016000</baseAddress>
|
||||
<baseAddress>0xF0015000</baseAddress>
|
||||
<groupName>KEYBOARD</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3108,7 +3066,7 @@ again until the interrupt is serviced.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>KEYINJECT</name>
|
||||
<baseAddress>0xF0017000</baseAddress>
|
||||
<baseAddress>0xF0016000</baseAddress>
|
||||
<groupName>KEYINJECT</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3144,14 +3102,14 @@ inject too fast.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>SEED</name>
|
||||
<baseAddress>0xF0018000</baseAddress>
|
||||
<baseAddress>0xF0017000</baseAddress>
|
||||
<groupName>SEED</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
<name>SEED1</name>
|
||||
<description><![CDATA[Bits 32-63 of `SEED_SEED`. Seed used for the build]]></description>
|
||||
<addressOffset>0x0000</addressOffset>
|
||||
<resetValue>0x676324b6</resetValue>
|
||||
<resetValue>0x1cbd6891</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
|
|
@ -3166,7 +3124,7 @@ inject too fast.]]></description>
|
|||
<name>SEED0</name>
|
||||
<description><![CDATA[Bits 0-31 of `SEED_SEED`.]]></description>
|
||||
<addressOffset>0x0004</addressOffset>
|
||||
<resetValue>0x57ada412</resetValue>
|
||||
<resetValue>0x3d2e31ed</resetValue>
|
||||
<size>32</size>
|
||||
<fields>
|
||||
<field>
|
||||
|
|
@ -3186,7 +3144,7 @@ inject too fast.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>KEYROM</name>
|
||||
<baseAddress>0xF0019000</baseAddress>
|
||||
<baseAddress>0xF0018000</baseAddress>
|
||||
<groupName>KEYROM</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3228,7 +3186,7 @@ inject too fast.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>AUDIO</name>
|
||||
<baseAddress>0xF001A000</baseAddress>
|
||||
<baseAddress>0xF0019000</baseAddress>
|
||||
<groupName>AUDIO</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3600,7 +3558,7 @@ I2S_FORMAT.I2S_STANDARD is I2S standard]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>TRNG_KERNEL</name>
|
||||
<baseAddress>0xF001B000</baseAddress>
|
||||
<baseAddress>0xF001A000</baseAddress>
|
||||
<groupName>TRNG_KERNEL</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -3736,7 +3694,7 @@ I2S_FORMAT.I2S_STANDARD is I2S standard]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>TRNG_SERVER</name>
|
||||
<baseAddress>0xF001C000</baseAddress>
|
||||
<baseAddress>0xF001B000</baseAddress>
|
||||
<groupName>TRNG_SERVER</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -4068,7 +4026,7 @@ to max field size]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>TRNG</name>
|
||||
<baseAddress>0xF001D000</baseAddress>
|
||||
<baseAddress>0xF001C000</baseAddress>
|
||||
<groupName>TRNG</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -4381,7 +4339,7 @@ VCCBRAM (V) = ``Value`` x 3 / 4096.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>SHA512</name>
|
||||
<baseAddress>0xF001E000</baseAddress>
|
||||
<baseAddress>0xF001D000</baseAddress>
|
||||
<groupName>SHA512</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -4876,7 +4834,7 @@ in bits]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>ENGINE</name>
|
||||
<baseAddress>0xF001F000</baseAddress>
|
||||
<baseAddress>0xF001E000</baseAddress>
|
||||
<groupName>ENGINE</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5105,7 +5063,7 @@ exactly reflects the binary layout of an Engine instruction.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>JTAG</name>
|
||||
<baseAddress>0xF0020000</baseAddress>
|
||||
<baseAddress>0xF001F000</baseAddress>
|
||||
<groupName>JTAG</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5163,7 +5121,7 @@ exactly reflects the binary layout of an Engine instruction.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>WDT</name>
|
||||
<baseAddress>0xF0021000</baseAddress>
|
||||
<baseAddress>0xF0020000</baseAddress>
|
||||
<groupName>WDT</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5323,7 +5281,7 @@ register to disable individual events.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>D11CTIME</name>
|
||||
<baseAddress>0xF0022000</baseAddress>
|
||||
<baseAddress>0xF0021000</baseAddress>
|
||||
<groupName>D11CTIME</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5365,7 +5323,7 @@ register to disable individual events.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>IDENTIFIER_MEM</name>
|
||||
<baseAddress>0xF0023000</baseAddress>
|
||||
<baseAddress>0xF0022000</baseAddress>
|
||||
<groupName>IDENTIFIER_MEM</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
@ -5392,7 +5350,7 @@ register to disable individual events.]]></description>
|
|||
</peripheral>
|
||||
<peripheral>
|
||||
<name>TIMER0</name>
|
||||
<baseAddress>0xF0024000</baseAddress>
|
||||
<baseAddress>0xF0023000</baseAddress>
|
||||
<groupName>TIMER0</groupName>
|
||||
<registers>
|
||||
<register>
|
||||
|
|
|
|||
Loading…
Reference in a new issue