Skip to content

Commit dc89d26

Browse files
committed
feat(rknpu): make rknpu to hole crates
1 parent 2a742c5 commit dc89d26

35 files changed

Lines changed: 19195 additions & 0 deletions

‎.cargo/config.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[target.'cfg(all(target_os = "none"))']
2+
# runner = "ostool cargo-test"
3+
runner = "cargo osrun"

‎.github/workflows/ci.yml‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Test CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
clippy:
7+
runs-on: ubuntu-22.04
8+
strategy:
9+
fail-fast: false
10+
env:
11+
RUSTUP_TOOLCHAIN: nightly
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: dtolnay/rust-toolchain@stable
15+
with:
16+
toolchain: nightly
17+
components: rust-src, clippy, rustfmt
18+
targets: aarch64-unknown-none-softfloat
19+
- uses: Swatinem/rust-cache@v2
20+
with:
21+
shared-key: cargo-bin-cache
22+
cache-targets: false
23+
- name: Check rust version
24+
run: rustc --version --verbose
25+
- name: Check code format
26+
run: cargo fmt --all -- --check
27+
- name: Clippy for the default target
28+
run: cargo clippy
29+
30+
Test:
31+
runs-on: ubuntu-22.04
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
rust-toolchain: [nightly]
36+
env:
37+
RUSTUP_TOOLCHAIN: ${{ matrix.rust-toolchain }}
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: dtolnay/rust-toolchain@stable
41+
with:
42+
toolchain: ${{ matrix.rust-toolchain }}
43+
components: rust-src, llvm-tools
44+
targets: aarch64-unknown-none-softfloat
45+
- uses: Swatinem/rust-cache@v2
46+
with:
47+
shared-key: cargo-bin-cache
48+
cache-targets: false
49+
- run: sudo apt update && sudo apt install -y libudev-dev
50+
- run: cargo install cargo-binutils
51+
- run: cargo install ostool@0.7.24
52+
- name: Build
53+
run: cargo build

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target
2+
Cargo.lock
3+
.bare-test.toml
4+
.spec-workflow

‎.vscode/launch.json‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
// 使用 IntelliSense 了解相关属性。
3+
// 悬停以查看现有属性的描述。
4+
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "cppdbg",
9+
"name": "Debug Test",
10+
"request": "launch",
11+
"miDebuggerServerAddress": "localhost:1234",
12+
"program": "${workspaceFolder}/target/kernel.elf",
13+
"miDebuggerPath": "gdb-multiarch",
14+
"cwd": "${workspaceRoot}",
15+
"preLaunchTask": "debug test"
16+
},
17+
]
18+
}

‎.vscode/settings.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"rust-analyzer.cargo.allTargets": false,
3+
"rust-analyzer.cargo.target": "aarch64-unknown-none-softfloat",
4+
}

‎.vscode/tasks.json‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "shell",
6+
"label": "debug test",
7+
"command": "cargo",
8+
"args": [
9+
"test",
10+
"--test",
11+
"test",
12+
"--",
13+
"--show-output",
14+
"--no-run",
15+
],
16+
"options": {
17+
"cwd": "${fileDirname}"
18+
},
19+
"problemMatcher": {
20+
"base": "$rustc",
21+
"background": {
22+
"activeOnStart": true,
23+
"beginsPattern": "^.*",
24+
"endsPattern": "^.*Running tests"
25+
}
26+
},
27+
"group": {
28+
"kind": "test",
29+
"isDefault": true
30+
},
31+
"detail": "断点调试 test 测试用例",
32+
"isBackground": true,
33+
}
34+
]
35+
}

‎Cargo.toml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
edition = "2024"
3+
name = "rknpu"
4+
version = "0.1.0"
5+
6+
[features]
7+
default = []
8+
starryos = []
9+
10+
[dependencies]
11+
aarch64-cpu-ext = "0.1"
12+
dma-api = {version = "0.5.2", features = ["alloc"]}
13+
log = "0.4"
14+
mbarrier = "0.1"
15+
num-align = "0.1"
16+
rdif-base = {version = "0.7"}
17+
spin = "0.10"
18+
thiserror = {version = "2.0", default-features = false}
19+
bitflags = "2"
20+
rknpu-regs = {path = "../rknpu-regs"}
21+

‎bare-test.toml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[qemu]
2+
machine = "virt"
3+
cpu = "cortex-a53"
4+
graphic = false
5+
args = ""

‎build.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fn main() {}

0 commit comments

Comments
 (0)