From 710abce418625ba373f62a001937ccf9e15abb2f Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 22 Nov 2020 03:45:44 +0800 Subject: [PATCH] fixup to latest soc.svd register documentation standard --- Cargo.lock | 92 +++++++++++++++++++++++--- buildpush.sh | 2 +- kernel/src/debug.rs | 4 +- services/graphics-server/src/debug.rs | 4 +- services/log-server/src/debug.rs | 4 +- services/shell/src/debug.rs | 4 +- services/shell/src/timer.rs | 4 +- services/ticktimer-server/src/debug.rs | 4 +- 8 files changed, 95 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e10482edd..bbe4eee10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,6 +39,18 @@ version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1fd36ffbb1fb7c834eac128ea8d0e310c5aeb635548f9d58861e1308d46e71c" +[[package]] +name = "as-slice" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb4d1c23475b74e3672afa8c2be22040b8b7783ad9b461021144ed10a46bb0e6" +dependencies = [ + "generic-array 0.12.3", + "generic-array 0.13.2", + "generic-array 0.14.4", + "stable_deref_trait", +] + [[package]] name = "atty" version = "0.2.14" @@ -214,15 +226,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" -[[package]] -name = "embedded-graphics" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40a69991ceb896bd4810a0cf2bcc46fc94b7860573c71f965d8e5b3d66942fed" -dependencies = [ - "byteorder", -] - [[package]] name = "env_logger" version = "0.7.1" @@ -251,6 +254,34 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ed1e761351b56f54eb9dcd0cfaca9fd0daecf93918e1cfc01c8a3d26ee7adcd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.1.14" @@ -279,6 +310,27 @@ dependencies = [ "xous", ] +[[package]] +name = "hash32" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4041af86e63ac4298ce40e5cca669066e75b6f1aa3390fe2561ffa5e1d9f4cc" +dependencies = [ + "byteorder", +] + +[[package]] +name = "heapless" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74911a68a1658cfcfb61bc0ccfbd536e3b6e906f8c2f7883ee50157e3e2184f1" +dependencies = [ + "as-slice", + "generic-array 0.13.2", + "hash32", + "stable_deref_trait", +] + [[package]] name = "hermit-abi" version = "0.1.15" @@ -819,6 +871,12 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "strsim" version = "0.8.0" @@ -890,7 +948,9 @@ dependencies = [ name = "ticktimer-server" version = "0.1.0" dependencies = [ - "embedded-graphics", + "heapless", + "log", + "log-server", "utralib", "xous", ] @@ -909,6 +969,12 @@ dependencies = [ "xmas-elf", ] +[[package]] +name = "typenum" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" + [[package]] name = "unicode-width" version = "0.1.8" @@ -934,6 +1000,12 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +[[package]] +name = "version_check" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" + [[package]] name = "void" version = "1.0.2" diff --git a/buildpush.sh b/buildpush.sh index a4438af06..18d144038 100755 --- a/buildpush.sh +++ b/buildpush.sh @@ -10,7 +10,7 @@ then exit 0 fi -DESTDIR=code/bin +DESTDIR=code/precursors # notes: # xous-stage1.bin written to 0x2050_0000 (64k erase block size) diff --git a/kernel/src/debug.rs b/kernel/src/debug.rs index effe0826e..10b44fb04 100644 --- a/kernel/src/debug.rs +++ b/kernel/src/debug.rs @@ -51,7 +51,7 @@ impl Uart { #[allow(dead_code)] pub fn enable_rx(self) { let mut uart_csr = CSR::new(self.base as *mut u32); - uart_csr.wfo(utra::uart::EV_ENABLE_ENABLE, uart_csr.rf(utra::uart::EV_ENABLE_ENABLE) | 2); + uart_csr.rmwf(utra::uart::EV_ENABLE_RX, 1); } pub fn putc(&self, c: u8) { @@ -68,7 +68,7 @@ impl Uart { let mut uart_csr = CSR::new(self.base as *mut u32); // If EV_PENDING_RX is 1, return the pending character. // Otherwise, return None. - match uart_csr.r(utra::uart::EV_PENDING) & 2 { + match uart_csr.rf(utra::uart::EV_PENDING_RX) { 0 => None, ack => { let c = Some(uart_csr.r(utra::uart::RXTX) as u8); diff --git a/services/graphics-server/src/debug.rs b/services/graphics-server/src/debug.rs index 4dbf34c86..65b20fb87 100644 --- a/services/graphics-server/src/debug.rs +++ b/services/graphics-server/src/debug.rs @@ -79,7 +79,7 @@ impl Uart { pub fn enable_rx(&self) { if cfg!(feature = "debugprint") { let mut uart_csr = CSR::new(unsafe{DEFAULT_UART_ADDR as *mut u32}); - uart_csr.wfo(utra::uart::EV_ENABLE_ENABLE, uart_csr.rf(utra::uart::EV_ENABLE_ENABLE) | 2 ); + uart_csr.rmwf(utra::uart::EV_ENABLE_RX, 1); } } @@ -89,7 +89,7 @@ impl Uart { self.map_uart(); } let mut uart_csr = CSR::new(unsafe{DEFAULT_UART_ADDR as *mut u32}); - match uart_csr.rf(utra::uart::EV_PENDING_PENDING) & 2 { + match uart_csr.rf(utra::uart::EV_PENDING_RX) { 0 => None, ack => { let c = Some(uart_csr.rf(utra::uart::RXTX_RXTX) as u8); diff --git a/services/log-server/src/debug.rs b/services/log-server/src/debug.rs index 1f678026a..6527495cb 100644 --- a/services/log-server/src/debug.rs +++ b/services/log-server/src/debug.rs @@ -76,7 +76,7 @@ impl Uart { pub fn enable_rx(&self) { let mut uart_csr = CSR::new(unsafe{DEFAULT_UART_ADDR as *mut u32}); - uart_csr.wfo(utra::uart::EV_ENABLE_ENABLE, uart_csr.rf(utra::uart::EV_ENABLE_ENABLE) | 2 ); + uart_csr.rmwf(utra::uart::EV_ENABLE_RX, 1 ); } pub fn getc(&self) -> Option { @@ -84,7 +84,7 @@ impl Uart { self.map_uart(); } let mut uart_csr = CSR::new(unsafe{DEFAULT_UART_ADDR as *mut u32}); - match uart_csr.rf(utra::uart::EV_PENDING_PENDING) & 2 { + match uart_csr.rf(utra::uart::EV_PENDING_RX) { 0 => None, ack => { let c = Some(uart_csr.rf(utra::uart::RXTX_RXTX) as u8); diff --git a/services/shell/src/debug.rs b/services/shell/src/debug.rs index 567e02c4c..122969211 100644 --- a/services/shell/src/debug.rs +++ b/services/shell/src/debug.rs @@ -79,7 +79,7 @@ impl Uart { pub fn enable_rx(&self) { if cfg!(feature = "debugprint") { let mut uart_csr = CSR::new(unsafe{DEFAULT_UART_ADDR as *mut u32}); - uart_csr.wfo(utra::uart::EV_ENABLE_ENABLE, uart_csr.rf(utra::uart::EV_ENABLE_ENABLE) | 2 ); + uart_csr.rmwf(utra::uart::EV_ENABLE_RX, 1 ); } } @@ -89,7 +89,7 @@ impl Uart { self.map_uart(); } let mut uart_csr = CSR::new(unsafe{DEFAULT_UART_ADDR as *mut u32}); - match uart_csr.rf(utra::uart::EV_PENDING_PENDING) & 2 { + match uart_csr.rf(utra::uart::EV_PENDING_RX) { 0 => None, ack => { let c = Some(uart_csr.rf(utra::uart::RXTX_RXTX) as u8); diff --git a/services/shell/src/timer.rs b/services/shell/src/timer.rs index 417387323..ff22221db 100644 --- a/services/shell/src/timer.rs +++ b/services/shell/src/timer.rs @@ -14,7 +14,7 @@ fn timer_tick(_irq_no: usize, _arg: *mut usize) { xous::rsyscall(xous::SysCall::ReturnToParent(xous::PID::new(1).unwrap(), 0)).expect("couldn't return to parent"); // acknowledge the timer - timer.wfo(utra::timer0::EV_PENDING_PENDING, 0b1); + timer.wfo(utra::timer0::EV_PENDING_ZERO, 0b1); //println!("<<< Returning from timer_tick()"); } @@ -45,7 +45,7 @@ pub fn init() { // Set EV_ENABLE let mut timer = CSR::new(TIMER_BASE as *mut u32); - timer.wfo(utra::timer0::EV_ENABLE_ENABLE, 0b1); + timer.wfo(utra::timer0::EV_ENABLE_ZERO, 0b1); } #[cfg(not(baremetal))] diff --git a/services/ticktimer-server/src/debug.rs b/services/ticktimer-server/src/debug.rs index 8c2c155d8..b1274560b 100644 --- a/services/ticktimer-server/src/debug.rs +++ b/services/ticktimer-server/src/debug.rs @@ -79,7 +79,7 @@ impl Uart { pub fn enable_rx(&self) { if cfg!(feature = "debugprint") { let mut uart_csr = CSR::new(unsafe{DEFAULT_UART_ADDR as *mut u32}); - uart_csr.wfo(utra::uart::EV_ENABLE_ENABLE, uart_csr.rf(utra::uart::EV_ENABLE_ENABLE) | 2 ); + uart_csr.rmwf(utra::uart::EV_ENABLE_RX, 1); } } @@ -89,7 +89,7 @@ impl Uart { self.map_uart(); } let mut uart_csr = CSR::new(unsafe{DEFAULT_UART_ADDR as *mut u32}); - match uart_csr.rf(utra::uart::EV_PENDING_PENDING) & 2 { + match uart_csr.rf(utra::uart::EV_PENDING_RX) { 0 => None, ack => { let c = Some(uart_csr.rf(utra::uart::RXTX_RXTX) as u8);