mirror of
https://github.com/LuckfoxTECH/luckfox-pico.git
synced 2026-01-18 03:28:19 +01:00
Add Luckfox Pico 86Panel Support (#274)
* project/cfg/BoardConfig_IPC/overlay : Add Luckfox Pico 86Panel overlay files Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * sysdrv/source/kernel/arch/arm/boot/dts : Add Luckfox Pico 86Panel device tree files Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * project/cfg/BoardConfig_IPC : Add Luckfox Pico 86Panel BoardConfig files Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * project/build.sh : Add the lunch menu item of Luckfox Pico 86Panel Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * sysdrv/source/kernel/arch/arm/configs : Add Goodix driver module configuration for RV1106 Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * sysdrv/tools/board/buildroot/luckfox_pico_w_defconfig : Add rsync command for Luckfox Pico Buildroot system Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-ubuntu-config : Add rysnc command for Luckfox Pico Ubuntu system Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-config/etc/init.d : Add MIC initialization script to improve default recording quality Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * sysdrv/tools/board/buildroot/busybox_patch : Add patches to enable Chinese display support in the terminal and allow the reboot command to accept parameters Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * sysdrv/Makefile : Automatically apply BusyBox patches when building the Buildroot image Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * sysdrv/source/kernel/arch/arm/kernel/setup.c : Make the kernel retrieve the unique CPU serial number Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-config/usr/bin/luckfox-config : Fix errors and add support for eMMC rootfs backup Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * sysdrv/source/kernel/arch/arm/boot/dts : Make Luckfox Pico Ultra and Luckfox Pico Pi default to using i2c4 for CSI cameras Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-ubuntu-ultra/usr/bin/wifi_bt_init.sh : Enable wireless module initialization support for Ubuntu on Luckfox Pico 86Panel and Luckfox Pico Pi Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * project/cfg/BoardConfig_IPC : Add executable permission to the BoardConfig scripts Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * sysdrv/source/uboot : Resolve the issue of fast boot failure on certain eMMC models Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * project/cfg/BoardConfig_IPC/luckfox-rv1106-tb-emmc-post.sh : Resolve the issue of file system initialization failure during eMMC fast boot Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * project/build.sh : Fix the issue of submodule switch failure Signed-off-by: luckfox-eng29 <eng29@luckfox.com> * project/app/rkipc/rkipc/src : Make sure that changes to rkipc.ini can be applied and take effect after modification Signed-off-by: eng29 <eng29@luckfox.com> * project/cfg/BoardConfig_IPC : Discontinue support for Ubuntu Signed-off-by: eng29 <eng29@luckfox.com> * project/build.sh : Discontinue support for Ubuntu Signed-off-by: eng29 <eng29@luckfox.com> * sysdrv/Makefile : Discontinue support for Ubuntu Signed-off-by: eng29 <eng29@luckfox.com> * README.md : Update description README_CN.md : Update description Signed-off-by: eng29 <eng29@luckfox.com> * . : Delete the Ubuntu rootfs submodule Signed-off-by: eng29 <eng29@luckfox.com> * sysdrv/drv_ko/wifi/aic8800dc : Update the aic8800dc driver Signed-off-by: eng29 <eng29@luckfox.com> --------- Signed-off-by: luckfox-eng29 <eng29@luckfox.com> Signed-off-by: eng29 <eng29@luckfox.com>
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +0,0 @@
|
||||
[submodule "ubuntu"]
|
||||
path = sysdrv/tools/board/ubuntu
|
||||
url = https://github.com/luckfox-eng33/pico_ubuntu.git
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "ubuntu"]
|
||||
path = sysdrv/tools/board/ubuntu
|
||||
url = https://gitee.com/eng-thirty-three/pico_ubuntu.git
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "ubuntu"]
|
||||
path = sysdrv/tools/board/ubuntu
|
||||
url = https://github.com/luckfox-eng33/pico_ubuntu.git
|
||||
195
README.md
195
README.md
@@ -37,11 +37,6 @@ source env_install_toolchain.sh
|
||||
```
|
||||
git clone <https://gitee.com/LuckfoxTECH/luckfox-pico.git>
|
||||
```
|
||||
* If you need to compile the Ubuntu system and use the Gitee source
|
||||
* Please modify the corresponding board mk file LF_SUBMODULES_BY to gitee, for example
|
||||
```
|
||||
LF_SUBMODULES_BY=gitee
|
||||
```
|
||||
### Instructions for build.sh
|
||||
* The build.sh script is used to automate the compilation process.
|
||||
* Most of the compilation operations can be completed automatically through build.sh.
|
||||
@@ -99,11 +94,17 @@ kernelconfig -config kernel and save defconfig"
|
||||
[1] RV1103_Luckfox_Pico_Mini_A
|
||||
[2] RV1103_Luckfox_Pico_Mini_B
|
||||
[3] RV1103_Luckfox_Pico_Plus
|
||||
[4] RV1106_Luckfox_Pico_Pro_Max
|
||||
[5] RV1106_Luckfox_Pico_Ultra
|
||||
[6] RV1106_Luckfox_Pico_Ultra_W
|
||||
[7] custom
|
||||
Which would you like? [0~7][default:0]:
|
||||
[4] RV1103_Luckfox_Pico_WebBee
|
||||
[5] RV1106_Luckfox_Pico_Pro
|
||||
[6] RV1106_Luckfox_Pico_Max
|
||||
[7] RV1106_Luckfox_Pico_Ultra
|
||||
[8] RV1106_Luckfox_Pico_Ultra_W
|
||||
[9] RV1106_Luckfox_Pico_Pi
|
||||
[10] RV1106_Luckfox_Pico_Pi_W
|
||||
[11] RV1106_Luckfox_Pico_86Panel
|
||||
[12] RV1106_Luckfox_Pico_86Panel_W
|
||||
[13] custom
|
||||
Which would you like? [0~13][default:0]:
|
||||
```
|
||||
+ Output the supported storage media for the corresponding Luckfox-pico hardware model. Enter the corresponding number to proceed to the root filesystem options (press Enter to select option [0] directly).For example, Luckfox Pico Plus.
|
||||
```shell
|
||||
@@ -119,7 +120,6 @@ kernelconfig -config kernel and save defconfig"
|
||||
Lunch menu...pick the system version:
|
||||
选择系统版本:
|
||||
[0] Buildroot(Support Rockchip official features)
|
||||
[1] Ubuntu(Support for the apt package management tool)
|
||||
|
||||
Which would you like? [0~1][default:0]:
|
||||
```
|
||||
@@ -132,121 +132,127 @@ kernelconfig -config kernel and save defconfig"
|
||||
[1] RV1103_Luckfox_Pico_Mini_A
|
||||
[2] RV1103_Luckfox_Pico_Mini_B
|
||||
[3] RV1103_Luckfox_Pico_Plus
|
||||
[4] RV1106_Luckfox_Pico_Pro_Max
|
||||
[5] RV1106_Luckfox_Pico_Ultra
|
||||
[6] RV1106_Luckfox_Pico_Ultra_W
|
||||
[7] custom
|
||||
Which would you like? [0~7][default:0]: 7
|
||||
[4] RV1103_Luckfox_Pico_WebBee
|
||||
[5] RV1106_Luckfox_Pico_Pro
|
||||
[6] RV1106_Luckfox_Pico_Max
|
||||
[7] RV1106_Luckfox_Pico_Ultra
|
||||
[8] RV1106_Luckfox_Pico_Ultra_W
|
||||
[9] RV1106_Luckfox_Pico_Pi
|
||||
[10] RV1106_Luckfox_Pico_Pi_W
|
||||
[11] RV1106_Luckfox_Pico_86Panel
|
||||
[12] RV1106_Luckfox_Pico_86Panel_W
|
||||
[13] custom
|
||||
Which would you like? [0~13][default:0]: 13
|
||||
----------------------------------------------------------------
|
||||
0. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_Ultra-IPC.mk
|
||||
0. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_86Panel-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_86Panel
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
1. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_86Panel_W-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_86Panel_W
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
2. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_Pi-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pi
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
3. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_Pi_W-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pi_W
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
4. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_Ultra-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Ultra
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
1. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_Ultra_W-IPC.mk
|
||||
5. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_Ultra_W-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Ultra_W
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
2. BoardConfig_IPC/BoardConfig-EMMC-Ubuntu-RV1106_Luckfox_Pico_Ultra-IPC.mk
|
||||
6. BoardConfig_IPC/BoardConfig-EMMC-Busybox-RV1106_Luckfox_Pico_Ultra-IPC_FASTBOOT.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Ubuntu
|
||||
system version(系统版本): Busybox
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Ultra
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC_FASTBOOT
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
3. BoardConfig_IPC/BoardConfig-EMMC-Ubuntu-RV1106_Luckfox_Pico_Ultra_W-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Ubuntu
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Ultra_W
|
||||
applicaton(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
4. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico-IPC.mk
|
||||
7. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
5. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_Mini_A-IPC.mk
|
||||
8. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_Mini_A-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Mini_A
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
6. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_Mini_B-IPC.mk
|
||||
9. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_Mini_B-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Mini_B
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
7. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_Plus-IPC.mk
|
||||
10. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_Plus-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Plus
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
8. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1106_Luckfox_Pico_Pro_Max-IPC.mk
|
||||
11. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_WebBee-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pro_Max
|
||||
applicaton(应用场景): IPC
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_WebBee
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
9. BoardConfig_IPC/BoardConfig-SD_CARD-Ubuntu-RV1103_Luckfox_Pico-IPC.mk
|
||||
12. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1106_Luckfox_Pico_Max-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Ubuntu
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico
|
||||
applicaton(应用场景): IPC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Max
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
10. BoardConfig_IPC/BoardConfig-SD_CARD-Ubuntu-RV1103_Luckfox_Pico_Mini_A-IPC.mk
|
||||
13. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1106_Luckfox_Pico_Pro-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Ubuntu
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Mini_A
|
||||
applicaton(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
11. BoardConfig_IPC/BoardConfig-SD_CARD-Ubuntu-RV1103_Luckfox_Pico_Mini_B-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Ubuntu
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Mini_B
|
||||
applicaton(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
12. BoardConfig_IPC/BoardConfig-SD_CARD-Ubuntu-RV1103_Luckfox_Pico_Plus-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Ubuntu
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Plus
|
||||
applicaton(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
13. BoardConfig_IPC/BoardConfig-SD_CARD-Ubuntu-RV1106_Luckfox_Pico_Pro_Max-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Ubuntu
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pro_Max
|
||||
applicaton(应用场景): IPC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pro
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
@@ -254,7 +260,7 @@ kernelconfig -config kernel and save defconfig"
|
||||
boot medium(启动介质): SPI_NAND
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Mini_B
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
@@ -262,18 +268,40 @@ kernelconfig -config kernel and save defconfig"
|
||||
boot medium(启动介质): SPI_NAND
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Plus
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
16. BoardConfig_IPC/BoardConfig-SPI_NAND-Buildroot-RV1106_Luckfox_Pico_Pro_Max-IPC.mk
|
||||
16. BoardConfig_IPC/BoardConfig-SPI_NAND-Buildroot-RV1103_Luckfox_Pico_WebBee-IPC.mk
|
||||
boot medium(启动介质): SPI_NAND
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pro_Max
|
||||
applicaton(应用场景): IPC
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_WebBee
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
Which would you like? [default:0]:
|
||||
----------------------------------------------------------------
|
||||
17. BoardConfig_IPC/BoardConfig-SPI_NAND-Buildroot-RV1106_Luckfox_Pico_Max-IPC.mk
|
||||
boot medium(启动介质): SPI_NAND
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Max
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
18. BoardConfig_IPC/BoardConfig-SPI_NAND-Buildroot-RV1106_Luckfox_Pico_Pro-IPC.mk
|
||||
boot medium(启动介质): SPI_NAND
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pro
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
19. BoardConfig_IPC/BoardConfig-SPI_NAND-Busybox-RV1106_Luckfox_Pico_Pro_Max-IPC_FASTBOOT.mk
|
||||
boot medium(启动介质): SPI_NAND
|
||||
system version(系统版本): Busybox
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pro_Max
|
||||
application(应用场景): IPC_FASTBOOT
|
||||
----------------------------------------------------------------
|
||||
```
|
||||
Enter the corresponding board support file number to complete the configuration.
|
||||
#### Set Buildroot System Default WIFI Configuration
|
||||
@@ -297,13 +325,6 @@ kernelconfig -config kernel and save defconfig"
|
||||
./build.sh lunch # Select the reference board
|
||||
./build.sh # One-click automatic compilation
|
||||
```
|
||||
* Compile Ubuntu
|
||||
```
|
||||
sudo ./build.sh lunch # Select the reference board
|
||||
sudo ./build.sh # One-click automatic compilation
|
||||
```
|
||||
* Note that when compiling Ubuntu, make sure to use sudo, otherwise it may cause file system errors
|
||||
* The following text will not distinguish between the two sets of instructions, please choose accordingly based on the situation
|
||||
#### Build U-Boot
|
||||
```shell
|
||||
./build.sh clean uboot
|
||||
|
||||
199
README_CN.md
199
README_CN.md
@@ -16,7 +16,7 @@
|
||||
* 推荐SDK使用系统环境为Ubuntu 22.04
|
||||
### 安装依赖
|
||||
```shell
|
||||
sudo apt-get install repo git ssh make gcc gcc-multilib g++-multilib module-assistant expect g++ gawk texinfo libssl-dev bison flex fakeroot cmake unzip gperf autoconf device-tree-compiler libncurses5-dev pkg-config
|
||||
sudo apt-get install repo git ssh make gcc gcc-multilib g++-multilib module-assistant expect g++ gawk texinfo libssl-dev bison flex fakeroot cmake unzip gperf autoconf device-tree-compiler libncurses5-dev pkg-config bc python-is-python3 passwd openssl openssh-server openssh-client vim file cpio rsync
|
||||
```
|
||||
### 获取SDK
|
||||
* github
|
||||
@@ -27,11 +27,6 @@ sudo apt-get install repo git ssh make gcc gcc-multilib g++-multilib module-assi
|
||||
```
|
||||
git clone https://gitee.com/LuckfoxTECH/luckfox-pico.git
|
||||
```
|
||||
* 如果你需要需要编译ubuntu系统,并且使用gitee源
|
||||
* 请修改对应的板型mk文件中LF_SUBMODULES_BY改为gitee,如
|
||||
```
|
||||
LF_SUBMODULES_BY=gitee
|
||||
```
|
||||
### 环境变量
|
||||
* 需要将交叉编译工具链设置
|
||||
```
|
||||
@@ -94,11 +89,17 @@ kernelconfig -config kernel and save defconfig"
|
||||
[1] RV1103_Luckfox_Pico_Mini_A
|
||||
[2] RV1103_Luckfox_Pico_Mini_B
|
||||
[3] RV1103_Luckfox_Pico_Plus
|
||||
[4] RV1106_Luckfox_Pico_Pro_Max
|
||||
[5] RV1106_Luckfox_Pico_Ultra
|
||||
[6] RV1106_Luckfox_Pico_Ultra_W
|
||||
[7] custom
|
||||
Which would you like? [0~7][default:0]:
|
||||
[4] RV1103_Luckfox_Pico_WebBee
|
||||
[5] RV1106_Luckfox_Pico_Pro
|
||||
[6] RV1106_Luckfox_Pico_Max
|
||||
[7] RV1106_Luckfox_Pico_Ultra
|
||||
[8] RV1106_Luckfox_Pico_Ultra_W
|
||||
[9] RV1106_Luckfox_Pico_Pi
|
||||
[10] RV1106_Luckfox_Pico_Pi_W
|
||||
[11] RV1106_Luckfox_Pico_86Panel
|
||||
[12] RV1106_Luckfox_Pico_86Panel_W
|
||||
[13] custom
|
||||
Which would you like? [0~13][default:0]:
|
||||
```
|
||||
+ 输出对应的Luckfox-pico硬件型号支持的存储介质,输入对应编号后进入根文件系统选项(直接回车选择序号[0]选项)
|
||||
以Luckfox Pico Plus为例
|
||||
@@ -115,11 +116,10 @@ kernelconfig -config kernel and save defconfig"
|
||||
Lunch menu...pick the system version:
|
||||
选择系统版本:
|
||||
[0] Buildroot(Support Rockchip official features)
|
||||
[1] Ubuntu(Support for the apt package management tool)
|
||||
|
||||
Which would you like? [0~1][default:0]:
|
||||
```
|
||||
+ 如果需要使用旧的配置方式或者使用自定义的板级支持文件,在配置Luckfox-pico硬件型号时,选择“[7]custom”选项
|
||||
+ 如果需要使用旧的配置方式或者使用自定义的板级支持文件,在配置Luckfox-pico硬件型号时,选择“custom”选项
|
||||
```shell
|
||||
You're building on Linux
|
||||
Lunch menu...pick the Luckfox Pico hardware version:
|
||||
@@ -128,121 +128,127 @@ kernelconfig -config kernel and save defconfig"
|
||||
[1] RV1103_Luckfox_Pico_Mini_A
|
||||
[2] RV1103_Luckfox_Pico_Mini_B
|
||||
[3] RV1103_Luckfox_Pico_Plus
|
||||
[4] RV1106_Luckfox_Pico_Pro_Max
|
||||
[5] RV1106_Luckfox_Pico_Ultra
|
||||
[6] RV1106_Luckfox_Pico_Ultra_W
|
||||
[7] custom
|
||||
Which would you like? [0~7][default:0]: 7
|
||||
[4] RV1103_Luckfox_Pico_WebBee
|
||||
[5] RV1106_Luckfox_Pico_Pro
|
||||
[6] RV1106_Luckfox_Pico_Max
|
||||
[7] RV1106_Luckfox_Pico_Ultra
|
||||
[8] RV1106_Luckfox_Pico_Ultra_W
|
||||
[9] RV1106_Luckfox_Pico_Pi
|
||||
[10] RV1106_Luckfox_Pico_Pi_W
|
||||
[11] RV1106_Luckfox_Pico_86Panel
|
||||
[12] RV1106_Luckfox_Pico_86Panel_W
|
||||
[13] custom
|
||||
Which would you like? [0~13][default:0]: 13
|
||||
----------------------------------------------------------------
|
||||
0. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_Ultra-IPC.mk
|
||||
0. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_86Panel-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_86Panel
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
1. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_86Panel_W-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_86Panel_W
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
2. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_Pi-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pi
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
3. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_Pi_W-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pi_W
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
4. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_Ultra-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Ultra
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
1. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_Ultra_W-IPC.mk
|
||||
5. BoardConfig_IPC/BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_Ultra_W-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Ultra_W
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
2. BoardConfig_IPC/BoardConfig-EMMC-Ubuntu-RV1106_Luckfox_Pico_Ultra-IPC.mk
|
||||
6. BoardConfig_IPC/BoardConfig-EMMC-Busybox-RV1106_Luckfox_Pico_Ultra-IPC_FASTBOOT.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Ubuntu
|
||||
system version(系统版本): Busybox
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Ultra
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC_FASTBOOT
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
3. BoardConfig_IPC/BoardConfig-EMMC-Ubuntu-RV1106_Luckfox_Pico_Ultra_W-IPC.mk
|
||||
boot medium(启动介质): EMMC
|
||||
system version(系统版本): Ubuntu
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Ultra_W
|
||||
applicaton(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
4. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico-IPC.mk
|
||||
7. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
5. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_Mini_A-IPC.mk
|
||||
8. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_Mini_A-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Mini_A
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
6. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_Mini_B-IPC.mk
|
||||
9. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_Mini_B-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Mini_B
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
7. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_Plus-IPC.mk
|
||||
10. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_Plus-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Plus
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
8. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1106_Luckfox_Pico_Pro_Max-IPC.mk
|
||||
11. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico_WebBee-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pro_Max
|
||||
applicaton(应用场景): IPC
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_WebBee
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
9. BoardConfig_IPC/BoardConfig-SD_CARD-Ubuntu-RV1103_Luckfox_Pico-IPC.mk
|
||||
12. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1106_Luckfox_Pico_Max-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Ubuntu
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico
|
||||
applicaton(应用场景): IPC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Max
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
10. BoardConfig_IPC/BoardConfig-SD_CARD-Ubuntu-RV1103_Luckfox_Pico_Mini_A-IPC.mk
|
||||
13. BoardConfig_IPC/BoardConfig-SD_CARD-Buildroot-RV1106_Luckfox_Pico_Pro-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Ubuntu
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Mini_A
|
||||
applicaton(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
11. BoardConfig_IPC/BoardConfig-SD_CARD-Ubuntu-RV1103_Luckfox_Pico_Mini_B-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Ubuntu
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Mini_B
|
||||
applicaton(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
12. BoardConfig_IPC/BoardConfig-SD_CARD-Ubuntu-RV1103_Luckfox_Pico_Plus-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Ubuntu
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Plus
|
||||
applicaton(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
13. BoardConfig_IPC/BoardConfig-SD_CARD-Ubuntu-RV1106_Luckfox_Pico_Pro_Max-IPC.mk
|
||||
boot medium(启动介质): SD_CARD
|
||||
system version(系统版本): Ubuntu
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pro_Max
|
||||
applicaton(应用场景): IPC
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pro
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
@@ -250,7 +256,7 @@ kernelconfig -config kernel and save defconfig"
|
||||
boot medium(启动介质): SPI_NAND
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Mini_B
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
@@ -258,18 +264,40 @@ kernelconfig -config kernel and save defconfig"
|
||||
boot medium(启动介质): SPI_NAND
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_Plus
|
||||
applicaton(应用场景): IPC
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
16. BoardConfig_IPC/BoardConfig-SPI_NAND-Buildroot-RV1106_Luckfox_Pico_Pro_Max-IPC.mk
|
||||
16. BoardConfig_IPC/BoardConfig-SPI_NAND-Buildroot-RV1103_Luckfox_Pico_WebBee-IPC.mk
|
||||
boot medium(启动介质): SPI_NAND
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pro_Max
|
||||
applicaton(应用场景): IPC
|
||||
hardware version(硬件版本): RV1103_Luckfox_Pico_WebBee
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
Which would you like? [default:0]:
|
||||
----------------------------------------------------------------
|
||||
17. BoardConfig_IPC/BoardConfig-SPI_NAND-Buildroot-RV1106_Luckfox_Pico_Max-IPC.mk
|
||||
boot medium(启动介质): SPI_NAND
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Max
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
18. BoardConfig_IPC/BoardConfig-SPI_NAND-Buildroot-RV1106_Luckfox_Pico_Pro-IPC.mk
|
||||
boot medium(启动介质): SPI_NAND
|
||||
system version(系统版本): Buildroot
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pro
|
||||
application(应用场景): IPC
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
19. BoardConfig_IPC/BoardConfig-SPI_NAND-Busybox-RV1106_Luckfox_Pico_Pro_Max-IPC_FASTBOOT.mk
|
||||
boot medium(启动介质): SPI_NAND
|
||||
system version(系统版本): Busybox
|
||||
hardware version(硬件版本): RV1106_Luckfox_Pico_Pro_Max
|
||||
application(应用场景): IPC_FASTBOOT
|
||||
----------------------------------------------------------------
|
||||
```
|
||||
输入对应的板级支持文件序号完成配置
|
||||
#### 设置 Buildroot 系统默认 WIFI 配置
|
||||
@@ -289,13 +317,6 @@ kernelconfig -config kernel and save defconfig"
|
||||
./build.sh lunch # 选择参考板级
|
||||
./build.sh # 一键自动编译
|
||||
```
|
||||
* 编译ubuntu
|
||||
```shell
|
||||
sudo ./build.sh lunch # 选择参考板级
|
||||
sudo ./build.sh # 一键自动编译
|
||||
```
|
||||
* 注意编译ubuntu时需要注意使用sudo,否则会导致文件系统错误
|
||||
* 下文就不一一区分两者指令区别,请自行根据情况选择
|
||||
#### 单独编译U-Boot
|
||||
```shell
|
||||
./build.sh clean uboot
|
||||
|
||||
@@ -106,9 +106,9 @@ post_chk() {
|
||||
echo "Error: not found rkipc.ini !!!"
|
||||
exit -1
|
||||
fi
|
||||
if [ ! -f "$rkipc_ini" ]; then
|
||||
#if [ ! -f "$rkipc_ini" ]; then
|
||||
cp $default_rkipc_ini $rkipc_ini -f
|
||||
fi
|
||||
#fi
|
||||
|
||||
if [ ! -f "/userdata/image.bmp" ]; then
|
||||
cp -fa /oem/usr/share/image.bmp /userdata/
|
||||
|
||||
@@ -114,9 +114,9 @@ post_chk() {
|
||||
echo "Error: not found rkipc.ini !!!"
|
||||
exit -1
|
||||
fi
|
||||
if [ ! -f "$rkipc_ini" ]; then
|
||||
#if [ ! -f "$rkipc_ini" ]; then
|
||||
cp $default_rkipc_ini $rkipc_ini -f
|
||||
fi
|
||||
#fi
|
||||
|
||||
if [ ! -f "/userdata/image.bmp" ]; then
|
||||
cp -fa /oem/usr/share/image.bmp /userdata/
|
||||
|
||||
@@ -40,7 +40,6 @@ SDK_CONFIG_DIR=${SDK_ROOT_DIR}/config
|
||||
DTS_CONFIG=${SDK_CONFIG_DIR}/dts_config
|
||||
KERNEL_DEFCONFIG=${SDK_CONFIG_DIR}/kernel_defconfig
|
||||
BUILDROOT_DEFCONFIG=${SDK_CONFIG_DIR}/buildroot_defconfig
|
||||
UBUNTU_DIR=${SDK_SYSDRV_DIR}/tools/board/ubuntu
|
||||
KERNEL_PATH=${SDK_SYSDRV_DIR}/source/kernel
|
||||
UBOOT_PATH=${SDK_SYSDRV_DIR}/source/uboot/u-boot
|
||||
#for custom rootfs
|
||||
@@ -159,9 +158,11 @@ function choose_target_board() {
|
||||
"RV1106_Luckfox_Pico_Ultra"
|
||||
"RV1106_Luckfox_Pico_Ultra_W"
|
||||
"RV1106_Luckfox_Pico_Pi"
|
||||
"RV1106_Luckfox_Pico_Pi_W")
|
||||
"RV1106_Luckfox_Pico_Pi_W"
|
||||
"RV1106_Luckfox_Pico_86Panel"
|
||||
"RV1106_Luckfox_Pico_86Panel_W")
|
||||
local LF_BOOT_MEDIA=("SD_CARD" "SPI_NAND" "EMMC")
|
||||
local LF_SYSTEM=("Buildroot" "Ubuntu" "Custom")
|
||||
local LF_SYSTEM=("Buildroot" "Custom")
|
||||
local cnt=0 space8=" "
|
||||
|
||||
# Get Hardware Version
|
||||
@@ -193,6 +194,10 @@ function choose_target_board() {
|
||||
LUNCH_NUM=$((LUNCH_NUM + 1))
|
||||
echo "${space8}${space8}[${LUNCH_NUM}] RV1106_Luckfox_Pico_Pi_W"
|
||||
LUNCH_NUM=$((LUNCH_NUM + 1))
|
||||
echo "${space8}${space8}[${LUNCH_NUM}] RV1106_Luckfox_Pico_86Panel"
|
||||
LUNCH_NUM=$((LUNCH_NUM + 1))
|
||||
echo "${space8}${space8}[${LUNCH_NUM}] RV1106_Luckfox_Pico_86Panel_W"
|
||||
LUNCH_NUM=$((LUNCH_NUM + 1))
|
||||
echo "${space8}${space8}[${LUNCH_NUM}] custom"
|
||||
|
||||
read -p "Which would you like? [0~${LUNCH_NUM}][default:0]: " HW_INDEX
|
||||
@@ -277,7 +282,7 @@ function choose_target_board() {
|
||||
|
||||
range_sd_card=(0 1)
|
||||
range_sd_card_spi_nand=(2 3 4 5 6)
|
||||
range_emmc=(7 8 9 10)
|
||||
range_emmc=(7 8 9 10 11 12)
|
||||
|
||||
if __IS_IN_ARRAY "$HW_INDEX" "${range_sd_card[@]}"; then
|
||||
echo "${space8}${space8}[0] SD_CARD"
|
||||
@@ -319,12 +324,11 @@ function choose_target_board() {
|
||||
|
||||
if (("$BM_INDEX" == 1)); then
|
||||
echo "${space8}${space8}[0] Buildroot "
|
||||
read -p "Which would you like? [0~1][default:0]: " SYS_INDEX
|
||||
read -p "Which would you like? [0][default:0]: " SYS_INDEX
|
||||
MAX_SYS_INDEX=0
|
||||
elif (("$BM_INDEX" == 0)); then
|
||||
echo "${space8}${space8}[0] Buildroot "
|
||||
echo "${space8}${space8}[1] Ubuntu "
|
||||
read -p "Which would you like? [0~1][default:0]: " SYS_INDEX
|
||||
read -p "Which would you like? [0][default:0]: " SYS_INDEX
|
||||
MAX_SYS_INDEX=1
|
||||
fi
|
||||
|
||||
@@ -353,7 +357,7 @@ function choose_target_board() {
|
||||
function build_select_board() {
|
||||
RK_TARGET_BOARD_ARRAY=($(
|
||||
cd ${TARGET_PRODUCT_DIR}/
|
||||
ls BoardConfig*.mk BoardConfig_*/BoardConfig*.mk | sort
|
||||
ls BoardConfig_*/BoardConfig*.mk | sort
|
||||
))
|
||||
|
||||
RK_TARGET_BOARD_ARRAY_LEN=${#RK_TARGET_BOARD_ARRAY[@]}
|
||||
@@ -592,7 +596,7 @@ function build_check_power_domain() {
|
||||
|
||||
function build_tool() {
|
||||
test -d ${SDK_SYSDRV_DIR} && make pctools -C ${SDK_SYSDRV_DIR}
|
||||
if [ $LF_ENABLE_SPI_NAND_FAST_BOOT = "y" ]; then
|
||||
if [ $LF_ENABLE_SPI_NAND_FAST_BOOT == "y" ]; then
|
||||
cp -fa $PROJECT_TOP_DIR/sfc_scripts/mk-fitimage.sh $RK_PROJECT_PATH_PC_TOOLS
|
||||
cp -fa $PROJECT_TOP_DIR/sfc_scripts/compress_tool $RK_PROJECT_PATH_PC_TOOLS
|
||||
cp -fa $PROJECT_TOP_DIR/sfc_scripts/mk-tftp_sd_update.sh $RK_PROJECT_PATH_PC_TOOLS
|
||||
@@ -1506,12 +1510,6 @@ function __PACKAGE_ROOTFS() {
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$RK_BOOT_MEDIUM" == "emmc" ] && [ "$LF_TARGET_ROOTFS" == "ubuntu" ]; then
|
||||
if [ -f $WIFI_CONF ]; then
|
||||
cp $WIFI_CONF $RK_PROJECT_PACKAGE_ROOTFS_DIR/etc
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$LF_TARGET_ROOTFS" == "buildroot" ] || [ "$LF_TARGET_ROOTFS" == "busybox" ]; then
|
||||
build_get_sdk_version
|
||||
cat >$RK_PROJECT_PACKAGE_ROOTFS_DIR/bin/sdkinfo <<EOF
|
||||
@@ -2159,9 +2157,6 @@ __GET_BOOTARGS_FROM_BOARD_CFG() {
|
||||
|
||||
__LINK_DEFCONFIG_FROM_BOARD_CFG() {
|
||||
mkdir -p ${SDK_CONFIG_DIR}
|
||||
if [[ "$LF_TARGET_ROOTFS" == "ubuntu" ]]; then
|
||||
sudo chmod a+rw $SDK_CONFIG_DIR
|
||||
fi
|
||||
|
||||
if [ -n "$RK_KERNEL_DTS" ]; then
|
||||
rm -f $DTS_CONFIG
|
||||
@@ -2229,7 +2224,7 @@ function build_mkimg() {
|
||||
fs_type="\$${fs_type}"
|
||||
fs_type=$(eval "echo ${fs_type}")
|
||||
|
||||
if [ "$LF_TARGET_ROOTFS" == "buildroot" ] || [ "$LF_TARGT_ROOTFS" == "busybox" ]; then
|
||||
if [ "$LF_TARGET_ROOTFS" == "buildroot" ] || [ "$LF_TARGET_ROOTFS" == "busybox" ]; then
|
||||
__RELEASE_FILESYSTEM_FILES $src
|
||||
fi
|
||||
|
||||
@@ -2658,9 +2653,6 @@ function build_save() {
|
||||
build_info >>$STUB_PATH/build_info.txt
|
||||
echo "save to $STUB_PATH"
|
||||
|
||||
if [[ "$LF_TARGET_ROOTFS" == "ubuntu" ]]; then
|
||||
sudo chmod a+rw $STUB_PARENT_PATH
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -2753,29 +2745,6 @@ export RK_PROJECT_BOARD_DIR=$(dirname $(realpath $BOARD_CONFIG))
|
||||
export RK_PROJECT_TOOLCHAIN_CROSS=$RK_TOOLCHAIN_CROSS
|
||||
export PATH="${SDK_ROOT_DIR}/tools/linux/toolchain/${RK_PROJECT_TOOLCHAIN_CROSS}/bin":$PATH
|
||||
|
||||
if [[ "$LF_TARGET_ROOTFS" = "ubuntu" ]]; then
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
msg_error "Error! Please use sudo ./build.sh to build Ubuntu Image!"
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$LF_SUBMODULES_BY" = "github" ]]; then
|
||||
cp ${SDK_ROOT_DIR}/.gitmodules.github ${SDK_ROOT_DIR}/.gitmodules
|
||||
else
|
||||
if [[ "$LF_SUBMODULES_BY" = "gitee" ]]; then
|
||||
cp ${SDK_ROOT_DIR}/.gitmodules.gitee ${SDK_ROOT_DIR}/.gitmodules
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d "$UBUNTU_DIR" ] && [ -f ${UBUNTU_DIR}/luckfox-ubuntu-22.04.3.tar.gz.md5 ]; then
|
||||
msg_info "${UBUNTU_DIR} is not empty, skipping submodule update!"
|
||||
else
|
||||
msg_info "${UBUNTU_DIR} is empty or does not exist, updateing submodule!"
|
||||
git submodule update --init --recursive
|
||||
fi
|
||||
fi
|
||||
|
||||
if echo $@ | grep -wqE "help|-h"; then
|
||||
if [ -n "$2" -a "$(type -t usage$2)" == function ]; then
|
||||
echo "###Current Configure [ $2 ] Build Command###"
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
#################################################
|
||||
# Board Config
|
||||
#################################################
|
||||
export LF_ORIGIN_BOARD_CONFIG=BoardConfig-EMMC-Ubuntu-RV1106_Luckfox_Pico_Pi-IPC.mk
|
||||
export LF_ORIGIN_BOARD_CONFIG=BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_86Panel-IPC.mk
|
||||
# Target CHIP
|
||||
export RK_CHIP=rv1106
|
||||
|
||||
# app config
|
||||
# export RK_APP_TYPE=RKIPC_RV1106
|
||||
export RK_APP_TYPE=RK_WIFI_APP
|
||||
|
||||
# Config CMA size in environment
|
||||
export RK_BOOTARGS_CMA_SIZE="36M"
|
||||
export RK_BOOTARGS_CMA_SIZE="1M"
|
||||
|
||||
# Kernel dts
|
||||
export RK_KERNEL_DTS=rv1106g-luckfox-pico-pi.dts
|
||||
export RK_KERNEL_DTS=rv1106g-luckfox-pico-86panel.dts
|
||||
|
||||
#################################################
|
||||
# BOOT_MEDIUM
|
||||
@@ -59,10 +59,7 @@ export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ext4,userdata@/userdata@ext4,oem@/
|
||||
#################################################
|
||||
|
||||
# Target rootfs
|
||||
export LF_TARGET_ROOTFS=ubuntu
|
||||
|
||||
# SUBMODULES : github/gitee
|
||||
export LF_SUBMODULES_BY=github
|
||||
export LF_TARGET_ROOTFS=buildroot
|
||||
|
||||
# Buildroot defconfig
|
||||
export RK_BUILDROOT_DEFCONFIG=luckfox_pico_w_defconfig
|
||||
@@ -87,17 +84,17 @@ export RK_UBOOT_DEFCONFIG=luckfox_rv1106_uboot_defconfig
|
||||
export RK_KERNEL_DEFCONFIG=luckfox_rv1106_linux_defconfig
|
||||
|
||||
# Kernel defconfig fragment
|
||||
export RK_KERNEL_DEFCONFIG_FRAGMENT="rv1106-bt.config luckfox_rv1106-wwan-ndis-ppp.config"
|
||||
export RK_KERNEL_DEFCONFIG_FRAGMENT="rv1106-gt911-module.config"
|
||||
|
||||
# Config sensor IQ files
|
||||
# RK_CAMERA_SENSOR_IQFILES format:
|
||||
# "iqfile1 iqfile2 iqfile3 ..."
|
||||
# ./build.sh media and copy <SDK root dir>/output/out/media_out/isp_iqfiles/$RK_CAMERA_SENSOR_IQFILES
|
||||
export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json mis5001_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json mis5001_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json sc530ai_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
|
||||
# Config sensor lens CAC calibrattion bin files
|
||||
export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
|
||||
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
|
||||
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16 CAC_sc530ai_CMK-OT2115-PC1_30IRC-F16"
|
||||
|
||||
# build ipc web backend
|
||||
@@ -111,6 +108,11 @@ export RK_ENABLE_ROCKCHIP_TEST=y
|
||||
|
||||
# enable rockchip wifi
|
||||
#export RK_ENABLE_WIFI=y
|
||||
#export RK_ENABLE_WIFI_CHIP=AIC8800DC
|
||||
|
||||
# config wifi ssid and passwd
|
||||
#export LF_WIFI_SSID="Your wifi ssid"
|
||||
#export LF_WIFI_PSK="Your wifi password"
|
||||
|
||||
#################################################
|
||||
# PRE and POST
|
||||
@@ -119,11 +121,8 @@ export RK_ENABLE_ROCKCHIP_TEST=y
|
||||
# specify pre.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_OEM_SCRIPT=luckfox-buildroot-oem-pre.sh
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_USERDATA_SCRIPT=luckfox-userdata-pre.sh
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
export RK_POST_BUILD_SCRIPT=luckfox-ubuntu-off-modem-post.sh
|
||||
|
||||
# declare overlay directory
|
||||
export RK_POST_OVERLAY="overlay-luckfox-config overlay-luckfox-ubuntu-config overlay-luckfox-ubuntu-ultra overlay-luckfox-ubuntu-rockchip\
|
||||
overlay-luckfox-ppp overlay-luckfox-ubuntu-sim7600g"
|
||||
export RK_POST_OVERLAY="overlay-luckfox-buildroot-init overlay-luckfox-buildroot-shadow overlay-luckfox-buildroot-86panel"
|
||||
@@ -3,18 +3,18 @@
|
||||
#################################################
|
||||
# Board Config
|
||||
#################################################
|
||||
export LF_ORIGIN_BOARD_CONFIG=BoardConfig-EMMC-Ubuntu-RV1106_Luckfox_Pico_Ultra_W-IPC.mk
|
||||
export LF_ORIGIN_BOARD_CONFIG=BoardConfig-EMMC-Buildroot-RV1106_Luckfox_Pico_86Panel_W-IPC.mk
|
||||
# Target CHIP
|
||||
export RK_CHIP=rv1106
|
||||
|
||||
# app config
|
||||
# export RK_APP_TYPE=RKIPC_RV1106
|
||||
export RK_APP_TYPE=RK_WIFI_APP
|
||||
|
||||
# Config CMA size in environment
|
||||
export RK_BOOTARGS_CMA_SIZE="36M"
|
||||
export RK_BOOTARGS_CMA_SIZE="1M"
|
||||
|
||||
# Kernel dts
|
||||
export RK_KERNEL_DTS=rv1106g-luckfox-pico-ultra-w.dts
|
||||
export RK_KERNEL_DTS=rv1106g-luckfox-pico-86panel-w.dts
|
||||
|
||||
#################################################
|
||||
# BOOT_MEDIUM
|
||||
@@ -59,10 +59,7 @@ export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ext4,userdata@/userdata@ext4,oem@/
|
||||
#################################################
|
||||
|
||||
# Target rootfs
|
||||
export LF_TARGET_ROOTFS=ubuntu
|
||||
|
||||
# SUBMODULES : github/gitee
|
||||
export LF_SUBMODULES_BY=github
|
||||
export LF_TARGET_ROOTFS=buildroot
|
||||
|
||||
# Buildroot defconfig
|
||||
export RK_BUILDROOT_DEFCONFIG=luckfox_pico_w_defconfig
|
||||
@@ -87,17 +84,17 @@ export RK_UBOOT_DEFCONFIG=luckfox_rv1106_uboot_defconfig
|
||||
export RK_KERNEL_DEFCONFIG=luckfox_rv1106_linux_defconfig
|
||||
|
||||
# Kernel defconfig fragment
|
||||
export RK_KERNEL_DEFCONFIG_FRAGMENT=rv1106-bt.config
|
||||
export RK_KERNEL_DEFCONFIG_FRAGMENT="rv1106-bt.config rv1106-gt911-module.config"
|
||||
|
||||
# Config sensor IQ files
|
||||
# RK_CAMERA_SENSOR_IQFILES format:
|
||||
# "iqfile1 iqfile2 iqfile3 ..."
|
||||
# ./build.sh media and copy <SDK root dir>/output/out/media_out/isp_iqfiles/$RK_CAMERA_SENSOR_IQFILES
|
||||
export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json mis5001_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json mis5001_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json sc530ai_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
|
||||
# Config sensor lens CAC calibrattion bin files
|
||||
export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
|
||||
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
|
||||
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16 CAC_sc530ai_CMK-OT2115-PC1_30IRC-F16"
|
||||
|
||||
# build ipc web backend
|
||||
@@ -128,4 +125,4 @@ export RK_PRE_BUILD_OEM_SCRIPT=luckfox-buildroot-oem-pre.sh
|
||||
export RK_PRE_BUILD_USERDATA_SCRIPT=luckfox-userdata-pre.sh
|
||||
|
||||
# declare overlay directory
|
||||
export RK_POST_OVERLAY="overlay-luckfox-config overlay-luckfox-ubuntu-config overlay-luckfox-ubuntu-ultra overlay-luckfox-ubuntu-rockchip"
|
||||
export RK_POST_OVERLAY="overlay-luckfox-buildroot-init overlay-luckfox-buildroot-shadow overlay-luckfox-buildroot-86panel"
|
||||
@@ -1,134 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#################################################
|
||||
# Board Config
|
||||
#################################################
|
||||
export LF_ORIGIN_BOARD_CONFIG=BoardConfig-EMMC-Ubuntu-RV1106_Luckfox_Pico_Pi_W-IPC.mk
|
||||
# Target CHIP
|
||||
export RK_CHIP=rv1106
|
||||
|
||||
# app config
|
||||
# export RK_APP_TYPE=RKIPC_RV1106
|
||||
|
||||
# Config CMA size in environment
|
||||
export RK_BOOTARGS_CMA_SIZE="36M"
|
||||
|
||||
# Kernel dts
|
||||
export RK_KERNEL_DTS=rv1106g-luckfox-pico-pi-w.dts
|
||||
|
||||
#################################################
|
||||
# BOOT_MEDIUM
|
||||
#################################################
|
||||
|
||||
# Target boot medium
|
||||
export RK_BOOT_MEDIUM=emmc
|
||||
|
||||
# Uboot defconfig fragment
|
||||
export RK_UBOOT_DEFCONFIG_FRAGMENT=rk-emmc.config
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
# export RK_PRE_BUILD_OEM_SCRIPT=rv1103-spi_nor-post.sh
|
||||
|
||||
# config partition in environment
|
||||
# RK_PARTITION_CMD_IN_ENV format:
|
||||
# <partdef>[,<partdef>]
|
||||
# <partdef> := <size>[@<offset>](part-name)
|
||||
# Note:
|
||||
# If the first partition offset is not 0x0, it must be added. Otherwise, it needn't adding.
|
||||
export RK_PARTITION_CMD_IN_ENV="32K(env),512K@32K(idblock),256K(uboot),32M(boot),512M(oem),256M(userdata),6G(rootfs)"
|
||||
|
||||
# config partition's filesystem type (squashfs is readonly)
|
||||
# emmc: squashfs/ext4
|
||||
# nand: squashfs/ubifs
|
||||
# spi nor: squashfs/jffs2
|
||||
# RK_PARTITION_FS_TYPE_CFG format:
|
||||
# AAAA:/BBBB/CCCC@ext4
|
||||
# AAAA ----------> partition name
|
||||
# /BBBB/CCCC ----> partition mount point
|
||||
# ext4 ----------> partition filesystem type
|
||||
export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ext4,userdata@/userdata@ext4,oem@/oem@ext4
|
||||
|
||||
# config filesystem compress (Just for squashfs or ubifs)
|
||||
# squashfs: lz4/lzo/lzma/xz/gzip, default xz
|
||||
# ubifs: lzo/zlib, default lzo
|
||||
# export RK_SQUASHFS_COMP=xz
|
||||
# export RK_UBIFS_COMP=lzo
|
||||
|
||||
#################################################
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs
|
||||
export LF_TARGET_ROOTFS=ubuntu
|
||||
|
||||
# SUBMODULES : github/gitee
|
||||
export LF_SUBMODULES_BY=github
|
||||
|
||||
# Buildroot defconfig
|
||||
export RK_BUILDROOT_DEFCONFIG=luckfox_pico_w_defconfig
|
||||
|
||||
#################################################
|
||||
# Defconfig
|
||||
#################################################
|
||||
|
||||
# Target arch
|
||||
export RK_ARCH=arm
|
||||
|
||||
# Target Toolchain Cross Compile
|
||||
export RK_TOOLCHAIN_CROSS=arm-rockchip830-linux-uclibcgnueabihf
|
||||
|
||||
#misc image
|
||||
export RK_MISC=wipe_all-misc.img
|
||||
|
||||
# Uboot defconfig
|
||||
export RK_UBOOT_DEFCONFIG=luckfox_rv1106_uboot_defconfig
|
||||
|
||||
# Kernel defconfig
|
||||
export RK_KERNEL_DEFCONFIG=luckfox_rv1106_linux_defconfig
|
||||
|
||||
# Kernel defconfig fragment
|
||||
export RK_KERNEL_DEFCONFIG_FRAGMENT="rv1106-bt.config luckfox_rv1106-wwan-ndis-ppp.config"
|
||||
|
||||
# Config sensor IQ files
|
||||
# RK_CAMERA_SENSOR_IQFILES format:
|
||||
# "iqfile1 iqfile2 iqfile3 ..."
|
||||
# ./build.sh media and copy <SDK root dir>/output/out/media_out/isp_iqfiles/$RK_CAMERA_SENSOR_IQFILES
|
||||
export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json mis5001_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json sc530ai_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
|
||||
# Config sensor lens CAC calibrattion bin files
|
||||
export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
|
||||
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16 CAC_sc530ai_CMK-OT2115-PC1_30IRC-F16"
|
||||
|
||||
# build ipc web backend
|
||||
# export RK_APP_IPCWEB_BACKEND=y
|
||||
|
||||
# enable install app to oem partition
|
||||
export RK_BUILD_APP_TO_OEM_PARTITION=y
|
||||
|
||||
# enable rockchip test
|
||||
export RK_ENABLE_ROCKCHIP_TEST=y
|
||||
|
||||
# enable rockchip wifi
|
||||
export RK_ENABLE_WIFI=y
|
||||
export RK_ENABLE_WIFI_CHIP=AIC8800DC
|
||||
|
||||
# config wifi ssid and passwd
|
||||
export LF_WIFI_SSID="Your wifi ssid"
|
||||
export LF_WIFI_PSK="Your wifi password"
|
||||
|
||||
#################################################
|
||||
# PRE and POST
|
||||
#################################################
|
||||
|
||||
# specify pre.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_OEM_SCRIPT=luckfox-buildroot-oem-pre.sh
|
||||
|
||||
export RK_PRE_BUILD_USERDATA_SCRIPT=luckfox-userdata-pre.sh
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
export RK_POST_BUILD_SCRIPT=luckfox-ubuntu-off-modem-post.sh
|
||||
|
||||
# declare overlay directory
|
||||
export RK_POST_OVERLAY="overlay-luckfox-config overlay-luckfox-ubuntu-config overlay-luckfox-ubuntu-ultra overlay-luckfox-ubuntu-rockchip\
|
||||
overlay-luckfox-ppp overlay-luckfox-ubuntu-sim7600g"
|
||||
@@ -1,123 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#################################################
|
||||
# Board Config
|
||||
#################################################
|
||||
export LF_ORIGIN_BOARD_CONFIG=BoardConfig-EMMC-Ubuntu-RV1106_Luckfox_Pico_Ultra-IPC.mk
|
||||
# Target CHIP
|
||||
export RK_CHIP=rv1106
|
||||
|
||||
# app config
|
||||
# export RK_APP_TYPE=RKIPC_RV1106
|
||||
|
||||
# Config CMA size in environment
|
||||
export RK_BOOTARGS_CMA_SIZE="36M"
|
||||
|
||||
# Kernel dts
|
||||
export RK_KERNEL_DTS=rv1106g-luckfox-pico-ultra.dts
|
||||
|
||||
#################################################
|
||||
# BOOT_MEDIUM
|
||||
#################################################
|
||||
|
||||
# Target boot medium
|
||||
export RK_BOOT_MEDIUM=emmc
|
||||
|
||||
# Uboot defconfig fragment
|
||||
export RK_UBOOT_DEFCONFIG_FRAGMENT=rk-emmc.config
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
# export RK_PRE_BUILD_OEM_SCRIPT=rv1103-spi_nor-post.sh
|
||||
|
||||
# config partition in environment
|
||||
# RK_PARTITION_CMD_IN_ENV format:
|
||||
# <partdef>[,<partdef>]
|
||||
# <partdef> := <size>[@<offset>](part-name)
|
||||
# Note:
|
||||
# If the first partition offset is not 0x0, it must be added. Otherwise, it needn't adding.
|
||||
export RK_PARTITION_CMD_IN_ENV="32K(env),512K@32K(idblock),256K(uboot),32M(boot),512M(oem),256M(userdata),6G(rootfs)"
|
||||
|
||||
# config partition's filesystem type (squashfs is readonly)
|
||||
# emmc: squashfs/ext4
|
||||
# nand: squashfs/ubifs
|
||||
# spi nor: squashfs/jffs2
|
||||
# RK_PARTITION_FS_TYPE_CFG format:
|
||||
# AAAA:/BBBB/CCCC@ext4
|
||||
# AAAA ----------> partition name
|
||||
# /BBBB/CCCC ----> partition mount point
|
||||
# ext4 ----------> partition filesystem type
|
||||
export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ext4,userdata@/userdata@ext4,oem@/oem@ext4
|
||||
|
||||
# config filesystem compress (Just for squashfs or ubifs)
|
||||
# squashfs: lz4/lzo/lzma/xz/gzip, default xz
|
||||
# ubifs: lzo/zlib, default lzo
|
||||
# export RK_SQUASHFS_COMP=xz
|
||||
# export RK_UBIFS_COMP=lzo
|
||||
|
||||
#################################################
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs
|
||||
export LF_TARGET_ROOTFS=ubuntu
|
||||
|
||||
# SUBMODULES : github/gitee
|
||||
export LF_SUBMODULES_BY=github
|
||||
|
||||
# Buildroot defconfig
|
||||
export RK_BUILDROOT_DEFCONFIG=luckfox_pico_defconfig
|
||||
|
||||
#################################################
|
||||
# Defconfig
|
||||
#################################################
|
||||
|
||||
# Target arch
|
||||
export RK_ARCH=arm
|
||||
|
||||
# Target Toolchain Cross Compile
|
||||
export RK_TOOLCHAIN_CROSS=arm-rockchip830-linux-uclibcgnueabihf
|
||||
|
||||
#misc image
|
||||
export RK_MISC=wipe_all-misc.img
|
||||
|
||||
# Uboot defconfig
|
||||
export RK_UBOOT_DEFCONFIG=luckfox_rv1106_uboot_defconfig
|
||||
|
||||
# Kernel defconfig
|
||||
export RK_KERNEL_DEFCONFIG=luckfox_rv1106_linux_defconfig
|
||||
|
||||
# Config sensor IQ files
|
||||
# RK_CAMERA_SENSOR_IQFILES format:
|
||||
# "iqfile1 iqfile2 iqfile3 ..."
|
||||
# ./build.sh media and copy <SDK root dir>/output/out/media_out/isp_iqfiles/$RK_CAMERA_SENSOR_IQFILES
|
||||
export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json mis5001_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json sc530ai_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
|
||||
# Config sensor lens CAC calibrattion bin files
|
||||
export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
|
||||
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16 CAC_sc530ai_CMK-OT2115-PC1_30IRC-F16"
|
||||
|
||||
# build ipc web backend
|
||||
# export RK_APP_IPCWEB_BACKEND=y
|
||||
|
||||
# enable install app to oem partition
|
||||
export RK_BUILD_APP_TO_OEM_PARTITION=y
|
||||
|
||||
# enable rockchip test
|
||||
export RK_ENABLE_ROCKCHIP_TEST=y
|
||||
|
||||
# enable rockchip wifi
|
||||
#export RK_ENABLE_WIFI=y
|
||||
|
||||
#################################################
|
||||
# PRE and POST
|
||||
#################################################
|
||||
|
||||
# specify pre.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_OEM_SCRIPT=luckfox-buildroot-oem-pre.sh
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_USERDATA_SCRIPT=luckfox-userdata-pre.sh
|
||||
|
||||
# declare overlay directory
|
||||
export RK_POST_OVERLAY="overlay-luckfox-config overlay-luckfox-ubuntu-config overlay-luckfox-ubuntu-ultra overlay-luckfox-ubuntu-rockchip"
|
||||
@@ -1,120 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#################################################
|
||||
# Board Config
|
||||
#################################################
|
||||
export LF_ORIGIN_BOARD_CONFIG=BoardConfig-SD_CARD-Ubuntu-RV1103_Luckfox_Pico-IPC.mk
|
||||
# Target CHIP
|
||||
export RK_CHIP=rv1106
|
||||
|
||||
# app config
|
||||
# export RK_APP_TYPE=RKIPC_RV1103
|
||||
|
||||
# Config CMA size in environment
|
||||
export RK_BOOTARGS_CMA_SIZE="1M"
|
||||
|
||||
# Kernel dts
|
||||
export RK_KERNEL_DTS=rv1103g-luckfox-pico.dts
|
||||
|
||||
#################################################
|
||||
# BOOT_MEDIUM
|
||||
#################################################
|
||||
|
||||
# Target boot medium
|
||||
export RK_BOOT_MEDIUM=sd_card
|
||||
|
||||
# Uboot defconfig fragment
|
||||
export RK_UBOOT_DEFCONFIG_FRAGMENT=rk-emmc.config
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
# export RK_PRE_BUILD_OEM_SCRIPT=rv1103-spi_nor-post.sh
|
||||
|
||||
# config partition in environment
|
||||
# RK_PARTITION_CMD_IN_ENV format:
|
||||
# <partdef>[,<partdef>]
|
||||
# <partdef> := <size>[@<offset>](part-name)
|
||||
# Note:
|
||||
# If the first partition offset is not 0x0, it must be added. Otherwise, it needn't adding.
|
||||
export RK_PARTITION_CMD_IN_ENV="32K(env),512K@32K(idblock),256K(uboot),32M(boot),512M(oem),256M(userdata),6G(rootfs)"
|
||||
|
||||
# config partition's filesystem type (squashfs is readonly)
|
||||
# emmc: squashfs/ext4
|
||||
# nand: squashfs/ubifs
|
||||
# spi nor: squashfs/jffs2
|
||||
# RK_PARTITION_FS_TYPE_CFG format:
|
||||
# AAAA:/BBBB/CCCC@ext4
|
||||
# AAAA ----------> partition name
|
||||
# /BBBB/CCCC ----> partition mount point
|
||||
# ext4 ----------> partition filesystem type
|
||||
export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ext4,userdata@/userdata@ext4,oem@/oem@ext4
|
||||
|
||||
# config filesystem compress (Just for squashfs or ubifs)
|
||||
# squashfs: lz4/lzo/lzma/xz/gzip, default xz
|
||||
# ubifs: lzo/zlib, default lzo
|
||||
# export RK_SQUASHFS_COMP=xz
|
||||
# export RK_UBIFS_COMP=lzo
|
||||
|
||||
#################################################
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs
|
||||
export LF_TARGET_ROOTFS=ubuntu
|
||||
|
||||
# SUBMODULES : github/gitee
|
||||
export LF_SUBMODULES_BY=github
|
||||
|
||||
# Buildroot defconfig
|
||||
export RK_BUILDROOT_DEFCONFIG=luckfox_pico_defconfig
|
||||
|
||||
#################################################
|
||||
# Defconfig
|
||||
#################################################
|
||||
|
||||
# Target arch
|
||||
export RK_ARCH=arm
|
||||
|
||||
# Target Toolchain Cross Compile
|
||||
export RK_TOOLCHAIN_CROSS=arm-rockchip830-linux-uclibcgnueabihf
|
||||
|
||||
#misc image
|
||||
export RK_MISC=wipe_all-misc.img
|
||||
|
||||
# Uboot defconfig
|
||||
export RK_UBOOT_DEFCONFIG=luckfox_rv1106_uboot_defconfig
|
||||
|
||||
# Kernel defconfig
|
||||
export RK_KERNEL_DEFCONFIG=luckfox_rv1106_linux_defconfig
|
||||
|
||||
# Config sensor IQ files
|
||||
# RK_CAMERA_SENSOR_IQFILES format:
|
||||
# "iqfile1 iqfile2 iqfile3 ..."
|
||||
# ./build.sh media and copy <SDK root dir>/output/out/media_out/isp_iqfiles/$RK_CAMERA_SENSOR_IQFILES
|
||||
export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json"
|
||||
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json sc530ai_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
|
||||
# Config sensor lens CAC calibrattion bin files
|
||||
export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
|
||||
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16 CAC_sc530ai_CMK-OT2115-PC1_30IRC-F16"
|
||||
|
||||
# build ipc web backend
|
||||
# export RK_APP_IPCWEB_BACKEND=y
|
||||
|
||||
# enable install app to oem partition
|
||||
export RK_BUILD_APP_TO_OEM_PARTITION=y
|
||||
|
||||
# enable rockchip test
|
||||
export RK_ENABLE_ROCKCHIP_TEST=y
|
||||
|
||||
#################################################
|
||||
# PRE and POST
|
||||
#################################################
|
||||
|
||||
# specify pre.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_OEM_SCRIPT=luckfox-ubuntu-oem-pre.sh
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_USERDATA_SCRIPT=luckfox-userdata-pre.sh
|
||||
|
||||
# declare overlay directory
|
||||
export RK_POST_OVERLAY="overlay-luckfox-config overlay-luckfox-ubuntu overlay-luckfox-ubuntu-config"
|
||||
@@ -1,120 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#################################################
|
||||
# Board Config
|
||||
#################################################
|
||||
export LF_ORIGIN_BOARD_CONFIG=BoardConfig-SD_CARD-Ubuntu-RV1103_Luckfox_Pico_Mini_A-IPC.mk
|
||||
# Target CHIP
|
||||
export RK_CHIP=rv1106
|
||||
|
||||
# app config
|
||||
# export RK_APP_TYPE=RKIPC_RV1103
|
||||
|
||||
# Config CMA size in environment
|
||||
export RK_BOOTARGS_CMA_SIZE="1M"
|
||||
|
||||
# Kernel dts
|
||||
export RK_KERNEL_DTS=rv1103g-luckfox-pico-mini.dts
|
||||
|
||||
#################################################
|
||||
# BOOT_MEDIUM
|
||||
#################################################
|
||||
|
||||
# Target boot medium
|
||||
export RK_BOOT_MEDIUM=sd_card
|
||||
|
||||
# Uboot defconfig fragment
|
||||
export RK_UBOOT_DEFCONFIG_FRAGMENT=rk-emmc.config
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
# export RK_PRE_BUILD_OEM_SCRIPT=rv1103-spi_nor-post.sh
|
||||
|
||||
# config partition in environment
|
||||
# RK_PARTITION_CMD_IN_ENV format:
|
||||
# <partdef>[,<partdef>]
|
||||
# <partdef> := <size>[@<offset>](part-name)
|
||||
# Note:
|
||||
# If the first partition offset is not 0x0, it must be added. Otherwise, it needn't adding.
|
||||
export RK_PARTITION_CMD_IN_ENV="32K(env),512K@32K(idblock),256K(uboot),32M(boot),512M(oem),256M(userdata),6G(rootfs)"
|
||||
|
||||
# config partition's filesystem type (squashfs is readonly)
|
||||
# emmc: squashfs/ext4
|
||||
# nand: squashfs/ubifs
|
||||
# spi nor: squashfs/jffs2
|
||||
# RK_PARTITION_FS_TYPE_CFG format:
|
||||
# AAAA:/BBBB/CCCC@ext4
|
||||
# AAAA ----------> partition name
|
||||
# /BBBB/CCCC ----> partition mount point
|
||||
# ext4 ----------> partition filesystem type
|
||||
export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ext4,userdata@/userdata@ext4,oem@/oem@ext4
|
||||
|
||||
# config filesystem compress (Just for squashfs or ubifs)
|
||||
# squashfs: lz4/lzo/lzma/xz/gzip, default xz
|
||||
# ubifs: lzo/zlib, default lzo
|
||||
# export RK_SQUASHFS_COMP=xz
|
||||
# export RK_UBIFS_COMP=lzo
|
||||
|
||||
#################################################
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs
|
||||
export LF_TARGET_ROOTFS=ubuntu
|
||||
|
||||
# SUBMODULES : github/gitee
|
||||
export LF_SUBMODULES_BY=github
|
||||
|
||||
# Buildroot defconfig
|
||||
export RK_BUILDROOT_DEFCONFIG=luckfox_pico_defconfig
|
||||
|
||||
#################################################
|
||||
# Defconfig
|
||||
#################################################
|
||||
|
||||
# Target arch
|
||||
export RK_ARCH=arm
|
||||
|
||||
# Target Toolchain Cross Compile
|
||||
export RK_TOOLCHAIN_CROSS=arm-rockchip830-linux-uclibcgnueabihf
|
||||
|
||||
#misc image
|
||||
export RK_MISC=wipe_all-misc.img
|
||||
|
||||
# Uboot defconfig
|
||||
export RK_UBOOT_DEFCONFIG=luckfox_rv1106_uboot_defconfig
|
||||
|
||||
# Kernel defconfig
|
||||
export RK_KERNEL_DEFCONFIG=luckfox_rv1106_linux_defconfig
|
||||
|
||||
# Config sensor IQ files
|
||||
# RK_CAMERA_SENSOR_IQFILES format:
|
||||
# "iqfile1 iqfile2 iqfile3 ..."
|
||||
# ./build.sh media and copy <SDK root dir>/output/out/media_out/isp_iqfiles/$RK_CAMERA_SENSOR_IQFILES
|
||||
export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json"
|
||||
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json sc530ai_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
|
||||
# Config sensor lens CAC calibrattion bin files
|
||||
export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
|
||||
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16 CAC_sc530ai_CMK-OT2115-PC1_30IRC-F16"
|
||||
|
||||
# build ipc web backend
|
||||
# export RK_APP_IPCWEB_BACKEND=y
|
||||
|
||||
# enable install app to oem partition
|
||||
export RK_BUILD_APP_TO_OEM_PARTITION=y
|
||||
|
||||
# enable rockchip test
|
||||
export RK_ENABLE_ROCKCHIP_TEST=y
|
||||
|
||||
#################################################
|
||||
# PRE and POST
|
||||
#################################################
|
||||
|
||||
# specify pre.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_OEM_SCRIPT=luckfox-ubuntu-oem-pre.sh
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_USERDATA_SCRIPT=luckfox-userdata-pre.sh
|
||||
|
||||
# declare overlay directory
|
||||
export RK_POST_OVERLAY="overlay-luckfox-config overlay-luckfox-ubuntu overlay-luckfox-ubuntu-config"
|
||||
@@ -1,120 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#################################################
|
||||
# Board Config
|
||||
#################################################
|
||||
export LF_ORIGIN_BOARD_CONFIG=BoardConfig-SD_CARD-Ubuntu-RV1103_Luckfox_Pico_Mini_B-IPC.mk
|
||||
# Target CHIP
|
||||
export RK_CHIP=rv1106
|
||||
|
||||
# app config
|
||||
# export RK_APP_TYPE=RKIPC_RV1103
|
||||
|
||||
# Config CMA size in environment
|
||||
export RK_BOOTARGS_CMA_SIZE="1M"
|
||||
|
||||
# Kernel dts
|
||||
export RK_KERNEL_DTS=rv1103g-luckfox-pico-mini.dts
|
||||
|
||||
#################################################
|
||||
# BOOT_MEDIUM
|
||||
#################################################
|
||||
|
||||
# Target boot medium
|
||||
export RK_BOOT_MEDIUM=sd_card
|
||||
|
||||
# Uboot defconfig fragment
|
||||
export RK_UBOOT_DEFCONFIG_FRAGMENT=rk-emmc.config
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
# export RK_PRE_BUILD_OEM_SCRIPT=rv1103-spi_nor-post.sh
|
||||
|
||||
# config partition in environment
|
||||
# RK_PARTITION_CMD_IN_ENV format:
|
||||
# <partdef>[,<partdef>]
|
||||
# <partdef> := <size>[@<offset>](part-name)
|
||||
# Note:
|
||||
# If the first partition offset is not 0x0, it must be added. Otherwise, it needn't adding.
|
||||
export RK_PARTITION_CMD_IN_ENV="32K(env),512K@32K(idblock),256K(uboot),32M(boot),512M(oem),256M(userdata),6G(rootfs)"
|
||||
|
||||
# config partition's filesystem type (squashfs is readonly)
|
||||
# emmc: squashfs/ext4
|
||||
# nand: squashfs/ubifs
|
||||
# spi nor: squashfs/jffs2
|
||||
# RK_PARTITION_FS_TYPE_CFG format:
|
||||
# AAAA:/BBBB/CCCC@ext4
|
||||
# AAAA ----------> partition name
|
||||
# /BBBB/CCCC ----> partition mount point
|
||||
# ext4 ----------> partition filesystem type
|
||||
export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ext4,userdata@/userdata@ext4,oem@/oem@ext4
|
||||
|
||||
# config filesystem compress (Just for squashfs or ubifs)
|
||||
# squashfs: lz4/lzo/lzma/xz/gzip, default xz
|
||||
# ubifs: lzo/zlib, default lzo
|
||||
# export RK_SQUASHFS_COMP=xz
|
||||
# export RK_UBIFS_COMP=lzo
|
||||
|
||||
#################################################
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs
|
||||
export LF_TARGET_ROOTFS=ubuntu
|
||||
|
||||
# SUBMODULES : github/gitee
|
||||
export LF_SUBMODULES_BY=github
|
||||
|
||||
# Buildroot defconfig
|
||||
export RK_BUILDROOT_DEFCONFIG=luckfox_pico_defconfig
|
||||
|
||||
#################################################
|
||||
# Defconfig
|
||||
#################################################
|
||||
|
||||
# Target arch
|
||||
export RK_ARCH=arm
|
||||
|
||||
# Target Toolchain Cross Compile
|
||||
export RK_TOOLCHAIN_CROSS=arm-rockchip830-linux-uclibcgnueabihf
|
||||
|
||||
#misc image
|
||||
export RK_MISC=wipe_all-misc.img
|
||||
|
||||
# Uboot defconfig
|
||||
export RK_UBOOT_DEFCONFIG=luckfox_rv1106_uboot_defconfig
|
||||
|
||||
# Kernel defconfig
|
||||
export RK_KERNEL_DEFCONFIG=luckfox_rv1106_linux_defconfig
|
||||
|
||||
# Config sensor IQ files
|
||||
# RK_CAMERA_SENSOR_IQFILES format:
|
||||
# "iqfile1 iqfile2 iqfile3 ..."
|
||||
# ./build.sh media and copy <SDK root dir>/output/out/media_out/isp_iqfiles/$RK_CAMERA_SENSOR_IQFILES
|
||||
export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json"
|
||||
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json sc530ai_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
|
||||
# Config sensor lens CAC calibrattion bin files
|
||||
export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
|
||||
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16 CAC_sc530ai_CMK-OT2115-PC1_30IRC-F16"
|
||||
|
||||
# build ipc web backend
|
||||
# export RK_APP_IPCWEB_BACKEND=y
|
||||
|
||||
# enable install app to oem partition
|
||||
export RK_BUILD_APP_TO_OEM_PARTITION=y
|
||||
|
||||
# enable rockchip test
|
||||
export RK_ENABLE_ROCKCHIP_TEST=y
|
||||
|
||||
#################################################
|
||||
# PRE and POST
|
||||
#################################################
|
||||
|
||||
# specify pre.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_OEM_SCRIPT=luckfox-ubuntu-oem-pre.sh
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_USERDATA_SCRIPT=luckfox-userdata-pre.sh
|
||||
|
||||
# declare overlay directory
|
||||
export RK_POST_OVERLAY="overlay-luckfox-config overlay-luckfox-ubuntu overlay-luckfox-ubuntu-config"
|
||||
@@ -1,120 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#################################################
|
||||
# Board Config
|
||||
#################################################
|
||||
export LF_ORIGIN_BOARD_CONFIG=BoardConfig-SD_CARD-Ubuntu-RV1103_Luckfox_Pico_Plus-IPC.mk
|
||||
# Target CHIP
|
||||
export RK_CHIP=rv1106
|
||||
|
||||
# app config
|
||||
# export RK_APP_TYPE=RKIPC_RV1103
|
||||
|
||||
# Config CMA size in environment
|
||||
export RK_BOOTARGS_CMA_SIZE="1M"
|
||||
|
||||
# Kernel dts
|
||||
export RK_KERNEL_DTS=rv1103g-luckfox-pico-plus.dts
|
||||
|
||||
#################################################
|
||||
# BOOT_MEDIUM
|
||||
#################################################
|
||||
|
||||
# Target boot medium
|
||||
export RK_BOOT_MEDIUM=sd_card
|
||||
|
||||
# Uboot defconfig fragment
|
||||
export RK_UBOOT_DEFCONFIG_FRAGMENT=rk-emmc.config
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
# export RK_PRE_BUILD_OEM_SCRIPT=rv1103-spi_nor-post.sh
|
||||
|
||||
# config partition in environment
|
||||
# RK_PARTITION_CMD_IN_ENV format:
|
||||
# <partdef>[,<partdef>]
|
||||
# <partdef> := <size>[@<offset>](part-name)
|
||||
# Note:
|
||||
# If the first partition offset is not 0x0, it must be added. Otherwise, it needn't adding.
|
||||
export RK_PARTITION_CMD_IN_ENV="32K(env),512K@32K(idblock),256K(uboot),32M(boot),512M(oem),256M(userdata),6G(rootfs)"
|
||||
|
||||
# config partition's filesystem type (squashfs is readonly)
|
||||
# emmc: squashfs/ext4
|
||||
# nand: squashfs/ubifs
|
||||
# spi nor: squashfs/jffs2
|
||||
# RK_PARTITION_FS_TYPE_CFG format:
|
||||
# AAAA:/BBBB/CCCC@ext4
|
||||
# AAAA ----------> partition name
|
||||
# /BBBB/CCCC ----> partition mount point
|
||||
# ext4 ----------> partition filesystem type
|
||||
export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ext4,userdata@/userdata@ext4,oem@/oem@ext4
|
||||
|
||||
# config filesystem compress (Just for squashfs or ubifs)
|
||||
# squashfs: lz4/lzo/lzma/xz/gzip, default xz
|
||||
# ubifs: lzo/zlib, default lzo
|
||||
# export RK_SQUASHFS_COMP=xz
|
||||
# export RK_UBIFS_COMP=lzo
|
||||
|
||||
#################################################
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs
|
||||
export LF_TARGET_ROOTFS=ubuntu
|
||||
|
||||
# SUBMODULES : github/gitee
|
||||
export LF_SUBMODULES_BY=github
|
||||
|
||||
# Buildroot defconfig
|
||||
export RK_BUILDROOT_DEFCONFIG=luckfox_pico_defconfig
|
||||
|
||||
#################################################
|
||||
# Defconfig
|
||||
#################################################
|
||||
|
||||
# Target arch
|
||||
export RK_ARCH=arm
|
||||
|
||||
# Target Toolchain Cross Compile
|
||||
export RK_TOOLCHAIN_CROSS=arm-rockchip830-linux-uclibcgnueabihf
|
||||
|
||||
#misc image
|
||||
export RK_MISC=wipe_all-misc.img
|
||||
|
||||
# Uboot defconfig
|
||||
export RK_UBOOT_DEFCONFIG=luckfox_rv1106_uboot_defconfig
|
||||
|
||||
# Kernel defconfig
|
||||
export RK_KERNEL_DEFCONFIG=luckfox_rv1106_linux_defconfig
|
||||
|
||||
# Config sensor IQ files
|
||||
# RK_CAMERA_SENSOR_IQFILES format:
|
||||
# "iqfile1 iqfile2 iqfile3 ..."
|
||||
# ./build.sh media and copy <SDK root dir>/output/out/media_out/isp_iqfiles/$RK_CAMERA_SENSOR_IQFILES
|
||||
export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json"
|
||||
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json sc530ai_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
|
||||
# Config sensor lens CAC calibrattion bin files
|
||||
export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
|
||||
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16 CAC_sc530ai_CMK-OT2115-PC1_30IRC-F16"
|
||||
|
||||
# build ipc web backend
|
||||
# export RK_APP_IPCWEB_BACKEND=y
|
||||
|
||||
# enable install app to oem partition
|
||||
export RK_BUILD_APP_TO_OEM_PARTITION=y
|
||||
|
||||
# enable rockchip test
|
||||
export RK_ENABLE_ROCKCHIP_TEST=y
|
||||
|
||||
#################################################
|
||||
# PRE and POST
|
||||
#################################################
|
||||
|
||||
# specify pre.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_OEM_SCRIPT=luckfox-ubuntu-oem-pre.sh
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_USERDATA_SCRIPT=luckfox-userdata-pre.sh
|
||||
|
||||
# declare overlay directory
|
||||
export RK_POST_OVERLAY="overlay-luckfox-config overlay-luckfox-ubuntu overlay-luckfox-ubuntu-config"
|
||||
@@ -1,120 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#################################################
|
||||
# Board Config
|
||||
#################################################
|
||||
export LF_ORIGIN_BOARD_CONFIG=BoardConfig-SD_CARD-Ubuntu-RV1103_Luckfox_Pico_WebBee.mk
|
||||
# Target CHIP
|
||||
export RK_CHIP=rv1106
|
||||
|
||||
# app config
|
||||
# export RK_APP_TYPE=RKIPC_RV1103
|
||||
|
||||
# Config CMA size in environment
|
||||
export RK_BOOTARGS_CMA_SIZE="1M"
|
||||
|
||||
# Kernel dts
|
||||
export RK_KERNEL_DTS=rv1103g-luckfox-pico-webbee.dts
|
||||
|
||||
#################################################
|
||||
# BOOT_MEDIUM
|
||||
#################################################
|
||||
|
||||
# Target boot medium
|
||||
export RK_BOOT_MEDIUM=sd_card
|
||||
|
||||
# Uboot defconfig fragment
|
||||
export RK_UBOOT_DEFCONFIG_FRAGMENT=rk-emmc.config
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
# export RK_PRE_BUILD_OEM_SCRIPT=rv1103-spi_nor-post.sh
|
||||
|
||||
# config partition in environment
|
||||
# RK_PARTITION_CMD_IN_ENV format:
|
||||
# <partdef>[,<partdef>]
|
||||
# <partdef> := <size>[@<offset>](part-name)
|
||||
# Note:
|
||||
# If the first partition offset is not 0x0, it must be added. Otherwise, it needn't adding.
|
||||
export RK_PARTITION_CMD_IN_ENV="32K(env),512K@32K(idblock),256K(uboot),32M(boot),512M(oem),256M(userdata),6G(rootfs)"
|
||||
|
||||
# config partition's filesystem type (squashfs is readonly)
|
||||
# emmc: squashfs/ext4
|
||||
# nand: squashfs/ubifs
|
||||
# spi nor: squashfs/jffs2
|
||||
# RK_PARTITION_FS_TYPE_CFG format:
|
||||
# AAAA:/BBBB/CCCC@ext4
|
||||
# AAAA ----------> partition name
|
||||
# /BBBB/CCCC ----> partition mount point
|
||||
# ext4 ----------> partition filesystem type
|
||||
export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ext4,userdata@/userdata@ext4,oem@/oem@ext4
|
||||
|
||||
# config filesystem compress (Just for squashfs or ubifs)
|
||||
# squashfs: lz4/lzo/lzma/xz/gzip, default xz
|
||||
# ubifs: lzo/zlib, default lzo
|
||||
# export RK_SQUASHFS_COMP=xz
|
||||
# export RK_UBIFS_COMP=lzo
|
||||
|
||||
#################################################
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs
|
||||
export LF_TARGET_ROOTFS=ubuntu
|
||||
|
||||
# SUBMODULES : github/gitee
|
||||
export LF_SUBMODULES_BY=github
|
||||
|
||||
# Buildroot defconfig
|
||||
export RK_BUILDROOT_DEFCONFIG=luckfox_pico_defconfig
|
||||
|
||||
#################################################
|
||||
# Defconfig
|
||||
#################################################
|
||||
|
||||
# Target arch
|
||||
export RK_ARCH=arm
|
||||
|
||||
# Target Toolchain Cross Compile
|
||||
export RK_TOOLCHAIN_CROSS=arm-rockchip830-linux-uclibcgnueabihf
|
||||
|
||||
#misc image
|
||||
export RK_MISC=wipe_all-misc.img
|
||||
|
||||
# Uboot defconfig
|
||||
export RK_UBOOT_DEFCONFIG=luckfox_rv1106_uboot_defconfig
|
||||
|
||||
# Kernel defconfig
|
||||
export RK_KERNEL_DEFCONFIG=luckfox_rv1106_linux_defconfig
|
||||
|
||||
# Config sensor IQ files
|
||||
# RK_CAMERA_SENSOR_IQFILES format:
|
||||
# "iqfile1 iqfile2 iqfile3 ..."
|
||||
# ./build.sh media and copy <SDK root dir>/output/out/media_out/isp_iqfiles/$RK_CAMERA_SENSOR_IQFILES
|
||||
export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json"
|
||||
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json sc530ai_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
|
||||
# Config sensor lens CAC calibrattion bin files
|
||||
export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
|
||||
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16 CAC_sc530ai_CMK-OT2115-PC1_30IRC-F16"
|
||||
|
||||
# build ipc web backend
|
||||
# export RK_APP_IPCWEB_BACKEND=y
|
||||
|
||||
# enable install app to oem partition
|
||||
export RK_BUILD_APP_TO_OEM_PARTITION=y
|
||||
|
||||
# enable rockchip test
|
||||
export RK_ENABLE_ROCKCHIP_TEST=y
|
||||
|
||||
#################################################
|
||||
# PRE and POST
|
||||
#################################################
|
||||
|
||||
# specify pre.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_OEM_SCRIPT=luckfox-ubuntu-oem-pre.sh
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_USERDATA_SCRIPT=luckfox-userdata-pre.sh
|
||||
|
||||
# declare overlay directory
|
||||
export RK_POST_OVERLAY="overlay-luckfox-ubuntu"
|
||||
@@ -1,120 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#################################################
|
||||
# Board Config
|
||||
#################################################
|
||||
export LF_ORIGIN_BOARD_CONFIG=BoardConfig-SD_CARD-Ubuntu-RV1106_Luckfox_Pico_Max-IPC.mk
|
||||
# Target CHIP
|
||||
export RK_CHIP=rv1106
|
||||
|
||||
# app config
|
||||
# export RK_APP_TYPE=RKIPC_RV1106
|
||||
|
||||
# Config CMA size in environment
|
||||
export RK_BOOTARGS_CMA_SIZE="36M"
|
||||
|
||||
# Kernel dts
|
||||
export RK_KERNEL_DTS=rv1106g-luckfox-pico-max.dts
|
||||
|
||||
#################################################
|
||||
# BOOT_MEDIUM
|
||||
#################################################
|
||||
|
||||
# Target boot medium
|
||||
export RK_BOOT_MEDIUM=sd_card
|
||||
|
||||
# Uboot defconfig fragment
|
||||
export RK_UBOOT_DEFCONFIG_FRAGMENT=rk-emmc.config
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
# export RK_PRE_BUILD_OEM_SCRIPT=rv1103-spi_nor-post.sh
|
||||
|
||||
# config partition in environment
|
||||
# RK_PARTITION_CMD_IN_ENV format:
|
||||
# <partdef>[,<partdef>]
|
||||
# <partdef> := <size>[@<offset>](part-name)
|
||||
# Note:
|
||||
# If the first partition offset is not 0x0, it must be added. Otherwise, it needn't adding.
|
||||
export RK_PARTITION_CMD_IN_ENV="32K(env),512K@32K(idblock),256K(uboot),32M(boot),512M(oem),256M(userdata),6G(rootfs)"
|
||||
|
||||
# config partition's filesystem type (squashfs is readonly)
|
||||
# emmc: squashfs/ext4
|
||||
# nand: squashfs/ubifs
|
||||
# spi nor: squashfs/jffs2
|
||||
# RK_PARTITION_FS_TYPE_CFG format:
|
||||
# AAAA:/BBBB/CCCC@ext4
|
||||
# AAAA ----------> partition name
|
||||
# /BBBB/CCCC ----> partition mount point
|
||||
# ext4 ----------> partition filesystem type
|
||||
export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ext4,userdata@/userdata@ext4,oem@/oem@ext4
|
||||
|
||||
# config filesystem compress (Just for squashfs or ubifs)
|
||||
# squashfs: lz4/lzo/lzma/xz/gzip, default xz
|
||||
# ubifs: lzo/zlib, default lzo
|
||||
# export RK_SQUASHFS_COMP=xz
|
||||
# export RK_UBIFS_COMP=lzo
|
||||
|
||||
#################################################
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs
|
||||
export LF_TARGET_ROOTFS=ubuntu
|
||||
|
||||
# SUBMODULES : github/gitee
|
||||
export LF_SUBMODULES_BY=github
|
||||
|
||||
# Buildroot defconfig
|
||||
export RK_BUILDROOT_DEFCONFIG=luckfox_pico_defconfig
|
||||
|
||||
#################################################
|
||||
# Defconfig
|
||||
#################################################
|
||||
|
||||
# Target arch
|
||||
export RK_ARCH=arm
|
||||
|
||||
# Target Toolchain Cross Compile
|
||||
export RK_TOOLCHAIN_CROSS=arm-rockchip830-linux-uclibcgnueabihf
|
||||
|
||||
#misc image
|
||||
export RK_MISC=wipe_all-misc.img
|
||||
|
||||
# Uboot defconfig
|
||||
export RK_UBOOT_DEFCONFIG=luckfox_rv1106_uboot_defconfig
|
||||
|
||||
# Kernel defconfig
|
||||
export RK_KERNEL_DEFCONFIG=luckfox_rv1106_linux_defconfig
|
||||
|
||||
# Config sensor IQ files
|
||||
# RK_CAMERA_SENSOR_IQFILES format:
|
||||
# "iqfile1 iqfile2 iqfile3 ..."
|
||||
# ./build.sh media and copy <SDK root dir>/output/out/media_out/isp_iqfiles/$RK_CAMERA_SENSOR_IQFILES
|
||||
export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json mis5001_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json sc530ai_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
|
||||
# Config sensor lens CAC calibrattion bin files
|
||||
export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
|
||||
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16 CAC_sc530ai_CMK-OT2115-PC1_30IRC-F16"
|
||||
|
||||
# build ipc web backend
|
||||
# export RK_APP_IPCWEB_BACKEND=y
|
||||
|
||||
# enable install app to oem partition
|
||||
export RK_BUILD_APP_TO_OEM_PARTITION=y
|
||||
|
||||
# enable rockchip test
|
||||
export RK_ENABLE_ROCKCHIP_TEST=y
|
||||
|
||||
#################################################
|
||||
# PRE and POST
|
||||
#################################################
|
||||
|
||||
# specify pre.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_OEM_SCRIPT=luckfox-ubuntu-oem-pre.sh
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_USERDATA_SCRIPT=luckfox-userdata-pre.sh
|
||||
|
||||
# declare overlay directory
|
||||
export RK_POST_OVERLAY="overlay-luckfox-config overlay-luckfox-ubuntu overlay-luckfox-ubuntu-config overlay-luckfox-ubuntu-rockchip"
|
||||
@@ -1,120 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#################################################
|
||||
# Board Config
|
||||
#################################################
|
||||
export LF_ORIGIN_BOARD_CONFIG=BoardConfig-SD_CARD-Ubuntu-RV1106_Luckfox_Pico_Pro-IPC.mk
|
||||
# Target CHIP
|
||||
export RK_CHIP=rv1106
|
||||
|
||||
# app config
|
||||
# export RK_APP_TYPE=RKIPC_RV1106
|
||||
|
||||
# Config CMA size in environment
|
||||
export RK_BOOTARGS_CMA_SIZE="36M"
|
||||
|
||||
# Kernel dts
|
||||
export RK_KERNEL_DTS=rv1106g-luckfox-pico-pro.dts
|
||||
|
||||
#################################################
|
||||
# BOOT_MEDIUM
|
||||
#################################################
|
||||
|
||||
# Target boot medium
|
||||
export RK_BOOT_MEDIUM=sd_card
|
||||
|
||||
# Uboot defconfig fragment
|
||||
export RK_UBOOT_DEFCONFIG_FRAGMENT=rk-emmc.config
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
# export RK_PRE_BUILD_OEM_SCRIPT=rv1103-spi_nor-post.sh
|
||||
|
||||
# config partition in environment
|
||||
# RK_PARTITION_CMD_IN_ENV format:
|
||||
# <partdef>[,<partdef>]
|
||||
# <partdef> := <size>[@<offset>](part-name)
|
||||
# Note:
|
||||
# If the first partition offset is not 0x0, it must be added. Otherwise, it needn't adding.
|
||||
export RK_PARTITION_CMD_IN_ENV="32K(env),512K@32K(idblock),256K(uboot),32M(boot),512M(oem),256M(userdata),6G(rootfs)"
|
||||
|
||||
# config partition's filesystem type (squashfs is readonly)
|
||||
# emmc: squashfs/ext4
|
||||
# nand: squashfs/ubifs
|
||||
# spi nor: squashfs/jffs2
|
||||
# RK_PARTITION_FS_TYPE_CFG format:
|
||||
# AAAA:/BBBB/CCCC@ext4
|
||||
# AAAA ----------> partition name
|
||||
# /BBBB/CCCC ----> partition mount point
|
||||
# ext4 ----------> partition filesystem type
|
||||
export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ext4,userdata@/userdata@ext4,oem@/oem@ext4
|
||||
|
||||
# config filesystem compress (Just for squashfs or ubifs)
|
||||
# squashfs: lz4/lzo/lzma/xz/gzip, default xz
|
||||
# ubifs: lzo/zlib, default lzo
|
||||
# export RK_SQUASHFS_COMP=xz
|
||||
# export RK_UBIFS_COMP=lzo
|
||||
|
||||
#################################################
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs
|
||||
export LF_TARGET_ROOTFS=ubuntu
|
||||
|
||||
# SUBMODULES : github/gitee
|
||||
export LF_SUBMODULES_BY=github
|
||||
|
||||
# Buildroot defconfig
|
||||
export RK_BUILDROOT_DEFCONFIG=luckfox_pico_defconfig
|
||||
|
||||
#################################################
|
||||
# Defconfig
|
||||
#################################################
|
||||
|
||||
# Target arch
|
||||
export RK_ARCH=arm
|
||||
|
||||
# Target Toolchain Cross Compile
|
||||
export RK_TOOLCHAIN_CROSS=arm-rockchip830-linux-uclibcgnueabihf
|
||||
|
||||
#misc image
|
||||
export RK_MISC=wipe_all-misc.img
|
||||
|
||||
# Uboot defconfig
|
||||
export RK_UBOOT_DEFCONFIG=luckfox_rv1106_uboot_defconfig
|
||||
|
||||
# Kernel defconfig
|
||||
export RK_KERNEL_DEFCONFIG=luckfox_rv1106_linux_defconfig
|
||||
|
||||
# Config sensor IQ files
|
||||
# RK_CAMERA_SENSOR_IQFILES format:
|
||||
# "iqfile1 iqfile2 iqfile3 ..."
|
||||
# ./build.sh media and copy <SDK root dir>/output/out/media_out/isp_iqfiles/$RK_CAMERA_SENSOR_IQFILES
|
||||
export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json mis5001_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json sc530ai_CMK-OT2115-PC1_30IRC-F16.json"
|
||||
|
||||
# Config sensor lens CAC calibrattion bin files
|
||||
export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
|
||||
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16 CAC_sc530ai_CMK-OT2115-PC1_30IRC-F16"
|
||||
|
||||
# build ipc web backend
|
||||
# export RK_APP_IPCWEB_BACKEND=y
|
||||
|
||||
# enable install app to oem partition
|
||||
export RK_BUILD_APP_TO_OEM_PARTITION=y
|
||||
|
||||
# enable rockchip test
|
||||
export RK_ENABLE_ROCKCHIP_TEST=y
|
||||
|
||||
#################################################
|
||||
# PRE and POST
|
||||
#################################################
|
||||
|
||||
# specify pre.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_OEM_SCRIPT=luckfox-ubuntu-oem-pre.sh
|
||||
|
||||
# specify post.sh for delete/overlay files
|
||||
export RK_PRE_BUILD_USERDATA_SCRIPT=luckfox-userdata-pre.sh
|
||||
|
||||
# declare overlay directory
|
||||
export RK_POST_OVERLAY="overlay-luckfox-config overlay-luckfox-ubuntu overlay-luckfox-ubuntu-config overlay-luckfox-ubuntu-rockchip"
|
||||
@@ -58,7 +58,7 @@ export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ubifs,oem@/oem@ubifs,userdata@/use
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs : ubuntu(only emmc)/buildroot/busybox
|
||||
# Target rootfs : buildroot/busybox
|
||||
export LF_TARGET_ROOTFS=buildroot
|
||||
|
||||
# Buildroot defconfig
|
||||
|
||||
@@ -58,7 +58,7 @@ export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ubifs,oem@/oem@ubifs,userdata@/use
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs : ubuntu(only emmc)/buildroot/busybox
|
||||
# Target rootfs : buildroot/busybox
|
||||
export LF_TARGET_ROOTFS=buildroot
|
||||
|
||||
# Buildroot defconfig
|
||||
|
||||
@@ -58,7 +58,7 @@ export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ubifs,oem@/oem@ubifs,userdata@/use
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs : ubuntu(only emmc)/buildroot/busybox
|
||||
# Target rootfs : buildroot/busybox
|
||||
export LF_TARGET_ROOTFS=buildroot
|
||||
|
||||
# Buildroot defconfig
|
||||
|
||||
@@ -58,7 +58,7 @@ export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ubifs,oem@/oem@ubifs,userdata@/use
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs : ubuntu(only emmc)/buildroot/busybox
|
||||
# Target rootfs : buildroot/busybox
|
||||
export LF_TARGET_ROOTFS=buildroot
|
||||
|
||||
# Buildroot defconfig
|
||||
|
||||
@@ -58,7 +58,7 @@ export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ubifs,oem@/oem@ubifs,userdata@/use
|
||||
# TARGET_ROOTFS
|
||||
#################################################
|
||||
|
||||
# Target rootfs : ubuntu(only emmc)/buildroot/busybox
|
||||
# Target rootfs : buildroot/busybox
|
||||
export LF_TARGET_ROOTFS=buildroot
|
||||
|
||||
# Buildroot defconfig
|
||||
|
||||
0
project/cfg/BoardConfig_IPC/luckfox-buildroot-nocsi-oem-pre.sh
Normal file → Executable file
0
project/cfg/BoardConfig_IPC/luckfox-buildroot-nocsi-oem-pre.sh
Normal file → Executable file
0
project/cfg/BoardConfig_IPC/luckfox-buildroot-oem-pre.sh
Normal file → Executable file
0
project/cfg/BoardConfig_IPC/luckfox-buildroot-oem-pre.sh
Normal file → Executable file
0
project/cfg/BoardConfig_IPC/luckfox-ubuntu-oem-pre.sh → project/cfg/BoardConfig_IPC/luckfox-glibc-oem-pre.sh
Normal file → Executable file
0
project/cfg/BoardConfig_IPC/luckfox-ubuntu-oem-pre.sh → project/cfg/BoardConfig_IPC/luckfox-glibc-oem-pre.sh
Normal file → Executable file
@@ -39,7 +39,9 @@ test ! -f crc16.ko || insmod crc16.ko
|
||||
test ! -f mbcache.ko || insmod mbcache.ko
|
||||
test ! -f ext4.ko || insmod ext4.ko
|
||||
test ! -f dw_mmc-rockchip.ko || insmod dw_mmc-rockchip.ko
|
||||
sleep 0.5
|
||||
sh /etc/init.d/S20linkmount start &
|
||||
sleep 0.5
|
||||
|
||||
echo "start app" > /dev/kmsg
|
||||
test -n "\$persist_camera_engine_log" && \
|
||||
|
||||
0
project/cfg/BoardConfig_IPC/luckfox-userdata-pre.sh
Normal file → Executable file
0
project/cfg/BoardConfig_IPC/luckfox-userdata-pre.sh
Normal file → Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
if [ -f "/usr/bin/insmod_goodix.sh" ]; then
|
||||
sh /usr/bin/insmod_goodix.sh &
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
if [ "$(cat /proc/device-tree/model)" == "Luckfox Pico 86Panel W" ] ||
|
||||
[ -f "/oem/usr/ko/insmod_wifi.sh" ]; then
|
||||
sh /oem/usr/ko/insmod_wifi.sh &
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
[ -f /etc/profile.d/RkEnv.sh ] && source /etc/profile.d/RkEnv.sh
|
||||
|
||||
network_init() {
|
||||
ethaddr1=$(ifconfig -a | grep "eth.*HWaddr" | awk '{print $5}')
|
||||
|
||||
if [ -f /data/ethaddr.txt ]; then
|
||||
ethaddr2=$(cat /data/ethaddr.txt)
|
||||
if [ $ethaddr1 == $ethaddr2 ]; then
|
||||
echo "eth HWaddr cfg ok"
|
||||
else
|
||||
ifconfig eth0 down
|
||||
ifconfig eth0 hw ether $ethaddr2
|
||||
fi
|
||||
else
|
||||
echo $ethaddr1 >/data/ethaddr.txt
|
||||
fi
|
||||
ifconfig eth0 up && udhcpc -i eth0 >/dev/null 2>&1
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
network_init &
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
[ -f /etc/profile.d/RkEnv.sh ] && source /etc/profile.d/RkEnv.sh
|
||||
case $1 in
|
||||
start)
|
||||
if [ -f /usr/bin/t_s ]; then
|
||||
/usr/bin/t_s &
|
||||
elif [ -f /usr/bin/86UI_demo ]; then
|
||||
/usr/bin/86UI_demo &
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Binary file not shown.
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Export Pins
|
||||
echo 120 >/sys/class/gpio/export
|
||||
echo 0 >/sys/class/gpio/export
|
||||
|
||||
# Set the initial level state
|
||||
echo out >/sys/class/gpio/gpio0/direction
|
||||
echo 1 >/sys/class/gpio/gpio0/value
|
||||
|
||||
echo out >/sys/class/gpio/gpio120/direction
|
||||
echo 0 >/sys/class/gpio/gpio120/value
|
||||
|
||||
# Set GT911 address 0x14
|
||||
sleep 0.5
|
||||
echo 1 >/sys/class/gpio/gpio120/value
|
||||
sleep 0.5
|
||||
|
||||
echo 0 >/sys/class/gpio/gpio0/value
|
||||
echo in >/sys/class/gpio/gpio0/direction
|
||||
|
||||
echo 120 >/sys/class/gpio/unexport
|
||||
echo 0 >/sys/class/gpio/unexport
|
||||
|
||||
# Insmod goodix driver
|
||||
insmod /oem/usr/ko/goodix.ko
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
[ -f /etc/profile.d/RkEnv.sh ] && source /etc/profile.d/RkEnv.sh
|
||||
case $1 in
|
||||
start)
|
||||
if command -v amixer >/dev/null 2>&1; then
|
||||
amixer set 'ADC ALC Left' 26 > /dev/null 2>&1
|
||||
amixer set 'ADC ALC Right' 26 > /dev/null 2>&1
|
||||
amixer set 'ADC MIC Left Gain' 3 > /dev/null 2>&1
|
||||
amixer set 'ADC MIC Right Gain' 3 > /dev/null 2>&1
|
||||
amixer set 'ADC MICBIAS Voltage' 'VREFx0_975' > /dev/null 2>&1
|
||||
amixer set 'ADC Mode' 'SingadcL' > /dev/null 2>&1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -343,15 +343,15 @@ function luckfox_load_cfg() {
|
||||
fi
|
||||
|
||||
# CSI ( Priority is lower than RGB )
|
||||
value=$(luckfox_get_pin_cfg "CSI_ENABLE")
|
||||
if [ -z "$value" ]; then
|
||||
if [ "$LUCKFOX_CHIP_MODEL" == "Luckfox Pico Ultra" ] || [ "$LUCKFOX_CHIP_MODEL" == "Luckfox Pico Ultra W" ]; then
|
||||
luckfox_set_pin_mark "I2C4_M1_SCL" 1
|
||||
luckfox_set_pin_mark "I2C4_M1_SDA" 1
|
||||
luckfox_set_pin_mark "I2C4_M0_SCL" 1
|
||||
luckfox_set_pin_mark "I2C4_M0_SDA" 1
|
||||
fi
|
||||
fi
|
||||
# value=$(luckfox_get_pin_cfg "CSI_ENABLE")
|
||||
# if [ -z "$value" ]; then
|
||||
# if [ "$LUCKFOX_CHIP_MODEL" == "Luckfox Pico Ultra" ] || [ "$LUCKFOX_CHIP_MODEL" == "Luckfox Pico Ultra W" ]; then
|
||||
# luckfox_set_pin_mark "I2C4_M1_SCL" 1
|
||||
# luckfox_set_pin_mark "I2C4_M1_SDA" 1
|
||||
# luckfox_set_pin_mark "I2C4_M0_SCL" 1
|
||||
# luckfox_set_pin_mark "I2C4_M0_SDA" 1
|
||||
# fi
|
||||
# fi
|
||||
|
||||
# FBTFT
|
||||
value=$(luckfox_get_pin_cfg "FBTFT_ENABLE")
|
||||
@@ -1386,25 +1386,6 @@ function hex_add() {
|
||||
echo "$sum_hex"
|
||||
}
|
||||
|
||||
################################################################
|
||||
# @fu hex_shift
|
||||
#
|
||||
# @param hex -
|
||||
# shift_amount -
|
||||
#
|
||||
# @return The hexadecimal number after shifting hex by shift_amount.
|
||||
################################################################
|
||||
function hex_shift() {
|
||||
local hex=$1
|
||||
local shift_amount=$2
|
||||
|
||||
local dec=$(printf "%d" 0x$hex)
|
||||
local shift=$((shift_amount * 2))
|
||||
local shifted=$((dec << shift))
|
||||
|
||||
printf "%X\n" $shifted
|
||||
}
|
||||
|
||||
################################################################
|
||||
# @fu luckfox_gpio_app
|
||||
#
|
||||
@@ -1686,13 +1667,10 @@ function luckfox_check_i2c() {
|
||||
csi_status=$(luckfox_get_pin_cfg "CSI_ENABLE")
|
||||
# process default status
|
||||
if [ -z "$csi_status" ]; then
|
||||
# CSI I2C is not enabled on Ultra models by default
|
||||
if [ "$LUCKFOX_CHIP_MODEL" == "Luckfox Pico Ultra" ] || [ "$LUCKFOX_CHIP_MODEL" == "Luckfox Pico Ultra W" ]; then
|
||||
"$csi_status" = 0
|
||||
else
|
||||
"$csi_status" = 1
|
||||
fi
|
||||
echo "set csi_status = 1"
|
||||
csi_status=1
|
||||
fi
|
||||
echo "csi_status = $csi_status"
|
||||
|
||||
if [ "$csi_status" == 1 ]; then
|
||||
luckfox_result_handle "$LF_ERR" "CSI is enable,Can't config I2C4"
|
||||
@@ -2861,12 +2839,9 @@ function luckfox_result_handle() {
|
||||
}
|
||||
|
||||
################################################################
|
||||
# @fu luckfox_result_handle
|
||||
# @fu luckfox_pico_show_pin_diagram
|
||||
#
|
||||
# @brief 1. Display a message in the GUI.
|
||||
#
|
||||
# @param status - Status of messages
|
||||
# log - Prepare the message to be printed
|
||||
# @brief 1. Display pin diagram in the GUI.
|
||||
#
|
||||
# @return none
|
||||
################################################################
|
||||
@@ -2889,13 +2864,15 @@ function luckfox_show_menu() {
|
||||
--menu "Choose an option" 80 50 6 \
|
||||
1 "Advanced Options" \
|
||||
2 "4G Module" \
|
||||
3 "About Luckfox" \
|
||||
3 "Backup" \
|
||||
4 "About Luckfox" \
|
||||
2>&1 >/dev/tty)
|
||||
|
||||
case $option in
|
||||
1) luckfox_advanced_options ;;
|
||||
2) luckfox_4G ;;
|
||||
3) luckfox_about ;;
|
||||
3) luckfox_backup ;;
|
||||
4) luckfox_about ;;
|
||||
*) luckfox_exit ;;
|
||||
esac
|
||||
done
|
||||
@@ -2905,12 +2882,14 @@ function luckfox_show_menu() {
|
||||
option=$(dialog --title "$LUCKFOX_CHIP_MODEL Config" \
|
||||
--menu "Choose an option" 80 50 6 \
|
||||
1 "Advanced Options" \
|
||||
2 "About Luckfox" \
|
||||
2 "Backup" \
|
||||
3 "About Luckfox" \
|
||||
2>&1 >/dev/tty)
|
||||
|
||||
case $option in
|
||||
1) luckfox_advanced_options ;;
|
||||
2) luckfox_about ;;
|
||||
2) luckfox_backup ;;
|
||||
3) luckfox_about ;;
|
||||
*) luckfox_exit ;;
|
||||
esac
|
||||
done
|
||||
@@ -3046,6 +3025,31 @@ function luckfox_advanced_options() {
|
||||
fi
|
||||
}
|
||||
|
||||
function luckfox_backup() {
|
||||
option=$(dialog --title "Advanced Options" \
|
||||
--menu "Choose an option" 80 50 6 \
|
||||
1 "rootfs" \
|
||||
2>&1 >/dev/tty)
|
||||
|
||||
if [ $option == 1 ]; then
|
||||
if [ "$LUCKFOX_CHIP_MODEL" == "Luckfox Pico Pi" ] || [ "$LUCKFOX_CHIP_MODEL" == "Luckfox Pico Pi W" ]; then
|
||||
media_class=$(dialog --menu "Select Backup Image Location" 80 50 6 \
|
||||
0 "local" \
|
||||
1 "usb_disk" \
|
||||
2 "sd_card" \
|
||||
2>&1 >/dev/tty)
|
||||
elif [ "$LUCKFOX_CHIP_MODEL" == "Luckfox Pico Ultra" ] || [ "$LUCKFOX_CHIP_MODEL" == "Luckfox Pico Ultra W" ]; then
|
||||
media_class=$(dialog --menu "Select Backup Image Location" 80 50 6 \
|
||||
0 "local" \
|
||||
1 "usb_disk" \
|
||||
2>&1 >/dev/tty)
|
||||
fi
|
||||
luckfox_rootfs_BACKUP "$media_class"
|
||||
else
|
||||
luckfox_show_menu
|
||||
fi
|
||||
}
|
||||
|
||||
function luckfox_about() {
|
||||
luckfox_pico_show_pin_diagram
|
||||
}
|
||||
@@ -3496,15 +3500,136 @@ function luckfox_4G() {
|
||||
3) apn="3gwap" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
luckfox_4g_app "$module_4g_enable" "$mode" "$apn"
|
||||
}
|
||||
|
||||
################################################################
|
||||
# ------------------------ Backup GUI --------------------------
|
||||
################################################################
|
||||
function luckfox_rootfs_BACKUP() {
|
||||
local media_class="$1"
|
||||
|
||||
ROOT_FS_TYPE=$(df -T / | tail -1 | awk '{print $2}')
|
||||
if [[ "$ROOT_FS_TYPE" != "ext4" ]]; then
|
||||
luckfox_result_handle "$LF_ERR" "Error: Root filesystem is not ext4 (found: $ROOT_FS_TYPE)"
|
||||
fi
|
||||
|
||||
if ! command -v rsync &>/dev/null; then
|
||||
luckfox_result_handle "$LF_ERR" "The rsync is not installed"
|
||||
fi
|
||||
|
||||
if [ "$media_class" == 1 ]; then
|
||||
if ! mount | grep "/mnt/udisk"; then
|
||||
luckfox_result_handle "$LF_ERR" "USB disk is not mounted"
|
||||
fi
|
||||
AVAILABLE_SPACE=$(df -k /mnt/udisk | tail -1 | awk '{print $4}')
|
||||
IMAGE_NAME="/mnt/udisk/backup_rootfs.img"
|
||||
MOUNT_POINT="/mnt/udisk/backup_img"
|
||||
elif [ "$media_class" == 2 ]; then
|
||||
if ! mount | grep "/mnt/sdcard"; then
|
||||
luckfox_result_handle "$LF_ERR" "SD card is not mounted"
|
||||
fi
|
||||
AVAILABLE_SPACE=$(df -k /mnt/sdcard | tail -1 | awk '{print $4}')
|
||||
IMAGE_NAME="/mnt/sdcard/backup_rootfs.img"
|
||||
MOUNT_POINT="/mnt/sdcard/backup_img"
|
||||
else
|
||||
AVAILABLE_SPACE=$(df -k /mnt | tail -1 | awk '{print $4}')
|
||||
IMAGE_NAME="/mnt/backup_rootfs.img"
|
||||
MOUNT_POINT="/mnt/backup_img"
|
||||
fi
|
||||
|
||||
used_kb=$(df -k / | tail -1 | awk '{print $3}')
|
||||
REQUIRED_SPACE=$(awk -v size_kb="$used_kb" 'BEGIN { printf("%d", (size_kb * 2.4 / 1024) + 0.999) }')
|
||||
|
||||
if [ -z "$AVAILABLE_SPACE" ]; then
|
||||
AVAILABLE_SPACE=0
|
||||
fi
|
||||
|
||||
if [ "$AVAILABLE_SPACE" -lt "$REQUIRED_SPACE" ]; then
|
||||
luckfox_result_handle "$LF_ERR" "Not enough space on $media_class (required: ${REQUIRED_SPACE}MB, available: ${AVAILABLE_SPACE}MB)"
|
||||
fi
|
||||
|
||||
LOG_FILE="/tmp/backup_rootfs.log"
|
||||
|
||||
if [ -f "$IMAGE_NAME" ]; then
|
||||
rm -f "$IMAGE_NAME"
|
||||
fi
|
||||
|
||||
if mountpoint -q "$MOUNT_POINT"; then
|
||||
umount "$MOUNT_POINT"
|
||||
fi
|
||||
rm -rf "$MOUNT_POINT"
|
||||
mkdir -p "$MOUNT_POINT"
|
||||
|
||||
{
|
||||
echo "XXX"
|
||||
echo 10
|
||||
echo "Starting backup process..."
|
||||
echo "XXX"
|
||||
|
||||
echo "Calculating used disk space..." >>"$LOG_FILE"
|
||||
used_kb=$(df -k / | tail -1 | awk '{print $3}')
|
||||
IMAGE_SIZE_MB=$(awk -v size_kb="$used_kb" 'BEGIN { printf("%d", (size_kb * 1.2 / 1024) + 0.999) }')
|
||||
|
||||
echo "XXX"
|
||||
echo 40
|
||||
echo "Creating ext4 image ($IMAGE_SIZE_MB MB)..."
|
||||
echo "XXX"
|
||||
dd if=/dev/zero of="$IMAGE_NAME" bs=1M count=$IMAGE_SIZE_MB >>"$LOG_FILE" 2>&1
|
||||
mkfs.ext4 -F "$IMAGE_NAME" >>"$LOG_FILE" 2>&1
|
||||
|
||||
echo "XXX"
|
||||
echo 60
|
||||
echo "Mounting image..."
|
||||
echo "XXX"
|
||||
mount -o loop "$IMAGE_NAME" "$MOUNT_POINT" >>"$LOG_FILE" 2>&1
|
||||
|
||||
echo "XXX"
|
||||
echo 80
|
||||
echo "Copying rootfs with rsync..."
|
||||
echo "XXX"
|
||||
rsync -aX --exclude={"/oem","/userdata","/mnt","/tmp","/proc"} / "$MOUNT_POINT" >>"$LOG_FILE" 2>&1
|
||||
|
||||
mkdir -p "$MOUNT_POINT/mnt" "$MOUNT_POINT/tmp" "$MOUNT_POINT/proc" "$MOUNT_POINT/userdata" "$MOUNT_POINT/oem"
|
||||
|
||||
echo "XXX"
|
||||
echo 100
|
||||
echo "Finalizing..."
|
||||
echo "XXX"
|
||||
umount "$MOUNT_POINT" >>"$LOG_FILE" 2>&1
|
||||
} | dialog --title "Backup in Progress" --gauge "Preparing backup..." 10 60 0
|
||||
|
||||
dialog --title "Backup Succeeded" --msgbox "The image is saved at $IMAGE_NAME" 10 60
|
||||
luckfox_show_menu
|
||||
|
||||
}
|
||||
|
||||
################################################################
|
||||
# @fu hex_shift
|
||||
#
|
||||
# @param hex -
|
||||
# shift_amount -
|
||||
#
|
||||
# @return The hexadecimal number after shifting hex by shift_amount.
|
||||
################################################################
|
||||
function hex_shift() {
|
||||
local hex=$1
|
||||
local shift_amount=$2
|
||||
|
||||
local dec=$(printf "%d" 0x$hex)
|
||||
local shift=$((shift_amount * 2))
|
||||
local shifted=$((dec << shift))
|
||||
|
||||
printf "%X\n" $shifted
|
||||
}
|
||||
|
||||
################################################################
|
||||
# --------------------------- Run ------------------------------
|
||||
################################################################
|
||||
|
||||
echo 0 >/proc/sys/kernel/printk
|
||||
if [ "$1" == "load" ]; then
|
||||
LF_GUI_ENABLE=0
|
||||
if [ -f $LUCKFOX_PIN_DIAGRAM_FILE ]; then
|
||||
@@ -3535,7 +3660,7 @@ elif [ "$1" == "rgb_switch" ]; then
|
||||
"18" "16" \
|
||||
"2" "2" \
|
||||
"0" "0" \
|
||||
"0" "1"
|
||||
"0" "0"
|
||||
elif [ "$(luckfox_get_pin_cfg "RGB_HACTIVE")" == "720" ]; then
|
||||
# 720 -> 480
|
||||
echo "****************************************************"
|
||||
@@ -3570,3 +3695,5 @@ elif [ -z "$1" ]; then
|
||||
luckfox_config_init
|
||||
luckfox_show_menu
|
||||
fi
|
||||
echo "7 4 1 7" >/proc/sys/kernel/printk
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
if [ -f "/usr/bin/insmod_goodix.sh" ]; then
|
||||
sh /usr/bin/insmod_goodix.sh &
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
USB_KEYWORD="android_work: sent uevent USB_STATE="
|
||||
USB_MODE_PATH="/proc/device-tree/usbdrd/usb@ffb00000/dr_mode"
|
||||
|
||||
usb_reset() {
|
||||
while true; do
|
||||
last_line=$(dmesg | grep "$USB_KEYWORD" | tail -n 1)
|
||||
|
||||
if [[ "$last_line" == *"DISCONNECTED" ]]; then
|
||||
echo "Detected USB DISCONNECTED."
|
||||
/etc/init.d/S50usbdevice restart
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
}
|
||||
|
||||
wifibt_init() {
|
||||
/usr/bin/wifi_bt_init.sh
|
||||
if [ -z "$(ifconfig -a | grep wlan0)" ]; then
|
||||
echo "Try Wi-Fi/BT init again!"
|
||||
sleep 5
|
||||
/usr/bin/wifi_bt_init.sh
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -f /oem/usr/ko/insmod_ko.sh ]; then
|
||||
chmod a+x /oem/usr/ko/insmod_ko.sh
|
||||
/oem/usr/ko/insmod_ko.sh
|
||||
fi
|
||||
/usr/bin/filesystem_resize.sh
|
||||
wifibt_init &
|
||||
|
||||
usb_mode="$(cat $USB_MODE_PATH)"
|
||||
/etc/init.d/S50usbdevice start
|
||||
if [ "$usb_mode" = "peripheral" ]; then
|
||||
usb_reset &
|
||||
fi
|
||||
|
||||
/etc/init.d/S25goodix start
|
||||
|
||||
if [ -n "$(hwclock | grep "invalid")" ]; then
|
||||
date -s 2024-01-01
|
||||
hwclock -w
|
||||
fi
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Export Pins
|
||||
echo 120 >/sys/class/gpio/export
|
||||
echo 0 >/sys/class/gpio/export
|
||||
|
||||
# Set the initial level state
|
||||
echo out >/sys/class/gpio/gpio0/direction
|
||||
echo 1 >/sys/class/gpio/gpio0/value
|
||||
|
||||
echo out >/sys/class/gpio/gpio120/direction
|
||||
echo 0 >/sys/class/gpio/gpio120/value
|
||||
|
||||
# Set GT911 address 0x14
|
||||
sleep 0.5
|
||||
echo 1 >/sys/class/gpio/gpio120/value
|
||||
sleep 0.5
|
||||
|
||||
echo 0 >/sys/class/gpio/gpio0/value
|
||||
echo in >/sys/class/gpio/gpio0/direction
|
||||
|
||||
echo 120 >/sys/class/gpio/unexport
|
||||
echo 0 >/sys/class/gpio/unexport
|
||||
|
||||
# Insmod goodix driver
|
||||
insmod /oem/usr/ko/goodix.ko
|
||||
BIN
project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-glibc-config/usr/bin/io
Executable file
BIN
project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-glibc-config/usr/bin/io
Executable file
Binary file not shown.
BIN
project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-glibc-config/usr/bin/rsync
Executable file
BIN
project/cfg/BoardConfig_IPC/overlay/overlay-luckfox-glibc-config/usr/bin/rsync
Executable file
Binary file not shown.
@@ -0,0 +1,198 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script uses openssl, gnutls, or stunnel to secure an rsync daemon connection.
|
||||
|
||||
# By default this script takes rsync args and hands them off to the actual
|
||||
# rsync command with an --rsh option that makes it open an SSL connection to an
|
||||
# rsync daemon. See the rsync-ssl manpage for usage details and env variables.
|
||||
|
||||
# When the first arg is --HELPER, we are being used by rsync as an --rsh helper
|
||||
# script, and the args are (note the trailing dot):
|
||||
#
|
||||
# rsync-ssl --HELPER HOSTNAME rsync --server --daemon .
|
||||
#
|
||||
# --HELPER is not a user-facing option, so it is not documented in the manpage.
|
||||
|
||||
# The first SSL setup was based on: http://dozzie.jarowit.net/trac/wiki/RsyncSSL
|
||||
# Note that an stunnel connection requires at least version 4.x of stunnel.
|
||||
|
||||
function rsync_ssl_run {
|
||||
case "$*" in
|
||||
*rsync://*) ;;
|
||||
*::*) ;;
|
||||
*)
|
||||
echo "You must use rsync-ssl with a daemon-style hostname." 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exec rsync --rsh="$0 --HELPER" "${@}"
|
||||
}
|
||||
|
||||
function rsync_ssl_helper {
|
||||
if [[ -z "$RSYNC_SSL_TYPE" ]]; then
|
||||
found=`path_search openssl stunnel4 stunnel` || exit 1
|
||||
if [[ "$found" == */openssl ]]; then
|
||||
RSYNC_SSL_TYPE=openssl
|
||||
RSYNC_SSL_OPENSSL="$found"
|
||||
elif [[ "$found" == */gnutls-cli ]]; then
|
||||
RSYNC_SSL_TYPE=gnutls
|
||||
RSYNC_SSL_GNUTLS="$found"
|
||||
else
|
||||
RSYNC_SSL_TYPE=stunnel
|
||||
RSYNC_SSL_STUNNEL="$found"
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$RSYNC_SSL_TYPE" in
|
||||
openssl)
|
||||
if [[ -z "$RSYNC_SSL_OPENSSL" ]]; then
|
||||
RSYNC_SSL_OPENSSL=`path_search openssl` || exit 1
|
||||
fi
|
||||
optsep=' '
|
||||
;;
|
||||
gnutls)
|
||||
if [[ -z "$RSYNC_SSL_GNUTLS" ]]; then
|
||||
RSYNC_SSL_GNUTLS=`path_search gnutls-cli` || exit 1
|
||||
fi
|
||||
optsep=' '
|
||||
;;
|
||||
stunnel)
|
||||
if [[ -z "$RSYNC_SSL_STUNNEL" ]]; then
|
||||
RSYNC_SSL_STUNNEL=`path_search stunnel4 stunnel` || exit 1
|
||||
fi
|
||||
optsep=' = '
|
||||
;;
|
||||
*)
|
||||
echo "The RSYNC_SSL_TYPE specifies an unknown type: $RSYNC_SSL_TYPE" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ -z "$RSYNC_SSL_CERT" ]]; then
|
||||
certopt=""
|
||||
gnutls_cert_opt=""
|
||||
else
|
||||
certopt="-cert$optsep$RSYNC_SSL_CERT"
|
||||
gnutls_cert_opt="--x509certfile=$RSYNC_SSL_CERT"
|
||||
fi
|
||||
|
||||
if [[ -z "$RSYNC_SSL_KEY" ]]; then
|
||||
keyopt=""
|
||||
gnutls_key_opt=""
|
||||
else
|
||||
keyopt="-key$optsep$RSYNC_SSL_KEY"
|
||||
gnutls_key_opt="--x509keyfile=$RSYNC_SSL_KEY"
|
||||
fi
|
||||
|
||||
if [[ -z ${RSYNC_SSL_CA_CERT+x} ]]; then
|
||||
# RSYNC_SSL_CA_CERT unset - default CA set AND verify:
|
||||
# openssl:
|
||||
caopt="-verify_return_error -verify 4"
|
||||
# gnutls:
|
||||
gnutls_opts=""
|
||||
# stunnel:
|
||||
# Since there is no way of using the default CA certificate collection,
|
||||
# we cannot do any verification. Thus, stunnel should really only be
|
||||
# used if nothing else is available.
|
||||
cafile=""
|
||||
verify=""
|
||||
elif [[ "$RSYNC_SSL_CA_CERT" == "" ]]; then
|
||||
# RSYNC_SSL_CA_CERT set but empty -do NO verifications:
|
||||
# openssl:
|
||||
caopt="-verify 1"
|
||||
# gnutls:
|
||||
gnutls_opts="--insecure"
|
||||
# stunnel:
|
||||
cafile=""
|
||||
verify="verifyChain = no"
|
||||
else
|
||||
# RSYNC_SSL_CA_CERT set - use CA AND verify:
|
||||
# openssl:
|
||||
caopt="-CAfile $RSYNC_SSL_CA_CERT -verify_return_error -verify 4"
|
||||
# gnutls:
|
||||
gnutls_opts="--x509cafile=$RSYNC_SSL_CA_CERT"
|
||||
# stunnel:
|
||||
cafile="CAfile = $RSYNC_SSL_CA_CERT"
|
||||
verify="verifyChain = yes"
|
||||
fi
|
||||
|
||||
port="${RSYNC_PORT:-0}"
|
||||
if [[ "$port" == 0 ]]; then
|
||||
port="${RSYNC_SSL_PORT:-874}"
|
||||
fi
|
||||
|
||||
# If the user specified USER@HOSTNAME::module, then rsync passes us
|
||||
# the -l USER option too, so we must be prepared to ignore it.
|
||||
if [[ "$1" == "-l" ]]; then
|
||||
shift 2
|
||||
fi
|
||||
|
||||
hostname="$1"
|
||||
shift
|
||||
|
||||
if [[ -z "$hostname" || "$1" != rsync || "$2" != --server || "$3" != --daemon ]]; then
|
||||
echo "Usage: rsync-ssl --HELPER HOSTNAME rsync --server --daemon ." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $RSYNC_SSL_TYPE == openssl ]]; then
|
||||
exec $RSYNC_SSL_OPENSSL s_client $caopt $certopt $keyopt -quiet -verify_quiet -servername $hostname -verify_hostname $hostname -connect $hostname:$port
|
||||
elif [[ $RSYNC_SSL_TYPE == gnutls ]]; then
|
||||
exec $RSYNC_SSL_GNUTLS --logfile=/dev/null $gnutls_cert_opt $gnutls_key_opt $gnutls_opts $hostname:$port
|
||||
else
|
||||
# devzero@web.de came up with this no-tmpfile calling syntax:
|
||||
exec $RSYNC_SSL_STUNNEL -fd 10 11<&0 <<EOF 10<&0 0<&11 11<&-
|
||||
foreground = yes
|
||||
debug = crit
|
||||
connect = $hostname:$port
|
||||
client = yes
|
||||
TIMEOUTclose = 0
|
||||
$verify
|
||||
$certopt
|
||||
$cafile
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
function path_search {
|
||||
IFS_SAVE="$IFS"
|
||||
IFS=:
|
||||
for prog in "${@}"; do
|
||||
for dir in $PATH; do
|
||||
[[ -z "$dir" ]] && dir=.
|
||||
if [[ -f "$dir/$prog" && -x "$dir/$prog" ]]; then
|
||||
echo "$dir/$prog"
|
||||
IFS="$IFS_SAVE"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
IFS="$IFS_SAVE"
|
||||
echo "Failed to find on your path: $*" 1>&2
|
||||
echo "See the rsync-ssl manpage for configuration assistance." 1>&2
|
||||
return 1
|
||||
}
|
||||
|
||||
if [[ "$#" == 0 ]]; then
|
||||
echo "Usage: rsync-ssl [--type=SSL_TYPE] RSYNC_ARG [...]" 1>&2
|
||||
echo "The SSL_TYPE can be openssl or stunnel"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$1" = --help || "$1" = -h ]]; then
|
||||
exec rsync --help
|
||||
fi
|
||||
|
||||
if [[ "$1" == --HELPER ]]; then
|
||||
shift
|
||||
rsync_ssl_helper "${@}"
|
||||
fi
|
||||
|
||||
if [[ "$1" == --type=* ]]; then
|
||||
export RSYNC_SSL_TYPE="${1/--type=/}"
|
||||
shift
|
||||
fi
|
||||
|
||||
rsync_ssl_run "${@}"
|
||||
@@ -1,6 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra W" ]; then
|
||||
if [ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra W" ] ||
|
||||
[ "$(cat /proc/device-tree/model)" == "Luckfox Pico 86Panel W" ] ||
|
||||
[ "$(cat /proc/device-tree/model)" == "Luckfox Pico Pi W" ]; then
|
||||
systemctl stop wpa_supplicant
|
||||
|
||||
if [ "$1" = "stop" ]; then
|
||||
@@ -120,7 +120,6 @@ endif
|
||||
ifneq ($(LF_TARGET_ROOTFS),)
|
||||
TARGET_ROOTFS := $(LF_TARGET_ROOTFS)
|
||||
else
|
||||
# TARGET_ROOTFS := ubuntu
|
||||
# TARGET_ROOTFS := buildroot
|
||||
TARGET_ROOTFS := busybox
|
||||
# TARGET_ROOTFS := custom
|
||||
@@ -128,8 +127,6 @@ endif
|
||||
|
||||
ifneq ($(findstring $(TARGET_ROOTFS),custom),)
|
||||
ROOTFS_BUILD_ENV := custom drv
|
||||
else ifneq ($(findstring $(TARGET_ROOTFS),ubuntu),)
|
||||
ROOTFS_BUILD_ENV := ubuntu drv
|
||||
else ifneq ($(findstring $(TARGET_ROOTFS),buildroot),)
|
||||
ROOTFS_BUILD_ENV := rootfs_prepare pctools buildroot boardtools drv
|
||||
else #busybox
|
||||
@@ -287,7 +284,6 @@ BUILDROOT_CFG ?= config_normal
|
||||
BUILDROOT_VER ?= buildroot-2023.02.6
|
||||
BUILDROOT_DIR := $(SYSDRV_DIR)/source/buildroot
|
||||
|
||||
UBUNTU_VER ?= luckfox-ubuntu-22.04.3
|
||||
CUSTOM_VER ?= custom
|
||||
|
||||
TOOLCHAIN_RUNTIME_LIB_C:=lib.tar.bz2
|
||||
@@ -316,6 +312,7 @@ SYSDRV_RAMDISK_DIR ?= $(SYSDRV_DIR_OUT_BOARD)
|
||||
|
||||
HCITOOL_TOOL_PATH :=$(SYSDRV_DIR)/tools/board/buildroot/hcitool_patch
|
||||
MPV_PATCH_PATH :=$(SYSDRV_DIR)/tools/board/buildroot/mpv_patch
|
||||
BUSYBOX_PATCH_PATH :=$(SYSDRV_DIR)/tools/board/buildroot/busybox_patch
|
||||
|
||||
export SYSDRV_DIR_OUT_PC
|
||||
export SYSDRV_DIR_OUT_BOARD
|
||||
@@ -608,6 +605,8 @@ buildroot_create:
|
||||
cp ${HCITOOL_TOOL_PATH}/0002-Fix-build-errors.patch $(BUILDROOT_DIR)/$(BUILDROOT_VER)/package/bluez5_utils/
|
||||
cp ${HCITOOL_TOOL_PATH}/0003-fix-compat-wordexp.patch $(BUILDROOT_DIR)/$(BUILDROOT_VER)/package/bluez5_utils/
|
||||
cp ${MPV_PATCH_PATH}/0002-change-j1.patch $(BUILDROOT_DIR)/$(BUILDROOT_VER)/package/mpv/
|
||||
cp ${BUSYBOX_PATCH_PATH}/0009-busybox-support-chinese-display-in-terminal.patch $(BUILDROOT_DIR)/$(BUILDROOT_VER)/package/busybox/
|
||||
cp ${BUSYBOX_PATCH_PATH}/0010-halt-Support-rebooting-with-arg.patch $(BUILDROOT_DIR)/$(BUILDROOT_VER)/package/busybox/
|
||||
|
||||
buildroot: prepare
|
||||
@echo -e "$(C_GREEN) ==sysdrv== build buildroot $(C_NORMAL)"
|
||||
@@ -621,6 +620,8 @@ buildroot: prepare
|
||||
cp ${HCITOOL_TOOL_PATH}/0002-Fix-build-errors.patch $(BUILDROOT_DIR)/$(BUILDROOT_VER)/package/bluez5_utils/ ;\
|
||||
cp ${HCITOOL_TOOL_PATH}/0003-fix-compat-wordexp.patch $(BUILDROOT_DIR)/$(BUILDROOT_VER)/package/bluez5_utils/ ;\
|
||||
cp ${MPV_PATCH_PATH}/0002-change-j1.patch $(BUILDROOT_DIR)/$(BUILDROOT_VER)/package/mpv/ ;\
|
||||
cp ${BUSYBOX_PATCH_PATH}/0009-busybox-support-chinese-display-in-terminal.patch $(BUILDROOT_DIR)/$(BUILDROOT_VER)/package/busybox/ ;\
|
||||
cp ${BUSYBOX_PATCH_PATH}/0010-halt-Support-rebooting-with-arg.patch $(BUILDROOT_DIR)/$(BUILDROOT_VER)/package/busybox/ ;\
|
||||
);
|
||||
|
||||
$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) $(BUILDROOT_DEFCONFIG) -C $(BUILDROOT_DIR)/$(BUILDROOT_VER)
|
||||
@@ -646,28 +647,6 @@ endif
|
||||
buildroot_clean:
|
||||
$(AT)rm -rf $(BUILDROOT_DIR)/$(BUILDROOT_VER)
|
||||
|
||||
##########################################################################################
|
||||
# build ubuntu
|
||||
# author :luckfox team
|
||||
# date:2023-11-28
|
||||
##########################################################################################
|
||||
ubuntu: prepare
|
||||
@echo -e "$(C_GREEN) ==sysdrv== build ubuntu $(C_NORMAL)"
|
||||
@echo -e "$(C_GREEN) ==$(LF_TARGET_ROOTFS)== $(C_NORMAL)"
|
||||
test -f $(SYSDRV_DIR)/tools/board/ubuntu/$(UBUNTU_VER).tar.gz || (\
|
||||
pushd $(SYSDRV_DIR)/tools/board/ubuntu/ ;\
|
||||
./split_and_check_md5.sh merge ./$(UBUNTU_VER).tar.gz ;\
|
||||
popd ;\
|
||||
);
|
||||
test -f $(SYSDRV_DIR_OUT_ROOTFS)/userdate/.ubuntu || (\
|
||||
mkdir -p $(SYSDRV_DIR_OUT_ROOTFS) ;\
|
||||
rm $(SYSDRV_DIR_OUT_ROOTFS)/* -rf ;\
|
||||
tar xzf $(SYSDRV_DIR)/tools/board/ubuntu/$(UBUNTU_VER).tar.gz -C $(SYSDRV_DIR_OUT_ROOTFS) ;\
|
||||
);
|
||||
ubuntu_clean:
|
||||
$(AT)rm -rf $(SYSDRV_DIR_OUT_ROOTFS)
|
||||
|
||||
|
||||
##########################################################################################
|
||||
# build custom
|
||||
# author :luckfox team
|
||||
|
||||
@@ -83,5 +83,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/
|
||||
|
||||
|
||||
@@ -28,9 +28,11 @@ CONFIG_FORCE_DPD_CALIB = y
|
||||
CONFIG_LOFT_CALIB = n
|
||||
CONFIG_EXT_FEM_8800DCDW = n
|
||||
CONFIG_RESV_MEM_SUPPORT ?= y
|
||||
CONFIG_AMSDU_RX = n
|
||||
CONFIG_AMSDU_RX = y
|
||||
CONFIG_IRQ_FALL ?= n
|
||||
CONFIG_SDIO_BT = n
|
||||
CONFIG_RADAR_OR_IR_DETECT =n
|
||||
CONFIG_FOR_IPCAM = n
|
||||
|
||||
ifeq ($(CONFIG_EXT_FEM_8800DCDW), y)
|
||||
CONFIG_DPD = n
|
||||
@@ -57,6 +59,9 @@ 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
|
||||
|
||||
|
||||
obj-m := $(MODULE_NAME).o
|
||||
$(MODULE_NAME)-y := \
|
||||
@@ -126,6 +131,8 @@ MODDESTDIR ?= /lib/modules/$(KVER)/kernel/drivers/net/wireless/
|
||||
ARCH ?= x86_64
|
||||
CROSS_COMPILE ?=
|
||||
endif
|
||||
|
||||
ccflags-y += -Wno-unused-function
|
||||
###########################################
|
||||
|
||||
all: modules
|
||||
|
||||
@@ -23,37 +23,44 @@ typedef struct {
|
||||
#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 aicbsp_syscfg_tbl_8800d80[][2] = {
|
||||
};
|
||||
u32 aicbsp_syscfg_tbl_8800d80[][2] = {};
|
||||
|
||||
int aicbsp_system_config_8800d80(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
int syscfg_num = sizeof(aicbsp_syscfg_tbl_8800d80) / sizeof(u32) / 2;
|
||||
int ret, cnt;
|
||||
for (cnt = 0; cnt < syscfg_num; cnt++) {
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, aicbsp_syscfg_tbl_8800d80[cnt][0], aicbsp_syscfg_tbl_8800d80[cnt][1]);
|
||||
ret = rwnx_send_dbg_mem_write_req(
|
||||
sdiodev, aicbsp_syscfg_tbl_8800d80[cnt][0],
|
||||
aicbsp_syscfg_tbl_8800d80[cnt][1]);
|
||||
if (ret) {
|
||||
printk("%x write fail: %d\n", aicbsp_syscfg_tbl_8800d80[cnt][0], ret);
|
||||
printk("%x write fail: %d\n",
|
||||
aicbsp_syscfg_tbl_8800d80[cnt][0], ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
u32 adaptivity_patch_tbl_8800d80[][2] = {
|
||||
{ 0x000C, 0x0000320A }, //linkloss_thd
|
||||
{ 0x009C, 0x00000000 }, //ac_param_conf
|
||||
{ 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 CFG_USER_CHAN_MAX_TXPWR_EN 0
|
||||
#define CFG_PWROFST_COVER_CALIB 1
|
||||
#define CFG_USER_CHAN_MAX_TXPWR_EN 1
|
||||
#define CFG_USER_TX_USE_ANA_F 0
|
||||
#define CFG_USER_APM_PRBRSP_OFFLOAD_DISABLE 0
|
||||
|
||||
#define CFG_USER_EXT_FLAGS_EN (CFG_USER_CHAN_MAX_TXPWR_EN || CFG_USER_TX_USE_ANA_F)
|
||||
#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
|
||||
@@ -62,33 +69,40 @@ 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, 0x00000001
|
||||
{ 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_ext_flags
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RADAR_OR_IR_DETECT
|
||||
{ 0x019c, 0x00000100 }, //enable radar detect
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OOB
|
||||
// for 8800d40/d80 map data1 isr to gpiob1
|
||||
u32 gpio_cfg_tbl_8800d40d80[][2] = {
|
||||
{0x40504084, 0x00000006},
|
||||
{0x40500040, 0x00000000},
|
||||
{0x40100030, 0x00000001},
|
||||
{0x40241020, 0x00000001},
|
||||
{0x40240030, 0x00000004},
|
||||
{0x40240020, 0x03020700},
|
||||
{ 0x40504084, 0x00000006 }, { 0x40500040, 0x00000000 },
|
||||
{ 0x40100030, 0x00000001 }, { 0x40241020, 0x00000001 },
|
||||
{ 0x40240030, 0x00000004 }, { 0x40240020, 0x03020700 },
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -98,9 +112,12 @@ int aicwifi_sys_config_8800d80(struct aic_sdio_dev *sdiodev)
|
||||
int ret, cnt;
|
||||
int gpiocfg_num = sizeof(gpio_cfg_tbl_8800d40d80) / sizeof(u32) / 2;
|
||||
for (cnt = 0; cnt < gpiocfg_num; cnt++) {
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, gpio_cfg_tbl_8800d40d80[cnt][0], gpio_cfg_tbl_8800d40d80[cnt][1]);
|
||||
ret = rwnx_send_dbg_mem_write_req(
|
||||
sdiodev, gpio_cfg_tbl_8800d40d80[cnt][0],
|
||||
gpio_cfg_tbl_8800d40d80[cnt][1]);
|
||||
if (ret) {
|
||||
printk("%x write fail: %d\n", gpio_cfg_tbl_8800d40d80[cnt][0], ret);
|
||||
printk("%x write fail: %d\n",
|
||||
gpio_cfg_tbl_8800d40d80[cnt][0], ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -130,12 +147,14 @@ int aicwifi_patch_config_8800d80(struct aic_sdio_dev *sdiodev)
|
||||
|
||||
if (adap_test) {
|
||||
printk("%s for adaptivity test \r\n", __func__);
|
||||
adap_patch_cnt = sizeof(adaptivity_patch_tbl_8800d80)/sizeof(u32)/2;
|
||||
adap_patch_cnt =
|
||||
sizeof(adaptivity_patch_tbl_8800d80) / sizeof(u32) / 2;
|
||||
}
|
||||
|
||||
aic_patch_addr = rd_patch_addr + 8;
|
||||
|
||||
ret = rwnx_send_dbg_mem_read_req(sdiodev, rd_patch_addr, &rd_patch_addr_cfm);
|
||||
ret = rwnx_send_dbg_mem_read_req(sdiodev, rd_patch_addr,
|
||||
&rd_patch_addr_cfm);
|
||||
if (ret) {
|
||||
printk("patch rd fail\n");
|
||||
return ret;
|
||||
@@ -143,7 +162,8 @@ int aicwifi_patch_config_8800d80(struct aic_sdio_dev *sdiodev)
|
||||
|
||||
config_base = rd_patch_addr_cfm.memdata;
|
||||
|
||||
ret = rwnx_send_dbg_mem_read_req(sdiodev, aic_patch_addr, &rd_patch_addr_cfm);
|
||||
ret = rwnx_send_dbg_mem_read_req(sdiodev, aic_patch_addr,
|
||||
&rd_patch_addr_cfm);
|
||||
if (ret) {
|
||||
printk("patch str rd fail\n");
|
||||
return ret;
|
||||
@@ -152,7 +172,8 @@ int aicwifi_patch_config_8800d80(struct aic_sdio_dev *sdiodev)
|
||||
|
||||
#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))) {
|
||||
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;
|
||||
}
|
||||
@@ -161,7 +182,8 @@ int aicwifi_patch_config_8800d80(struct aic_sdio_dev *sdiodev)
|
||||
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);
|
||||
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;
|
||||
@@ -171,37 +193,45 @@ int aicwifi_patch_config_8800d80(struct aic_sdio_dev *sdiodev)
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(magic_num), AIC_PATCH_MAGIG_NUM);
|
||||
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));
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(magic_num_2), AIC_PATCH_MAGIG_NUM_2);
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(magic_num_2),
|
||||
AIC_PATCH_MAGIG_NUM_2);
|
||||
if (ret) {
|
||||
printk("0x%x write fail\n", AIC_PATCH_ADDR(magic_num_2));
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(pair_start), patch_addr);
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(pair_start),
|
||||
patch_addr);
|
||||
if (ret) {
|
||||
printk("0x%x write fail\n", AIC_PATCH_ADDR(pair_start));
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(pair_count), patch_cnt + adap_patch_cnt);
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(pair_count),
|
||||
patch_cnt + adap_patch_cnt);
|
||||
if (ret) {
|
||||
printk("0x%x write fail\n", AIC_PATCH_ADDR(pair_count));
|
||||
return ret;
|
||||
}
|
||||
|
||||
for (cnt = 0; cnt < patch_cnt; cnt++) {
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, start_addr+8*cnt, patch_tbl_8800d80[cnt][0]+config_base);
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, start_addr + 8 * cnt,
|
||||
patch_tbl_8800d80[cnt][0] +
|
||||
config_base);
|
||||
if (ret) {
|
||||
printk("%x write fail\n", start_addr + 8 * cnt);
|
||||
return ret;
|
||||
}
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, start_addr+8*cnt+4, patch_tbl_8800d80[cnt][1]);
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev,
|
||||
start_addr + 8 * cnt + 4,
|
||||
patch_tbl_8800d80[cnt][1]);
|
||||
if (ret) {
|
||||
printk("%x write fail\n", start_addr + 8 * cnt + 4);
|
||||
return ret;
|
||||
@@ -212,41 +242,53 @@ int aicwifi_patch_config_8800d80(struct aic_sdio_dev *sdiodev)
|
||||
int tmp_cnt = patch_cnt + adap_patch_cnt;
|
||||
for (cnt = patch_cnt; cnt < tmp_cnt; cnt++) {
|
||||
int tbl_idx = cnt - patch_cnt;
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, start_addr+8*cnt, adaptivity_patch_tbl_8800d80[tbl_idx][0]+config_base);
|
||||
ret = rwnx_send_dbg_mem_write_req(
|
||||
sdiodev, start_addr + 8 * cnt,
|
||||
adaptivity_patch_tbl_8800d80[tbl_idx][0] +
|
||||
config_base);
|
||||
if (ret) {
|
||||
printk("%x write fail\n", start_addr + 8 * cnt);
|
||||
return ret;
|
||||
}
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, start_addr+8*cnt+4, adaptivity_patch_tbl_8800d80[tbl_idx][1]);
|
||||
ret = rwnx_send_dbg_mem_write_req(
|
||||
sdiodev, start_addr + 8 * cnt + 4,
|
||||
adaptivity_patch_tbl_8800d80[tbl_idx][1]);
|
||||
if (ret) {
|
||||
printk("%x write fail\n", start_addr+8*cnt+4);
|
||||
printk("%x write fail\n",
|
||||
start_addr + 8 * cnt + 4);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(block_size[0]), 0);
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev,
|
||||
AIC_PATCH_ADDR(block_size[0]), 0);
|
||||
if (ret) {
|
||||
printk("block_size[0x%x] write fail: %d\n", AIC_PATCH_ADDR(block_size[0]), ret);
|
||||
printk("block_size[0x%x] write fail: %d\n",
|
||||
AIC_PATCH_ADDR(block_size[0]), ret);
|
||||
return ret;
|
||||
}
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(block_size[1]), 0);
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev,
|
||||
AIC_PATCH_ADDR(block_size[1]), 0);
|
||||
if (ret) {
|
||||
printk("block_size[0x%x] write fail: %d\n", AIC_PATCH_ADDR(block_size[1]), ret);
|
||||
printk("block_size[0x%x] write fail: %d\n",
|
||||
AIC_PATCH_ADDR(block_size[1]), ret);
|
||||
return ret;
|
||||
}
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(block_size[2]), 0);
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev,
|
||||
AIC_PATCH_ADDR(block_size[2]), 0);
|
||||
if (ret) {
|
||||
printk("block_size[0x%x] write fail: %d\n", AIC_PATCH_ADDR(block_size[2]), ret);
|
||||
printk("block_size[0x%x] write fail: %d\n",
|
||||
AIC_PATCH_ADDR(block_size[2]), ret);
|
||||
return ret;
|
||||
}
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(block_size[3]), 0);
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev,
|
||||
AIC_PATCH_ADDR(block_size[3]), 0);
|
||||
if (ret) {
|
||||
printk("block_size[0x%x] write fail: %d\n", AIC_PATCH_ADDR(block_size[3]), ret);
|
||||
printk("block_size[0x%x] write fail: %d\n",
|
||||
AIC_PATCH_ADDR(block_size[3]), ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,8 +17,4 @@ int aicbsp_system_config_8800d80(struct aic_sdio_dev *sdiodev);
|
||||
int aicwifi_sys_config_8800d80(struct aic_sdio_dev *sdiodev);
|
||||
int aicwifi_patch_config_8800d80(struct aic_sdio_dev *sdiodev);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,18 +23,21 @@ void system_config_8800dc(struct aic_sdio_dev *rwnx_hw);
|
||||
int aicwf_misc_ram_init_8800dc(struct aic_sdio_dev *sdiodev);
|
||||
|
||||
#ifdef CONFIG_DPD
|
||||
int aicwf_dpd_calib_8800dc(struct aic_sdio_dev *sdiodev, rf_misc_ram_lite_t *dpd_res);
|
||||
int aicwf_dpd_result_apply_8800dc(struct aic_sdio_dev *sdiodev, rf_misc_ram_lite_t *dpd_res);
|
||||
int aicwf_dpd_calib_8800dc(struct aic_sdio_dev *sdiodev,
|
||||
rf_misc_ram_lite_t *dpd_res);
|
||||
int aicwf_dpd_result_apply_8800dc(struct aic_sdio_dev *sdiodev,
|
||||
rf_misc_ram_lite_t *dpd_res);
|
||||
#ifndef CONFIG_FORCE_DPD_CALIB
|
||||
int aicwf_dpd_result_load_8800dc(struct aic_sdio_dev *sdiodev, rf_misc_ram_lite_t *dpd_res);
|
||||
int aicwf_dpd_result_load_8800dc(struct aic_sdio_dev *sdiodev,
|
||||
rf_misc_ram_lite_t *dpd_res);
|
||||
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);
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||
@@ -46,7 +46,6 @@ extern int aicwf_dbg_level_bsp;
|
||||
|
||||
#define AICWF_LOG "AICWFDBG("
|
||||
|
||||
#ifdef DEBUG
|
||||
#define AICWFDBG(level, args, arg...) \
|
||||
do { \
|
||||
if (aicwf_dbg_level_bsp & level) { \
|
||||
@@ -61,12 +60,6 @@ do { \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
|
||||
#define AICWFDBG(level, args, arg...)
|
||||
#define RWNX_DBG(fmt, ...)
|
||||
|
||||
#endif
|
||||
/// Message structure for MSGs from Emb to App
|
||||
struct ipc_e2a_msg {
|
||||
u16 id; ///< Message id.
|
||||
@@ -134,7 +127,8 @@ struct rwnx_cmd_mgr {
|
||||
|
||||
int (*queue)(struct rwnx_cmd_mgr *, struct rwnx_cmd *);
|
||||
int (*llind)(struct rwnx_cmd_mgr *, struct rwnx_cmd *);
|
||||
int (*msgind)(struct rwnx_cmd_mgr *, struct rwnx_cmd_e2amsg *, msg_cb_fct);
|
||||
int (*msgind)(struct rwnx_cmd_mgr *, struct rwnx_cmd_e2amsg *,
|
||||
msg_cb_fct);
|
||||
void (*print)(struct rwnx_cmd_mgr *);
|
||||
void (*drain)(struct rwnx_cmd_mgr *);
|
||||
|
||||
@@ -144,7 +138,8 @@ struct rwnx_cmd_mgr {
|
||||
|
||||
void rwnx_cmd_mgr_init(struct rwnx_cmd_mgr *cmd_mgr);
|
||||
void rwnx_cmd_mgr_deinit(struct rwnx_cmd_mgr *cmd_mgr);
|
||||
int cmd_mgr_queue_force_defer(struct rwnx_cmd_mgr *cmd_mgr, struct rwnx_cmd *cmd);
|
||||
int cmd_mgr_queue_force_defer(struct rwnx_cmd_mgr *cmd_mgr,
|
||||
struct rwnx_cmd *cmd);
|
||||
void rwnx_set_cmd_tx(void *dev, struct lmac_msg *msg, uint len);
|
||||
|
||||
enum {
|
||||
@@ -238,7 +233,6 @@ enum dbg_msg_tag {
|
||||
DBG_GPIO_WRITE_REQ,
|
||||
DBG_GPIO_WRITE_CFM,
|
||||
|
||||
|
||||
/// Max number of Debug messages
|
||||
DBG_MAX,
|
||||
};
|
||||
@@ -256,7 +250,6 @@ enum {
|
||||
HOST_START_APP_DUMMY = 5,
|
||||
};
|
||||
|
||||
|
||||
struct dbg_mem_block_write_req {
|
||||
u32 memaddr;
|
||||
u32 memsize;
|
||||
@@ -317,10 +310,9 @@ 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
|
||||
int aicwf_misc_ram_valid_check_8800dc(struct aic_sdio_dev *sdiodev, int *valid_out);
|
||||
#endif
|
||||
#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
|
||||
|
||||
@@ -329,14 +321,19 @@ int aicwf_patch_table_load(struct aic_sdio_dev *rwnx_hw, char *filename);
|
||||
|
||||
int rwnx_send_dbg_mem_read_req(struct aic_sdio_dev *sdiodev, u32 mem_addr,
|
||||
struct dbg_mem_read_cfm *cfm);
|
||||
int rwnx_send_dbg_mem_block_write_req(struct aic_sdio_dev *sdiodev, u32 mem_addr,
|
||||
u32 mem_size, u32 *mem_data);
|
||||
int rwnx_send_dbg_mem_write_req(struct aic_sdio_dev *sdiodev, u32 mem_addr, u32 mem_data);
|
||||
int rwnx_send_dbg_mem_block_write_req(struct aic_sdio_dev *sdiodev,
|
||||
u32 mem_addr, u32 mem_size,
|
||||
u32 *mem_data);
|
||||
int rwnx_send_dbg_mem_write_req(struct aic_sdio_dev *sdiodev, u32 mem_addr,
|
||||
u32 mem_data);
|
||||
int rwnx_send_dbg_mem_mask_write_req(struct aic_sdio_dev *sdiodev, u32 mem_addr,
|
||||
u32 mem_mask, u32 mem_data);
|
||||
int rwnx_send_dbg_start_app_req(struct aic_sdio_dev *sdiodev, u32 boot_addr, u32 boot_type, struct dbg_start_app_cfm *start_app_cfm);
|
||||
int rwnx_send_dbg_start_app_req(struct aic_sdio_dev *sdiodev, u32 boot_addr,
|
||||
u32 boot_type,
|
||||
struct dbg_start_app_cfm *start_app_cfm);
|
||||
|
||||
int rwnx_plat_bin_fw_upload_android(struct aic_sdio_dev *sdiodev, u32 fw_addr, const char *filename);
|
||||
int rwnx_plat_bin_fw_upload_android(struct aic_sdio_dev *sdiodev, u32 fw_addr,
|
||||
const char *filename);
|
||||
|
||||
void rwnx_rx_handle_msg(struct aic_sdio_dev *sdiodev, struct ipc_e2a_msg *msg);
|
||||
int aicbsp_platform_init(struct aic_sdio_dev *sdiodev);
|
||||
@@ -352,6 +349,7 @@ int aicbsp_resv_mem_deinit(void);
|
||||
#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
|
||||
@@ -369,7 +367,6 @@ int aicbsp_resv_mem_deinit(void);
|
||||
|
||||
#define AICBT_PT_TAG "AICBT_PT_TAG"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Addresses within RWNX_ADDR_CPU
|
||||
*****************************************************************************/
|
||||
@@ -378,12 +375,16 @@ int aicbsp_resv_mem_deinit(void);
|
||||
#define ROM_FMAC_FW_ADDR 0x00010000
|
||||
#define ROM_FMAC_PATCH_ADDR 0x00180000
|
||||
|
||||
#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"
|
||||
#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"
|
||||
#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"
|
||||
#define RWNX_MAC_CALIB_NAME_8800DC_H_U02 \
|
||||
RWNX_MAC_CALIB_BASE_NAME_8800DC "_h_u02.bin"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DPD) || defined(CONFIG_LOFT_CALIB)
|
||||
@@ -403,21 +404,27 @@ int aicbsp_resv_mem_deinit(void);
|
||||
#else
|
||||
#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"
|
||||
#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"
|
||||
#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"
|
||||
#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"
|
||||
#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"
|
||||
#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"
|
||||
#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"
|
||||
@@ -508,11 +515,13 @@ 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
|
||||
@@ -526,7 +535,7 @@ enum chip_rev {
|
||||
#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
|
||||
@@ -551,6 +560,7 @@ struct aicbt_info_t {
|
||||
|
||||
struct aicbt_patch_info_t {
|
||||
uint32_t info_len;
|
||||
//base len start
|
||||
uint32_t adid_addrinf;
|
||||
uint32_t addr_adid;
|
||||
uint32_t patch_addrinf;
|
||||
@@ -559,6 +569,11 @@ struct aicbt_patch_info_t {
|
||||
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 {
|
||||
@@ -567,6 +582,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 {
|
||||
@@ -589,5 +605,6 @@ 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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "rwnx_version_gen.h"
|
||||
#include "aicwf_txq_prealloc.h"
|
||||
|
||||
|
||||
#define DRV_DESCRIPTION "AIC BSP"
|
||||
#define DRV_COPYRIGHT "Copyright(c) 2015-2020 AICSemi"
|
||||
#define DRV_AUTHOR "AICSemi"
|
||||
@@ -17,13 +16,14 @@
|
||||
|
||||
int aicwf_dbg_level_bsp = LOGERROR | LOGINFO | LOGDEBUG | LOGTRACE;
|
||||
|
||||
struct semaphore aicbsp_probe_semaphore;
|
||||
|
||||
static struct platform_device *aicbsp_pdev;
|
||||
|
||||
const struct aicbsp_firmware *aicbsp_firmware_list = fw_u02;
|
||||
|
||||
const struct aicbsp_firmware fw_u02[] = {
|
||||
[AICBSP_CPMODE_WORK] = {
|
||||
.desc = "normal work mode(sdio u02)",
|
||||
[AICBSP_CPMODE_WORK] = { .desc = "normal work mode(sdio u02)",
|
||||
.bt_adid = "fw_adid.bin",
|
||||
.bt_patch = "fw_patch.bin",
|
||||
.bt_table = "fw_patch_table.bin",
|
||||
@@ -33,18 +33,15 @@ const struct aicbsp_firmware fw_u02[] = {
|
||||
.wl_fw = "fmacfw.bin"
|
||||
#endif
|
||||
},
|
||||
[AICBSP_CPMODE_TEST] = {
|
||||
.desc = "rf test mode(sdio u02)",
|
||||
[AICBSP_CPMODE_TEST] = { .desc = "rf test mode(sdio u02)",
|
||||
.bt_adid = "fw_adid.bin",
|
||||
.bt_patch = "fw_patch.bin",
|
||||
.bt_table = "fw_patch_table.bin",
|
||||
.wl_fw = "fmacfw_rf.bin"
|
||||
},
|
||||
.wl_fw = "fmacfw_rf.bin" },
|
||||
};
|
||||
|
||||
const struct aicbsp_firmware fw_u03[] = {
|
||||
[AICBSP_CPMODE_WORK] = {
|
||||
.desc = "normal work mode(sdio u03/u04)",
|
||||
[AICBSP_CPMODE_WORK] = { .desc = "normal work mode(sdio u03/u04)",
|
||||
.bt_adid = "fw_adid_u03.bin",
|
||||
.bt_patch = "fw_patch_u03.bin",
|
||||
.bt_table = "fw_patch_table_u03.bin",
|
||||
@@ -57,40 +54,34 @@ const struct aicbsp_firmware fw_u03[] = {
|
||||
#endif
|
||||
},
|
||||
|
||||
[AICBSP_CPMODE_TEST] = {
|
||||
.desc = "rf test mode(sdio u03/u04)",
|
||||
[AICBSP_CPMODE_TEST] = { .desc = "rf test mode(sdio u03/u04)",
|
||||
.bt_adid = "fw_adid_u03.bin",
|
||||
.bt_patch = "fw_patch_u03.bin",
|
||||
.bt_table = "fw_patch_table_u03.bin",
|
||||
.wl_fw = "fmacfw_rf.bin"
|
||||
},
|
||||
.wl_fw = "fmacfw_rf.bin" },
|
||||
};
|
||||
|
||||
const struct aicbsp_firmware fw_8800dc_u01[] = {
|
||||
[AICBSP_CPMODE_WORK] = {
|
||||
.desc = "normal work mode(sdio u01)",
|
||||
[AICBSP_CPMODE_WORK] = { .desc = "normal work mode(sdio u01)",
|
||||
.bt_adid = "fw_adid_8800dc.bin",
|
||||
.bt_patch = "fw_patch_8800dc.bin",
|
||||
.bt_table = "fw_patch_table_8800dc.bin",
|
||||
.wl_fw = "fmacfw_8800dc.bin"
|
||||
},
|
||||
.wl_fw = "fmacfw_8800dc.bin" },
|
||||
|
||||
[AICBSP_CPMODE_TEST] = {
|
||||
.desc = "rf test mode(sdio u01)",
|
||||
[AICBSP_CPMODE_TEST] = { .desc = "rf test mode(sdio u01)",
|
||||
.bt_adid = "fw_adid_8800dc.bin",
|
||||
.bt_patch = "fw_patch_8800dc.bin",
|
||||
.bt_table = "fw_patch_table_8800dc.bin",
|
||||
.wl_fw = "fmacfw_rf_8800dc.bin"
|
||||
},
|
||||
.wl_fw = "fmacfw_rf_8800dc.bin" },
|
||||
};
|
||||
|
||||
|
||||
const struct aicbsp_firmware fw_8800dc_u02[] = {
|
||||
[AICBSP_CPMODE_WORK] = {
|
||||
.desc = "normal work mode(8800dc sdio 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"
|
||||
},
|
||||
|
||||
@@ -99,6 +90,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
|
||||
},
|
||||
};
|
||||
@@ -109,6 +101,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"
|
||||
},
|
||||
|
||||
@@ -117,71 +110,87 @@ 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
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
const struct aicbsp_firmware fw_8800d80_u01[] = {
|
||||
[AICBSP_CPMODE_WORK] = {
|
||||
.desc = "normal work mode(8800d80 sdio u01)",
|
||||
[AICBSP_CPMODE_WORK] = { .desc = "normal work mode(8800d80 sdio u01)",
|
||||
.bt_adid = "fw_adid_8800d80.bin",
|
||||
.bt_patch = "fw_patch_8800d80.bin",
|
||||
.bt_table = "fw_patch_table_8800d80.bin",
|
||||
.wl_fw = "fmacfw_8800d80.bin"
|
||||
},
|
||||
.wl_fw = "fmacfw_8800d80.bin" },
|
||||
|
||||
[AICBSP_CPMODE_TEST] = {
|
||||
.desc = "rf test mode(8800d80 sdio u01)",
|
||||
[AICBSP_CPMODE_TEST] = { .desc = "rf test mode(8800d80 sdio u01)",
|
||||
.bt_adid = "fw_adid_8800d80.bin",
|
||||
.bt_patch = "fw_patch_8800d80.bin",
|
||||
.bt_table = "fw_patch_table_8800d80.bin",
|
||||
.wl_fw = "lmacfw_rf_8800d80.bin"
|
||||
},
|
||||
.wl_fw = "lmacfw_rf_8800d80.bin" },
|
||||
};
|
||||
|
||||
const struct aicbsp_firmware fw_8800d80_u02[] = {
|
||||
[AICBSP_CPMODE_WORK] = {
|
||||
.desc = "normal work mode(8800d80 sdio u02)",
|
||||
[AICBSP_CPMODE_WORK] = { .desc = "normal work 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",
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
.wl_fw = "fmacfwbt_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"
|
||||
.wl_fw = "fmacfw_8800d80_u02.bin",
|
||||
#endif
|
||||
},
|
||||
.bt_ext_patch = "fw_patch_8800d80_u02_ext" },
|
||||
|
||||
[AICBSP_CPMODE_TEST] = {
|
||||
.desc = "rf test mode(8800d80 sdio u02)",
|
||||
[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"
|
||||
},
|
||||
.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)",
|
||||
[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",
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
.wl_fw = "fmacfwbt_8800d80_h_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"
|
||||
.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)",
|
||||
[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"
|
||||
},
|
||||
.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" },
|
||||
};
|
||||
|
||||
struct aicbsp_info_t aicbsp_info = {
|
||||
@@ -207,8 +216,8 @@ static struct platform_driver aicbsp_driver = {
|
||||
//.remove = aicbsp_remove,
|
||||
};
|
||||
|
||||
static ssize_t cpmode_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
static ssize_t cpmode_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
ssize_t count = 0;
|
||||
uint8_t i = 0;
|
||||
@@ -217,19 +226,25 @@ static ssize_t cpmode_show(struct device *dev,
|
||||
|
||||
for (i = 0; i < AICBSP_CPMODE_MAX; i++) {
|
||||
if (aicbsp_firmware_list[i].desc)
|
||||
count += sprintf(&buf[count], " %2d: %s\n", i, aicbsp_firmware_list[i].desc);
|
||||
count += sprintf(&buf[count], " %2d: %s\n", i,
|
||||
aicbsp_firmware_list[i].desc);
|
||||
}
|
||||
|
||||
count += sprintf(&buf[count], "Current: %d, firmware info:\n", aicbsp_info.cpmode);
|
||||
count += sprintf(&buf[count], " BT ADID : %s\n", aicbsp_firmware_list[aicbsp_info.cpmode].bt_adid);
|
||||
count += sprintf(&buf[count], " BT PATCH: %s\n", aicbsp_firmware_list[aicbsp_info.cpmode].bt_patch);
|
||||
count += sprintf(&buf[count], " BT TABLE: %s\n", aicbsp_firmware_list[aicbsp_info.cpmode].bt_table);
|
||||
count += sprintf(&buf[count], " WIFI FW : %s\n", aicbsp_firmware_list[aicbsp_info.cpmode].wl_fw);
|
||||
count += sprintf(&buf[count], "Current: %d, firmware info:\n",
|
||||
aicbsp_info.cpmode);
|
||||
count += sprintf(&buf[count], " BT ADID : %s\n",
|
||||
aicbsp_firmware_list[aicbsp_info.cpmode].bt_adid);
|
||||
count += sprintf(&buf[count], " BT PATCH: %s\n",
|
||||
aicbsp_firmware_list[aicbsp_info.cpmode].bt_patch);
|
||||
count += sprintf(&buf[count], " BT TABLE: %s\n",
|
||||
aicbsp_firmware_list[aicbsp_info.cpmode].bt_table);
|
||||
count += sprintf(&buf[count], " WIFI FW : %s\n",
|
||||
aicbsp_firmware_list[aicbsp_info.cpmode].wl_fw);
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t cpmode_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
static ssize_t cpmode_store(struct device *dev, struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
unsigned long val;
|
||||
int err = kstrtoul(buf, 0, &val);
|
||||
@@ -242,13 +257,14 @@ static ssize_t cpmode_store(struct device *dev,
|
||||
}
|
||||
|
||||
aicbsp_info.cpmode = val;
|
||||
printk("%s, set mode to: %lu[%s] done\n", __func__, val, aicbsp_firmware_list[val].desc);
|
||||
printk("%s, set mode to: %lu[%s] done\n", __func__, val,
|
||||
aicbsp_firmware_list[val].desc);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t hwinfo_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
static ssize_t hwinfo_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
ssize_t count = 0;
|
||||
|
||||
@@ -260,20 +276,23 @@ static ssize_t hwinfo_show(struct device *dev,
|
||||
|
||||
count += sprintf(&buf[count], "hwinfo read: ");
|
||||
if (aicbsp_info.hwinfo_r < 0)
|
||||
count += sprintf(&buf[count], "%d(not avalible), ", aicbsp_info.hwinfo_r);
|
||||
count += sprintf(&buf[count], "%d(not avalible), ",
|
||||
aicbsp_info.hwinfo_r);
|
||||
else
|
||||
count += sprintf(&buf[count], "0x%02X, ", aicbsp_info.hwinfo_r);
|
||||
|
||||
if (aicbsp_info.hwinfo < 0)
|
||||
count += sprintf(&buf[count], "set: %d(not avalible)\n", aicbsp_info.hwinfo);
|
||||
count += sprintf(&buf[count], "set: %d(not avalible)\n",
|
||||
aicbsp_info.hwinfo);
|
||||
else
|
||||
count += sprintf(&buf[count], "set: 0x%02X\n", aicbsp_info.hwinfo);
|
||||
count += sprintf(&buf[count], "set: 0x%02X\n",
|
||||
aicbsp_info.hwinfo);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t hwinfo_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
static ssize_t hwinfo_store(struct device *dev, struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
long val;
|
||||
int err = kstrtol(buf, 0, &val);
|
||||
@@ -292,8 +311,8 @@ static ssize_t hwinfo_store(struct device *dev,
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t fwdebug_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
static ssize_t fwdebug_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
ssize_t count = 0;
|
||||
|
||||
@@ -303,8 +322,8 @@ static ssize_t fwdebug_show(struct device *dev,
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t fwdebug_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
static ssize_t fwdebug_store(struct device *dev, struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
long val;
|
||||
int err = kstrtol(buf, 0, &val);
|
||||
@@ -323,14 +342,11 @@ static ssize_t fwdebug_store(struct device *dev,
|
||||
return count;
|
||||
}
|
||||
|
||||
static DEVICE_ATTR(cpmode, S_IRUGO | S_IWUSR,
|
||||
cpmode_show, cpmode_store);
|
||||
static DEVICE_ATTR(cpmode, S_IRUGO | S_IWUSR, cpmode_show, cpmode_store);
|
||||
|
||||
static DEVICE_ATTR(hwinfo, S_IRUGO | S_IWUSR,
|
||||
hwinfo_show, hwinfo_store);
|
||||
static DEVICE_ATTR(hwinfo, S_IRUGO | S_IWUSR, hwinfo_show, hwinfo_store);
|
||||
|
||||
static DEVICE_ATTR(fwdebug, S_IRUGO | S_IWUSR,
|
||||
fwdebug_show, fwdebug_store);
|
||||
static DEVICE_ATTR(fwdebug, S_IRUGO | S_IWUSR, fwdebug_show, fwdebug_store);
|
||||
|
||||
static struct attribute *aicbsp_attributes[] = {
|
||||
&dev_attr_cpmode.attr,
|
||||
@@ -349,7 +365,6 @@ int adap_test = 0;
|
||||
module_param(testmode, int, 0660);
|
||||
module_param(adap_test, int, 0660);
|
||||
|
||||
|
||||
static int __init aicbsp_init(void)
|
||||
{
|
||||
int ret;
|
||||
@@ -359,6 +374,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);
|
||||
@@ -372,7 +390,8 @@ static int __init aicbsp_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = sysfs_create_group(&(aicbsp_pdev->dev.kobj), &aicbsp_attribute_group);
|
||||
ret = sysfs_create_group(&(aicbsp_pdev->dev.kobj),
|
||||
&aicbsp_attribute_group);
|
||||
if (ret) {
|
||||
pr_err("register sysfs create group failed!\n");
|
||||
return ret;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <linux/rfkill-wlan.h>
|
||||
#endif /* CONFIG_PLATFORM_ROCKCHIP */
|
||||
|
||||
|
||||
#ifdef CONFIG_PLATFORM_ALLWINNER
|
||||
extern void sunxi_mmc_rescan_card(unsigned ids);
|
||||
extern void sunxi_wlan_set_power(int on);
|
||||
@@ -42,13 +41,12 @@ extern void extern_wifi_set_enable(int is_on);
|
||||
extern void set_power_control_lock(int lock);
|
||||
#endif //for AML
|
||||
|
||||
|
||||
static int aicbsp_platform_power_on(void);
|
||||
static void aicbsp_platform_power_off(void);
|
||||
|
||||
struct aic_sdio_dev *aicbsp_sdiodev = NULL;
|
||||
static struct semaphore *aicbsp_notify_semaphore;
|
||||
static struct semaphore *aicbsp_probe_semaphore = NULL;
|
||||
extern struct semaphore aicbsp_probe_semaphore;
|
||||
|
||||
static const struct sdio_device_id aicbsp_sdmmc_ids[];
|
||||
static bool aicbsp_load_fw_in_fdrv = false;
|
||||
@@ -69,7 +67,6 @@ module_param_string(saved_sdk_ver, saved_sdk_ver,64, 0660);
|
||||
|
||||
extern int testmode;
|
||||
|
||||
|
||||
#define SDIO_DEVICE_ID_AIC8801_FUNC2 0x0146
|
||||
#define SDIO_DEVICE_ID_AIC8800D80_FUNC2 0x0182
|
||||
|
||||
@@ -77,13 +74,15 @@ 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)
|
||||
static int aicbsp_dummy_probe(struct sdio_func *func,
|
||||
const struct sdio_device_id *id)
|
||||
{
|
||||
if (func && (func->num != 2))
|
||||
return 0;
|
||||
@@ -170,10 +169,12 @@ int aicbsp_set_subsys(int subsys, int state)
|
||||
pre_power_state = pre_power_map > 0;
|
||||
cur_power_state = cur_power_map > 0;
|
||||
|
||||
sdio_dbg("%s, subsys: %s, state to: %d\n", __func__, aicbsp_subsys_name(subsys), state);
|
||||
sdio_dbg("%s, subsys: %s, state to: %d\n", __func__,
|
||||
aicbsp_subsys_name(subsys), state);
|
||||
|
||||
if (cur_power_state != pre_power_state) {
|
||||
sdio_dbg("%s, power state change to %d dure to %s\n", __func__, cur_power_state, aicbsp_subsys_name(subsys));
|
||||
sdio_dbg("%s, power state change to %d dure to %s\n", __func__,
|
||||
cur_power_state, aicbsp_subsys_name(subsys));
|
||||
if (cur_power_state) {
|
||||
if (aicbsp_platform_power_on() < 0)
|
||||
goto err0;
|
||||
@@ -203,7 +204,8 @@ int aicbsp_set_subsys(int subsys, int state)
|
||||
aicbsp_platform_power_off();
|
||||
}
|
||||
} else {
|
||||
sdio_dbg("%s, power state no need to change, current: %d\n", __func__, cur_power_state);
|
||||
sdio_dbg("%s, power state no need to change, current: %d\n",
|
||||
__func__, cur_power_state);
|
||||
}
|
||||
pre_power_map = cur_power_map;
|
||||
mutex_unlock(&aicbsp_power_lock);
|
||||
@@ -218,32 +220,42 @@ err1:
|
||||
aicbsp_platform_power_off();
|
||||
|
||||
err0:
|
||||
sdio_dbg("%s, fail to set %s power state to %d\n", __func__, aicbsp_subsys_name(subsys), state);
|
||||
sdio_dbg("%s, fail to set %s power state to %d\n", __func__,
|
||||
aicbsp_subsys_name(subsys), state);
|
||||
mutex_unlock(&aicbsp_power_lock);
|
||||
return -1;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(aicbsp_set_subsys);
|
||||
|
||||
bool aicbsp_get_load_fw_in_fdrv(void){
|
||||
bool aicbsp_get_load_fw_in_fdrv(void)
|
||||
{
|
||||
return aicbsp_load_fw_in_fdrv;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL_GPL(aicbsp_get_load_fw_in_fdrv);
|
||||
|
||||
static int aicwf_sdio_chipmatch(struct aic_sdio_dev *sdio_dev, uint16_t vid, uint16_t did){
|
||||
|
||||
static int aicwf_sdio_chipmatch(struct aic_sdio_dev *sdio_dev, uint16_t vid,
|
||||
uint16_t did)
|
||||
{
|
||||
if (vid == SDIO_VENDOR_ID_AIC8801 && did == SDIO_DEVICE_ID_AIC8801) {
|
||||
sdio_dev->chipid = PRODUCT_ID_AIC8801;
|
||||
AICWFDBG(LOGINFO, "%s USE AIC8801\r\n", __func__);
|
||||
return 0;
|
||||
}else if(vid == SDIO_VENDOR_ID_AIC8800DC && did == SDIO_DEVICE_ID_AIC8800DC){
|
||||
} else if (vid == SDIO_VENDOR_ID_AIC8800DC &&
|
||||
did == SDIO_DEVICE_ID_AIC8800DC) {
|
||||
sdio_dev->chipid = PRODUCT_ID_AIC8800DC;
|
||||
AICWFDBG(LOGINFO, "%s USE AIC8800DC\r\n", __func__);
|
||||
return 0;
|
||||
}else if(vid == SDIO_VENDOR_ID_AIC8800D80 && did == SDIO_DEVICE_ID_AIC8800D80){
|
||||
} else if (vid == SDIO_VENDOR_ID_AIC8800D80 &&
|
||||
did == SDIO_DEVICE_ID_AIC8800D80) {
|
||||
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;
|
||||
}
|
||||
@@ -257,7 +269,6 @@ void *aicbsp_get_drvdata(void *args)
|
||||
return dev_get_drvdata((const struct device *)args);
|
||||
}
|
||||
|
||||
|
||||
static int aicbsp_sdio_probe(struct sdio_func *func,
|
||||
const struct sdio_device_id *id)
|
||||
{
|
||||
@@ -271,11 +282,6 @@ static int aicbsp_sdio_probe(struct sdio_func *func,
|
||||
return err;
|
||||
}
|
||||
|
||||
if (aicbsp_probe_semaphore == NULL) {
|
||||
sdio_err("%s bsp_probe_semaphore is null\n", __func__);
|
||||
return err;
|
||||
}
|
||||
|
||||
sdio_dbg("%s:%d vid:0x%04X did:0x%04X\n", __func__, func->num,
|
||||
func->vendor, func->device);
|
||||
|
||||
@@ -308,7 +314,6 @@ static int aicbsp_sdio_probe(struct sdio_func *func,
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
sdiodev = kzalloc(sizeof(struct aic_sdio_dev), GFP_KERNEL);
|
||||
if (!sdiodev) {
|
||||
sdio_err("alloc sdiodev fail\n");
|
||||
@@ -320,19 +325,22 @@ static int aicbsp_sdio_probe(struct sdio_func *func,
|
||||
err = aicwf_sdio_chipmatch(sdiodev, func->vendor, func->device);
|
||||
|
||||
sdiodev->func = func;
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8800DC || sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
if (sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DW) {
|
||||
sdiodev->func_msg = func->card->sdio_func[1];
|
||||
}
|
||||
sdiodev->bus_if = bus_if;
|
||||
bus_if->bus_priv.sdio = sdiodev;
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8800DC || sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
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");
|
||||
}
|
||||
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);
|
||||
@@ -349,7 +357,7 @@ static int aicbsp_sdio_probe(struct sdio_func *func,
|
||||
|
||||
aicbsp_platform_init(sdiodev);
|
||||
|
||||
up(aicbsp_probe_semaphore);
|
||||
up(&aicbsp_probe_semaphore);
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
@@ -360,7 +368,6 @@ fail:
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
static void aicbsp_sdio_remove(struct sdio_func *func)
|
||||
{
|
||||
struct mmc_host *host;
|
||||
@@ -372,7 +379,7 @@ static void aicbsp_sdio_remove(struct sdio_func *func)
|
||||
AICWFDBG(LOGERROR, "%s: allready unregister\n", __func__);
|
||||
goto done;
|
||||
}
|
||||
if ((func == NULL) || (&func->dev == NULL)) {
|
||||
if (func == NULL) {
|
||||
AICWFDBG(LOGERROR, "%s, sdio func is null\n", __func__);
|
||||
goto done;
|
||||
}
|
||||
@@ -403,11 +410,9 @@ done:
|
||||
if (bus_if)
|
||||
kfree(bus_if);
|
||||
aicbsp_sdiodev = NULL;
|
||||
aicbsp_probe_semaphore = NULL;
|
||||
sdio_dbg("%s done\n", __func__);
|
||||
}
|
||||
|
||||
#ifdef SDIO_REMOVEABLE
|
||||
static int aicbsp_sdio_suspend(struct device *dev)
|
||||
{
|
||||
struct sdio_func *func = dev_to_sdio_func(dev);
|
||||
@@ -427,7 +432,8 @@ static int aicbsp_sdio_suspend(struct device *dev)
|
||||
|
||||
sdio_flags = sdio_get_host_pm_caps(func);
|
||||
if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
|
||||
sdio_dbg("%s: can't keep power while host is suspended\n", __func__);
|
||||
sdio_dbg("%s: can't keep power while host is suspended\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -462,7 +468,6 @@ static int aicbsp_sdio_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct sdio_device_id aicbsp_sdmmc_ids[] = {
|
||||
{ SDIO_DEVICE_CLASS(SDIO_CLASS_WLAN) },
|
||||
@@ -471,9 +476,8 @@ static const struct sdio_device_id aicbsp_sdmmc_ids[] = {
|
||||
|
||||
MODULE_DEVICE_TABLE(sdio, aicbsp_sdmmc_ids);
|
||||
|
||||
static const struct dev_pm_ops aicbsp_sdio_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(aicbsp_sdio_suspend, aicbsp_sdio_resume)
|
||||
};
|
||||
static const struct dev_pm_ops aicbsp_sdio_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(
|
||||
aicbsp_sdio_suspend, aicbsp_sdio_resume) };
|
||||
|
||||
static struct sdio_driver aicbsp_sdio_driver = {
|
||||
.probe = aicbsp_sdio_probe,
|
||||
@@ -548,7 +552,6 @@ static int aicbsp_platform_power_on(void)
|
||||
extern_wifi_set_enable(0);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP2
|
||||
rockchip_wifi_power(0);
|
||||
#endif /*CONFIG_PLATFORM_ROCKCHIP2*/
|
||||
@@ -581,29 +584,22 @@ static void aicbsp_platform_power_off(void)
|
||||
extern_wifi_set_enable(0);
|
||||
#endif
|
||||
|
||||
|
||||
sdio_dbg("%s\n", __func__);
|
||||
}
|
||||
|
||||
|
||||
int aicbsp_sdio_init(void)
|
||||
{
|
||||
struct semaphore aic_chipup_sem;
|
||||
|
||||
sema_init(&aic_chipup_sem, 0);
|
||||
aicbsp_probe_semaphore = &aic_chipup_sem;
|
||||
|
||||
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){
|
||||
if (down_timeout(&aicbsp_probe_semaphore, msecs_to_jiffies(2000)) !=
|
||||
0) {
|
||||
printk("%s aicbsp_sdio_probe fail\r\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -618,7 +614,8 @@ void aicbsp_sdio_release(struct aic_sdio_dev *sdiodev)
|
||||
sdio_claim_host(sdiodev->func);
|
||||
sdio_release_irq(sdiodev->func);
|
||||
sdio_release_host(sdiodev->func);
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8800DC || sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
if (sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DW) {
|
||||
sdio_claim_host(sdiodev->func_msg);
|
||||
sdio_release_irq(sdiodev->func_msg);
|
||||
sdio_release_host(sdiodev->func_msg);
|
||||
@@ -668,12 +665,14 @@ int aicwf_sdio_flow_ctrl(struct aic_sdio_dev *sdiodev)
|
||||
u32 count = 0;
|
||||
|
||||
while (true) {
|
||||
ret = aicwf_sdio_readb(sdiodev, sdiodev->sdio_reg.flow_ctrl_reg, &fc_reg);
|
||||
ret = aicwf_sdio_readb(sdiodev, sdiodev->sdio_reg.flow_ctrl_reg,
|
||||
&fc_reg);
|
||||
if (ret) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (sdiodev->chipid == PRODUCT_ID_AIC8801 || sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
if (sdiodev->chipid == PRODUCT_ID_AIC8801 ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DW) {
|
||||
fc_reg = fc_reg & SDIOWIFI_FLOWCTRL_MASK_REG;
|
||||
}
|
||||
@@ -715,7 +714,8 @@ int aicwf_sdio_send_pkt(struct aic_sdio_dev *sdiodev, u8 *buf, uint count)
|
||||
int ret = 0;
|
||||
|
||||
sdio_claim_host(sdiodev->func);
|
||||
ret = sdio_writesb(sdiodev->func, sdiodev->sdio_reg.wr_fifo_addr, buf, count);
|
||||
ret = sdio_writesb(sdiodev->func, sdiodev->sdio_reg.wr_fifo_addr, buf,
|
||||
count);
|
||||
sdio_release_host(sdiodev->func);
|
||||
|
||||
return ret;
|
||||
@@ -727,20 +727,22 @@ int aicwf_sdio_recv_pkt(struct aic_sdio_dev *sdiodev, struct sk_buff *skbbuf,
|
||||
int ret;
|
||||
|
||||
if ((!skbbuf) || (!size)) {
|
||||
return -EINVAL;;
|
||||
return -EINVAL;
|
||||
;
|
||||
}
|
||||
|
||||
if (!msg) {
|
||||
sdio_claim_host(sdiodev->func);
|
||||
ret = sdio_readsb(sdiodev->func, skbbuf->data, sdiodev->sdio_reg.rd_fifo_addr, size);
|
||||
ret = sdio_readsb(sdiodev->func, skbbuf->data,
|
||||
sdiodev->sdio_reg.rd_fifo_addr, size);
|
||||
sdio_release_host(sdiodev->func);
|
||||
} else {
|
||||
sdio_claim_host(sdiodev->func_msg);
|
||||
ret = sdio_readsb(sdiodev->func_msg, skbbuf->data, sdiodev->sdio_reg.rd_fifo_addr, size);
|
||||
ret = sdio_readsb(sdiodev->func_msg, skbbuf->data,
|
||||
sdiodev->sdio_reg.rd_fifo_addr, size);
|
||||
sdio_release_host(sdiodev->func_msg);
|
||||
}
|
||||
|
||||
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
@@ -749,7 +751,6 @@ int aicwf_sdio_recv_pkt(struct aic_sdio_dev *sdiodev, struct sk_buff *skbbuf,
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#if defined(CONFIG_SDIO_PWRCTRL)
|
||||
int aicwf_sdio_wakeup(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
@@ -762,7 +763,8 @@ 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;
|
||||
}
|
||||
|
||||
@@ -770,7 +772,9 @@ int aicwf_sdio_wakeup(struct aic_sdio_dev *sdiodev)
|
||||
//if (sdiodev->rwnx_hw->vif_started) {
|
||||
down(&sdiodev->pwrctl_wakeup_sema);
|
||||
while (write_retry) {
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.wakeup_reg, wakeup_reg_val);
|
||||
ret = aicwf_sdio_writeb(sdiodev,
|
||||
sdiodev->sdio_reg.wakeup_reg,
|
||||
wakeup_reg_val);
|
||||
if (ret) {
|
||||
txrx_err("sdio wakeup fail\n");
|
||||
ret = -1;
|
||||
@@ -778,7 +782,10 @@ int aicwf_sdio_wakeup(struct aic_sdio_dev *sdiodev)
|
||||
read_retry = 10;
|
||||
while (read_retry) {
|
||||
u8 val;
|
||||
ret = aicwf_sdio_readb(sdiodev, sdiodev->sdio_reg.sleep_reg, &val);
|
||||
ret = aicwf_sdio_readb(
|
||||
sdiodev,
|
||||
sdiodev->sdio_reg.sleep_reg,
|
||||
&val);
|
||||
if ((ret == 0) && (val & 0x10)) {
|
||||
break;
|
||||
}
|
||||
@@ -809,7 +816,8 @@ int aicwf_sdio_sleep_allow(struct aic_sdio_dev *sdiodev)
|
||||
struct aicwf_bus *bus_if = sdiodev->bus_if;
|
||||
|
||||
if (bus_if->state == BUS_DOWN_ST) {
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.sleep_reg, 0x10);
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.sleep_reg,
|
||||
0x10);
|
||||
if (ret) {
|
||||
sdio_err("Write sleep fail!\n");
|
||||
}
|
||||
@@ -820,7 +828,8 @@ int aicwf_sdio_sleep_allow(struct aic_sdio_dev *sdiodev)
|
||||
if (sdiodev->state == SDIO_ACTIVE_ST) {
|
||||
{
|
||||
sdio_dbg("s\n");
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.sleep_reg, 0x10);
|
||||
ret = aicwf_sdio_writeb(
|
||||
sdiodev, sdiodev->sdio_reg.sleep_reg, 0x10);
|
||||
if (ret)
|
||||
sdio_err("Write sleep fail!\n");
|
||||
}
|
||||
@@ -843,7 +852,8 @@ int aicwf_sdio_pwr_stctl(struct aic_sdio_dev *sdiodev, uint target)
|
||||
|
||||
if (sdiodev->state == target) {
|
||||
if (target == SDIO_ACTIVE_ST) {
|
||||
aicwf_sdio_pwrctl_timer(sdiodev, sdiodev->active_duration);
|
||||
aicwf_sdio_pwrctl_timer(sdiodev,
|
||||
sdiodev->active_duration);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -875,7 +885,8 @@ int aicwf_sdio_txpkt(struct aic_sdio_dev *sdiodev, struct sk_buff *pkt)
|
||||
|
||||
frame = (u8 *)(pkt->data);
|
||||
len = pkt->len;
|
||||
len = (len + SDIOWIFI_FUNC_BLOCKSIZE - 1) / SDIOWIFI_FUNC_BLOCKSIZE * SDIOWIFI_FUNC_BLOCKSIZE;
|
||||
len = (len + SDIOWIFI_FUNC_BLOCKSIZE - 1) / SDIOWIFI_FUNC_BLOCKSIZE *
|
||||
SDIOWIFI_FUNC_BLOCKSIZE;
|
||||
ret = aicwf_sdio_send_pkt(sdiodev, pkt->data, len);
|
||||
if (ret)
|
||||
sdio_err("aicwf_sdio_send_pkt fail%d\n", ret);
|
||||
@@ -883,7 +894,8 @@ int aicwf_sdio_txpkt(struct aic_sdio_dev *sdiodev, struct sk_buff *pkt)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int aicwf_sdio_intr_get_len_bytemode(struct aic_sdio_dev *sdiodev, u8 *byte_len)
|
||||
static int aicwf_sdio_intr_get_len_bytemode(struct aic_sdio_dev *sdiodev,
|
||||
u8 *byte_len)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
@@ -893,7 +905,8 @@ static int aicwf_sdio_intr_get_len_bytemode(struct aic_sdio_dev *sdiodev, u8 *by
|
||||
if (sdiodev->bus_if->state == BUS_DOWN_ST) {
|
||||
*byte_len = 0;
|
||||
} else {
|
||||
ret = aicwf_sdio_readb(sdiodev, sdiodev->sdio_reg.bytemode_len_reg, byte_len);
|
||||
ret = aicwf_sdio_readb(
|
||||
sdiodev, sdiodev->sdio_reg.bytemode_len_reg, byte_len);
|
||||
sdiodev->rx_priv->data_len = (*byte_len) * 4;
|
||||
}
|
||||
|
||||
@@ -978,13 +991,18 @@ static int aicwf_sdio_tx_msg(struct aic_sdio_dev *sdiodev)
|
||||
if ((len % SDIOWIFI_FUNC_BLOCKSIZE) != 0) {
|
||||
memset(payload + payload_len, 0, TAIL_LEN);
|
||||
payload_len += TAIL_LEN;
|
||||
len = (payload_len/SDIOWIFI_FUNC_BLOCKSIZE + 1) * SDIOWIFI_FUNC_BLOCKSIZE;
|
||||
len = (payload_len / SDIOWIFI_FUNC_BLOCKSIZE + 1) *
|
||||
SDIOWIFI_FUNC_BLOCKSIZE;
|
||||
} 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) {
|
||||
while ((buffer_cnt <= 0 ||
|
||||
(buffer_cnt > 0 && len > (buffer_cnt * BUFFER_SIZE))) &&
|
||||
retry < 10) {
|
||||
retry++;
|
||||
buffer_cnt = aicwf_sdio_flow_ctrl(sdiodev);
|
||||
printk("buffer_cnt = %d\n", buffer_cnt);
|
||||
@@ -992,18 +1010,22 @@ 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) {
|
||||
sdio_err("aicwf_sdio_send_pkt fail%d\n", err);
|
||||
}
|
||||
} else {
|
||||
sdio_err("tx msg fc retry fail:%d, %d\n", buffer_cnt, len);
|
||||
sdio_err("tx msg fc retry fail:%d, %d\n", buffer_cnt,
|
||||
len);
|
||||
up(&sdiodev->tx_priv->cmd_txsema);
|
||||
return -1;
|
||||
}
|
||||
}else if(sdiodev->chipid == PRODUCT_ID_AIC8800DC || sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
} else if (sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DW) {
|
||||
err = aicwf_sdio_send_msg(sdiodev, payload, len);
|
||||
if (err) {
|
||||
sdio_err("aicwf_sdio_send_pkt fail%d\n", err);
|
||||
@@ -1072,7 +1094,8 @@ static void aicwf_sdio_tx_process(struct aic_sdio_dev *sdiodev)
|
||||
}
|
||||
|
||||
if (!aicwf_is_framequeue_empty(&sdiodev->tx_priv->txq))
|
||||
sdiodev->tx_priv->fw_avail_bufcnt = aicwf_sdio_flow_ctrl(sdiodev);
|
||||
sdiodev->tx_priv->fw_avail_bufcnt =
|
||||
aicwf_sdio_flow_ctrl(sdiodev);
|
||||
while (!aicwf_is_framequeue_empty(&sdiodev->tx_priv->txq)) {
|
||||
aicwf_sdio_send(sdiodev->tx_priv);
|
||||
if (sdiodev->tx_priv->cmd_txstate)
|
||||
@@ -1133,14 +1156,17 @@ static int aicwf_sdio_bus_txmsg(struct device *dev, u8 *msg, uint msglen)
|
||||
|
||||
if (sdiodev->tx_priv->cmd_txstate) {
|
||||
int timeout = msecs_to_jiffies(CMD_TX_TIMEOUT);
|
||||
ret = wait_event_timeout(sdiodev->tx_priv->cmd_txdone_wait, \
|
||||
!(sdiodev->tx_priv->cmd_txstate), timeout);
|
||||
ret = wait_event_timeout(sdiodev->tx_priv->cmd_txdone_wait,
|
||||
!(sdiodev->tx_priv->cmd_txstate),
|
||||
timeout);
|
||||
}
|
||||
|
||||
if (!sdiodev->tx_priv->cmd_txstate && sdiodev->tx_priv->cmd_tx_succ) {
|
||||
ret = 0;
|
||||
} else {
|
||||
sdio_err("send faild:%d, %d,%x\n", sdiodev->tx_priv->cmd_txstate, sdiodev->tx_priv->cmd_tx_succ, ret);
|
||||
sdio_err("send faild:%d, %d,%x\n",
|
||||
sdiodev->tx_priv->cmd_txstate,
|
||||
sdiodev->tx_priv->cmd_tx_succ, ret);
|
||||
ret = -EIO;
|
||||
}
|
||||
|
||||
@@ -1156,8 +1182,8 @@ int aicwf_sdio_send(struct aicwf_tx_priv *tx_priv)
|
||||
int max_retry_times = 5;
|
||||
|
||||
aggr_len = (tx_priv->tail - tx_priv->head);
|
||||
if (((atomic_read(&tx_priv->aggr_count) == 0) && (aggr_len != 0))
|
||||
|| ((atomic_read(&tx_priv->aggr_count) != 0) && (aggr_len == 0))) {
|
||||
if (((atomic_read(&tx_priv->aggr_count) == 0) && (aggr_len != 0)) ||
|
||||
((atomic_read(&tx_priv->aggr_count) != 0) && (aggr_len == 0))) {
|
||||
if (aggr_len > 0)
|
||||
aicwf_sdio_aggrbuf_reset(tx_priv);
|
||||
goto done;
|
||||
@@ -1165,20 +1191,25 @@ int aicwf_sdio_send(struct aicwf_tx_priv *tx_priv)
|
||||
|
||||
if (tx_priv->fw_avail_bufcnt <= 0) { //flow control failed
|
||||
tx_priv->fw_avail_bufcnt = aicwf_sdio_flow_ctrl(sdiodev);
|
||||
while (tx_priv->fw_avail_bufcnt <= 0 && retry_times < max_retry_times) {
|
||||
while (tx_priv->fw_avail_bufcnt <= 0 &&
|
||||
retry_times < max_retry_times) {
|
||||
retry_times++;
|
||||
tx_priv->fw_avail_bufcnt = aicwf_sdio_flow_ctrl(sdiodev);
|
||||
tx_priv->fw_avail_bufcnt =
|
||||
aicwf_sdio_flow_ctrl(sdiodev);
|
||||
}
|
||||
if (tx_priv->fw_avail_bufcnt <= 0) {
|
||||
sdio_err("fc retry %d fail\n", tx_priv->fw_avail_bufcnt);
|
||||
sdio_err("fc retry %d fail\n",
|
||||
tx_priv->fw_avail_bufcnt);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (atomic_read(&tx_priv->aggr_count) == tx_priv->fw_avail_bufcnt) {
|
||||
if (atomic_read(&tx_priv->aggr_count) > 0) {
|
||||
tx_priv->fw_avail_bufcnt -= atomic_read(&tx_priv->aggr_count);
|
||||
aicwf_sdio_aggr_send(tx_priv); //send and check the next pkt;
|
||||
tx_priv->fw_avail_bufcnt -=
|
||||
atomic_read(&tx_priv->aggr_count);
|
||||
aicwf_sdio_aggr_send(
|
||||
tx_priv); //send and check the next pkt;
|
||||
}
|
||||
} else {
|
||||
spin_lock_bh(&sdiodev->tx_priv->txqlock);
|
||||
@@ -1200,8 +1231,10 @@ int aicwf_sdio_send(struct aicwf_tx_priv *tx_priv)
|
||||
}
|
||||
|
||||
//when aggr finish or there is cmd to send, just send this aggr pkt to fw
|
||||
if ((int)atomic_read(&sdiodev->tx_priv->tx_pktcnt) == 0 || sdiodev->tx_priv->cmd_txstate) { //no more pkt send it!
|
||||
tx_priv->fw_avail_bufcnt -= atomic_read(&tx_priv->aggr_count);
|
||||
if ((int)atomic_read(&sdiodev->tx_priv->tx_pktcnt) == 0 ||
|
||||
sdiodev->tx_priv->cmd_txstate) { //no more pkt send it!
|
||||
tx_priv->fw_avail_bufcnt -=
|
||||
atomic_read(&tx_priv->aggr_count);
|
||||
aicwf_sdio_aggr_send(tx_priv);
|
||||
} else
|
||||
goto done;
|
||||
@@ -1223,10 +1256,12 @@ int aicwf_sdio_aggr(struct aicwf_tx_priv *tx_priv, struct sk_buff *pkt)
|
||||
//sdio_header[0] =((pkt->len - sizeof(struct rwnx_txhdr) + sizeof(struct txdesc_api)) & 0xff);
|
||||
//sdio_header[1] =(((pkt->len - sizeof(struct rwnx_txhdr) + sizeof(struct txdesc_api)) >> 8)&0x0f);
|
||||
sdio_header[2] = 0x01; //data
|
||||
if (tx_priv->sdiodev->chipid == PRODUCT_ID_AIC8801 || tx_priv->sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
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));
|
||||
@@ -1245,7 +1280,8 @@ int aicwf_sdio_aggr(struct aicwf_tx_priv *tx_priv, struct sk_buff *pkt)
|
||||
tx_priv->tail += allign_len;
|
||||
}
|
||||
|
||||
if (tx_priv->sdiodev->chipid == PRODUCT_ID_AIC8801 || tx_priv->sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
if (tx_priv->sdiodev->chipid == PRODUCT_ID_AIC8801 ||
|
||||
tx_priv->sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
tx_priv->sdiodev->chipid == PRODUCT_ID_AIC8800DW) {
|
||||
start_ptr[0] = ((tx_priv->tail - start_ptr - 4) & 0xff);
|
||||
start_ptr[1] = (((tx_priv->tail - start_ptr - 4) >> 8) & 0x0f);
|
||||
@@ -1307,33 +1343,40 @@ static int aicwf_sdio_bus_start(struct device *dev)
|
||||
sdio_claim_host(sdiodev->func);
|
||||
sdio_claim_irq(sdiodev->func, aicwf_sdio_hal_irqhandler);
|
||||
//enable sdio interrupt
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x07);
|
||||
ret = aicwf_sdio_writeb(
|
||||
sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x07);
|
||||
if (ret != 0)
|
||||
sdio_err("intr register failed:%d\n", ret);
|
||||
sdio_release_host(sdiodev->func);
|
||||
}else if(sdiodev->chipid == PRODUCT_ID_AIC8800DC || sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
} else if (sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DW) {
|
||||
sdio_claim_host(sdiodev->func);
|
||||
|
||||
//since we have func2 we don't register irq handler
|
||||
sdio_claim_irq(sdiodev->func, NULL);
|
||||
sdio_claim_irq(sdiodev->func_msg, NULL);
|
||||
|
||||
sdiodev->func->irq_handler = (sdio_irq_handler_t *)aicwf_sdio_hal_irqhandler;
|
||||
sdiodev->func_msg->irq_handler = (sdio_irq_handler_t *)aicwf_sdio_hal_irqhandler_func2;
|
||||
sdiodev->func->irq_handler =
|
||||
(sdio_irq_handler_t *)aicwf_sdio_hal_irqhandler;
|
||||
sdiodev->func_msg->irq_handler =
|
||||
(sdio_irq_handler_t *)aicwf_sdio_hal_irqhandler_func2;
|
||||
sdio_release_host(sdiodev->func);
|
||||
|
||||
//enable sdio interrupt
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x07);
|
||||
ret = aicwf_sdio_writeb(
|
||||
sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x07);
|
||||
|
||||
if (ret != 0)
|
||||
sdio_err("intr register failed:%d\n", ret);
|
||||
|
||||
//enable sdio interrupt
|
||||
ret = aicwf_sdio_writeb_func2(sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x07);
|
||||
ret = aicwf_sdio_writeb_func2(
|
||||
sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x07);
|
||||
|
||||
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);
|
||||
|
||||
@@ -1343,7 +1386,8 @@ static int aicwf_sdio_bus_start(struct device *dev)
|
||||
}
|
||||
sdio_release_host(sdiodev->func);
|
||||
//enable sdio interrupt
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x07);
|
||||
ret = aicwf_sdio_writeb(
|
||||
sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x07);
|
||||
if (ret != 0)
|
||||
sdio_err("intr register failed:%d\n", ret);
|
||||
}
|
||||
@@ -1363,7 +1407,9 @@ int aicwf_sdio_bustx_thread(void *data)
|
||||
break;
|
||||
}
|
||||
if (!wait_for_completion_interruptible(&bus->bustx_trgg)) {
|
||||
if ((int)(atomic_read(&sdiodev->tx_priv->tx_pktcnt) > 0) || (sdiodev->tx_priv->cmd_txstate == true))
|
||||
if ((int)(atomic_read(&sdiodev->tx_priv->tx_pktcnt) >
|
||||
0) ||
|
||||
(sdiodev->tx_priv->cmd_txstate == true))
|
||||
aicwf_sdio_tx_process(sdiodev);
|
||||
}
|
||||
}
|
||||
@@ -1410,7 +1456,8 @@ static void aicwf_sdio_bus_pwrctl(ulong data)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void aicwf_sdio_enq_rxpkt(struct aic_sdio_dev *sdiodev, struct sk_buff *pkt)
|
||||
static void aicwf_sdio_enq_rxpkt(struct aic_sdio_dev *sdiodev,
|
||||
struct sk_buff *pkt)
|
||||
{
|
||||
struct aicwf_rx_priv *rx_priv = sdiodev->rx_priv;
|
||||
unsigned long flags = 0;
|
||||
@@ -1449,18 +1496,24 @@ void aicwf_sdio_hal_irqhandler(struct sdio_func *func)
|
||||
return;
|
||||
}
|
||||
|
||||
if (sdiodev->chipid == PRODUCT_ID_AIC8801 || sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
if (sdiodev->chipid == PRODUCT_ID_AIC8801 ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DW) {
|
||||
ret = aicwf_sdio_readb(sdiodev, sdiodev->sdio_reg.block_cnt_reg, &intstatus);
|
||||
ret = aicwf_sdio_readb(sdiodev, sdiodev->sdio_reg.block_cnt_reg,
|
||||
&intstatus);
|
||||
|
||||
while (intstatus) {
|
||||
sdiodev->rx_priv->data_len = intstatus * SDIOWIFI_FUNC_BLOCKSIZE;
|
||||
sdiodev->rx_priv->data_len =
|
||||
intstatus * SDIOWIFI_FUNC_BLOCKSIZE;
|
||||
if (intstatus > 0) {
|
||||
if (intstatus < 64) {
|
||||
pkt = aicwf_sdio_readframes(sdiodev, 0);
|
||||
} else {
|
||||
aicwf_sdio_intr_get_len_bytemode(sdiodev, &byte_len);//byte_len must<= 128
|
||||
sdio_info("byte mode len=%d\r\n", byte_len);
|
||||
aicwf_sdio_intr_get_len_bytemode(
|
||||
sdiodev,
|
||||
&byte_len); //byte_len must<= 128
|
||||
sdio_info("byte mode len=%d\r\n",
|
||||
byte_len);
|
||||
pkt = aicwf_sdio_readframes(sdiodev, 0);
|
||||
}
|
||||
} else {
|
||||
@@ -1472,11 +1525,16 @@ void aicwf_sdio_hal_irqhandler(struct sdio_func *func)
|
||||
if (pkt)
|
||||
aicwf_sdio_enq_rxpkt(sdiodev, pkt);
|
||||
|
||||
ret = aicwf_sdio_readb(sdiodev, sdiodev->sdio_reg.block_cnt_reg, &intstatus);
|
||||
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);
|
||||
ret = aicwf_sdio_readb(
|
||||
sdiodev, sdiodev->sdio_reg.misc_int_status_reg,
|
||||
&intstatus);
|
||||
if (!ret) {
|
||||
break;
|
||||
}
|
||||
@@ -1484,14 +1542,20 @@ void aicwf_sdio_hal_irqhandler(struct sdio_func *func)
|
||||
} while (1);
|
||||
if (intstatus & SDIO_OTHER_INTERRUPT) {
|
||||
u8 int_pending;
|
||||
ret = aicwf_sdio_readb(sdiodev, sdiodev->sdio_reg.sleep_reg, &int_pending);
|
||||
ret = aicwf_sdio_readb(sdiodev,
|
||||
sdiodev->sdio_reg.sleep_reg,
|
||||
&int_pending);
|
||||
if (ret < 0) {
|
||||
sdio_err("reg:%d read failed!\n", sdiodev->sdio_reg.sleep_reg);
|
||||
sdio_err("reg:%d read failed!\n",
|
||||
sdiodev->sdio_reg.sleep_reg);
|
||||
}
|
||||
int_pending &= ~0x01; // dev to host soft irq
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.sleep_reg, int_pending);
|
||||
ret = aicwf_sdio_writeb(sdiodev,
|
||||
sdiodev->sdio_reg.sleep_reg,
|
||||
int_pending);
|
||||
if (ret < 0) {
|
||||
sdio_err("reg:%d write failed!\n", sdiodev->sdio_reg.sleep_reg);
|
||||
sdio_err("reg:%d write failed!\n",
|
||||
sdiodev->sdio_reg.sleep_reg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1500,21 +1564,31 @@ void aicwf_sdio_hal_irqhandler(struct sdio_func *func)
|
||||
if (intmaskf2 > 120U) { // func2
|
||||
if (intmaskf2 == 127U) { // byte mode
|
||||
//aicwf_sdio_intr_get_len_bytemode(sdiodev, &byte_len, 1);//byte_len must<= 128
|
||||
aicwf_sdio_intr_get_len_bytemode(sdiodev, &byte_len);//byte_len must<= 128
|
||||
sdio_info("byte mode len=%d\r\n", byte_len);
|
||||
aicwf_sdio_intr_get_len_bytemode(
|
||||
sdiodev,
|
||||
&byte_len); //byte_len must<= 128
|
||||
sdio_info("byte mode len=%d\r\n",
|
||||
byte_len);
|
||||
pkt = aicwf_sdio_readframes(sdiodev, 1);
|
||||
} else { // block mode
|
||||
sdiodev->rx_priv->data_len = (intstatus & 0x7U) * SDIOWIFI_FUNC_BLOCKSIZE;
|
||||
sdiodev->rx_priv->data_len =
|
||||
(intstatus & 0x7U) *
|
||||
SDIOWIFI_FUNC_BLOCKSIZE;
|
||||
pkt = aicwf_sdio_readframes(sdiodev, 1);
|
||||
}
|
||||
} else { // func1
|
||||
if (intstatus == 120U) { // byte mode
|
||||
//aicwf_sdio_intr_get_len_bytemode(sdiodev, &byte_len, 0);//byte_len must<= 128
|
||||
aicwf_sdio_intr_get_len_bytemode(sdiodev, &byte_len);//byte_len must<= 128
|
||||
sdio_info("byte mode len=%d\r\n", byte_len);
|
||||
aicwf_sdio_intr_get_len_bytemode(
|
||||
sdiodev,
|
||||
&byte_len); //byte_len must<= 128
|
||||
sdio_info("byte mode len=%d\r\n",
|
||||
byte_len);
|
||||
pkt = aicwf_sdio_readframes(sdiodev, 0);
|
||||
} else { // block mode
|
||||
sdiodev->rx_priv->data_len = (intstatus & 0x7FU) * SDIOWIFI_FUNC_BLOCKSIZE;
|
||||
sdiodev->rx_priv->data_len =
|
||||
(intstatus & 0x7FU) *
|
||||
SDIOWIFI_FUNC_BLOCKSIZE;
|
||||
pkt = aicwf_sdio_readframes(sdiodev, 0);
|
||||
}
|
||||
}
|
||||
@@ -1556,17 +1630,21 @@ void aicwf_sdio_hal_irqhandler_func2(struct sdio_func *func)
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = aicwf_sdio_readb_func2(sdiodev, sdiodev->sdio_reg.block_cnt_reg, &intstatus);
|
||||
ret = aicwf_sdio_readb_func2(sdiodev, sdiodev->sdio_reg.block_cnt_reg,
|
||||
&intstatus);
|
||||
|
||||
while (intstatus) {
|
||||
sdiodev->rx_priv->data_len = intstatus * SDIOWIFI_FUNC_BLOCKSIZE;
|
||||
sdiodev->rx_priv->data_len =
|
||||
intstatus * SDIOWIFI_FUNC_BLOCKSIZE;
|
||||
if (intstatus > 0) {
|
||||
if (intstatus < 64) {
|
||||
pkt = aicwf_sdio_readframes(sdiodev, 1);
|
||||
} else {
|
||||
sdio_info("byte mode len=%d\r\n", byte_len);
|
||||
|
||||
aicwf_sdio_intr_get_len_bytemode(sdiodev, &byte_len);//byte_len must<= 128
|
||||
aicwf_sdio_intr_get_len_bytemode(
|
||||
sdiodev,
|
||||
&byte_len); //byte_len must<= 128
|
||||
pkt = aicwf_sdio_readframes(sdiodev, 1);
|
||||
}
|
||||
} else {
|
||||
@@ -1578,7 +1656,8 @@ void aicwf_sdio_hal_irqhandler_func2(struct sdio_func *func)
|
||||
if (pkt) {
|
||||
aicwf_sdio_enq_rxpkt(sdiodev, pkt);
|
||||
}
|
||||
ret = aicwf_sdio_readb_func2(sdiodev, sdiodev->sdio_reg.block_cnt_reg, &intstatus);
|
||||
ret = aicwf_sdio_readb_func2(
|
||||
sdiodev, sdiodev->sdio_reg.block_cnt_reg, &intstatus);
|
||||
}
|
||||
|
||||
complete(&bus_if->busrx_trgg);
|
||||
@@ -1618,13 +1697,14 @@ void aicwf_sdio_release_func2(struct aic_sdio_dev *sdiodev)
|
||||
sdio_dbg("%s\n", __func__);
|
||||
sdio_claim_host(sdiodev->func_msg);
|
||||
//disable sdio interrupt
|
||||
ret = aicwf_sdio_writeb_func2(sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x0);
|
||||
ret = aicwf_sdio_writeb_func2(sdiodev,
|
||||
sdiodev->sdio_reg.intr_config_reg, 0x0);
|
||||
if (ret < 0) {
|
||||
sdio_err("reg:%d write failed!\n", sdiodev->sdio_reg.intr_config_reg);
|
||||
sdio_err("reg:%d write failed!\n",
|
||||
sdiodev->sdio_reg.intr_config_reg);
|
||||
}
|
||||
sdio_release_irq(sdiodev->func_msg);
|
||||
sdio_release_host(sdiodev->func_msg);
|
||||
|
||||
}
|
||||
|
||||
void aicwf_sdio_release(struct aic_sdio_dev *sdiodev)
|
||||
@@ -1649,15 +1729,18 @@ void aicwf_sdio_release(struct aic_sdio_dev *sdiodev)
|
||||
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);
|
||||
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_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);
|
||||
}
|
||||
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8800DC || sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
if (sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DW) {
|
||||
aicwf_sdio_release_func2(sdiodev);
|
||||
}
|
||||
|
||||
@@ -1673,13 +1756,12 @@ 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__);
|
||||
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8801 || sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
if (sdiodev->chipid == PRODUCT_ID_AIC8801 ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DW) {
|
||||
sdiodev->sdio_reg.bytemode_len_reg = SDIOWIFI_BYTEMODE_LEN_REG;
|
||||
sdiodev->sdio_reg.intr_config_reg = SDIOWIFI_INTR_CONFIG_REG;
|
||||
@@ -1687,18 +1769,23 @@ void aicwf_sdio_reg_init(struct aic_sdio_dev *sdiodev)
|
||||
sdiodev->sdio_reg.wakeup_reg = SDIOWIFI_WAKEUP_REG;
|
||||
sdiodev->sdio_reg.flow_ctrl_reg = SDIOWIFI_FLOW_CTRL_REG;
|
||||
sdiodev->sdio_reg.register_block = SDIOWIFI_REGISTER_BLOCK;
|
||||
sdiodev->sdio_reg.bytemode_enable_reg = SDIOWIFI_BYTEMODE_ENABLE_REG;
|
||||
sdiodev->sdio_reg.bytemode_enable_reg =
|
||||
SDIOWIFI_BYTEMODE_ENABLE_REG;
|
||||
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){
|
||||
sdiodev->sdio_reg.bytemode_len_reg = SDIOWIFI_BYTEMODE_LEN_REG_V3;
|
||||
} 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;
|
||||
sdiodev->sdio_reg.wakeup_reg = SDIOWIFI_INTR_TO_DEVICE_REG_V3;
|
||||
sdiodev->sdio_reg.flow_ctrl_reg = SDIOWIFI_FLOW_CTRL_Q1_REG_V3;
|
||||
sdiodev->sdio_reg.bytemode_enable_reg = SDIOWIFI_BYTEMODE_ENABLE_REG_V3;
|
||||
sdiodev->sdio_reg.misc_int_status_reg = SDIOWIFI_MISC_INT_STATUS_REG_V3;
|
||||
sdiodev->sdio_reg.bytemode_enable_reg =
|
||||
SDIOWIFI_BYTEMODE_ENABLE_REG_V3;
|
||||
sdiodev->sdio_reg.misc_int_status_reg =
|
||||
SDIOWIFI_MISC_INT_STATUS_REG_V3;
|
||||
sdiodev->sdio_reg.rd_fifo_addr = SDIOWIFI_RD_FIFO_ADDR_V3;
|
||||
sdiodev->sdio_reg.wr_fifo_addr = SDIOWIFI_WR_FIFO_ADDR_V3;
|
||||
}
|
||||
@@ -1750,14 +1837,16 @@ int aicwf_sdio_func_init(struct aic_sdio_dev *sdiodev)
|
||||
#endif
|
||||
sdio_release_host(sdiodev->func);
|
||||
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8800DC || sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
|
||||
if (sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DW) {
|
||||
sdio_claim_host(sdiodev->func_msg);
|
||||
|
||||
//set sdio blocksize
|
||||
ret = sdio_set_block_size(sdiodev->func_msg, SDIOWIFI_FUNC_BLOCKSIZE);
|
||||
ret = sdio_set_block_size(sdiodev->func_msg,
|
||||
SDIOWIFI_FUNC_BLOCKSIZE);
|
||||
if (ret < 0) {
|
||||
AICWFDBG(LOGERROR, "set func2 blocksize fail %d\n", ret);
|
||||
AICWFDBG(LOGERROR, "set func2 blocksize fail %d\n",
|
||||
ret);
|
||||
sdio_release_host(sdiodev->func_msg);
|
||||
return ret;
|
||||
}
|
||||
@@ -1770,30 +1859,39 @@ int aicwf_sdio_func_init(struct aic_sdio_dev *sdiodev)
|
||||
|
||||
sdio_release_host(sdiodev->func_msg);
|
||||
|
||||
ret = aicwf_sdio_writeb_func2(sdiodev, sdiodev->sdio_reg.register_block, block_bit0);
|
||||
ret = aicwf_sdio_writeb_func2(
|
||||
sdiodev, sdiodev->sdio_reg.register_block, block_bit0);
|
||||
if (ret < 0) {
|
||||
AICWFDBG(LOGERROR, "reg:%d write failed!\n", sdiodev->sdio_reg.register_block);
|
||||
AICWFDBG(LOGERROR, "reg:%d write failed!\n",
|
||||
sdiodev->sdio_reg.register_block);
|
||||
return ret;
|
||||
}
|
||||
|
||||
//1: no byte mode
|
||||
ret = aicwf_sdio_writeb_func2(sdiodev, sdiodev->sdio_reg.bytemode_enable_reg, byte_mode_disable);
|
||||
ret = aicwf_sdio_writeb_func2(
|
||||
sdiodev, sdiodev->sdio_reg.bytemode_enable_reg,
|
||||
byte_mode_disable);
|
||||
if (ret < 0) {
|
||||
AICWFDBG(LOGERROR, "reg:%d write failed!\n", sdiodev->sdio_reg.bytemode_enable_reg);
|
||||
AICWFDBG(LOGERROR, "reg:%d write failed!\n",
|
||||
sdiodev->sdio_reg.bytemode_enable_reg);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.register_block, block_bit0);
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.register_block,
|
||||
block_bit0);
|
||||
if (ret < 0) {
|
||||
sdio_err("reg:%d write failed!\n", sdiodev->sdio_reg.register_block);
|
||||
sdio_err("reg:%d write failed!\n",
|
||||
sdiodev->sdio_reg.register_block);
|
||||
return ret;
|
||||
}
|
||||
|
||||
//1: no byte mode
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.bytemode_enable_reg, byte_mode_disable);
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.bytemode_enable_reg,
|
||||
byte_mode_disable);
|
||||
if (ret < 0) {
|
||||
sdio_err("reg:%d write failed!\n", sdiodev->sdio_reg.bytemode_enable_reg);
|
||||
sdio_err("reg:%d write failed!\n",
|
||||
sdiodev->sdio_reg.bytemode_enable_reg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1872,9 +1970,11 @@ int aicwf_sdiov3_func_init(struct aic_sdio_dev *sdiodev)
|
||||
sdio_release_host(sdiodev->func);
|
||||
|
||||
//1: no byte mode
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.bytemode_enable_reg, byte_mode_disable);
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.bytemode_enable_reg,
|
||||
byte_mode_disable);
|
||||
if (ret < 0) {
|
||||
sdio_err("reg:%d write failed!\n", sdiodev->sdio_reg.bytemode_enable_reg);
|
||||
sdio_err("reg:%d write failed!\n",
|
||||
sdiodev->sdio_reg.bytemode_enable_reg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1903,15 +2003,14 @@ void aicwf_sdio_func_deinit(struct aic_sdio_dev *sdiodev)
|
||||
sdio_release_host(sdiodev->func);
|
||||
}
|
||||
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8800DC || sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
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;
|
||||
@@ -1984,23 +2083,28 @@ fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void get_fw_path(char* fw_path){
|
||||
void get_fw_path(char *fw_path)
|
||||
{
|
||||
if (strlen(aic_fw_path) > 0) {
|
||||
memcpy(fw_path, aic_fw_path, strlen(aic_fw_path));
|
||||
} else {
|
||||
memcpy(fw_path, aic_default_fw_path, strlen(aic_default_fw_path));
|
||||
memcpy(fw_path, aic_default_fw_path,
|
||||
strlen(aic_default_fw_path));
|
||||
}
|
||||
}
|
||||
|
||||
int get_testmode(void){
|
||||
int get_testmode(void)
|
||||
{
|
||||
return testmode;
|
||||
}
|
||||
|
||||
struct sdio_func *get_sdio_func(void){
|
||||
struct sdio_func *get_sdio_func(void)
|
||||
{
|
||||
return aicbsp_sdiodev->func;
|
||||
}
|
||||
|
||||
void set_irq_handler(void *fn){
|
||||
void set_irq_handler(void *fn)
|
||||
{
|
||||
aicbsp_sdiodev->sdio_hal_irqhandler = (sdio_irq_handler_t *)fn;
|
||||
}
|
||||
|
||||
@@ -2032,4 +2136,3 @@ EXPORT_SYMBOL(get_fw_path);
|
||||
EXPORT_SYMBOL(get_testmode);
|
||||
EXPORT_SYMBOL(get_sdio_func);
|
||||
EXPORT_SYMBOL(set_irq_handler);
|
||||
|
||||
|
||||
@@ -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 {
|
||||
@@ -126,7 +127,8 @@ int aicwf_sdio_func_init(struct aic_sdio_dev *sdiodev);
|
||||
int aicwf_sdiov3_func_init(struct aic_sdio_dev *sdiodev);
|
||||
void aicwf_sdio_func_deinit(struct aic_sdio_dev *sdiodev);
|
||||
int aicwf_sdio_flow_ctrl(struct aic_sdio_dev *sdiodev);
|
||||
int aicwf_sdio_recv_pkt(struct aic_sdio_dev *sdiodev, struct sk_buff *skbbuf, u32 size, u8 msg);
|
||||
int aicwf_sdio_recv_pkt(struct aic_sdio_dev *sdiodev, struct sk_buff *skbbuf,
|
||||
u32 size, u8 msg);
|
||||
int aicwf_sdio_send_pkt(struct aic_sdio_dev *sdiodev, u8 *buf, uint count);
|
||||
void *aicwf_sdio_bus_init(struct aic_sdio_dev *sdiodev);
|
||||
void aicwf_sdio_release(struct aic_sdio_dev *sdiodev);
|
||||
|
||||
@@ -40,10 +40,8 @@ int aicwf_bus_init(uint bus_hdrlen, struct device *dev)
|
||||
init_completion(&bus_if->bustx_trgg);
|
||||
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
|
||||
|
||||
bus_if->bustx_thread = kthread_run(
|
||||
aicwf_sdio_bustx_thread, (void *)bus_if, "aicwf_bustx_thread");
|
||||
if (IS_ERR(bus_if->bustx_thread)) {
|
||||
bus_if->bustx_thread = NULL;
|
||||
txrx_err("aicwf_bustx_thread run fail\n");
|
||||
@@ -51,6 +49,10 @@ int aicwf_bus_init(uint bus_hdrlen, struct device *dev)
|
||||
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");
|
||||
@@ -58,6 +60,7 @@ int aicwf_bus_init(uint bus_hdrlen, struct device *dev)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
#endif
|
||||
return ret;
|
||||
fail:
|
||||
aicwf_bus_deinit(dev);
|
||||
@@ -173,15 +176,19 @@ int aicwf_process_rxframes(struct aicwf_rx_priv *rx_priv)
|
||||
data = skb->data;
|
||||
pkt_len = (*skb->data | (*(skb->data + 1) << 8));
|
||||
|
||||
if ((skb->data[2] & SDIO_TYPE_CFG) != SDIO_TYPE_CFG) { // type : data
|
||||
if ((skb->data[2] & SDIO_TYPE_CFG) !=
|
||||
SDIO_TYPE_CFG) { // type : data
|
||||
aggr_len = pkt_len + RX_HWHRD_LEN;
|
||||
|
||||
if (aggr_len & (RX_ALIGNMENT - 1))
|
||||
adjust_len = roundup(aggr_len, RX_ALIGNMENT);
|
||||
adjust_len =
|
||||
roundup(aggr_len, RX_ALIGNMENT);
|
||||
else
|
||||
adjust_len = aggr_len;
|
||||
|
||||
skb_inblock = __dev_alloc_skb(aggr_len + CCMP_OR_WEP_INFO, GFP_KERNEL);//8 is for ccmp mic or wep icv
|
||||
skb_inblock = __dev_alloc_skb(
|
||||
aggr_len + CCMP_OR_WEP_INFO,
|
||||
GFP_KERNEL); //8 is for ccmp mic or wep icv
|
||||
if (skb_inblock == NULL) {
|
||||
txrx_err("no more space!\n");
|
||||
aicwf_dev_skb_free(skb);
|
||||
@@ -198,11 +205,13 @@ int aicwf_process_rxframes(struct aicwf_rx_priv *rx_priv)
|
||||
aggr_len = pkt_len;
|
||||
|
||||
if (aggr_len & (RX_ALIGNMENT - 1))
|
||||
adjust_len = roundup(aggr_len, RX_ALIGNMENT);
|
||||
adjust_len =
|
||||
roundup(aggr_len, RX_ALIGNMENT);
|
||||
else
|
||||
adjust_len = aggr_len;
|
||||
|
||||
skb_inblock = __dev_alloc_skb(aggr_len+4, GFP_KERNEL);
|
||||
skb_inblock = __dev_alloc_skb(aggr_len + 4,
|
||||
GFP_KERNEL);
|
||||
if (skb_inblock == NULL) {
|
||||
txrx_err("no more space!\n");
|
||||
aicwf_dev_skb_free(skb);
|
||||
@@ -211,8 +220,13 @@ int aicwf_process_rxframes(struct aicwf_rx_priv *rx_priv)
|
||||
|
||||
skb_put(skb_inblock, aggr_len + 4);
|
||||
memcpy(skb_inblock->data, data, aggr_len + 4);
|
||||
if ((*(skb_inblock->data + 2) & 0x7f) == SDIO_TYPE_CFG_CMD_RSP)
|
||||
rwnx_rx_handle_msg(rx_priv->sdiodev, (struct ipc_e2a_msg *)(skb_inblock->data + 4));
|
||||
if ((*(skb_inblock->data + 2) & 0x7f) ==
|
||||
SDIO_TYPE_CFG_CMD_RSP)
|
||||
rwnx_rx_handle_msg(
|
||||
rx_priv->sdiodev,
|
||||
(struct ipc_e2a_msg
|
||||
*)(skb_inblock->data +
|
||||
4));
|
||||
#if 0
|
||||
if ((*(skb_inblock->data + 2) & 0x7f) == SDIO_TYPE_CFG_DATA_CFM)
|
||||
aicwf_sdio_host_tx_cfm_handler(&(rx_priv->sdiodev->rwnx_hw->sdio_env), (u32 *)(skb_inblock->data + 4));
|
||||
@@ -234,7 +248,8 @@ int aicwf_process_rxframes(struct aicwf_rx_priv *rx_priv)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct recv_msdu *aicwf_rxframe_queue_init(struct list_head *q, int qsize)
|
||||
static struct recv_msdu *aicwf_rxframe_queue_init(struct list_head *q,
|
||||
int qsize)
|
||||
{
|
||||
int i;
|
||||
struct recv_msdu *req, *reqs;
|
||||
@@ -268,7 +283,8 @@ struct aicwf_rx_priv *aicwf_rx_init(void *arg)
|
||||
|
||||
INIT_LIST_HEAD(&rx_priv->rxframes_freequeue);
|
||||
spin_lock_init(&rx_priv->freeq_lock);
|
||||
rx_priv->recv_frames = aicwf_rxframe_queue_init(&rx_priv->rxframes_freequeue, MAX_REORD_RXFRAME);
|
||||
rx_priv->recv_frames = aicwf_rxframe_queue_init(
|
||||
&rx_priv->rxframes_freequeue, MAX_REORD_RXFRAME);
|
||||
if (!rx_priv->recv_frames) {
|
||||
txrx_err("no enough buffer for free recv frame queue!\n");
|
||||
kfree(rx_priv);
|
||||
@@ -280,7 +296,6 @@ struct aicwf_rx_priv *aicwf_rx_init(void *arg)
|
||||
return rx_priv;
|
||||
}
|
||||
|
||||
|
||||
static void aicwf_recvframe_queue_deinit(struct list_head *q)
|
||||
{
|
||||
struct recv_msdu *req, *next;
|
||||
@@ -307,12 +322,12 @@ void aicwf_rx_deinit(struct aicwf_rx_priv *rx_priv)
|
||||
//rx_priv = NULL;
|
||||
}
|
||||
|
||||
bool aicwf_rxframe_enqueue(struct device *dev, struct frame_queue *q, struct sk_buff *pkt)
|
||||
bool aicwf_rxframe_enqueue(struct device *dev, struct frame_queue *q,
|
||||
struct sk_buff *pkt)
|
||||
{
|
||||
return aicwf_frame_enq(dev, q, pkt, 0);
|
||||
}
|
||||
|
||||
|
||||
void aicwf_dev_skb_free(struct sk_buff *skb)
|
||||
{
|
||||
if (!skb)
|
||||
@@ -321,7 +336,8 @@ void aicwf_dev_skb_free(struct sk_buff *skb)
|
||||
dev_kfree_skb_any(skb);
|
||||
}
|
||||
|
||||
static struct sk_buff *aicwf_frame_queue_penq(struct frame_queue *pq, int prio, struct sk_buff *p)
|
||||
static struct sk_buff *aicwf_frame_queue_penq(struct frame_queue *pq, int prio,
|
||||
struct sk_buff *p)
|
||||
{
|
||||
struct sk_buff_head *q;
|
||||
|
||||
@@ -345,7 +361,8 @@ void aicwf_frame_queue_flush(struct frame_queue *pq)
|
||||
|
||||
for (prio = 0; prio < pq->num_prio; prio++) {
|
||||
q = &pq->queuelist[prio];
|
||||
skb_queue_walk_safe(q, p, next) {
|
||||
skb_queue_walk_safe(q, p, next)
|
||||
{
|
||||
skb_unlink(p, q);
|
||||
aicwf_dev_skb_free(p);
|
||||
pq->qcnt--;
|
||||
@@ -357,7 +374,9 @@ void aicwf_frame_queue_init(struct frame_queue *pq, int num_prio, int max_len)
|
||||
{
|
||||
int prio;
|
||||
|
||||
memset(pq, 0, offsetof(struct frame_queue, queuelist) + (sizeof(struct sk_buff_head) * num_prio));
|
||||
memset(pq, 0,
|
||||
offsetof(struct frame_queue, queuelist) +
|
||||
(sizeof(struct sk_buff_head) * num_prio));
|
||||
pq->num_prio = (u16)num_prio;
|
||||
pq->qmax = (u16)max_len;
|
||||
|
||||
@@ -366,7 +385,8 @@ void aicwf_frame_queue_init(struct frame_queue *pq, int num_prio, int max_len)
|
||||
}
|
||||
}
|
||||
|
||||
struct sk_buff *aicwf_frame_queue_peek_tail(struct frame_queue *pq, int *prio_out)
|
||||
struct sk_buff *aicwf_frame_queue_peek_tail(struct frame_queue *pq,
|
||||
int *prio_out)
|
||||
{
|
||||
int prio;
|
||||
|
||||
@@ -405,7 +425,8 @@ struct sk_buff *aicwf_frame_dequeue(struct frame_queue *pq)
|
||||
if (pq->qcnt == 0)
|
||||
return NULL;
|
||||
|
||||
while ((prio = pq->hi_prio) > 0 && skb_queue_empty(&pq->queuelist[prio]))
|
||||
while ((prio = pq->hi_prio) > 0 &&
|
||||
skb_queue_empty(&pq->queuelist[prio]))
|
||||
pq->hi_prio--;
|
||||
|
||||
q = &pq->queuelist[prio];
|
||||
@@ -430,7 +451,8 @@ static struct sk_buff *aicwf_skb_dequeue_tail(struct frame_queue *pq, int prio)
|
||||
return p;
|
||||
}
|
||||
|
||||
bool aicwf_frame_enq(struct device *dev, struct frame_queue *q, struct sk_buff *pkt, int prio)
|
||||
bool aicwf_frame_enq(struct device *dev, struct frame_queue *q,
|
||||
struct sk_buff *pkt, int prio)
|
||||
{
|
||||
struct sk_buff *p = NULL;
|
||||
int prio_modified = -1;
|
||||
@@ -461,5 +483,3 @@ bool aicwf_frame_enq(struct device *dev, struct frame_queue *q, struct sk_buff *
|
||||
|
||||
return p != NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,9 +30,15 @@
|
||||
|
||||
#define DBG_LEVEL DEBUG_DEBUG_LEVEL
|
||||
|
||||
#define txrx_err(fmt, ...) pr_err("aicbsp: txrx_err:<%s,%d>: " fmt, __func__, __LINE__, ##__VA_ARGS__)
|
||||
#define sdio_err(fmt, ...) pr_err("aicbsp: sdio_err:<%s,%d>: " fmt, __func__, __LINE__, ##__VA_ARGS__)
|
||||
#define usb_err(fmt, ...) pr_err("aicbsp: usb_err:<%s,%d>: " fmt, __func__, __LINE__, ##__VA_ARGS__)
|
||||
#define txrx_err(fmt, ...) \
|
||||
pr_err("aicbsp: txrx_err:<%s,%d>: " fmt, __func__, __LINE__, \
|
||||
##__VA_ARGS__)
|
||||
#define sdio_err(fmt, ...) \
|
||||
pr_err("aicbsp: sdio_err:<%s,%d>: " fmt, __func__, __LINE__, \
|
||||
##__VA_ARGS__)
|
||||
#define usb_err(fmt, ...) \
|
||||
pr_err("aicbsp: usb_err:<%s,%d>: " fmt, __func__, __LINE__, \
|
||||
##__VA_ARGS__)
|
||||
#if DBG_LEVEL >= DEBUG_DEBUG_LEVEL
|
||||
#define sdio_dbg(fmt, ...) printk("aicbsp: " fmt, ##__VA_ARGS__)
|
||||
#define usb_dbg(fmt, ...) printk("aicbsp: " fmt, ##__VA_ARGS__)
|
||||
@@ -48,10 +54,7 @@
|
||||
#define usb_info(fmt, ...)
|
||||
#endif
|
||||
|
||||
enum aicwf_bus_state {
|
||||
BUS_DOWN_ST,
|
||||
BUS_UP_ST
|
||||
};
|
||||
enum aicwf_bus_state { BUS_DOWN_ST, BUS_UP_ST };
|
||||
|
||||
struct aicwf_bus_ops {
|
||||
int (*start)(struct device *dev);
|
||||
@@ -110,7 +113,6 @@ struct aicwf_tx_priv {
|
||||
u8 *tail;
|
||||
};
|
||||
|
||||
|
||||
#define MAX_REORD_RXFRAME 250
|
||||
#define REORDER_UPDATE_TIME 50
|
||||
#define AICWF_REORDER_WINSIZE 64
|
||||
@@ -203,12 +205,15 @@ struct aicwf_tx_priv *aicwf_tx_init(void *arg);
|
||||
struct aicwf_rx_priv *aicwf_rx_init(void *arg);
|
||||
void aicwf_frame_queue_init(struct frame_queue *pq, int num_prio, int max_len);
|
||||
void aicwf_frame_queue_flush(struct frame_queue *pq);
|
||||
bool aicwf_frame_enq(struct device *dev, struct frame_queue *q, struct sk_buff *pkt, int prio);
|
||||
bool aicwf_rxframe_enqueue(struct device *dev, struct frame_queue *q, struct sk_buff *pkt);
|
||||
bool aicwf_frame_enq(struct device *dev, struct frame_queue *q,
|
||||
struct sk_buff *pkt, int prio);
|
||||
bool aicwf_rxframe_enqueue(struct device *dev, struct frame_queue *q,
|
||||
struct sk_buff *pkt);
|
||||
bool aicwf_is_framequeue_empty(struct frame_queue *pq);
|
||||
void aicwf_frame_tx(void *dev, struct sk_buff *skb);
|
||||
void aicwf_dev_skb_free(struct sk_buff *skb);
|
||||
struct sk_buff *aicwf_frame_dequeue(struct frame_queue *pq);
|
||||
struct sk_buff *aicwf_frame_queue_peek_tail(struct frame_queue *pq, int *prio_out);
|
||||
struct sk_buff *aicwf_frame_queue_peek_tail(struct frame_queue *pq,
|
||||
int *prio_out);
|
||||
|
||||
#endif /* _AICWF_TXRXIF_H_ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1 @@
|
||||
int aicwf_get_firmware_array(char *fw_name, u32 **fw_buf);
|
||||
|
||||
|
||||
|
||||
@@ -13,16 +13,14 @@ struct prealloc_txq prealloc_txq;
|
||||
|
||||
void *aicwf_prealloc_txq_alloc(size_t size)
|
||||
{
|
||||
|
||||
BUG_ON(size > MAX_TXQ_SIZE);
|
||||
|
||||
//check prealloc_txq.size
|
||||
if((int)prealloc_txq.size != (int)size)
|
||||
{
|
||||
AICWFDBG(LOGINFO, "%s size is diff will to be kzalloc \r\n", __func__);
|
||||
if ((int)prealloc_txq.size != (int)size) {
|
||||
AICWFDBG(LOGINFO, "%s size is diff will to be kzalloc \r\n",
|
||||
__func__);
|
||||
|
||||
if(prealloc_txq.txq != NULL)
|
||||
{
|
||||
if (prealloc_txq.txq != NULL) {
|
||||
AICWFDBG(LOGINFO, "%s txq to kfree \r\n", __func__);
|
||||
kfree(prealloc_txq.txq);
|
||||
prealloc_txq.txq = NULL;
|
||||
@@ -33,13 +31,14 @@ void *aicwf_prealloc_txq_alloc(size_t size)
|
||||
}
|
||||
|
||||
//check prealloc or not
|
||||
if(!prealloc_txq.prealloced)
|
||||
{
|
||||
if (!prealloc_txq.prealloced) {
|
||||
prealloc_txq.txq = kzalloc(size, GFP_KERNEL);
|
||||
if (!prealloc_txq.txq) {
|
||||
AICWFDBG(LOGERROR, "%s txq kzalloc fail \r\n", __func__);
|
||||
AICWFDBG(LOGERROR, "%s txq kzalloc fail \r\n",
|
||||
__func__);
|
||||
} else {
|
||||
AICWFDBG(LOGINFO, "%s txq kzalloc successful \r\n", __func__);
|
||||
AICWFDBG(LOGINFO, "%s txq kzalloc successful \r\n",
|
||||
__func__);
|
||||
prealloc_txq.prealloced = 1;
|
||||
}
|
||||
} else {
|
||||
@@ -50,8 +49,7 @@ void *aicwf_prealloc_txq_alloc(size_t size)
|
||||
}
|
||||
void aicwf_prealloc_txq_free(void)
|
||||
{
|
||||
if(prealloc_txq.txq != NULL)
|
||||
{
|
||||
if (prealloc_txq.txq != NULL) {
|
||||
AICWFDBG(LOGINFO, "%s txq to kfree \r\n", __func__);
|
||||
kfree(prealloc_txq.txq);
|
||||
prealloc_txq.txq = NULL;
|
||||
@@ -59,4 +57,3 @@ void aicwf_prealloc_txq_free(void)
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(aicwf_prealloc_txq_alloc);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user