Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[board] refactor directory, add init-dram case macro module for 100ask-d1-h-rs #130

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Next Next commit
[board] refactor directory, add init-dram case on 100ask-d1-h
Minor fixes to xtask module.

Signed-off-by: DongQing <placebo27@hust.edu.cn>
  • Loading branch information
Placebo27 committed Sep 24, 2024
commit c6cba7e68ece1e8d812badc7edd08113a3ca3ba6
21 changes: 12 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions board/100ask-d1-h-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ allwinner-rt = { git = "https://github.com/rustsbi/allwinner-hal" }
embedded-hal = "1.0.0"
embedded-io = "0.6.1"

[[bin]]
name = "syterkit-100ask-d1-h"
[lib]
name = "syterkit_100ask_d1_h"
test = false
bench = false

[features]
default = ["nezha"]
nezha = []
lichee = []
2 changes: 1 addition & 1 deletion board/100ask-d1-h-rs/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fn main() {
println!("cargo:rustc-link-arg=-Tallwinner-rt.ld");
}
}
18 changes: 18 additions & 0 deletions board/100ask-d1-h-rs/src/bin/init-dram.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#![no_std]
#![no_main]
use allwinner_hal::uart::{Config, Serial};
use allwinner_rt::{entry, Clocks, Peripherals};
use embedded_io::Write;
use panic_halt as _;
use syterkit_100ask_d1_h::mctl;

#[entry]
fn main(p: Peripherals, c: Clocks) {
let tx = p.gpio.pb8.into_function::<6>();
let rx = p.gpio.pb9.into_function::<6>();
let mut serial = Serial::new(p.uart0, (tx, rx), Config::default(), &c, &p.ccu);

writeln!(serial, "DDR init").unwrap();
let ram_size = mctl::init();
writeln!(serial, "{}M 🐏", ram_size).unwrap();
}
3 changes: 3 additions & 0 deletions board/100ask-d1-h-rs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#![no_std]

pub mod mctl;
Loading