简介
本项目基于泰山派编写一款属于自己Linux SDK。
环境搭建
1 2 3 4
| sudo apt-get install -y \ gcc-aarch64-linux-gnu \ python3-pyelftools \ zstd
|
项目结构
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| rk3566-sdk/ │ ├── bootloader/ │ │ │ ├── rkbin/ │ │ │ └── u-boot/ │ ├── kernel/ │ └── linux-6.1/ │ ├── rootfs/ │ └── buildroot/ │ ├── board/ │ └── tspi-rk3566/ │ │ │ ├── dts/ │ ├── defconfig/ │ ├── rootfs-overlay/ │ ├── partition/ │ └── config/ │ ├── scripts/ │ ├── env.sh │ ├── build_uboot.sh │ ├── build_kernel.sh │ ├── build_rootfs.sh │ ├── pack.sh │ ├── flash.sh │ └── clean.sh │ ├── tools/ │ ├── output/ │ ├── bootloader/ │ ├── kernel/ │ ├── rootfs/ │ └── images/ │ ├── docs/ │ ├── 00_hardware/ │ ├── 01_bootrom/ │ ├── 02_ddr/ │ ├── 03_uboot/ │ ├── 04_kernel/ │ ├── 05_dts/ │ ├── 06_rootfs/ │ └── 07_drivers/ │ ├── README.md └── build.sh
|
硬件
- 控制器:
UART2
- Linux 设备:
ttyFIQ0
- 寄存器地址:
0xFE660000
- 波特率:
1500000
- 数据格式:通常为
8N1
- 引脚复用:
BOOTROM
BootROM 是烧录在 RK3566 芯片内部的一小段只读程序,
是由芯片厂提供,芯片生产时已经固化,用户不能修改,往往是CPU复位后执行。
此时的状态是:
- 外部 DDR 尚未初始化,不能正常使用
- BootROM 只能使用片内 ROM、片内 SRAM 和少量已支持的外设
- 它负责寻找启动介质、验证并读取首级启动镜像
- 找不到镜像时,进入USB下载模式
这一阶段需要先拿到原厂提供的引导固件。
1 2
| git clone https://github.com/rockchip-linux/rkbin.git git clone https://github.com/rockchip-linux/u-boot.git
|
其中rkbin是引导固件,后面的就是uboot代码。
我们进入uboot查看
1 2 3
| chengjing@chengjing:~/pro/rk3566SDK/bootloader/u-boot$ cat configs/rk3566.config CONFIG_BASE_DEFCONFIG="rk3568_defconfig" CONFIG_LOADER_INI="RK3566MINIALL.ini"
|
可以看到板级配置文件依赖rk3568_defconfig
RK3566MINIALL.ini就在下载的rkbin目录里面,主要是Loader 打包清单

uboot阶段使用的设备树文件