mirror of
https://gitee.com/bianbu-linux/openwrt-docs
synced 2025-06-28 17:42:57 -04:00
update openwrt development docs
This commit is contained in:
parent
b2b4247964
commit
149943db90
11 changed files with 287 additions and 210 deletions
12
README.md
12
README.md
|
@ -5,7 +5,7 @@ sidebar_position: 1
|
||||||
|
|
||||||
# 简介
|
# 简介
|
||||||
|
|
||||||
基于原生OpenWrt 23.05集成Spacemit Stone 系列芯片的 BSP,包含监管程序接口(OpenSBI)、引导加载程序(U-Boot/UEFI)、Linux 内核、根文件系统(包含各种中间件和库)以及示例等。其目标是为客户提供软路由和NAS方案支持,并且可以开发驱动或应用。
|
基于原生OpenWrt 23.05(*bl-v2.0.y分支基于master*)集成Spacemit Stone 系列芯片的 BSP,包含监管程序接口(OpenSBI)、引导加载程序(U-Boot/UEFI)、Linux 内核、根文件系统(包含各种中间件和库)以及示例等。其目标是为客户提供软路由和NAS方案支持,并且可以开发驱动或应用。
|
||||||
|
|
||||||
## 主要组件
|
## 主要组件
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ sidebar_position: 1
|
||||||
- U-Boot
|
- U-Boot
|
||||||
- Linux Kernel
|
- Linux Kernel
|
||||||
- mpp: Media Process Platform
|
- mpp: Media Process Platform
|
||||||
|
- FFmpeg (with Hardware Accelerated)
|
||||||
|
|
||||||
更多组件正在适配中
|
更多组件正在适配中
|
||||||
|
|
||||||
|
@ -23,7 +24,6 @@ sidebar_position: 1
|
||||||
- k1x-vpu-firmware: Video Process Unit firmware
|
- k1x-vpu-firmware: Video Process Unit firmware
|
||||||
- k1x-vpu-test: Video Process Unit test program
|
- k1x-vpu-test: Video Process Unit test program
|
||||||
- k1x-jpu: JPEG Process Unit API
|
- k1x-jpu: JPEG Process Unit API
|
||||||
- FFmpeg (with Hardware Accelerated)
|
|
||||||
- GStreamer (with Hardware Accelerated)
|
- GStreamer (with Hardware Accelerated)
|
||||||
|
|
||||||
## 快速指南
|
## 快速指南
|
||||||
|
@ -34,23 +34,25 @@ sidebar_position: 1
|
||||||
|
|
||||||
## 进阶指南
|
## 进阶指南
|
||||||
|
|
||||||
[系统开发指南](https://bianbu-linux.spacemit.com/category/%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97)
|
[系统开发指南](https://bianbu-linux.spacemit.com/development_guide)
|
||||||
|
|
||||||
## 预编译
|
## 预编译
|
||||||
|
|
||||||
[进迭OpenWrt源站点](https://archive.spacemit.com/openwrt/releases/23.05.2/)
|
[进迭OpenWrt源站点](https://archive.spacemit.com/openwrt/releases/[branch])
|
||||||
|
|
||||||
[BPI-F3、MUSE-Pi固件](https://archive.spacemit.com/openwrt/releases/23.05.2/targets/spacemit/DEVICE_debX/openwrt-spacemit-k1-sbc-debX-ext4-pack.zip)
|
[BPI-F3、MUSE-Pi固件](https://archive.spacemit.com/openwrt/releases/23.05.2/targets/spacemit/DEVICE_debX/openwrt-spacemit-k1-sbc-debX-ext4-pack.zip)
|
||||||
|
|
||||||
[MUSE-N1固件](https://archive.spacemit.com/openwrt/releases/23.05.2/targets/spacemit/DEVICE_MUSE-N1/openwrt-spacemit-k1-nas-MUSE-N1-ext4-pack.zip)
|
[MUSE-N1固件](https://archive.spacemit.com/openwrt/releases/23.05.2/targets/spacemit/DEVICE_MUSE-N1/openwrt-spacemit-k1-nas-MUSE-N1-ext4-pack.zip)
|
||||||
|
|
||||||
|
|
||||||
## 支持设备列表
|
## 支持设备列表
|
||||||
|
|
||||||
目前支持以下硬件设备:
|
目前支持以下硬件设备:
|
||||||
|
|
||||||
### SBC 方案
|
### SBC 方案
|
||||||
|
|
||||||
- BPI-F3
|
- BPI-F3
|
||||||
- [MUSE Pi](supported_devices/muse_pi.md)
|
- [MUSE Pi](supported_devices/muse_pi.md)
|
||||||
|
|
||||||
### NAS 方案
|
### NAS 方案
|
||||||
|
|
||||||
- [MUSE N1](supported_devices/muse_n1.md)
|
- [MUSE N1](supported_devices/muse_n1.md)
|
|
@ -9,13 +9,14 @@ sidebar_position: 3
|
||||||
后续文档描述的设备和板型等效
|
后续文档描述的设备和板型等效
|
||||||
|
|
||||||
## 添加新设备
|
## 添加新设备
|
||||||
|
|
||||||
以下以新增k1-x_MUSE-Pi板型为例说明
|
以下以新增k1-x_MUSE-Pi板型为例说明
|
||||||
|
|
||||||
### kernel设备树
|
### kernel设备树
|
||||||
|
|
||||||
如参考deb1硬件设计,则拷贝k1-x_deb1.dts到如下文件,修改相应内容
|
如参考deb1硬件设计,则拷贝k1-x_deb1.dts到如下文件,修改相应内容
|
||||||
|
|
||||||
```
|
```sh
|
||||||
target/linux/spacemit/dts/k1-x_MUSE-Pi.dts
|
target/linux/spacemit/dts/k1-x_MUSE-Pi.dts
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -23,12 +24,13 @@ target/linux/spacemit/dts/k1-x_MUSE-Pi.dts
|
||||||
对于新增的版型,dts文件均存放在以上目录。编译的时候打包进bootfs分区,uboot启动kernel前加载设备树文件。
|
对于新增的版型,dts文件均存放在以上目录。编译的时候打包进bootfs分区,uboot启动kernel前加载设备树文件。
|
||||||
|
|
||||||
### uboot设备树
|
### uboot设备树
|
||||||
|
|
||||||
新增板型需要在uboot源码仓库修改,如下:
|
新增板型需要在uboot源码仓库修改,如下:
|
||||||
|
|
||||||
1.添加uboot设备树u-boot-2022.10/arch/riscv/dts/k1-x_MUSE-Pi.dts
|
1.添加uboot设备树u-boot-2022.10/arch/riscv/dts/k1-x_MUSE-Pi.dts
|
||||||
2.修改Makefile,将k1-x_MUSE-Pi.dtb添加到里面,如下:(注意后缀改成dtb)
|
2.修改Makefile,将k1-x_MUSE-Pi.dtb添加到里面,如下:(注意后缀改成dtb)
|
||||||
|
|
||||||
```
|
```diff
|
||||||
11 dtb-$(CONFIG_TARGET_SPACEMIT_K1X) += k1-x_evb.dtb k1-x_deb2.dtb k1-x_deb1.dtb k1-x_hs450.dtb \
|
11 dtb-$(CONFIG_TARGET_SPACEMIT_K1X) += k1-x_evb.dtb k1-x_deb2.dtb k1-x_deb1.dtb k1-x_hs450.dtb \
|
||||||
12 k1-x_kx312.dtb k1-x_MINI-PC.dtb k1-x_mingo.dtb k1-x_MUSE-N1.dtb \
|
12 k1-x_kx312.dtb k1-x_MINI-PC.dtb k1-x_mingo.dtb k1-x_MUSE-N1.dtb \
|
||||||
13 k1-x_MUSE-Pi.dtb k1-x_spl.dtb k1-x_milkv-jupiter.dtb \
|
13 k1-x_MUSE-Pi.dtb k1-x_spl.dtb k1-x_milkv-jupiter.dtb \
|
||||||
|
@ -36,10 +38,11 @@ target/linux/spacemit/dts/k1-x_MUSE-Pi.dts
|
||||||
15
|
15
|
||||||
```
|
```
|
||||||
|
|
||||||
3. 修改uboot-2022.10/board/spacemit/k1-x/configs/uboot_fdt.its,添加新节点。
|
3.修改`uboot-2022.10/board/spacemit/k1-x/configs/uboot_fdt.its`,添加新节点。
|
||||||
|
|
||||||
```
|
```diff
|
||||||
@@ -46,15 +46,6 @@
|
@@ -46,15 +46,6 @@
|
||||||
|
|
||||||
algo = "crc32";
|
algo = "crc32";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -68,9 +71,9 @@ target/linux/spacemit/dts/k1-x_MUSE-Pi.dts
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
4. 修改uboot-2022.10/include/configs/k1-x.h,更新DEFAULT_PRODUCT_NAME,FSBL和u-boot将默认根据DEFAULT_PRODUCT_NAME加载dtb。如果板子有EEPROM记录product_name等信息,则优先级更高,FSBL和u-boot将使用EEPROM的信息实现自适应启动。
|
4.修改`uboot-2022.10/include/configs/k1-x.h`,更新`DEFAULT_PRODUCT_NAME`,FSBL和u-boot将默认根据`DEFAULT_PRODUCT_NAME`加载dtb。如果板子有EEPROM记录product_name等信息,则优先级更高,FSBL和u-boot将使用EEPROM的信息实现自适应启动。
|
||||||
|
|
||||||
```
|
```sh
|
||||||
@@ -25,7 +25,7 @@
|
@@ -25,7 +25,7 @@
|
||||||
#define CONFIG_GATEWAYIP 10.0.92.1
|
#define CONFIG_GATEWAYIP 10.0.92.1
|
||||||
#define CONFIG_NETMASK 255.255.255.0
|
#define CONFIG_NETMASK 255.255.255.0
|
||||||
|
@ -84,9 +87,9 @@ target/linux/spacemit/dts/k1-x_MUSE-Pi.dts
|
||||||
|
|
||||||
### 加入方案
|
### 加入方案
|
||||||
|
|
||||||
如是开发板形态,则修改openwrt/target/linux/spacemit/image/k1-sbc.mk,添加k1-x_MUSE-Pi板型支持
|
如是开发板形态,则修改`openwrt/target/linux/spacemit/image/k1-sbc.mk`,添加`k1-x_MUSE-Pi`板型支持
|
||||||
|
|
||||||
```
|
```sh
|
||||||
DEVICE_DTS := k1-x_deb1 k1-x_MUSE-Pi
|
DEVICE_DTS := k1-x_deb1 k1-x_MUSE-Pi
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -108,11 +111,11 @@ FSBL默认支持双CS DDR,修改`uboot-2022.10/arch/riscv/dts/k1-x_spl.dts`可
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
如果设备有EEPROM,支持通过EEPROM实现自适应,待更新。
|
如果设备有EEPROM,支持通过EEPROM实现自适应,对应的key_name为`ddr_cs_num`,可用titantools工具写号。刷机工具的时候请参考文档<https://developer.spacemit.com/documentation?token=O6wlwlXcoiBZUikVNh2cczhin5d>
|
||||||
|
|
||||||
## 通过EEPROM实现自适应
|
## 通过EEPROM实现自适应
|
||||||
|
|
||||||
通过进迭Titanflasher工具给板子eeprom写号,实现启动的自适应,即一个固件支持多个板子。
|
通过进迭Titanflasher工具给板子eeprom写号,实现启动的自适应,即一个固件支持多个板子
|
||||||
|
|
||||||
系统启动时读取eeprom的信息,匹配uboot_fdt.its中信息,从而实现多板型支持。
|
系统启动时读取eeprom的信息,匹配uboot_fdt.its中信息,从而实现多板型支持。
|
||||||
|
|
||||||
|
@ -136,8 +139,8 @@ uboot-2022.10/arch/riscv/dts/k1-x_*.dts
|
||||||
eeprom@50{
|
eeprom@50{
|
||||||
compatible = "atmel,24c02";
|
compatible = "atmel,24c02";
|
||||||
u-boot,dm-spl;
|
u-boot,dm-spl;
|
||||||
- reg = <0x50>;
|
reg = <0x50>;
|
||||||
+ reg = <0xA0>;
|
reg = <0xA0>;
|
||||||
bus = <6>;
|
bus = <6>;
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <1>;
|
#size-cells = <1>;
|
||||||
|
@ -182,13 +185,12 @@ uboot-2022.10/arch/riscv/dts/k1-x_*.dts
|
||||||
|
|
||||||
`Programming passed.`表示写入成功。
|
`Programming passed.`表示写入成功。
|
||||||
|
|
||||||
请以设备dts的文件名(不带后缀)命名,方便u-boot自动加载dtb。
|
请以设备dts的文件名(不带后缀, 如k1-x_MUSE-Pi)命名,方便u-boot自动加载dtb。
|
||||||
|
|
||||||
3. `reset`检查是否可以加载`k1-x_MUSE-Pi`的dtb,正常的话u-boot有如下打印。
|
3. 重启设备,检查是否可以加载`k1-x_MUSE-Pi`的dtb,正常的话u-boot有如下打印。
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
product_name: k1-x_MUSE-Pi
|
product_name: k1-x_MUSE-Pi
|
||||||
detect dtb_name: k1-x_MUSE-Pi.dtb
|
|
||||||
```
|
```
|
||||||
|
|
||||||
SDK还支持从EEPROM读取以下信息:
|
SDK还支持从EEPROM读取以下信息:
|
||||||
|
|
|
@ -10,7 +10,7 @@ sidebar_position: 2
|
||||||
|
|
||||||
### 安装依赖
|
### 安装依赖
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo apt install build-essential clang flex bison g++ gawk \
|
sudo apt install build-essential clang flex bison g++ gawk \
|
||||||
gcc-multilib g++-multilib gettext git libncurses-dev libssl-dev \
|
gcc-multilib g++-multilib gettext git libncurses-dev libssl-dev \
|
||||||
python3-distutils rsync unzip zlib1g-dev file wget jq device-tree-compiler
|
python3-distutils rsync unzip zlib1g-dev file wget jq device-tree-compiler
|
||||||
|
@ -19,15 +19,18 @@ python3-distutils rsync unzip zlib1g-dev file wget jq device-tree-compiler
|
||||||
|
|
||||||
## 下载代码
|
## 下载代码
|
||||||
|
|
||||||
```
|
代码仓库分为bl-v1.0.y,bl-v2.0.y两个分支,分别对应linux-6.1、linux-6.6。后续主要维护bl-v2.0.y分支。
|
||||||
git clone https://gitee.com/bianbu-linux/openwrt.git -b bl-v1.0.y
|
|
||||||
|
```sh
|
||||||
|
git clone https://gitee.com/bianbu-linux/openwrt.git -b bl-v2.0.y
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 拉取feeds
|
## 拉取feeds
|
||||||
|
|
||||||
首次或想更新包时需要运行
|
首次或想更新包时需要运行以下命令。更新包会从openwrt官网等下载压缩包,请确保网络可用。如果出现某些包下载失败,可重复执行命令
|
||||||
|
|
||||||
```
|
```sh
|
||||||
cd openwrt
|
cd openwrt
|
||||||
./scripts/feeds update -a
|
./scripts/feeds update -a
|
||||||
./scripts/feeds install -f -p spacemit_openwrt_feeds -a
|
./scripts/feeds install -f -p spacemit_openwrt_feeds -a
|
||||||
|
@ -36,71 +39,116 @@ cd openwrt
|
||||||
|
|
||||||
## 固件编译
|
## 固件编译
|
||||||
|
|
||||||
V=s输出详细日志
|
以下编译命令的可选参数`V=s`为输出详细日志。目前提供两种方案的编译启动。
|
||||||
|
|
||||||
### SBC方案
|
### SBC方案
|
||||||
|
|
||||||
```
|
```sh
|
||||||
cp feeds/spacemit_openwrt_feeds/spacemit_k1_defconfig .config
|
cp feeds/spacemit_openwrt_feeds/spacemit_k1_defconfig .config
|
||||||
make -j12 V=s
|
make -j12 V=s
|
||||||
```
|
```
|
||||||
|
|
||||||
固件位于bin/targets/spacemit/DEVICE_debX/*.zip
|
固件位于`bin/targets/spacemit/DEVICE_debX/*.zip`
|
||||||
|
|
||||||
### NAS方案
|
### NAS方案
|
||||||
|
|
||||||
```
|
```sh
|
||||||
cp feeds/spacemit_openwrt_feeds/spacemit_k1_nas_defconfig .config
|
cp feeds/spacemit_openwrt_feeds/spacemit_k1_nas_defconfig .config
|
||||||
make -j12 V=s
|
make -j12 V=s
|
||||||
```
|
```
|
||||||
固件位于bin/targets/spacemit/DEVICE_MUSE-N1/*.zip
|
|
||||||
|
固件位于`bin/targets/spacemit/DEVICE_MUSE-N1/*.zip`
|
||||||
|
|
||||||
### 清理
|
### 清理
|
||||||
|
|
||||||
全部清理,会把bin、build_dir、staging_dir、feeds、dl等目录删掉
|
* 全部清理命令,会把`bin、build_dir、staging_dir、feeds、dl`等目录以及`.config`文件都删掉,代码仓库为最原始的状态
|
||||||
|
|
||||||
```
|
```sh
|
||||||
make distclean
|
make distclean
|
||||||
```
|
```
|
||||||
|
|
||||||
局部清理,会把编译输出目录bin、build_dir、staging_dir删掉
|
* 局部清理命令,会把编译输出目录`bin、build_dir、staging_dir`删掉,不包含dl目录、`.config`文件等
|
||||||
|
|
||||||
```
|
```sh
|
||||||
make dirclean
|
make dirclean
|
||||||
```
|
```
|
||||||
|
|
||||||
## 单包编译
|
## 单包编译
|
||||||
|
|
||||||
以adb包为例说明
|
### 单编uboot
|
||||||
|
|
||||||
### 编译
|
* 编译
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make package/boot/uboot-spacemit/compile V=s
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* 清理
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make package/boot/uboot-spacemit/clean V=s
|
||||||
|
```
|
||||||
|
|
||||||
|
### 单编opensbi
|
||||||
|
|
||||||
|
* 编译
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make package/boot/opensbi-spacemit/compile V=s
|
||||||
|
```
|
||||||
|
|
||||||
|
* 清理
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make package/boot/opensbi-spacemit/clean V=s
|
||||||
|
```
|
||||||
|
|
||||||
|
### 单编linux
|
||||||
|
|
||||||
|
* 编译
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make target/linux/compile V=s
|
||||||
|
```
|
||||||
|
|
||||||
|
* 清理
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make target/linux/clean V=s
|
||||||
|
```
|
||||||
|
|
||||||
|
### 单编adb包
|
||||||
|
|
||||||
|
其他包的编译都类似一下的编译方式
|
||||||
|
|
||||||
|
* 编译
|
||||||
|
|
||||||
|
```sh
|
||||||
make package/utils/adb/compile V=s
|
make package/utils/adb/compile V=s
|
||||||
```
|
```
|
||||||
|
|
||||||
### 清理
|
* 清理
|
||||||
|
|
||||||
```
|
```sh
|
||||||
make package/utils/adb/clean V=s
|
make package/utils/adb/clean V=s
|
||||||
```
|
```
|
||||||
|
|
||||||
## 烧写
|
## 烧写
|
||||||
|
|
||||||
固件*.zip,使用Titan Flasher工具刷写至设备板载存储介质
|
固件*.zip,使用Titan Flasher工具刷写至设备板载存储介质,刷机工具使用参考<https://developer.spacemit.com/documentation?token=O6wlwlXcoiBZUikVNh2cczhin5d>
|
||||||
|
|
||||||
固件*sdcard.img,使用dd命令写至卡上,设备插卡上电即可实现卡启动
|
固件*sdcard.img,可使用dd命令写至卡上,设备插卡上电即可实现卡启动
|
||||||
|
|
||||||
## 支持设备列表
|
## 支持设备列表
|
||||||
|
|
||||||
### SBC 方案
|
### SBC 方案
|
||||||
|
|
||||||
- BPI-F3
|
* BPI-F3
|
||||||
- MUSE-Pi
|
* MUSE-Pi
|
||||||
|
|
||||||
### NAS 方案
|
### NAS 方案
|
||||||
|
|
||||||
- MUSE-N1
|
* MUSE-N1
|
||||||
|
|
||||||
## 软路由
|
## 软路由
|
||||||
|
|
||||||
|
@ -110,13 +158,13 @@ SBC方案有线网卡eth1为lan口,eth2为wan
|
||||||
|
|
||||||
NAS方案有线网卡2.5G为wan,其它两个千兆口为lan
|
NAS方案有线网卡2.5G为wan,其它两个千兆口为lan
|
||||||
|
|
||||||
- 热点名称:openWRT-AP
|
* 热点名称:openWRT-AP
|
||||||
- 热点密码:12345678
|
* 热点密码:12345678
|
||||||
- WiFi网关:192.168.1.1
|
* WiFi网关:192.168.1.1
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
### 1. 内核编译链接pthread_once出错
|
### 内核编译链接pthread_once出错
|
||||||
|
|
||||||
基于ubuntu 20.04编译openwrt出现"pthread_once"的编译报错,可修改`linux-*/certs/Makefile`
|
基于ubuntu 20.04编译openwrt出现"pthread_once"的编译报错,可修改`linux-*/certs/Makefile`
|
||||||
|
|
||||||
|
@ -125,3 +173,92 @@ openwrt/build_dir/target-riscv64_riscv64_musl_*/linux-spacemit_*/linux-6.1.15/ce
|
||||||
最后一行改成:
|
最后一行改成:
|
||||||
HOSTLDLIBS_extract-cert = -lcrypto -pthread
|
HOSTLDLIBS_extract-cert = -lcrypto -pthread
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 如何更新uboot/opensbi/linux版本
|
||||||
|
|
||||||
|
1.openwrt跟踪<https://gitee.com/bianbu-linux>的uboot/opensbi/linux仓库版本。openwrt会不定期更新该仓库的版本
|
||||||
|
|
||||||
|
2.如果需要手动更新最新的uboot/opensbi/linux版本,可参考一下方式
|
||||||
|
|
||||||
|
* 确认gitee仓库的最新版本的tar包已经上传到<https://archive.spacemit.com/openwrt/dl/>,如linux-6.1-v1.0.15.tar.xz
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
* 更改Makefile版本号
|
||||||
|
|
||||||
|
```diff
|
||||||
|
diff --git a/package/boot/opensbi-spacemit/Makefile b/package/boot/opensbi-spacemit/Makefile
|
||||||
|
index d4572af253..208d2fae6d 100644
|
||||||
|
--- a/package/boot/opensbi-spacemit/Makefile
|
||||||
|
+++ b/package/boot/opensbi-spacemit/Makefile
|
||||||
|
@@ -16,7 +16,7 @@ else
|
||||||
|
PKG_NAME:=opensbi
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
PKG_VERSION:=1.3
|
||||||
|
-PKG_SOURCE_VERSION:=1.0.5
|
||||||
|
+PKG_SOURCE_VERSION:=v1.0.15
|
||||||
|
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
|
PKG_SOURCE_URL:=https://archive.spacemit.com/openwrt/dl/
|
||||||
|
diff --git a/package/boot/uboot-spacemit/Makefile b/package/boot/uboot-spacemit/Makefile
|
||||||
|
index 51e6e97fb7..c69173cfa8 100644
|
||||||
|
--- a/package/boot/uboot-spacemit/Makefile
|
||||||
|
+++ b/package/boot/uboot-spacemit/Makefile
|
||||||
|
@@ -18,7 +18,7 @@ else
|
||||||
|
PKG_NAME:=uboot
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
PKG_VERSION:=2022.10
|
||||||
|
-PKG_SOURCE_VERSION:=1.0.5
|
||||||
|
+PKG_SOURCE_VERSION:=v1.0.15
|
||||||
|
|
||||||
|
PKG_SOURCE:=uboot-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
|
PKG_SOURCE_URL:=https://archive.spacemit.com/openwrt/dl/
|
||||||
|
|
||||||
|
diff --git a/target/linux/spacemit/Makefile b/target/linux/spacemit/Makefile
|
||||||
|
index ac230af366..148e5a79b8 100644
|
||||||
|
--- a/target/linux/spacemit/Makefile
|
||||||
|
+++ b/target/linux/spacemit/Makefile
|
||||||
|
@@ -20,7 +20,7 @@ CONFIG_EXTERNAL_KERNEL_TREE=$(TOPDIR)/../bsp-src/linux-6.1
|
||||||
|
CONFIG_KERNEL_GIT_CLONE_URI=""
|
||||||
|
else
|
||||||
|
## download tar.xz from url.
|
||||||
|
-LINUX_VERSION_CUSTOM:=linux-6.1-1.0.5
|
||||||
|
+LINUX_VERSION_CUSTOM:=linux-6.1-v1.0.15
|
||||||
|
LINUX_SOURCE:=$(LINUX_VERSION_CUSTOM).tar.xz
|
||||||
|
LINUX_KERNEL_HASH:=skip
|
||||||
|
endif
|
||||||
|
|
||||||
|
```sh
|
||||||
|
* 更新kernel config
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make kernel_menuconfig
|
||||||
|
```
|
||||||
|
|
||||||
|
* 编译
|
||||||
|
|
||||||
|
可能会出现失败,如果编译异常,请根据报错原因修正
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make -j12 V=s
|
||||||
|
```
|
||||||
|
|
||||||
|
### 更改下载源为spacemit
|
||||||
|
|
||||||
|
spacemit维护一套预编译的安装包,可通过更改源来下载安装
|
||||||
|
|
||||||
|
* 修改软件源地址(基于设备上修改)
|
||||||
|
bl-v2.0.y为具体版本的标签,请根据需求来修改。
|
||||||
|
如果为sbc方案,需要将`DEVICE_MUSE-N1`改成`DEVICE_debX`
|
||||||
|
|
||||||
|
```sh
|
||||||
|
//vim /etc/opkg/distfeeds.conf
|
||||||
|
|
||||||
|
src/gz openwrt_base https://archive.spacemit.com/openwrt/releases/bl-v2.0.y/packages/riscv64_riscv64/base
|
||||||
|
src/gz openwrt_luci https://archive.spacemit.com/openwrt/releases/bl-v2.0.y/packages/riscv64_riscv64/luci
|
||||||
|
src/gz openwrt_packages https://archive.spacemit.com/openwrt/releases/bl-v2.0.y/packages/riscv64_riscv64/packages
|
||||||
|
src/gz openwrt_routing https://archive.spacemit.com/openwrt/releases/bl-v2.0.y/packages/riscv64_riscv64/routing
|
||||||
|
src/gz openwrt_telephony https://archive.spacemit.com/openwrt/releases/bl-v2.0.y/packages/riscv64_riscv64/telephony
|
||||||
|
src/gz openwrt_spacemit_packages https://archive.spacemit.com/openwrt/releases/bl-v2.0.y/targets/spacemit/DEVICE_MUSE-N1/packages
|
||||||
|
|
||||||
|
```
|
||||||
|
|
|
@ -9,12 +9,11 @@ sidebar_position: 4
|
||||||
本文档介绍进迭OpenWrt SDK的方案管理,目前发行的SDK默认适配k1-sbc、k1-nas方案,
|
本文档介绍进迭OpenWrt SDK的方案管理,目前发行的SDK默认适配k1-sbc、k1-nas方案,
|
||||||
每个方案支持多个板型,如k1-sbc方案支持k1-x_MUSE-Pi、k1-x_deb1板型,未来会持续更新。
|
每个方案支持多个板型,如k1-sbc方案支持k1-x_MUSE-Pi、k1-x_deb1板型,未来会持续更新。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 方案总览
|
## 方案总览
|
||||||
|
|
||||||
以开发板方案k1-sbc为例,通常跟以下配置文件有关,后续章节逐一介绍
|
以开发板方案k1-sbc为例,通常跟以下配置文件有关,后续章节逐一介绍
|
||||||
```
|
|
||||||
|
```sh
|
||||||
#方案配置
|
#方案配置
|
||||||
feeds/spacemit_openwrt_feeds/spacemit_k1_defconfig
|
feeds/spacemit_openwrt_feeds/spacemit_k1_defconfig
|
||||||
|
|
||||||
|
@ -51,20 +50,20 @@ openwrt/target/linux/spacemit/base-files/etc/uci-defaults/
|
||||||
|
|
||||||
k1-sbc方案的编译配置,用于指导OpenWrt的编译行为
|
k1-sbc方案的编译配置,用于指导OpenWrt的编译行为
|
||||||
|
|
||||||
|
|
||||||
### 方案Makefile
|
### 方案Makefile
|
||||||
|
|
||||||
`openwrt/target/linux/spacemit/Makefile`
|
`openwrt/target/linux/spacemit/Makefile`
|
||||||
|
|
||||||
SUBTARGETS添加方案名称
|
SUBTARGETS添加方案名称
|
||||||
|
|
||||||
```
|
```c
|
||||||
...
|
...
|
||||||
12 SUBTARGETS:=k1-nas k1-sbc
|
12 SUBTARGETS:=k1-nas k1-sbc
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### 方案目录
|
### 方案目录
|
||||||
|
|
||||||
`openwrt/target/linux/spacemit/k1-sbc`
|
`openwrt/target/linux/spacemit/k1-sbc`
|
||||||
|
|
||||||
创建跟方案名称同名目录:k1-sbc,包含以下内容
|
创建跟方案名称同名目录:k1-sbc,包含以下内容
|
||||||
|
@ -79,11 +78,11 @@ SUBTARGETS添加方案名称
|
||||||
|
|
||||||
此为OpenWrt定义,不同device type默认包含不同软件包
|
此为OpenWrt定义,不同device type默认包含不同软件包
|
||||||
|
|
||||||
|
|
||||||
* openwrt/target/linux/spacemit/k1-sbc/base-files/
|
* openwrt/target/linux/spacemit/k1-sbc/base-files/
|
||||||
|
|
||||||
包含要打包进rootfs的配置文件,如下:
|
包含要打包进rootfs的配置文件,如下:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
openwrt/target/linux/spacemit/k1-sbc/base-files$ tree
|
openwrt/target/linux/spacemit/k1-sbc/base-files$ tree
|
||||||
.
|
.
|
||||||
├── etc
|
├── etc
|
||||||
|
@ -109,15 +108,14 @@ openwrt/target/linux/spacemit/k1-sbc/base-files$ tree
|
||||||
8 directories, 11 files
|
8 directories, 11 files
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 方案设备树
|
### 方案设备树
|
||||||
|
|
||||||
`openwrt/target/linux/spacemit/dts/`
|
`openwrt/target/linux/spacemit/dts/`
|
||||||
|
|
||||||
不同板型的内核设备树,可参考[设备管理](openwrt_device_management.md)添加一个新板型支持
|
不同板型的内核设备树,可参考[设备管理](openwrt_device_management.md)添加一个新板型支持
|
||||||
|
|
||||||
|
|
||||||
### 方案分区表
|
### 方案分区表
|
||||||
|
|
||||||
`openwrt/target/linux/spacemit/image/partition_tables/`
|
`openwrt/target/linux/spacemit/image/partition_tables/`
|
||||||
|
|
||||||
这里的分区表是多个方案通用。里面包含不同存储介质的分区表配置,
|
这里的分区表是多个方案通用。里面包含不同存储介质的分区表配置,
|
||||||
|
@ -128,21 +126,23 @@ openwrt/target/linux/spacemit/k1-sbc/base-files$ tree
|
||||||
* partition_universal.json,用于blk设备的刷机启动,
|
* partition_universal.json,用于blk设备的刷机启动,
|
||||||
* partition_flash.json,用于spacemit Titanflasher工具制作卡量产
|
* partition_flash.json,用于spacemit Titanflasher工具制作卡量产
|
||||||
|
|
||||||
修改分区表可能会影响到系统正常启动,详细的修改方式请参考《启动》文档
|
修改分区表可能会影响到系统正常启动,详细的修改方式请参考<https://bianbu-linux.spacemit.com/development_guide/boot>
|
||||||
|
|
||||||
### 方案启动参数
|
### 方案启动参数
|
||||||
|
|
||||||
`openwrt/target/linux/spacemit/image/env_k1-x.txt`
|
`openwrt/target/linux/spacemit/image/env_k1-x.txt`
|
||||||
|
|
||||||
uboot最高优先级环境变量,这里可以设定bootargs启动参数,loglevel等
|
uboot最高优先级环境变量,这里可以设定bootargs启动参数,loglevel等
|
||||||
|
|
||||||
默认的bootargs为:
|
默认的bootargs为:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
commonargs=setenv bootargs earlycon=${earlycon} earlyprintk console=tty1 console=${console} loglevel=${loglevel} clk_ignore_unused swiotlb=65536 rdinit=${init}
|
commonargs=setenv bootargs earlycon=${earlycon} earlyprintk console=tty1 console=${console} loglevel=${loglevel} clk_ignore_unused swiotlb=65536 rdinit=${init}
|
||||||
```
|
```
|
||||||
|
|
||||||
可在env_k1-x.txt中重定义earlycon/console/loglevel/init等环境变量
|
可在env_k1-x.txt中重定义earlycon/console/loglevel/init等环境变量
|
||||||
```
|
|
||||||
|
```sh
|
||||||
# Common parameter
|
# Common parameter
|
||||||
earlycon=sbi
|
earlycon=sbi
|
||||||
console=ttyS0,115200
|
console=ttyS0,115200
|
||||||
|
@ -153,13 +153,14 @@ loglevel=8
|
||||||
```
|
```
|
||||||
|
|
||||||
也可以直接重定义整个bootargs
|
也可以直接重定义整个bootargs
|
||||||
```
|
|
||||||
|
```sh
|
||||||
bootargs=earlycon=sbi console=ttyS0,115200 loglevel=4
|
bootargs=earlycon=sbi console=ttyS0,115200 loglevel=4
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### 方案固件
|
### 方案固件
|
||||||
|
|
||||||
`openwrt/target/linux/spacemit/image/k1-sbc.mk`
|
`openwrt/target/linux/spacemit/image/k1-sbc.mk`
|
||||||
|
|
||||||
制定方案的固件编译,如包含支持的板型、生成sdcard.img、spacemit.zip刷机包等,
|
制定方案的固件编译,如包含支持的板型、生成sdcard.img、spacemit.zip刷机包等,
|
||||||
|
@ -170,7 +171,7 @@ bootargs=earlycon=sbi console=ttyS0,115200 loglevel=4
|
||||||
|
|
||||||
且openwrt/target/linux/spacemit/dts/需有一份k1-x_MUSE-Pi.dts
|
且openwrt/target/linux/spacemit/dts/需有一份k1-x_MUSE-Pi.dts
|
||||||
|
|
||||||
```
|
```sh
|
||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
#
|
#
|
||||||
# Copyright (C) 2024 Spacemit Ltd.
|
# Copyright (C) 2024 Spacemit Ltd.
|
||||||
|
@ -191,36 +192,36 @@ TARGET_DEVICES += debX
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### 方案首次启动
|
### 方案首次启动
|
||||||
|
|
||||||
`openwrt/target/linux/spacemit/base-files/etc/uci-defaults/`
|
`openwrt/target/linux/spacemit/base-files/etc/uci-defaults/`
|
||||||
|
|
||||||
UCI默认设置提供了一种使用UCI预配置您的镜像的方法。 要在设备首次启动时设置一些系统默认值,
|
UCI默认设置提供了一种使用UCI预配置您的镜像的方法。 要在设备首次启动时设置一些系统默认值,
|
||||||
|
|
||||||
请在目录此中创建一个脚本。
|
请在目录此中创建一个脚本。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 新增方案
|
## 新增方案
|
||||||
|
|
||||||
以k1-sbc方案为例,需要修改以下内容:
|
以k1-sbc方案为例,需要修改以下内容:
|
||||||
|
|
||||||
1.修改openwrt/target/linux/spacemit/Makefile中的SUBTARGETS,添加方案名称,如k1-sbc
|
1.修改openwrt/target/linux/spacemit/Makefile中的SUBTARGETS,添加方案名称,如k1-sbc
|
||||||
2.新增方案目录,如openwrt/target/linux/spacemit/k1-sbc/,添加如下文件
|
2.新增方案目录,如openwrt/target/linux/spacemit/k1-sbc/,添加如下文件
|
||||||
|
|
||||||
```
|
```sh
|
||||||
openwrt/target/linux/spacemit/k1-sbc/config-6.1
|
openwrt/target/linux/spacemit/k1-sbc/config-6.1
|
||||||
openwrt/target/linux/spacemit/k1-sbc/target.mk
|
openwrt/target/linux/spacemit/k1-sbc/target.mk
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
3.新增固件编译和兼容板型 openwrt/target/linux/spacemit/image/k1-sbc.mk
|
3.新增固件编译和兼容板型 openwrt/target/linux/spacemit/image/k1-sbc.mk
|
||||||
|
|
||||||
4.feeds/spacemit_openwrt_feeds/目录下新增编译配置,如k1-sbc方案spacemit_k1_defconfig
|
4.feeds/spacemit_openwrt_feeds/目录下新增编译配置,如k1-sbc方案spacemit_k1_defconfig
|
||||||
|
|
||||||
|
|
||||||
### 新增板型
|
### 新增板型
|
||||||
|
|
||||||
每个方案下至少有一个或多个板型,新增板型支持可参考[设备管理](openwrt_device_management.md)
|
每个方案下至少有一个或多个板型,新增板型支持可参考[设备管理](openwrt_device_management.md)
|
||||||
|
|
||||||
|
|
||||||
### uboot/opensbi编译配置
|
### uboot/opensbi编译配置
|
||||||
|
|
||||||
如有需要增加uboot/opensbi新的编译配置,可参考修改以下内容
|
如有需要增加uboot/opensbi新的编译配置,可参考修改以下内容
|
||||||
|
|
||||||
#### uboot
|
#### uboot
|
||||||
|
@ -228,8 +229,7 @@ openwrt/target/linux/spacemit/k1-sbc/target.mk
|
||||||
1. uboot源码仓库新增编译配置,如u-boot-2022.10/configs/k1_defconfig
|
1. uboot源码仓库新增编译配置,如u-boot-2022.10/configs/k1_defconfig
|
||||||
2. 修改openwrt/package/boot/uboot-spacemit/Makefile
|
2. 修改openwrt/package/boot/uboot-spacemit/Makefile
|
||||||
|
|
||||||
```
|
```sh
|
||||||
|
|
||||||
50 define Build/Configure
|
50 define Build/Configure
|
||||||
51 $(MAKE) -C $(LOCAL_SOURCE_DIR) k1_defconfig
|
51 $(MAKE) -C $(LOCAL_SOURCE_DIR) k1_defconfig
|
||||||
52 endef
|
52 endef
|
||||||
|
@ -241,7 +241,7 @@ openwrt/target/linux/spacemit/k1-sbc/target.mk
|
||||||
1. opensbi源码仓库新增编译配置,如opensbi-1.3/platform/generic/configs/k1_defconfig
|
1. opensbi源码仓库新增编译配置,如opensbi-1.3/platform/generic/configs/k1_defconfig
|
||||||
2. 修改package/boot/opensbi-spacemit/Makefile
|
2. 修改package/boot/opensbi-spacemit/Makefile
|
||||||
|
|
||||||
```
|
```sh
|
||||||
59 define Build/Compile
|
59 define Build/Compile
|
||||||
60 $(eval $(Package/opensbi_$(BUILD_VARIANT))) \
|
60 $(eval $(Package/opensbi_$(BUILD_VARIANT))) \
|
||||||
61 +$(MAKE_VARS) $(MAKE) -C $(LOCAL_SOURCE_DIR) \
|
61 +$(MAKE_VARS) $(MAKE) -C $(LOCAL_SOURCE_DIR) \
|
||||||
|
|
BIN
static/image.png
Normal file
BIN
static/image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 242 KiB |
|
@ -4,38 +4,4 @@ sidebar_position: 1
|
||||||
|
|
||||||
# MUSE N1
|
# MUSE N1
|
||||||
|
|
||||||
## **概述**
|
参考 [MUSE N1](https://bianbu.spacemit.com/bianbu-nas/device_list/muse_n1)
|
||||||
|
|
||||||
MUSE N1 开发板板型:
|
|
||||||
|
|
||||||
- MUSE N1 开发板采用 K1 芯片、P1 PMIC + 外挂 DCDC 的供电方案
|
|
||||||
- 存储采用 LPDDR4X、eMMC
|
|
||||||
- DC Power:USB TYPEC 供电
|
|
||||||
- Ethernet:支持3路 RJ45 网络接口. 其中2路支持 10/100/1000M 以太网,1路支持 2.5G 网口
|
|
||||||
- USB:1路USB 2.0 Host TYPEA 接口,1路 USB3.0 Device TypeC 功能
|
|
||||||
- SDIO WIFI:WIFI 型号为 RTL8852BS,外置 SMA 天线,支持无线上网功能
|
|
||||||
- PCIe2.0 2lane Interface:2路标准M.2 KEY M 接口,用于扩展 PCIe 设备
|
|
||||||
|
|
||||||
## **实物图**
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## 刷机模式
|
|
||||||
|
|
||||||
对照实物图,进行下述操作:
|
|
||||||
|
|
||||||
- USB线一端连接板子Type-C口,一端连接PC。长按 S3 键不松手,然后按下 S2 REST键进入刷机模式
|
|
||||||
|
|
||||||
刷机工具使用参考《 [刷机工具使用手册](https://developer.spacemit.com/#/documentation?token=O6wlwlXcoiBZUikVNh2cczhin5d)》,刷机完成,按S2重启系统。
|
|
||||||
|
|
||||||
## 拨码开关
|
|
||||||
|
|
||||||
对照实物图,拨码开关功能由 SW1 进行控制。通过拨动 SW1 可使得开发板以下面两种模式启动:
|
|
||||||
|
|
||||||
- NAS 模式:如图所示放置 MUSE N1 开发板,SW1 三个子键全部往上拨为 NAS 模式。
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
- 快速U盘模式:如图所示放置 MUSE N1 开发板,SW1 三个子键全部往下拨为快速U盘模式。
|
|
||||||
|
|
||||||

|
|
||||||
|
|
|
@ -4,34 +4,4 @@ sidebar_position: 2
|
||||||
|
|
||||||
# MUSE Pi
|
# MUSE Pi
|
||||||
|
|
||||||
## 概述
|
参考 [MUSE N1](https://bianbu.spacemit.com/bianbu-nas/device_list/muse_pi)
|
||||||
|
|
||||||
MUSE Pi 开发板板型:
|
|
||||||
|
|
||||||
- MUSE Pi 开发板采用 K1 芯片,集成8核 X60,符合 RISC-V 64GCVB 和 RVA22 标准设计
|
|
||||||
- 存储采用 LPDDR4X 4266 SDRAM 8GB/16GB 和 EMMC 32GB/64GB
|
|
||||||
- 电源:TypeC 接口支持 USB2.0 OTG 数据传输,支持 PD3.0 协议输入(12V)
|
|
||||||
- Ethernet:支持2路 RJ45 接口 1000M 以太网
|
|
||||||
- HDMI:支持 HDMI1.4 接口,最大可输出 1920x1080@60Hz
|
|
||||||
- 卡启动:支持 TF 卡扩展存储,可用作系统启动存储,支持高速数据传输模式
|
|
||||||
- 蓝牙:支持蓝牙5.0标准及低功耗模式(BLE)
|
|
||||||
- Wi-Fi:支持双频(2.4GHz 和 5GHz)的 802.11ax Wi-Fi 无线网络连接
|
|
||||||
- MIPI DSI:支持 4lane MIPI DSI 接口,最大可输出 1920x1080@60Hz
|
|
||||||
- MIPI CSI:支持 2x4-lane MIPI CSI,支持 4lane+4lane 或 4lane+2lane+2lane 组合
|
|
||||||
- PCIe:支持2路 PCIe x2,提供 10Gbps 通讯速率,快速扩展
|
|
||||||
- 音频:支持立体声喇叭、耳机输出及双 MIC 录音
|
|
||||||
- GPIO:兼容树莓派标准 26pin 接口
|
|
||||||
- USB:支持1路 USB3.0 DRD,1路 USB2.0 Host
|
|
||||||
|
|
||||||
## 实物图
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## 刷机模式
|
|
||||||
|
|
||||||
对照实物图,进行下述操作:
|
|
||||||
|
|
||||||
- USB线一端连接板子Type-C口,一端连接PC。长按 SW2 键不松手,然后按下SW4 REST键进入刷机模式
|
|
||||||
|
|
||||||
刷机工具使用参考《 [刷机工具使用手册](https://developer.spacemit.com/#/documentation?token=O6wlwlXcoiBZUikVNh2cczhin5d)》,刷机完成,按SW4 重启系统。
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.6 MiB |
Binary file not shown.
Before Width: | Height: | Size: 829 KiB |
Binary file not shown.
Before Width: | Height: | Size: 909 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3 MiB |
Loading…
Add table
Add a link
Reference in a new issue