Skip to content
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4ce08e7
Initial support of ast1060
LeeTroy Jul 30, 2025
d7466d2
Update per comment
LeeTroy Jul 31, 2025
bab4c30
Merge pull request #1 from LeeTroy/ast1060-initial
LeeTroy Jul 31, 2025
bc4a1ed
Add scaffold for mctp server, api and idol ipc definition
embediver Aug 12, 2025
e32ff1e
Create MCTP IPC API idol definition
embediver Aug 13, 2025
316fc83
Add missing build.rs for mctp-api
embediver Aug 14, 2025
ca3f41b
Implement mctp client api
embediver Aug 14, 2025
5bd5dfa
Add rustdoc for mctp-rs and ipc api
embediver Aug 14, 2025
ec8ee09
Basic MCTP echo example task
embediver Aug 14, 2025
3d635b9
Add mctp-server ipc stub, rename and clarify stuff in mctp-api
embediver Aug 19, 2025
27f7a30
Merge remote-tracking branch 'aspeed/aspeed-devel' into mctp
embediver Aug 21, 2025
e6317eb
Add ast1060 mctp echo example app
embediver Aug 21, 2025
33e07b9
Merge remote-tracking branch 'origin/master' into mctp
embediver Aug 21, 2025
e852a8e
Add mctp server stub, add mctp and mctp-estack deps
embediver Aug 21, 2025
4b89326
Implement mctp server ipc handling for pipelined server architecture
embediver Aug 28, 2025
2fc8b72
Implement simple mctp ipc calls in mctp-server
embediver Sep 17, 2025
3fe7894
MCTP IPC Implementation (#2)
embediver Sep 25, 2025
ab8e7d7
Mcpt uart driver (#3)
embediver Sep 25, 2025
2839cd4
Fix bug in serial transport handler, fix warnings
embediver Sep 30, 2025
7eddb38
Relax response lifetime requirements, free resources when dropping re…
embediver Sep 30, 2025
29277e9
Re-enable uart irq after interrupt, use uart in app.toml
embediver Oct 1, 2025
edf8677
Fix bug in uart lib write function, flush after sending mctp packets
embediver Oct 1, 2025
3c1b171
Fix remaining bugs to get a working POC and cleanup
embediver Oct 2, 2025
7c348b6
Change mctp-rs dependency to OpenPRoT fork
embediver Oct 2, 2025
ad0e516
Add documentation and test script for mctp
embediver Oct 6, 2025
f00c6e5
Improve instructions for mctp echo example
embediver Oct 9, 2025
ab4de6d
refactor: fix `cargo fmt` errors
mynetz Oct 29, 2025
29a4f00
refactor: add missing MPL 2.0 license headers to source files
mynetz Oct 29, 2025
6b925f8
Fix clippy lints
embediver Oct 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
868 changes: 562 additions & 306 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ path = "lib/counters"
anyhow = { version = "1.0.31", default-features = false, features = ["std"] }
array-init = { version = "2.1.0" }
arrayvec = { version = "0.7.4", default-features = false }
aspeed-ddk = { git = "https://github.com/aspeedtech-bmc/aspeed-rust.git" }
ast1060-pac = { git = "https://github.com/aspeedtech-bmc/ast1060-pac.git" }
atty = { version = "0.2", default-features = false }
bitfield = { version = "0.13", default-features = false }
bitflags = { version = "2.5.0", default-features = false }
Expand Down Expand Up @@ -162,6 +164,7 @@ tlvc = { git = "https://github.com/oxidecomputer/tlvc", default-features = false
tlvc-text = { git = "https://github.com/oxidecomputer/tlvc", default-features = false, version = "0.3.0" }
transceiver-messages = { git = "https://github.com/oxidecomputer/transceiver-control/", default-features = false }
vsc7448-pac = { git = "https://github.com/oxidecomputer/vsc7448", default-features = false }
mctp = { git = "https://github.com/9elements/mctp-rs.git", branch = "main", default-features = false }

[workspace.lints.rust]
elided_lifetimes_in_paths = "warn"
Expand Down
25 changes: 25 additions & 0 deletions app/ast1060-mctp-echo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
edition = "2021"
readme = "README.md"
name = "ast1060-mctp-echo"
version = "0.1.0"

[features]
#dump = ["kern/dump"]
jtag-halt = []

[dependencies]
ast1060-pac = { workspace = true, features = ["rt"] }
cortex-m = { workspace = true }
cortex-m-rt = { workspace = true }
kern = { path = "../../sys/kern" }

# this lets you use `cargo fix`!
[[bin]]
name = "ast1060-mctp-echo"
test = false
doctest = false
bench = false

[lints]
workspace = true
1 change: 1 addition & 0 deletions app/ast1060-mctp-echo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# AST1060 mctp over serial echo example
43 changes: 43 additions & 0 deletions app/ast1060-mctp-echo/app.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name = "ast1060-mctp-echo"
target = "thumbv7em-none-eabihf"
board = "ast1060-rot"
chip = "../../chips/ast1060"
stacksize = 1024

[kernel]
name = "ast1060-starter"
requires = {flash = 20000, ram = 3072}

[tasks.jefe]
name = "task-jefe"
priority = 0
max-sizes = {flash = 8192, ram = 4096}
start = true
stacksize = 1536
notifications = ["fault", "timer"]

[tasks.idle]
name = "task-idle"
priority = 5
max-sizes = {flash = 128, ram = 256}
stacksize = 256
start = true

[tasks.mctp_echo]
name = "mctp-echo"
priority = 2
max-sizes = {flash = 8192, ram = 4096}
start = true
stacksize = 2048
task-slots = ["mctp_server"]

# app/ast1060-starter/app.toml
[tasks.mctp_server]
name = "mctp-server"
priority = 1
max-sizes = {flash = 32768, ram = 16384}
start = true
stacksize = 12288
notifications = ["uart-irq", "timer"]
interrupts = {"uart.irq" = "uart-irq"}

62 changes: 62 additions & 0 deletions app/ast1060-mctp-echo/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#![no_std]
#![no_main]

// We have to do this if we don't otherwise use it to ensure its vector table
// gets linked in.

use cortex_m_rt::entry;
use ast1060_pac::Peripherals;

#[cfg(feature = "jtag-halt")]
use core::ptr::{self, addr_of};

#[entry]
fn main() -> ! {

// This code just forces the ast1060 pac to be linked in.
let peripherals = unsafe {
Peripherals::steal()
};
peripherals.scu.scu000().modify(|_, w| {
w
});
peripherals.scu.scu41c().modify(|_, w| {
// Set the JTAG pinmux to 0x1f << 25
w.enbl_armtmsfn_pin().bit(true)
.enbl_armtckfn_pin().bit(true)
.enbl_armtrstfn_pin().bit(true)
.enbl_armtdifn_pin().bit(true)
.enbl_armtdofn_pin().bit(true)
});

#[cfg(feature = "jtag-halt")]
jtag_halt();

// Default boot speed, until we bother raising it:
const CYCLES_PER_MS: u32 = 16_000;

unsafe { kern::startup::start_kernel(CYCLES_PER_MS) }
}

#[cfg(feature = "jtag-halt")]
fn jtag_halt() {
static mut HALT : u32 = 1;

// This is a hack to halt the CPU in JTAG mode.
// It writes a value to a volatile memory location
// Break by jtag and set val to zero to continue.
loop {
let val;
unsafe {
val = ptr::read_volatile(addr_of!(HALT));
}

if val == 0 {
break;
}
}
}
25 changes: 25 additions & 0 deletions app/ast1060-starter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
edition = "2021"
readme = "README.md"
name = "ast1060-starter"
version = "0.1.0"

[features]
#dump = ["kern/dump"]
jtag-halt = []

[dependencies]
ast1060-pac = { workspace = true, features = ["rt"] }
cortex-m = { workspace = true }
cortex-m-rt = { workspace = true }
kern = { path = "../../sys/kern" }

# this lets you use `cargo fix`!
[[bin]]
name = "ast1060-starter"
test = false
doctest = false
bench = false

[lints]
workspace = true
1 change: 1 addition & 0 deletions app/ast1060-starter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# AST1060 minimum application
24 changes: 24 additions & 0 deletions app/ast1060-starter/app.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name = "ast1060-starter"
target = "thumbv7em-none-eabihf"
board = "ast1060-rot"
chip = "../../chips/ast1060"
stacksize = 1024

[kernel]
name = "ast1060-starter"
requires = {flash = 20000, ram = 3072}

[tasks.jefe]
name = "task-jefe"
priority = 0
max-sizes = {flash = 8192, ram = 4096}
start = true
stacksize = 1536
notifications = ["fault", "timer"]

[tasks.idle]
name = "task-idle"
priority = 5
max-sizes = {flash = 128, ram = 256}
stacksize = 256
start = true
62 changes: 62 additions & 0 deletions app/ast1060-starter/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#![no_std]
#![no_main]

// We have to do this if we don't otherwise use it to ensure its vector table
// gets linked in.

use cortex_m_rt::entry;
use ast1060_pac::Peripherals;

#[cfg(feature = "jtag-halt")]
use core::ptr::{self, addr_of};

#[entry]
fn main() -> ! {

// This code just forces the ast1060 pac to be linked in.
let peripherals = unsafe {
Peripherals::steal()
};
peripherals.scu.scu000().modify(|_, w| {
w
});
peripherals.scu.scu41c().modify(|_, w| {
// Set the JTAG pinmux to 0x1f << 25
w.enbl_armtmsfn_pin().bit(true)
.enbl_armtckfn_pin().bit(true)
.enbl_armtrstfn_pin().bit(true)
.enbl_armtdifn_pin().bit(true)
.enbl_armtdofn_pin().bit(true)
});

#[cfg(feature = "jtag-halt")]
jtag_halt();

// Default boot speed, until we bother raising it:
const CYCLES_PER_MS: u32 = 16_000;

unsafe { kern::startup::start_kernel(CYCLES_PER_MS) }
}

#[cfg(feature = "jtag-halt")]
fn jtag_halt() {
static mut HALT : u32 = 1;

// This is a hack to halt the CPU in JTAG mode.
// It writes a value to a volatile memory location
// Break by jtag and set val to zero to continue.
loop {
let val;
unsafe {
val = ptr::read_volatile(addr_of!(HALT));
}

if val == 0 {
break;
}
}
}
4 changes: 4 additions & 0 deletions boards/ast1060-rot.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# AST1060 RoT board configuration
[probe-rs]
chip-name = "AST1060"

10 changes: 10 additions & 0 deletions chips/ast1060/chip.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# AST1060 SoC peripheral definitions

[hace_controller]
address = 0x7e6d0000
size = 0x400

[uart]
address = 0x7e784000
size = 0x1000
interrupts = { irq = 8 }
21 changes: 21 additions & 0 deletions chips/ast1060/memory.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[[flash]]
address = 0x00000000
size = 65536
read = true
write = true
execute = true

[[ram]]
address = 0x20000
size = 65536
read = true
write = true
execute = true

[[sboot_hdr]]
address = 0x400
size = 32
read = true
write = false
execute = false

12 changes: 12 additions & 0 deletions chips/ast1060/openocd.gdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
target extended-remote :3341

# print demangled symbols
set print asm-demangle on

# set backtrace limit to not have infinite backtrace loops
set backtrace limit 32

# detect hard faults
break HardFault

monitor arm semihosting enable
3 changes: 2 additions & 1 deletion drv/lpc55-usart/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ edition = "2021"

[dependencies]
lpc55-pac = { workspace = true }
nb = { workspace = true }
# nb = { workspace = true }
nb = "1.1.0"
zerocopy = { workspace = true }
zerocopy-derive = { workspace = true }

Expand Down
Loading