mirror of
https://github.com/sipeed/LicheeRV-Nano-Build.git
synced 2026-09-12 05:39:55 -05:00
Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ce67e89a1 | ||
|
|
a8325c3070 | ||
|
|
1559c57961 | ||
|
|
4b6edb79a6 | ||
|
|
49d168aed3 | ||
|
|
eccf81f117 | ||
|
|
bd8019232f | ||
|
|
4b479336b6 | ||
|
|
cf14081252 | ||
|
|
217b2670fe | ||
|
|
9877373468 | ||
|
|
d88d58feca | ||
|
|
9af47b1bb2 | ||
|
|
2dbbd9e65b | ||
|
|
8a20f93b46 | ||
|
|
dc518cddef | ||
|
|
0cff6d9d49 | ||
|
|
1e9369ccf5 | ||
|
|
c5d9efaaad | ||
|
|
e5a5c4df9b | ||
|
|
1f3fa10d71 | ||
|
|
98d17d2c04 | ||
|
|
7e98af86e3 | ||
|
|
3649fe90d1 | ||
|
|
2ad0073a43 | ||
|
|
bf7570c8aa | ||
|
|
425f917ca5 | ||
|
|
d4af3c62f7 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -3,6 +3,10 @@
|
||||
*.o
|
||||
*.ko
|
||||
*.d
|
||||
# keep init.d directory
|
||||
!kvm/init.d/*
|
||||
!buildroot/board/cvitek/SG200X/overlay/etc/init.d/
|
||||
!buildroot/board/cvitek/SG200X/overlay/etc/init.d/*
|
||||
host-tools/
|
||||
host-tools
|
||||
*.sqfs
|
||||
@@ -419,4 +423,3 @@ middleware/v2/sample/vio/sample_vio_main.o
|
||||
osdrv/extdrv/wireless/.tmp_4261/
|
||||
middleware/v2/lib
|
||||
host-tools/
|
||||
kvm/
|
||||
|
||||
702
README.md
702
README.md
@@ -1,60 +1,696 @@
|
||||
# LicheeRV-Nano-Build
|
||||
# 构建 NanoKVM 镜像
|
||||
|
||||
# download source
|
||||
完整的 NanoKVM 镜像由两部分组成:
|
||||
|
||||
1. `LicheeRV-Nano` 的 Linux 系统镜像。
|
||||
2. `NanoKVM APP`,也就是设备启动后运行的 KVM 应用、Web 前端、后端服务和硬件辅助组件。
|
||||
|
||||
整体流程是:先编译 `LicheeRV-Nano Linux` 镜像,再编译 `NanoKVM APP`,最后把 `kvmapp` 合并进系统镜像。
|
||||
|
||||
## 0. 路径约定
|
||||
|
||||
为避免后续构建、复制和挂载命令中的路径混乱,本文固定使用下面的目录结构。所有源码都放在用户目录下的 `LicheeRV_NanoKVM` 文件夹中:
|
||||
|
||||
```text
|
||||
~/LicheeRV_NanoKVM/
|
||||
├── LicheeRV-Nano-Build/ # SDK 和系统镜像构建目录
|
||||
└── NanoKVM/ # NanoKVM APP 源码目录
|
||||
```
|
||||
git clone https://github.com/sipeed/LicheeRV-Nano-Build --depth=1
|
||||
cd LicheeRV-Nano-Build
|
||||
|
||||
先在终端里定义这几个固定路径变量,后续命令都基于它们执行:
|
||||
|
||||
```shell
|
||||
export WORKDIR="$HOME/LicheeRV_NanoKVM"
|
||||
export SDK_DIR="$WORKDIR/LicheeRV-Nano-Build"
|
||||
export APP_DIR="$WORKDIR/NanoKVM"
|
||||
```
|
||||
|
||||
首次构建前创建工作目录:
|
||||
|
||||
```shell
|
||||
mkdir -p "$WORKDIR"
|
||||
```
|
||||
|
||||
不要把 `LicheeRV-Nano-Build` 和 `NanoKVM` 分散到其他目录,否则后文的复制、合并镜像命令需要同步调整。新开终端后需要重新执行上面的变量定义。
|
||||
|
||||
## 1. 构建 LicheeRV-Nano Linux 镜像
|
||||
|
||||
### 1.1 源码和分支
|
||||
|
||||
- SDK 仓库:<https://github.com/sipeed/LicheeRV-Nano-Build>
|
||||
- SDK 分支:`NanoKVM`
|
||||
- 工具链仓库:<https://github.com/sophgo/host-tools>
|
||||
|
||||
`host-tools` 中包含 `riscv64-unknown-linux-musl-gcc`,后续编译 `NanoKVM APP` 的后端服务也会用到同一套工具链。
|
||||
|
||||
### 1.2 拉取源码
|
||||
|
||||
```shell
|
||||
cd "$WORKDIR"
|
||||
|
||||
git clone -b NanoKVM https://github.com/sipeed/LicheeRV-Nano-Build --depth=1
|
||||
cd "$SDK_DIR"
|
||||
git clone https://github.com/sophgo/host-tools --depth=1
|
||||
```
|
||||
|
||||
## host environment
|
||||
如果源码已经存在,可以跳过 clone,直接进入目录:
|
||||
|
||||
you can use container:
|
||||
|
||||
```
|
||||
cd host/ubuntu
|
||||
docker build -t licheervnano-build-ubuntu .
|
||||
docker run --name licheervnano-build-ubuntu licheervnano-build-ubuntu
|
||||
docker export licheervnano-build-ubuntu | sqfstar licheervnano-build-ubuntu.sqfs
|
||||
singularity shell -e licheervnano-build-ubuntu.sqfs
|
||||
```shell
|
||||
cd "$SDK_DIR"
|
||||
```
|
||||
|
||||
# build it
|
||||
### 1.3 编译系统镜像
|
||||
|
||||
```
|
||||
进入 SDK 目录并加载编译环境:
|
||||
|
||||
```shell
|
||||
cd "$SDK_DIR"
|
||||
source build/cvisetup.sh
|
||||
# C906:
|
||||
```
|
||||
|
||||
执行后会注册 `defconfig`、`build_all`、`clean_all` 等命令,并打印当前 SDK 支持的板型配置说明。
|
||||
|
||||
选择 `LicheeRV Nano` 的板级配置:
|
||||
|
||||
```shell
|
||||
defconfig sg2002_licheervnano_sd
|
||||
# A53:
|
||||
# defconfig sg2002_licheea53nano_sd
|
||||
```
|
||||
|
||||
如果要编译 A53 版本,可以改用:
|
||||
|
||||
```shell
|
||||
defconfig sg2002_licheea53nano_sd
|
||||
```
|
||||
|
||||
开始完整编译:
|
||||
|
||||
```shell
|
||||
build_all
|
||||
```
|
||||
|
||||
# build fail
|
||||
`build_all` 会依次编译 `U-Boot`、`Kernel`、`ramdisk/rootfs`、驱动、第三方库、中间件,并打包最终镜像。
|
||||
|
||||
on some system, qt5svg or qt5base will build failed on first build, please retry command:
|
||||
如果需要从干净状态重新完整编译,可以执行:
|
||||
|
||||
```
|
||||
```shell
|
||||
cd "$SDK_DIR"
|
||||
source build/cvisetup.sh
|
||||
defconfig sg2002_licheervnano_sd
|
||||
clean_all
|
||||
build_all
|
||||
```
|
||||
|
||||
# how to modify image after build:
|
||||
不要在另一个 `build_all` 还在运行时执行 `clean_all`。
|
||||
|
||||
```
|
||||
# first partition
|
||||
touch wifi.sta
|
||||
mcopy -i install/xxx/xxx.img@@1s wifi.sta ::/
|
||||
### 1.4 WSL 下的 PATH 问题
|
||||
|
||||
# second partition
|
||||
./host/mount_ext4.sh install/xxx/xxx.img mountpoint
|
||||
cd mountpoint
|
||||
touch xxx
|
||||
如果在 WSL 中编译,可能会遇到类似错误:
|
||||
|
||||
```text
|
||||
Your PATH contains spaces, TABs, and/or newline (\n) characters.
|
||||
This doesn't work. Fix you PATH.
|
||||
make: *** [support/dependencies/dependencies.mk:27: dependencies] Error 1
|
||||
```
|
||||
|
||||
# logo
|
||||
这是因为 `PATH` 里混入了带空格的 Windows 路径,Buildroot 不允许 `PATH` 包含空格、Tab 或换行。可以在当前终端临时过滤掉这些路径后再重新编译:
|
||||
|
||||
```shell
|
||||
export PATH="$(printf '%s' "$PATH" | tr ':' '\n' | grep -v '[[:space:]]' | paste -sd: -)"
|
||||
```
|
||||
./host/make_logo.sh input.jpeg logo.jpeg
|
||||
mcopy -i install/xxx/xxx.img@@1s logo.jpeg ::/
|
||||
|
||||
### 1.5 编译产物
|
||||
|
||||
编译成功后,产物通常位于:
|
||||
|
||||
```shell
|
||||
"$SDK_DIR/install/soc_sg2002_licheervnano_sd/"
|
||||
```
|
||||
|
||||
镜像文件通常在:
|
||||
|
||||
```shell
|
||||
"$SDK_DIR/install/soc_sg2002_licheervnano_sd/images/"
|
||||
```
|
||||
|
||||
常见产物包括:
|
||||
|
||||
```text
|
||||
fip.bin
|
||||
boot.sd
|
||||
rootfs.sd
|
||||
system.sd
|
||||
upgrade.zip
|
||||
*.img
|
||||
```
|
||||
|
||||
查看最新生成的整盘镜像:
|
||||
|
||||
```shell
|
||||
ls -lh "$SDK_DIR"/install/soc_sg2002_licheervnano_sd/images/*.img
|
||||
```
|
||||
|
||||
### 1.6 编译 minimal 镜像
|
||||
|
||||
如果需要更小的 rootfs,可以选择 minimal 板型:
|
||||
|
||||
```shell
|
||||
cd "$SDK_DIR"
|
||||
source build/cvisetup.sh
|
||||
defconfig sg2002_licheervnano_sd_minimal
|
||||
clean_all
|
||||
build_all
|
||||
```
|
||||
|
||||
minimal 产物位于:
|
||||
|
||||
```shell
|
||||
"$SDK_DIR/install/soc_sg2002_licheervnano_sd_minimal/"
|
||||
```
|
||||
|
||||
minimal 镜像不预装 Python3、FRP 和 Tailscale,但保留 NanoKVM、SSH、mDNS、Bash 及基础网络功能。合并 APP 时需要显式指定 minimal 镜像:
|
||||
|
||||
```shell
|
||||
./kvm/merge_nanokvm_app.sh \
|
||||
-i install/soc_sg2002_licheervnano_sd_minimal/images/your-image-name.img
|
||||
```
|
||||
|
||||
如果编译过程中停在下载进度位置,例如 `Buildroot` 正在下载 `Pillow`、`qt5base`、`qt5svg` 等源码包,通常是网络较慢,不一定是编译卡死。可以观察对应的临时下载文件大小是否仍在增长。
|
||||
|
||||
如果首次构建在 `qt5svg` 或 `qt5base` 附近失败,可以先重新执行:
|
||||
|
||||
```shell
|
||||
build_all
|
||||
```
|
||||
|
||||
## 2. 构建 NanoKVM APP
|
||||
|
||||
### 2.1 拉取源码
|
||||
|
||||
```shell
|
||||
cd "$WORKDIR"
|
||||
git clone https://github.com/sipeed/NanoKVM.git --depth=1
|
||||
cd "$APP_DIR"
|
||||
```
|
||||
|
||||
这里的 `kvmapp` 是 NanoKVM 设备上的应用目录,不是完整烧录镜像。完整系统镜像还需要依赖前面编译出的 `LicheeRV-Nano Linux` 镜像。
|
||||
|
||||
`NanoKVM` 仓库的主要目录如下:
|
||||
|
||||
```text
|
||||
NanoKVM/
|
||||
├── server/ # Go 后端服务
|
||||
├── web/ # 前端页面
|
||||
├── support/sg2002/ # kvm_system 等硬件辅助组件
|
||||
├── kvmapp/ # 本地应用包目录
|
||||
└── Makefile # Docker builder 编译入口
|
||||
```
|
||||
|
||||
最终 `kvmapp` 中至少需要这些关键内容:
|
||||
|
||||
```text
|
||||
kvmapp/server/NanoKVM-Server
|
||||
kvmapp/server/dl_lib/
|
||||
kvmapp/server/web/
|
||||
kvmapp/kvm_system/kvm_system
|
||||
kvmapp/kvm_system/kvm_stream
|
||||
kvmapp/system/init.d/S95nanokvm
|
||||
```
|
||||
|
||||
需要编译或更新的组件主要是:
|
||||
|
||||
- `server/`:Go 后端,生成 `NanoKVM-Server`。
|
||||
- `web/`:前端页面,生成 `dist/` 后放入 `kvmapp/server/web/`。
|
||||
- `support/sg2002/kvm_system`:硬件辅助进程,生成 `kvm_system`。
|
||||
|
||||
通常不需要单独编译的内容:
|
||||
|
||||
- `kvmapp/system/init.d/`:启动脚本,直接复制。
|
||||
- `kvmapp/picoclaw/`:运行时配置和技能文件,`picoclaw` 二进制由设备侧安装或下载逻辑处理。
|
||||
- `kvmapp/jpg_stream/`:旧版本升级兼容文件,保留即可。
|
||||
- `tools/logo_generator/`:Python 辅助脚本,不参与 `kvmapp` 主流程编译。
|
||||
|
||||
按需编译的内容:
|
||||
|
||||
- `support/sg2002/kvm_vision`:只有修改图像采集或编码动态库时才需要重新编译。
|
||||
- `tools/nanokvm_update_edid`:EDID 更新工具。如果后续从 SDK 镜像挂载目录里的 `mnt/system/tool/` 补齐,可以不重新编译。
|
||||
|
||||
### 2.2 准备 Go 环境
|
||||
|
||||
`server/` 是 Go 后端项目,编译 `NanoKVM-Server` 需要本机安装 Go。项目 `server/go.mod` 使用:
|
||||
|
||||
```go
|
||||
go 1.24.0
|
||||
```
|
||||
|
||||
先检查当前电脑是否已经有 Go:
|
||||
|
||||
```shell
|
||||
which go
|
||||
go version
|
||||
```
|
||||
|
||||
期望 Go 版本为 `1.24.0` 或更高,例如:
|
||||
|
||||
```text
|
||||
/usr/local/go/bin/go
|
||||
go version go1.24.0 linux/amd64
|
||||
```
|
||||
|
||||
如果提示 `go: command not found`,或者版本低于 `1.24.0`,可以安装官方 Go:
|
||||
|
||||
```shell
|
||||
cd /tmp
|
||||
wget https://go.dev/dl/go1.24.0.linux-amd64.tar.gz
|
||||
sudo rm -rf /usr/local/go
|
||||
sudo tar -C /usr/local -xzf go1.24.0.linux-amd64.tar.gz
|
||||
|
||||
echo 'export PATH=/usr/local/go/bin:$PATH' >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
hash -r
|
||||
|
||||
which go
|
||||
go version
|
||||
```
|
||||
|
||||
如果 `which go` 指向 `/usr/bin/go`,或者执行 `go mod tidy` 时出现:
|
||||
|
||||
```text
|
||||
invalid go version '1.24.0': must match format 1.23
|
||||
```
|
||||
|
||||
说明当前 Go 太旧,或者用到了 Ubuntu 自带的 `gccgo`。确认 `/usr/local/go/bin` 已经排在 `PATH` 前面,然后重新执行:
|
||||
|
||||
```shell
|
||||
hash -r
|
||||
go version
|
||||
```
|
||||
|
||||
如果 Go 依赖下载很慢,可以设置代理:
|
||||
|
||||
```shell
|
||||
go env -w GOPROXY=https://goproxy.cn,direct
|
||||
go env -w GOSUMDB=sum.golang.google.cn
|
||||
```
|
||||
|
||||
### 2.3 准备 server 编译依赖
|
||||
|
||||
除了 Go,`server/build.sh` 还需要:
|
||||
|
||||
- `patchelf`
|
||||
- `riscv64-unknown-linux-musl-gcc`
|
||||
|
||||
检查依赖:
|
||||
|
||||
```shell
|
||||
which patchelf
|
||||
which riscv64-unknown-linux-musl-gcc
|
||||
```
|
||||
|
||||
安装 `patchelf`:
|
||||
|
||||
```shell
|
||||
sudo apt update
|
||||
sudo apt install -y patchelf
|
||||
```
|
||||
|
||||
如果 RISC-V 工具链没有加入 `PATH`,可以使用 SDK 里的 `host-tools`:
|
||||
|
||||
```shell
|
||||
export PATH="$SDK_DIR/host-tools/gcc/riscv64-linux-musl-x86_64/bin:$PATH"
|
||||
|
||||
which riscv64-unknown-linux-musl-gcc
|
||||
riscv64-unknown-linux-musl-gcc -v
|
||||
```
|
||||
|
||||
### 2.4 编译后端 server
|
||||
|
||||
推荐使用仓库里的脚本,因为它会自动设置 `RPATH`:
|
||||
|
||||
```shell
|
||||
cd "$APP_DIR/server"
|
||||
go mod tidy
|
||||
./build.sh
|
||||
```
|
||||
|
||||
成功后生成:
|
||||
|
||||
```text
|
||||
server/NanoKVM-Server
|
||||
```
|
||||
|
||||
确认架构和 `RPATH`:
|
||||
|
||||
```shell
|
||||
file NanoKVM-Server
|
||||
patchelf --print-rpath NanoKVM-Server
|
||||
```
|
||||
|
||||
期望输出包含:
|
||||
|
||||
```text
|
||||
ELF 64-bit ... RISC-V ...
|
||||
$ORIGIN/dl_lib
|
||||
```
|
||||
|
||||
如果看到类似警告:
|
||||
|
||||
```text
|
||||
warning: libopencv_video.so.409, needed by .../libkvm.so, not found
|
||||
```
|
||||
|
||||
但同时看到:
|
||||
|
||||
```text
|
||||
[SUCCESS] Binary 'NanoKVM-Server' created successfully.
|
||||
[DONE] Build script completed successfully!
|
||||
```
|
||||
|
||||
说明 `server` 已经编译成功。这个警告表示本机交叉链接时没有找到某个运行时库,后续需要确认设备或 `kvmapp/server/dl_lib` 中有对应库。
|
||||
|
||||
把后端放入本地 `kvmapp`:
|
||||
|
||||
```shell
|
||||
cd "$APP_DIR"
|
||||
mkdir -p kvmapp/server
|
||||
cp server/NanoKVM-Server kvmapp/server/NanoKVM-Server
|
||||
cp -a server/dl_lib kvmapp/server/
|
||||
```
|
||||
|
||||
### 2.5 编译前端 web
|
||||
|
||||
进入前端目录:
|
||||
|
||||
```shell
|
||||
cd "$APP_DIR/web"
|
||||
pnpm install
|
||||
pnpm build
|
||||
```
|
||||
|
||||
如果执行 `pnpm install` 时报错:
|
||||
|
||||
```text
|
||||
ERROR packages field missing or empty
|
||||
```
|
||||
|
||||
说明当前 `pnpm` 版本识别到了 `web/pnpm-workspace.yaml`,但这个文件里缺少 `packages` 字段。可以给 `pnpm-workspace.yaml` 补上当前目录作为 workspace 包:
|
||||
|
||||
```yaml
|
||||
packages:
|
||||
- "."
|
||||
|
||||
allowBuilds:
|
||||
bufferutil: true
|
||||
es5-ext: true
|
||||
esbuild: true
|
||||
msw: true
|
||||
utf-8-validate: true
|
||||
```
|
||||
|
||||
修改后重新执行:
|
||||
|
||||
```shell
|
||||
pnpm install
|
||||
pnpm build
|
||||
```
|
||||
|
||||
成功后生成:
|
||||
|
||||
```text
|
||||
web/dist
|
||||
```
|
||||
|
||||
放入本地 `kvmapp`:
|
||||
|
||||
```shell
|
||||
cd "$APP_DIR/web"
|
||||
rm -rf "$APP_DIR/kvmapp/server/web"
|
||||
mkdir -p "$APP_DIR/kvmapp/server"
|
||||
cp -a dist "$APP_DIR/kvmapp/server/web"
|
||||
```
|
||||
|
||||
检查前端文件:
|
||||
|
||||
```shell
|
||||
ls "$APP_DIR/kvmapp/server/web"
|
||||
ls "$APP_DIR/kvmapp/server/web/assets"
|
||||
```
|
||||
|
||||
应包含:
|
||||
|
||||
```text
|
||||
index.html
|
||||
assets/
|
||||
sipeed.ico
|
||||
```
|
||||
|
||||
### 2.6 编译 support 组件
|
||||
|
||||
仓库顶层 `Makefile` 使用 Docker builder 编译 support 组件,需要 Docker 已安装并运行。
|
||||
|
||||
检查 Docker:
|
||||
|
||||
```shell
|
||||
docker --version
|
||||
```
|
||||
|
||||
构建 builder 镜像:
|
||||
|
||||
```shell
|
||||
cd "$APP_DIR"
|
||||
make builder-image
|
||||
```
|
||||
|
||||
编译 support:
|
||||
|
||||
```shell
|
||||
make support
|
||||
```
|
||||
|
||||
`make support` 会在 Docker 中使用 `MaixCDK` 编译 `support/sg2002/kvm_system`,并执行:
|
||||
|
||||
```text
|
||||
./build kvm_system
|
||||
./build kvm_system add_to_kvmapp
|
||||
```
|
||||
|
||||
生成或更新:
|
||||
|
||||
```text
|
||||
kvmapp/kvm_system/kvm_system
|
||||
```
|
||||
|
||||
如果修改过图像采集或编码相关动态库,可以按需编译 `kvm_vision`:
|
||||
|
||||
```shell
|
||||
cd "$APP_DIR/support/sg2002"
|
||||
./build kvm_vision
|
||||
./build kvm_vision add_to_kvmapp
|
||||
```
|
||||
|
||||
这会把 `kvm_vision_test/dist/kvm_vision_test_release/dl_lib/` 更新到 `kvmapp/server/dl_lib/`。没有修改这部分时,通常直接使用仓库或镜像中已有的 `dl_lib/` 即可。
|
||||
|
||||
注意:顶层 `make all` 等于:
|
||||
|
||||
```text
|
||||
make app
|
||||
make support
|
||||
```
|
||||
|
||||
但是 `make all` 不会编译前端 `web`,并且 `make app` 没有执行 `patchelf --add-rpath '$ORIGIN/dl_lib'`。因此 `server` 更推荐使用 `server/build.sh` 编译。
|
||||
|
||||
### 2.7 可选:编译 EDID 更新工具
|
||||
|
||||
如果不从 SDK 镜像挂载目录里的 `mnt/system/tool/` 复制 EDID 工具,可以手动编译:
|
||||
|
||||
```shell
|
||||
cd "$APP_DIR/tools/nanokvm_update_edid"
|
||||
make
|
||||
|
||||
cd "$APP_DIR"
|
||||
mkdir -p kvmapp/system/tool
|
||||
cp tools/nanokvm_update_edid/nanokvm_update_edid kvmapp/system/tool/
|
||||
cp tools/nanokvm_update_edid/E21_NanoKVM.bin kvmapp/system/tool/
|
||||
```
|
||||
|
||||
如果板子烧录的是当前 SDK 编译出的镜像,更推荐后续从 `mountpoint` 补齐,避免工具版本和镜像不一致。
|
||||
|
||||
### 2.8 补充 version 文件
|
||||
|
||||
在 `kvmapp` 目录中写入应用版本号:
|
||||
|
||||
```shell
|
||||
cd "$APP_DIR/kvmapp"
|
||||
echo 2.4.3 > version
|
||||
```
|
||||
|
||||
### 2.9 检查 kvmapp 文件
|
||||
|
||||
构建完后的 `kvmapp` 目录应该包含以下关键文件。不同版本的文件数量可能略有差异,但这些核心路径应当存在:
|
||||
|
||||
```text
|
||||
kvmapp
|
||||
├── jpg_stream
|
||||
│ ├── S95nanokvm
|
||||
│ └── jpg_stream
|
||||
├── kvm_new_app
|
||||
├── kvm_system
|
||||
│ ├── kvm_stream
|
||||
│ └── kvm_system
|
||||
├── picoclaw
|
||||
│ ├── AGENT.md
|
||||
│ ├── AGENT_KVM.md
|
||||
│ └── skills
|
||||
│ └── kvm-control
|
||||
├── server
|
||||
│ ├── NanoKVM-Server
|
||||
│ ├── dl_lib
|
||||
│ └── web
|
||||
│ ├── assets
|
||||
│ ├── index.html
|
||||
│ ├── mockServiceWorker.js
|
||||
│ └── sipeed.ico
|
||||
├── system
|
||||
│ ├── init.d
|
||||
│ │ ├── S00kmod
|
||||
│ │ ├── S01fs
|
||||
│ │ ├── S03usbdev
|
||||
│ │ ├── S03usbhid
|
||||
│ │ ├── S15kvmhwd
|
||||
│ │ ├── S30eth
|
||||
│ │ ├── S30wifi
|
||||
│ │ ├── S50avahi-daemon
|
||||
│ │ ├── S50ssdpd
|
||||
│ │ ├── S50sshd
|
||||
│ │ ├── S80dnsmasq
|
||||
│ │ ├── S95nanokvm
|
||||
│ │ ├── S96picoclaw
|
||||
│ │ └── S98tailscaled
|
||||
│ ├── ko
|
||||
│ │ └── soph_mipi_rx.ko
|
||||
│ └── update-nanokvm.py
|
||||
└── version
|
||||
```
|
||||
|
||||
可以用下面的命令快速检查关键文件:
|
||||
|
||||
```shell
|
||||
test -x "$APP_DIR/kvmapp/server/NanoKVM-Server"
|
||||
test -d "$APP_DIR/kvmapp/server/dl_lib"
|
||||
test -f "$APP_DIR/kvmapp/server/web/index.html"
|
||||
test -x "$APP_DIR/kvmapp/kvm_system/kvm_system"
|
||||
test -f "$APP_DIR/kvmapp/system/init.d/S95nanokvm"
|
||||
test -f "$APP_DIR/kvmapp/version"
|
||||
```
|
||||
|
||||
## 3. 合并系统镜像和 NanoKVM APP
|
||||
|
||||
SDK 的 `kvm/merge_nanokvm_app.sh` 脚本可以自动完成合并流程,包括:
|
||||
|
||||
- 从 `NanoKVM/kvmapp` 复制应用文件到 SDK 的 `kvm/kvmapp`。
|
||||
- 自动选择最新生成的原始 `.img`,或者使用你手动指定的镜像。
|
||||
- 默认复制出一个新的 `*-nanokvm.img`,只修改这个输出镜像,不原地修改原始镜像。
|
||||
- 挂载镜像的 ext4 分区。
|
||||
- 写入 `kvmapp`、内核模块、启动脚本、默认数据和默认 KVM 配置;普通镜像还会写入 `frpc`、`tailscale` 和 `tailscaled`。
|
||||
- 每个关键步骤后检查挂载状态或目标文件,并校验第二分区之前的 boot 区域没有变化;失败时打印具体失败步骤并终止。
|
||||
- 写入完成后自动卸载镜像。
|
||||
|
||||
### 3.1 默认用法
|
||||
|
||||
确认目录结构符合本文约定:
|
||||
|
||||
```text
|
||||
~/LicheeRV_NanoKVM/
|
||||
├── LicheeRV-Nano-Build/
|
||||
└── NanoKVM/
|
||||
```
|
||||
|
||||
然后进入 SDK 目录执行:
|
||||
|
||||
```shell
|
||||
cd "$SDK_DIR"
|
||||
./kvm/merge_nanokvm_app.sh
|
||||
```
|
||||
|
||||
默认情况下,脚本会:
|
||||
|
||||
- 从 `"$APP_DIR/kvmapp"` 复制应用文件。
|
||||
- 使用 `"$SDK_DIR/install/soc_sg2002_licheervnano_sd/images/"` 中最新的原始 `.img`。
|
||||
- 生成同目录下的 `*-nanokvm.img` 作为输出镜像。
|
||||
- 使用 `"$SDK_DIR/mountpoint"` 作为临时挂载目录。
|
||||
|
||||
执行完成后,终端会打印已经写入 NanoKVM APP 的镜像路径,例如:
|
||||
|
||||
```text
|
||||
NanoKVM APP has been merged into:
|
||||
/home/xxx/LicheeRV_NanoKVM/LicheeRV-Nano-Build/install/soc_sg2002_licheervnano_sd/images/xxx-nanokvm.img
|
||||
```
|
||||
|
||||
把这个 `.img` 烧录到 SD 卡即可。
|
||||
|
||||
### 3.2 指定镜像文件
|
||||
|
||||
如果你不想使用最新镜像,可以用 `-i` 指定某一个 `.img`:
|
||||
|
||||
```shell
|
||||
cd "$SDK_DIR"
|
||||
./kvm/merge_nanokvm_app.sh -i install/soc_sg2002_licheervnano_sd/images/your-image-name.img
|
||||
```
|
||||
|
||||
脚本默认会生成 `your-image-name-nanokvm.img`。如果想指定输出路径,可以使用 `-o`:
|
||||
|
||||
```shell
|
||||
./kvm/merge_nanokvm_app.sh \
|
||||
-i install/soc_sg2002_licheervnano_sd/images/your-image-name.img \
|
||||
-o install/soc_sg2002_licheervnano_sd/images/your-output-name.img
|
||||
```
|
||||
|
||||
如果输出镜像已经存在,需要加 `-f` 覆盖:
|
||||
|
||||
```shell
|
||||
./kvm/merge_nanokvm_app.sh -i your-image-name.img -o your-output-name.img -f
|
||||
```
|
||||
|
||||
也可以使用绝对路径:
|
||||
|
||||
```shell
|
||||
./kvm/merge_nanokvm_app.sh -i "$SDK_DIR/install/soc_sg2002_licheervnano_sd/images/your-image-name.img"
|
||||
```
|
||||
|
||||
### 3.3 指定 NanoKVM 源码目录
|
||||
|
||||
如果 `NanoKVM` 源码没有放在 `~/LicheeRV_NanoKVM/NanoKVM`,可以用 `-a` 指定:
|
||||
|
||||
```shell
|
||||
cd "$SDK_DIR"
|
||||
./kvm/merge_nanokvm_app.sh -a /path/to/NanoKVM
|
||||
```
|
||||
|
||||
不过为了减少路径错误,仍然推荐按本文约定放置源码。
|
||||
|
||||
### 3.4 使用已有的 SDK kvm/kvmapp
|
||||
|
||||
如果你已经手动准备好了 `"$SDK_DIR/kvm/kvmapp"`,不想让脚本重新从 `NanoKVM/kvmapp` 覆盖它,可以加 `--skip-copy-kvmapp`:
|
||||
|
||||
```shell
|
||||
cd "$SDK_DIR"
|
||||
./kvm/merge_nanokvm_app.sh --skip-copy-kvmapp
|
||||
```
|
||||
|
||||
这种方式会直接使用现有的 `kvm/kvmapp` 写入镜像。
|
||||
|
||||
### 3.5 查看脚本帮助
|
||||
|
||||
脚本支持的参数可以通过 `--help` 查看:
|
||||
|
||||
```shell
|
||||
cd "$SDK_DIR"
|
||||
./kvm/merge_nanokvm_app.sh --help
|
||||
```
|
||||
|
||||
### 3.6 注意事项
|
||||
|
||||
- 执行脚本前,先确保第 1 节的系统镜像已经编译完成。
|
||||
- 执行脚本前,先确保第 2 节的 `NanoKVM/kvmapp` 已经准备完整。
|
||||
- 脚本会覆盖 SDK 目录下的 `kvm/kvmapp`,除非使用 `--skip-copy-kvmapp`。
|
||||
- 脚本不会原地修改输入 `.img`,而是生成新的输出镜像;烧录时请使用脚本最后打印的 `*-nanokvm.img`。
|
||||
- 如果脚本提示 `mountpoint` 目录已经挂载,先执行 `umount "$SDK_DIR/mountpoint"` 后再重试。
|
||||
|
||||
@@ -543,6 +543,10 @@ br-rootfs-prepare:export CROSS_COMPILE_SDK=$(patsubst "%",%,$(CONFIG_CROSS_COMPI
|
||||
br-rootfs-prepare:
|
||||
$(call print_target)
|
||||
# copy ko and mmf libs
|
||||
${Q}rm -rf $(BR_OVERLAY_DIR)
|
||||
${Q}mkdir -p $(BR_OVERLAY_DIR)
|
||||
${Q}cp -a $(BR_BASE_OVERLAY_DIR)/. $(BR_OVERLAY_DIR)/
|
||||
${Q}rm -rf $(BR_OVERLAY_DIR)/mnt/system
|
||||
${Q}mkdir -p $(BR_OVERLAY_DIR)/mnt/system
|
||||
${Q}cp -arf ${SYSTEM_OUT_DIR}/* $(BR_OVERLAY_DIR)/mnt/system/
|
||||
# strip
|
||||
@@ -550,16 +554,16 @@ br-rootfs-prepare:
|
||||
${Q}find $(BR_OVERLAY_DIR) -name "*.so*" -type f -printf 'striping %p\n' -exec $(CROSS_COMPILE_KERNEL)strip --strip-all {} \;
|
||||
${Q}find $(BR_OVERLAY_DIR) -executable -type f ! -name "*.sh" ! -path "*etc*" ! -path "*.ko" -printf 'striping %p\n' -exec $(CROSS_COMPILE_SDK)strip --strip-all {} 2>/dev/null \;
|
||||
|
||||
br-rootfs-pack:export TARGET_OUTPUT_DIR=$(BR_DIR)/output/$(BR_BOARD)
|
||||
br-rootfs-pack:export TARGET_OUTPUT_DIR=$(BR_OUTPUT_DIR)
|
||||
br-rootfs-pack:
|
||||
$(call print_target)
|
||||
${Q}$(MAKE) -C $(BR_DIR) $(BR_DEFCONFIG) BR2_TOOLCHAIN_EXTERNAL_PATH=$(CROSS_COMPILE_PATH)
|
||||
${Q}$(MAKE) -j${NPROC} -C $(BR_DIR) source
|
||||
${Q}$(MAKE) -j${NPROC} -C $(BR_DIR)
|
||||
${Q}$(MAKE) -C $(BR_DIR) O=$(TARGET_OUTPUT_DIR) $(BR_DEFCONFIG) BR2_DEFCONFIG=$(BR2_DEFCONFIG) BR2_ROOTFS_OVERLAY=$(BR_OVERLAY_DIR) BR2_TOOLCHAIN_EXTERNAL_PATH=$(CROSS_COMPILE_PATH)
|
||||
${Q}$(MAKE) -j${NPROC} -C $(BR_DIR) O=$(TARGET_OUTPUT_DIR) BR2_ROOTFS_OVERLAY=$(BR_OVERLAY_DIR) source
|
||||
${Q}$(MAKE) -j${NPROC} -C $(BR_DIR) O=$(TARGET_OUTPUT_DIR) BR2_ROOTFS_OVERLAY=$(BR_OVERLAY_DIR)
|
||||
# ${Q}rm -rf $(BR_ROOTFS_DIR)/*
|
||||
# copy rootfs to rawimg dir
|
||||
${Q}cp $(BR_DIR)/output/images/rootfs.ext4 $(OUTPUT_DIR)/rawimages/rootfs.$(STORAGE_TYPE)
|
||||
${Q}tar zcvf $(OUTPUT_DIR)/licheervnano-drivers.tar.gz $(BR_DIR)/output/target/mnt
|
||||
${Q}cp $(TARGET_OUTPUT_DIR)/images/rootfs.ext4 $(OUTPUT_DIR)/rawimages/rootfs.$(STORAGE_TYPE)
|
||||
${Q}tar zcvf $(OUTPUT_DIR)/licheervnano-drivers.tar.gz $(TARGET_OUTPUT_DIR)/target/mnt
|
||||
$(call raw2cimg ,rootfs.$(STORAGE_TYPE))
|
||||
|
||||
ifeq ($(CONFIG_BUILDROOT_FS),y)
|
||||
|
||||
@@ -173,6 +173,7 @@
|
||||
/delete-property/ mute-gpio-r;
|
||||
};
|
||||
|
||||
#if (CVIMMAP_FRAMEBUFFER_SIZE > 0)
|
||||
&fb_reserved {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -180,6 +181,7 @@
|
||||
&cvi_fb {
|
||||
status = "okay";
|
||||
};
|
||||
#endif
|
||||
|
||||
&mipi_rx {
|
||||
snsr-reset = <&porte 1 GPIO_ACTIVE_LOW>;
|
||||
|
||||
@@ -42,7 +42,7 @@ CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
# CONFIG_INET_DIAG is not set
|
||||
# CONFIG_IPV6 is not set
|
||||
CONFIG_IPV6=y
|
||||
CONFIG_CFG80211=m
|
||||
CONFIG_RFKILL=y
|
||||
CONFIG_UEVENT_HELPER=y
|
||||
|
||||
@@ -40,7 +40,7 @@ class MemoryMap:
|
||||
# =================
|
||||
# Multimedia buffer. Used by u-boot/kernel/FreeRTOS
|
||||
# =================
|
||||
ION_SIZE = 105 * SIZE_1M
|
||||
ION_SIZE = 75 * SIZE_1M
|
||||
H26X_BITSTREAM_SIZE = 2 * SIZE_1M
|
||||
H26X_ENC_BUFF_SIZE = 0
|
||||
ISP_MEM_BASE_SIZE = 20 * SIZE_1M
|
||||
@@ -56,9 +56,9 @@ class MemoryMap:
|
||||
|
||||
assert ISP_MEM_BASE_ADDR + ISP_MEM_BASE_SIZE <= ION_ADDR + ION_SIZE
|
||||
|
||||
# Boot logo is after the ION buffer
|
||||
# Framebuffer uses boot logo's reserved memory
|
||||
BOOTLOGO_SIZE = 8000 * SIZE_1K
|
||||
# NanoKVM has no display output, so do not reserve framebuffer/bootlogo
|
||||
# memory. Keeping this at zero returns the region to Linux.
|
||||
BOOTLOGO_SIZE = 0
|
||||
BOOTLOGO_ADDR = ION_ADDR - BOOTLOGO_SIZE
|
||||
FRAMEBUFFER_SIZE = BOOTLOGO_SIZE
|
||||
FRAMEBUFFER_ADDR = BOOTLOGO_ADDR
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<physical_partition type="sd">
|
||||
<partition label="BOOT" size_in_kb="80960" readonly="false" file="boot.sd"/>
|
||||
<partition label="ROOTFS" size_in_kb="1572864" readonly="false" file="rootfs.sd" />
|
||||
<partition label="ROOTFS" size_in_kb="1581056" readonly="false" file="rootfs.sd" />
|
||||
</physical_partition>
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
BR2_riscv=y
|
||||
BR2_RISCV_ISA_RVC=y
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="riscv64-unknown-linux-musl"
|
||||
BR2_TOOLCHAIN_EXTERNAL_GCC_10=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_10=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CXX=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_OPENMP=y
|
||||
BR2_TARGET_LDFLAGS="-mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d"
|
||||
BR2_CCACHE=y
|
||||
BR2_OPTIMIZE_S=y
|
||||
BR2_REPRODUCIBLE=y
|
||||
BR2_PER_PACKAGE_DIRECTORIES=y
|
||||
BR2_TARGET_GENERIC_HOSTNAME="licheervnano"
|
||||
BR2_TARGET_GENERIC_ISSUE="Welcome to NanoKVM"
|
||||
BR2_INIT_SYSV=y
|
||||
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
|
||||
# The fixed NanoKVM device set does not need the full udev hardware database.
|
||||
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
|
||||
BR2_ROOTFS_MERGED_USR=y
|
||||
BR2_TARGET_ENABLE_ROOT_LOGIN=y
|
||||
BR2_TARGET_GENERIC_ROOT_PASSWD="root"
|
||||
BR2_ENABLE_LOCALE_WHITELIST="C en_US en_US.utf8"
|
||||
BR2_ROOTFS_OVERLAY="$(TOPDIR)/board/cvitek/SG200X/overlay"
|
||||
BR2_ROOTFS_POST_BUILD_SCRIPT="$(TOPDIR)/../build/boards/sg200x/sg2002_licheervnano_sd_minimal/post-build.sh"
|
||||
BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="$(TOPDIR)/board/cvitek/SG200X/busybox-extra.config"
|
||||
|
||||
# Filesystem management used by first-boot expansion and virtual media.
|
||||
BR2_PACKAGE_E2FSPROGS=y
|
||||
BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y
|
||||
BR2_PACKAGE_EXFATPROGS=y
|
||||
BR2_PACKAGE_PARTED=y
|
||||
|
||||
# NanoKVM runtime and network services.
|
||||
BR2_PACKAGE_AVAHI=y
|
||||
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
|
||||
BR2_PACKAGE_AVAHI_DAEMON=y
|
||||
BR2_PACKAGE_BASH=y
|
||||
BR2_PACKAGE_CA_CERTIFICATES=y
|
||||
BR2_PACKAGE_LIBCURL=y
|
||||
BR2_PACKAGE_LIBCURL_CURL=y
|
||||
BR2_PACKAGE_ETHTOOL=y
|
||||
BR2_PACKAGE_HOSTAPD=y
|
||||
BR2_PACKAGE_HOSTAPD_WPA3=y
|
||||
BR2_PACKAGE_IPROUTE2=y
|
||||
BR2_PACKAGE_IPTABLES=y
|
||||
BR2_PACKAGE_IPUTILS=y
|
||||
BR2_PACKAGE_IW=y
|
||||
BR2_PACKAGE_NTP=y
|
||||
BR2_PACKAGE_NTP_NTPD=y
|
||||
BR2_PACKAGE_NTP_NTPDATE=y
|
||||
BR2_PACKAGE_OPENSSH=y
|
||||
# BR2_PACKAGE_OPENSSH_CLIENT is not set
|
||||
BR2_PACKAGE_OPENSSH_SERVER=y
|
||||
BR2_PACKAGE_OPENSSH_KEY_UTILS=y
|
||||
# Python is intentionally excluded from the minimal image.
|
||||
# BR2_PACKAGE_PYTHON3 is not set
|
||||
BR2_PACKAGE_WIRELESS_REGDB=y
|
||||
BR2_PACKAGE_WIRELESS_TOOLS=y
|
||||
BR2_PACKAGE_WIRELESS_TOOLS_LIB=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_WEXT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_WPA3=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
|
||||
BR2_PACKAGE_UTIL_LINUX_RFKILL=y
|
||||
|
||||
# Board runtime, Wi-Fi firmware and video codec firmware.
|
||||
BR2_PACKAGE_AIC8800_SDIO_FIRMWARE=y
|
||||
BR2_PACKAGE_CVITEK_RISCV64_MUSL_SYSROOT=y
|
||||
BR2_PACKAGE_SG2002_CODEC_FIRMWARE=y
|
||||
BR2_TARGET_ROOTFS_EXT2=y
|
||||
BR2_TARGET_ROOTFS_EXT2_4=y
|
||||
BR2_TARGET_ROOTFS_EXT2_SIZE="112M"
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ddr_cfg_list": [
|
||||
"",
|
||||
"ddr3_1866_x16",
|
||||
"ddr3_2133_x16",
|
||||
"ddr_auto_x16"
|
||||
],
|
||||
"board_information": "NanoKVM, C906B + DDR 256MB"
|
||||
}
|
||||
@@ -0,0 +1,272 @@
|
||||
/dts-v1/;
|
||||
#include "soph_base_riscv.dtsi"
|
||||
#include "soph_asic_qfn.dtsi"
|
||||
#include "soph_asic_sd.dtsi"
|
||||
#include "soph_default_memmap.dtsi"
|
||||
|
||||
#include <dt-bindings/input/linux-event-codes.h>
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
|
||||
&i2c0 {
|
||||
status = "okay";
|
||||
/delete-property/ scl-pinmux;
|
||||
/delete-property/ sda-pinmux;
|
||||
/delete-property/ scl-gpios;
|
||||
/delete-property/ sda-gpios;
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
status = "okay";
|
||||
/delete-property/ scl-pinmux;
|
||||
/delete-property/ sda-pinmux;
|
||||
/delete-property/ scl-gpios;
|
||||
/delete-property/ sda-gpios;
|
||||
};
|
||||
|
||||
&sd {
|
||||
min-frequency = <400000>; // 400Khz
|
||||
//max-frequency = <50000000>; // 50Mhz
|
||||
max-frequency = <25000000>; // 25Mhz
|
||||
//max-frequency = <10000000>; // 10Mhz
|
||||
//max-frequency = <5000000>; // 5Mhz
|
||||
};
|
||||
|
||||
&cvi_vo {
|
||||
#ifndef __UBOOT__
|
||||
/delete-property/ reset-gpio;
|
||||
/delete-property/ pwm-gpio;
|
||||
#else
|
||||
// for uboot
|
||||
reset-gpio = <&porte 0 1>;
|
||||
pwm-gpio = <&porte 2 1>;
|
||||
#endif
|
||||
/delete-property/ power-ct-gpio;
|
||||
|
||||
};
|
||||
|
||||
&mipi_tx {
|
||||
#ifndef __UBOOT__
|
||||
// for linux kernel
|
||||
reset-gpio = <&porte 0 1>;
|
||||
pwm-gpio = <&porte 2 1>;
|
||||
#else
|
||||
/delete-property/ reset-gpio;
|
||||
/delete-property/ pwm-gpio;
|
||||
#endif
|
||||
/delete-property/ power-ct-gpio;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
clocks = <&clk CV181X_CLK_UART0>;
|
||||
/delete-property/ clock-frequency;
|
||||
};
|
||||
|
||||
&uart1 {
|
||||
clocks = <&clk CV181X_CLK_UART1>;
|
||||
/delete-property/ clock-frequency;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart2 {
|
||||
clocks = <&clk CV181X_CLK_UART2>;
|
||||
/delete-property/ clock-frequency;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart3 {
|
||||
clocks = <&clk CV181X_CLK_UART3>;
|
||||
/delete-property/ clock-frequency;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pwm0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pwm1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pwm2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c2 {
|
||||
status = "disabled";
|
||||
/delete-property/ scl-pinmux;
|
||||
/delete-property/ sda-pinmux;
|
||||
/delete-property/ scl-gpios;
|
||||
/delete-property/ sda-gpios;
|
||||
};
|
||||
|
||||
&i2c3 {
|
||||
status = "okay";
|
||||
/delete-property/ scl-pinmux;
|
||||
/delete-property/ sda-pinmux;
|
||||
/delete-property/ scl-gpios;
|
||||
/delete-property/ sda-gpios;
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
status = "okay";
|
||||
gt9xx: gt9xx@14 {
|
||||
compatible = "goodix,gt9xx";
|
||||
reg = <0x14>;
|
||||
goodix,irq-gpio = <&porte 3 0>;
|
||||
goodix,rst-gpio = <&porte 4 0>;
|
||||
status = "okay";
|
||||
};
|
||||
hynitron: hynitron@5a {
|
||||
compatible = "hynitron,hyn_ts", "hyn,7xx";
|
||||
reg = <0x5a>;
|
||||
irq-gpio = <&porte 3 0>;
|
||||
hynitron,irq-gpio = <&porte 3 0>;
|
||||
reset-gpio = <&porte 4 0>;
|
||||
hynitron,reset-gpio = <&porte 4 0>;
|
||||
max-touch-number = <5>;
|
||||
hynitron,max-touch-number = <5>;
|
||||
display-coords = <0 0 480 640>;
|
||||
hynitron,display-coords = <368 552>;
|
||||
pos-swap = <0>;
|
||||
posx-reverse = <1>;
|
||||
posy-reverse = <1>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
status = "okay";
|
||||
|
||||
// /delete-node/ spidev@0;
|
||||
st7789: st7789@0{
|
||||
compatible = "sitronix,st7789";
|
||||
reg = <0>;
|
||||
status = "disabled";
|
||||
spi-max-frequency = <80000000>;
|
||||
spi-cpol;
|
||||
spi-cpha;
|
||||
rotate = <0>;
|
||||
fps = <60>;
|
||||
rgb;
|
||||
buswidth = <8>;
|
||||
dc = <&porte 20 GPIO_ACTIVE_HIGH>;
|
||||
reset = <&porta 14 GPIO_ACTIVE_LOW>;
|
||||
debug = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
&spi3 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&dac {
|
||||
status = "okay";
|
||||
/delete-property/ mute-gpio-r;
|
||||
};
|
||||
|
||||
&fb_reserved {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&cvi_fb {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mipi_rx {
|
||||
snsr-reset = <&porte 1 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
/ {
|
||||
model = "LicheeRv Nano";
|
||||
|
||||
spi4: spi4@gpio {
|
||||
compatible = "spi-gpio";
|
||||
sck-gpio = <&porta 22 0>;
|
||||
miso-gpio = <&porta 23 0>;
|
||||
mosi-gpio = <&porta 25 0>;
|
||||
cs-gpio = <&porta 24 GPIO_ACTIVE_LOW>;
|
||||
num-chipselects = <1>;
|
||||
status = "okay";
|
||||
|
||||
spidev@0 {
|
||||
compatible = "spidev";
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
i2c5: i2c5@gpio {
|
||||
compatible = "i2c-gpio";
|
||||
scl-gpios = <&porta 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
sda-gpios = <&porta 27 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
i2c-gpio,delay-us = <5>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
key-user {
|
||||
label = "User Key";
|
||||
linux,code = <KEY_DISPLAYTOGGLE>;
|
||||
debounce-interval = <1>;
|
||||
gpios = <&porta 30 1>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led-user {
|
||||
gpios = <&porta 14 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "activity";
|
||||
};
|
||||
};
|
||||
|
||||
// buggy pwm driver, not working, please use userspace pwm api
|
||||
/*
|
||||
lcd0_backlight: pwm-backlight@0 {
|
||||
compatible = "pwm-backlight";
|
||||
pwm-names = "backlight";
|
||||
pwms = <&pwm2 2 50000000>; // 20Khz
|
||||
brightness-levels = <0 2 4 8 16 32 64 128 255>;
|
||||
default-brightness-level = <4>;
|
||||
};
|
||||
*/
|
||||
|
||||
wifisd:wifi-sd@4320000 {
|
||||
compatible = "cvitek,cv181x-sdio";
|
||||
bus-width = <4>;
|
||||
reg = <0x0 0x4320000 0x0 0x1000>;
|
||||
reg_names = "core_mem";
|
||||
src-frequency = <375000000>;
|
||||
min-frequency = <400000>; // 400Khz
|
||||
//max-frequency = <50000000>; // 50Mhz
|
||||
//max-frequency = <45000000>; // 45Mhz
|
||||
//max-frequency = <40000000>; // 40Mhz
|
||||
//max-frequency = <35000000>; // 35Mhz
|
||||
//max-frequency = <30000000>; // 30Mhz
|
||||
max-frequency = <25000000>; // 25Mhz
|
||||
//max-frequency = <20000000>; // 20Mhz
|
||||
//max-frequency = <15000000>; // 15Mhz
|
||||
//max-frequency = <10000000>; // 10Mhz
|
||||
//max-frequency = <5000000>; // 5Mhz
|
||||
64_addressing;
|
||||
reset_tx_rx_phy;
|
||||
non-removable;
|
||||
pll_index = <0x7>;
|
||||
pll_reg = <0x300207C>;
|
||||
no-mmc;
|
||||
no-sd;
|
||||
status = "okay";
|
||||
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-parent = <&plic0>;
|
||||
};
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
85
build/boards/sg200x/sg2002_licheervnano_sd_minimal/memmap.py
Executable file
85
build/boards/sg200x/sg2002_licheervnano_sd_minimal/memmap.py
Executable file
@@ -0,0 +1,85 @@
|
||||
SIZE_1M = 0x100000
|
||||
SIZE_1K = 1024
|
||||
|
||||
|
||||
# Only attributes in class MemoryMap are generated to .h
|
||||
class MemoryMap:
|
||||
# No prefix "CVIMMAP_" for the items in _no_prefix[]
|
||||
_no_prefix = [
|
||||
"CONFIG_SYS_TEXT_BASE" # u-boot's CONFIG_SYS_TEXT_BASE is used without CPP.
|
||||
]
|
||||
|
||||
DRAM_BASE = 0x80000000
|
||||
DRAM_SIZE = 256 * SIZE_1M
|
||||
|
||||
# ==============
|
||||
# C906L FreeRTOS
|
||||
# ==============
|
||||
FREERTOS_SIZE = 2 * SIZE_1M
|
||||
# FreeRTOS is at the end of DRAM
|
||||
FREERTOS_ADDR = DRAM_BASE + DRAM_SIZE - FREERTOS_SIZE
|
||||
FSBL_C906L_START_ADDR = FREERTOS_ADDR
|
||||
|
||||
# ==============================
|
||||
# OpenSBI | arm-trusted-firmware
|
||||
# ==============================
|
||||
# Monitor is at the begining of DRAM
|
||||
MONITOR_ADDR = DRAM_BASE
|
||||
|
||||
ATF_SIZE = 512 * SIZE_1K
|
||||
OPENSBI_SIZE = 512 * SIZE_1K
|
||||
OPENSBI_FDT_ADDR = MONITOR_ADDR + OPENSBI_SIZE
|
||||
|
||||
# =========================
|
||||
# memory@DRAM_BASE in .dts.
|
||||
# =========================
|
||||
# Ignore the area of FreeRTOS in u-boot and kernel
|
||||
KERNEL_MEMORY_ADDR = DRAM_BASE
|
||||
KERNEL_MEMORY_SIZE = DRAM_SIZE - FREERTOS_SIZE
|
||||
|
||||
# =================
|
||||
# Multimedia buffer. Used by u-boot/kernel/FreeRTOS
|
||||
# =================
|
||||
ION_SIZE = 75 * SIZE_1M
|
||||
H26X_BITSTREAM_SIZE = 2 * SIZE_1M
|
||||
H26X_ENC_BUFF_SIZE = 0
|
||||
ISP_MEM_BASE_SIZE = 20 * SIZE_1M
|
||||
FREERTOS_RESERVED_ION_SIZE = H26X_BITSTREAM_SIZE + H26X_ENC_BUFF_SIZE + ISP_MEM_BASE_SIZE
|
||||
|
||||
# ION after FreeRTOS
|
||||
ION_ADDR = FREERTOS_ADDR - ION_SIZE
|
||||
|
||||
# Buffers of the fast image are inside the ION buffer
|
||||
H26X_BITSTREAM_ADDR = ION_ADDR
|
||||
H26X_ENC_BUFF_ADDR = H26X_BITSTREAM_ADDR + H26X_BITSTREAM_SIZE
|
||||
ISP_MEM_BASE_ADDR = H26X_ENC_BUFF_ADDR + H26X_ENC_BUFF_SIZE
|
||||
|
||||
assert ISP_MEM_BASE_ADDR + ISP_MEM_BASE_SIZE <= ION_ADDR + ION_SIZE
|
||||
|
||||
# Boot logo is after the ION buffer
|
||||
# Framebuffer uses boot logo's reserved memory
|
||||
BOOTLOGO_SIZE = 8000 * SIZE_1K
|
||||
BOOTLOGO_ADDR = ION_ADDR - BOOTLOGO_SIZE
|
||||
FRAMEBUFFER_SIZE = BOOTLOGO_SIZE
|
||||
FRAMEBUFFER_ADDR = BOOTLOGO_ADDR
|
||||
|
||||
# ===================
|
||||
# FSBL and u-boot-2021
|
||||
# ===================
|
||||
CVI_UPDATE_HEADER_SIZE = SIZE_1K
|
||||
UIMAG_SIZE = 16 * SIZE_1M
|
||||
|
||||
# kernel image loading buffer
|
||||
UIMAG_ADDR = DRAM_BASE + 24 * SIZE_1M
|
||||
CVI_UPDATE_HEADER_ADDR = UIMAG_ADDR - CVI_UPDATE_HEADER_SIZE
|
||||
|
||||
# FSBL decompress buffer
|
||||
FSBL_UNZIP_ADDR = UIMAG_ADDR
|
||||
FSBL_UNZIP_SIZE = UIMAG_SIZE
|
||||
|
||||
assert UIMAG_ADDR + UIMAG_SIZE <= BOOTLOGO_ADDR
|
||||
|
||||
# u-boot's run address and entry point
|
||||
CONFIG_SYS_TEXT_BASE = DRAM_BASE + 2 * SIZE_1M
|
||||
# u-boot's init stack point is only used before board_init_f()
|
||||
CONFIG_SYS_INIT_SP_ADDR = UIMAG_ADDR + UIMAG_SIZE
|
||||
@@ -0,0 +1,4 @@
|
||||
<physical_partition type="sd">
|
||||
<partition label="BOOT" size_in_kb="80960" readonly="false" file="boot.sd"/>
|
||||
<partition label="ROOTFS" size_in_kb="1581056" readonly="false" file="rootfs.sd" />
|
||||
</physical_partition>
|
||||
43
build/boards/sg200x/sg2002_licheervnano_sd_minimal/post-build.sh
Executable file
43
build/boards/sg200x/sg2002_licheervnano_sd_minimal/post-build.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
target_dir=$1
|
||||
|
||||
# Production NanoKVM uses its own server and multimedia libraries. SDK sample
|
||||
# programs and development metadata are not needed at runtime.
|
||||
find "$target_dir/mnt/system/usr/bin" -type f \
|
||||
\( -name 'sample_*' -o -name '*_test' -o -name 'test_*' -o -name 'ive_stress' -o -name 'sensor_test' \) \
|
||||
-delete 2>/dev/null || true
|
||||
|
||||
touch "$target_dir/etc/nanokvm-minimal"
|
||||
|
||||
# The minimal board uses AIC8800; do not ship or load the unused 8733bs driver.
|
||||
rm -f "$target_dir/mnt/system/ko/3rd/8733bs.ko"
|
||||
if [ -f "$target_dir/etc/init.d/S25wifimod" ]; then
|
||||
sed -i '/insmod 3rd\/8733bs\.ko/d' "$target_dir/etc/init.d/S25wifimod"
|
||||
fi
|
||||
|
||||
# Do not retain stale hardware database files in an incremental build.
|
||||
rm -rf "$target_dir/etc/udev/hwdb.bin" "$target_dir/etc/udev/hwdb.d"
|
||||
|
||||
# Keep only the sensor selected by the minimal board configuration.
|
||||
rm -f \
|
||||
"$target_dir/mnt/system/usr/lib/libsns_gc4653.so" \
|
||||
"$target_dir/mnt/system/usr/lib/libov_ov2685.so" \
|
||||
"$target_dir/mnt/system/usr/lib/libsns_os04a10.so" \
|
||||
"$target_dir/mnt/system/usr/lib/libsns_sc035gs.so"
|
||||
|
||||
# LT6911 has no matching SDK ISP tuning blob; remove stale blobs from reuse builds.
|
||||
find "$target_dir/mnt/cfg/param" "$target_dir/mnt/cfg/tmp_secure" \
|
||||
-type f -delete 2>/dev/null || true
|
||||
|
||||
find "$target_dir" -type f \( -name '*.a' -o -name '*.la' \) -delete
|
||||
rm -rf \
|
||||
"$target_dir/usr/include" \
|
||||
"$target_dir/usr/share/doc" \
|
||||
"$target_dir/usr/share/info" \
|
||||
"$target_dir/usr/share/man" \
|
||||
"$target_dir/usr/share/pkgconfig" \
|
||||
"$target_dir/usr/lib/pkgconfig" \
|
||||
"$target_dir/usr/lib/cmake"
|
||||
@@ -0,0 +1,23 @@
|
||||
CONFIG_CHIP_sg2002=y
|
||||
CONFIG_BOARD_licheervnano_sd_minimal=y
|
||||
CONFIG_DDR_CFG_ddr3_1866_x16=y
|
||||
CONFIG_ARCH="riscv"
|
||||
CONFIG_CROSS_COMPILE="riscv64-unknown-linux-musl-"
|
||||
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
|
||||
CONFIG_KERNEL_ENTRY_HACK=y
|
||||
CONFIG_KERNEL_ENTRY_HACK_ADDR="0x80200000"
|
||||
CONFIG_TOOLCHAIN_MUSL_RISCV64=y
|
||||
CONFIG_BOOT_IMAGE_SINGLE_DTB=y
|
||||
# CONFIG_FLASH_SIZE_SHRINK is not set
|
||||
CONFIG_CP_EXT_WIRELESS=y
|
||||
CONFIG_STORAGE_TYPE_sd=y
|
||||
CONFIG_MIPI_PANEL_ZCT2133V1=y
|
||||
CONFIG_SENSOR_LONTIUM_LT6911=y
|
||||
CONFIG_UBOOT_2021_10=y
|
||||
CONFIG_KERNEL_SRC_5.10=y
|
||||
CONFIG_KERNEL_UNCOMPRESSED=y
|
||||
# CONFIG_SKIP_RAMDISK is not set
|
||||
# CONFIG_SENSOR_TUNING_PARAM_sg200x_src_ov_os04a10=y
|
||||
# CONFIG_ROOTFS_OVERLAYFS is not set
|
||||
# CONFIG_ENABLE_FREERTOS=y
|
||||
# CONFIG_TARGET_PACKAGE_GATORD is not set
|
||||
@@ -0,0 +1,164 @@
|
||||
__attribute__((optimize("O0")))
|
||||
// 1.26ms
|
||||
void suck_loop(uint64_t loop) {
|
||||
loop = loop * 50 * 100;
|
||||
uint64_t a;
|
||||
while (loop > 0) {
|
||||
a = loop / (uint64_t)99;
|
||||
a = loop / (uint64_t)77;
|
||||
a = loop / (uint64_t)55;
|
||||
a = loop / (uint64_t)33;
|
||||
a = loop / (uint64_t)11;
|
||||
a = loop / (uint64_t)999;
|
||||
a = loop / (uint64_t)777;
|
||||
a = loop / (uint64_t)555;
|
||||
a = loop / (uint64_t)333;
|
||||
a = loop / (uint64_t)111;
|
||||
a = loop / (uint64_t)9999;
|
||||
a = loop / (uint64_t)7777;
|
||||
a = loop / (uint64_t)5555;
|
||||
a = loop / (uint64_t)3333;
|
||||
a = loop / (uint64_t)1111;
|
||||
a = loop / (uint64_t)99999;
|
||||
a = loop / (uint64_t)77777;
|
||||
a = loop / (uint64_t)55555;
|
||||
a = loop / (uint64_t)33333;
|
||||
a = loop / (uint64_t)11111;
|
||||
loop--;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void user_led_on(void) {
|
||||
uint32_t val;
|
||||
|
||||
val = mmio_read_32(0x03020000);
|
||||
val |= (1 << 14);
|
||||
mmio_write_32(0x03020000, val);
|
||||
}
|
||||
|
||||
static inline void user_led_off(void) {
|
||||
uint32_t val;
|
||||
|
||||
val = mmio_read_32(0x03020000);
|
||||
val &= ~(1 << 14);
|
||||
mmio_write_32(0x03020000, val);
|
||||
}
|
||||
|
||||
static inline void user_led_toggle(void) {
|
||||
uint32_t val;
|
||||
|
||||
val = mmio_read_32(0x03020000);
|
||||
val ^= (1 << 14);
|
||||
mmio_write_32(0x03020000, val);
|
||||
}
|
||||
|
||||
int cvi_board_init(void)
|
||||
{
|
||||
uint32_t val;
|
||||
|
||||
// user led
|
||||
mmio_write_32(0x03001038, 0x3); // GPIOA 14 GPIO_MODE
|
||||
val = mmio_read_32(0x03020004); // GPIOA DIR
|
||||
val |= (1 << 14); // output
|
||||
mmio_write_32(0x03020004, val);
|
||||
user_led_toggle();
|
||||
|
||||
// wifi power reset
|
||||
mmio_write_32(0x0300104C, 0x3); // GPIOA 26
|
||||
val = mmio_read_32(0x03020004); // GPIOA DIR
|
||||
val |= (1 << 26); // output
|
||||
mmio_write_32(0x03020004, val);
|
||||
|
||||
val = mmio_read_32(0x03020000); // signal level
|
||||
val &= ~(1 << 26); // set level to low
|
||||
mmio_write_32(0x03020000, val);
|
||||
|
||||
suck_loop(50);
|
||||
user_led_toggle();
|
||||
|
||||
val = mmio_read_32(0x03020000); // signal level
|
||||
val |= (1 << 26); // set level to high
|
||||
mmio_write_32(0x03020000, val);
|
||||
|
||||
// wifi sdio pinmux
|
||||
mmio_write_32(0x030010D0, 0x0); // D3
|
||||
mmio_write_32(0x030010D4, 0x0); // D2
|
||||
mmio_write_32(0x030010D8, 0x0); // D1
|
||||
mmio_write_32(0x030010DC, 0x0); // D0
|
||||
mmio_write_32(0x030010E0, 0x0); // CMD
|
||||
mmio_write_32(0x030010E4, 0x0); // CLK
|
||||
|
||||
// spi2 pinmux
|
||||
// mmio_write_32(0x030010D0, 0x1); // CS
|
||||
// mmio_write_32(0x030010DC, 0x1); // MISO
|
||||
// mmio_write_32(0x030010E0, 0x1); // MOSI
|
||||
// mmio_write_32(0x030010E4, 0x1); // SCK
|
||||
// mmio_write_32(0x030010D8, 0x3); // DC
|
||||
// mmio_write_32(0x03001038, 0x3); // RESET
|
||||
|
||||
// uart bluetooth
|
||||
mmio_write_32(0x03001070, 0x1); // GPIOA 28 UART1 TX
|
||||
mmio_write_32(0x03001074, 0x1); // GPIOA 29 UART1 RX
|
||||
mmio_write_32(0x03001068, 0x4); // GPIOA 18 UART1 CTS
|
||||
mmio_write_32(0x03001064, 0x4); // GPIOA 19 UART1 RTS
|
||||
|
||||
// PWM
|
||||
//mmio_write_32(0x03001068, 0x2); // GPIOA 18 PWM 6
|
||||
|
||||
// lcd reset
|
||||
mmio_write_32(0x030010A4, 0x0); // PWRGPIO 0 GPIO_MODE
|
||||
|
||||
user_led_toggle();
|
||||
// lcd backlight
|
||||
//mmio_write_32(0x030010EC, 0x0); // GPIOB 0 PWM0_BUCK
|
||||
// for licheervnano alpha
|
||||
val = mmio_read_32(0x03021000); // signal level
|
||||
val |= (1 << 0); // set level to high
|
||||
mmio_write_32(0x03021000, val);
|
||||
val = mmio_read_32(0x03021004); // GPIOB DIR
|
||||
val |= (1 << 0); // output
|
||||
mmio_write_32(0x03021004, val);
|
||||
mmio_write_32(0x030010EC, 0x3); // GPIOB 0 GPIO_MODE
|
||||
|
||||
// for licheervnano beta
|
||||
//mmio_write_32(0x030010ac, 0x4); // PWRGPIO 2 PWM 10
|
||||
mmio_write_32(0x030010ac, 0x0); // PWRGPIO 2 GPIO_MODE
|
||||
|
||||
// camera function
|
||||
//mmio_write_32(0x0300116C, 0x5); // RX4N CAM_MCLK0 for alpha
|
||||
mmio_write_32(0x0300118C, 0x5); // RX0N CAM_MCLK1 for beta
|
||||
|
||||
// spi1 on mipi csi
|
||||
/*
|
||||
mmio_write_32(0x0300116C, 0x7); // spi1 clk GPIOC2 MIPI_RX4N
|
||||
mmio_write_32(0x03001170, 0x7); // spi1 cs GPIOC3 MIPI_RX4P
|
||||
mmio_write_32(0x03001174, 0x7); // spi1 miso GPIOC4 MIPI_RX3N
|
||||
mmio_write_32(0x03001178, 0x7); // spi1 mosi GPIOC5 MIPI_RX3P
|
||||
*/
|
||||
|
||||
|
||||
// camera/tp i2c
|
||||
mmio_write_32(0x03001090, 0x5); // PWR_GPIO6 IIC4_SCL
|
||||
mmio_write_32(0x03001098, 0x5); // PWR_GPIO8 IIC4_SDA
|
||||
|
||||
// tp function
|
||||
mmio_write_32(0x03001084, 0x3); // PWR_SEQ1 PWR_GPIO[3]
|
||||
mmio_write_32(0x03001088, 0x3); // PWR_SEQ2 PWR_GPIO[4]
|
||||
mmio_write_32(0x05027078, 0x11);// Unlock PWR_GPIO[3]
|
||||
mmio_write_32(0x0502707c, 0x11);// Unlock PWR_GPIO[4]
|
||||
|
||||
// bitbang i2c
|
||||
mmio_write_32(0x0300103C, 0x03); // GPIOA 15 GPIO_MODE
|
||||
mmio_write_32(0x03001058, 0x03); // GPIOA 27 GPIO_MODE
|
||||
|
||||
// bitbang spi
|
||||
mmio_write_32(0x03001060, 0x03); // GPIOA 24 GPIO_MODE
|
||||
mmio_write_32(0x0300105C, 0x03); // GPIOA 23 GPIO_MODE
|
||||
mmio_write_32(0x03001054, 0x03); // GPIOA 25 GPIO_MODE
|
||||
mmio_write_32(0x03001050, 0x03); // GPIOA 22 GPIO_MODE
|
||||
|
||||
// wait hardware bootup
|
||||
suck_loop(50);
|
||||
user_led_off();
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
CONFIG_RISCV=y
|
||||
CONFIG_SYS_MALLOC_F_LEN=0x2000
|
||||
CONFIG_NR_DRAM_BANKS=1
|
||||
CONFIG_DEFAULT_DEVICE_TREE="soph_asic"
|
||||
CONFIG_IDENT_STRING=" soph"
|
||||
CONFIG_ARCH_RV64I=y
|
||||
CONFIG_RISCV_SMODE=y
|
||||
CONFIG_TARGET_CVITEK_CV181X=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_FIT=y
|
||||
# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
|
||||
CONFIG_BOOTDELAY=0
|
||||
CONFIG_SYS_PROMPT="soph# "
|
||||
# CONFIG_CMD_CONSOLE is not set
|
||||
# CONFIG_CMD_XIMG is not set
|
||||
# CONFIG_CMD_EDITENV is not set
|
||||
# CONFIG_CMD_CRC32 is not set
|
||||
# CONFIG_CMD_LZMADEC is not set
|
||||
# CONFIG_CMD_UNLZ4 is not set
|
||||
# CONFIG_CMD_UNZIP is not set
|
||||
# CONFIG_CMD_LOADS is not set
|
||||
CONFIG_CMD_MMC=y
|
||||
# CONFIG_CMD_ITEST is not set
|
||||
CONFIG_CMD_CACHE=y
|
||||
CONFIG_CMD_CVI_SD_UPDATE=y
|
||||
# CONFIG_ISO_PARTITION is not set
|
||||
# CONFIG_EFI_PARTITION is not set
|
||||
CONFIG_NET_RANDOM_ETHADDR=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_MMC_SDHCI_CVITEK=y
|
||||
CONFIG_MTD=y
|
||||
# CONFIG_PHY_SMSC is not set
|
||||
CONFIG_DM_ETH=y
|
||||
CONFIG_ETH_DESIGNWARE=y
|
||||
CONFIG_PHY_CVITEK=y
|
||||
CONFIG_SYS_NS16550=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_LZ4=y
|
||||
CONFIG_LZMA=y
|
||||
# CONFIG_TOOLS_LIBCRYPTO is not set
|
||||
CONFIG_ENV_IS_NOWHERE=y
|
||||
|
||||
# for licheervnano
|
||||
CONFIG_UDP_FUNCTION_FASTBOOT=y
|
||||
CONFIG_FASTBOOT_FLASH=y
|
||||
CONFIG_FASTBOOT_BUF_ADDR=0x81800000
|
||||
CONFIG_FASTBOOT_BUF_SIZE=0x1000000
|
||||
CONFIG_FASTBOOT_FLASH_MMC_DEV=0
|
||||
CONFIG_DISPLAY=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_DM_GPIO=y
|
||||
CONFIG_DWAPB_GPIO=y
|
||||
CONFIG_CMD_VIDCONSOLE=y
|
||||
CONFIG_VIDEO_BPP16=y
|
||||
CONFIG_VIDEO_BPP32=y
|
||||
CONFIG_VIDEO_CVITEK=y
|
||||
CONFIG_DISPLAY_CVITEK_MIPI=y
|
||||
CONFIG_BMP_16BPP=y
|
||||
CONFIG_BMP_24BPP=y
|
||||
CONFIG_BMP_32BPP=y
|
||||
CONFIG_BOOTLOGO=y
|
||||
CONFIG_CMD_CVI_VO=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_MBR=y
|
||||
@@ -525,6 +525,7 @@ function clean_ramdisk()
|
||||
rm -rf "${RAMDISK_PATH:?}"/"$RAMDISK_OUTPUT_BASE"
|
||||
rm -rf "$SYSTEM_OUT_DIR"
|
||||
rm -rf "$ROOTFS_DIR"
|
||||
rm -rf "${BR_OUTPUT_DIR:?}"
|
||||
}
|
||||
|
||||
function build_access_guard_turnkey_app()
|
||||
@@ -734,6 +735,11 @@ function cvi_setup_env()
|
||||
|
||||
PROJECT_FULLNAME="$CHIP"_"$BOARD"
|
||||
|
||||
# NanoKVM has no display output; do not build or load the vendor bootlogo.
|
||||
if [[ "$PROJECT_FULLNAME" == "sg2002_licheervnano_sd" ]]; then
|
||||
ENABLE_BOOTLOGO=0
|
||||
fi
|
||||
|
||||
# output folder path
|
||||
INSTALL_PATH="$TOP_DIR"/install
|
||||
OUTPUT_DIR="$INSTALL_PATH"/soc_"$PROJECT_FULLNAME"
|
||||
@@ -876,9 +882,16 @@ function cvi_setup_env()
|
||||
# buildroot config
|
||||
export BR_DIR="$TOP_DIR"/buildroot
|
||||
export BR_BOARD=cvitek_${CHIP_ARCH}_${SDK_VER}
|
||||
export BR_OVERLAY_DIR=${BR_DIR}/board/cvitek/${CHIP_ARCH}/overlay
|
||||
export BR_DEFCONFIG=${BR_BOARD}_defconfig
|
||||
echo "BR2_DEFCONFIG: ${BRDEFCONFIG}"
|
||||
export BR_OUTPUT_DIR=${BR_DIR}/output/${PROJECT_FULLNAME}
|
||||
export BR_BASE_OVERLAY_DIR=${BR_DIR}/board/cvitek/${CHIP_ARCH}/overlay
|
||||
export BR_OVERLAY_DIR=${BR_OUTPUT_DIR}/overlay
|
||||
export BR_DEFCONFIG=defconfig
|
||||
export BR2_DEFCONFIG=${BR_DIR}/configs/${BR_BOARD}_defconfig
|
||||
board_br_defconfig="$BUILD_PATH/boards/${CHIP_ARCH,,}/$PROJECT_FULLNAME/buildroot.config"
|
||||
if [ -f "$board_br_defconfig" ]; then
|
||||
export BR2_DEFCONFIG=$board_br_defconfig
|
||||
fi
|
||||
echo "BR2_DEFCONFIG: ${BR2_DEFCONFIG}"
|
||||
}
|
||||
|
||||
cvi_print_env()
|
||||
|
||||
@@ -5,8 +5,8 @@ image boot.vfat {
|
||||
"fip.bin",
|
||||
"rawimages/boot.sd",
|
||||
"usb.dev",
|
||||
"usb.ncm",
|
||||
"usb.rndis",
|
||||
"usb.disk0",
|
||||
"usb.rndis0",
|
||||
"wifi.sta",
|
||||
"gt9xx",
|
||||
"logo.jpeg",
|
||||
|
||||
@@ -27,8 +27,8 @@ cp -fv ${output_dir}/fip.bin ${output_dir}/input/
|
||||
cp -fv ${output_dir}/rawimages/boot.sd ${output_dir}/input/rawimages/
|
||||
cp -fv ${output_dir}/rawimages/rootfs.sd ${output_dir}/input/
|
||||
touch ${output_dir}/input/usb.dev
|
||||
touch ${output_dir}/input/usb.ncm
|
||||
touch ${output_dir}/input/usb.rndis
|
||||
touch ${output_dir}/input/usb.disk0
|
||||
touch ${output_dir}/input/usb.rndis0
|
||||
touch ${output_dir}/input/wifi.sta
|
||||
touch ${output_dir}/input/gt9xx
|
||||
touch ${output_dir}/input/fb
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$1" = "start" ]
|
||||
then
|
||||
. /etc/profile
|
||||
printf "load kernel module: "
|
||||
cd /mnt/system/ko/
|
||||
insmod soph_sys.ko
|
||||
insmod soph_base.ko
|
||||
insmod soph_rtos_cmdqu.ko
|
||||
insmod soph_fast_image.ko
|
||||
insmod soph_mipi_rx.ko
|
||||
insmod soph_snsr_i2c.ko
|
||||
insmod soph_vi.ko
|
||||
insmod soph_vpss.ko
|
||||
insmod soph_dwa.ko
|
||||
insmod soph_vo.ko
|
||||
# insmod soph_mipi_tx.ko
|
||||
insmod soph_rgn.ko
|
||||
insmod soph_wdt.ko
|
||||
insmod soph_clock_cooling.ko
|
||||
insmod soph_tpu.ko
|
||||
insmod soph_vcodec.ko
|
||||
insmod soph_jpeg.ko
|
||||
insmod soph_vc_driver.ko MaxVencChnNum=9 MaxVdecChnNum=9
|
||||
insmod soph_rtc.ko
|
||||
insmod soph_ive.ko
|
||||
insmod soph_mon.ko
|
||||
insmod soph_pwm.ko
|
||||
insmod soph_saradc.ko
|
||||
insmod soph_wiegand.ko
|
||||
echo "OK"
|
||||
exit 0
|
||||
fi
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$1" = "start" ]
|
||||
then
|
||||
. /etc/profile
|
||||
printf "mounting filesystem : "
|
||||
mkdir -p /boot
|
||||
mount -t vfat /dev/mmcblk0p1 /boot
|
||||
mount -t configfs configfs /sys/kernel/config
|
||||
mount -t debugfs debugfs /sys/kernel/debug
|
||||
echo "OK"
|
||||
fi
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$1" = "start" ]
|
||||
then
|
||||
str_value=$(cat /sys/class/cvi-base/base_uid | awk '{print $2}')
|
||||
first_uint=$(echo $str_value | cut -d'_' -f1)
|
||||
second_uint=$(echo $str_value | cut -d'_' -f2)
|
||||
result="$first_uint$second_uint"
|
||||
echo $result > /device_key
|
||||
# for compatibility with previous network mac addr
|
||||
cat /sys/class/cvi-base/base_uid > /device_key_legacy
|
||||
fi
|
||||
|
||||
@@ -1,200 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
if [ "$1" = "start" ]
|
||||
then
|
||||
. /etc/profile
|
||||
if [ -e /boot/usb.host ]
|
||||
then
|
||||
echo "usb mode: host"
|
||||
echo host > /proc/cviusb/otg_role
|
||||
elif [ -e /boot/usb.dev ]
|
||||
then
|
||||
echo "usb mode: device"
|
||||
cd /sys/kernel/config/usb_gadget
|
||||
mkdir -p g0
|
||||
cd g0
|
||||
if [ -e /boot/usb.idVendor ]
|
||||
then
|
||||
cat /boot/usb.idVendor > idVendor
|
||||
else
|
||||
echo 0x359F > idVendor
|
||||
fi
|
||||
if [ -e /boot/usb.idProduct ]
|
||||
then
|
||||
cat /boot/usb.idProduct > idProduct
|
||||
else
|
||||
echo 0x2120 > idProduct
|
||||
fi
|
||||
if [ -e /boot/usb.bcdDevice ]
|
||||
then
|
||||
cat /boot/usb.bcdDevice > bcdDevice
|
||||
else
|
||||
echo 0x0300 > bcdDevice
|
||||
fi
|
||||
if [ -e /boot/usb.bcdUSB ]
|
||||
then
|
||||
cat /boot/usb.bcdUSB > bcdUSB
|
||||
else
|
||||
echo 0x0200 > bcdUSB
|
||||
fi
|
||||
if [ -e /boot/usb.bDeviceClass ]
|
||||
then
|
||||
cat /boot/usb.bDeviceClass > bDeviceClass
|
||||
else
|
||||
echo 0xef > bDeviceClass
|
||||
fi
|
||||
if [ -e /boot/usb.bDeviceSubClass ]
|
||||
then
|
||||
cat /boot/usb.bDeviceSubClass > bDeviceSubClass
|
||||
else
|
||||
echo 0x02 > bDeviceSubClass
|
||||
fi
|
||||
if [ -e /boot/usb.bDeviceProtocol ]
|
||||
then
|
||||
cat /boot/usb.bDeviceProtocol > bDeviceProtocol
|
||||
else
|
||||
echo 0x01 > bDeviceProtocol
|
||||
fi
|
||||
mkdir -p strings/0x409
|
||||
if [ -e /boot/usb.serialnumber ]
|
||||
then
|
||||
cat /boot/usb.serialnumber > strings/0x409/serialnumber
|
||||
else
|
||||
cat /device_key > strings/0x409/serialnumber
|
||||
fi
|
||||
if [ -e /boot/usb.manufacturer ]
|
||||
then
|
||||
cat /boot/usb.manufacturer > strings/0x409/manufacturer
|
||||
else
|
||||
echo 'sipeed' > strings/0x409/manufacturer
|
||||
fi
|
||||
if [ -e /boot/usb.product ]
|
||||
then
|
||||
cat /boot/usb.product > strings/0x409/product
|
||||
else
|
||||
echo 'licheervnano' > strings/0x409/product
|
||||
fi
|
||||
mkdir -p configs/c.1
|
||||
# uvc
|
||||
if [ -e /boot/usb.uvc ]
|
||||
then
|
||||
/etc/init.d/uvc_tool.sh mount /boot/usb.uvc
|
||||
/etc/init.d/uvc_tool.sh server
|
||||
fi
|
||||
|
||||
if [ -e /boot/usb.GS0 ]
|
||||
then
|
||||
mkdir -p functions/acm.GS0
|
||||
rm -rf configs/c.1/acm.GS0
|
||||
ln -s functions/acm.GS0 configs/c.1/
|
||||
fi
|
||||
|
||||
if [ -e /boot/usb.disk0 ]
|
||||
then
|
||||
mkdir -p functions/mass_storage.disk0
|
||||
rm -rf configs/c.1/mass_storage.disk0
|
||||
ln -s functions/mass_storage.disk0 configs/c.1/
|
||||
echo 1 > functions/mass_storage.disk0/lun.0/removable
|
||||
if [ -e /boot/usb.disk0.ro ]
|
||||
then
|
||||
echo 1 > functions/mass_storage.disk0/lun.0/ro
|
||||
echo 1 > functions/mass_storage.disk0/lun.0/cdrom
|
||||
fi
|
||||
disk=$(cat /boot/usb.disk0)
|
||||
if [ -z "${disk}" ]
|
||||
then
|
||||
if [ ! -e /mnt/usbdisk.img ]
|
||||
then
|
||||
dd if=/dev/zero of=/mnt/usbdisk.img bs=1M count=16
|
||||
mkfs.vfat /mnt/usbdisk.img
|
||||
fi
|
||||
echo /mnt/usbdisk.img > functions/mass_storage.disk0/lun.0/file
|
||||
else
|
||||
cat /boot/usb.disk0 > functions/mass_storage.disk0/lun.0/file
|
||||
fi
|
||||
fi
|
||||
|
||||
# rndis
|
||||
if [ -e /boot/usb.rndis ]
|
||||
then
|
||||
mkdir -p functions/rndis.usb0
|
||||
ln -s functions/rndis.usb0 configs/c.1/
|
||||
echo e0 > functions/rndis.usb0/class
|
||||
echo 01 > functions/rndis.usb0/subclass
|
||||
echo 03 > functions/rndis.usb0/protocol
|
||||
fi
|
||||
|
||||
# ncm
|
||||
if [ -e /boot/usb.ncm ]
|
||||
then
|
||||
mkdir -p functions/ncm.usb0
|
||||
ln -s functions/ncm.usb0 configs/c.1/
|
||||
fi
|
||||
|
||||
# keyboard
|
||||
if [ -e /boot/usb.keyboard ]
|
||||
then
|
||||
mkdir functions/hid.GS0
|
||||
# echo 1 > functions/hid.GS0/subclass
|
||||
echo 1 > functions/hid.GS0/wakeup_on_write
|
||||
echo 1 > functions/hid.GS0/protocol
|
||||
echo 6 > functions/hid.GS0/report_length
|
||||
echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > functions/hid.GS0/report_desc
|
||||
ln -s functions/hid.GS0 configs/c.1
|
||||
fi
|
||||
|
||||
# mouse
|
||||
if [ -e /boot/usb.mouse ]
|
||||
then
|
||||
mkdir functions/hid.GS1
|
||||
# echo 1 > functions/hid.GS1/subclass
|
||||
echo 1 > functions/hid.GS1/wakeup_on_write
|
||||
echo 2 > functions/hid.GS1/protocol
|
||||
echo -ne \\x34 > functions/hid.GS1/report_length
|
||||
echo -ne \\x5\\x1\\x9\\x2\\xa1\\x1\\x9\\x1\\xa1\\x0\\x5\\x9\\x19\\x1\\x29\\x3\\x15\\x0\\x25\\x1\\x95\\x3\\x75\\x1\\x81\\x2\\x95\\x1\\x75\\x5\\x81\\x3\\x5\\x1\\x9\\x30\\x9\\x31\\x9\\x38\\x15\\x81\\x25\\x7f\\x75\\x8\\x95\\x3\\x81\\x6\\xc0\\xc0 > functions/hid.GS1/report_desc
|
||||
ln -s functions/hid.GS1 configs/c.1
|
||||
fi
|
||||
|
||||
# touchpad
|
||||
if [ -e /boot/usb.touchpad ]
|
||||
then
|
||||
mkdir functions/hid.GS2
|
||||
# echo 1 > functions/hid.GS2/subclass
|
||||
echo 1 > functions/hid.GS2/wakeup_on_write
|
||||
echo 2 > functions/hid.GS2/protocol
|
||||
echo 6 > functions/hid.GS2/report_length
|
||||
echo -ne \\x05\\x01\\x09\\x02\\xa1\\x01\\x09\\x01\\xa1\\x00\\x05\\x09\\x19\\x01\\x29\\x03\\x15\\x00\\x25\\x01\\x95\\x03\\x75\\x01\\x81\\x02\\x95\\x01\\x75\\x05\\x81\\x01\\x05\\x01\\x09\\x30\\x09\\x31\\x15\\x00\\x26\\xff\\x7f\\x35\\x00\\x46\\xff\\x7f\\x75\\x10\\x95\\x02\\x81\\x02\\x05\\x01\\x09\\x38\\x15\\x81\\x25\\x7f\\x35\\x00\\x45\\x00\\x75\\x08\\x95\\x01\\x81\\x06\\xc0\\xc0 > functions/hid.GS2/report_desc
|
||||
ln -s functions/hid.GS2 configs/c.1
|
||||
fi
|
||||
|
||||
ls /sys/class/udc/ | cat > UDC
|
||||
echo device > /proc/cviusb/otg_role
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "stop" ]
|
||||
then
|
||||
echo '' > /sys/kernel/config/usb_gadget/g0/UDC
|
||||
echo host > /proc/cviusb/otg_role
|
||||
# uvc
|
||||
if [ -e /sys/kernel/config/usb_gadget/g0/configs/c.1/uvc.usb0 ]
|
||||
then
|
||||
/etc/init.d/uvc_tool.sh unmount
|
||||
fi
|
||||
|
||||
# rndis
|
||||
if [ -e /sys/kernel/config/usb_gadget/g0/configs/c.1/rndis.usb0 ]
|
||||
then
|
||||
unlink /sys/kernel/config/usb_gadget/g0/configs/c.1/rndis.usb0
|
||||
rmdir /sys/kernel/config/usb_gadget/g0/functions/rndis.usb0
|
||||
fi
|
||||
|
||||
# ncm
|
||||
if [ -e /sys/kernel/config/usb_gadget/g0/configs/c.1/ncm.usb0 ]
|
||||
then
|
||||
unlink /sys/kernel/config/usb_gadget/g0/configs/c.1/ncm.usb0
|
||||
rmdir /sys/kernel/config/usb_gadget/g0/functions/ncm.usb0
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$1" = "start" ]
|
||||
then
|
||||
. /etc/profile
|
||||
if [ ! -e /boot/alpha ]
|
||||
then
|
||||
devmem 0x030010AC 32 0x04 # PINMUX PWM10
|
||||
blpwm="/sys/class/pwm/pwmchip8/pwm2/"
|
||||
if [ ! -e "${blpwm}" ]
|
||||
then
|
||||
echo 2 > /sys/class/pwm/pwmchip8/export
|
||||
fi
|
||||
echo 0 > $blpwm/enable
|
||||
echo "10000" > ${blpwm}/period # 100KHZ
|
||||
panel_value=""
|
||||
if [ -e /boot/board ]
|
||||
then
|
||||
panel_value=$(grep '^panel=' /boot/board | cut -d '=' -f 2)
|
||||
elif [ -e /boot/uEnv.txt ]
|
||||
then
|
||||
panel_value=$(grep '^panel=' /boot/uEnv.txt | cut -d '=' -f 2)
|
||||
fi
|
||||
if [ "$panel_value" = "st7701_hd228001c31" ]
|
||||
then
|
||||
echo "2000" > ${blpwm}/duty_cycle # 20%
|
||||
else
|
||||
echo "9000" > ${blpwm}/duty_cycle
|
||||
fi
|
||||
echo 1 > $blpwm/enable
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$1" = "start" ]
|
||||
then
|
||||
. /etc/profile
|
||||
panel_value=""
|
||||
if [ -e /boot/board ]
|
||||
then
|
||||
panel_value=$(grep '^panel=' /boot/board | cut -d '=' -f 2)
|
||||
elif [ -e /boot/uEnv.txt ]
|
||||
then
|
||||
panel_value=$(grep '^panel=' /boot/uEnv.txt | cut -d '=' -f 2)
|
||||
fi
|
||||
if [ "$panel_value" = "st7701_lct024bsi20" ]
|
||||
then
|
||||
echo "load cst7xx touchscreen driver"
|
||||
insmod /mnt/system/ko/hynitron_touch_new.ko
|
||||
elif [ "$panel_value" = "st7701_hd228001c31" ]
|
||||
then
|
||||
echo "load cst3xx touchscreen driver"
|
||||
insmod /mnt/system/ko/hynitron_touch.ko
|
||||
fi
|
||||
if [ -e /boot/gt9xx ]
|
||||
then
|
||||
echo "load gt9xx touchscreen driver"
|
||||
insmod /mnt/system/ko/3rd/gt9xx.ko
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
@@ -13,13 +13,13 @@ hex2mac() {
|
||||
|
||||
if [ "${1}" = start ]
|
||||
then
|
||||
prefix=licheervnano
|
||||
prefix=kvm
|
||||
if [ -e /boot/hostname.prefix ]
|
||||
then
|
||||
prefix=$(cat /boot/hostname.prefix)
|
||||
fi
|
||||
old_hostname=$(cat /etc/hostname)
|
||||
new_hostname=${prefix}-$(sha512sum /device_key_legacy | head -c 4)
|
||||
new_hostname=${prefix}-$(sha512sum /sys/class/cvi-base/base_uid | head -c 4)
|
||||
|
||||
if [ -e /boot/hostname ]
|
||||
then
|
||||
@@ -38,11 +38,25 @@ then
|
||||
then
|
||||
new_ethmac=$(cat /boot/ethmac)
|
||||
else
|
||||
new_ethmac=$(hex2mac 48da356f$(sha512sum /device_key_legacy | head -c 4))
|
||||
new_ethmac=$(hex2mac 48da356f$(sha512sum /sys/class/cvi-base/base_uid | head -c 4))
|
||||
fi
|
||||
|
||||
ifconfig eth0 down
|
||||
ip link set eth0 address ${new_ethmac}
|
||||
ifconfig eth0 up
|
||||
echo "ethernet mac address: ${new_ethmac}"
|
||||
|
||||
if [ -e /boot/usb.rndis0 ]
|
||||
then
|
||||
if [ -e /boot/usb.rndis0.mac ]
|
||||
then
|
||||
new_rndismac=$(cat /boot/usb.rndis0.mac)
|
||||
else
|
||||
new_rndismac=$(hex2mac 48da356e$(sha512sum /sys/class/cvi-base/base_uid | head -c 4))
|
||||
fi
|
||||
ifconfig usb0 down
|
||||
ip link set usb0 address ${new_rndismac}
|
||||
ifconfig usb0 up
|
||||
echo "rndis mac address: ${new_rndismac}"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/profile
|
||||
|
||||
start() {
|
||||
printf "start ethernet: "
|
||||
if [ ! -e /boot/eth.nodhcp ]
|
||||
then
|
||||
(udhcpc -i eth0 -t 10 -T 1 -A 5 -b -p /run/udhcpc.eth0.pid) &
|
||||
fi
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
stop() {
|
||||
kill `cat /run/udhcpc.eth0.pid`
|
||||
rm /run/udhcpc.eth0.pid
|
||||
}
|
||||
|
||||
restart() {
|
||||
start
|
||||
stop
|
||||
}
|
||||
|
||||
if [ "${1}" = "start" ]
|
||||
then
|
||||
start
|
||||
elif [ "${1}" = "stop" ]
|
||||
then
|
||||
stop
|
||||
elif [ "${1}" = "restart" ]
|
||||
then
|
||||
restart
|
||||
fi
|
||||
@@ -1,176 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/profile
|
||||
|
||||
gen_udhcpd_conf() {
|
||||
interface=${1}
|
||||
ipv4_prefix=${2}
|
||||
echo "start ${ipv4_prefix}.100"
|
||||
echo "end ${ipv4_prefix}.200"
|
||||
echo "interface ${interface}"
|
||||
echo "pidfile /var/run/udhcpd.${interface}.pid"
|
||||
echo "lease_file /var/lib/misc/udhcpd.${interface}.leases"
|
||||
echo "option subnet 255.255.255.0"
|
||||
echo "option lease 864000"
|
||||
}
|
||||
|
||||
hex2mac() {
|
||||
MAC=""
|
||||
seq 2 2 12 | while read i
|
||||
do
|
||||
echo -n ${1} | head -c $i | tail -c 2
|
||||
if [ $i != 12 ]
|
||||
then
|
||||
echo -n ':'
|
||||
fi
|
||||
done | tr '[:upper:]' '[:lower:]'
|
||||
}
|
||||
|
||||
start() {
|
||||
# S03usbdev start first
|
||||
if [ -e /boot/usb.dev ]
|
||||
then
|
||||
rndis_ifname=usb0
|
||||
# RNDIS
|
||||
if [ -e /boot/usb.rndis ]
|
||||
then
|
||||
# mac
|
||||
if [ -e /boot/usb.rndis.mac ]
|
||||
then
|
||||
new_rndismac=$(cat /boot/usb.rndis.mac)
|
||||
else
|
||||
new_rndismac=$(hex2mac 48da356f$(sha512sum /device_key_legacy | head -c 4))
|
||||
fi
|
||||
ip link set $rndis_ifname address ${new_rndismac}
|
||||
ifconfig $rndis_ifname up
|
||||
echo "rndis mac address: ${new_rndismac}"
|
||||
|
||||
# dhcp
|
||||
if [ ! -e /boot/rndis.nodhcpd ]
|
||||
then
|
||||
if [ -e /boot/rndis.ipv4_prefix ]
|
||||
then
|
||||
ipv4_prefix=`cat /boot/rndis.ipv4_prefix`
|
||||
else
|
||||
id2=$(printf "%d" 0x$(sha512sum /device_key_legacy | head -c 2))
|
||||
id3=$(printf "%d" 0x$(sha512sum /device_key_legacy | head -c 4 | tail -c 2))
|
||||
id3=$((id3 + 1))
|
||||
if [ "$id2" = "$id3" ]
|
||||
then
|
||||
id2=$((id2 + 2))
|
||||
fi
|
||||
if [ "$id2" -ge 255 ]
|
||||
then
|
||||
id2=252
|
||||
fi
|
||||
if [ "$id3" -ge 255 ]
|
||||
then
|
||||
id3=251
|
||||
fi
|
||||
ipv4_prefix=10.$id2.$id3
|
||||
fi
|
||||
gen_udhcpd_conf $rndis_ifname "${ipv4_prefix}" > /etc/udhcpd.${rndis_ifname}.conf
|
||||
ip addr add $ipv4_prefix.1/24 dev $rndis_ifname
|
||||
udhcpd -S /etc/udhcpd.${rndis_ifname}.conf
|
||||
fi
|
||||
echo "RNDIS DHCP OK"
|
||||
rndis_ifname=usb1
|
||||
fi
|
||||
|
||||
# CDC NCM
|
||||
if [ -e /boot/usb.ncm ]
|
||||
then
|
||||
# mac
|
||||
if [ -e /boot/usb.ncm.mac ]
|
||||
then
|
||||
new_mac=$(cat /boot/usb.ncm.mac)
|
||||
else
|
||||
new_mac=$(hex2mac 48da356e$(sha512sum /device_key_legacy | head -c 4))
|
||||
fi
|
||||
ip link set $rndis_ifname address ${new_mac}
|
||||
ifconfig $rndis_ifname up
|
||||
echo "ncm mac address: ${new_mac}"
|
||||
|
||||
# dhcp
|
||||
if [ ! -e /boot/ncm.nodhcpd ]
|
||||
then
|
||||
if [ -e /boot/ncm.ipv4_prefix ]
|
||||
then
|
||||
ipv4_prefix=`cat /boot/ncm.ipv4_prefix`
|
||||
else
|
||||
id2=$(printf "%d" 0x$(sha512sum /device_key_legacy | head -c 2))
|
||||
id3=$(printf "%d" 0x$(sha512sum /device_key_legacy | head -c 4 | tail -c 2))
|
||||
if [ "$id2" = "$id3" ]
|
||||
then
|
||||
id2=$((id2 + 1))
|
||||
fi
|
||||
if [ "$id2" -ge 255 ]
|
||||
then
|
||||
id2=253
|
||||
fi
|
||||
if [ "$id3" -ge 255 ]
|
||||
then
|
||||
id3=254
|
||||
fi
|
||||
ipv4_prefix=10.$id2.$id3
|
||||
fi
|
||||
gen_udhcpd_conf $rndis_ifname "${ipv4_prefix}" > /etc/udhcpd.${rndis_ifname}.conf
|
||||
ip addr add $ipv4_prefix.1/24 dev $rndis_ifname
|
||||
udhcpd -S /etc/udhcpd.${rndis_ifname}.conf
|
||||
fi
|
||||
echo "CDC NCM DHCP OK"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
# first card
|
||||
if [ -e /var/run/udhcpd.usb0.pid ]
|
||||
then
|
||||
kill $(cat "/var/run/udhcpd.usb0.pid")
|
||||
rm /var/run/udhcpd.usb0.pid || true
|
||||
fi
|
||||
pnum=$(ps -ef|grep udhcpd|grep -v grep| grep udhcpd.usb0.conf | awk '{print $1}' | wc -l)
|
||||
if [ x$pnum != x0 ]
|
||||
then
|
||||
ps -ef|grep udhcpd|grep -v grep| grep udhcpd.usb0.conf | awk '{print $1}'|xargs kill -2 || true
|
||||
fi
|
||||
usb0_info=$(ip link |grep usb0)
|
||||
if [ -n "$usb0_info" ]
|
||||
then
|
||||
ifconfig usb0 down
|
||||
fi
|
||||
|
||||
# second card
|
||||
if [ -e /var/run/udhcpd.usb1.pid ]
|
||||
then
|
||||
kill $(cat /var/run/udhcpd.usb1.pid)
|
||||
rm /var/run/udhcpd.usb1.pid || true
|
||||
fi
|
||||
pnum=$(ps -ef|grep udhcpd|grep -v grep| grep udhcpd.usb1.conf | awk '{print $1}' | wc -l)
|
||||
if [ x$pnum != x0 ]
|
||||
then
|
||||
ps -ef|grep udhcpd|grep -v grep| grep udhcpd.usb1.conf | awk '{print $1}'|xargs kill -2 || true
|
||||
fi
|
||||
usb0_info=$(ip link |grep usb1)
|
||||
if [ -n "$usb0_info" ]
|
||||
then
|
||||
ifconfig usb1 down
|
||||
fi
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
if [ "${1}" = "start" ]
|
||||
then
|
||||
start
|
||||
elif [ "${1}" = "stop" ]
|
||||
then
|
||||
stop
|
||||
elif [ "${1}" = "restart" ]
|
||||
then
|
||||
restart
|
||||
fi
|
||||
70
buildroot/board/cvitek/SG200X/overlay/etc/init.d/S30rndis
Executable file
70
buildroot/board/cvitek/SG200X/overlay/etc/init.d/S30rndis
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/profile
|
||||
|
||||
gen_udhcpd_conf() {
|
||||
interface=${1}
|
||||
ipv4_prefix=${2}
|
||||
echo "start ${ipv4_prefix}.100"
|
||||
echo "end ${ipv4_prefix}.200"
|
||||
echo "interface ${interface}"
|
||||
echo "pidfile /var/run/udhcpd.${interface}.pid"
|
||||
echo "lease_file /var/lib/misc/udhcpd.${interface}.leases"
|
||||
echo "option subnet 255.255.255.0"
|
||||
echo "option lease 864000"
|
||||
}
|
||||
|
||||
start() {
|
||||
if [ -e /boot/usb.rndis0 ]
|
||||
then
|
||||
printf "start usb rndis: "
|
||||
if [ ! -e /boot/rndis.nodhcpd ]
|
||||
then
|
||||
if [ -e /boot/rndis.ipv4_prefix ]
|
||||
then
|
||||
ipv4_prefix=`cat /boot/rndis.ipv4_prefix`
|
||||
else
|
||||
id2=$(printf "%d" 0x$(sha512sum /sys/class/cvi-base/base_uid | head -c 2))
|
||||
id3=$(printf "%d" 0x$(sha512sum /sys/class/cvi-base/base_uid | head -c 4 | tail -c 2))
|
||||
if [ "$id2" = "$id3" ]
|
||||
then
|
||||
id2=$((id2 + 1))
|
||||
fi
|
||||
if [ "$id2" -ge 255 ]
|
||||
then
|
||||
id2=253
|
||||
fi
|
||||
if [ "$id3" -ge 255 ]
|
||||
then
|
||||
id3=254
|
||||
fi
|
||||
ipv4_prefix=10.$id2.$id3
|
||||
fi
|
||||
gen_udhcpd_conf usb0 "${ipv4_prefix}" > /etc/udhcpd.usb0.conf
|
||||
ip addr add $ipv4_prefix.1/24 dev usb0
|
||||
udhcpd -S /etc/udhcpd.usb0.conf
|
||||
fi
|
||||
echo "ok"
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
kill `cat /var/run/udhcpd.usb0.pid`
|
||||
rm /var/run/udhcpd.usb0.pid
|
||||
}
|
||||
|
||||
restart() {
|
||||
start
|
||||
stop
|
||||
}
|
||||
|
||||
if [ "${1}" = "start" ]
|
||||
then
|
||||
start
|
||||
elif [ "${1}" = "stop" ]
|
||||
then
|
||||
stop
|
||||
elif [ "${1}" = "restart" ]
|
||||
then
|
||||
restart
|
||||
fi
|
||||
@@ -1,168 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/profile
|
||||
|
||||
gen_hostapd_conf() {
|
||||
ssid="${1}"
|
||||
pass="${2}"
|
||||
echo "ctrl_interface=/var/run/hostapd"
|
||||
echo "ctrl_interface_group=0"
|
||||
echo "ssid=${ssid}"
|
||||
echo "hw_mode=g"
|
||||
echo "channel=1"
|
||||
echo "beacon_int=100"
|
||||
echo "dtim_period=2"
|
||||
echo "max_num_sta=255"
|
||||
echo "rts_threshold=-1"
|
||||
echo "fragm_threshold=-1"
|
||||
echo "macaddr_acl=0"
|
||||
echo "auth_algs=3"
|
||||
echo "wpa=2"
|
||||
echo "wpa_passphrase=${pass}"
|
||||
echo "ieee80211n=1"
|
||||
}
|
||||
|
||||
|
||||
|
||||
gen_udhcpd_conf() {
|
||||
interface=${1}
|
||||
ipv4_prefix=${2}
|
||||
echo "start ${ipv4_prefix}.100"
|
||||
echo "end ${ipv4_prefix}.200"
|
||||
echo "interface ${interface}"
|
||||
echo "pidfile /var/run/udhcpd.${interface}.pid"
|
||||
echo "lease_file /var/lib/misc/udhcpd.${interface}.leases"
|
||||
echo "option subnet 255.255.255.0"
|
||||
echo "option lease 864000"
|
||||
}
|
||||
|
||||
start() {
|
||||
if [ -e /boot/wifi.sta ]
|
||||
then
|
||||
echo "wifi mode: sta"
|
||||
if [ -e /boot/wpa_supplicant.conf ]
|
||||
then
|
||||
cp /boot/wpa_supplicant.conf /etc/wpa_supplicant.conf
|
||||
else
|
||||
ssid=""
|
||||
pass=""
|
||||
if [ -e /boot/wifi.ssid ]
|
||||
then
|
||||
echo -n "ssid: "
|
||||
cat /boot/wifi.ssid
|
||||
ssid=`cat /boot/wifi.ssid`
|
||||
fi
|
||||
if [ -e /boot/wifi.pass ]
|
||||
then
|
||||
echo -n "wifi.pass: "
|
||||
cat /boot/wifi.pass
|
||||
pass=`cat /boot/wifi.pass`
|
||||
fi
|
||||
if [ ! -z "${ssid}${pass}" ]
|
||||
then
|
||||
echo "ctrl_interface=/var/run/wpa_supplicant" > /etc/wpa_supplicant.conf
|
||||
wpa_passphrase "$ssid" "$pass" >> /etc/wpa_supplicant.conf
|
||||
fi
|
||||
fi
|
||||
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
|
||||
if [ ! -e /boot/wifi.nodhcp ]
|
||||
then
|
||||
(udhcpc -i wlan0 -t 10 -T 1 -A 5 -b -p /run/udhcpc.wlan0.pid) &
|
||||
fi
|
||||
elif [ -e /boot/wifi.ap ]
|
||||
then
|
||||
echo "wifi mode: ap"
|
||||
if [ -e /boot/hostapd.conf ]
|
||||
then
|
||||
cp /boot/hostapd.conf /etc/hostapd.conf
|
||||
else
|
||||
id2=$(printf "%d" 0x$(sha512sum /device_key_legacy | head -c 2))
|
||||
id3=$(printf "%d" 0x$(sha512sum /device_key_legacy | head -c 4 | tail -c 2))
|
||||
if [ "$id2" = "$id3" ]
|
||||
then
|
||||
id2=$((id2 + 1))
|
||||
fi
|
||||
if [ "$id2" -ge 255 ]
|
||||
then
|
||||
id2=253
|
||||
fi
|
||||
if [ "$id3" -ge 255 ]
|
||||
then
|
||||
id3=254
|
||||
fi
|
||||
ssid="licheervnano-${id2}${id3}"
|
||||
pass="licheervnano"
|
||||
if [ -e /boot/wifi.ssid ]
|
||||
then
|
||||
echo -n "ssid: "
|
||||
cat /boot/wifi.ssid
|
||||
ssid=`cat /boot/wifi.ssid`
|
||||
fi
|
||||
if [ -e /boot/wifi.pass ]
|
||||
then
|
||||
echo -n "wifi.pass: "
|
||||
cat /boot/wifi.pass
|
||||
pass=`cat /boot/wifi.pass`
|
||||
fi
|
||||
gen_hostapd_conf "$ssid" "$pass" > /etc/hostapd.conf
|
||||
fi
|
||||
if [ -e /boot/wifi.ipv4_prefix ]
|
||||
then
|
||||
ipv4_prefix=`cat /boot/wifi.ipv4_prefix`
|
||||
else
|
||||
ipv4_prefix=10.$id3.$id2
|
||||
fi
|
||||
if [ ! -e /etc/udhcpd.wlan0.conf ]
|
||||
then
|
||||
gen_udhcpd_conf wlan0 "${ipv4_prefix}" > /etc/udhcpd.wlan0.conf
|
||||
fi
|
||||
ifconfig wlan0 up
|
||||
ip route del default || true
|
||||
# routes=$(ip route show | grep 'dev wlan0' | awk '{print $1}')
|
||||
# for route in $routes; do
|
||||
# ip route del $route dev wlan0
|
||||
# echo "Deleted route $route dev wlan0"
|
||||
# done
|
||||
ip add flush dev wlan0
|
||||
ip addr add $ipv4_prefix.1/24 dev wlan0
|
||||
hostapd -B -i wlan0 /etc/hostapd.conf
|
||||
udhcpd -S /etc/udhcpd.wlan0.conf
|
||||
elif [ -e /boot/wifi.mon ]
|
||||
then
|
||||
echo "wifi mode: mon"
|
||||
airmon-ng start wlan0
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
ps -ef|grep hostapd|grep -v grep|awk '{print $1}'|xargs kill -2 || true
|
||||
ps -ef|grep "udhcpd -S /etc/udhcpd.wlan0.conf" |grep -v grep|awk '{print $1}'|xargs kill -2 || true
|
||||
killall wpa_supplicant || true
|
||||
if [ -e /run/udhcpc.wlan0.pid ]
|
||||
then
|
||||
kill `cat /run/udhcpc.wlan0.pid` || true
|
||||
rm -f /run/udhcpc.wlan0.pid
|
||||
fi
|
||||
if [ -e /var/run/udhcpd.wlan0.pid ]
|
||||
then
|
||||
kill `cat /var/run/udhcpd.wlan0.pid` || true
|
||||
rm -f /var/run/udhcpd.wlan0.pid
|
||||
fi
|
||||
airmon-ng stop wlan0mon || true
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
if [ "${1}" = "start" ]
|
||||
then
|
||||
start
|
||||
elif [ "${1}" = "stop" ]
|
||||
then
|
||||
stop
|
||||
elif [ "${1}" = "restart" ]
|
||||
then
|
||||
restart
|
||||
fi
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting audtest: "
|
||||
if [ -e /boot/audtest ]
|
||||
then
|
||||
touch /tmp/audtest
|
||||
fi
|
||||
(
|
||||
if [ -e /tmp/audtest ]
|
||||
then
|
||||
sleep 20
|
||||
fi
|
||||
while true
|
||||
do
|
||||
if [ ! -e /tmp/audtest ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
. /etc/profile
|
||||
export HOME=/root
|
||||
rm /tmp/rec.wav
|
||||
arecord -f S16_LE -d 1 /tmp/rec.wav
|
||||
aplay -f S16_LE -Dhw:1,0 /tmp/rec.wav
|
||||
sleep 0.5
|
||||
done
|
||||
) &
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping audtest: "
|
||||
rm /tmp/audtest
|
||||
echo "OK"
|
||||
;;
|
||||
restart)
|
||||
printf "Restart audtest: "
|
||||
$(realpath ${0}) stop
|
||||
$(realpath ${0}) start
|
||||
echo "OK"
|
||||
;;
|
||||
esac
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting camtest: "
|
||||
if [ -e /boot/camtest ]
|
||||
then
|
||||
touch /tmp/camtest
|
||||
fi
|
||||
if [ ! -e /tmp/camtest ]
|
||||
then
|
||||
exit 0
|
||||
else
|
||||
sleep 1
|
||||
fi
|
||||
(nice -n 17 /mnt/system/usr/bin/sample_vio 6 &> /dev/null) &
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping camtest: "
|
||||
rm /tmp/camtest
|
||||
killall sample_vio
|
||||
echo "OK"
|
||||
;;
|
||||
restart)
|
||||
printf "Restart camtest: "
|
||||
$(realpath ${0}) stop
|
||||
$(realpath ${0}) start
|
||||
echo "OK"
|
||||
;;
|
||||
esac
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting ednctest: "
|
||||
if [ -e /boot/ednctest ]
|
||||
then
|
||||
touch /tmp/ednctest
|
||||
fi
|
||||
. /etc/profile
|
||||
(
|
||||
while true
|
||||
do
|
||||
if [ ! -e /tmp/ednctest ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
if [ ! -e /tmp/rand.h264 ]
|
||||
then
|
||||
dd if=/dev/urandom of=/tmp/rand.yuv bs=1M count=2
|
||||
/mnt/system/usr/bin/sample_venc -h 1080 -w 1080 -c 264 -i rand.yuv -o /tmp/rand
|
||||
fi
|
||||
/mnt/system/usr/bin/sample_vcodec sample_vdec -c 264 -i rand.h264 -o rand
|
||||
done
|
||||
) &
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping ednctest: "
|
||||
rm /tmp/ednctest
|
||||
echo "OK"
|
||||
;;
|
||||
restart)
|
||||
printf "Restart ednctest: "
|
||||
$(realpath ${0}) stop
|
||||
$(realpath ${0}) start
|
||||
echo "OK"
|
||||
;;
|
||||
esac
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting ivetest: "
|
||||
if [ -e /boot/ivetest ]
|
||||
then
|
||||
touch /tmp/ivetest
|
||||
fi
|
||||
. /etc/profile
|
||||
(
|
||||
while true
|
||||
do
|
||||
if [ ! -e /tmp/ivetest ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
if [ ! -e /tmp/rand2MiB ]
|
||||
then
|
||||
dd if=/dev/urandom of=/tmp/rand2MiB bs=1M count=2
|
||||
fi
|
||||
/mnt/system/usr/bin/ive_stress 1920 1080 /tmp/rand2MiB 1000
|
||||
done
|
||||
) &
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping ivetest: "
|
||||
rm /tmp/ivetest
|
||||
echo "OK"
|
||||
;;
|
||||
restart)
|
||||
printf "Restart ivetest: "
|
||||
$(realpath ${0}) stop
|
||||
$(realpath ${0}) start
|
||||
echo "OK"
|
||||
;;
|
||||
esac
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting lcdtest: "
|
||||
if [ -e /boot/lcdtest ]
|
||||
then
|
||||
touch /tmp/lcdtest
|
||||
fi
|
||||
if [ -e /tmp/lcdtest ]
|
||||
then
|
||||
sleep 2
|
||||
fbpattern
|
||||
fi
|
||||
(
|
||||
while true
|
||||
do
|
||||
if [ ! -e /tmp/lcdtest ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
date | fbbar 0 0xFFFFFFFF 0xFF000000
|
||||
sleep 1
|
||||
done
|
||||
) &
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping lcdtest: "
|
||||
rm /tmp/lcdtest
|
||||
echo "OK"
|
||||
;;
|
||||
restart)
|
||||
printf "Restart lcdtest: "
|
||||
$(realpath ${0}) stop
|
||||
$(realpath ${0}) start
|
||||
echo "OK"
|
||||
;;
|
||||
esac
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting loadtest: "
|
||||
if [ -e /boot/loadtest ]
|
||||
then
|
||||
touch /tmp/loadtest
|
||||
fi
|
||||
(
|
||||
while true
|
||||
do
|
||||
if [ ! -e /tmp/loadtest ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
colorbg=0xFF000000
|
||||
colorfg=0xFFFFFFFF
|
||||
echo "tpu_clk: $(cat /sys/kernel/debug/clk/clk_tpu/clk_rate)" | fbbar 16 $colorfg $colorbg
|
||||
sleep 1
|
||||
done
|
||||
) &
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping loadtest: "
|
||||
rm /tmp/loadtest
|
||||
echo "OK"
|
||||
;;
|
||||
restart)
|
||||
printf "Restart loadtest: "
|
||||
$(realpath ${0}) stop
|
||||
$(realpath ${0}) start
|
||||
echo "OK"
|
||||
;;
|
||||
esac
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "${1}" = "start" ]
|
||||
then
|
||||
if [ ! -e /boot/rclocal.disable ]
|
||||
then
|
||||
sh /etc/rc.local &
|
||||
fi
|
||||
fi
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting modeltest: "
|
||||
if [ -e /boot/modeltest ]
|
||||
then
|
||||
touch /tmp/modeltest
|
||||
fi
|
||||
(
|
||||
while true
|
||||
do
|
||||
if [ ! -e /tmp/modeltest ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
cd /usr/bin/
|
||||
nice -n 19 model_runner_test 10000
|
||||
done
|
||||
) &
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping modeltest: "
|
||||
rm /tmp/modeltest
|
||||
killall model_runner
|
||||
echo "OK"
|
||||
;;
|
||||
restart)
|
||||
printf "Restart modeltest: "
|
||||
$(realpath ${0}) stop
|
||||
$(realpath ${0}) start
|
||||
echo "OK"
|
||||
;;
|
||||
esac
|
||||
@@ -1,109 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
GREEN=0xFF00FF00
|
||||
RED=0xFFFF0000
|
||||
|
||||
WLAN0_TIMEOUT=15
|
||||
ETH0_TIMEOUT=8
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting nettest: "
|
||||
if [ -e /boot/nettest ]
|
||||
then
|
||||
touch /tmp/nettest
|
||||
fi
|
||||
if [ -e /boot/nettest_url ]
|
||||
then
|
||||
url=$(cat /boot/nettest_url)
|
||||
fi
|
||||
if [ -z "${url}" ]
|
||||
then
|
||||
url=http://192.168.0.104:8000/rand10MiB
|
||||
fi
|
||||
(
|
||||
while true
|
||||
do
|
||||
if [ ! -e /tmp/nettest ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
colorbg=0xFF000000
|
||||
colorfg=0xFFFFFFFF
|
||||
wlan0_stat=$(ip link show wlan0 | head -n 1)
|
||||
wlan0_addr=$(ip link show wlan0 | tail -n 1)
|
||||
if [ -z "${wlan0_stat}" ]
|
||||
then
|
||||
wlan0_stat="wlan0 not found"
|
||||
colorfg=$RED
|
||||
fi
|
||||
echo "$wlan0_stat" | fbbar 64 $colorfg $colorbg
|
||||
echo "$wlan0_addr" | fbbar 80 $colorfg $colorbg
|
||||
colorfg=0xFFFFFFFF
|
||||
eth0_stat=$(ip link show eth0 | head -n 1)
|
||||
eth0_addr=$(ip link show eth0 | tail -n 1)
|
||||
if [ -z "${eth0_stat}" ]
|
||||
then
|
||||
eth0_stat="eth0 not found"
|
||||
colorfg=$RED
|
||||
fi
|
||||
echo "$eth0_stat" | fbbar 96 $colorfg $colorbg
|
||||
echo "$eth0_addr" | fbbar 112 $colorfg $colorbg
|
||||
wlan0_dl_start=$(cat /proc/uptime | awk -F. '{print $1}')
|
||||
curl --interface wlan0 --max-time ${WLAN0_TIMEOUT} ${url} > /dev/null
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
wlan0_dl_time=-1
|
||||
udhcpc -i wlan0 -t 1 -T 1 -A 1 -v -n
|
||||
else
|
||||
wlan0_dl_end=$(cat /proc/uptime | awk -F. '{print $1}')
|
||||
wlan0_dl_time=$((wlan0_dl_end - wlan0_dl_start))
|
||||
fi
|
||||
if [ "${wlan0_dl_time}" -ge $((WLAN0_TIMEOUT - 3)) ]
|
||||
then
|
||||
colorfg=$RED
|
||||
elif [ "${wlan0_dl_time}" = -1 ]
|
||||
then
|
||||
colorfg=$RED
|
||||
else
|
||||
colorfg=$GREEN
|
||||
fi
|
||||
echo "wlan0 download test: ${wlan0_dl_time}" | fbbar 128 $colorfg $colorbg
|
||||
eth0_dl_start=$(cat /proc/uptime | awk -F. '{print $1}')
|
||||
curl --interface eth0 --max-time ${ETH0_TIMEOUT} ${url} > /dev/null
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
eth0_dl_time=-1
|
||||
udhcpc -i eth0 -t 1 -T 1 -A 1 -v -n
|
||||
else
|
||||
eth0_dl_end=$(cat /proc/uptime | awk -F. '{print $1}')
|
||||
eth0_dl_time=$((eth0_dl_end - eth0_dl_start))
|
||||
fi
|
||||
if [ "${eth0_dl_time}" -ge $((ETH0_TIMEOUT - 3)) ]
|
||||
then
|
||||
colorfg=$RED
|
||||
elif [ "${eth0_dl_time}" = -1 ]
|
||||
then
|
||||
colorfg=$RED
|
||||
else
|
||||
colorfg=$GREEN
|
||||
fi
|
||||
echo "eth0 download test: ${eth0_dl_time}" | fbbar 144 $colorfg $colorbg
|
||||
sleep 0.5
|
||||
done
|
||||
) &
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping nettest: "
|
||||
rm /tmp/nettest
|
||||
echo "OK"
|
||||
sleep 1
|
||||
;;
|
||||
restart)
|
||||
printf "Restart nettest: "
|
||||
$(realpath ${0}) stop
|
||||
$(realpath ${0}) start
|
||||
echo "OK"
|
||||
;;
|
||||
esac
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting nntest: "
|
||||
if [ -e /boot/nntest ]
|
||||
then
|
||||
touch /tmp/nntest
|
||||
fi
|
||||
(
|
||||
while true
|
||||
do
|
||||
if [ ! -e /tmp/nntest ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
cd /usr/bin/
|
||||
nice -n 19 nn_runner_test 1000
|
||||
done
|
||||
) &
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping nntest: "
|
||||
rm /tmp/nntest
|
||||
killall nn_runner_test
|
||||
echo "OK"
|
||||
;;
|
||||
restart)
|
||||
printf "Restart nntest: "
|
||||
$(realpath ${0}) stop
|
||||
$(realpath ${0}) start
|
||||
echo "OK"
|
||||
;;
|
||||
esac
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/profile
|
||||
|
||||
if [ "${1}" = start ]
|
||||
then
|
||||
# use all sdcard free space for data
|
||||
parted -s /dev/mmcblk0 "resizepart 2 -0"
|
||||
echo "yes
|
||||
100%
|
||||
" | parted ---pretend-input-tty /dev/mmcblk0 "resizepart 2 100%"
|
||||
# resize data filesystem
|
||||
(resize2fs /dev/mmcblk0p2) &
|
||||
fi
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
GREEN=0xFF00FF00
|
||||
RED=0xFFFF0000
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting temptest: "
|
||||
if [ -e /boot/temptest ]
|
||||
then
|
||||
touch /tmp/temptest
|
||||
fi
|
||||
(
|
||||
while true
|
||||
do
|
||||
if [ ! -e /tmp/temptest ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
colorbg=0xFF000000
|
||||
soc_temp=$(cat /sys/class/thermal/thermal_zone0/temp)
|
||||
if [ "${soc_temp}" -le 75000 ]
|
||||
then
|
||||
colorfg=$GREEN
|
||||
else
|
||||
colorfg=$RED
|
||||
fi
|
||||
echo "soc temp: $soc_temp" | fbbar 32 $colorfg $colorbg
|
||||
colorfg=0xFFFFFFFF
|
||||
echo "soc id: $(cat /device_key_legacy)" | fbbar 48 $colorfg $colorbg
|
||||
sleep 1
|
||||
done
|
||||
) &
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping temptest: "
|
||||
rm /tmp/temptest
|
||||
echo "OK"
|
||||
;;
|
||||
restart)
|
||||
printf "Restart temptest: "
|
||||
$(realpath ${0}) stop
|
||||
$(realpath ${0}) start
|
||||
echo "OK"
|
||||
;;
|
||||
esac
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,274 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# 支持的格式,可以通过修改这个变量自定义支持的格式
|
||||
# Supported formats, you can customize the list by modifying this variable
|
||||
supported_formats="yuyv mjpg"
|
||||
|
||||
# 支持的分辨率,可以通过修改这个变量自定义支持的分辨率
|
||||
# Supported resolutions, you can customize the list by modifying this variable
|
||||
supported_resolutions="480x320 640x360 640x480 1280x720 1920x1080 2560x1440"
|
||||
|
||||
|
||||
parse_uvc_config() {
|
||||
input_file="$1" # 传入的文件路径 / Path to the input file
|
||||
parsed_data="" # 初始化 parsed_data 为空 / Initialize parsed_data as empty
|
||||
|
||||
# 检查文件是否存在并可读取 / Check if the file exists and is readable
|
||||
if [ -z "$input_file" ]; then
|
||||
# 没有提供文件路径 / No input file provided
|
||||
echo "Warn: No input file provided for config." 1>&2 # 输出到标准错误 / Output to stderr
|
||||
elif [ ! -f "$input_file" ]; then
|
||||
# 文件不存在 / File does not exist
|
||||
echo "Warn: File '$input_file' does not exist." 1>&2 # 输出到标准错误 / Output to stderr
|
||||
elif [ ! -r "$input_file" ]; then
|
||||
# 文件不可读取 / File is not readable
|
||||
echo "Warn: File '$input_file' is not readable." 1>&2 # 输出到标准错误 / Output to stderr
|
||||
else
|
||||
# 使用 awk 处理文件内容 / Using awk to process the file content
|
||||
parsed_data=$(awk -v resolutions="$supported_resolutions" -v formats="$supported_formats" '
|
||||
BEGIN {
|
||||
OFS = " ";
|
||||
split(resolutions, supported_res, " "); # 将支持的分辨率放入数组 / Split the supported resolutions into an array
|
||||
split(formats, supported_fmt, " "); # 将支持的格式放入数组 / Split the supported formats into an array
|
||||
}
|
||||
/^[^#]/ { # 只处理非 # 开头的行 / Process lines that do not start with #
|
||||
fmt = $1;
|
||||
res = $2;
|
||||
|
||||
# 检查格式是否在支持的格式列表中 / Check if the format is in the supported formats list
|
||||
is_supported_fmt = 0;
|
||||
for (i in supported_fmt) {
|
||||
if (fmt == supported_fmt[i]) {
|
||||
is_supported_fmt = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!is_supported_fmt) {
|
||||
print "Unsupported format:", fmt > "/dev/stderr"; # 输出不支持的格式到标准错误 / Output unsupported format to stderr
|
||||
next;
|
||||
}
|
||||
|
||||
if (res ~ /^[0-9]+x[0-9]+$/) { # 匹配 640x360/1280x720 这种格式 / Match the format like 640x360 or 1280x720
|
||||
is_supported_res = 0;
|
||||
for (i in supported_res) {
|
||||
if (res == supported_res[i]) {
|
||||
is_supported_res = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!is_supported_res) {
|
||||
print "Unsupported resolution:", res > "/dev/stderr"; # 输出不支持的分辨率到标准错误 / Output unsupported resolution to stderr
|
||||
next;
|
||||
}
|
||||
split(res, dims, "x"); # 将 1280x720 按 "x" 分割成宽高 / Split 1280x720 into width and height
|
||||
w = dims[1];
|
||||
h = dims[2];
|
||||
} else {
|
||||
print "Invalid resolution format:", res > "/dev/stderr"; # 输出无效的分辨率格式到标准错误 / Output invalid resolution format to stderr
|
||||
next;
|
||||
}
|
||||
print fmt, w, h; # 输出格式 fmt, w, h / Output fmt, w, h
|
||||
}
|
||||
' "$input_file")
|
||||
fi
|
||||
|
||||
# 确保至少包含 'mjpg' 和 'yuyv' 格式 / Ensure at least one 'mjpg' and 'yuyv' format exists
|
||||
has_mjpg=$(echo "$parsed_data" | grep -w "mjpg")
|
||||
has_yuyv=$(echo "$parsed_data" | grep -w "yuyv")
|
||||
|
||||
if [ -z "$has_mjpg" ]; then
|
||||
default_mjpg=$'\nmjpg 480x320\nmjpg 640x360\nmjpg 640x480\nmjpg 1280x720\nmjpg 1920x1080\nmjpg 2560x1440\n'
|
||||
echo "Warn: No 'mjpg' config found, adding default: $default_mjpg" 1>&2
|
||||
parsed_data="$parsed_data""$(echo "$default_mjpg" | sed 's/x/ /g')"
|
||||
fi
|
||||
|
||||
if [ -z "$has_yuyv" ]; then
|
||||
default_yuyv=$'\nyuyv 480x320\nyuyv 640x360\nyuyv 640x480\nyuyv 1280x720\nyuyv 1920x1080\nyuyv 2560x1440\n'
|
||||
echo "Warn: No 'yuyv' config found, adding default: $default_yuyv" 1>&2
|
||||
parsed_data="$parsed_data""$(echo "$default_yuyv" | sed 's/x/ /g')"
|
||||
fi
|
||||
|
||||
parsed_data=$(echo "$parsed_data" | sed '/^$/d') # 删除空行
|
||||
|
||||
echo "$parsed_data" # 返回解析的数据 / Return the parsed data
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
##########################################################################
|
||||
# UVC
|
||||
|
||||
CONFIGFS_PATH="/sys/kernel/config/usb_gadget/g0"
|
||||
ORIGINAL_DIR=$(pwd) # 记录脚本启动时的目录 / Record the original working directory
|
||||
|
||||
create_frame() {
|
||||
# Example usage:
|
||||
# create_frame <width> <height> <format name>
|
||||
|
||||
WIDTH=$1
|
||||
HEIGHT=$2
|
||||
FORMAT=$3
|
||||
|
||||
if [ "$FORMAT" == "yuyv" ]; then
|
||||
wdir=streaming/uncompressed/u/${HEIGHT}p
|
||||
elif [ "$FORMAT" == "mjpg" ]; then
|
||||
wdir=streaming/mjpeg/m/${HEIGHT}p
|
||||
else
|
||||
echo "only support format yuyv/mjpeg!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p $wdir
|
||||
echo $WIDTH > $wdir/wWidth
|
||||
echo $HEIGHT > $wdir/wHeight
|
||||
echo $(( $WIDTH * $HEIGHT * 2 )) > $wdir/dwMaxVideoFrameBufferSize
|
||||
echo $(( $WIDTH * $HEIGHT * 2 * 8 * 5 )) > $wdir/dwMinBitRate
|
||||
echo $(( $WIDTH * $HEIGHT * 2 * 8 * 60 )) > $wdir/dwMaxBitRate
|
||||
|
||||
cat > $wdir/dwFrameInterval <<EOF
|
||||
166666
|
||||
333333
|
||||
400000
|
||||
500000
|
||||
666666
|
||||
1000000
|
||||
2000000
|
||||
EOF
|
||||
echo "333333" > $wdir/dwDefaultFrameInterval
|
||||
|
||||
<< EOF
|
||||
configure FrameRate
|
||||
dwFrameInterfal is in 100-ns units (fps = 1/(dwFrameInterval * 10000000))
|
||||
166666 -> 60 fps
|
||||
333333 -> 30 fps
|
||||
400000 -> 25 fps
|
||||
500000 -> 20 fps
|
||||
666666 -> 15 fps
|
||||
1000000 -> 10 fps
|
||||
2000000 -> 5 fps
|
||||
5000000 -> 2 fps
|
||||
10000000 -> 1 fps
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
# 挂载 UVC ConfigFS / Mount the UVC ConfigFS
|
||||
mount_uvc_configfs() {
|
||||
echo "Mounting UVC ConfigFS in $(pwd)"
|
||||
|
||||
# 创建 functions/uvc.usb0 目录 / Create the directory for uvc.usb0
|
||||
mkdir -p functions/uvc.usb0
|
||||
cd functions/uvc.usb0
|
||||
|
||||
# 在 functions/uvc.usb0 目录中创建控制头和符号链接 / Create control header and symlink it in uvc.usb0
|
||||
mkdir -p control/header/h
|
||||
ln -s control/header/h/ control/class/fs/
|
||||
ln -s control/header/h/ control/class/ss/
|
||||
|
||||
# streaming_maxpacket sets wMaxPacketSize. Valid values are 1024/2048/3072
|
||||
echo 1024 > streaming_maxpacket
|
||||
# streaming_interval sets bInterval. Values range from 1..255
|
||||
echo 1 > streaming_interval
|
||||
# streaming_maxburst sets bMaxBurst. Valid values are 1..15
|
||||
echo 1 > streaming_maxburst
|
||||
|
||||
# 在 functions/uvc.usb0 目录中创建流媒体路径 / Create streaming paths in uvc.usb0
|
||||
mkdir -p streaming/uncompressed/u # YUV 目录 / YUV directory
|
||||
mkdir -p streaming/mjpeg/m # MJPEG 目录 / MJPEG directory
|
||||
# 执行解析并直接传递给 while 循环进行处理 / Execute parsing and directly pass to while loop for processing
|
||||
parse_uvc_config "$1" | while read fmt w h; do
|
||||
echo "Adding: Format: $fmt, Width: $w, Height: $h" # 输出格式、宽和高 / Output fmt, width, and height
|
||||
create_frame $w $h $fmt
|
||||
done
|
||||
mkdir -p streaming/header/h
|
||||
# 将 YUV 和 MJPEG 目录链接到流媒体头中 / Link YUV and MJPEG to streaming header
|
||||
ln -s streaming/uncompressed/u/ streaming/header/h/
|
||||
ln -s streaming/mjpeg/m/ streaming/header/h/
|
||||
# 将 header 链接到 class 中 / Link header to classes
|
||||
ln -s streaming/header/h/ streaming/class/fs
|
||||
ln -s streaming/header/h/ streaming/class/hs
|
||||
ln -s streaming/header/h/ streaming/class/ss
|
||||
|
||||
cd ../..
|
||||
ln -s functions/uvc.usb0 configs/c.1
|
||||
|
||||
echo "UVC ConfigFS mounted successfully in $(pwd)"
|
||||
}
|
||||
|
||||
# 卸载 UVC ConfigFS / Unmount the UVC ConfigFS
|
||||
unmount_uvc_configfs() {
|
||||
echo "Unmounting UVC ConfigFS in $(pwd)"
|
||||
|
||||
unlink configs/c.1/uvc.usb0
|
||||
|
||||
cd functions/uvc.usb0
|
||||
|
||||
# 删除流媒体目录 / Remove streaming directories
|
||||
unlink streaming/class/fs/h
|
||||
unlink streaming/class/hs/h
|
||||
unlink streaming/class/ss/h
|
||||
|
||||
unlink streaming/header/h/u
|
||||
unlink streaming/header/h/m
|
||||
rmdir streaming/header/h
|
||||
|
||||
rmdir streaming/uncompressed/u/*p
|
||||
rmdir streaming/mjpeg/m/*p
|
||||
rmdir streaming/uncompressed/u
|
||||
rmdir streaming/mjpeg/m
|
||||
|
||||
unlink control/class/fs/h
|
||||
unlink control/class/ss/h
|
||||
rmdir control/header/h
|
||||
|
||||
cd ../..
|
||||
# 删除 functions/uvc.usb0 目录 / Remove the uvc.usb0 directory
|
||||
rmdir functions/uvc.usb0
|
||||
|
||||
echo UVC ConfigFS unmounted successfully in $(pwd)
|
||||
}
|
||||
|
||||
# 进入工作目录 / Enter the working directory
|
||||
cd "$CONFIGFS_PATH" || return 1
|
||||
|
||||
# 处理传入的参数
|
||||
# Process the input arguments
|
||||
case "$1" in
|
||||
"mount")
|
||||
mount_uvc_configfs "$2"
|
||||
;;
|
||||
"unmount")
|
||||
unmount_uvc_configfs
|
||||
;;
|
||||
"server")
|
||||
if [ -z "$(fuser /etc/init.d/uvc-gadget-server.elf)" ]; then
|
||||
(
|
||||
echo "Waiting for UDC start..."
|
||||
while [ -z "$(cat /sys/kernel/config/usb_gadget/g0/UDC)" ]; do
|
||||
echo -n "."
|
||||
sleep 1
|
||||
done
|
||||
sleep 3 # necessary delay time
|
||||
if [ -z "$(fuser /etc/init.d/uvc-gadget-server.elf)" ]; then
|
||||
echo -e "\nServer is starting..." # 输出选择了 server 模式 / Output that the server mode is selected
|
||||
echo -e "===============================\n\n\n"
|
||||
# 在这里添加你希望在 server 模式下执行的其他操作 / Add other operations you want to perform in server mode here
|
||||
/etc/init.d/uvc-gadget-server.elf -u /dev/$(basename /sys/class/udc/*/device/gadget/video4linux/video*) -d -i /bin/cat_224.jpg
|
||||
else
|
||||
echo -e "\nServer has started..."
|
||||
echo -e "===============================\n\n\n"
|
||||
fi
|
||||
) >/tmp/uvc-gadget.log 2>&1 &
|
||||
fi
|
||||
;;
|
||||
"stop_server")
|
||||
fuser -k /etc/init.d/uvc-gadget-server.elf
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {mount <file>|unmount|server|stop_server}" # 提示正确的使用方式 / Prompt the correct usage
|
||||
;;
|
||||
esac
|
||||
|
||||
# 返回原始目录 / Return to the original directory
|
||||
cd "$ORIGINAL_DIR" || return 1
|
||||
@@ -401,3 +401,9 @@ BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="$(TOPDIR)/board/cvitek/SG200X/busybox
|
||||
BR2_TARGET_TZ_INFO=y
|
||||
BR2_TARGET_TZ_ZONELIST="default"
|
||||
BR2_TARGET_LOCALTIME="Etc/UTC"
|
||||
|
||||
BR2_PACKAGE_SER2NET=y
|
||||
|
||||
BR2_PACKAGE_NANO=y
|
||||
|
||||
BR2_PACKAGE_OPENIPMI=y
|
||||
|
||||
@@ -1,264 +1,196 @@
|
||||
BR2_riscv=y
|
||||
BR2_riscv_g=y
|
||||
BR2_RISCV_ISA_RVC=y
|
||||
BR2_RISCV_ABI_LP64D=y
|
||||
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED=y
|
||||
# cvitek vendor toolchain
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="riscv64-unknown-linux-musl"
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_GCC_10=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_10=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_HAS_SSP=y
|
||||
# BR2_TOOLCHAIN_EXTERNAL_INET_RPC is not set
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CXX=y
|
||||
# BR2_TOOLCHAIN_EXTERNAL_FORTRAN is not set
|
||||
BR2_TOOLCHAIN_EXTERNAL_OPENMP=y
|
||||
BR2_OPTIMIZE_2=y
|
||||
BR2_TARGET_LDFLAGS="-mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d"
|
||||
BR2_PACKAGE_GDB=y
|
||||
BR2_PACKAGE_GDB_SERVER=y
|
||||
BR2_PACKAGE_GDB_DEBUGGER=y
|
||||
BR2_PACKAGE_GDB_PYTHON=y
|
||||
BR2_PACKAGE_GDB_TUI=y
|
||||
BR2_PACKAGE_HOST_GDB=y
|
||||
BR2_PACKAGE_HOST_GDB_TUI=y
|
||||
BR2_PACKAGE_HOST_GDB_PYTHON3=y
|
||||
BR2_PACKAGE_HOST_GDB_SIM=y
|
||||
BR2_PACKAGE_HOST_GDB_TUI=y
|
||||
BR2_GDB_VERSION_13=y
|
||||
|
||||
BR2_TARGET_LDFLAGS="-mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d"
|
||||
BR2_CCACHE=y
|
||||
BR2_OPTIMIZE_2=y
|
||||
BR2_REPRODUCIBLE=y
|
||||
BR2_PER_PACKAGE_DIRECTORIES=y
|
||||
|
||||
BR2_TARGET_GENERIC_HOSTNAME="licheervnano"
|
||||
BR2_TARGET_GENERIC_ISSUE="Welcome to Linux"
|
||||
BR2_TARGET_GENERIC_ROOT_PASSWD="root"
|
||||
|
||||
BR2_PACKAGE_AIC8800_SDIO_FIRMWARE=y
|
||||
|
||||
BR2_PACKAGE_CVITEK_RISCV64_MUSL_SYSROOT=y
|
||||
|
||||
BR2_INIT_SYSV=y
|
||||
BR2_ROOTFS_MERGED_USR=y
|
||||
BR2_ENABLE_LOCALE_WHITELIST="C en_US en_US.utf8"
|
||||
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
|
||||
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
|
||||
BR2_PACKAGE_KMOD=y
|
||||
# dont rename network card,
|
||||
# BR2_PACKAGE_EUDEV_RULES_GEN is not set
|
||||
BR2_PACKAGE_EUDEV_ENABLE_HWDB=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_TOOLS=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_HID=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_NETWORK=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_TOOLS_HID2HCI=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_MONITOR=y
|
||||
BR2_PACKAGE_BLUEZ_ALSA=y
|
||||
BR2_PACKAGE_BLUEZ_ALSA_RFCOMM=y
|
||||
BR2_PACKAGE_BLUEZ_ALSA_HCITOP=y
|
||||
BR2_PACKAGE_NTP=y
|
||||
BR2_PACKAGE_NTP_NTPD=y
|
||||
BR2_PACKAGE_NTP_NTPDATE=y
|
||||
BR2_PACKAGE_MACCHANGER=y
|
||||
BR2_PACKAGE_AVAHI=y
|
||||
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
|
||||
BR2_PACKAGE_AVAHI_DAEMON=y
|
||||
# BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY is not set
|
||||
BR2_PACKAGE_AVAHI_DEFAULT_SERVICES=y
|
||||
# BR2_PACKAGE_MDNSD is not set
|
||||
# BR2_PACKAGE_MDNSD_MQUERY is not set
|
||||
# BR2_PACKAGE_MDNSD_HTTP_SERVICE is not set
|
||||
# BR2_PACKAGE_MDNSD_SSH_SERVICE is not set
|
||||
BR2_PACKAGE_WIRELESS_TOOLS=y
|
||||
BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME=y
|
||||
BR2_PACKAGE_WIRELESS_TOOLS_IWCONFIG=y
|
||||
BR2_PACKAGE_WIRELESS_TOOLS_LIB=y
|
||||
BR2_PACKAGE_AIRCRACK_NG=y
|
||||
BR2_PACKAGE_UTIL_LINUX_RFKILL=y
|
||||
BR2_PACKAGE_IPERF3=y
|
||||
BR2_PACKAGE_IPMITOOL=y
|
||||
BR2_PACKAGE_IPMITOOL_PEN_REG_URI=y
|
||||
BR2_PACKAGE_IPMITOOL_LANPLUS=y
|
||||
BR2_PACKAGE_IPMITOOL_USB=y
|
||||
BR2_PACKAGE_IPMITOOL_IPMIEVD=y
|
||||
BR2_PACKAGE_IPMITOOL_IPMISHELL=y
|
||||
BR2_PACKAGE_ETHTOOL=y
|
||||
BR2_PACKAGE_DNSMASQ=y
|
||||
BR2_PACKAGE_DNSMASQ_DHCP=y
|
||||
BR2_PACKAGE_RSYNC=y
|
||||
BR2_PACKAGE_SOCAT=y
|
||||
BR2_PACKAGE_TINC=y
|
||||
BR2_PACKAGE_WIRELESS_REGDB=y
|
||||
BR2_PACKAGE_MOSH=y
|
||||
BR2_PACKAGE_LRZSZ=y
|
||||
BR2_PACKAGE_IW=y
|
||||
BR2_PACKAGE_NETCAT=y
|
||||
BR2_PACKAGE_MTR=y
|
||||
# BR2_PACKAGE_WIREGUARD=y
|
||||
BR2_PACKAGE_WIREGUARD_TOOLS=y
|
||||
# BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_WPA3=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_OVERRIDES=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_WIFI_DISPLAY=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_MESH_NETWORKING=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_IBSS_RSN=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_WEXT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_EAP=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_WPS=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_DBUS=y
|
||||
BR2_PACKAGE_HOSTAPD=y
|
||||
BR2_PACKAGE_HOSTAPD_DRIVER_HOSTAP=y
|
||||
BR2_PACKAGE_HOSTAPD_DRIVER_NL80211=y
|
||||
BR2_PACKAGE_HOSTAPD_ACS=y
|
||||
BR2_PACKAGE_HOSTAPD_EAP=y
|
||||
BR2_PACKAGE_HOSTAPD_WPS=y
|
||||
BR2_PACKAGE_HOSTAPD_WPA3=y
|
||||
# BR2_PACKAGE_HOSTAPD_VLAN is not set
|
||||
BR2_PACKAGE_OPENSSH=y
|
||||
BR2_PACKAGE_OPENSSH_CLIENT=y
|
||||
BR2_PACKAGE_OPENSSH_SERVER=y
|
||||
BR2_PACKAGE_OPENSSH_KEY_UTILS=y
|
||||
BR2_PACKAGE_HAVEGED=y
|
||||
BR2_PACKAGE_LIBOPENSSL_BIN=y
|
||||
BR2_PACKAGE_LIBOPENSSL_ENGINES=y
|
||||
BR2_PACKAGE_PARTED=y
|
||||
BR2_PACKAGE_MEMTESTER=y
|
||||
BR2_PACKAGE_CACHE_CALIBRATOR=y
|
||||
BR2_PACKAGE_DHRYSTONE=y
|
||||
BR2_PACKAGE_COREMARK=y
|
||||
BR2_PACKAGE_RAMSPEED=y
|
||||
BR2_PACKAGE_SPIDEV_TEST=y
|
||||
BR2_PACKAGE_STRESS_NG=y
|
||||
BR2_PACKAGE_STRACE=y
|
||||
BR2_PACKAGE_VMTOUCH=y
|
||||
BR2_ROOTFS_MERGED_USR=y
|
||||
BR2_TARGET_GENERIC_ROOT_PASSWD="root"
|
||||
BR2_ENABLE_LOCALE_WHITELIST="C en_US en_US.utf8"
|
||||
BR2_TARGET_TZ_INFO=y
|
||||
BR2_ROOTFS_OVERLAY="$(TOPDIR)/board/cvitek/SG200X/overlay"
|
||||
BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="$(TOPDIR)/board/cvitek/SG200X/busybox-extra.config"
|
||||
BR2_PACKAGE_ALSA_UTILS=y
|
||||
BR2_PACKAGE_ALSA_UTILS_ALSACTL=y
|
||||
BR2_PACKAGE_ALSA_UTILS_ALSAMIXER=y
|
||||
BR2_PACKAGE_ALSA_UTILS_APLAY=y
|
||||
BR2_PACKAGE_ALSA_UTILS_AMIXER=y
|
||||
BR2_PACKAGE_ALSA_UTILS_APLAY=y
|
||||
BR2_PACKAGE_FFMPEG_GPL=y
|
||||
BR2_PACKAGE_FFMPEG_NONFREE=y
|
||||
BR2_PACKAGE_FFMPEG_FFPROBE=y
|
||||
BR2_PACKAGE_FFMPEG_POSTPROC=y
|
||||
BR2_PACKAGE_MPG123=y
|
||||
BR2_PACKAGE_BZIP2=y
|
||||
BR2_PACKAGE_BROTLI=y
|
||||
BR2_PACKAGE_LRZIP=y
|
||||
BR2_PACKAGE_LZIP=y
|
||||
BR2_PACKAGE_LZOP=y
|
||||
BR2_PACKAGE_P7ZIP=y
|
||||
BR2_PACKAGE_PIGZ=y
|
||||
BR2_PACKAGE_PIXZ=y
|
||||
BR2_PACKAGE_UNRAR=y
|
||||
BR2_PACKAGE_UNZIP=y
|
||||
BR2_PACKAGE_ZIP=y
|
||||
BR2_PACKAGE_ZSTD=y
|
||||
BR2_PACKAGE_LZOP=y
|
||||
BR2_PACKAGE_BROTLI=y
|
||||
BR2_PACKAGE_LIBZIP=y
|
||||
BR2_PACKAGE_LZ4_PROGS=y
|
||||
BR2_PACKAGE_SZIP=y
|
||||
BR2_PACKAGE_CA_CERTIFICATES=y
|
||||
BR2_PACKAGE_EVTEST=y
|
||||
BR2_PACKAGE_BASH=y
|
||||
BR2_PACKAGE_FILE=y
|
||||
BR2_PACKAGE_EMPTY=y
|
||||
BR2_PACKAGE_EXFATPROGS=y
|
||||
BR2_PACKAGE_CACHE_CALIBRATOR=y
|
||||
BR2_PACKAGE_COREMARK=y
|
||||
BR2_PACKAGE_DHRYSTONE=y
|
||||
BR2_PACKAGE_GDB=y
|
||||
BR2_PACKAGE_GDB_SERVER=y
|
||||
BR2_PACKAGE_GDB_DEBUGGER=y
|
||||
BR2_PACKAGE_GDB_TUI=y
|
||||
BR2_PACKAGE_GDB_PYTHON=y
|
||||
BR2_PACKAGE_RAMSPEED=y
|
||||
BR2_PACKAGE_SPIDEV_TEST=y
|
||||
BR2_PACKAGE_STRACE=y
|
||||
BR2_PACKAGE_STRESS_NG=y
|
||||
BR2_PACKAGE_VMTOUCH=y
|
||||
BR2_PACKAGE_E2FSPROGS=y
|
||||
BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y
|
||||
BR2_PACKAGE_TMUX=y
|
||||
BR2_PACKAGE_HTOP=y
|
||||
BR2_PACKAGE_LIBCURL=y
|
||||
BR2_PACKAGE_LIBCURL_CURL=y
|
||||
BR2_PACKAGE_LIBCURL_VERBOSE=y
|
||||
BR2_PACKAGE_LIBCURL_PROXY_SUPPORT=y
|
||||
BR2_PACKAGE_LIBCURL_COOKIES_SUPPORT=y
|
||||
BR2_PACKAGE_LIBCURL_WEBSOCKETS_SUPPORT=y
|
||||
BR2_PACKAGE_LIBCURL_EXTRA_PROTOCOLS_FEATURES=y
|
||||
BR2_PACKAGE_LIBCURL_OPENSSL=y
|
||||
BR2_PACKAGE_LIBWEBSOCKETS=y
|
||||
BR2_PACKAGE_WATCHDOG=y
|
||||
BR2_PACKAGE_EXFATPROGS=y
|
||||
BR2_PACKAGE_SQUASHFS=y
|
||||
BR2_PACKAGE_SQUASHFS_GZIP=y
|
||||
BR2_PACKAGE_SQUASHFS_LZ4=y
|
||||
BR2_PACKAGE_SQUASHFS_LZMA=y
|
||||
BR2_PACKAGE_SQUASHFS_LZO=y
|
||||
BR2_PACKAGE_SQUASHFS_XZ=y
|
||||
BR2_PACKAGE_SQUASHFS_ZSTD=y
|
||||
BR2_PACKAGE_LCDTEST=y
|
||||
BR2_PACKAGE_ASCII_INVADERS=y
|
||||
BR2_PACKAGE_GNUCHESS=y
|
||||
BR2_PACKAGE_SL=y
|
||||
BR2_PACKAGE_XORCURSES=y
|
||||
BR2_PACKAGE_INPUT_EVENT_DAEMON=y
|
||||
BR2_PACKAGE_BLUEZ_TOOLS=y
|
||||
BR2_PACKAGE_TPUDEMO_SG200X=y
|
||||
BR2_PACKAGE_SG2002_CODEC_FIRMWARE=y
|
||||
BR2_PACKAGE_TCPDUMP=y
|
||||
BR2_PACKAGE_SSDP_RESPONDER=y
|
||||
BR2_PACKAGE_PPPD=y
|
||||
BR2_PACKAGE_NFTABLES=y
|
||||
BR2_PACKAGE_BIND=y
|
||||
BR2_PACKAGE_SYSSTAT=y
|
||||
BR2_PACKAGE_TRACEROUTE=y
|
||||
BR2_PACKAGE_IPUTILS=y
|
||||
BR2_PACKAGE_IPROUTE2=y
|
||||
BR2_PACKAGE_IPTABLES=y
|
||||
BR2_PACKAGE_IPTABLES_NFTABLES=y
|
||||
BR2_PACKAGE_NCURSES_WCHAR=y
|
||||
BR2_PACKAGE_RTC_TOOLS=y
|
||||
BR2_PACKAGE_PICOCOM=y
|
||||
BR2_PACKAGE_FBGRAB=y
|
||||
BR2_PACKAGE_DBUS_GLIB=y
|
||||
BR2_PACKAGE_EVTEST=y
|
||||
BR2_PACKAGE_IPMITOOL=y
|
||||
BR2_PACKAGE_IPMITOOL_LANPLUS=y
|
||||
BR2_PACKAGE_IPMITOOL_USB=y
|
||||
BR2_PACKAGE_IPMITOOL_IPMIEVD=y
|
||||
BR2_PACKAGE_IPMITOOL_IPMISHELL=y
|
||||
BR2_PACKAGE_MEMTESTER=y
|
||||
BR2_PACKAGE_MHZ=y
|
||||
BR2_PACKAGE_OPENIPMI=y
|
||||
BR2_PACKAGE_PARTED=y
|
||||
BR2_PACKAGE_PICOCOM=y
|
||||
BR2_PACKAGE_RTC_TOOLS=y
|
||||
BR2_PACKAGE_SETSERIAL=y
|
||||
BR2_PACKAGE_SYSSTAT=y
|
||||
BR2_PACKAGE_UBOOT_TOOLS=y
|
||||
BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT=y
|
||||
BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE=y
|
||||
BR2_PACKAGE_UBOOT_TOOLS_DUMPIMAGE=y
|
||||
|
||||
# if your sdnand is small, you can delete some package
|
||||
# BR2_PACKAGE_IMAGEMAGICK is not set
|
||||
# BR2_PACKAGE_OCRAD is not set
|
||||
# BR2_PACKAGE_SDL is not set
|
||||
# BR2_PACKAGE_SDL_FBCON is not set
|
||||
# BR2_PACKAGE_SDL_GFX is not set
|
||||
# BR2_PACKAGE_SDL_IMAGE is not set
|
||||
# BR2_PACKAGE_SDL_IMAGE_BMP is not set
|
||||
# BR2_PACKAGE_SDL_IMAGE_GIF is not set
|
||||
# BR2_PACKAGE_SDL_IMAGE_JPEG is not set
|
||||
# BR2_PACKAGE_SDL_IMAGE_PNG is not set
|
||||
# BR2_PACKAGE_SDL_IMAGE_WEBP is not set
|
||||
# BR2_PACKAGE_SDL_MIXER is not set
|
||||
# BR2_PACKAGE_SDL_NET is not set
|
||||
# BR2_PACKAGE_SDL_SOUND is not set
|
||||
# BR2_PACKAGE_SDL_SOUND_PLAYSOUND is not set
|
||||
# BR2_PACKAGE_LBREAKOUT2 is not set
|
||||
# BR2_PACKAGE_LBREAKOUT2_AUDIO is not set
|
||||
# BR2_PACKAGE_LBREAKOUT2_NET is not set
|
||||
# BR2_PACKAGE_LTRIS is not set
|
||||
# BR2_PACKAGE_LTRIS_AUDIO is not set
|
||||
# BR2_PACKAGE_PRBOOM is not set
|
||||
# BR2_PACKAGE_DOOM_WAD is not set
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON3_PY_PYC=y
|
||||
BR2_PACKAGE_PYTHON3_2TO3=y
|
||||
BR2_PACKAGE_PYTHON3_CURSES=y
|
||||
BR2_PACKAGE_PYTHON3_READLINE=y
|
||||
BR2_PACKAGE_PYTHON3_XZ=y
|
||||
BR2_PACKAGE_PYTHON_AENUM=y
|
||||
BR2_PACKAGE_PYTHON_ALSAAUDIO=y
|
||||
BR2_PACKAGE_PYTHON_BEAUTIFULSOUP4=y
|
||||
BR2_PACKAGE_PYTHON_BROTLI=y
|
||||
BR2_PACKAGE_PYTHON_BSDIFF4=y
|
||||
BR2_PACKAGE_PYTHON_CRC16=y
|
||||
BR2_PACKAGE_PYTHON_CRCMOD=y
|
||||
BR2_PACKAGE_PYTHON_CRONTAB=y
|
||||
BR2_PACKAGE_PYTHON_CYCLER=y
|
||||
BR2_PACKAGE_PYTHON_DBUS_FAST=y
|
||||
BR2_PACKAGE_PYTHON_DBUS_NEXT=y
|
||||
BR2_PACKAGE_PYTHON_DJANGO=y
|
||||
BR2_PACKAGE_PYTHON_EVDEV=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_BABEL=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_CORS=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_JSONRPC=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_LOGIN=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_SMOREST=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_SQLALCHEMY=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_WTF=y
|
||||
BR2_PACKAGE_PYTHON_FLATBUFFERS=y
|
||||
BR2_PACKAGE_PYTHON_HTML5LIB=y
|
||||
BR2_PACKAGE_PYTHON_HUMANIZE=y
|
||||
BR2_PACKAGE_PYTHON_HWDATA=y
|
||||
BR2_PACKAGE_PYTHON_INTELHEX=y
|
||||
BR2_PACKAGE_PYTHON_IPYTHON=y
|
||||
BR2_PACKAGE_PYTHON_IPYTHON_GENUTILS=y
|
||||
BR2_PACKAGE_PYTHON_KIWISOLVER=y
|
||||
BR2_PACKAGE_PYTHON_LIBEVDEV=y
|
||||
BR2_PACKAGE_PYTHON_LIBUSB1=y
|
||||
BR2_PACKAGE_PYTHON_LXML=y
|
||||
BR2_PACKAGE_PYTHON_MARKDOWN=y
|
||||
BR2_PACKAGE_PYTHON_MSGPACK=y
|
||||
BR2_PACKAGE_PYTHON_NETADDR=y
|
||||
BR2_PACKAGE_PYTHON_NETIFACES=y
|
||||
BR2_PACKAGE_PYTHON_NETWORKX=y
|
||||
BR2_PACKAGE_PYTHON_PAHO_MQTT=y
|
||||
BR2_PACKAGE_PYTHON_PERIPHERY=y
|
||||
BR2_PACKAGE_PYTHON_PIP=y
|
||||
BR2_PACKAGE_PYTHON_POSIX_IPC=y
|
||||
BR2_PACKAGE_PYTHON_PROTOBUF=y
|
||||
BR2_PACKAGE_PYTHON_PSUTIL=y
|
||||
BR2_PACKAGE_PYTHON_PYAES=y
|
||||
BR2_PACKAGE_PYTHON_PYALSA=y
|
||||
BR2_PACKAGE_PYTHON_PYDEVMEM=y
|
||||
BR2_PACKAGE_PYTHON_PYLIBFDT=y
|
||||
BR2_PACKAGE_PYTHON_PYMODBUS=y
|
||||
BR2_PACKAGE_PYTHON_PYPARSING=y
|
||||
BR2_PACKAGE_PYTHON_PYQRCODE=y
|
||||
BR2_PACKAGE_PYTHON_PYSMB=y
|
||||
BR2_PACKAGE_PYTHON_PYUDEV=y
|
||||
BR2_PACKAGE_PYTHON_PYUSB=y
|
||||
BR2_PACKAGE_PYTHON_PYZMQ=y
|
||||
BR2_PACKAGE_PYTHON_QRCODE=y
|
||||
BR2_PACKAGE_PYTHON_QRCODE_PIL=y
|
||||
BR2_PACKAGE_PYTHON_REQUESTS_OAUTHLIB=y
|
||||
BR2_PACKAGE_PYTHON_REQUESTS_TOOLBELT=y
|
||||
BR2_PACKAGE_PYTHON_SCAPY=y
|
||||
BR2_PACKAGE_PYTHON_SELENIUM=y
|
||||
BR2_PACKAGE_PYTHON_SERIAL_ASYNCIO=y
|
||||
BR2_PACKAGE_PYTHON_SMBUS_CFFI=y
|
||||
BR2_PACKAGE_PYTHON_SNAPPY=y
|
||||
BR2_PACKAGE_PYTHON_SOCKETIO=y
|
||||
BR2_PACKAGE_PYTHON_SPIDEV=y
|
||||
BR2_PACKAGE_PYTHON_TINYRPC=y
|
||||
BR2_PACKAGE_PYTHON_TOML=y
|
||||
BR2_PACKAGE_PYTHON_TORNADO=y
|
||||
BR2_PACKAGE_PYTHON_UBJSON=y
|
||||
BR2_PACKAGE_PYTHON_UHID=y
|
||||
BR2_PACKAGE_PYTHON_UJSON=y
|
||||
BR2_PACKAGE_PYTHON_WATCHDOG=y
|
||||
BR2_PACKAGE_PYTHON_WEBSOCKET_CLIENT=y
|
||||
BR2_PACKAGE_PYTHON_WEBSOCKETS=y
|
||||
BR2_PACKAGE_PYTHON_XLSXWRITER=y
|
||||
BR2_PACKAGE_PYTHON_XLUTILS=y
|
||||
BR2_PACKAGE_PYTHON_XMODEM=y
|
||||
BR2_PACKAGE_PYTHON_ZEROCONF=y
|
||||
BR2_PACKAGE_TCL=y
|
||||
# BR2_PACKAGE_TCL_SHLIB_ONLY is not set
|
||||
# BR2_PACKAGE_TCL_DEL_ENCODINGS is not set
|
||||
# BR2_PACKAGE_TCL_SHLIB_ONLY is not set
|
||||
BR2_PACKAGE_EXPECT=y
|
||||
BR2_PACKAGE_TCLLIB=y
|
||||
BR2_PACKAGE_SBC=y
|
||||
BR2_PACKAGE_LIBZIP=y
|
||||
BR2_PACKAGE_LZ4_PROGS=y
|
||||
BR2_PACKAGE_SZIP=y
|
||||
BR2_PACKAGE_CA_CERTIFICATES=y
|
||||
BR2_PACKAGE_LIBOPENSSL_BIN=y
|
||||
BR2_PACKAGE_LIBOPENSSL_ENGINES=y
|
||||
BR2_PACKAGE_LIBQRENCODE=y
|
||||
BR2_PACKAGE_LIBQRENCODE_TOOLS=y
|
||||
BR2_PACKAGE_OPENCV4=y
|
||||
BR2_PACKAGE_OPENCV4_LIB_CALIB3D=y
|
||||
BR2_PACKAGE_OPENCV4_LIB_DNN=y
|
||||
BR2_PACKAGE_OPENCV4_LIB_HIGHGUI=y
|
||||
BR2_PACKAGE_OPENCV4_LIB_OBJDETECT=y
|
||||
BR2_PACKAGE_OPENCV4_LIB_PHOTO=y
|
||||
BR2_PACKAGE_OPENCV4_LIB_PYTHON=y
|
||||
BR2_PACKAGE_OPENCV4_LIB_SHAPE=y
|
||||
BR2_PACKAGE_OPENCV4_LIB_STITCHING=y
|
||||
BR2_PACKAGE_OPENCV4_LIB_SUPERRES=y
|
||||
@@ -274,338 +206,85 @@ BR2_PACKAGE_OPENCV4_WITH_TIFF=y
|
||||
BR2_PACKAGE_OPENCV4_WITH_V4L=y
|
||||
BR2_PACKAGE_OPENCV4_WITH_WEBP=y
|
||||
BR2_PACKAGE_OPENCV4_INSTALL_DATA=y
|
||||
BR2_PACKAGE_LIBQRENCODE=y
|
||||
BR2_PACKAGE_LIBQRENCODE_TOOLS=y
|
||||
BR2_PACKAGE_FFMPEG=y
|
||||
BR2_PACKAGE_FFMPEG_FFMPEG=y
|
||||
BR2_PACKAGE_FFMPEG_FFPROBE=y
|
||||
BR2_PACKAGE_FFMPEG_GPL=y
|
||||
BR2_PACKAGE_FFMPEG_NONFREE=y
|
||||
BR2_PACKAGE_FFMPEG_POSTPROC=y
|
||||
# BR2_PACKAGE_MULTICAT is not set
|
||||
# BR2_PACKAGE_WQY_ZENHEI is not set
|
||||
# BR2_PACKAGE_DEJAVU is not set
|
||||
# BR2_PACKAGE_GNUPLOT is not set
|
||||
# BR2_PACKAGE_TESSERACT_OCR is not set
|
||||
# BR2_PACKAGE_TESSERACT_OCR_LANG_ENG is not set
|
||||
# BR2_PACKAGE_TESSERACT_OCR_LANG_CHI_SIM is not set
|
||||
# BR2_PACKAGE_TESSERACT_OCR_LANG_CHI_TRA is not set
|
||||
# BR2_PACKAGE_QT5 is not set
|
||||
# BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM is not set
|
||||
# BR2_PACKAGE_QT5BASE_GUI is not set
|
||||
# BR2_PACKAGE_QT5BASE_LINUXFB is not set
|
||||
# BR2_PACKAGE_QT5BASE_WIDGETS is not set
|
||||
# BR2_PACKAGE_QT5BASE_DEFAULT_QPA="linuxf is not set
|
||||
# BR2_PACKAGE_QT5BASE_FONTCONFIG is not set
|
||||
# BR2_PACKAGE_QT5BASE_GIF is not set
|
||||
# BR2_PACKAGE_QT5BASE_PNG is not set
|
||||
# BR2_PACKAGE_QT5BASE_JPEG is not set
|
||||
# BR2_PACKAGE_QT5BASE_SYSLOG is not set
|
||||
# BR2_PACKAGE_QT5BASE_DBUS is not set
|
||||
# BR2_PACKAGE_QT5BASE_TSLIB is not set
|
||||
# BR2_PACKAGE_QT5BASE_EXAMPLES is not set
|
||||
# BR2_PACKAGE_QT5BASE_CONCURRENT is not set
|
||||
# BR2_PACKAGE_QT5CONNECTIVITY is not set
|
||||
# BR2_PACKAGE_QT5IMAGEFORMATS is not set
|
||||
# BR2_PACKAGE_QT5MULTIMEDIA is not set
|
||||
# BR2_PACKAGE_QT5SENSORS is not set
|
||||
# BR2_PACKAGE_QT5SERIALBUS is not set
|
||||
# BR2_PACKAGE_QT5CHARTS is not set
|
||||
# BR2_PACKAGE_QT5COAP is not set
|
||||
# BR2_PACKAGE_QT5ENGINIO is not set
|
||||
# BR2_PACKAGE_QT5KNX is not set
|
||||
# BR2_PACKAGE_QT5LOCATION is not set
|
||||
# BR2_PACKAGE_QT5MQTT is not set
|
||||
# BR2_PACKAGE_QT5OPCUA is not set
|
||||
# BR2_PACKAGE_QT5REMOTEOBJECTS is not set
|
||||
# BR2_PACKAGE_QT5SPEECH is not set
|
||||
# BR2_PACKAGE_QT5SVG is not set
|
||||
# BR2_PACKAGE_QT5WEBSOCKETS is not set
|
||||
# BR2_PACKAGE_QT5WEBCHANNEL is not set
|
||||
# BR2_PACKAGE_QEXTSERIALPORT is not set
|
||||
# BR2_PACKAGE_QT5X11EXTRAS is not set
|
||||
# BR2_PACKAGE_QT5XMLPATTERNS is not set
|
||||
# BR2_PACKAGE_QT5BASE_MYSQL is not set
|
||||
# BR2_PACKAGE_QJSON is not set
|
||||
# BR2_PACKAGE_QUAZIP is not set
|
||||
BR2_PACKAGE_OPENCV4_LIB_PYTHON=y
|
||||
# BR2_PACKAGE_OPENCV4_WITH_QT5 is not set
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON3_2TO3=y
|
||||
BR2_PACKAGE_PYTHON3_BZIP2=y
|
||||
BR2_PACKAGE_PYTHON3_CODECSCJK=y
|
||||
BR2_PACKAGE_PYTHON3_CURSES=y
|
||||
BR2_PACKAGE_PYTHON3_READLINE=y
|
||||
BR2_PACKAGE_PYTHON3_SSL=y
|
||||
BR2_PACKAGE_PYTHON3_UNICODEDATA=y
|
||||
BR2_PACKAGE_PYTHON3_SQLITE=y
|
||||
BR2_PACKAGE_PYTHON3_PYEXPAT=y
|
||||
BR2_PACKAGE_PYTHON3_XZ=y
|
||||
BR2_PACKAGE_PYTHON3_ZLIB=y
|
||||
BR2_PACKAGE_PYTHON3_PY_PYC=y
|
||||
|
||||
BR2_PACKAGE_PYTHON_NUMPY=y
|
||||
BR2_PACKAGE_PYTHON_BSDIFF4=y
|
||||
BR2_PACKAGE_PYTHON_BEAUTIFULSOUP4=y
|
||||
BR2_PACKAGE_PYTHON_CFFI=y
|
||||
BR2_PACKAGE_PYTHON_CRC16=y
|
||||
BR2_PACKAGE_PYTHON_DBUS_FAST=y
|
||||
BR2_PACKAGE_PYTHON_DATEUTIL=y
|
||||
BR2_PACKAGE_PYTHON_DBUS_NEXT=y
|
||||
BR2_PACKAGE_PYTHON_DJANGO=y
|
||||
BR2_PACKAGE_PYTHON_FLASK=y
|
||||
BR2_PACKAGE_PYTHON_EVDEV=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_BABEL=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_CORS=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_JSONRPC=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_LOGIN=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_SMOREST=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_SQLALCHEMY=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_WTF=y
|
||||
BR2_PACKAGE_PYTHON_HWDATA=y
|
||||
BR2_PACKAGE_PYTHON_PIP=y
|
||||
BR2_PACKAGE_PYTHON_PEXPECT=y
|
||||
BR2_PACKAGE_PYTHON_PSUTIL=y
|
||||
BR2_PACKAGE_PYTHON_PYAES=y
|
||||
BR2_PACKAGE_PYTHON_PYALSA=y
|
||||
BR2_PACKAGE_PYTHON_PYDEVMEM=y
|
||||
BR2_PACKAGE_PYTHON_PYUSB=y
|
||||
BR2_PACKAGE_PYTHON_REQUESTS=y
|
||||
BR2_PACKAGE_PYTHON_REQUESTS_OAUTHLIB=y
|
||||
BR2_PACKAGE_PYTHON_REQUESTS_TOOLBELT=y
|
||||
BR2_PACKAGE_PYTHON_SERIAL=y
|
||||
BR2_PACKAGE_PYTHON_SERIAL_ASYNCIO=y
|
||||
BR2_PACKAGE_PYTHON_WEBSOCKETS=y
|
||||
BR2_PACKAGE_PYTHON_WEBSOCKET_CLIENT=y
|
||||
BR2_PACKAGE_PYTHON_XMODEM=y
|
||||
BR2_PACKAGE_PYTHON_PYQT5=y
|
||||
BR2_PACKAGE_PYTHON_PYQRCODE=y
|
||||
BR2_PACKAGE_PYTHON_PYLIBFDT=y
|
||||
BR2_PACKAGE_PYTHON_JEDI=y
|
||||
BR2_PACKAGE_PYTHON_LIBUSB1=y
|
||||
BR2_PACKAGE_PYTHON_LXML=y
|
||||
BR2_PACKAGE_PYTHON_MARKDOWN=y
|
||||
BR2_PACKAGE_PYTHON_MSGPACK=y
|
||||
BR2_PACKAGE_PYTHON_PERIPHERY=y
|
||||
BR2_PACKAGE_PYTHON_PILLOW=y
|
||||
BR2_PACKAGE_PYTHON_POSIX_IPC=y
|
||||
BR2_PACKAGE_PYTHON_PROTOBUF=y
|
||||
BR2_PACKAGE_PYTHON_PYUDEV=y
|
||||
BR2_PACKAGE_PYTHON_PYYAML=y
|
||||
BR2_PACKAGE_PYTHON_QRCODE=y
|
||||
BR2_PACKAGE_PYTHON_QRCODE_PIL=y
|
||||
BR2_PACKAGE_PYTHON_INTELHEX=y
|
||||
|
||||
#
|
||||
# External python modules
|
||||
#
|
||||
BR2_PACKAGE_PYTHON_AENUM=y
|
||||
BR2_PACKAGE_PYTHON_ALSAAUDIO=y
|
||||
BR2_PACKAGE_PYTHON_APISPEC=y
|
||||
BR2_PACKAGE_PYTHON_ARGH=y
|
||||
BR2_PACKAGE_PYTHON_ASGIREF=y
|
||||
BR2_PACKAGE_PYTHON_ASTTOKENS=y
|
||||
BR2_PACKAGE_PYTHON_ASYNC_GENERATOR=y
|
||||
BR2_PACKAGE_PYTHON_ASYNC_TIMEOUT=y
|
||||
BR2_PACKAGE_PYTHON_ATTRS=y
|
||||
BR2_PACKAGE_PYTHON_BABEL=y
|
||||
BR2_PACKAGE_PYTHON_BACKCALL=y
|
||||
BR2_PACKAGE_PYTHON_BEAUTIFULSOUP4=y
|
||||
BR2_PACKAGE_PYTHON_BIDICT=y
|
||||
BR2_PACKAGE_PYTHON_BLINKER=y
|
||||
|
||||
#
|
||||
# python-bluezero needs a glibc toolchain, gcc >= 4.9, host gcc >= 8
|
||||
#
|
||||
BR2_PACKAGE_PYTHON_BROTLI=y
|
||||
BR2_PACKAGE_PYTHON_BSDIFF4=y
|
||||
BR2_PACKAGE_PYTHON_CERTIFI=y
|
||||
BR2_PACKAGE_PYTHON_CFFI=y
|
||||
BR2_PACKAGE_PYTHON_CHARSET_NORMALIZER=y
|
||||
BR2_PACKAGE_PYTHON_CLICK=y
|
||||
BR2_PACKAGE_PYTHON_CRC16=y
|
||||
BR2_PACKAGE_PYTHON_CRCMOD=y
|
||||
BR2_PACKAGE_PYTHON_CRONTAB=y
|
||||
BR2_PACKAGE_PYTHON_CYCLER=y
|
||||
BR2_PACKAGE_PYTHON_DATEUTIL=y
|
||||
BR2_PACKAGE_PYTHON_DBUS_FAST=y
|
||||
BR2_PACKAGE_PYTHON_DBUS_NEXT=y
|
||||
BR2_PACKAGE_PYTHON_DECORATOR=y
|
||||
BR2_PACKAGE_PYTHON_DJANGO=y
|
||||
BR2_PACKAGE_PYTHON_ENGINEIO=y
|
||||
BR2_PACKAGE_PYTHON_EVDEV=y
|
||||
BR2_PACKAGE_PYTHON_EXECUTING=y
|
||||
BR2_PACKAGE_PYTHON_FLASK=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_BABEL=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_CORS=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_JSONRPC=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_LOGIN=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_SMOREST=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_SQLALCHEMY=y
|
||||
BR2_PACKAGE_PYTHON_FLASK_WTF=y
|
||||
BR2_PACKAGE_PYTHON_FLATBUFFERS=y
|
||||
|
||||
#
|
||||
# python-gobject needs a glibc toolchain, gcc >= 4.9, host gcc >= 8
|
||||
#
|
||||
BR2_PACKAGE_PYTHON_GREENLET_ARCH_SUPPORTS=y
|
||||
BR2_PACKAGE_PYTHON_H11=y
|
||||
BR2_PACKAGE_PYTHON_HTML5LIB=y
|
||||
BR2_PACKAGE_PYTHON_HUMANIZE=y
|
||||
BR2_PACKAGE_PYTHON_HWDATA=y
|
||||
BR2_PACKAGE_PYTHON_IDNA=y
|
||||
BR2_PACKAGE_PYTHON_IFADDR=y
|
||||
BR2_PACKAGE_PYTHON_INTELHEX=y
|
||||
BR2_PACKAGE_PYTHON_IPYTHON=y
|
||||
BR2_PACKAGE_PYTHON_IPYTHON_GENUTILS=y
|
||||
BR2_PACKAGE_PYTHON_ITSDANGEROUS=y
|
||||
BR2_PACKAGE_PYTHON_JEDI=y
|
||||
BR2_PACKAGE_PYTHON_JINJA2=y
|
||||
BR2_PACKAGE_PYTHON_KIWISOLVER=y
|
||||
|
||||
#
|
||||
# python-libconfig needs a glibc or uClibc toolchain w/ C++, threads
|
||||
#
|
||||
BR2_PACKAGE_PYTHON_LIBEVDEV=y
|
||||
BR2_PACKAGE_PYTHON_LIBUSB1=y
|
||||
BR2_PACKAGE_PYTHON_LXML=y
|
||||
BR2_PACKAGE_PYTHON_MARKUPSAFE=y
|
||||
BR2_PACKAGE_PYTHON_MARSHMALLOW=y
|
||||
BR2_PACKAGE_PYTHON_MSGPACK=y
|
||||
BR2_PACKAGE_PYTHON_MYPY_EXTENSIONS=y
|
||||
BR2_PACKAGE_PYTHON_NETADDR=y
|
||||
BR2_PACKAGE_PYTHON_NETIFACES=y
|
||||
BR2_PACKAGE_PYTHON_NETWORKX=y
|
||||
BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS=y
|
||||
BR2_PACKAGE_PYTHON_NUMPY=y
|
||||
BR2_PACKAGE_PYTHON_OAUTHLIB=y
|
||||
BR2_PACKAGE_PYTHON_OUTCOME=y
|
||||
BR2_PACKAGE_PYTHON_PACKAGING=y
|
||||
BR2_PACKAGE_PYTHON_PAHO_MQTT=y
|
||||
BR2_PACKAGE_PYTHON_PARSO=y
|
||||
BR2_PACKAGE_PYTHON_PATHTOOLS=y
|
||||
BR2_PACKAGE_PYTHON_PERIPHERY=y
|
||||
BR2_PACKAGE_PYTHON_PEXPECT=y
|
||||
BR2_PACKAGE_PYTHON_PICKLESHARE=y
|
||||
BR2_PACKAGE_PYTHON_PILLOW=y
|
||||
BR2_PACKAGE_PYTHON_PIP=y
|
||||
BR2_PACKAGE_PYTHON_POSIX_IPC=y
|
||||
BR2_PACKAGE_PYTHON_PROMPT_TOOLKIT=y
|
||||
BR2_PACKAGE_PYTHON_PROTOBUF=y
|
||||
BR2_PACKAGE_PYTHON_PSUTIL=y
|
||||
BR2_PACKAGE_PYTHON_PTYPROCESS=y
|
||||
BR2_PACKAGE_PYTHON_PURE_EVAL=y
|
||||
BR2_PACKAGE_PYTHON_PYAES=y
|
||||
BR2_PACKAGE_PYTHON_PYALSA=y
|
||||
BR2_PACKAGE_PYTHON_PYASN1=y
|
||||
BR2_PACKAGE_PYTHON_PYCPARSER=y
|
||||
BR2_PACKAGE_PYTHON_PYDEVMEM=y
|
||||
BR2_PACKAGE_PYTHON_PYGMENTS=y
|
||||
BR2_PACKAGE_PYTHON_PYLIBFDT=y
|
||||
BR2_PACKAGE_PYTHON_PYMODBUS=y
|
||||
|
||||
#
|
||||
# python-pymupdf needs Xorg
|
||||
#
|
||||
BR2_PACKAGE_PYTHON_PYPARSING=y
|
||||
BR2_PACKAGE_PYTHON_PYQRCODE=y
|
||||
|
||||
#
|
||||
# python-pyqt5 needs Qt5
|
||||
#
|
||||
BR2_PACKAGE_PYTHON_PYSMB=y
|
||||
BR2_PACKAGE_PYTHON_PYSOCKS=y
|
||||
BR2_PACKAGE_PYTHON_PYTZ=y
|
||||
BR2_PACKAGE_PYTHON_PYUDEV=y
|
||||
BR2_PACKAGE_PYTHON_PYUSB=y
|
||||
BR2_PACKAGE_PYTHON_PYYAML=y
|
||||
BR2_PACKAGE_PYTHON_PYZMQ=y
|
||||
BR2_PACKAGE_PYTHON_QRCODE=y
|
||||
BR2_PACKAGE_PYTHON_QRCODE_PIL=y
|
||||
BR2_PACKAGE_PYTHON_REQUESTS=y
|
||||
BR2_PACKAGE_PYTHON_REQUESTS_OAUTHLIB=y
|
||||
BR2_PACKAGE_PYTHON_REQUESTS_TOOLBELT=y
|
||||
BR2_PACKAGE_PYTHON_SCAPY=y
|
||||
|
||||
#
|
||||
# python-scipy needs glibc or musl toolchain w/ fortran, c++, gcc >= 9, host gcc >= 9
|
||||
#
|
||||
BR2_PACKAGE_PYTHON_SELENIUM=y
|
||||
BR2_PACKAGE_PYTHON_SERIAL=y
|
||||
BR2_PACKAGE_PYTHON_SERIAL_ASYNCIO=y
|
||||
BR2_PACKAGE_PYTHON_SETUPTOOLS=y
|
||||
BR2_PACKAGE_PYTHON_SIX=y
|
||||
BR2_PACKAGE_PYTHON_SMBUS_CFFI=y
|
||||
BR2_PACKAGE_PYTHON_SNAPPY=y
|
||||
BR2_PACKAGE_PYTHON_SNIFFIO=y
|
||||
BR2_PACKAGE_PYTHON_SOCKETIO=y
|
||||
BR2_PACKAGE_PYTHON_SORTEDCONTAINERS=y
|
||||
BR2_PACKAGE_PYTHON_SOUPSIEVE=y
|
||||
BR2_PACKAGE_PYTHON_SPIDEV=y
|
||||
BR2_PACKAGE_PYTHON_SQLALCHEMY=y
|
||||
BR2_PACKAGE_PYTHON_SQLPARSE=y
|
||||
BR2_PACKAGE_PYTHON_STACK_DATA=y
|
||||
|
||||
#
|
||||
# python-systemd needs systemd
|
||||
#
|
||||
BR2_PACKAGE_PYTHON_TINYRPC=y
|
||||
BR2_PACKAGE_PYTHON_TOML=y
|
||||
BR2_PACKAGE_PYTHON_TORNADO=y
|
||||
BR2_PACKAGE_PYTHON_TQDM=y
|
||||
BR2_PACKAGE_PYTHON_TRAITLETS=y
|
||||
BR2_PACKAGE_PYTHON_TRIO=y
|
||||
BR2_PACKAGE_PYTHON_TRIO_WEBSOCKET=y
|
||||
BR2_PACKAGE_PYTHON_TYPEGUARD=y
|
||||
BR2_PACKAGE_PYTHON_TYPING_EXTENSIONS=y
|
||||
BR2_PACKAGE_PYTHON_TYPING_INSPECT=y
|
||||
BR2_PACKAGE_PYTHON_UBJSON=y
|
||||
BR2_PACKAGE_PYTHON_UHID=y
|
||||
BR2_PACKAGE_PYTHON_UJSON=y
|
||||
BR2_PACKAGE_PYTHON_URLLIB3=y
|
||||
BR2_PACKAGE_PYTHON_WATCHDOG=y
|
||||
BR2_PACKAGE_PYTHON_WCWIDTH=y
|
||||
BR2_PACKAGE_PYTHON_WEBARGS=y
|
||||
BR2_PACKAGE_PYTHON_WEBENCODINGS=y
|
||||
BR2_PACKAGE_PYTHON_WEBSOCKET_CLIENT=y
|
||||
BR2_PACKAGE_PYTHON_WEBSOCKETS=y
|
||||
BR2_PACKAGE_PYTHON_WERKZEUG=y
|
||||
BR2_PACKAGE_PYTHON_WSPROTO=y
|
||||
BR2_PACKAGE_PYTHON_WTFORMS=y
|
||||
BR2_PACKAGE_PYTHON_XLRD=y
|
||||
BR2_PACKAGE_PYTHON_XLSXWRITER=y
|
||||
BR2_PACKAGE_PYTHON_XLUTILS=y
|
||||
BR2_PACKAGE_PYTHON_XLWT=y
|
||||
BR2_PACKAGE_PYTHON_XMODEM=y
|
||||
BR2_PACKAGE_PYTHON_ZEROCONF=y
|
||||
|
||||
# BR2_PACKAGE_MGBA is not set
|
||||
# BR2_PACKAGE_GB_TEST_ROMS is not set
|
||||
|
||||
# BR2_PACKAGE_NGINX=y
|
||||
# BR2_PACKAGE_NGINX_HTTP=y
|
||||
# BR2_PACKAGE_NGINX_HTTP_DAV_MODULE=y
|
||||
# BR2_PACKAGE_NGINX_HTTP_MP4_MODULE=y
|
||||
# BR2_PACKAGE_NGINX_HTTP_FLV_MODULE=y
|
||||
# BR2_PACKAGE_NGINX_HTTP_GUNZIP_MODULE=y
|
||||
# BR2_PACKAGE_NGINX_STREAM=y
|
||||
# BR2_PACKAGE_NGINX_SELECT_MODULE=y
|
||||
# BR2_PACKAGE_NGINX_HTTP_FASTCGI_MODULE=y
|
||||
# BR2_PACKAGE_NGINX_HTTP_UWSGI_MODULE=y
|
||||
# BR2_PACKAGE_NGINX_HTTP_SCGI_MODULE=y
|
||||
|
||||
BR2_PACKAGE_VIM=y
|
||||
BR2_PACKAGE_VIM_RUNTIME=y
|
||||
|
||||
BR2_PACKAGE_LIBCURL=y
|
||||
BR2_PACKAGE_LIBCURL_CURL=y
|
||||
BR2_PACKAGE_LIBCURL_VERBOSE=y
|
||||
BR2_PACKAGE_LIBCURL_WEBSOCKETS_SUPPORT=y
|
||||
BR2_PACKAGE_LIBWEBSOCKETS=y
|
||||
BR2_PACKAGE_LIBBSD=y
|
||||
BR2_PACKAGE_NCURSES_WCHAR=y
|
||||
BR2_PACKAGE_EMPTY=y
|
||||
BR2_PACKAGE_HAVEGED=y
|
||||
BR2_PACKAGE_AIRCRACK_NG=y
|
||||
BR2_PACKAGE_AVAHI=y
|
||||
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
|
||||
BR2_PACKAGE_AVAHI_DAEMON=y
|
||||
BR2_PACKAGE_AVAHI_DEFAULT_SERVICES=y
|
||||
BR2_PACKAGE_BIND=y
|
||||
BR2_PACKAGE_DNSMASQ=y
|
||||
BR2_PACKAGE_ETHTOOL=y
|
||||
BR2_PACKAGE_HOSTAPD=y
|
||||
BR2_PACKAGE_HOSTAPD_EAP=y
|
||||
BR2_PACKAGE_HOSTAPD_WPS=y
|
||||
BR2_PACKAGE_HOSTAPD_WPA3=y
|
||||
# BR2_PACKAGE_HOSTAPD_VLAN is not set
|
||||
BR2_PACKAGE_IPERF3=y
|
||||
BR2_PACKAGE_IPROUTE2=y
|
||||
BR2_PACKAGE_IPTABLES=y
|
||||
BR2_PACKAGE_IPTABLES_NFTABLES=y
|
||||
BR2_PACKAGE_IPUTILS=y
|
||||
BR2_PACKAGE_IW=y
|
||||
BR2_PACKAGE_LRZSZ=y
|
||||
BR2_PACKAGE_MACCHANGER=y
|
||||
BR2_PACKAGE_MOSH=y
|
||||
BR2_PACKAGE_MTR=y
|
||||
BR2_PACKAGE_NETCAT=y
|
||||
BR2_PACKAGE_NFTABLES=y
|
||||
BR2_PACKAGE_NTP=y
|
||||
BR2_PACKAGE_NTP_NTPDATE=y
|
||||
BR2_PACKAGE_PPPD=y
|
||||
BR2_PACKAGE_RSYNC=y
|
||||
BR2_PACKAGE_SER2NET=y
|
||||
BR2_PACKAGE_SOCAT=y
|
||||
BR2_PACKAGE_SSDP_RESPONDER=y
|
||||
BR2_PACKAGE_TCPDUMP=y
|
||||
BR2_PACKAGE_TINC=y
|
||||
BR2_PACKAGE_TRACEROUTE=y
|
||||
BR2_PACKAGE_WIREGUARD_TOOLS=y
|
||||
BR2_PACKAGE_WIRELESS_REGDB=y
|
||||
BR2_PACKAGE_WIRELESS_TOOLS=y
|
||||
BR2_PACKAGE_WIRELESS_TOOLS_IFRENAME=y
|
||||
BR2_PACKAGE_WIRELESS_TOOLS_LIB=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_WEXT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_IBSS_RSN=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_WIFI_DISPLAY=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_MESH_NETWORKING=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_OVERRIDES=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_WPS=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_WPA3=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_DBUS=y
|
||||
BR2_PACKAGE_BASH=y
|
||||
BR2_PACKAGE_FILE=y
|
||||
BR2_PACKAGE_TMUX=y
|
||||
BR2_PACKAGE_AXP2101=y
|
||||
|
||||
BR2_PACKAGE_HTOP=y
|
||||
BR2_PACKAGE_UTIL_LINUX_RFKILL=y
|
||||
BR2_PACKAGE_WATCHDOG=y
|
||||
BR2_PACKAGE_NANO=y
|
||||
BR2_PACKAGE_VIM=y
|
||||
BR2_PACKAGE_AIC8800_SDIO_FIRMWARE=y
|
||||
BR2_PACKAGE_CVITEK_RISCV64_MUSL_SYSROOT=y
|
||||
BR2_PACKAGE_LCDTEST=y
|
||||
BR2_PACKAGE_TPUDEMO_SG200X=y
|
||||
BR2_PACKAGE_SG2002_CODEC_FIRMWARE=y
|
||||
BR2_TARGET_ROOTFS_EXT2=y
|
||||
BR2_TARGET_ROOTFS_EXT2_4=y
|
||||
BR2_TARGET_ROOTFS_EXT2_SIZE="1536M"
|
||||
|
||||
BR2_ROOTFS_OVERLAY="$(TOPDIR)/board/cvitek/SG200X/overlay"
|
||||
BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="$(TOPDIR)/board/cvitek/SG200X/busybox-extra.config"
|
||||
|
||||
BR2_TARGET_TZ_INFO=y
|
||||
BR2_TARGET_TZ_ZONELIST="default"
|
||||
BR2_TARGET_LOCALTIME="Etc/UTC"
|
||||
@@ -4,8 +4,8 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
AIC8800_SDIO_FIRMWARE_VERSION = e44a51d3c129bbd7413848a430b8206556e923a5
|
||||
AIC8800_SDIO_FIRMWARE_SITE = $(call github,0x754C,aic8800-sdio-firmware,$(AIC8800_SDIO_FIRMWARE_VERSION))
|
||||
AIC8800_SDIO_FIRMWARE_VERSION = c56f910044cc854d6c553bcb9a644f3bca5a4c38
|
||||
AIC8800_SDIO_FIRMWARE_SITE = $(call github,lxowalle,aic8800-sdio-firmware,$(AIC8800_SDIO_FIRMWARE_VERSION))
|
||||
|
||||
define AIC8800_SDIO_FIRMWARE_INSTALL_TARGET_CMDS
|
||||
mkdir -pv $(TARGET_DIR)/usr/lib/firmware/aic8800_sdio/
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# From http://sourceforge.net/projects/openipmi/files/OpenIPMI%202.0%20Library/
|
||||
sha1 bc910d5d682710e9ff290c33e0780a71edba29d4 OpenIPMI-2.0.34.tar.gz
|
||||
md5 9d27cc86b95a29251009db96452e7213 OpenIPMI-2.0.34.tar.gz
|
||||
sha1 a7b8b581a32b649cbf5bc79926f97d59919c5b79 OpenIPMI-2.0.36.tar.gz
|
||||
md5 e77028dcfb6e91cc256da19723af1a2e OpenIPMI-2.0.36.tar.gz
|
||||
# Locally computed
|
||||
sha256 93227e43c72b5c3bd5949323e0669aa5527d1a971473a3a365af03fb8284a95f OpenIPMI-2.0.34.tar.gz
|
||||
sha256 a0403148fa5f7bed930c958a4d1c558047e273763a408b3a0368edc137cc55d9 OpenIPMI-2.0.36.tar.gz
|
||||
sha256 32b1062f7da84967e7019d01ab805935caa7ab7321a7ced0e30ebe75e5df1670 COPYING
|
||||
sha256 185323a62589e7ee80f86bf2ea29caad9a09fdda0ea3f1c00db8b778c7edf60e COPYING.BSD
|
||||
sha256 5bbcbb737e60fe9deba08ecbd00920cfcc3403ba2e534c64fdeea49d6bb87509 COPYING.LIB
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
OPENIPMI_VERSION = 2.0.34
|
||||
OPENIPMI_VERSION = 2.0.36
|
||||
OPENIPMI_SITE = https://sourceforge.net/projects/openipmi/files/OpenIPMI%202.0%20Library
|
||||
OPENIPMI_SOURCE = OpenIPMI-$(OPENIPMI_VERSION).tar.gz
|
||||
OPENIPMI_LICENSE = LGPL-2.0+, GPL-2.0+, BSD-3-Clause
|
||||
|
||||
34
kvm/data/sensor_cfg.ini
Normal file
34
kvm/data/sensor_cfg.ini
Normal file
@@ -0,0 +1,34 @@
|
||||
[source]
|
||||
|
||||
;type = SOURCE_USER_FE
|
||||
|
||||
dev_num = 1
|
||||
|
||||
; section for sensor
|
||||
|
||||
[sensor]
|
||||
|
||||
; sensor name
|
||||
name = LONTIUM_LT6911_2M_60FPS_8BIT
|
||||
|
||||
bus_id = 4
|
||||
|
||||
sns_i2c_addr = ff
|
||||
|
||||
mipi_dev = 0
|
||||
|
||||
lane_id = 2, 4, 3, 1, 0
|
||||
|
||||
pn_swap = 0, 0, 0, 0, 0
|
||||
|
||||
mclk_en = 0
|
||||
|
||||
mclk = 0
|
||||
|
||||
;port = 0
|
||||
|
||||
;pin = 2
|
||||
|
||||
;pol = 1
|
||||
|
||||
fps = 60
|
||||
34
kvm/data/sensor_cfg.ini.LT
Normal file
34
kvm/data/sensor_cfg.ini.LT
Normal file
@@ -0,0 +1,34 @@
|
||||
[source]
|
||||
|
||||
;type = SOURCE_USER_FE
|
||||
|
||||
dev_num = 1
|
||||
|
||||
; section for sensor
|
||||
|
||||
[sensor]
|
||||
|
||||
; sensor name
|
||||
name = LONTIUM_LT6911_2M_60FPS_8BIT
|
||||
|
||||
bus_id = 4
|
||||
|
||||
sns_i2c_addr = ff
|
||||
|
||||
mipi_dev = 0
|
||||
|
||||
lane_id = 2, 4, 3, 1, 0
|
||||
|
||||
pn_swap = 0, 0, 0, 0, 0
|
||||
|
||||
mclk_en = 0
|
||||
|
||||
mclk = 0
|
||||
|
||||
;port = 0
|
||||
|
||||
;pin = 2
|
||||
|
||||
;pol = 1
|
||||
|
||||
fps = 60
|
||||
34
kvm/data/sensor_cfg.ini.OA
Executable file
34
kvm/data/sensor_cfg.ini.OA
Executable file
@@ -0,0 +1,34 @@
|
||||
[source]
|
||||
|
||||
;type = SOURCE_USER_FE
|
||||
|
||||
dev_num = 1
|
||||
|
||||
; section for sensor
|
||||
|
||||
[sensor]
|
||||
|
||||
; sensor name
|
||||
name = OV_OS04A10_MIPI_4M_1440P_30FPS_12BIT
|
||||
|
||||
bus_id = 4
|
||||
|
||||
sns_i2c_addr = 36
|
||||
|
||||
mipi_dev = 0
|
||||
|
||||
lane_id = 2, 1, 3, 0, 4
|
||||
|
||||
pn_swap = 0, 0, 0, 0, 0
|
||||
|
||||
mclk_en = 0
|
||||
|
||||
mclk = 0
|
||||
|
||||
;port = 0
|
||||
|
||||
;pin = 2
|
||||
|
||||
;pol = 1
|
||||
|
||||
;fps = 30
|
||||
34
kvm/data/sensor_cfg.ini.SC035
Executable file
34
kvm/data/sensor_cfg.ini.SC035
Executable file
@@ -0,0 +1,34 @@
|
||||
[source]
|
||||
|
||||
;type = SOURCE_USER_FE
|
||||
|
||||
dev_num = 1
|
||||
|
||||
; section for sensor
|
||||
|
||||
[sensor]
|
||||
|
||||
; sensor name
|
||||
name = SMS_SC035GS_MIPI_480P_120FPS_12BIT
|
||||
|
||||
bus_id = 4
|
||||
|
||||
sns_i2c_addr = 30
|
||||
|
||||
mipi_dev = 0
|
||||
|
||||
lane_id = 4, 3, 2, -1, -1
|
||||
|
||||
pn_swap = 0, 0, 0, 0, 0
|
||||
|
||||
mclk_en = 1
|
||||
|
||||
mclk = 1
|
||||
|
||||
;port = 0
|
||||
|
||||
;pin = 2
|
||||
|
||||
;pol = 1
|
||||
|
||||
;fps = 30
|
||||
34
kvm/data/sensor_cfg.ini.alpha
Normal file
34
kvm/data/sensor_cfg.ini.alpha
Normal file
@@ -0,0 +1,34 @@
|
||||
[source]
|
||||
|
||||
;type = SOURCE_USER_FE
|
||||
|
||||
dev_num = 1
|
||||
|
||||
; section for sensor
|
||||
|
||||
[sensor]
|
||||
|
||||
; sensor name
|
||||
name = GCORE_GC4653_MIPI_4M_30FPS_10BIT
|
||||
|
||||
bus_id = 4
|
||||
|
||||
sns_i2c_addr = 29
|
||||
|
||||
mipi_dev = 0
|
||||
|
||||
lane_id = 2, 1, 0, -1, -1
|
||||
|
||||
pn_swap = 0, 0, 0, 0, 0
|
||||
|
||||
mclk_en = 1
|
||||
|
||||
mclk = 0
|
||||
|
||||
;port = 0
|
||||
|
||||
;pin = 2
|
||||
|
||||
;pol = 1
|
||||
|
||||
;fps = 30
|
||||
34
kvm/data/sensor_cfg.ini.beta
Normal file
34
kvm/data/sensor_cfg.ini.beta
Normal file
@@ -0,0 +1,34 @@
|
||||
[source]
|
||||
|
||||
;type = SOURCE_USER_FE
|
||||
|
||||
dev_num = 1
|
||||
|
||||
; section for sensor
|
||||
|
||||
[sensor]
|
||||
|
||||
; sensor name
|
||||
name = GCORE_GC4653_MIPI_4M_30FPS_10BIT
|
||||
|
||||
bus_id = 4
|
||||
|
||||
sns_i2c_addr = 29
|
||||
|
||||
mipi_dev = 0
|
||||
|
||||
lane_id = 4, 3, 2, -1, -1
|
||||
|
||||
pn_swap = 0, 0, 0, 0, 0
|
||||
|
||||
mclk_en = 1
|
||||
|
||||
mclk = 1
|
||||
|
||||
;port = 0
|
||||
|
||||
;pin = 2
|
||||
|
||||
;pol = 1
|
||||
|
||||
;fps = 30
|
||||
202
kvm/frp_0.59.0_linux_riscv64/LICENSE
Normal file
202
kvm/frp_0.59.0_linux_riscv64/LICENSE
Normal file
@@ -0,0 +1,202 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
BIN
kvm/frp_0.59.0_linux_riscv64/frpc
Executable file
BIN
kvm/frp_0.59.0_linux_riscv64/frpc
Executable file
Binary file not shown.
9
kvm/frp_0.59.0_linux_riscv64/frpc.toml
Normal file
9
kvm/frp_0.59.0_linux_riscv64/frpc.toml
Normal file
@@ -0,0 +1,9 @@
|
||||
serverAddr = "127.0.0.1"
|
||||
serverPort = 7000
|
||||
|
||||
[[proxies]]
|
||||
name = "test-tcp"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 22
|
||||
remotePort = 6000
|
||||
BIN
kvm/frp_0.59.0_linux_riscv64/frps
Normal file
BIN
kvm/frp_0.59.0_linux_riscv64/frps
Normal file
Binary file not shown.
1
kvm/frp_0.59.0_linux_riscv64/frps.toml
Normal file
1
kvm/frp_0.59.0_linux_riscv64/frps.toml
Normal file
@@ -0,0 +1 @@
|
||||
bindPort = 7000
|
||||
424
kvm/merge_nanokvm_app.sh
Executable file
424
kvm/merge_nanokvm_app.sh
Executable file
@@ -0,0 +1,424 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
set +x
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage:
|
||||
kvm/merge_nanokvm_app.sh [options]
|
||||
|
||||
Options:
|
||||
-i, --image FILE Input image. Defaults to the latest non-*-nanokvm.img in
|
||||
install/soc_sg2002_licheervnano_sd/images/.
|
||||
-o, --output FILE Output image. Defaults to INPUT-nanokvm.img.
|
||||
-a, --app-dir DIR NanoKVM source directory. Defaults to ../NanoKVM next to
|
||||
this SDK directory.
|
||||
-m, --mount-dir DIR Temporary mount directory. Defaults to ./mountpoint.
|
||||
--skip-copy-kvmapp Use existing kvm/kvmapp instead of copying from APP_DIR.
|
||||
-f, --force Overwrite the output image if it already exists.
|
||||
-h, --help Show this help.
|
||||
|
||||
Examples:
|
||||
./kvm/merge_nanokvm_app.sh
|
||||
./kvm/merge_nanokvm_app.sh -i install/soc_sg2002_licheervnano_sd/images/out.img
|
||||
./kvm/merge_nanokvm_app.sh -i base.img -o base-nanokvm.img
|
||||
./kvm/merge_nanokvm_app.sh -a "$HOME/LicheeRV_NanoKVM/NanoKVM"
|
||||
EOF
|
||||
}
|
||||
|
||||
die() {
|
||||
echo "error: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
warn() {
|
||||
echo "warning: $*" >&2
|
||||
}
|
||||
|
||||
info() {
|
||||
echo "==> $*"
|
||||
}
|
||||
|
||||
run_step() {
|
||||
desc=$1
|
||||
shift
|
||||
|
||||
info "$desc"
|
||||
if "$@"; then
|
||||
return 0
|
||||
else
|
||||
status=$?
|
||||
die "$desc failed with exit code $status"
|
||||
fi
|
||||
}
|
||||
|
||||
need_file() {
|
||||
[ -f "$1" ] || die "missing file: $1"
|
||||
}
|
||||
|
||||
need_exec() {
|
||||
[ -x "$1" ] || die "missing executable file: $1"
|
||||
}
|
||||
|
||||
need_dir() {
|
||||
[ -d "$1" ] || die "missing directory: $1"
|
||||
}
|
||||
|
||||
copy_image() {
|
||||
src=$1
|
||||
dst=$2
|
||||
|
||||
cp --reflink=auto --sparse=always "$src" "$dst" 2>/dev/null || cp "$src" "$dst"
|
||||
}
|
||||
|
||||
partition2_offset_bytes() {
|
||||
partx -s "$1" | awk '$1 == 2 { print $2 * 512; found = 1 } END { exit !found }'
|
||||
}
|
||||
|
||||
is_mounted() {
|
||||
if command -v mountpoint >/dev/null 2>&1; then
|
||||
mountpoint -q "$MOUNT_DIR" && return 0
|
||||
fi
|
||||
|
||||
if command -v findmnt >/dev/null 2>&1; then
|
||||
findmnt -rn --mountpoint "$MOUNT_DIR" >/dev/null 2>&1 && return 0
|
||||
fi
|
||||
|
||||
if [ -r /proc/mounts ]; then
|
||||
awk -v dir="$MOUNT_DIR" '$2 == dir { found = 1 } END { exit !found }' /proc/mounts
|
||||
return $?
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
write_config() {
|
||||
name=$1
|
||||
value=$2
|
||||
file="$MOUNT_DIR/kvmapp/kvm/$name"
|
||||
|
||||
info "write default config: kvm/$name=$value"
|
||||
if ! printf '%s\n' "$value" > "$file"; then
|
||||
die "failed to write default config: $file"
|
||||
fi
|
||||
|
||||
need_file "$file"
|
||||
}
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
||||
SDK_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd -P)
|
||||
WORKDIR=$(dirname "$SDK_DIR")
|
||||
|
||||
APP_DIR="$WORKDIR/NanoKVM"
|
||||
IMAGE_DIR="$SDK_DIR/install/soc_sg2002_licheervnano_sd/images"
|
||||
IMAGE_FILE=""
|
||||
OUTPUT_IMAGE_FILE=""
|
||||
MOUNT_DIR="$SDK_DIR/mountpoint"
|
||||
COPY_KVMAPP=1
|
||||
FORCE_OUTPUT=0
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
-i|--image)
|
||||
[ "$#" -ge 2 ] || die "$1 requires a file path"
|
||||
IMAGE_FILE=$2
|
||||
shift 2
|
||||
;;
|
||||
-o|--output)
|
||||
[ "$#" -ge 2 ] || die "$1 requires a file path"
|
||||
OUTPUT_IMAGE_FILE=$2
|
||||
shift 2
|
||||
;;
|
||||
-a|--app-dir)
|
||||
[ "$#" -ge 2 ] || die "$1 requires a directory path"
|
||||
APP_DIR=$2
|
||||
shift 2
|
||||
;;
|
||||
-m|--mount-dir)
|
||||
[ "$#" -ge 2 ] || die "$1 requires a directory path"
|
||||
MOUNT_DIR=$2
|
||||
shift 2
|
||||
;;
|
||||
--skip-copy-kvmapp)
|
||||
COPY_KVMAPP=0
|
||||
shift
|
||||
;;
|
||||
-f|--force)
|
||||
FORCE_OUTPUT=1
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
die "unknown argument: $1"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
case "$IMAGE_FILE" in
|
||||
"") ;;
|
||||
/*) ;;
|
||||
*) IMAGE_FILE="$SDK_DIR/$IMAGE_FILE" ;;
|
||||
esac
|
||||
|
||||
case "$OUTPUT_IMAGE_FILE" in
|
||||
"") ;;
|
||||
/*) ;;
|
||||
*) OUTPUT_IMAGE_FILE="$SDK_DIR/$OUTPUT_IMAGE_FILE" ;;
|
||||
esac
|
||||
|
||||
case "$MOUNT_DIR" in
|
||||
/*) ;;
|
||||
*) MOUNT_DIR="$SDK_DIR/$MOUNT_DIR" ;;
|
||||
esac
|
||||
|
||||
command -v partx >/dev/null 2>&1 || die "missing command: partx"
|
||||
need_exec "$SDK_DIR/host/mount_ext4.sh"
|
||||
|
||||
if [ -z "$IMAGE_FILE" ]; then
|
||||
need_dir "$IMAGE_DIR"
|
||||
IMAGE_FILE=$(find "$IMAGE_DIR" -maxdepth 1 -type f -name '*.img' ! -name '*-nanokvm.img' -printf '%T@ %p\n' | sort -nr | sed -n '1s/^[^ ]* //p')
|
||||
[ -n "$IMAGE_FILE" ] || die "no input *.img found in $IMAGE_DIR; build the system image first or pass -i FILE"
|
||||
fi
|
||||
|
||||
need_file "$IMAGE_FILE"
|
||||
SOURCE_IMAGE_FILE=$IMAGE_FILE
|
||||
|
||||
ROOTFS_OFFSET_BYTES=$(partition2_offset_bytes "$SOURCE_IMAGE_FILE") || die "failed to read partition 2 offset from $SOURCE_IMAGE_FILE"
|
||||
[ "$ROOTFS_OFFSET_BYTES" -gt 0 ] || die "invalid partition 2 offset: $ROOTFS_OFFSET_BYTES"
|
||||
|
||||
if [ -z "$OUTPUT_IMAGE_FILE" ]; then
|
||||
case "$SOURCE_IMAGE_FILE" in
|
||||
*.img) OUTPUT_IMAGE_FILE=${SOURCE_IMAGE_FILE%.img}-nanokvm.img ;;
|
||||
*) OUTPUT_IMAGE_FILE=$SOURCE_IMAGE_FILE.nanokvm.img ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
[ "$OUTPUT_IMAGE_FILE" != "$SOURCE_IMAGE_FILE" ] || die "output image must be different from input image"
|
||||
|
||||
MOUNTED=0
|
||||
OUTPUT_CREATED=0
|
||||
STRIP_TEMP_FILE=""
|
||||
cleanup() {
|
||||
status=$?
|
||||
cleanup_ok=1
|
||||
if [ "$MOUNTED" -eq 1 ]; then
|
||||
info "cleanup: unmount $MOUNT_DIR"
|
||||
if umount "$MOUNT_DIR"; then
|
||||
MOUNTED=0
|
||||
else
|
||||
cleanup_ok=0
|
||||
warn "failed to unmount $MOUNT_DIR; please run: umount \"$MOUNT_DIR\""
|
||||
fi
|
||||
fi
|
||||
if [ "$status" -ne 0 ] && [ "$OUTPUT_CREATED" -eq 1 ] && [ "$cleanup_ok" -eq 1 ]; then
|
||||
info "cleanup: remove incomplete output image $OUTPUT_IMAGE_FILE"
|
||||
rm -f "$OUTPUT_IMAGE_FILE" || warn "failed to remove incomplete output image: $OUTPUT_IMAGE_FILE"
|
||||
fi
|
||||
if [ -n "$STRIP_TEMP_FILE" ]; then
|
||||
rm -f "$STRIP_TEMP_FILE"
|
||||
fi
|
||||
exit "$status"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
trap 'exit 1' HUP INT TERM
|
||||
|
||||
if [ -e "$OUTPUT_IMAGE_FILE" ]; then
|
||||
if [ "$FORCE_OUTPUT" -eq 1 ]; then
|
||||
run_step "remove old output image" rm -f "$OUTPUT_IMAGE_FILE"
|
||||
else
|
||||
die "output image already exists: $OUTPUT_IMAGE_FILE; pass -f to overwrite it"
|
||||
fi
|
||||
fi
|
||||
|
||||
OUTPUT_CREATED=1
|
||||
run_step "copy input image to output image" copy_image "$SOURCE_IMAGE_FILE" "$OUTPUT_IMAGE_FILE"
|
||||
IMAGE_FILE=$OUTPUT_IMAGE_FILE
|
||||
|
||||
if ! cmp -n "$ROOTFS_OFFSET_BYTES" "$SOURCE_IMAGE_FILE" "$IMAGE_FILE" >/dev/null; then
|
||||
die "output image differs from input before partition 2; aborting before mount"
|
||||
fi
|
||||
|
||||
info "SDK directory: $SDK_DIR"
|
||||
info "NanoKVM directory: $APP_DIR"
|
||||
info "input image: $SOURCE_IMAGE_FILE"
|
||||
info "output image: $IMAGE_FILE"
|
||||
info "partition 2 offset: $ROOTFS_OFFSET_BYTES bytes"
|
||||
info "mount directory: $MOUNT_DIR"
|
||||
|
||||
run_step "create mount directory" mkdir -p "$MOUNT_DIR"
|
||||
|
||||
if is_mounted; then
|
||||
die "$MOUNT_DIR is already mounted; run: umount \"$MOUNT_DIR\""
|
||||
fi
|
||||
|
||||
if [ "$COPY_KVMAPP" -eq 1 ]; then
|
||||
need_dir "$APP_DIR/kvmapp"
|
||||
need_exec "$APP_DIR/kvmapp/server/NanoKVM-Server"
|
||||
need_exec "$APP_DIR/kvmapp/kvm_system/kvm_system"
|
||||
need_file "$APP_DIR/kvmapp/system/ko/soph_mipi_rx.ko"
|
||||
need_file "$APP_DIR/kvmapp/system/init.d/S95nanokvm"
|
||||
need_file "$APP_DIR/kvmapp/version"
|
||||
|
||||
run_step "remove old SDK kvmapp" rm -rf "$SCRIPT_DIR/kvmapp"
|
||||
run_step "copy NanoKVM app from $APP_DIR/kvmapp" cp -a "$APP_DIR/kvmapp" "$SCRIPT_DIR/"
|
||||
run_step "create kvm_new_img marker" touch "$SCRIPT_DIR/kvmapp/kvm_new_img"
|
||||
else
|
||||
info "use existing SDK kvmapp: $SCRIPT_DIR/kvmapp"
|
||||
fi
|
||||
|
||||
need_dir "$SCRIPT_DIR/kvmapp"
|
||||
run_step "make SDK kvmapp files executable" chmod -R +x "$SCRIPT_DIR/kvmapp"
|
||||
need_exec "$SCRIPT_DIR/kvmapp/server/NanoKVM-Server"
|
||||
need_exec "$SCRIPT_DIR/kvmapp/kvm_system/kvm_system"
|
||||
need_file "$SCRIPT_DIR/kvmapp/system/ko/soph_mipi_rx.ko"
|
||||
need_file "$SCRIPT_DIR/kvmapp/system/init.d/S95nanokvm"
|
||||
need_file "$SCRIPT_DIR/kvmapp/version"
|
||||
for script in S00kmod S01fs S03usbdev S15kvmhwd S30eth S30wifi S95nanokvm; do
|
||||
need_file "$SCRIPT_DIR/kvmapp/system/init.d/$script"
|
||||
done
|
||||
need_dir "$SCRIPT_DIR/data"
|
||||
need_file "$SCRIPT_DIR/data/sensor_cfg.ini"
|
||||
|
||||
info "mount image: $IMAGE_FILE"
|
||||
if "$SDK_DIR/host/mount_ext4.sh" "$IMAGE_FILE" "$MOUNT_DIR"; then
|
||||
:
|
||||
else
|
||||
status=$?
|
||||
die "failed to mount image: $IMAGE_FILE; mount_ext4.sh exited with code $status"
|
||||
fi
|
||||
MOUNTED=1
|
||||
|
||||
if ! is_mounted; then
|
||||
die "mount command finished, but $MOUNT_DIR is not a mounted filesystem"
|
||||
fi
|
||||
|
||||
need_dir "$MOUNT_DIR/etc"
|
||||
need_dir "$MOUNT_DIR/usr"
|
||||
need_dir "$MOUNT_DIR/mnt"
|
||||
info "mount check passed"
|
||||
|
||||
MINIMAL_IMAGE=0
|
||||
if [ -e "$MOUNT_DIR/etc/nanokvm-minimal" ]; then
|
||||
MINIMAL_IMAGE=1
|
||||
else
|
||||
FRP_DIR=$(find "$SCRIPT_DIR" -maxdepth 1 -type d -name 'frp_*_linux_riscv64' | sort -V | tail -n 1)
|
||||
TAILSCALE_DIR=$(find "$SCRIPT_DIR" -maxdepth 1 -type d -name 'tailscale_*_riscv64' | sort -V | tail -n 1)
|
||||
[ -n "$FRP_DIR" ] || die "missing frp_*_linux_riscv64 directory under $SCRIPT_DIR"
|
||||
[ -n "$TAILSCALE_DIR" ] || die "missing tailscale_*_riscv64 directory under $SCRIPT_DIR"
|
||||
need_exec "$FRP_DIR/frpc"
|
||||
need_exec "$TAILSCALE_DIR/tailscale"
|
||||
need_exec "$TAILSCALE_DIR/tailscaled"
|
||||
fi
|
||||
|
||||
SSH_AVAILABLE=0
|
||||
if [ -x "$MOUNT_DIR/usr/sbin/sshd" ] && [ -x "$MOUNT_DIR/usr/bin/ssh-keygen" ]; then
|
||||
SSH_AVAILABLE=1
|
||||
need_file "$SCRIPT_DIR/kvmapp/system/init.d/S50sshd"
|
||||
fi
|
||||
|
||||
run_step "remove old image kvmapp" rm -rf "$MOUNT_DIR/kvmapp"
|
||||
run_step "copy kvmapp into image" cp -a "$SCRIPT_DIR/kvmapp" "$MOUNT_DIR/"
|
||||
strip_tool="${CROSS_COMPILE_STRIP:-}"
|
||||
if [ -z "$strip_tool" ]; then
|
||||
strip_tool=$(command -v riscv64-unknown-linux-musl-strip 2>/dev/null || true)
|
||||
fi
|
||||
if [ -z "$strip_tool" ]; then
|
||||
strip_tool="$SDK_DIR/host-tools/gcc/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-strip"
|
||||
fi
|
||||
case "$strip_tool" in
|
||||
*/*) need_exec "$strip_tool" ;;
|
||||
*) command -v "$strip_tool" >/dev/null 2>&1 || die "missing strip tool: $strip_tool" ;;
|
||||
esac
|
||||
STRIP_TEMP_FILE=$(mktemp "${TMPDIR:-/tmp}/nanokvm-server.XXXXXX") || die "failed to create strip temporary file"
|
||||
run_step "strip NanoKVM-Server debug information" \
|
||||
"$strip_tool" --strip-debug -o "$STRIP_TEMP_FILE" "$SCRIPT_DIR/kvmapp/server/NanoKVM-Server"
|
||||
run_step "install stripped NanoKVM-Server" \
|
||||
install -m 755 "$STRIP_TEMP_FILE" "$MOUNT_DIR/kvmapp/server/NanoKVM-Server"
|
||||
need_exec "$MOUNT_DIR/kvmapp/server/NanoKVM-Server"
|
||||
need_file "$MOUNT_DIR/kvmapp/system/init.d/S95nanokvm"
|
||||
need_file "$MOUNT_DIR/kvmapp/version"
|
||||
info "kvmapp install check passed"
|
||||
|
||||
if [ "$MINIMAL_IMAGE" -eq 1 ]; then
|
||||
info "minimal image: omit bundled frp and tailscale"
|
||||
run_step "remove bundled frp and tailscale" rm -f \
|
||||
"$MOUNT_DIR/usr/bin/frpc" \
|
||||
"$MOUNT_DIR/usr/bin/tailscale" \
|
||||
"$MOUNT_DIR/usr/sbin/tailscaled" \
|
||||
"$MOUNT_DIR/etc/init.d/S98tailscaled"
|
||||
else
|
||||
run_step "create frp and tailscale target directories" install -d "$MOUNT_DIR/usr/bin" "$MOUNT_DIR/usr/sbin"
|
||||
run_step "install frpc" install -m 755 "$FRP_DIR/frpc" "$MOUNT_DIR/usr/bin/frpc"
|
||||
run_step "install tailscale" install -m 755 "$TAILSCALE_DIR/tailscale" "$MOUNT_DIR/usr/bin/tailscale"
|
||||
run_step "install tailscaled" install -m 755 "$TAILSCALE_DIR/tailscaled" "$MOUNT_DIR/usr/sbin/tailscaled"
|
||||
need_exec "$MOUNT_DIR/usr/bin/frpc"
|
||||
need_exec "$MOUNT_DIR/usr/bin/tailscale"
|
||||
need_exec "$MOUNT_DIR/usr/sbin/tailscaled"
|
||||
info "frp and tailscale install check passed"
|
||||
fi
|
||||
|
||||
run_step "create kernel module and init target directories" install -d "$MOUNT_DIR/mnt/system/ko" "$MOUNT_DIR/etc/init.d"
|
||||
run_step "install soph_mipi_rx.ko" install -m 755 "$SCRIPT_DIR/kvmapp/system/ko/soph_mipi_rx.ko" "$MOUNT_DIR/mnt/system/ko/soph_mipi_rx.ko"
|
||||
need_file "$MOUNT_DIR/mnt/system/ko/soph_mipi_rx.ko"
|
||||
|
||||
for script in S00kmod S01fs S03usbdev S15kvmhwd S30eth S30wifi S95nanokvm; do
|
||||
run_step "install init script: $script" install -m 755 "$SCRIPT_DIR/kvmapp/system/init.d/$script" "$MOUNT_DIR/etc/init.d/$script"
|
||||
need_exec "$MOUNT_DIR/etc/init.d/$script"
|
||||
done
|
||||
if [ "$SSH_AVAILABLE" -eq 1 ]; then
|
||||
run_step "install init script: S50sshd" install -m 755 "$SCRIPT_DIR/kvmapp/system/init.d/S50sshd" "$MOUNT_DIR/etc/init.d/S50sshd"
|
||||
need_exec "$MOUNT_DIR/etc/init.d/S50sshd"
|
||||
else
|
||||
warn "input image has no OpenSSH server; SSH remains unavailable"
|
||||
run_step "remove unavailable SSH init script" rm -f "$MOUNT_DIR/etc/init.d/S50sshd"
|
||||
fi
|
||||
info "kernel module and init script install check passed"
|
||||
|
||||
run_step "create default data and kvm config directories" install -d "$MOUNT_DIR/mnt/data" "$MOUNT_DIR/etc/kvm" "$MOUNT_DIR/kvmapp/kvm"
|
||||
for data_file in "$SCRIPT_DIR"/data/*; do
|
||||
[ -f "$data_file" ] || continue
|
||||
data_name=$(basename "$data_file")
|
||||
run_step "install default data: $data_name" install -m 644 "$data_file" "$MOUNT_DIR/mnt/data/$data_name"
|
||||
need_file "$MOUNT_DIR/mnt/data/$data_name"
|
||||
done
|
||||
need_file "$MOUNT_DIR/mnt/data/sensor_cfg.ini"
|
||||
run_step "create ssh_stop marker" touch "$MOUNT_DIR/etc/kvm/ssh_stop"
|
||||
need_file "$MOUNT_DIR/etc/kvm/ssh_stop"
|
||||
|
||||
write_config fps 30
|
||||
write_config height 1080
|
||||
write_config now_fps 0
|
||||
write_config qlty 60
|
||||
write_config res 0
|
||||
write_config state 1
|
||||
write_config type mjpeg
|
||||
write_config width 1920
|
||||
info "default data and kvm config install check passed"
|
||||
|
||||
info "unmount image"
|
||||
if umount "$MOUNT_DIR"; then
|
||||
:
|
||||
else
|
||||
status=$?
|
||||
die "failed to unmount $MOUNT_DIR with exit code $status; make sure no terminal is inside the mount directory, then run: umount \"$MOUNT_DIR\""
|
||||
fi
|
||||
MOUNTED=0
|
||||
|
||||
if is_mounted; then
|
||||
die "$MOUNT_DIR is still mounted after umount"
|
||||
fi
|
||||
|
||||
if ! cmp -n "$ROOTFS_OFFSET_BYTES" "$SOURCE_IMAGE_FILE" "$IMAGE_FILE" >/dev/null; then
|
||||
die "boot area changed unexpectedly; do not burn this output image: $IMAGE_FILE"
|
||||
fi
|
||||
info "boot area check passed: bytes before partition 2 are unchanged"
|
||||
|
||||
trap - EXIT HUP INT TERM
|
||||
|
||||
echo
|
||||
echo "NanoKVM APP has been merged into:"
|
||||
echo "$IMAGE_FILE"
|
||||
8
kvm/tailscale_1.80.2_riscv64/systemd/tailscaled.defaults
Normal file
8
kvm/tailscale_1.80.2_riscv64/systemd/tailscaled.defaults
Normal file
@@ -0,0 +1,8 @@
|
||||
# Set the port to listen on for incoming VPN packets.
|
||||
# Remote nodes will automatically be informed about the new port number,
|
||||
# but you might want to configure this in order to set external firewall
|
||||
# settings.
|
||||
PORT="41641"
|
||||
|
||||
# Extra flags you might want to pass to tailscaled.
|
||||
FLAGS=""
|
||||
23
kvm/tailscale_1.80.2_riscv64/systemd/tailscaled.service
Normal file
23
kvm/tailscale_1.80.2_riscv64/systemd/tailscaled.service
Normal file
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=Tailscale node agent
|
||||
Documentation=https://tailscale.com/kb/
|
||||
Wants=network-pre.target
|
||||
After=network-pre.target NetworkManager.service systemd-resolved.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/default/tailscaled
|
||||
ExecStart=/usr/sbin/tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/run/tailscale/tailscaled.sock --port=${PORT} $FLAGS
|
||||
ExecStopPost=/usr/sbin/tailscaled --cleanup
|
||||
|
||||
Restart=on-failure
|
||||
|
||||
RuntimeDirectory=tailscale
|
||||
RuntimeDirectoryMode=0755
|
||||
StateDirectory=tailscale
|
||||
StateDirectoryMode=0700
|
||||
CacheDirectory=tailscale
|
||||
CacheDirectoryMode=0750
|
||||
Type=notify
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
BIN
kvm/tailscale_1.80.2_riscv64/tailscale
Executable file
BIN
kvm/tailscale_1.80.2_riscv64/tailscale
Executable file
Binary file not shown.
BIN
kvm/tailscale_1.80.2_riscv64/tailscaled
Executable file
BIN
kvm/tailscale_1.80.2_riscv64/tailscaled
Executable file
Binary file not shown.
@@ -1167,6 +1167,16 @@ static int do_read_header(struct fsg_common *common, struct fsg_buffhd *bh)
|
||||
u32 lba = get_unaligned_be32(&common->cmnd[2]);
|
||||
u8 *buf = (u8 *)bh->buf;
|
||||
|
||||
if (curlun->cd_as_dvd) {
|
||||
/*
|
||||
* The READ_HEADER command is obsolete since MMC-3.
|
||||
* We're keeping it for backward compatibility,
|
||||
* but disabling it for big images since they will be
|
||||
* handled as DVD.
|
||||
*/
|
||||
curlun->sense_data = SS_INVALID_COMMAND;
|
||||
return -EINVAL;
|
||||
}
|
||||
if (common->cmnd[1] & ~0x02) { /* Mask away MSF */
|
||||
curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
|
||||
return -EINVAL;
|
||||
@@ -1205,7 +1215,19 @@ static int do_read_toc(struct fsg_common *common, struct fsg_buffhd *bh)
|
||||
|
||||
buf[13] = 0x16; /* Lead-out track is data */
|
||||
buf[14] = 0xAA; /* Lead-out track number */
|
||||
store_cdrom_address(&buf[16], msf, curlun->num_sectors);
|
||||
if (curlun->cd_as_dvd) {
|
||||
/*
|
||||
* According to specifications, for DVD images
|
||||
* the lead-out address should be fabricated.
|
||||
* It seems it's not using by drivers at all,
|
||||
* so it can contain any big valid MSF address.
|
||||
* This address MSF:0,0x23,0,0 is taken
|
||||
* from the example in the doc.
|
||||
*/
|
||||
store_cdrom_address(&buf[16], msf, 157350);
|
||||
} else {
|
||||
store_cdrom_address(&buf[16], msf, curlun->num_sectors);
|
||||
}
|
||||
return 20;
|
||||
}
|
||||
|
||||
@@ -1220,6 +1242,23 @@ static int do_mode_sense(struct fsg_common *common, struct fsg_buffhd *bh)
|
||||
int valid_page = 0;
|
||||
int len, limit;
|
||||
|
||||
/*
|
||||
* This magic blob contains a bunch of flags according to
|
||||
* "Table 580 - C/DVD Capabilities and Mechanical Status"
|
||||
* and too long to decode it here.
|
||||
* See the big PDF "INF-TA-1010 Rev 1.0.0".
|
||||
*/
|
||||
const u8 capabilities[] =
|
||||
"\x3f\x00\xf1\x77\x29\x23\x2b\x48" \
|
||||
"\x01\x00\x06\x00\x2b\x48\x00\x10" \
|
||||
"\x2b\x48\x2b\x48\x00\x01\x00\x00" \
|
||||
"\x00\x00\x2b\x48\x00\x09\x00\x00" \
|
||||
"\x2b\x48\x00\x00\x20\x76\x00\x00" \
|
||||
"\x15\xa4\x00\x00\x10\x3b\x00\x00" \
|
||||
"\x10\x3b\x00\x00\x10\x3b\x00\x00" \
|
||||
"\x10\x3b\x00\x00\x10\x3b\x00\x00" \
|
||||
"\x10\x3b";
|
||||
|
||||
if ((common->cmnd[1] & ~0x08) != 0) { /* Mask away DBD */
|
||||
curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
|
||||
return -EINVAL;
|
||||
@@ -1252,10 +1291,9 @@ static int do_mode_sense(struct fsg_common *common, struct fsg_buffhd *bh)
|
||||
|
||||
/* No block descriptors */
|
||||
|
||||
/*
|
||||
* The mode pages, in numerical order. The only page we support
|
||||
* is the Caching page.
|
||||
*/
|
||||
/* The mode pages, in numerical order */
|
||||
|
||||
/* Caching page */
|
||||
if (page_code == 0x08 || all_pages) {
|
||||
valid_page = 1;
|
||||
buf[0] = 0x08; /* Page code */
|
||||
@@ -1277,6 +1315,24 @@ static int do_mode_sense(struct fsg_common *common, struct fsg_buffhd *bh)
|
||||
buf += 12;
|
||||
}
|
||||
|
||||
/* Power Condition Page */
|
||||
if (page_code == 0x1A || all_pages) {
|
||||
valid_page = 1;
|
||||
buf[0] = 0x1A; /* Page code */
|
||||
buf[1] = 10; /* Page length */
|
||||
memset(buf+2, 0, 10); /* Disable the Standby/Idle timers */
|
||||
buf += 12;
|
||||
}
|
||||
|
||||
/* C/DVD Capabilities and Mechanical Status Page */
|
||||
if (curlun->cdrom && (page_code == 0x2A || all_pages)) {
|
||||
valid_page = 1;
|
||||
buf[0] = 0x2A; /* Page code */
|
||||
buf[1] = sizeof(capabilities) - 1; /* Page length */
|
||||
memcpy(buf+2, capabilities, buf[1]);
|
||||
buf += buf[1] + 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check that a valid page was requested and the mode data length
|
||||
* isn't too long.
|
||||
@@ -1396,6 +1452,249 @@ static int do_mode_select(struct fsg_common *common, struct fsg_buffhd *bh)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int do_get_configuration(struct fsg_common *common,
|
||||
struct fsg_buffhd *bh)
|
||||
{
|
||||
struct fsg_lun *curlun = common->curlun;
|
||||
u8 *buf = (u8 *) bh->buf;
|
||||
u8 *buf0 = buf;
|
||||
int len;
|
||||
int profile;
|
||||
int rt; /* Request type */
|
||||
int starting; /* Feature code */
|
||||
|
||||
/*
|
||||
* The standard prescribes to return disabled profiles
|
||||
* MMC_PROFILE_NONE when we have no medium, but it seems
|
||||
* it is enough to make unknown_cmnd in do_scsi_command().
|
||||
*/
|
||||
if (curlun->cd_as_dvd) {
|
||||
/* Big images will be handled as DVD */
|
||||
profile = MMC_PROFILE_DVD_ROM;
|
||||
} else {
|
||||
profile = MMC_PROFILE_CD_ROM;
|
||||
}
|
||||
|
||||
/*
|
||||
* RT == 0x00 - Return all features since starting;
|
||||
* RT == 0x01 - Same but filtered by Current bit (all in our case);
|
||||
* RT == 0x02 - Return only header and zero or one supported feature;
|
||||
* RT == 0x03 - Reserved, but we'll handle it as 0x00 for paranoia;
|
||||
* ... So we have only one special case for 0x02.
|
||||
*/
|
||||
rt = common->cmnd[1] & 0x03;
|
||||
starting = get_unaligned_be16(&common->cmnd[2]);
|
||||
|
||||
memset(buf, 0, 256); /* This should be enough for our all features */
|
||||
/* Allocation Length in buf[0,1,2,3] will be calculated later */
|
||||
put_unaligned_be16(profile, &buf[6]);
|
||||
buf += 8;
|
||||
|
||||
#define NEED_REPORT(feature) \
|
||||
(rt == 0x02 ? (starting == feature) : (starting <= feature))
|
||||
|
||||
/* Profile List feature */
|
||||
if (NEED_REPORT(0)) {
|
||||
/* buf[8,9] = 0 for the feature */
|
||||
buf[2] = 0 | 0x03; /* Version = 0, Persistent|Current */
|
||||
buf[3] = 8; /* Additional length for two profiles */
|
||||
put_unaligned_be16(MMC_PROFILE_DVD_ROM, &buf[4]);
|
||||
buf[6] = (profile == MMC_PROFILE_DVD_ROM);
|
||||
put_unaligned_be16(MMC_PROFILE_CD_ROM, &buf[8]);
|
||||
buf[10] = (profile == MMC_PROFILE_CD_ROM);
|
||||
buf += 12;
|
||||
}
|
||||
|
||||
/* Core feature */
|
||||
if (NEED_REPORT(0x0001)) {
|
||||
put_unaligned_be16(0x0001, &buf[0]);
|
||||
buf[2] = 0x08 | 0x03; /* Version = 2, Persistent|Current */
|
||||
buf[3] = 8; /* Additional length */
|
||||
put_unaligned_be32(1, &buf[4]); /* Phy = SCSI Family */
|
||||
buf[8] = 0x01; /* Device Busy Class Events = 1 */
|
||||
buf += 12;
|
||||
}
|
||||
|
||||
/* Morphing feature */
|
||||
if (NEED_REPORT(0x0002)) {
|
||||
put_unaligned_be16(0x0002, &buf[0]);
|
||||
buf[2] = 0x04 | 0x03; /* Version = 1, Persistent|Current */
|
||||
buf[3] = 4; /* Additional length */
|
||||
buf += 8;
|
||||
}
|
||||
|
||||
/* Removable Medium feature */
|
||||
if (NEED_REPORT(0x0003)) {
|
||||
put_unaligned_be16(0x0003, &buf[0]);
|
||||
buf[2] = 0x08 | 0x03; /* Version = 2, Persistent|Current */
|
||||
buf[3] = 4; /* Additional length */
|
||||
buf[4] = 0x20 | 0x19; /* Tray mechanism, Load|Eject|Lock */
|
||||
buf += 8;
|
||||
}
|
||||
|
||||
/* Random Readable feature */
|
||||
if (NEED_REPORT(0x0010)) {
|
||||
put_unaligned_be16(0x0010, &buf[0]);
|
||||
buf[2] = 0 | 0x03; /* Version = 0, Persistent|Current */
|
||||
buf[3] = 8; /* Additional length */
|
||||
put_unaligned_be32(2048, &buf[4]); /* Logical Block Size */
|
||||
/* buf[8,9] = 0, no Blocking size presented */
|
||||
buf[10] = 0x01; /* RW Error Recovery Mode Page */
|
||||
buf += 12;
|
||||
}
|
||||
|
||||
/* MultiRead feature */
|
||||
if (NEED_REPORT(0x001D)) {
|
||||
put_unaligned_be16(0x001D, &buf[0]);
|
||||
buf[2] = 0 | 0x03; /* Version = 0, Persistent|Current */
|
||||
buf += 4;
|
||||
}
|
||||
|
||||
/* CD Read feature */
|
||||
if (NEED_REPORT(0x001E)) {
|
||||
put_unaligned_be16(0x001E, &buf[0]);
|
||||
buf[2] = 0x04 | 0x03; /* Version = 1, Persistent|Current */
|
||||
buf[3] = 4; /* Additional length */
|
||||
buf[4] = 0x03; /* C2|CD-Text */
|
||||
buf += 8;
|
||||
}
|
||||
|
||||
/* DVD Read feature */
|
||||
if (NEED_REPORT(0x001F)) {
|
||||
put_unaligned_be16(0x001F, &buf[0]);
|
||||
buf[2] = 0x04 | 0x03; /* Version = 1, Persistent|Current */
|
||||
buf[3] = 4; /* Additional length */
|
||||
buf[4] = 0x01; /* MULTI110 */
|
||||
buf[6] = 0x01; /* Dual-R */
|
||||
buf += 8;
|
||||
}
|
||||
|
||||
/* Power Management feature */
|
||||
if (NEED_REPORT(0x0100)) {
|
||||
put_unaligned_be16(0x0100, &buf[0]);
|
||||
buf[2] = 0 | 0x03; /* Version = 0, Persistent|Current */
|
||||
buf += 4;
|
||||
}
|
||||
|
||||
/* Timeout feature */
|
||||
if (NEED_REPORT(0x0105)) {
|
||||
put_unaligned_be16(0x0105,&buf[0]);
|
||||
buf[2] = 0x04 | 0x03; /* Version = 1, Persistent|Current */
|
||||
buf[3] = 4; /* Additional length */
|
||||
buf += 8;
|
||||
}
|
||||
|
||||
/* Real Time Streaming feature */
|
||||
if (NEED_REPORT(0x0107)) {
|
||||
put_unaligned_be16(0x0107, &buf[0]);
|
||||
buf[2] = 0x10 | 0x03; /* Version = 4, Persistent|Current */
|
||||
buf[3] = 4; /* Additional length */
|
||||
buf[4] = 0x0F; /* SCS|MP2A|WSPD|SW */
|
||||
buf += 8;
|
||||
}
|
||||
|
||||
#undef NEED_REPORT
|
||||
|
||||
len = buf - buf0;
|
||||
/* Put len minus the size of data length field (be32) */
|
||||
put_unaligned_be32(len - 4, &buf0[0]);
|
||||
return len;
|
||||
}
|
||||
|
||||
static int do_read_disc_information(struct fsg_common *common,
|
||||
struct fsg_buffhd *bh)
|
||||
{
|
||||
struct fsg_lun *curlun = common->curlun;
|
||||
u8 *buf = (u8 *) bh->buf;
|
||||
|
||||
/*
|
||||
* (common->cmnd[1] & 0x07) contains Data Type, but it is safe
|
||||
* to ignore it and always return Data Type = 0 in buf[2]
|
||||
* for the Standard Disc Information.
|
||||
*/
|
||||
|
||||
memset(buf, 0, 34);
|
||||
put_unaligned_be16(32, &buf[0]);
|
||||
buf[2] = 0x0E; /* Last session complete, disc finalized */
|
||||
buf[3] = 1; /* First track on disc */
|
||||
buf[4] = 1; /* Number of sessions */
|
||||
buf[5] = 1; /* First track of last session */
|
||||
buf[6] = 1; /* Last track of last session */
|
||||
buf[7] = 0x20; /* Unrestricted use */
|
||||
buf[8] = 0; /* For CD should be 0, for DVD is inapplicable */
|
||||
|
||||
if (!curlun->cd_as_dvd) {
|
||||
/*
|
||||
* For CD if the disc is complete, both should be 0xFF.
|
||||
* For DVD it's inapplicable and shall be set to 0.
|
||||
* buf[16,17,18,19] - Last Session Lead-in Start Time.
|
||||
* buf[20,21,22,23] - Last Possible Start Time
|
||||
* for Start of Lead-out.
|
||||
*/
|
||||
memset(&buf[16], 0, 8);
|
||||
}
|
||||
return 34;
|
||||
}
|
||||
|
||||
static int do_read_track_information(struct fsg_common* common,
|
||||
struct fsg_buffhd * bh)
|
||||
{
|
||||
struct fsg_lun *curlun = common->curlun;
|
||||
u8 *buf = (u8 *) bh->buf;
|
||||
u32 track;
|
||||
|
||||
track = get_unaligned_be32(&common->cmnd[2]);
|
||||
|
||||
/* We only support T_CDB */
|
||||
if ((common->cmnd[1] & 0x03) != 1 || track != 1) {
|
||||
curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
memset(buf, 0, 36);
|
||||
put_unaligned_be16(34, &buf[0]);
|
||||
buf[2] = 1; /* Track 1 */
|
||||
buf[3] = 1; /* Session 1 */
|
||||
buf[5] = 0x06; /* Data track | Digital copy permitted */
|
||||
buf[6] = 0x01; /* Data mode 1 */
|
||||
put_unaligned_be32(curlun->num_sectors, &buf[24]);
|
||||
return 36;
|
||||
}
|
||||
|
||||
static int do_read_disc_structure(struct fsg_common* common,
|
||||
struct fsg_buffhd * bh)
|
||||
{
|
||||
struct fsg_lun *curlun = common->curlun;
|
||||
u8 *buf = (u8 *) bh->buf;
|
||||
|
||||
/* We only support physical format info */
|
||||
if (common->cmnd[7] != 0x00) {
|
||||
curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
memset(buf, 0, 2052);
|
||||
put_unaligned_be16(2050, &buf[0]);
|
||||
buf += 4; /* Skip size and 2 reserved bytes */
|
||||
buf[0] = 0 | 0x01; /* DVD-ROM, DVD-R Part Version 1 */
|
||||
buf[1] = 0 | 0x0F; /* 120mm disc, No transfer rate limit */
|
||||
buf[2] = 0 | 0 | 0x01; /* 1 Layer, Single Layer, Read-Only */
|
||||
/* buf[3] = 0 - Linear Density = 0.267, Track Density = 0.74 */
|
||||
|
||||
/* Starting sector of main data is always 0x30000 for DVD-ROM */
|
||||
put_unaligned_be24(0x030000, &buf[5]);
|
||||
|
||||
/*
|
||||
* We can't address more than (2 ^^ 24) - 0x30000 sectors
|
||||
* i.e. 32384MB per layer, and it seems we will never reach
|
||||
* this limit. But maybe we should make a check to be sure.
|
||||
*/
|
||||
put_unaligned_be24(0x030000 + curlun->num_sectors, &buf[9]);
|
||||
|
||||
/* It is okay to keep 0 in End physical sector number of Layer 0 */
|
||||
return 2052;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
@@ -1817,6 +2116,63 @@ static int do_scsi_command(struct fsg_common *common)
|
||||
down_read(&common->filesem); /* We're using the backing file */
|
||||
switch (common->cmnd[0]) {
|
||||
|
||||
case 0x46: /* GET_CONFIGURATION */
|
||||
if (!common->curlun || !common->curlun->cdrom)
|
||||
goto unknown_cmnd;
|
||||
common->data_size_from_cmnd =
|
||||
get_unaligned_be16(&common->cmnd[7]);
|
||||
reply = check_command(common, 10, DATA_DIR_TO_HOST,
|
||||
0xffffffff, 1,
|
||||
"GET CONFIGURATION");
|
||||
if (reply == 0)
|
||||
reply = do_get_configuration(common, bh);
|
||||
break;
|
||||
|
||||
case 0x51: /* READ_DISC_INFORMATION */
|
||||
if (!common->curlun || !common->curlun->cdrom)
|
||||
goto unknown_cmnd;
|
||||
common->data_size_from_cmnd =
|
||||
get_unaligned_be16(&common->cmnd[7]);
|
||||
reply = check_command(common, 10, DATA_DIR_TO_HOST,
|
||||
0xffffffff, 1,
|
||||
"READ DISK INFORMATION");
|
||||
if (reply == 0)
|
||||
reply = do_read_disc_information(common, bh);
|
||||
break;
|
||||
|
||||
case 0x52: /* READ_TRACK_INFORMATION */
|
||||
if (!common->curlun || !common->curlun->cdrom)
|
||||
goto unknown_cmnd;
|
||||
common->data_size_from_cmnd =
|
||||
get_unaligned_be16(&common->cmnd[7]);
|
||||
reply = check_command(common, 10, DATA_DIR_TO_HOST,
|
||||
0xffffffff, 1,
|
||||
"READ TRACK INFORMATION");
|
||||
if (reply == 0)
|
||||
reply = do_read_track_information(common, bh);
|
||||
break;
|
||||
|
||||
case 0xAD: /* READ_DISK_STRUCTURE */
|
||||
if (!common->curlun || !common->curlun->cdrom)
|
||||
goto unknown_cmnd;
|
||||
common->data_size_from_cmnd =
|
||||
get_unaligned_be16(&common->cmnd[8]);
|
||||
reply = check_command(common, 12, DATA_DIR_TO_HOST,
|
||||
0xffffffff, 1,
|
||||
"READ DISK STRUCTURE");
|
||||
if (reply == 0)
|
||||
reply = do_read_disc_structure(common, bh);
|
||||
break;
|
||||
|
||||
case 0xBB: /* SET_CD_SPEED */
|
||||
if (!common->curlun || !common->curlun->cdrom)
|
||||
goto unknown_cmnd;
|
||||
common->data_size_from_cmnd = 0;
|
||||
reply = check_command(common, 12, DATA_DIR_NONE,
|
||||
0xffffffff, 1,
|
||||
"SET CD SPEED");
|
||||
break;
|
||||
|
||||
case INQUIRY:
|
||||
common->data_size_from_cmnd = common->cmnd[4];
|
||||
reply = check_command(common, 6, DATA_DIR_TO_HOST,
|
||||
@@ -1933,7 +2289,8 @@ static int do_scsi_command(struct fsg_common *common)
|
||||
common->data_size_from_cmnd =
|
||||
get_unaligned_be16(&common->cmnd[7]);
|
||||
reply = check_command(common, 10, DATA_DIR_TO_HOST,
|
||||
(7<<6) | (1<<1), 1,
|
||||
/* TODO: Why? */
|
||||
0xffffffff, 1, /* (7<<6) | (1<<1), 1, */
|
||||
"READ TOC");
|
||||
if (reply == 0)
|
||||
reply = do_read_toc(common, bh);
|
||||
|
||||
@@ -240,16 +240,7 @@ int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
|
||||
}
|
||||
|
||||
num_sectors = size >> blkbits; /* File size in logic-block-size blocks */
|
||||
min_sectors = 1;
|
||||
if (curlun->cdrom) {
|
||||
min_sectors = 300; /* Smallest track is 300 frames */
|
||||
if (num_sectors >= 256*60*75) {
|
||||
num_sectors = 256*60*75 - 1;
|
||||
LINFO(curlun, "file too big: %s\n", filename);
|
||||
LINFO(curlun, "using only first %d blocks\n",
|
||||
(int) num_sectors);
|
||||
}
|
||||
}
|
||||
min_sectors = curlun->cdrom ? 300 : 1; /* Smallest track is 300 frames */
|
||||
if (num_sectors < min_sectors) {
|
||||
LINFO(curlun, "file too small: %s\n", filename);
|
||||
rc = -ETOOSMALL;
|
||||
@@ -259,6 +250,10 @@ int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
|
||||
if (fsg_lun_is_open(curlun))
|
||||
fsg_lun_close(curlun);
|
||||
|
||||
/* Too big CD-ROM images will be handled as DVD-ROM */
|
||||
curlun->cd_as_dvd = curlun->cdrom &&
|
||||
(num_sectors >= CD_MAX_MSF_SECTORS);
|
||||
|
||||
curlun->blksize = blksize;
|
||||
curlun->blkbits = blkbits;
|
||||
curlun->ro = ro;
|
||||
|
||||
@@ -85,6 +85,19 @@ do { \
|
||||
#define SS_WRITE_ERROR 0x030c02
|
||||
#define SS_WRITE_PROTECTED 0x072700
|
||||
|
||||
/* Some used profiles from MMC-3 */
|
||||
#define MMC_PROFILE_NONE 0x0000
|
||||
#define MMC_PROFILE_CD_ROM 0x0008
|
||||
#define MMC_PROFILE_DVD_ROM 0x0010
|
||||
|
||||
/*
|
||||
* Maximum number of sectors of CD with MSF addressing.
|
||||
* A bit paranoid value is calculated based on standard
|
||||
* and store_cdrom_address() implementation.
|
||||
* It is assumed that bigger images will be handled as DVD.
|
||||
*/
|
||||
#define CD_MAX_MSF_SECTORS ((255 * 59 * 74) - (2 * 75))
|
||||
|
||||
#define SK(x) ((u8) ((x) >> 16)) /* Sense Key byte, etc. */
|
||||
#define ASC(x) ((u8) ((x) >> 8))
|
||||
#define ASCQ(x) ((u8) (x))
|
||||
@@ -104,6 +117,7 @@ struct fsg_lun {
|
||||
unsigned int ro:1;
|
||||
unsigned int removable:1;
|
||||
unsigned int cdrom:1;
|
||||
unsigned int cd_as_dvd:1; /* Handle big CD as DVD if cdrom == 1 */
|
||||
unsigned int prevent_medium_removal:1;
|
||||
unsigned int registered:1;
|
||||
unsigned int info_valid:1;
|
||||
|
||||
2
osdrv/extdrv/wireless/aic8800/.gitignore
vendored
Normal file → Executable file
2
osdrv/extdrv/wireless/aic8800/.gitignore
vendored
Normal file → Executable file
@@ -1,3 +1,5 @@
|
||||
*.symvers
|
||||
*.order
|
||||
*.symvers.cmd
|
||||
*.order.cmd
|
||||
.tmp_versions/
|
||||
|
||||
2
osdrv/extdrv/wireless/aic8800/Kconfig
Normal file → Executable file
2
osdrv/extdrv/wireless/aic8800/Kconfig
Normal file → Executable file
@@ -8,7 +8,7 @@ config AIC_FW_PATH
|
||||
depends on AIC_WLAN_SUPPORT
|
||||
string "Firmware & config file path"
|
||||
#default "/vendor/etc/firmware"
|
||||
default "/lib/firmware/aic8800_sdio/aic8800"
|
||||
default "/usr/lib/firmware/aic8800_sdio/aic8800_and_aic8800D80"
|
||||
help
|
||||
Path to the firmware & config file.
|
||||
|
||||
|
||||
58
osdrv/extdrv/wireless/aic8800/Makefile
Normal file → Executable file
58
osdrv/extdrv/wireless/aic8800/Makefile
Normal file → Executable file
@@ -6,51 +6,54 @@ obj-$(CONFIG_AIC8800_BTLPM_SUPPORT) += aic8800_btlpm/
|
||||
obj-$(CONFIG_AIC8800_WLAN_SUPPORT) += aic8800_fdrv/
|
||||
obj-$(CONFIG_AIC_WLAN_SUPPORT) += aic8800_bsp/
|
||||
|
||||
MAKEFLAGS +=-j$(shell nproc)
|
||||
|
||||
# Platform support list
|
||||
CONFIG_PLATFORM_ROCKCHIP = n
|
||||
CONFIG_PLATFORM_ROCKCHIP2 = n
|
||||
CONFIG_PLATFORM_ALLWINNER = n
|
||||
CONFIG_PLATFORM_AMLOGIC = n
|
||||
CONFIG_PLATFORM_UBUNTU = y
|
||||
########## config option ##########
|
||||
export CONFIG_USE_FW_REQUEST = n
|
||||
export CONFIG_PREALLOC_RX_SKB = y
|
||||
export CONFIG_PREALLOC_TXQ = y
|
||||
export CONFIG_OOB = n
|
||||
export CONFIG_GPIO_WAKEUP = n
|
||||
export CONFIG_RESV_MEM_SUPPORT = y
|
||||
###################################
|
||||
|
||||
########## Platform support list ##########
|
||||
export CONFIG_PLATFORM_ROCKCHIP = n
|
||||
export CONFIG_PLATFORM_ROCKCHIP2 = n
|
||||
export CONFIG_PLATFORM_ALLWINNER = n
|
||||
export CONFIG_PLATFORM_AMLOGIC = n
|
||||
export CONFIG_PLATFORM_UBUNTU = y
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ROCKCHIP), y)
|
||||
#KDIR = /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/kernel
|
||||
#ARCH = arm
|
||||
#CROSS_COMPILE = /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
|
||||
KDIR = /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/kernel
|
||||
ARCH = arm
|
||||
CROSS_COMPILE = /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/prebuilts/gcc/linux-x86/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
||||
#KDIR = /home/yaya/E/Rockchip/3399/rk3399-android-10/kernel
|
||||
#ARCH = arm64
|
||||
#CROSS_COMPILE = /home/yaya/E/Rockchip/3399/rk3399-android-10/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
ARCH = arm64
|
||||
KDIR = /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/kernel
|
||||
CROSS_COMPILE = /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
ccflags-y += -DANDROID_PLATFORM
|
||||
ccflags-y += -DCONFIG_PLATFORM_ROCKCHIP
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ROCKCHIP2), y)
|
||||
ARCH = arm64
|
||||
KDIR = /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/kernel
|
||||
CROSS_COMPILE = /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
KDIR := /home/yaya/E/Rockchip/3126/Android6/kernel
|
||||
ARCH ?= arm
|
||||
CROSS_COMPILE ?= /home/yaya/E/Rockchip/3288/Android5/rk3288_JHY/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
|
||||
ccflags-y += -DANDROID_PLATFORM
|
||||
ccflags-y += -DCONFIG_PLATFORM_ROCKCHIP2
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ALLWINNER), y)
|
||||
KDIR = /home/yaya/E/Allwinner/R818/R818/AndroidQ/lichee/kernel/linux-4.9
|
||||
KDIR = /home/yaya/E/Allwinner/A133/Android10/linux-4.9
|
||||
ARCH = arm64
|
||||
CROSS_COMPILE = /home/yaya/E/Allwinner/R818/R818/AndroidQ/lichee/out/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
CROSS_COMPILE = /home/yaya/E/Allwinner/r818/Android10/lichee/out/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
export CONFIG_SUPPORT_LPM = y
|
||||
ccflags-y += -DANDROID_PLATFORM
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_AMLOGIC), y)
|
||||
ccflags-y += -DANDROID_PLATFORM
|
||||
ARCH = arm
|
||||
CROSS_COMPILE = /home/yaya/D/Workspace/CyberQuantum/JinHaoYue/amls905x3/SDK/20191101-0tt-asop/android9.0/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-
|
||||
KDIR = /home/yaya/D/Workspace/CyberQuantum/JinHaoYue/amls905x3/SDK/20191101-0tt-asop/android9.0/out/target/product/u202/obj/KERNEL_OBJ/
|
||||
|
||||
ccflags-y += -DANDROID_PLATFORM
|
||||
export CONFIG_SUPPORT_LPM = y
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_UBUNTU), y)
|
||||
@@ -58,9 +61,12 @@ KDIR = /lib/modules/$(shell uname -r)/build
|
||||
PWD = $(shell pwd)
|
||||
KVER = $(shell uname -r)
|
||||
MODDESTDIR = /lib/modules/$(KVER)/kernel/drivers/net/wireless/aic8800
|
||||
ARCH = x86_64
|
||||
CROSS_COMPILE =
|
||||
SUBARCH = $(shell uname -m | sed -e s/i.86/i386/ -e s/armv.l/arm/ -e s/aarch64/arm64/)
|
||||
ARCH ?= $(SUBARCH)
|
||||
CROSS_COMPILE ?=
|
||||
endif
|
||||
###########################################
|
||||
|
||||
all: modules
|
||||
modules:
|
||||
make -C $(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
|
||||
@@ -82,5 +88,5 @@ clean:
|
||||
cd aic8800_bsp/;make clean;cd ..
|
||||
cd aic8800_fdrv/;make clean;cd ..
|
||||
cd aic8800_btlpm/;make clean;cd ..
|
||||
rm -rf modules.order Module.symvers .tmp_versions/
|
||||
rm -rf modules.order Module.symvers .modules.order.cmd .Module.symvers.cmd .tmp_versions/
|
||||
|
||||
|
||||
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/.gitignore
vendored
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/.gitignore
vendored
Normal file → Executable file
67
osdrv/extdrv/wireless/aic8800/aic8800_bsp/Makefile
Normal file → Executable file
67
osdrv/extdrv/wireless/aic8800/aic8800_bsp/Makefile
Normal file → Executable file
@@ -1,8 +1,8 @@
|
||||
CONFIG_SDIO_SUPPORT := y
|
||||
CONFIG_SDIO_PWRCTRL := y
|
||||
CONFIG_SDIO_PWRCTRL := n
|
||||
#CONFIG_AIC_FW_PATH = "/vendor/etc/firmware"
|
||||
#CONFIG_AIC_FW_PATH ?= "/lib/firmware/aic8800_sdio/aic8800"
|
||||
|
||||
#CONFIG_AIC_FW_PATH = "/lib/firmware/aic8800D80"
|
||||
CONFIG_AIC_FW_PATH = "/usr/lib/firmware/aic8800_sdio/aic8800_and_aic8800D80"
|
||||
export CONFIG_AIC_FW_PATH
|
||||
ccflags-y += -DCONFIG_AIC_FW_PATH=\"$(CONFIG_AIC_FW_PATH)\"
|
||||
|
||||
@@ -12,24 +12,36 @@ ccflags-y += -DAICWF_SDIO_SUPPORT
|
||||
ccflags-$(CONFIG_SDIO_PWRCTRL) += -DCONFIG_SDIO_PWRCTRL
|
||||
endif
|
||||
|
||||
CONFIG_GPIO_WAKEUP = n
|
||||
CONFIG_GPIO_WAKEUP ?= n
|
||||
CONFIG_M2D_OTA_AUTO_SUPPORT = n
|
||||
CONFIG_M2D_OTA_LZMA_SUPPORT = n
|
||||
CONFIG_LINK_DET_5G = y
|
||||
CONFIG_MCU_MESSAGE = n
|
||||
CONFIG_FIRMWARE_ARRAY = n
|
||||
# Need to set fw path in BOARD_KERNEL_CMDLINE
|
||||
CONFIG_USE_FW_REQUEST = n
|
||||
CONFIG_USE_FW_REQUEST ?= n
|
||||
CONFIG_FDRV_NO_REG_SDIO = n
|
||||
CONFIG_VRF_DCDC_MODE = y
|
||||
CONFIG_OOB = n
|
||||
CONFIG_OOB ?= n
|
||||
CONFIG_PREALLOC_TXQ = y
|
||||
CONFIG_ONE_TXQ = n
|
||||
CONFIG_DPD = y
|
||||
CONFIG_FORCE_DPD_CALIB = y
|
||||
CONFIG_RESV_MEM_SUPPORT = y
|
||||
CONFIG_AMSDU_RX ?=n
|
||||
CONFIG_LOFT_CALIB = n
|
||||
CONFIG_EXT_FEM_8800DCDW = n
|
||||
CONFIG_RESV_MEM_SUPPORT ?= y
|
||||
CONFIG_AMSDU_RX = y
|
||||
CONFIG_IRQ_FALL ?= n
|
||||
CONFIG_SDIO_BT = y
|
||||
CONFIG_RADAR_OR_IR_DETECT =n
|
||||
CONFIG_FOR_IPCAM = n
|
||||
CONFIG_BAND_STEERING = n
|
||||
CONFIG_PRBREQ_REPORT = n
|
||||
|
||||
ifeq ($(CONFIG_EXT_FEM_8800DCDW), y)
|
||||
CONFIG_DPD = n
|
||||
CONFIG_FORCE_DPD_CALIB = n
|
||||
CONFIG_LOFT_CALIB = y
|
||||
endif
|
||||
|
||||
ccflags-$(CONFIG_GPIO_WAKEUP) += -DCONFIG_GPIO_WAKEUP
|
||||
ccflags-$(CONFIG_M2D_OTA_AUTO_SUPPORT) += -DCONFIG_M2D_OTA_AUTO_SUPPORT
|
||||
@@ -42,17 +54,25 @@ ccflags-$(CONFIG_FDRV_NO_REG_SDIO) += -DCONFIG_FDRV_NO_REG_SDIO
|
||||
ccflags-$(CONFIG_VRF_DCDC_MODE) += -DCONFIG_VRF_DCDC_MODE
|
||||
ccflags-$(CONFIG_OOB) += -DCONFIG_OOB
|
||||
ccflags-$(CONFIG_PREALLOC_TXQ) += -DCONFIG_PREALLOC_TXQ
|
||||
ccflags-$(CONFIG_ONE_TXQ) += -DCONFIG_ONE_TXQ
|
||||
ccflags-$(CONFIG_DPD) += -DCONFIG_DPD
|
||||
ccflags-$(CONFIG_FORCE_DPD_CALIB) += -DCONFIG_FORCE_DPD_CALIB -DCONFIG_DPD
|
||||
ccflags-$(CONFIG_LOFT_CALIB) += -DCONFIG_LOFT_CALIB
|
||||
ccflags-$(CONFIG_EXT_FEM_8800DCDW) += -DCONFIG_EXT_FEM_8800DCDW
|
||||
ccflags-$(CONFIG_RESV_MEM_SUPPORT) += -DCONFIG_RESV_MEM_SUPPORT
|
||||
ccflags-$(CONFIG_AMSDU_RX) += -DCONFIG_AMSDU_RX
|
||||
ccflags-$(CONFIG_IRQ_FALL) += -DCONFIG_IRQ_FALL
|
||||
ccflags-$(CONFIG_SDIO_BT) += -DCONFIG_SDIO_BT
|
||||
ccflags-$(CONFIG_RADAR_OR_IR_DETECT) += -DCONFIG_RADAR_OR_IR_DETECT
|
||||
ccflags-$(CONFIG_FOR_IPCAM) += -DCONFIG_FOR_IPCAM
|
||||
ccflags-$(CONFIG_BAND_STEERING) += -DCONFIG_BAND_STEERING
|
||||
ccflags-$(CONFIG_PRBREQ_REPORT) += -DCONFIG_PRBREQ_REPORT
|
||||
|
||||
|
||||
obj-m := $(MODULE_NAME).o
|
||||
$(MODULE_NAME)-y := \
|
||||
aic8800dc_compat.o \
|
||||
aic8800d80_compat.o \
|
||||
aic8800d80x2_compat.o \
|
||||
aic_bsp_main.o \
|
||||
aic_bsp_driver.o \
|
||||
aicsdio.o \
|
||||
@@ -65,7 +85,7 @@ ifeq ($(CONFIG_FIRMWARE_ARRAY),y)
|
||||
$(MODULE_NAME)-y += aicwf_firmware_array.o
|
||||
endif
|
||||
|
||||
# Platform support list
|
||||
########## Platform support list ##########
|
||||
CONFIG_PLATFORM_ROCKCHIP ?= n
|
||||
CONFIG_PLATFORM_ROCKCHIP2 ?= n
|
||||
CONFIG_PLATFORM_ALLWINNER ?=n
|
||||
@@ -75,26 +95,6 @@ CONFIG_PLATFORM_UBUNTU ?= y
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ROCKCHIP), y)
|
||||
ccflags-$(CONFIG_PLATFORM_ROCKCHIP) += -DCONFIG_PLATFORM_ROCKCHIP
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3399/rk3399-android-10/kernel
|
||||
#ARCH ?= arm64
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3399/rk3399-android-10/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3288/Android10/kernel/kernel/
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3288/Android10/tool/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/kernel
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/kernel
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/prebuilts/gcc/linux-x86/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/kernel
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3566/oudu/kernel
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3566/shengteng/kernel
|
||||
#ARCH ?= arm64
|
||||
#CROSS_COMPILE ?= ~/E/Rockchip/3566/Android11/rk3566_rk3568_android11_oranth/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3328/Android9/SDK/kernel/
|
||||
#ARCH ?= arm64
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3328/Android9/SDK/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
KDIR ?= /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/kernel
|
||||
ARCH ?= arm64
|
||||
CROSS_COMPILE ?= /home/yaya/E/Rockchip/3566/Android11/rk3566_rk3568_android11_oranth/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
@@ -109,9 +109,6 @@ endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ALLWINNER), y)
|
||||
ccflags-$(CONFIG_PLATFORM_ALLWINNER) += -DCONFIG_PLATFORM_ALLWINNER
|
||||
#KDIR ?= /home/yaya/E/Allwinner/A133/a133-sdk/android/longan/out/kernel/build/
|
||||
#ARCH ?= arm64
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Allwinner/A133/a133-sdk/android/longan/out/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
KDIR ?= /home/yaya/E/Allwinner/r818/Android10/lichee/kernel/linux-4.9/
|
||||
ARCH ?= arm64
|
||||
CROSS_COMPILE ?= /home/yaya/E/Allwinner/r818/Android10/android/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
|
||||
@@ -140,7 +137,7 @@ MODDESTDIR ?= /lib/modules/$(KVER)/kernel/drivers/net/wireless/
|
||||
ARCH ?= x86_64
|
||||
CROSS_COMPILE ?=
|
||||
endif
|
||||
|
||||
###########################################
|
||||
|
||||
all: modules
|
||||
modules:
|
||||
|
||||
71
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic8800d80_compat.c
Normal file → Executable file
71
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic8800d80_compat.c
Normal file → Executable file
@@ -47,6 +47,27 @@ u32 adaptivity_patch_tbl_8800d80[][2] = {
|
||||
{0x0168, 0x00010000}, //tx_adaptivity_en
|
||||
};
|
||||
|
||||
#define USER_PWROFST_COVER_CALIB_FLAG 0x01U
|
||||
#define USER_CHAN_MAX_TXPWR_EN_FLAG (0x01U << 1)
|
||||
#define USER_TX_USE_ANA_F_FLAG (0x01U << 2)
|
||||
#define USER_APM_PRBRSP_OFFLOAD_DISABLE_FLAG (0x01U << 3)
|
||||
#define USER_HE_MU_EDCA_UPDATE_DISABLE_FLAG (0x01U << 4)
|
||||
#define USER_LOFT_CALIB_DISABLE_FLAG (0x01U << 6)
|
||||
#define USER_CAPA_CALIB_DISABLE_FLAG (0x01U << 7)
|
||||
#define USER_PWR_CALIB_DISABLE_FLAG (0x01U << 8)
|
||||
|
||||
#define CFG_PWROFST_COVER_CALIB 1
|
||||
#define CFG_USER_CHAN_MAX_TXPWR_EN 1
|
||||
#define CFG_USER_TX_USE_ANA_F 0
|
||||
#ifdef CONFIG_PRBREQ_REPORT
|
||||
#define CFG_USER_APM_PRBRSP_OFFLOAD_DISABLE 1
|
||||
#else
|
||||
#define CFG_USER_APM_PRBRSP_OFFLOAD_DISABLE 0
|
||||
#endif
|
||||
|
||||
|
||||
#define CFG_USER_EXT_FLAGS_EN (CFG_PWROFST_COVER_CALIB || CFG_USER_CHAN_MAX_TXPWR_EN || CFG_USER_TX_USE_ANA_F || CFG_USER_APM_PRBRSP_OFFLOAD_DISABLE)
|
||||
|
||||
u32 patch_tbl_8800d80[][2] = {
|
||||
#ifdef USE_5G
|
||||
{0x00b4, 0xf3010001},
|
||||
@@ -54,11 +75,33 @@ u32 patch_tbl_8800d80[][2] = {
|
||||
{0x00b4, 0xf3010000},
|
||||
#endif
|
||||
#if defined(CONFIG_AMSDU_RX)
|
||||
{0x170, 0x0100000a}
|
||||
{0x170, 0x0100000a},
|
||||
#endif
|
||||
#ifdef CONFIG_IRQ_FALL
|
||||
{0x00000170, 0x0000010a}, //irqf
|
||||
#endif
|
||||
|
||||
#if CFG_USER_EXT_FLAGS_EN
|
||||
{0x0188, 0x00000000
|
||||
#if CFG_PWROFST_COVER_CALIB
|
||||
| USER_PWROFST_COVER_CALIB_FLAG
|
||||
#endif
|
||||
#if CFG_USER_CHAN_MAX_TXPWR_EN
|
||||
| USER_CHAN_MAX_TXPWR_EN_FLAG
|
||||
#endif
|
||||
#if CFG_USER_TX_USE_ANA_F
|
||||
| USER_TX_USE_ANA_F_FLAG
|
||||
#endif
|
||||
#if CFG_USER_APM_PRBRSP_OFFLOAD_DISABLE
|
||||
| USER_APM_PRBRSP_OFFLOAD_DISABLE_FLAG
|
||||
#endif
|
||||
//| USER_CAPA_CALIB_DISABLE_FLAG
|
||||
}, // user_ext_flags
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RADAR_OR_IR_DETECT
|
||||
{0x019c, 0x00000900}, //enable radar detect
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OOB
|
||||
@@ -90,11 +133,16 @@ int aicwifi_sys_config_8800d80(struct aic_sdio_dev *sdiodev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define NEW_PATCH_BUFFER_MAP 1
|
||||
|
||||
int aicwifi_patch_config_8800d80(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
const u32 rd_patch_addr = RAM_FMAC_FW_ADDR + 0x0198;
|
||||
u32 aic_patch_addr;
|
||||
u32 config_base, aic_patch_str_base;
|
||||
#if (NEW_PATCH_BUFFER_MAP)
|
||||
u32 patch_buff_addr, patch_buff_base, rd_version_addr, rd_version_val;
|
||||
#endif
|
||||
uint32_t start_addr = 0x0016F800;
|
||||
u32 patch_addr = start_addr;
|
||||
u32 patch_cnt = sizeof(patch_tbl_8800d80)/sizeof(u32)/2;
|
||||
@@ -126,6 +174,27 @@ int aicwifi_patch_config_8800d80(struct aic_sdio_dev *sdiodev)
|
||||
}
|
||||
aic_patch_str_base = rd_patch_addr_cfm.memdata;
|
||||
|
||||
#if (NEW_PATCH_BUFFER_MAP)
|
||||
rd_version_addr = RAM_FMAC_FW_ADDR + 0x01C;
|
||||
if ((ret = rwnx_send_dbg_mem_read_req(sdiodev, rd_version_addr, &rd_patch_addr_cfm))) {
|
||||
printk("version val[0x%x] rd fail: %d\n", rd_version_addr, ret);
|
||||
return ret;
|
||||
}
|
||||
rd_version_val = rd_patch_addr_cfm.memdata;
|
||||
printk("rd_version_val=%08X\n", rd_version_val);
|
||||
sdiodev->fw_version_uint = rd_version_val;
|
||||
if (rd_version_val > 0x06090100) {
|
||||
patch_buff_addr = rd_patch_addr + 12;
|
||||
ret = rwnx_send_dbg_mem_read_req(sdiodev, patch_buff_addr, &rd_patch_addr_cfm);
|
||||
if (ret) {
|
||||
printk("patch buf rd fail\n");
|
||||
return ret;
|
||||
}
|
||||
patch_buff_base = rd_patch_addr_cfm.memdata;
|
||||
patch_addr = start_addr = patch_buff_base;
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(magic_num), AIC_PATCH_MAGIG_NUM);
|
||||
if (ret) {
|
||||
printk("0x%x write fail\n", AIC_PATCH_ADDR(magic_num));
|
||||
|
||||
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic8800d80_compat.h
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic8800d80_compat.h
Normal file → Executable file
199
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic8800d80x2_compat.c
Executable file
199
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic8800d80x2_compat.c
Executable file
@@ -0,0 +1,199 @@
|
||||
#include "aic8800d80x2_compat.h"
|
||||
#include "aic_bsp_driver.h"
|
||||
|
||||
#define USER_PWROFST_COVER_CALIB_FLAG (0x01U << 0)
|
||||
#define USER_CHAN_MAX_TXPWR_EN_FLAG (0x01U << 1)
|
||||
#define USER_TX_USE_ANA_F_FLAG (0x01U << 2)
|
||||
#define USER_APM_PRBRSP_OFFLOAD_DISABLE_FLAG (0x01U << 3)
|
||||
#define USER_HE_MU_EDCA_UPDATE_DISABLE_FLAG (0x01U << 4)
|
||||
|
||||
#define RAM_FMAC_FW_ADDR_8800D80X2 0x120000
|
||||
#define RAM_FMAC_RF_FW_ADDR_8800D80X2 0x120000
|
||||
|
||||
#define CFG_USER_CHAN_MAX_TXPWR_EN 1
|
||||
#define CFG_USER_TX_USE_ANA_F 0
|
||||
#ifdef CONFIG_PRBREQ_REPORT
|
||||
#define CFG_USER_APM_PRBRSP_OFFLOAD_DISABLE 1
|
||||
#else
|
||||
#define CFG_USER_APM_PRBRSP_OFFLOAD_DISABLE 0
|
||||
#endif
|
||||
|
||||
extern int adap_test;
|
||||
#define NEW_PATCH_BUFFER_MAP 1
|
||||
#define AIC_PATCH_MAGIG_NUM 0x48435450 // "PTCH"
|
||||
#define AIC_PATCH_MAGIG_NUM_2 0x50544348 // "HCTP"
|
||||
#define AIC_PATCH_BLOCK_MAX 4
|
||||
extern struct aicbsp_info_t aicbsp_info;
|
||||
extern int adap_test;
|
||||
|
||||
typedef u32 (*array2_tbl_t)[2];
|
||||
|
||||
typedef struct {
|
||||
uint32_t magic_num;
|
||||
uint32_t pair_start;
|
||||
uint32_t magic_num_2;
|
||||
uint32_t pair_count;
|
||||
uint32_t block_dst[AIC_PATCH_BLOCK_MAX];
|
||||
uint32_t block_src[AIC_PATCH_BLOCK_MAX];
|
||||
uint32_t block_size[AIC_PATCH_BLOCK_MAX]; // word count
|
||||
} aic_patch_t;
|
||||
|
||||
#define AIC_PATCH_OFST(mem) ((size_t) &((aic_patch_t *)0)->mem)
|
||||
#define AIC_PATCH_ADDR(mem) ((u32) (aic_patch_str_base + AIC_PATCH_OFST(mem)))
|
||||
|
||||
|
||||
u32 patch_tbl_d80x2[][2] =
|
||||
{
|
||||
{0x021c, 0x04000000},//hs amsdu
|
||||
{0x0220, 0x04010101},//ss amsdu
|
||||
{0x0224, 0x50000a01},//hs aggr
|
||||
{0x0228, 0x50000a00},//ss aggr
|
||||
|
||||
{0x01f0, 0x00000001
|
||||
#if CFG_USER_CHAN_MAX_TXPWR_EN
|
||||
| USER_CHAN_MAX_TXPWR_EN_FLAG
|
||||
#endif
|
||||
#if CFG_USER_TX_USE_ANA_F
|
||||
| USER_TX_USE_ANA_F_FLAG
|
||||
#endif
|
||||
#if CFG_USER_APM_PRBRSP_OFFLOAD_DISABLE
|
||||
| USER_APM_PRBRSP_OFFLOAD_DISABLE_FLAG
|
||||
#endif
|
||||
}, // user_ext_flags
|
||||
};
|
||||
|
||||
//adap test
|
||||
u32 adaptivity_patch_tbl_d80x2[][2] = {
|
||||
{0x000C, 0x0000320A}, //linkloss_thd
|
||||
{0x009C, 0x00000000}, //ac_param_conf
|
||||
{0x01D0, 0x00010000}, //tx_adaptivity_en
|
||||
};
|
||||
|
||||
|
||||
int aicwifi_patch_config_8800d80x2(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
u32 rd_patch_addr;
|
||||
u32 aic_patch_addr;
|
||||
u32 config_base, aic_patch_str_base;
|
||||
#if (NEW_PATCH_BUFFER_MAP)
|
||||
u32 patch_buff_addr, patch_buff_base, rd_version_addr, rd_version_val;
|
||||
#endif
|
||||
uint32_t start_addr;
|
||||
u32 patch_addr;
|
||||
u32 patch_cnt = sizeof(patch_tbl_d80x2) / 4 / 2;
|
||||
struct dbg_mem_read_cfm rd_patch_addr_cfm;
|
||||
int ret = 0;
|
||||
int cnt = 0;
|
||||
//adap test
|
||||
int adap_patch_cnt = 0;
|
||||
|
||||
if (adap_test) {
|
||||
AICWFDBG(LOGINFO, "%s adap test \r\n", __func__);
|
||||
adap_patch_cnt = sizeof(adaptivity_patch_tbl_d80x2)/sizeof(u32)/2;
|
||||
}
|
||||
|
||||
rd_patch_addr = RAM_FMAC_FW_ADDR_8800D80X2 + 0x01A8;
|
||||
aic_patch_addr = rd_patch_addr + 8;
|
||||
|
||||
AICWFDBG(LOGINFO, "Read FW mem: %08x\n", rd_patch_addr);
|
||||
if ((ret = rwnx_send_dbg_mem_read_req(sdiodev, rd_patch_addr, &rd_patch_addr_cfm))) {
|
||||
AICWFDBG(LOGERROR, "setting base[0x%x] rd fail: %d\n", rd_patch_addr, ret);
|
||||
return ret;
|
||||
}
|
||||
AICWFDBG(LOGINFO, "rd_patch_addr_cfm %x=%x\n", rd_patch_addr_cfm.memaddr, rd_patch_addr_cfm.memdata);
|
||||
config_base = rd_patch_addr_cfm.memdata;
|
||||
|
||||
if ((ret = rwnx_send_dbg_mem_read_req(sdiodev, aic_patch_addr, &rd_patch_addr_cfm))) {
|
||||
AICWFDBG(LOGERROR, "patch_str_base[0x%x] rd fail: %d\n", aic_patch_addr, ret);
|
||||
return ret;
|
||||
}
|
||||
AICWFDBG(LOGINFO, "rd_patch_addr_cfm %x=%x\n", rd_patch_addr_cfm.memaddr, rd_patch_addr_cfm.memdata);
|
||||
aic_patch_str_base = rd_patch_addr_cfm.memdata;
|
||||
|
||||
#if (NEW_PATCH_BUFFER_MAP)
|
||||
rd_version_addr = RAM_FMAC_FW_ADDR_8800D80X2 + 0x01C;
|
||||
if ((ret = rwnx_send_dbg_mem_read_req(sdiodev, rd_version_addr, &rd_patch_addr_cfm))) {
|
||||
AICWFDBG(LOGERROR, "version val[0x%x] rd fail: %d\n", rd_version_addr, ret);
|
||||
return ret;
|
||||
}
|
||||
rd_version_val = rd_patch_addr_cfm.memdata;
|
||||
AICWFDBG(LOGINFO, "rd_version_val=%08X\n", rd_version_val);
|
||||
sdiodev->fw_version_uint = rd_version_val;
|
||||
patch_buff_addr = rd_patch_addr + 12;
|
||||
ret = rwnx_send_dbg_mem_read_req(sdiodev, patch_buff_addr, &rd_patch_addr_cfm);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGERROR, "patch buf rd fail\n");
|
||||
return ret;
|
||||
}
|
||||
AICWFDBG(LOGINFO, "rd_patch_addr_cfm %x=%x\n", rd_patch_addr_cfm.memaddr, rd_patch_addr_cfm.memdata);
|
||||
patch_buff_base = rd_patch_addr_cfm.memdata;
|
||||
patch_addr = start_addr = patch_buff_base;
|
||||
#endif
|
||||
|
||||
if ((ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(magic_num), AIC_PATCH_MAGIG_NUM))) {
|
||||
AICWFDBG(LOGERROR, "maigic_num[0x%x] write fail: %d\n", AIC_PATCH_ADDR(magic_num), ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(magic_num_2), AIC_PATCH_MAGIG_NUM_2))) {
|
||||
AICWFDBG(LOGERROR, "maigic_num[0x%x] write fail: %d\n", AIC_PATCH_ADDR(magic_num_2), ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(pair_start), patch_addr))) {
|
||||
AICWFDBG(LOGERROR, "pair_start[0x%x] write fail: %d\n", AIC_PATCH_ADDR(pair_start), ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(pair_count), patch_cnt + adap_patch_cnt))) {
|
||||
AICWFDBG(LOGERROR, "pair_count[0x%x] write fail: %d\n", AIC_PATCH_ADDR(pair_count), ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
for (cnt = 0; cnt < patch_cnt; cnt++) {
|
||||
if ((ret = rwnx_send_dbg_mem_write_req(sdiodev, start_addr+8*cnt, patch_tbl_d80x2[cnt][0]+config_base))) {
|
||||
AICWFDBG(LOGERROR, "%x write fail\n", start_addr+8*cnt);
|
||||
return ret;
|
||||
}
|
||||
if ((ret = rwnx_send_dbg_mem_write_req(sdiodev, start_addr+8*cnt+4, patch_tbl_d80x2[cnt][1]))) {
|
||||
AICWFDBG(LOGERROR, "%x write fail\n", start_addr+8*cnt+4);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (adap_test){
|
||||
int tmp_cnt = patch_cnt + adap_patch_cnt;
|
||||
AICWFDBG(LOGINFO, "%s set adap_test patch \r\n", __func__);
|
||||
for (cnt = patch_cnt; cnt < tmp_cnt; cnt++) {
|
||||
int tbl_idx = cnt - patch_cnt;
|
||||
if ((ret = rwnx_send_dbg_mem_write_req(sdiodev, start_addr+8*cnt, adaptivity_patch_tbl_d80x2[tbl_idx][0]+config_base))) {
|
||||
AICWFDBG(LOGERROR, "%x write fail\n", start_addr+8*cnt);
|
||||
return ret;
|
||||
}
|
||||
if ((ret = rwnx_send_dbg_mem_write_req(sdiodev, start_addr+8*cnt+4, adaptivity_patch_tbl_d80x2[tbl_idx][1]))) {
|
||||
AICWFDBG(LOGERROR, "%x write fail\n", start_addr+8*cnt+4);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(block_size[0]), 0))) {
|
||||
AICWFDBG(LOGERROR, "block_size[0x%x] write fail: %d\n", AIC_PATCH_ADDR(block_size[0]), ret);
|
||||
return ret;
|
||||
}
|
||||
if ((ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(block_size[1]), 0))) {
|
||||
AICWFDBG(LOGERROR, "block_size[0x%x] write fail: %d\n", AIC_PATCH_ADDR(block_size[1]), ret);
|
||||
return ret;
|
||||
}
|
||||
if ((ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(block_size[2]), 0))) {
|
||||
AICWFDBG(LOGERROR, "block_size[0x%x] write fail: %d\n", AIC_PATCH_ADDR(block_size[2]), ret);
|
||||
return ret;
|
||||
}
|
||||
if ((ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(block_size[3]), 0))) {
|
||||
AICWFDBG(LOGERROR, "block_size[0x%x] write fail: %d\n", AIC_PATCH_ADDR(block_size[3]), ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
12
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic8800d80x2_compat.h
Executable file
12
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic8800d80x2_compat.h
Executable file
@@ -0,0 +1,12 @@
|
||||
#ifndef _AIC8800D80x2_COMPAT_H_
|
||||
#define _AIC8800D80x2_COMPAT_H_
|
||||
|
||||
#include "aicsdio.h"
|
||||
|
||||
|
||||
int aicwifi_patch_config_8800d80x2(struct aic_sdio_dev *sdiodev);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
441
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic8800dc_compat.c
Normal file → Executable file
441
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic8800dc_compat.c
Normal file → Executable file
@@ -52,6 +52,7 @@ u32 syscfg_tbl_masked_8800dc[][3] = {
|
||||
{0x700010A0, (0x1 << 11), (0x1 << 11)},
|
||||
{0x70001034, ((0x1 << 20) | (0x7 << 26)), ((0x0 << 20) | (0x2 << 26))},
|
||||
{0x70001038, (0x1 << 8), (0x1 << 8)},
|
||||
{0x70001084, (0x3 << 13), (0x0 << 13)},
|
||||
{0x70001094, (0x3 << 2), (0x0 << 2)},
|
||||
{0x700021D0, ((0x1 << 5) | (0x1 << 6)), ((0x1 << 5) | (0x1 << 6))},
|
||||
{0x70001000, ((0x1 << 0) | (0x1 << 20) | (0x1 << 22)),
|
||||
@@ -69,6 +70,7 @@ u32 syscfg_tbl_masked_8800dc[][3] = {
|
||||
{0x700010A0, (0x1 << 11), (0x1 << 11)},
|
||||
{0x70001034, ((0x1 << 20) | (0x7 << 26)), ((0x0 << 20) | (0x2 << 26))},
|
||||
{0x70001038, (0x1 << 8), (0x1 << 8)},
|
||||
{0x70001084, (0x3 << 13), (0x0 << 13)},
|
||||
{0x70001094, (0x3 << 2), (0x0 << 2)},
|
||||
{0x700021D0, ((0x1 << 5) | (0x1 << 6)), ((0x1 << 5) | (0x1 << 6))},
|
||||
{0x70001000, ((0x1 << 0) | (0x1 << 20) | (0x1 << 22)),
|
||||
@@ -94,6 +96,7 @@ u32 syscfg_tbl_masked_8800dc_h[][3] = {
|
||||
{0x700010A0, (0x1 << 11), (0x1 << 11)},
|
||||
//{0x70001034, ((0x1 << 20) | (0x7 << 26)), ((0x0 << 20) | (0x2 << 26))},
|
||||
{0x70001038, (0x1 << 8), (0x1 << 8)},
|
||||
{0x70001084, (0x3 << 13), (0x0 << 13)},
|
||||
{0x70001094, (0x3 << 2), (0x0 << 2)},
|
||||
{0x700021D0, ((0x1 << 5) | (0x1 << 6)), ((0x1 << 5) | (0x1 << 6))},
|
||||
#if defined(CONFIG_VRF_DCDC_MODE)
|
||||
@@ -128,6 +131,9 @@ u32 patch_tbl_wifisetting_8800dc_u02[][2] =
|
||||
#else
|
||||
{0x0124,0x01001E01}
|
||||
#endif
|
||||
#ifdef CONFIG_PRBREQ_REPORT
|
||||
{0x0138, 0x00010a00}, //apm probe resp offload en
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -1323,7 +1329,7 @@ uint32_t agc_cfg_ram[] = {
|
||||
0x00000000
|
||||
};
|
||||
|
||||
|
||||
#if !defined(CONFIG_EXT_FEM_8800DCDW)
|
||||
uint32_t txgain_map[96] = {
|
||||
#ifdef CONFIG_FPGA_VERIFICATION
|
||||
0x20c0c971,
|
||||
@@ -1461,8 +1467,8 @@ uint32_t txgain_map[96] = {
|
||||
0x00ffc88b,
|
||||
0x00ffc979,
|
||||
0x00ffc989,
|
||||
0x00ffca7d,
|
||||
0x00ffca88,
|
||||
0x00ffcc4b,
|
||||
0x00ffcc54,
|
||||
0x00ffcc5e,
|
||||
0x00ffcc69,
|
||||
0x00ffcc78,
|
||||
@@ -1494,8 +1500,8 @@ uint32_t txgain_map[96] = {
|
||||
0x00ffc88b,
|
||||
0x00ffc979,
|
||||
0x00ffc989,
|
||||
0x00ffca7d,
|
||||
0x00ffca88,
|
||||
0x00ffcc4b,
|
||||
0x00ffcc54,
|
||||
0x00ffcc5e,
|
||||
0x00ffcc69,
|
||||
0x00ffcc78,
|
||||
@@ -1503,9 +1509,9 @@ uint32_t txgain_map[96] = {
|
||||
0x00ffcd70,
|
||||
0x00ffcd80,
|
||||
0x00ffcd90,
|
||||
0x00ffce80,
|
||||
0x00ffce93,
|
||||
0x00ffcf90,
|
||||
0x00ffcf68,
|
||||
0x00ffcf75,
|
||||
0x00ffcf83,
|
||||
0x00ffc080,
|
||||
0x00ffc090,
|
||||
0x00ffc180,
|
||||
@@ -1564,8 +1570,8 @@ const uint32_t txgain_map_h[96] =
|
||||
0xffc879, //8
|
||||
0xffc96b, //9
|
||||
0xffc979, //10
|
||||
0xffca6b, //11
|
||||
0xffca79, //12
|
||||
0xffcc45, //11
|
||||
0xffcc4d, //12
|
||||
0xffcc56, //13
|
||||
0xffcc60, //14
|
||||
0xffcc6b, //15
|
||||
@@ -1597,15 +1603,15 @@ const uint32_t txgain_map_h[96] =
|
||||
0xffc879, //8
|
||||
0xffc96b, //9
|
||||
0xffc979, //10
|
||||
0xffca6b, //11
|
||||
0xffca79, //12
|
||||
0xffcc45, //11
|
||||
0xffcc4d, //12
|
||||
0xffcc56, //13
|
||||
0xffcc60, //14
|
||||
0xffcc6b, //15
|
||||
0xffcc79, //16
|
||||
0xffcd72, //17
|
||||
0xffce60, //18
|
||||
0xffce72, //19
|
||||
0xffcf5b, //18
|
||||
0xffcf66, //19
|
||||
0xffcf72, //20
|
||||
0xffcf80, //21
|
||||
0xffcf90, //22
|
||||
@@ -1628,6 +1634,213 @@ const uint32_t txgain_map_h[96] =
|
||||
0xffc86b, //7
|
||||
};
|
||||
|
||||
#else /* #ifdef CONFIG_EXT_FEM_8800DCDW */
|
||||
const uint32_t txgain_map_femkct[96] =
|
||||
{
|
||||
//11b
|
||||
0x00ffd780,//15
|
||||
0x00ffd872,//16
|
||||
0x00ffd880,//17
|
||||
0x00ffd972,//18
|
||||
0x00ffd980,//19
|
||||
0x00ffda72,//20
|
||||
0x00ffda80,//21
|
||||
0x00ffdb72,//22
|
||||
0x00ffdb80,//23
|
||||
0x00ffdc72,//24
|
||||
0x00ffdc80,//25
|
||||
0x00ffdd72,//26
|
||||
0x00ffdd80,//27
|
||||
0x00ffde72,//28
|
||||
0x00ffde80,//29
|
||||
0x00ffdf72,//30
|
||||
0x00ffd072,//-1
|
||||
0x00ffd072,//0
|
||||
0x00ffd080,//1
|
||||
0x00ffd172,//2
|
||||
0x00ffd180,//3
|
||||
0x00ffd272,//4
|
||||
0x00ffd280,//5
|
||||
0x00ffd36d,//6
|
||||
0x00ffd379,//7
|
||||
0x00ffd46d,//8
|
||||
0x00ffd479,//9
|
||||
0x00ffd572,//10
|
||||
0x00ffd580,//11
|
||||
0x00ffd672,//12
|
||||
0x00ffd680,//13
|
||||
0x00ffd772,//14
|
||||
//high
|
||||
0x00ffc872,//11
|
||||
0x00ffc880,//12
|
||||
0x00ffc972,//13
|
||||
0x00ffc980,//14
|
||||
0x00ffca72,//15
|
||||
0x00ffca80,//16
|
||||
0x00ffcb72,//17
|
||||
0x00ffcb80,//18
|
||||
0x00ffcc72,//19
|
||||
0x00ffcc80,//20
|
||||
0x00ffcd72,//21
|
||||
0x00ffcd80,//22
|
||||
0x00ffce72,//23
|
||||
0x00ffce80,//24
|
||||
0x00ffcf72,//25
|
||||
0x00ffcf80,//26
|
||||
0x00ffc072,//-5
|
||||
0x00ffc080,//-4
|
||||
0x00ffc172,//-3
|
||||
0x00ffc180,//-2
|
||||
0x00ffc272,//-1
|
||||
0x00ffc280,//0
|
||||
0x00ffc372,//1
|
||||
0x00ffc380,//2
|
||||
0x00ffc472,//3
|
||||
0x00ffc480,//4
|
||||
0x00ffc572,//5
|
||||
0x00ffc580,//6
|
||||
0x00ffc672,//7
|
||||
0x00ffc680,//8
|
||||
0x00ffc772,//9
|
||||
0x00ffc780,//10
|
||||
//low
|
||||
0x00ffc872,//11
|
||||
0x00ffc880,//12
|
||||
0x00ffc972,//13
|
||||
0x00ffc980,//14
|
||||
0x00ffca72,//15
|
||||
0x00ffca80,//16
|
||||
0x00ffcb72,//17
|
||||
0x00ffcb80,//18
|
||||
0x00ffcc72,//19
|
||||
0x00ffcc80,//20
|
||||
0x00ffcd72,//21
|
||||
0x00ffcd80,//22
|
||||
0x00ffce72,//23
|
||||
0x00ffce80,//24
|
||||
0x00ffcf72,//26
|
||||
0x00ffcf80,//27
|
||||
0x00ffc072,//-5
|
||||
0x00ffc080,//-4
|
||||
0x00ffc172,//-3
|
||||
0x00ffc180,//-2
|
||||
0x00ffc272,//-1
|
||||
0x00ffc280,//0
|
||||
0x00ffc372,//1
|
||||
0x00ffc380,//2
|
||||
0x00ffc472,//3
|
||||
0x00ffc480,//4
|
||||
0x00ffc572,//5
|
||||
0x00ffc580,//6
|
||||
0x00ffc672,//7
|
||||
0x00ffc680,//8
|
||||
0x00ffc772,//9
|
||||
0x00ffc780,//10
|
||||
};
|
||||
|
||||
const uint32_t txgain_map_femkct_h[96] =
|
||||
{
|
||||
//11b
|
||||
0x00ffd86c,//15
|
||||
0x00ffd879,//16
|
||||
0x00ffd96c,//17
|
||||
0x00ffd979,//18
|
||||
0x00ffd988,//19
|
||||
0x00ffda6c,//20
|
||||
0x00ffda79,//21
|
||||
0x00ffdb6c,//22
|
||||
0x00ffdb79,//23
|
||||
0x00ffdc6c,//24
|
||||
0x00ffdc79,//25
|
||||
0x00ffdd6c,//26
|
||||
0x00ffdd79,//27
|
||||
0x00ffde6c,//28
|
||||
0x00ffde79,//29
|
||||
0x00ffdf6c,//30
|
||||
0x00ffd06c,//-1
|
||||
0x00ffd06c,//0
|
||||
0x00ffd079,//1
|
||||
0x00ffd16c,//2
|
||||
0x00ffd179,//3
|
||||
0x00ffd26c,//4
|
||||
0x00ffd279,//5
|
||||
0x00ffd372,//6
|
||||
0x00ffd467,//7
|
||||
0x00ffd472,//8
|
||||
0x00ffd56c,//9
|
||||
0x00ffd579,//10
|
||||
0x00ffd66c,//11
|
||||
0x00ffd679,//12
|
||||
0x00ffd76c,//13
|
||||
0x00ffd779,//14
|
||||
//high
|
||||
0x00ffc879,//11
|
||||
0x00ffc96c,//12
|
||||
0x00ffc979,//13
|
||||
0x00ffca6c,//14
|
||||
0x00ffca79,//15
|
||||
0x00ffcb6c,//16
|
||||
0x00ffcb79,//17
|
||||
0x00ffcc6c,//18
|
||||
0x00ffcc79,//19
|
||||
0x00ffcc88,//20
|
||||
0x00ffcd6c,//21
|
||||
0x00ffcd79,//22
|
||||
0x00ffce6c,//23
|
||||
0x00ffce79,//24
|
||||
0x00ffcf6c,//25
|
||||
0x00ffcf79,//26
|
||||
0x00ffc079,//-5
|
||||
0x00ffc16c,//-4
|
||||
0x00ffc179,//-3
|
||||
0x00ffc26c,//-2
|
||||
0x00ffc279,//-1
|
||||
0x00ffc36c,//0
|
||||
0x00ffc379,//1
|
||||
0x00ffc46c,//2
|
||||
0x00ffc479,//3
|
||||
0x00ffc56c,//4
|
||||
0x00ffc579,//5
|
||||
0x00ffc66c,//6
|
||||
0x00ffc679,//7
|
||||
0x00ffc76c,//8
|
||||
0x00ffc779,//9
|
||||
0x00ffc86c,//10
|
||||
//low
|
||||
0x00ffc879,//11
|
||||
0x00ffc96c,//12
|
||||
0x00ffc979,//13
|
||||
0x00ffca6c,//14
|
||||
0x00ffca79,//15
|
||||
0x00ffcb6c,//16
|
||||
0x00ffcb79,//17
|
||||
0x00ffcc6c,//18
|
||||
0x00ffcc79,//19
|
||||
0x00ffcc88,//20
|
||||
0x00ffcd6c,//21
|
||||
0x00ffcd79,//22
|
||||
0x00ffce6c,//23
|
||||
0x00ffce79,//24
|
||||
0x00ffcf6c,//25
|
||||
0x00ffcf79,//26
|
||||
0x00ffc079,//-5
|
||||
0x00ffc16c,//-4
|
||||
0x00ffc179,//-3
|
||||
0x00ffc26c,//-2
|
||||
0x00ffc279,//-1
|
||||
0x00ffc36c,//0
|
||||
0x00ffc379,//1
|
||||
0x00ffc46c,//2
|
||||
0x00ffc479,//3
|
||||
0x00ffc56c,//4
|
||||
0x00ffc579,//5
|
||||
0x00ffc66c,//6
|
||||
0x00ffc679,//7
|
||||
0x00ffc76c,//8
|
||||
0x00ffc779,//9
|
||||
0x00ffc86c,//10
|
||||
};
|
||||
#endif
|
||||
|
||||
u32 jump_tbl[][2] =
|
||||
{
|
||||
@@ -1689,10 +1902,61 @@ u32 patch_tbl_rf_func[][2] =
|
||||
{0x00110bf0, 0x00180001},
|
||||
};
|
||||
|
||||
|
||||
//adap test
|
||||
u32 adaptivity_patch_tbl_8800dc[][2] = {
|
||||
{0x000C, 0x0000320A}, //linkloss_thd
|
||||
{0x009C, 0x00000000}, //ac_param_conf
|
||||
{0x0128, 0xF6140001}, //tx_adaptivity_en
|
||||
};
|
||||
//adap test
|
||||
|
||||
|
||||
static u8 chip_id = 0;
|
||||
#define CHIP_ID_H_MASK 0xC0
|
||||
#define IS_CHIP_ID_H() ((chip_id & CHIP_ID_H_MASK) == CHIP_ID_H_MASK)
|
||||
|
||||
//Crystal provided by CPU (start)
|
||||
int set_bbpll_config(struct aic_sdio_dev *rwnx_hw){
|
||||
// {0x40505010, 0x7C301010},//bbpll
|
||||
int ret = 0;
|
||||
struct dbg_mem_read_cfm rd_mem_addr_cfm;
|
||||
|
||||
//Read crystal provided by CPU or not.
|
||||
ret = rwnx_send_dbg_mem_read_req(rwnx_hw, 0x40500148, &rd_mem_addr_cfm);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGERROR, "%x rd fail: %d\n", 0x40500148, ret);
|
||||
return -1;
|
||||
}
|
||||
|
||||
AICWFDBG(LOGDEBUG, "%s rd_mem_addr_cfm.memdata:%x \r\n", __func__, rd_mem_addr_cfm.memdata);
|
||||
|
||||
if(!(rd_mem_addr_cfm.memdata & 0x01)){
|
||||
AICWFDBG(LOGINFO, "%s Crystal not provided by CPU \r\n", __func__);
|
||||
return 0;
|
||||
}else{
|
||||
AICWFDBG(LOGINFO, "%s Crystal provided by CPU \r\n", __func__);
|
||||
//Read 0x40505010 value to check bbpll set or not.
|
||||
ret = rwnx_send_dbg_mem_read_req(rwnx_hw, 0x40505010, &rd_mem_addr_cfm);
|
||||
if(ret < 0){
|
||||
AICWFDBG(LOGERROR, "%s error ret_val:%d\r\n", __func__, ret);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if((rd_mem_addr_cfm.memdata >> 29) == 3){
|
||||
AICWFDBG(LOGERROR, "%s Not need to set \r\n", __func__);
|
||||
return 0;
|
||||
}else{
|
||||
rd_mem_addr_cfm.memdata |= ((0x1 << 29) | (0x1 << 30));
|
||||
rd_mem_addr_cfm.memdata &= (~(0x1 << 31));
|
||||
rwnx_send_dbg_mem_write_req(rwnx_hw, 0x40505010, rd_mem_addr_cfm.memdata);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//Crystal provided by CPU (end)
|
||||
|
||||
|
||||
void system_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
||||
{
|
||||
int syscfg_num;
|
||||
@@ -1724,6 +1988,14 @@ void system_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
||||
//printk("%x=%x\n", rd_mem_addr_cfm.memaddr, rd_mem_addr_cfm.memdata);
|
||||
AICWFDBG(LOGINFO, "chip_id=%x, chip_sub_id=%x!!\n", chip_id, chip_sub_id);
|
||||
|
||||
//Crystal provided by CPU (start)
|
||||
ret = set_bbpll_config(rwnx_hw);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGERROR, "set_bbpll_config fail: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
//Crystal provided by CPU (end)
|
||||
|
||||
|
||||
ret = rwnx_send_dbg_mem_read_req(rwnx_hw, 0x40500010, &rd_mem_addr_cfm);
|
||||
AICWFDBG(LOGDEBUG, "[0x40500010]=%x\n", rd_mem_addr_cfm.memdata);
|
||||
@@ -1816,6 +2088,7 @@ void system_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
||||
|
||||
}
|
||||
|
||||
extern int adap_test;
|
||||
|
||||
void aicwf_patch_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
||||
{
|
||||
@@ -1838,6 +2111,11 @@ void aicwf_patch_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
||||
u32 jump_tbl_size = 0;
|
||||
u32 patch_tbl_func_num = 0;
|
||||
|
||||
//adap test
|
||||
int adap_patch_num = 0;
|
||||
//adap test
|
||||
|
||||
|
||||
array2_tbl_t jump_tbl_base = NULL;
|
||||
array2_tbl_t patch_tbl_func_base = NULL;
|
||||
array2_tbl_t patch_tbl_wifisetting_8800dc_base = NULL;
|
||||
@@ -1895,6 +2173,19 @@ void aicwf_patch_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
||||
}
|
||||
}
|
||||
|
||||
//adap test
|
||||
if(adap_test){
|
||||
AICWFDBG(LOGINFO, "%s for adaptivity test \r\n", __func__);
|
||||
adap_patch_num = sizeof(adaptivity_patch_tbl_8800dc)/sizeof(u32)/2;
|
||||
for(cnt = 0; cnt < adap_patch_num; cnt++)
|
||||
{
|
||||
if((ret = rwnx_send_dbg_mem_write_req(rwnx_hw, wifisetting_cfg_addr + adaptivity_patch_tbl_8800dc[cnt][0], adaptivity_patch_tbl_8800dc[cnt][1]))) {
|
||||
AICWFDBG(LOGERROR, "%x write fail\n", wifisetting_cfg_addr + adaptivity_patch_tbl_8800dc[cnt][0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//adap test
|
||||
|
||||
if (ldpc_cfg_size > 512) {// > 0.5KB data
|
||||
for (i = 0; i < (ldpc_cfg_size - 512); i += 512) {//each time write 0.5KB
|
||||
ret = rwnx_send_dbg_mem_block_write_req(rwnx_hw, ldpc_cfg_addr + i, 512, ldpc_cfg_ram + i / 4);
|
||||
@@ -1931,11 +2222,21 @@ void aicwf_patch_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
||||
|
||||
#if !defined(CONFIG_FPGA_VERIFICATION)
|
||||
if ((IS_CHIP_ID_H())) {
|
||||
#if defined(CONFIG_EXT_FEM_8800DCDW)
|
||||
txgain_cfg_size = sizeof(txgain_map_femkct_h);
|
||||
txgain_cfg_array = (u32 *)txgain_map_femkct_h;
|
||||
#else
|
||||
txgain_cfg_size = sizeof(txgain_map_h);
|
||||
txgain_cfg_array = (u32 *)txgain_map_h;
|
||||
#endif
|
||||
} else {
|
||||
#if defined(CONFIG_EXT_FEM_8800DCDW)
|
||||
txgain_cfg_size = sizeof(txgain_map_femkct);
|
||||
txgain_cfg_array = (u32 *)txgain_map_femkct;
|
||||
#else
|
||||
txgain_cfg_size = sizeof(txgain_map);
|
||||
txgain_cfg_array = (u32 *)txgain_map;
|
||||
#endif
|
||||
}
|
||||
ret = rwnx_send_dbg_mem_block_write_req(rwnx_hw, txgain_cfg_addr, txgain_cfg_size, txgain_cfg_array);
|
||||
if (ret) {
|
||||
@@ -2223,4 +2524,116 @@ int aicwf_dpd_result_write_8800dc(void *buf, int buf_len)
|
||||
#endif /* !CONFIG_FORCE_DPD_CALIB */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LOFT_CALIB
|
||||
int aicwf_loft_calib_8800dc(struct aic_sdio_dev *sdiodev, rf_misc_ram_lite_t *loft_res)
|
||||
{
|
||||
int ret = 0;
|
||||
uint32_t fw_addr, boot_type;
|
||||
int valid_flag;
|
||||
|
||||
printk("%s\n", __func__);
|
||||
|
||||
ret = aicwf_misc_ram_valid_check_8800dc(sdiodev, &valid_flag);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "misc ram check fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
if (valid_flag) {
|
||||
AICWFDBG(LOGINFO, "misc ram valid, skip calib process\n");
|
||||
return ret;
|
||||
}
|
||||
ret = aicwf_plat_calib_load_8800dc(sdiodev);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "load calib bin fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
/* fw start */
|
||||
fw_addr = 0x00130009;
|
||||
boot_type = HOST_START_APP_FNCALL;
|
||||
AICWFDBG(LOGINFO, "Start app: %08x, %d\n", fw_addr, boot_type);
|
||||
ret = rwnx_send_dbg_start_app_req(sdiodev, fw_addr, boot_type, NULL);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "start app fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
{ // read loft res
|
||||
const uint32_t cfg_base = 0x10164;
|
||||
struct dbg_mem_read_cfm cfm;
|
||||
uint32_t misc_ram_addr;
|
||||
uint32_t ram_base_addr, ram_word_cnt;
|
||||
int i;
|
||||
ret = rwnx_send_dbg_mem_read_req(sdiodev, cfg_base + 0x14, &cfm);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGERROR, "rf misc ram[0x%x] rd fail: %d\n", cfg_base + 0x14, ret);
|
||||
return ret;
|
||||
}
|
||||
misc_ram_addr = cfm.memdata;
|
||||
// bit_mask
|
||||
ram_base_addr = misc_ram_addr + offsetof(rf_misc_ram_t, bit_mask);
|
||||
ram_word_cnt = (MEMBER_SIZE(rf_misc_ram_t, bit_mask) + MEMBER_SIZE(rf_misc_ram_t, reserved)) / 4;
|
||||
for (i = 0; i < ram_word_cnt; i++) {
|
||||
ret = rwnx_send_dbg_mem_read_req(sdiodev, ram_base_addr + i * 4, &cfm);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGERROR, "bit_mask[0x%x] rd fail: %d\n", ram_base_addr + i * 4, ret);
|
||||
return ret;
|
||||
}
|
||||
loft_res->bit_mask[i] = cfm.memdata;
|
||||
}
|
||||
// loft_res
|
||||
ram_base_addr = misc_ram_addr + offsetof(rf_misc_ram_t, loft_res);
|
||||
ram_word_cnt = MEMBER_SIZE(rf_misc_ram_t, loft_res) / 4;
|
||||
for (i = 0; i < ram_word_cnt; i++) {
|
||||
ret = rwnx_send_dbg_mem_read_req(sdiodev, ram_base_addr + i * 4, &cfm);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGERROR, "loft_res[0x%x] rd fail: %d\n", ram_base_addr + i * 4, ret);
|
||||
return ret;
|
||||
}
|
||||
loft_res->loft_res[i] = cfm.memdata;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int aicwf_loft_result_apply_8800dc(struct aic_sdio_dev *sdiodev, rf_misc_ram_lite_t *loft_res)
|
||||
{
|
||||
int ret = 0;
|
||||
uint32_t cfg_base = 0x10164;
|
||||
struct dbg_mem_read_cfm cfm;
|
||||
uint32_t misc_ram_addr;
|
||||
uint32_t ram_base_addr, ram_byte_cnt;
|
||||
AICWFDBG(LOGINFO, "bit_mask[1]=%x\n", loft_res->bit_mask[1]);
|
||||
if (loft_res->bit_mask[1] == 0) {
|
||||
AICWFDBG(LOGERROR, "void loft_res, bypass it.\n");
|
||||
return 0;
|
||||
}
|
||||
if (testmode == FW_RFTEST_MODE) {
|
||||
cfg_base = RAM_LMAC_FW_ADDR + 0x0164;
|
||||
}
|
||||
if ((ret = rwnx_send_dbg_mem_read_req(sdiodev, cfg_base + 0x14, &cfm))) {
|
||||
AICWFDBG(LOGERROR, "rf misc ram[0x%x] rd fail: %d\n", cfg_base + 0x14, ret);
|
||||
return ret;
|
||||
}
|
||||
misc_ram_addr = cfm.memdata;
|
||||
AICWFDBG(LOGINFO, "misc_ram_addr: %x\n", misc_ram_addr);
|
||||
/* Copy loft_res on the Embedded side */
|
||||
// bit_mask
|
||||
AICWFDBG(LOGINFO, "bit_mask[0]=%x\n", loft_res->bit_mask[0]);
|
||||
ram_base_addr = misc_ram_addr + offsetof(rf_misc_ram_t, bit_mask);
|
||||
ram_byte_cnt = MEMBER_SIZE(rf_misc_ram_t, bit_mask) + MEMBER_SIZE(rf_misc_ram_t, reserved);
|
||||
ret = rwnx_send_dbg_mem_block_write_req(sdiodev, ram_base_addr, ram_byte_cnt, (u32 *)&loft_res->bit_mask[0]);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGERROR, "bit_mask wr fail: %x, ret:%d\r\n", ram_base_addr, ret);
|
||||
return ret;
|
||||
}
|
||||
// loft_res
|
||||
AICWFDBG(LOGINFO, "loft_res[0]=%x\n", loft_res->loft_res[0]);
|
||||
ram_base_addr = misc_ram_addr + offsetof(rf_misc_ram_t, loft_res);
|
||||
ram_byte_cnt = MEMBER_SIZE(rf_misc_ram_t, loft_res);
|
||||
ret = rwnx_send_dbg_mem_block_write_req(sdiodev, ram_base_addr, ram_byte_cnt, (u32 *)&loft_res->loft_res[0]);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGERROR, "loft_res wr fail: %x, ret:%d\r\n", ram_base_addr, ret);
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
4
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic8800dc_compat.h
Normal file → Executable file
4
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic8800dc_compat.h
Normal file → Executable file
@@ -30,6 +30,10 @@ int aicwf_dpd_result_load_8800dc(struct aic_sdio_dev *sdiodev, rf_misc_ram_lite_
|
||||
int aicwf_dpd_result_write_8800dc(void *buf, int buf_len);
|
||||
#endif/* !CONFIG_FORCE_DPD_CALIB */
|
||||
#endif
|
||||
#ifdef CONFIG_LOFT_CALIB
|
||||
int aicwf_loft_calib_8800dc(struct aic_sdio_dev *sdiodev, rf_misc_ram_lite_t *loft_res);
|
||||
int aicwf_loft_result_apply_8800dc(struct aic_sdio_dev *sdiodev, rf_misc_ram_lite_t *loft_res);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
214
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic_bsp_driver.c
Normal file → Executable file
214
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic_bsp_driver.c
Normal file → Executable file
@@ -27,6 +27,7 @@
|
||||
#include "md5.h"
|
||||
#include "aic8800dc_compat.h"
|
||||
#include "aic8800d80_compat.h"
|
||||
#include "aic8800d80x2_compat.h"
|
||||
#include "aicwf_firmware_array.h"
|
||||
#define FW_PATH_MAX 200
|
||||
|
||||
@@ -242,9 +243,12 @@ void rwnx_cmd_mgr_init(struct rwnx_cmd_mgr *cmd_mgr)
|
||||
|
||||
void rwnx_cmd_mgr_deinit(struct rwnx_cmd_mgr *cmd_mgr)
|
||||
{
|
||||
cmd_mgr->print(cmd_mgr);
|
||||
cmd_mgr->drain(cmd_mgr);
|
||||
cmd_mgr->print(cmd_mgr);
|
||||
if(cmd_mgr->print)
|
||||
cmd_mgr->print(cmd_mgr);
|
||||
if(cmd_mgr->drain)
|
||||
cmd_mgr->drain(cmd_mgr);
|
||||
if(cmd_mgr->print)
|
||||
cmd_mgr->print(cmd_mgr);
|
||||
memset(cmd_mgr, 0, sizeof(*cmd_mgr));
|
||||
}
|
||||
|
||||
@@ -262,7 +266,7 @@ void rwnx_set_cmd_tx(void *dev, struct lmac_msg *msg, uint len)
|
||||
if (sdiodev->chipid == PRODUCT_ID_AIC8801 || sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DW)
|
||||
buffer[3] = 0x0;
|
||||
else if (sdiodev->chipid == PRODUCT_ID_AIC8800D80)
|
||||
else if (sdiodev->chipid == PRODUCT_ID_AIC8800D80 || sdiodev->chipid == PRODUCT_ID_AIC8800D80X2)
|
||||
buffer[3] = crc8_ponl_107(&buffer[0], 3); // crc8
|
||||
index += 4;
|
||||
//there is a dummy word
|
||||
@@ -984,7 +988,7 @@ int aicwf_plat_rftest_load_8800dc(struct aic_sdio_dev *sdiodev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DPD
|
||||
#if defined(CONFIG_DPD) || defined(CONFIG_LOFT_CALIB)
|
||||
int aicwf_misc_ram_valid_check_8800dc(struct aic_sdio_dev *sdiodev, int *valid_out)
|
||||
{
|
||||
int ret = 0;
|
||||
@@ -998,7 +1002,7 @@ int aicwf_misc_ram_valid_check_8800dc(struct aic_sdio_dev *sdiodev, int *valid_o
|
||||
*valid_out = 0;
|
||||
}
|
||||
if (testmode == FW_RFTEST_MODE) {
|
||||
|
||||
|
||||
uint32_t vect1 = 0;
|
||||
uint32_t vect2 = 0;
|
||||
cfg_base = RAM_LMAC_FW_ADDR + 0x0004;
|
||||
@@ -1061,19 +1065,21 @@ int aicwf_plat_calib_load_8800dc(struct aic_sdio_dev *sdiodev)
|
||||
if (chip_sub_id == 1) {
|
||||
ret = rwnx_plat_bin_fw_upload_android(sdiodev, ROM_FMAC_CALIB_ADDR, RWNX_MAC_CALIB_NAME_8800DC_U02);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "load rftest bin fail: %d\n", ret);
|
||||
AICWFDBG(LOGINFO, "load calib bin fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
} else if (chip_sub_id == 2) {
|
||||
ret = rwnx_plat_bin_fw_upload_android(sdiodev, ROM_FMAC_CALIB_ADDR, RWNX_MAC_CALIB_NAME_8800DC_H_U02);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "load rftest bin fail: %d\n", ret);
|
||||
AICWFDBG(LOGINFO, "load calib bin fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DPD
|
||||
#ifndef CONFIG_FORCE_DPD_CALIB
|
||||
int is_file_exist(char* name)
|
||||
{
|
||||
@@ -1111,6 +1117,11 @@ rf_misc_ram_lite_t dpd_res = {{0},};
|
||||
EXPORT_SYMBOL(dpd_res);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LOFT_CALIB
|
||||
rf_misc_ram_lite_t loft_res_local = {{0},};
|
||||
EXPORT_SYMBOL(loft_res_local);
|
||||
#endif
|
||||
|
||||
static int rwnx_plat_patch_load(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
int ret = 0;
|
||||
@@ -1168,6 +1179,15 @@ static int rwnx_plat_patch_load(struct aic_sdio_dev *sdiodev)
|
||||
}
|
||||
#endif
|
||||
else
|
||||
#elif defined(CONFIG_LOFT_CALIB)
|
||||
if (1) {
|
||||
AICWFDBG(LOGINFO, "loft calib\n");
|
||||
ret = aicwf_loft_calib_8800dc(sdiodev, &loft_res_local);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "loft calib fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
ret = aicwf_misc_ram_init_8800dc(sdiodev);
|
||||
@@ -1193,8 +1213,23 @@ static int rwnx_plat_patch_load(struct aic_sdio_dev *sdiodev)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif/*CONFIG_FORCE_DPD_CALIB*/
|
||||
#elif defined(CONFIG_LOFT_CALIB)
|
||||
{
|
||||
AICWFDBG(LOGINFO, "patch load\n");
|
||||
ret = aicwf_plat_patch_load_8800dc(sdiodev);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "load patch bin fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
AICWFDBG(LOGINFO, "loft calib\n");
|
||||
ret = aicwf_loft_calib_8800dc(sdiodev, &loft_res_local);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "loft calib fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
#endif/*CONFIG_DPD*/
|
||||
ret = aicwf_plat_rftest_load_8800dc(sdiodev);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "load rftest bin fail: %d\n", ret);
|
||||
@@ -1360,14 +1395,89 @@ err:
|
||||
}
|
||||
int aicbt_patch_info_unpack(struct aicbt_patch_info_t *patch_info, struct aicbt_patch_table *head_t)
|
||||
{
|
||||
uint8_t *patch_info_array = (uint8_t*)patch_info;
|
||||
int base_len = 0;
|
||||
int memcpy_len = 0;
|
||||
|
||||
if (AICBT_PT_INF == head_t->type) {
|
||||
patch_info->info_len = head_t->len;
|
||||
if(patch_info->info_len == 0)
|
||||
base_len = ((offsetof(struct aicbt_patch_info_t, ext_patch_nb_addr) - offsetof(struct aicbt_patch_info_t, adid_addrinf) )/sizeof(uint32_t))/2;
|
||||
AICWFDBG(LOGDEBUG, "%s head_t->len:%d base_len:%d \r\n", __func__, head_t->len, base_len);
|
||||
|
||||
if (head_t->len > base_len){
|
||||
patch_info->info_len = base_len;
|
||||
memcpy_len = patch_info->info_len + 1;//include ext patch nb
|
||||
} else{
|
||||
patch_info->info_len = head_t->len;
|
||||
memcpy_len = patch_info->info_len;
|
||||
}
|
||||
head_t->len = patch_info->info_len;
|
||||
AICWFDBG(LOGDEBUG, "%s memcpy_len:%d \r\n", __func__, memcpy_len);
|
||||
|
||||
if (patch_info->info_len == 0)
|
||||
return 0;
|
||||
memcpy(&patch_info->adid_addrinf, head_t->data, patch_info->info_len * sizeof(uint32_t) * 2);
|
||||
|
||||
memcpy(((patch_info_array) + sizeof(patch_info->info_len)),
|
||||
head_t->data,
|
||||
memcpy_len * sizeof(uint32_t) * 2);
|
||||
AICWFDBG(LOGDEBUG, "%s adid_addrinf:%x addr_adid:%x \r\n", __func__,
|
||||
((struct aicbt_patch_info_t *)patch_info_array)->adid_addrinf,
|
||||
((struct aicbt_patch_info_t *)patch_info_array)->addr_adid);
|
||||
|
||||
if (patch_info->ext_patch_nb > 0){
|
||||
int index = 0;
|
||||
patch_info->ext_patch_param = (uint32_t *)(head_t->data + ((memcpy_len) * 2));
|
||||
|
||||
for(index = 0; index < patch_info->ext_patch_nb; index++){
|
||||
AICWFDBG(LOGDEBUG, "%s id:%x addr:%x \r\n", __func__,
|
||||
*(patch_info->ext_patch_param + (index * 2)),
|
||||
*(patch_info->ext_patch_param + (index * 2) + 1));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aicbt_ext_patch_data_load(struct aic_sdio_dev *sdiodev, struct aicbt_patch_info_t *patch_info)
|
||||
{
|
||||
int ret = 0;
|
||||
uint32_t ext_patch_nb = patch_info->ext_patch_nb;
|
||||
char ext_patch_file_name[50];
|
||||
int index = 0;
|
||||
uint32_t id = 0;
|
||||
uint32_t addr = 0;
|
||||
|
||||
|
||||
if (ext_patch_nb > 0){
|
||||
if (sdiodev->chipid == PRODUCT_ID_AIC8800DC) {
|
||||
AICWFDBG(LOGDEBUG, "[0x40506004]: 0x04318000\n");
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, 0x40506004, 0x04318000);
|
||||
AICWFDBG(LOGDEBUG, "[0x40506004]: 0x04338000\n");
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, 0x40506004, 0x04338000);
|
||||
} else if (sdiodev->chipid == PRODUCT_ID_AIC8800D80X2) {
|
||||
AICWFDBG(LOGDEBUG, "[0x40580000]: 0x00040220\n");
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, 0x40580000, 0x00040220);
|
||||
}
|
||||
for (index = 0; index < patch_info->ext_patch_nb; index++){
|
||||
id = *(patch_info->ext_patch_param + (index * 2));
|
||||
addr = *(patch_info->ext_patch_param + (index * 2) + 1);
|
||||
memset(ext_patch_file_name, 0, sizeof(ext_patch_file_name));
|
||||
sprintf(ext_patch_file_name,"%s%d.bin",
|
||||
aicbsp_firmware_list[aicbsp_info.cpmode].bt_ext_patch,
|
||||
id);
|
||||
AICWFDBG(LOGDEBUG, "%s ext_patch_file_name:%s ext_patch_id:%x ext_patch_addr:%x \r\n",
|
||||
__func__,ext_patch_file_name, id, addr);
|
||||
|
||||
if (rwnx_plat_bin_fw_upload_android(sdiodev, addr, ext_patch_file_name)) {
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int aicbt_patch_trap_data_load(struct aic_sdio_dev *sdiodev, struct aicbt_patch_table *head)
|
||||
{
|
||||
struct aicbt_patch_info_t patch_info = {
|
||||
@@ -1380,6 +1490,8 @@ int aicbt_patch_trap_data_load(struct aic_sdio_dev *sdiodev, struct aicbt_patch_
|
||||
.reset_val = 0,
|
||||
.adid_flag_addr = 0,
|
||||
.adid_flag = 0,
|
||||
.ext_patch_nb_addr = 0,
|
||||
.ext_patch_nb = 0,
|
||||
};
|
||||
if(head == NULL){
|
||||
return -1;
|
||||
@@ -1420,12 +1532,20 @@ int aicbt_patch_trap_data_load(struct aic_sdio_dev *sdiodev, struct aicbt_patch_
|
||||
printk("%s, aicbt_patch_info_unpack fail\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
} else if(sdiodev->chipid == PRODUCT_ID_AIC8800D80X2){
|
||||
aicbt_patch_info_unpack(&patch_info, head);
|
||||
if(patch_info.info_len == 0) {
|
||||
printk("%s, aicbt_patch_info_unpack fail\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (rwnx_plat_bin_fw_upload_android(sdiodev, patch_info.addr_adid, aicbsp_firmware_list[aicbsp_info.cpmode].bt_adid))
|
||||
return -1;
|
||||
if (rwnx_plat_bin_fw_upload_android(sdiodev, patch_info.addr_patch, aicbsp_firmware_list[aicbsp_info.cpmode].bt_patch))
|
||||
return -1;
|
||||
if (aicbt_ext_patch_data_load(sdiodev, &patch_info))
|
||||
return -1;
|
||||
return 0;
|
||||
|
||||
}
|
||||
@@ -1462,7 +1582,16 @@ static struct aicbt_info_t aicbt_info[]={
|
||||
.uart_flowctrl = AICBT_UART_FC_DEFAULT,
|
||||
.lpm_enable = AICBT_LPM_ENABLE_DEFAULT,
|
||||
.txpwr_lvl = AICBT_TXPWR_LVL_DEFAULT_8800d80,
|
||||
}//PRODUCT_ID_AIC8800D80
|
||||
},//PRODUCT_ID_AIC8800D80
|
||||
{
|
||||
.btmode = AICBT_BTMODE_DEFAULT_8800d80x2,
|
||||
.btport = AICBT_BTPORT_DEFAULT,
|
||||
.uart_baud = AICBT_UART_BAUD_DEFAULT,
|
||||
.uart_flowctrl = AICBT_UART_FC_DEFAULT,
|
||||
.lpm_enable = AICBT_LPM_ENABLE_DEFAULT,
|
||||
.txpwr_lvl = AICBT_TXPWR_LVL_DEFAULT_8800d80x2,
|
||||
}//PRODUCT_ID_AIC8800D80x2
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1738,6 +1867,12 @@ int aicwifi_init(struct aic_sdio_dev *sdiodev)
|
||||
printk("download wifi fw fail\n");
|
||||
return -1;
|
||||
}
|
||||
if (testmode == FW_NORMAL_MODE) {
|
||||
if (rwnx_plat_bin_fw_upload_android(sdiodev, RAM_FMAC_FW_PATCH_ADDR, RAM_FMAC_FW_PATCH_NAME)) {
|
||||
printk("download wifi fw patch fail\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (aicwifi_patch_config(sdiodev)) {
|
||||
printk("aicwifi_patch_config fail\n");
|
||||
@@ -1792,9 +1927,24 @@ int aicwifi_init(struct aic_sdio_dev *sdiodev)
|
||||
printk("8800d80 wifi start fail\n");
|
||||
return -1;
|
||||
}
|
||||
}else if(sdiodev->chipid == PRODUCT_ID_AIC8800D80X2){
|
||||
if (rwnx_plat_bin_fw_upload_android(sdiodev, RAM_FMAC_FW_ADDR, aicbsp_firmware_list[aicbsp_info.cpmode].wl_fw)) {
|
||||
printk("8800d80x2 download wifi fw fail\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (aicwifi_patch_config_8800d80x2(sdiodev)) {
|
||||
printk("aicwifi_patch_config_8800d80x2 fail\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (aicwifi_start_from_bootrom(sdiodev)) {
|
||||
printk("8800d80x2 wifi start fail\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
#if (defined(CONFIG_GPIO_WAKEUP) || defined(CONFIG_SDIO_PWRCTRL))
|
||||
if (aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.wakeup_reg, 4)) {
|
||||
sdio_err("reg:%d write failed!\n", sdiodev->sdio_reg.wakeup_reg);
|
||||
return -1;
|
||||
@@ -1920,16 +2070,34 @@ int aicbsp_driver_fw_init(struct aic_sdio_dev *sdiodev)
|
||||
if (rwnx_send_dbg_mem_read_req(sdiodev, mem_addr, &rd_mem_addr_cfm))
|
||||
return -1;
|
||||
|
||||
aicbsp_info.chip_rev = (u8)(rd_mem_addr_cfm.memdata >> 16);
|
||||
aicbsp_info.chip_rev = (u8)((rd_mem_addr_cfm.memdata >> 16) & 0x3F);
|
||||
is_chip_id_h = (u8)(((rd_mem_addr_cfm.memdata >> 16) & 0xC0) == 0xC0);
|
||||
btenable = 1;
|
||||
|
||||
if (aicbsp_info.chip_rev == CHIP_REV_U01)
|
||||
aicbsp_firmware_list = fw_8800d80_u01;
|
||||
if (aicbsp_info.chip_rev == CHIP_REV_U02 || aicbsp_info.chip_rev == CHIP_REV_U03)
|
||||
aicbsp_firmware_list = fw_8800d80_u02;
|
||||
if (is_chip_id_h) {
|
||||
AICWFDBG(LOGINFO, "IS_CHIP_ID_H \n");
|
||||
aicbsp_firmware_list = fw_8800d80_h_u02;
|
||||
} else {
|
||||
if (aicbsp_info.chip_rev == CHIP_REV_U01)
|
||||
aicbsp_firmware_list = fw_8800d80_u01;
|
||||
if (aicbsp_info.chip_rev == CHIP_REV_U02 || aicbsp_info.chip_rev == CHIP_REV_U03)
|
||||
aicbsp_firmware_list = fw_8800d80_u02;
|
||||
}
|
||||
if (aicbsp_system_config_8800d80(sdiodev))
|
||||
return -1;
|
||||
}
|
||||
else if(sdiodev->chipid == PRODUCT_ID_AIC8800D80X2){
|
||||
btenable = 1;
|
||||
if (rwnx_send_dbg_mem_read_req(sdiodev, mem_addr, &rd_mem_addr_cfm))
|
||||
return -1;
|
||||
|
||||
aicbsp_info.chip_rev = (u8)((rd_mem_addr_cfm.memdata >> 16) & 0x3F);
|
||||
if (aicbsp_info.chip_rev >= (CHIP_REV_U04 + 8))
|
||||
aicbsp_firmware_list = fw_8800d80x2;
|
||||
else{
|
||||
pr_err("aicbsp: %s, unsupport chip rev: %d\n", __func__, aicbsp_info.chip_rev);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
AICWFDBG(LOGINFO, "aicbsp: %s, chip rev: %d\n", __func__, aicbsp_info.chip_rev);
|
||||
|
||||
@@ -1955,7 +2123,7 @@ int aicbsp_get_feature(struct aicbsp_feature_t *feature, char *fw_path)
|
||||
aicbsp_sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
aicbsp_sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
feature->sdio_clock = FEATURE_SDIO_CLOCK;
|
||||
}else if (aicbsp_sdiodev->chipid == PRODUCT_ID_AIC8800D80){
|
||||
}else if (aicbsp_sdiodev->chipid == PRODUCT_ID_AIC8800D80 || aicbsp_sdiodev->chipid == PRODUCT_ID_AIC8800D80X2){
|
||||
feature->sdio_clock = FEATURE_SDIO_CLOCK_V3;
|
||||
}
|
||||
feature->sdio_phase = FEATURE_SDIO_PHASE;
|
||||
@@ -1965,9 +2133,11 @@ int aicbsp_get_feature(struct aicbsp_feature_t *feature, char *fw_path)
|
||||
if(fw_path != NULL){
|
||||
sprintf(fw_path,"%s", AICBSP_FW_PATH);
|
||||
}
|
||||
|
||||
sdio_dbg("%s, set FEATURE_SDIO_CLOCK %d MHz\n", __func__, feature->sdio_clock/1000000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL_GPL(aicbsp_get_feature);
|
||||
|
||||
#ifdef CONFIG_RESV_MEM_SUPPORT
|
||||
|
||||
67
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic_bsp_driver.h
Normal file → Executable file
67
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic_bsp_driver.h
Normal file → Executable file
@@ -16,7 +16,7 @@
|
||||
#include <linux/module.h>
|
||||
#include "aic_bsp_export.h"
|
||||
|
||||
#define RWNX_80211_CMD_TIMEOUT_MS 3000//500//300
|
||||
#define RWNX_80211_CMD_TIMEOUT_MS 6000//500//300
|
||||
|
||||
#define RWNX_CMD_FLAG_NONBLOCK BIT(0)
|
||||
#define RWNX_CMD_FLAG_REQ_CFM BIT(1)
|
||||
@@ -310,7 +310,7 @@ struct dbg_start_app_cfm {
|
||||
|
||||
int aicwf_plat_patch_load_8800dc(struct aic_sdio_dev *sdiodev);
|
||||
int aicwf_plat_rftest_load_8800dc(struct aic_sdio_dev *sdiodev);
|
||||
#ifdef CONFIG_DPD
|
||||
#if defined(CONFIG_DPD) || defined(CONFIG_LOFT_CALIB)
|
||||
int aicwf_misc_ram_valid_check_8800dc(struct aic_sdio_dev *sdiodev, int *valid_out);
|
||||
int aicwf_plat_calib_load_8800dc(struct aic_sdio_dev *sdiodev);
|
||||
#endif
|
||||
@@ -338,12 +338,12 @@ int is_file_exist(char* name);
|
||||
#endif
|
||||
int aicbsp_resv_mem_init(void);
|
||||
int aicbsp_resv_mem_deinit(void);
|
||||
extern char* aic_default_fw_path;
|
||||
|
||||
#define AICBSP_FW_PATH aic_default_fw_path
|
||||
#define AICBSP_FW_PATH CONFIG_AIC_FW_PATH
|
||||
#define AICBSP_FW_PATH_MAX 200
|
||||
|
||||
#define RAM_FMAC_FW_ADDR 0x00120000
|
||||
#define RAM_FMAC_FW_PATCH_ADDR 0x00190000
|
||||
#define FW_RAM_ADID_BASE_ADDR 0x00161928
|
||||
#define FW_RAM_ADID_BASE_ADDR_U03 0x00161928
|
||||
#define FW_RAM_PATCH_BASE_ADDR 0x00100000
|
||||
@@ -370,12 +370,19 @@ extern char* aic_default_fw_path;
|
||||
#define ROM_FMAC_FW_ADDR 0x00010000
|
||||
#define ROM_FMAC_PATCH_ADDR 0x00180000
|
||||
|
||||
#define RWNX_MAC_CALIB_BASE_NAME_8800DC "fmacfw_calib_8800dc"
|
||||
#define RAM_FMAC_FW_PATCH_NAME "fmacfw_patch.bin"
|
||||
#define RWNX_MAC_CALIB_BASE_NAME_8800DC "fmacfw_calib_8800dc"
|
||||
#define RWNX_MAC_CALIB_NAME_8800DC_U02 RWNX_MAC_CALIB_BASE_NAME_8800DC"_u02.bin"
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
#define RWNX_MAC_CALIB_NAME_8800DC_H_U02 RWNX_MAC_CALIB_BASE_NAME_8800DC"_hbt_u02.bin"
|
||||
#else
|
||||
#define RWNX_MAC_CALIB_NAME_8800DC_H_U02 RWNX_MAC_CALIB_BASE_NAME_8800DC"_h_u02.bin"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DPD
|
||||
#if defined(CONFIG_DPD) || defined(CONFIG_LOFT_CALIB)
|
||||
#define ROM_FMAC_CALIB_ADDR 0x00130000
|
||||
#endif
|
||||
#ifdef CONFIG_DPD
|
||||
#ifndef CONFIG_FORCE_DPD_CALIB
|
||||
#define FW_DPDRESULT_NAME_8800DC "aic_dpdresult_lite_8800dc.bin"
|
||||
#endif
|
||||
@@ -390,13 +397,21 @@ extern char* aic_default_fw_path;
|
||||
#define RWNX_MAC_PATCH_BASE_NAME_8800DC "fmacfw_patch_8800dc"
|
||||
#define RWNX_MAC_PATCH_NAME2_8800DC RWNX_MAC_PATCH_BASE_NAME_8800DC".bin"
|
||||
#define RWNX_MAC_PATCH_NAME2_8800DC_U02 RWNX_MAC_PATCH_BASE_NAME_8800DC"_u02.bin"
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
#define RWNX_MAC_PATCH_NAME2_8800DC_H_U02 RWNX_MAC_PATCH_BASE_NAME_8800DC"_hbt_u02.bin"
|
||||
#else
|
||||
#define RWNX_MAC_PATCH_NAME2_8800DC_H_U02 RWNX_MAC_PATCH_BASE_NAME_8800DC"_h_u02.bin"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define RWNX_MAC_PATCH_TABLE_NAME_8800DC "fmacfw_patch_tbl_8800dc"
|
||||
#define RWNX_MAC_PATCH_TABLE_8800DC RWNX_MAC_PATCH_TABLE_NAME_8800DC ".bin"
|
||||
#define RWNX_MAC_PATCH_TABLE_8800DC_U02 RWNX_MAC_PATCH_TABLE_NAME_8800DC "_u02.bin"
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
#define RWNX_MAC_PATCH_TABLE_8800DC_H_U02 RWNX_MAC_PATCH_TABLE_NAME_8800DC "_hbt_u02.bin"
|
||||
#else
|
||||
#define RWNX_MAC_PATCH_TABLE_8800DC_H_U02 RWNX_MAC_PATCH_TABLE_NAME_8800DC "_h_u02.bin"
|
||||
#endif
|
||||
|
||||
#define RWNX_MAC_RF_PATCH_BASE_NAME_8800DC "fmacfw_rf_patch_8800dc"
|
||||
#define RWNX_MAC_RF_PATCH_NAME_8800DC RWNX_MAC_RF_PATCH_BASE_NAME_8800DC".bin"
|
||||
@@ -486,27 +501,32 @@ enum chip_rev {
|
||||
#define AICBT_TXPWR_LVL 0x00006020
|
||||
#define AICBT_TXPWR_LVL_8800dc 0x00006f2f
|
||||
#define AICBT_TXPWR_LVL_8800d80 0x00006f2f
|
||||
#define AICBT_TXPWR_LVL_8800d80x2 0x00006f2f
|
||||
|
||||
|
||||
#define AICBSP_HWINFO_DEFAULT (-1)
|
||||
#define AICBSP_CPMODE_DEFAULT AICBSP_CPMODE_WORK
|
||||
#define AICBSP_FWLOG_EN_DEFAULT 0
|
||||
|
||||
#define AICBT_BTMODE_DEFAULT_8800d80x2 AICBT_BTMODE_BT_ONLY_COANT
|
||||
#define AICBT_BTMODE_DEFAULT_8800d80 AICBT_BTMODE_BT_ONLY_COANT
|
||||
#define AICBT_BTMODE_DEFAULT AICBT_BTMODE_BT_ONLY_SW
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
#define AICBT_BTPORT_DEFAULT AICBT_BTPORT_MB
|
||||
#else
|
||||
#define AICBT_BTPORT_DEFAULT AICBT_BTPORT_UART
|
||||
#endif
|
||||
#define AICBT_UART_BAUD_DEFAULT AICBT_UART_BAUD_1_5M
|
||||
#define AICBT_UART_FC_DEFAULT AICBT_UART_FLOWCTRL_ENABLE
|
||||
#define AICBT_LPM_ENABLE_DEFAULT 0
|
||||
#define AICBT_TXPWR_LVL_DEFAULT AICBT_TXPWR_LVL
|
||||
#define AICBT_TXPWR_LVL_DEFAULT_8800dc AICBT_TXPWR_LVL_8800dc
|
||||
#define AICBT_TXPWR_LVL_DEFAULT_8800d80 AICBT_TXPWR_LVL_8800d80
|
||||
#define AICBT_TXPWR_LVL_DEFAULT_8800d80x2 AICBT_TXPWR_LVL_8800d80x2
|
||||
|
||||
|
||||
//#define FEATURE_SDIO_CLOCK 50000000 // 0: default, other: target clock rate
|
||||
//#define FEATURE_SDIO_CLOCK_V3 150000000 // 0: default, other: target clock rate
|
||||
// some noise on sdio line
|
||||
#define FEATURE_SDIO_CLOCK 25000000 // 0: default, other: target clock rate
|
||||
#define FEATURE_SDIO_CLOCK_V3 25000000 // 0: default, other: target clock rate
|
||||
#define FEATURE_SDIO_CLOCK_V3 150000000 // 0: default, other: target clock rate
|
||||
#define FEATURE_SDIO_PHASE 2 // 0: default, 2: 180°
|
||||
|
||||
struct aicbt_patch_table {
|
||||
@@ -527,15 +547,21 @@ struct aicbt_info_t {
|
||||
};
|
||||
|
||||
struct aicbt_patch_info_t {
|
||||
uint32_t info_len;
|
||||
uint32_t adid_addrinf;
|
||||
uint32_t addr_adid;
|
||||
uint32_t patch_addrinf;
|
||||
uint32_t addr_patch;
|
||||
uint32_t reset_addr;
|
||||
uint32_t reset_val;
|
||||
uint32_t adid_flag_addr;
|
||||
uint32_t adid_flag;
|
||||
uint32_t info_len;
|
||||
//base len start
|
||||
uint32_t adid_addrinf;
|
||||
uint32_t addr_adid;
|
||||
uint32_t patch_addrinf;
|
||||
uint32_t addr_patch;
|
||||
uint32_t reset_addr;
|
||||
uint32_t reset_val;
|
||||
uint32_t adid_flag_addr;
|
||||
uint32_t adid_flag;
|
||||
//base len end
|
||||
//ext patch nb
|
||||
uint32_t ext_patch_nb_addr;
|
||||
uint32_t ext_patch_nb;
|
||||
uint32_t *ext_patch_param;
|
||||
};
|
||||
|
||||
struct aicbsp_firmware {
|
||||
@@ -544,6 +570,7 @@ struct aicbsp_firmware {
|
||||
const char *bt_patch;
|
||||
const char *bt_table;
|
||||
const char *wl_fw;
|
||||
const char *bt_ext_patch;
|
||||
};
|
||||
|
||||
struct aicbsp_info_t {
|
||||
@@ -565,5 +592,7 @@ extern const struct aicbsp_firmware fw_8800dc_u02[];
|
||||
extern const struct aicbsp_firmware fw_8800dc_h_u02[];
|
||||
extern const struct aicbsp_firmware fw_8800d80_u01[];
|
||||
extern const struct aicbsp_firmware fw_8800d80_u02[];
|
||||
extern const struct aicbsp_firmware fw_8800d80_h_u02[];
|
||||
extern const struct aicbsp_firmware fw_8800d80x2[];
|
||||
|
||||
#endif
|
||||
|
||||
8
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic_bsp_export.h
Normal file → Executable file
8
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic_bsp_export.h
Normal file → Executable file
@@ -31,7 +31,7 @@ struct aicbsp_feature_t {
|
||||
uint8_t irqf;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DPD
|
||||
#if defined(CONFIG_DPD) || defined(CONFIG_LOFT_CALIB)
|
||||
typedef struct {
|
||||
uint32_t bit_mask[3];
|
||||
uint32_t reserved;
|
||||
@@ -53,10 +53,16 @@ typedef struct {
|
||||
|
||||
#define MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
|
||||
#define DPD_RESULT_SIZE_8800DC sizeof(rf_misc_ram_lite_t)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DPD
|
||||
extern rf_misc_ram_lite_t dpd_res;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LOFT_CALIB
|
||||
extern rf_misc_ram_lite_t loft_res_local;
|
||||
#endif
|
||||
|
||||
int aicbsp_set_subsys(int, int);
|
||||
int aicbsp_get_feature(struct aicbsp_feature_t *feature, char *fw_path);
|
||||
struct sk_buff *aicbsp_resv_mem_alloc_skb(unsigned int length, uint32_t id);
|
||||
|
||||
84
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic_bsp_main.c
Normal file → Executable file
84
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aic_bsp_main.c
Normal file → Executable file
@@ -15,8 +15,9 @@
|
||||
#define DRV_AUTHOR "AICSemi"
|
||||
#define DRV_VERS_MOD "1.0"
|
||||
|
||||
//int aicwf_dbg_level_bsp = LOGERROR|LOGINFO|LOGDEBUG|LOGTRACE;
|
||||
int aicwf_dbg_level_bsp = LOGERROR;
|
||||
int aicwf_dbg_level_bsp = LOGERROR|LOGINFO|LOGDEBUG|LOGTRACE;
|
||||
|
||||
struct semaphore aicbsp_probe_semaphore;
|
||||
|
||||
static struct platform_device *aicbsp_pdev;
|
||||
|
||||
@@ -28,7 +29,11 @@ const struct aicbsp_firmware fw_u02[] = {
|
||||
.bt_adid = "fw_adid.bin",
|
||||
.bt_patch = "fw_patch.bin",
|
||||
.bt_table = "fw_patch_table.bin",
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
.wl_fw = "fmacfwbt.bin"
|
||||
#else
|
||||
.wl_fw = "fmacfw.bin"
|
||||
#endif
|
||||
},
|
||||
[AICBSP_CPMODE_TEST] = {
|
||||
.desc = "rf test mode(sdio u02)",
|
||||
@@ -47,6 +52,8 @@ const struct aicbsp_firmware fw_u03[] = {
|
||||
.bt_table = "fw_patch_table_u03.bin",
|
||||
#ifdef CONFIG_MCU_MESSAGE
|
||||
.wl_fw = "fmacfw_8800m_custmsg.bin"
|
||||
#elif defined(CONFIG_SDIO_BT)
|
||||
.wl_fw = "fmacfwbt.bin"
|
||||
#else
|
||||
.wl_fw = "fmacfw.bin"
|
||||
#endif
|
||||
@@ -86,6 +93,7 @@ const struct aicbsp_firmware fw_8800dc_u02[] = {
|
||||
.bt_adid = "fw_adid_8800dc_u02.bin",
|
||||
.bt_patch = "fw_patch_8800dc_u02.bin",
|
||||
.bt_table = "fw_patch_table_8800dc_u02.bin",
|
||||
.bt_ext_patch = "fw_patch_8800dc_u02_ext",
|
||||
.wl_fw = "fmacfw_patch_8800dc_u02.bin"
|
||||
},
|
||||
|
||||
@@ -94,6 +102,7 @@ const struct aicbsp_firmware fw_8800dc_u02[] = {
|
||||
.bt_adid = "fw_adid_8800dc_u02.bin",
|
||||
.bt_patch = "fw_patch_8800dc_u02.bin",
|
||||
.bt_table = "fw_patch_table_8800dc_u02.bin",
|
||||
.bt_ext_patch = "fw_patch_8800dc_u02_ext",
|
||||
.wl_fw = "lmacfw_rf_8800dc.bin" //u01,u02 lmacfw load same bin
|
||||
},
|
||||
};
|
||||
@@ -104,6 +113,7 @@ const struct aicbsp_firmware fw_8800dc_h_u02[] = {
|
||||
.bt_adid = "fw_adid_8800dc_u02h.bin",
|
||||
.bt_patch = "fw_patch_8800dc_u02h.bin",
|
||||
.bt_table = "fw_patch_table_8800dc_u02h.bin",
|
||||
.bt_ext_patch = "fw_patch_8800dc_u02h_ext",
|
||||
.wl_fw = "fmacfw_patch_8800dc_h_u02.bin"
|
||||
},
|
||||
|
||||
@@ -112,6 +122,7 @@ const struct aicbsp_firmware fw_8800dc_h_u02[] = {
|
||||
.bt_adid = "fw_adid_8800dc_u02h.bin",
|
||||
.bt_patch = "fw_patch_8800dc_u02h.bin",
|
||||
.bt_table = "fw_patch_table_8800dc_u02h.bin",
|
||||
.bt_ext_patch = "fw_patch_8800dc_u02h_ext",
|
||||
.wl_fw = "lmacfw_rf_8800dc.bin" //u01,u02 lmacfw load same bin
|
||||
},
|
||||
};
|
||||
@@ -141,7 +152,14 @@ const struct aicbsp_firmware fw_8800d80_u02[] = {
|
||||
.bt_adid = "fw_adid_8800d80_u02.bin",
|
||||
.bt_patch = "fw_patch_8800d80_u02.bin",
|
||||
.bt_table = "fw_patch_table_8800d80_u02.bin",
|
||||
.wl_fw = "fmacfw_8800d80_u02.bin"
|
||||
#if defined CONFIG_SDIO_BT
|
||||
.wl_fw = "fmacfwbt_8800d80_u02.bin",
|
||||
#elif defined CONFIG_FOR_IPCAM
|
||||
.wl_fw = "fmacfw_8800d80_u02_ipc.bin",
|
||||
#else
|
||||
.wl_fw = "fmacfw_8800d80_u02.bin",
|
||||
#endif
|
||||
.bt_ext_patch = "fw_patch_8800d80_u02_ext"
|
||||
},
|
||||
|
||||
[AICBSP_CPMODE_TEST] = {
|
||||
@@ -149,7 +167,58 @@ const struct aicbsp_firmware fw_8800d80_u02[] = {
|
||||
.bt_adid = "fw_adid_8800d80_u02.bin",
|
||||
.bt_patch = "fw_patch_8800d80_u02.bin",
|
||||
.bt_table = "fw_patch_table_8800d80_u02.bin",
|
||||
.wl_fw = "lmacfw_rf_8800d80_u02.bin"
|
||||
.wl_fw = "lmacfw_rf_8800d80_u02.bin",
|
||||
.bt_ext_patch = "fw_patch_8800d80_u02_ext"
|
||||
},
|
||||
};
|
||||
|
||||
const struct aicbsp_firmware fw_8800d80_h_u02[] = {
|
||||
[AICBSP_CPMODE_WORK] = {
|
||||
.desc = "normal work mode(8800d80 sdio h_u02)",
|
||||
.bt_adid = "fw_adid_8800d80_u02.bin",
|
||||
.bt_patch = "fw_patch_8800d80_u02.bin",
|
||||
.bt_table = "fw_patch_table_8800d80_u02.bin",
|
||||
#if defined CONFIG_SDIO_BT
|
||||
.wl_fw = "fmacfwbt_8800d80_h_u02.bin",
|
||||
#elif defined CONFIG_FOR_IPCAM
|
||||
.wl_fw = "fmacfw_8800d80_h_u02_ipc.bin",
|
||||
#else
|
||||
.wl_fw = "fmacfw_8800d80_h_u02.bin",
|
||||
#endif
|
||||
.bt_ext_patch = "fw_patch_8800d80_u02_ext"
|
||||
},
|
||||
|
||||
[AICBSP_CPMODE_TEST] = {
|
||||
.desc = "rf test mode(8800d80 sdio u02)",
|
||||
.bt_adid = "fw_adid_8800d80_u02.bin",
|
||||
.bt_patch = "fw_patch_8800d80_u02.bin",
|
||||
.bt_table = "fw_patch_table_8800d80_u02.bin",
|
||||
.wl_fw = "lmacfw_rf_8800d80_u02.bin",
|
||||
.bt_ext_patch = "fw_patch_8800d80_u02_ext"
|
||||
},
|
||||
};
|
||||
|
||||
const struct aicbsp_firmware fw_8800d80x2[] = {
|
||||
[AICBSP_CPMODE_WORK] = {
|
||||
.desc = "normal work mode(8800d80x2 sdio)",
|
||||
.bt_adid = "fw_adid_8800d80x2_u05.bin",
|
||||
.bt_patch = "fw_patch_8800d80x2_u05.bin",
|
||||
.bt_table = "fw_patch_table_8800d80x2_u05.bin",
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
.wl_fw = "fmacfwbt_8800d80_h_u02.bin",
|
||||
#else
|
||||
.wl_fw = "fmacfw_8800d80x2.bin",
|
||||
#endif
|
||||
.bt_ext_patch = "fw_patch_8800d80x2_u05_ext"
|
||||
},
|
||||
|
||||
[AICBSP_CPMODE_TEST] = {
|
||||
.desc = "rf test mode(8800d80x2 sdio)",
|
||||
.bt_adid = "fw_adid_8800d80x2_u05.bin",
|
||||
.bt_patch = "fw_patch_8800d80x2_u05.bin",
|
||||
.bt_table = "fw_patch_table_8800d80x2_u05.bin",
|
||||
.wl_fw = "lmacfw_rf_8800d80x2.bin",
|
||||
.bt_ext_patch = "fw_patch_8800d80x2_u05_ext"
|
||||
},
|
||||
};
|
||||
|
||||
@@ -328,6 +397,9 @@ static int __init aicbsp_init(void)
|
||||
aicbsp_info.cpmode = testmode;
|
||||
|
||||
aicbsp_resv_mem_init();
|
||||
|
||||
sema_init(&aicbsp_probe_semaphore, 0);
|
||||
|
||||
ret = platform_driver_register(&aicbsp_driver);
|
||||
if (ret) {
|
||||
pr_err("register platform driver failed: %d\n", ret);
|
||||
@@ -348,7 +420,7 @@ static int __init aicbsp_init(void)
|
||||
}
|
||||
|
||||
mutex_init(&aicbsp_power_lock);
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP
|
||||
#if defined CONFIG_PLATFORM_ROCKCHIP || defined CONFIG_PLATFORM_ROCKCHIP2
|
||||
aicbsp_set_subsys(AIC_BLUETOOTH, AIC_PWR_ON);
|
||||
#endif
|
||||
return 0;
|
||||
@@ -359,7 +431,7 @@ extern struct aic_sdio_dev *aicbsp_sdiodev;
|
||||
|
||||
static void __exit aicbsp_exit(void)
|
||||
{
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP
|
||||
#if defined CONFIG_PLATFORM_ROCKCHIP || defined CONFIG_PLATFORM_ROCKCHIP2
|
||||
if(aicbsp_sdiodev){
|
||||
aicbsp_sdio_exit();
|
||||
}
|
||||
|
||||
177
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicsdio.c
Normal file → Executable file
177
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicsdio.c
Normal file → Executable file
@@ -48,15 +48,17 @@ static void aicbsp_platform_power_off(void);
|
||||
|
||||
struct aic_sdio_dev *aicbsp_sdiodev = NULL;
|
||||
static struct semaphore *aicbsp_notify_semaphore;
|
||||
extern struct semaphore aicbsp_probe_semaphore;
|
||||
|
||||
static const struct sdio_device_id aicbsp_sdmmc_ids[];
|
||||
static bool aicbsp_load_fw_in_fdrv = false;
|
||||
|
||||
#define FW_PATH_MAX 200
|
||||
|
||||
//#ifdef CONFIG_PLATFORM_UBUNTU
|
||||
char* aic_default_fw_path = "/usr/lib/firmware/aic8800_sdio/aic8800";
|
||||
//static const char* aic_default_fw_path = "/lib/firmware/aic8800_sdio";
|
||||
//#else
|
||||
//static const char* aic_default_fw_path = CONFIG_AIC_FW_PATH;
|
||||
static const char* aic_default_fw_path = CONFIG_AIC_FW_PATH;
|
||||
//#endif
|
||||
char aic_fw_path[FW_PATH_MAX];
|
||||
module_param_string(aic_fw_path, aic_fw_path, FW_PATH_MAX, 0660);
|
||||
@@ -75,10 +77,12 @@ extern int testmode;
|
||||
#define SDIO_VENDOR_ID_AIC8801 0x5449
|
||||
#define SDIO_VENDOR_ID_AIC8800DC 0xc8a1
|
||||
#define SDIO_VENDOR_ID_AIC8800D80 0xc8a1
|
||||
#define SDIO_VENDOR_ID_AIC8800D80X2 0xc8a1
|
||||
|
||||
#define SDIO_DEVICE_ID_AIC8801 0x0145
|
||||
#define SDIO_DEVICE_ID_AIC8800DC 0xc08d
|
||||
#define SDIO_DEVICE_ID_AIC8800D80 0x0082
|
||||
#define SDIO_DEVICE_ID_AIC8800D80X2 0x2082
|
||||
|
||||
|
||||
static int aicbsp_dummy_probe(struct sdio_func *func, const struct sdio_device_id *id)
|
||||
@@ -242,6 +246,10 @@ static int aicwf_sdio_chipmatch(struct aic_sdio_dev *sdio_dev, uint16_t vid, uin
|
||||
sdio_dev->chipid = PRODUCT_ID_AIC8800D80;
|
||||
AICWFDBG(LOGINFO, "%s USE AIC8800D80\r\n", __func__);
|
||||
return 0;
|
||||
}else if(vid == SDIO_VENDOR_ID_AIC8800D80X2 && did == SDIO_DEVICE_ID_AIC8800D80X2){
|
||||
sdio_dev->chipid = PRODUCT_ID_AIC8800D80X2;
|
||||
AICWFDBG(LOGINFO, "%s USE AIC8800D80X2\r\n", __func__);
|
||||
return 0;
|
||||
}else{
|
||||
return -1;
|
||||
}
|
||||
@@ -264,6 +272,11 @@ static int aicbsp_sdio_probe(struct sdio_func *func,
|
||||
struct aicwf_bus *bus_if;
|
||||
int err = -ENODEV;
|
||||
|
||||
if (func == NULL) {
|
||||
sdio_err("%s func is null\n", __func__);
|
||||
return err;
|
||||
}
|
||||
|
||||
sdio_dbg("%s:%d vid:0x%04X did:0x%04X\n", __func__, func->num,
|
||||
func->vendor, func->device);
|
||||
|
||||
@@ -283,8 +296,11 @@ static int aicbsp_sdio_probe(struct sdio_func *func,
|
||||
return err;
|
||||
}
|
||||
|
||||
func = func->card->sdio_func[1 - 1]; //replace 2 with 1
|
||||
host = func->card->host;
|
||||
host->caps |= MMC_CAP_NONREMOVABLE;
|
||||
|
||||
func = func->card->sdio_func[1 - 1]; //replace 2 with 1
|
||||
|
||||
sdio_dbg("%s after replace:%d\n", __func__, func->num);
|
||||
|
||||
bus_if = kzalloc(sizeof(struct aicwf_bus), GFP_KERNEL);
|
||||
@@ -313,12 +329,11 @@ static int aicbsp_sdio_probe(struct sdio_func *func,
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8800DC || sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
dev_set_drvdata(&sdiodev->func_msg->dev, bus_if);
|
||||
printk("the device is PRODUCT_ID_AIC8800DC \n");
|
||||
aic_default_fw_path = "/usr/lib/firmware/aic8800_sdio/aic8800DC";
|
||||
}
|
||||
dev_set_drvdata(&func->dev, bus_if);
|
||||
sdiodev->dev = &func->dev;
|
||||
|
||||
if (sdiodev->chipid != PRODUCT_ID_AIC8800D80) {
|
||||
if (sdiodev->chipid != PRODUCT_ID_AIC8800D80 && sdiodev->chipid != PRODUCT_ID_AIC8800D80X2) {
|
||||
err = aicwf_sdio_func_init(sdiodev);
|
||||
} else {
|
||||
err = aicwf_sdiov3_func_init(sdiodev);
|
||||
@@ -332,9 +347,11 @@ static int aicbsp_sdio_probe(struct sdio_func *func,
|
||||
sdio_err("sdio bus init err\r\n");
|
||||
goto fail;
|
||||
}
|
||||
host->caps |= MMC_CAP_NONREMOVABLE;
|
||||
|
||||
aicbsp_platform_init(sdiodev);
|
||||
|
||||
up(&aicbsp_probe_semaphore);
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
aicwf_sdio_func_deinit(sdiodev);
|
||||
@@ -344,33 +361,37 @@ fail:
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
static void aicbsp_sdio_remove(struct sdio_func *func)
|
||||
{
|
||||
struct mmc_host *host;
|
||||
struct aicwf_bus *bus_if = NULL;
|
||||
struct aic_sdio_dev *sdiodev = NULL;
|
||||
|
||||
sdio_dbg("%s\n", __func__);
|
||||
AICWFDBG(LOGINFO, "%s\n", __func__);
|
||||
if (aicbsp_sdiodev == NULL) {
|
||||
sdio_dbg("%s: allready unregister\n", __func__);
|
||||
return;
|
||||
AICWFDBG(LOGERROR, "%s: allready unregister\n", __func__);
|
||||
goto done;
|
||||
}
|
||||
if (func == NULL) {
|
||||
AICWFDBG(LOGERROR, "%s, sdio func is null\n", __func__);
|
||||
goto done;
|
||||
}
|
||||
|
||||
bus_if = aicbsp_get_drvdata(&func->dev);
|
||||
|
||||
if (!bus_if) {
|
||||
AICWFDBG(LOGERROR, "%s bus_if is NULL \r\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
func = aicbsp_sdiodev->func;
|
||||
host = func->card->host;
|
||||
host->caps &= ~MMC_CAP_NONREMOVABLE;
|
||||
|
||||
bus_if = aicbsp_get_drvdata(&func->dev);
|
||||
|
||||
if (!bus_if) {
|
||||
AICWFDBG(LOGERROR, "%s bus_if is NULL \r\n", __func__);
|
||||
goto done;
|
||||
}
|
||||
|
||||
sdiodev = bus_if->bus_priv.sdio;
|
||||
if (!sdiodev) {
|
||||
AICWFDBG(LOGERROR, "%s sdiodev is NULL \r\n", __func__);
|
||||
return;
|
||||
AICWFDBG(LOGERROR, "%s sdiodev is NULL \r\n", __func__);
|
||||
goto done;
|
||||
}
|
||||
|
||||
aicwf_sdio_release(sdiodev);
|
||||
@@ -378,29 +399,26 @@ static void aicbsp_sdio_remove(struct sdio_func *func)
|
||||
|
||||
dev_set_drvdata(&sdiodev->func->dev, NULL);
|
||||
kfree(sdiodev);
|
||||
kfree(bus_if);
|
||||
|
||||
done:
|
||||
if (bus_if)
|
||||
kfree(bus_if);
|
||||
aicbsp_sdiodev = NULL;
|
||||
sdio_dbg("%s done\n", __func__);
|
||||
}
|
||||
|
||||
|
||||
static int aicbsp_sdio_suspend(struct device *dev)
|
||||
{
|
||||
struct sdio_func *func = dev_to_sdio_func(dev);
|
||||
int err;
|
||||
mmc_pm_flag_t sdio_flags;
|
||||
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP
|
||||
#if defined(CONFIG_PLATFORM_ROCKCHIP) || defined(CONFIG_PLATFORM_ROCKCHIP2)
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
//BT_SLEEP:true,BT_WAKEUP:false
|
||||
rfkill_rk_sleep_bt(false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP2
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
//BT_SLEEP:true,BT_WAKEUP:false
|
||||
rfkill_rk_sleep_bt(false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
sdio_dbg("%s, func->num = %d\n", __func__, func->num);
|
||||
@@ -420,7 +438,7 @@ static int aicbsp_sdio_suspend(struct device *dev)
|
||||
return err;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP
|
||||
#if defined(CONFIG_PLATFORM_ROCKCHIP) || defined(CONFIG_PLATFORM_ROCKCHIP2)
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
//BT_SLEEP:true,BT_WAKEUP:false
|
||||
rfkill_rk_sleep_bt(true);
|
||||
@@ -428,15 +446,6 @@ static int aicbsp_sdio_suspend(struct device *dev)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP2
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
//BT_SLEEP:true,BT_WAKEUP:false
|
||||
rfkill_rk_sleep_bt(true);
|
||||
printk("%s BT wake to SLEEP\r\n", __func__);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -444,6 +453,13 @@ static int aicbsp_sdio_resume(struct device *dev)
|
||||
{
|
||||
sdio_dbg("%s\n", __func__);
|
||||
|
||||
#if defined(CONFIG_PLATFORM_ROCKCHIP) || defined(CONFIG_PLATFORM_ROCKCHIP2)
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
//BT_SLEEP:true,BT_WAKEUP:false
|
||||
rfkill_rk_sleep_bt(false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -571,11 +587,18 @@ static void aicbsp_platform_power_off(void)
|
||||
|
||||
int aicbsp_sdio_init(void)
|
||||
{
|
||||
|
||||
if (sdio_register_driver(&aicbsp_sdio_driver)) {
|
||||
return -1;
|
||||
} else {
|
||||
//may add mmc_rescan here
|
||||
}
|
||||
if (down_timeout(&aicbsp_probe_semaphore, msecs_to_jiffies(2000)) != 0){
|
||||
printk("%s aicbsp_sdio_probe fail\r\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -734,7 +757,7 @@ int aicwf_sdio_wakeup(struct aic_sdio_dev *sdiodev)
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DW) {
|
||||
wakeup_reg_val = 1;
|
||||
} else if (sdiodev->chipid == PRODUCT_ID_AIC8800D80) {
|
||||
} else if (sdiodev->chipid == PRODUCT_ID_AIC8800D80 || sdiodev->chipid == PRODUCT_ID_AIC8800D80X2) {
|
||||
wakeup_reg_val = 0x11;
|
||||
}
|
||||
|
||||
@@ -954,7 +977,8 @@ static int aicwf_sdio_tx_msg(struct aic_sdio_dev *sdiodev)
|
||||
} else
|
||||
len = payload_len;
|
||||
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8801 || sdiodev->chipid == PRODUCT_ID_AIC8800D80){
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8801 || sdiodev->chipid == PRODUCT_ID_AIC8800D80 ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800D80X2){
|
||||
buffer_cnt = aicwf_sdio_flow_ctrl(sdiodev);
|
||||
while ((buffer_cnt <= 0 || (buffer_cnt > 0 && len > (buffer_cnt * BUFFER_SIZE))) && retry < 10) {
|
||||
retry++;
|
||||
@@ -964,7 +988,8 @@ static int aicwf_sdio_tx_msg(struct aic_sdio_dev *sdiodev)
|
||||
}
|
||||
down(&sdiodev->tx_priv->cmd_txsema);
|
||||
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8801 || sdiodev->chipid == PRODUCT_ID_AIC8800D80){
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8801 || sdiodev->chipid == PRODUCT_ID_AIC8800D80 ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800D80X2){
|
||||
if (buffer_cnt > 0 && len < (buffer_cnt * BUFFER_SIZE)) {
|
||||
err = aicwf_sdio_send_pkt(sdiodev, payload, len);
|
||||
if (err) {
|
||||
@@ -1198,7 +1223,7 @@ int aicwf_sdio_aggr(struct aicwf_tx_priv *tx_priv, struct sk_buff *pkt)
|
||||
if (tx_priv->sdiodev->chipid == PRODUCT_ID_AIC8801 || tx_priv->sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
tx_priv->sdiodev->chipid == PRODUCT_ID_AIC8800DW)
|
||||
sdio_header[3] = 0; //reserved
|
||||
else if (tx_priv->sdiodev->chipid == PRODUCT_ID_AIC8800D80)
|
||||
else if (tx_priv->sdiodev->chipid == PRODUCT_ID_AIC8800D80 || tx_priv->sdiodev->chipid == PRODUCT_ID_AIC8800D80X2)
|
||||
sdio_header[3] = crc8_ponl_107(&sdio_header[0], 3); // crc8
|
||||
|
||||
memcpy(tx_priv->tail, (u8 *)&sdio_header, sizeof(sdio_header));
|
||||
@@ -1305,7 +1330,7 @@ static int aicwf_sdio_bus_start(struct device *dev)
|
||||
|
||||
if (ret != 0)
|
||||
sdio_err("func2 intr register failed:%d\n", ret);
|
||||
}else if(sdiodev->chipid == PRODUCT_ID_AIC8800D80){
|
||||
}else if(sdiodev->chipid == PRODUCT_ID_AIC8800D80 || sdiodev->chipid == PRODUCT_ID_AIC8800D80X2){
|
||||
sdio_claim_host(sdiodev->func);
|
||||
sdio_claim_irq(sdiodev->func, aicwf_sdio_hal_irqhandler);
|
||||
|
||||
@@ -1446,7 +1471,7 @@ void aicwf_sdio_hal_irqhandler(struct sdio_func *func)
|
||||
|
||||
ret = aicwf_sdio_readb(sdiodev, sdiodev->sdio_reg.block_cnt_reg, &intstatus);
|
||||
}
|
||||
}else if (sdiodev->chipid == PRODUCT_ID_AIC8800D80) {
|
||||
}else if (sdiodev->chipid == PRODUCT_ID_AIC8800D80 || sdiodev->chipid == PRODUCT_ID_AIC8800D80X2) {
|
||||
do {
|
||||
ret = aicwf_sdio_readb(sdiodev, sdiodev->sdio_reg.misc_int_status_reg, &intstatus);
|
||||
if (!ret) {
|
||||
@@ -1601,22 +1626,33 @@ void aicwf_sdio_release_func2(struct aic_sdio_dev *sdiodev)
|
||||
|
||||
void aicwf_sdio_release(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
struct aicwf_bus *bus_if;
|
||||
struct aicwf_bus *bus_if = NULL;
|
||||
struct aicwf_bus *bus_if_t = NULL;
|
||||
int ret = 0;
|
||||
|
||||
sdio_dbg("%s\n", __func__);
|
||||
if (sdiodev->func == NULL) {
|
||||
printk("%s, NULL sdio func\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
bus_if = aicbsp_get_drvdata(sdiodev->dev);
|
||||
bus_if->state = BUS_DOWN_ST;
|
||||
if (bus_if)
|
||||
bus_if->state = BUS_DOWN_ST;
|
||||
|
||||
sdio_claim_host(sdiodev->func);
|
||||
//disable sdio interrupt
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x0);
|
||||
if (ret < 0) {
|
||||
sdio_err("reg:%d write failed!, ret=%d\n", sdiodev->sdio_reg.intr_config_reg, ret);
|
||||
bus_if_t = dev_get_drvdata(sdiodev->dev);
|
||||
|
||||
if ((bus_if_t != NULL) && (sdiodev->bus_if == bus_if_t)) {
|
||||
sdio_dbg("%s bsp release\n", __func__);
|
||||
sdio_claim_host(sdiodev->func);
|
||||
//disable sdio interrupt
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x0);
|
||||
if (ret < 0) {
|
||||
sdio_err("reg:%d write failed!, ret=%d\n", sdiodev->sdio_reg.intr_config_reg, ret);
|
||||
}
|
||||
sdio_release_irq(sdiodev->func);
|
||||
sdio_release_host(sdiodev->func);
|
||||
}
|
||||
sdio_release_irq(sdiodev->func);
|
||||
sdio_release_host(sdiodev->func);
|
||||
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8800DC || sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
aicwf_sdio_release_func2(sdiodev);
|
||||
@@ -1634,6 +1670,8 @@ void aicwf_sdio_release(struct aic_sdio_dev *sdiodev)
|
||||
rwnx_cmd_mgr_deinit(&sdiodev->cmd_mgr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void aicwf_sdio_reg_init(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
sdio_dbg("%s\n", __func__);
|
||||
@@ -1650,7 +1688,7 @@ void aicwf_sdio_reg_init(struct aic_sdio_dev *sdiodev)
|
||||
sdiodev->sdio_reg.block_cnt_reg = SDIOWIFI_BLOCK_CNT_REG;
|
||||
sdiodev->sdio_reg.rd_fifo_addr = SDIOWIFI_RD_FIFO_ADDR;
|
||||
sdiodev->sdio_reg.wr_fifo_addr = SDIOWIFI_WR_FIFO_ADDR;
|
||||
} else if (sdiodev->chipid == PRODUCT_ID_AIC8800D80){
|
||||
} else if (sdiodev->chipid == PRODUCT_ID_AIC8800D80 || sdiodev->chipid == PRODUCT_ID_AIC8800D80X2){
|
||||
sdiodev->sdio_reg.bytemode_len_reg = SDIOWIFI_BYTEMODE_LEN_REG_V3;
|
||||
sdiodev->sdio_reg.intr_config_reg = SDIOWIFI_INTR_ENABLE_REG_V3;
|
||||
sdiodev->sdio_reg.sleep_reg = SDIOWIFI_INTR_PENDING_REG_V3;
|
||||
@@ -1842,16 +1880,35 @@ int aicwf_sdiov3_func_init(struct aic_sdio_dev *sdiodev)
|
||||
|
||||
void aicwf_sdio_func_deinit(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
sdio_claim_host(sdiodev->func);
|
||||
sdio_disable_func(sdiodev->func);
|
||||
sdio_release_host(sdiodev->func);
|
||||
struct aicwf_bus *bus_if = NULL;
|
||||
|
||||
if (sdiodev->func == NULL) {
|
||||
sdio_err("%s, NULL sdio func\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
bus_if = dev_get_drvdata(sdiodev->dev);
|
||||
if (bus_if == NULL) {
|
||||
sdio_err("%s, bus_if is null\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
if (sdiodev->bus_if == bus_if) {
|
||||
sdio_dbg("%s bsp disable\n", __func__);
|
||||
sdio_claim_host(sdiodev->func);
|
||||
sdio_disable_func(sdiodev->func);
|
||||
sdio_release_host(sdiodev->func);
|
||||
}
|
||||
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8800DC || sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
sdio_claim_host(sdiodev->func_msg);
|
||||
sdio_disable_func(sdiodev->func_msg);
|
||||
sdio_release_host(sdiodev->func_msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void *aicwf_sdio_bus_init(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
int ret;
|
||||
@@ -1944,6 +2001,11 @@ void set_irq_handler(void *fn){
|
||||
aicbsp_sdiodev->sdio_hal_irqhandler = (sdio_irq_handler_t *)fn;
|
||||
}
|
||||
|
||||
extern int adap_test;
|
||||
int get_adap_test(void){
|
||||
return adap_test;
|
||||
}
|
||||
|
||||
uint8_t crc8_ponl_107(uint8_t *p_buffer, uint16_t cal_size)
|
||||
{
|
||||
uint8_t i;
|
||||
@@ -1972,4 +2034,5 @@ EXPORT_SYMBOL(get_fw_path);
|
||||
EXPORT_SYMBOL(get_testmode);
|
||||
EXPORT_SYMBOL(get_sdio_func);
|
||||
EXPORT_SYMBOL(set_irq_handler);
|
||||
EXPORT_SYMBOL(get_adap_test);
|
||||
|
||||
|
||||
4
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicsdio.h
Normal file → Executable file
4
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicsdio.h
Normal file → Executable file
@@ -69,7 +69,8 @@ enum AICWF_IC{
|
||||
PRODUCT_ID_AIC8801 = 0,
|
||||
PRODUCT_ID_AIC8800DC,
|
||||
PRODUCT_ID_AIC8800DW,
|
||||
PRODUCT_ID_AIC8800D80
|
||||
PRODUCT_ID_AIC8800D80,
|
||||
PRODUCT_ID_AIC8800D80X2
|
||||
};
|
||||
|
||||
struct aic_sdio_reg {
|
||||
@@ -108,6 +109,7 @@ struct aic_sdio_dev {
|
||||
struct semaphore pwrctl_wakeup_sema;
|
||||
#endif
|
||||
u16 chipid;
|
||||
u32 fw_version_uint;
|
||||
struct aic_sdio_reg sdio_reg;
|
||||
void (*sdio_hal_irqhandler) (struct sdio_func *func);
|
||||
};
|
||||
|
||||
7
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicsdio_txrxif.c
Normal file → Executable file
7
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicsdio_txrxif.c
Normal file → Executable file
@@ -41,21 +41,22 @@ int aicwf_bus_init(uint bus_hdrlen, struct device *dev)
|
||||
init_completion(&bus_if->busrx_trgg);
|
||||
#ifdef AICWF_SDIO_SUPPORT
|
||||
bus_if->bustx_thread = kthread_run(aicwf_sdio_bustx_thread, (void *)bus_if, "aicwf_bustx_thread");
|
||||
bus_if->busrx_thread = kthread_run(aicwf_sdio_busrx_thread, (void *)bus_if->bus_priv.sdio->rx_priv, "aicwf_busrx_thread");
|
||||
#endif
|
||||
|
||||
if (IS_ERR(bus_if->bustx_thread)) {
|
||||
bus_if->bustx_thread = NULL;
|
||||
txrx_err("aicwf_bustx_thread run fail\n");
|
||||
ret = -1;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
bus_if->busrx_thread = kthread_run(aicwf_sdio_busrx_thread, (void *)bus_if->bus_priv.sdio->rx_priv, "aicwf_busrx_thread");
|
||||
if (IS_ERR(bus_if->busrx_thread)) {
|
||||
bus_if->busrx_thread = NULL;
|
||||
txrx_err("aicwf_bustx_thread run fail\n");
|
||||
ret = -1;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
#endif
|
||||
return ret;
|
||||
fail:
|
||||
aicwf_bus_deinit(dev);
|
||||
|
||||
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicsdio_txrxif.h
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicsdio_txrxif.h
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicwf_firmware_array.c
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicwf_firmware_array.c
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicwf_firmware_array.h
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicwf_firmware_array.h
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicwf_txq_prealloc.c
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicwf_txq_prealloc.c
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicwf_txq_prealloc.h
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/aicwf_txq_prealloc.h
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/md5.c
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/md5.c
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/md5.h
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_bsp/md5.h
Normal file → Executable file
2
osdrv/extdrv/wireless/aic8800/aic8800_bsp/rwnx_version_gen.h
Normal file → Executable file
2
osdrv/extdrv/wireless/aic8800/aic8800_bsp/rwnx_version_gen.h
Normal file → Executable file
@@ -1,4 +1,4 @@
|
||||
#define RWNX_VERS_REV "241c091M (master)"
|
||||
#define RWNX_VERS_MOD "6.4.3.0"
|
||||
#define RWNX_VERS_BANNER "rwnx v6.4.3.0 - - 241c091M (master)"
|
||||
#define RELEASE_DATE "2024_0109_ec460377"
|
||||
#define RELEASE_DATE "2025_0926_91c9dae5"
|
||||
|
||||
0
osdrv/extdrv/wireless/aic8800/aic8800_btlpm/.gitignore
vendored
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_btlpm/.gitignore
vendored
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_btlpm/Kconfig
Normal file → Executable file
0
osdrv/extdrv/wireless/aic8800/aic8800_btlpm/Kconfig
Normal file → Executable file
25
osdrv/extdrv/wireless/aic8800/aic8800_btlpm/Makefile
Normal file → Executable file
25
osdrv/extdrv/wireless/aic8800/aic8800_btlpm/Makefile
Normal file → Executable file
@@ -12,38 +12,23 @@ CONFIG_PLATFORM_AMLOGIC ?= n
|
||||
CONFIG_PLATFORM_UBUNTU ?= y
|
||||
|
||||
|
||||
CONFIG_SUPPORT_LPM = y
|
||||
CONFIG_SUPPORT_LPM ?= y
|
||||
CONFIG_AUTO_PM ?= n
|
||||
|
||||
aic8800_btlpm-y := \
|
||||
aic_bluetooth_main.o \
|
||||
rfkill.o \
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_UBUNTU), n)
|
||||
aic8800_btlpm-$(CONFIG_SUPPORT_LPM) += lpm.o
|
||||
endif
|
||||
aic8800_btlpm-$(CONFIG_SUPPORT_LPM) += lpm.o
|
||||
|
||||
ccflags-y += -DAIC_TRACE_INCLUDE_PATH=$(src)
|
||||
|
||||
ccflags-$(CONFIG_AUTO_PM) += -DCONFIG_AUTO_PM
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ROCKCHIP), y)
|
||||
KDIR ?= /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/kernel
|
||||
ARCH ?= arm
|
||||
CROSS_COMPILE ?= /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/prebuilts/gcc/linux-x86/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3229/Android10/SDK/kernel/
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3229/Android10/SDK/prebuilts/gcc/linux-x86/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3288/Android10/kernel/kernel/
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3288/Android10/tool/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux#-gnueabihf-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/kernel
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3328/Android9/SDK/SDK/kernel
|
||||
#ARCH ?= arm64
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3328/Android9/SDK/SDK/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
|
||||
ARCH = arm64
|
||||
KDIR = /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/kernel
|
||||
CROSS_COMPILE = /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
ccflags-$(CONFIG_PLATFORM_ROCKCHIP) += -DCONFIG_PLATFORM_ROCKCHIP
|
||||
ccflags-y += -DANDROID_PLATFORM
|
||||
endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user