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

Conversation

Placebo27
Copy link
Contributor

@Placebo27 Placebo27 commented Sep 24, 2024

Work description

  1. Refactor directory, change directory structure src/main.rs to src/bin/hello-world.rs and src/bin/led-lightup.rs.

    Before:  100ask-d1-h-rs                     After:  100ask-d1-h-rs 
              └── src                                    ├── macros
                  └── main.rs                            └── src
                                                             └── bin
                                                                 └── hello-world.rs
                                                                 └── init-dram.rs
                                                                 └── led-lightup.rs
    
  2. Initialize the memory controller and print out the size of the DRAM. Refer to https://github.com/oreboot/oreboot/blob/main/src/mainboard/sunxi/nezha/bt0/src/mctl.rs, which compliances with the open source license GPL-2.0 license.

  3. Add field bin to specify the name of the binary file in the xtask command. We can now use xtask by command cargo flash hello-world nor --release, cargo flash init-dram nor --release and cargo flash led-lightup nor --release.

Test results

  1. cargo flash hello-world nor --release and cargo flash init-dram nor --release :

SecureCRT_ugEoJprUIJ

  1. cargo flash led-lightup nor --release:
lightup.led.mp4

Placebo27 and others added 3 commits September 24, 2024 21:18
Minor fixes to xtask module.

Signed-off-by: DongQing <placebo27@hust.edu.cn>
Co-authored-by: Zhouqi Jiang <luojia@hust.edu.cn>
Signed-off-by: DongQing <placebo27@hust.edu.cn>
Signed-off-by: DongQing <placebo27@hust.edu.cn>
@luojia65
Copy link
Collaborator

luojia65 commented Sep 24, 2024

I can repreduce test results. Code format is nice and clean, it introduces simple test cases files (rewritten hello-world, dram-init into Rust, introduced new test case led-lightup). The test cases can be as simple as:

#![no_std]
#![no_main]

use panic_halt as _;
use syterkit_100ask_d1_h::{entry, println, Clocks, Peripherals};

#[entry]
fn main(p: Peripherals, c: Clocks) {
    println!("Hello World!");
}

Link: https://github.com/YuzukiHD/SyterKit/blob/ef24c9fe1e63f0c3a06b4832f7dd0bc6b390e571/board/100ask-d1-h-rs/src/bin/hello-world.rs

(In the future, we can do: use syterkit::{entry, println, Clocks, Peripherals}; after further code reformations)

In conclusion, this PR LGTM. In the future we can rewrite SyterBoot example into Rust as well.

@luojia65 luojia65 merged commit 8baa3e5 into YuzukiHD:main Sep 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants