Skip to content

Commit

Permalink
hal: rearrange code, move src into path allwinner-hal
Browse files Browse the repository at this point in the history
Signed-off-by: Zhouqi Jiang <[email protected]>
  • Loading branch information
luojia65 committed Oct 31, 2024
1 parent 8ecc242 commit 5b983d4
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 67 deletions.
36 changes: 2 additions & 34 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,7 @@
[package]
name = "allwinner-hal"
version = "0.0.0"
edition = "2021"
description = "Allwinner SoC driver support"
authors = [
"Luo Jia <[email protected]>",
"Gao Chengbo <[email protected]>",
]
repository = "https://github.com/rustsbi/allwinner-hal"
documentation = "https://docs.rs/allwinner-hal"
license = "MulanPSL-2.0 OR MIT"
readme = "README.md"
keywords = ["hal", "allwinner"]
categories = ["os", "embedded", "hardware-support", "no-std"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
volatile-register = "0.2.1"
embedded-hal = "1.0.0"
embedded-io = "0.6.1"
embedded-time = "0.12.1"
uart16550 = "0.0.1"
plic = "0.0.2"

[dev-dependencies]
memoffset = "0.8"

[features]
default = ["d1"]
# D1-like chips: D1-H, D1s, F133.
d1 = []

[workspace]
resolver = "2"
members = [
"allwinner-hal",
"allwinner-rt",
"allwinner-rt/macros",
"examples/nezha-d1",
Expand Down
34 changes: 6 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,15 @@
# allwinner-hal

[![crates.io](https://img.shields.io/crates/v/allwinner-hal.svg)](https://crates.io/crates/allwinner-hal)
[![Documentation](https://docs.rs/allwinner-hal/badge.svg)](https://docs.rs/allwinner-hal)
![License](https://img.shields.io/crates/l/allwinner-hal.svg)
Allwinner-HAL仓库包含以下的项目.

全志芯片组件化外设驱动;外设包括DDR控制器。

## 支持列表

组件化外设驱动可根据外设基地址提供驱动支持,这要求外设的设计(寄存器定义和功能等)相同;
大多数情况下,外设IP核相同就能满足以上条件。

按此要求,虽然全志系列芯片大部分外设IP核都是共享的,但本项目只测试了一部分芯片的兼容性。
经过测试能够运行本项目的芯片如下。

| 系列* | CCU | GPIO | SPI | UART |
|:-----|:----|:----|:----|:----|
| D1系列 |||||

✓:可运行,功能完整
○:可运行,详细功能仍需完善
×:暂未支持

*全志芯片中有一部分型号的外设基地址布局相同,即使其中的处理器核可能不相同。
本项目称这些芯片为一个系列,并以系列中首个发布的芯片型号命名。

理论上兼容,但尚未经过测试的芯片型号如下:

- D1系列:D1s, F133, V853, R128
| 项目 | crates.io | 文档 | 许可协议 |
|:----|:-----------|:------|:--------|
| [`allwinner-hal`](./allwinner-hal/) | [![crates.io](https://img.shields.io/crates/v/allwinner-hal.svg)](https://crates.io/crates/allwinner-hal) | [![Documentation](https://docs.rs/allwinner-hal/badge.svg)](https://docs.rs/allwinner-hal) | ![License](https://img.shields.io/crates/l/allwinner-hal.svg) |
| [`allwinner-rt`](./allwinner-rt/) | [![crates.io](https://img.shields.io/crates/v/allwinner-rt.svg)](https://crates.io/crates/allwinner-rt) | [![Documentation](https://docs.rs/allwinner-rt/badge.svg)](https://docs.rs/allwinner-rt) | ![License](https://img.shields.io/crates/l/allwinner-rt.svg) |

## 许可协议

本项目使用MIT和Mulan-PSL v2.0双许可协议。
本仓库的所有项目使用MIT和Mulan-PSL v2.0双许可协议。

## 参考资料

Expand Down
File renamed without changes.
33 changes: 33 additions & 0 deletions allwinner-hal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "allwinner-hal"
version = "0.0.0"
edition = "2021"
description = "Allwinner SoC driver support"
authors = [
"Luo Jia <[email protected]>",
"Gao Chengbo <[email protected]>",
]
repository = "https://github.com/rustsbi/allwinner-hal"
documentation = "https://docs.rs/allwinner-hal"
license = "MulanPSL-2.0 OR MIT"
readme = "README.md"
keywords = ["hal", "allwinner"]
categories = ["os", "embedded", "hardware-support", "no-std"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
volatile-register = "0.2.1"
embedded-hal = "1.0.0"
embedded-io = "0.6.1"
embedded-time = "0.12.1"
uart16550 = "0.0.1"
plic = "0.0.2"

[dev-dependencies]
memoffset = "0.8"

[features]
default = ["d1"]
# D1-like chips: D1-H, D1s, F133.
d1 = []
41 changes: 41 additions & 0 deletions allwinner-hal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# allwinner-hal

[![crates.io](https://img.shields.io/crates/v/allwinner-hal.svg)](https://crates.io/crates/allwinner-hal)
[![Documentation](https://docs.rs/allwinner-hal/badge.svg)](https://docs.rs/allwinner-hal)
![License](https://img.shields.io/crates/l/allwinner-hal.svg)

全志芯片组件化外设驱动;外设包括DDR控制器。

## 支持列表

组件化外设驱动可根据外设基地址提供驱动支持,这要求外设的设计(寄存器定义和功能等)相同;
大多数情况下,外设IP核相同就能满足以上条件。

按此要求,虽然全志系列芯片大部分外设IP核都是共享的,但本项目只测试了一部分芯片的兼容性。
经过测试能够运行本项目的芯片如下。

| 系列* | CCU | GPIO | SPI | UART |
|:-----|:----|:----|:----|:----|
| D1系列 |||||

✓:可运行,功能完整
○:可运行,详细功能仍需完善
×:暂未支持

*全志芯片中有一部分型号的外设基地址布局相同,即使其中的处理器核可能不相同。
本项目称这些芯片为一个系列,并以系列中首个发布的芯片型号命名。

理论上兼容,但尚未经过测试的芯片型号如下:

- D1系列:D1s, F133, V853, R128

## 许可协议

本项目使用MIT和Mulan-PSL v2.0双许可协议。

## 参考资料

以下资料提供了全志芯片驱动的参考设计或社区设计,供贡献者参考。

- RT-Thread驱动:https://gitee.com/rtthread/rt-thread/tree/master/bsp/allwinner/libraries/sunxi-hal/hal/source
- TinyKasKit项目:https://github.com/YuzukiHD/TinyKasKit
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions allwinner-rt/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion allwinner-rt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ categories = ["embedded", "hardware-support", "no-std"]

[dependencies]
allwinner-rt-macros = { version = "0.0.0", path = "macros" }
allwinner-hal = { version = "0.0.0", features = ["d1"], path = ".." }
allwinner-hal = { version = "0.0.0", features = ["d1"], path = "../allwinner-hal" }
embedded-hal = "1.0.0"
embedded-time = "0.12.1"
nb = "1.1.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/nezha-d1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
publish = false

[dependencies]
allwinner-hal = { path = "../.." }
allwinner-hal = { path = "../../allwinner-hal" }
allwinner-rt = { path = "../../allwinner-rt" }
panic-halt = "0.2.0"
embedded-io = "0.6.1"
2 changes: 1 addition & 1 deletion examples/sdmmc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
publish = false

[dependencies]
allwinner-hal = { path = "../.." }
allwinner-hal = { path = "../../allwinner-hal" }
allwinner-rt = { path = "../../allwinner-rt" }
panic-halt = "0.2.0"
embedded-io = "0.6.1"
Expand Down

0 comments on commit 5b983d4

Please sign in to comment.