runtime: work around mor1kx ignoring low bits of reset address.

Fixes #599.
This commit is contained in:
whitequark 2016-10-31 18:13:15 +00:00
parent 617e345d16
commit 898a716b91
4 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@ from misoc.integration.soc_core import mem_decoder
class KernelCPU(Module):
def __init__(self, platform,
exec_address=0x40800080,
exec_address=0x40800000,
main_mem_origin=0x40000000,
l2_size=8192):
self._reset = CSRStorage(reset=1)

View File

@ -3,7 +3,7 @@
use core::marker::PhantomData;
use core::fmt;
pub const KERNELCPU_EXEC_ADDRESS: usize = 0x40800080;
pub const KERNELCPU_EXEC_ADDRESS: usize = 0x40800000;
pub const KERNELCPU_PAYLOAD_ADDRESS: usize = 0x40840000;
pub const KERNELCPU_LAST_ADDRESS: usize = 0x4fffffff;
pub const KSUPPORT_HEADER_SIZE: usize = 0x80;

View File

@ -8,7 +8,7 @@ const SEND_MAILBOX: *mut usize = (board::mem::MAILBOX_BASE + 4) as *mut usize;
const RECV_MAILBOX: *mut usize = (board::mem::MAILBOX_BASE + 8) as *mut usize;
const QUEUE_BEGIN: usize = 0x40400000;
const QUEUE_END: usize = 0x40800000;
const QUEUE_END: usize = 0x407fff80;
const QUEUE_CHUNK: usize = 0x1000;
pub unsafe fn init() {
@ -21,7 +21,7 @@ fn next(mut addr: usize) -> usize {
debug_assert!(addr >= QUEUE_BEGIN && addr < QUEUE_END);
addr += QUEUE_CHUNK;
if addr == QUEUE_END { addr = QUEUE_BEGIN }
if addr >= QUEUE_END { addr = QUEUE_BEGIN }
addr
}

View File

@ -13,7 +13,7 @@ INCLUDE generated/regions.ld
* are also loaded.
*/
MEMORY {
ksupport (RWX) : ORIGIN = 0x40800080, LENGTH = 0x40000
ksupport (RWX) : ORIGIN = 0x40800000, LENGTH = 0x40000
}
/* Kernel stack is at the end of main RAM. */