Skip to content

Commit

Permalink
runtime: work around mor1kx ignoring low bits of reset address.
Browse files Browse the repository at this point in the history
Fixes #599.
whitequark committed Oct 31, 2016
1 parent 617e345 commit 898a716
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion artiq/gateware/amp/kernel_cpu.py
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@

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)
2 changes: 1 addition & 1 deletion artiq/runtime.rs/src/kernel_proto.rs
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 2 additions & 2 deletions artiq/runtime.rs/src/rpc_queue.rs
Original file line number Diff line number Diff line change
@@ -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
}

2 changes: 1 addition & 1 deletion artiq/runtime/ksupport.ld
Original file line number Diff line number Diff line change
@@ -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. */

0 comments on commit 898a716

Please sign in to comment.