Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ embedded-io = "0.6.1"
fugit = "0.3.7"
proposed-traits = { git = "https://github.com/rusty1968/proposed_traits.git", package = "proposed-traits", rev = "85641310df5a5276c67f81621b104322cff0286c" }
hex-literal = "0.4"
paste = "1.0"

cortex-m = { version = "0.7.5" }
cortex-m-rt = { version = "0.6.5", features = ["device"] }
Expand Down
27 changes: 3 additions & 24 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#![no_std]
#![no_main]

use aspeed_ddk::gpio::{gpiol, GpioExt};
use core::sync::atomic::AtomicBool;
// use core::arch::asm;
use aspeed_ddk::uart::{Config, UartController};
Expand All @@ -16,10 +15,10 @@ use aspeed_ddk::hace_controller::HaceController;
use aspeed_ddk::rsa::AspeedRsa;
use aspeed_ddk::spi;
use aspeed_ddk::syscon::{ClockId, ResetId, SysCon};
use embedded_hal::digital::OutputPin;
use fugit::MillisDurationU32 as MilliSeconds;

use aspeed_ddk::tests::functional::ecdsa_test::run_ecdsa_tests;
use aspeed_ddk::tests::functional::gpio_test;
use aspeed_ddk::tests::functional::hash_test::run_hash_tests;
use aspeed_ddk::tests::functional::hmac_test::run_hmac_tests;
use aspeed_ddk::tests::functional::rsa_test::run_rsa_tests;
Expand Down Expand Up @@ -97,26 +96,6 @@ fn test_wdt(uart: &mut UartController<'_>) {
}
}

fn test_gpio_flash_power(uart: &mut UartController<'_>) {
let mut delay = DummyDelay {};
if true {
/* Older demo board required this */
let peripherals = unsafe { Peripherals::steal() };
let gpio = peripherals.gpio;
let gpiol = gpiol::GPIOL::new(gpio).split();
uart.write_all(b"\r\n####### GPIO test #######\r\n")
.unwrap();

let mut pl2 = gpiol.pl2.into_push_pull_output();
pl2.set_high().unwrap();
uart.write_all(b"\r\nGPIOL2 set high\r\n").unwrap();
let mut pl3 = gpiol.pl3.into_push_pull_output();
pl3.set_high().unwrap();
uart.write_all(b"\r\nGPIOL3 set high\r\n").unwrap();
delay.delay_ns(1_000_000);
}
}

#[no_mangle]
pub static HALT: AtomicBool = AtomicBool::new(true);

Expand Down Expand Up @@ -184,15 +163,15 @@ fn main() -> ! {

let mut rsa = AspeedRsa::new(&secure, delay);
run_rsa_tests(&mut uart_controller, &mut rsa);

gpio_test::test_gpioa(&mut uart_controller);
test_wdt(&mut uart_controller);

let test_spicontroller = false;
if test_spicontroller {
spi::spitest::test_fmc(&mut uart_controller);
spi::spitest::test_spi(&mut uart_controller);

test_gpio_flash_power(&mut uart_controller);
gpio_test::test_gpio_flash_power(&mut uart_controller);
spi::spitest::test_spi2(&mut uart_controller);
}
// Initialize the peripherals here if needed
Expand Down
Loading