forked from M-Labs/artiq
1
0
Fork 0

firmware: increase post-boot UART speed to 921600.

This commit is contained in:
whitequark 2017-01-16 16:12:28 +00:00
parent 13a544e13f
commit 971e4c3026
4 changed files with 13 additions and 3 deletions

View File

@ -11,6 +11,7 @@ include!(concat!(env!("BUILDINC_DIRECTORY"), "/generated/csr.rs"));
pub mod spr; pub mod spr;
pub mod irq; pub mod irq;
pub mod clock; pub mod clock;
pub mod uart;
#[cfg(has_i2c)] #[cfg(has_i2c)]
pub mod i2c; pub mod i2c;

View File

@ -0,0 +1,8 @@
use csr;
pub fn set_speed(rate: u32) {
unsafe {
let tuning_word = (rate as u64) * (1 << 32) / (csr::CONFIG_CLOCK_FREQUENCY as u64);
csr::uart_phy::tuning_word_write(tuning_word as u32);
}
}

View File

@ -103,6 +103,7 @@ pub unsafe extern fn rust_main() {
static mut LOG_BUFFER: [u8; 65536] = [0; 65536]; static mut LOG_BUFFER: [u8; 65536] = [0; 65536];
BufferLogger::new(&mut LOG_BUFFER[..]) BufferLogger::new(&mut LOG_BUFFER[..])
.register(move || { .register(move || {
board::uart::set_speed(921600);
board::clock::init(); board::clock::init();
info!("ARTIQ runtime starting..."); info!("ARTIQ runtime starting...");
info!("software version {}", GIT_COMMIT); info!("software version {}", GIT_COMMIT);

View File

@ -66,11 +66,11 @@ def main():
tmp = "artiq" + "".join([rng.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ") for _ in range(6)]) tmp = "artiq" + "".join([rng.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ") for _ in range(6)])
env = "bash -c 'export PATH=$HOME/miniconda/bin:$PATH; exec $0 $*' " env = "bash -c 'export PATH=$HOME/miniconda/bin:$PATH; exec $0 $*' "
def run_command(cmd): def run_command(cmd, **kws):
logger.info("Executing {}".format(cmd)) logger.info("Executing {}".format(cmd))
chan = get_ssh().get_transport().open_session() chan = get_ssh().get_transport().open_session()
chan.set_combine_stderr(True) chan.set_combine_stderr(True)
chan.exec_command(cmd.format(tmp=tmp, env=env, serial=args.serial, ip=args.ip)) chan.exec_command(cmd.format(tmp=tmp, env=env, serial=args.serial, ip=args.ip, **kws))
return chan.makefile() return chan.makefile()
def drain(chan): def drain(chan):
@ -151,7 +151,7 @@ def main():
logger.info("Connecting to device") logger.info("Connecting to device")
flterm = run_command( flterm = run_command(
"{env} python3 flterm.py {serial} --output-only") "{env} python3 flterm.py {serial} --speed 921600 --output-only")
drain(flterm) drain(flterm)
else: else: