下载内核
您可以从基于内核 4.4 的 github 克隆 Rockchip 内核存储库:

支持的 SoC 和设备
瑞芯微内核 4.4 支持:
RK3036、RK3066、RK312X、RK3188、RK322X、RK3288、 RK3328、RK3368、 RK3399、PX30
配置和构建
对于 Linux 操作系统,您需要使用 rockchip_linux_defconfig
对于 ARM v7

适用于 ARM V8

然后你可以得到 Image/zImage 和 dtb 文件并用于 LInux Distro 启动。
瑞芯微 RKIMG 格式图片
RKIMG 是瑞芯微根据 Android 启动镜像定制的格式,通常只供内核开发者使用。它由瑞芯微 U-Boot 支持。
例如,使用以下命令构建 rk3399-evb:

输出如下,boot.img 是带有rockchip header 的ramdisk,kernel 是带有rockchip header 的zImage/Image,resource 是dtb 和带有rockchip header 的boot logo。

为发行版安装引导/内核
我们在 U-Boot 中使用发行版引导,因此我们需要为 U-Boot 创建一个引导分区,其中包含内核映像和 dtb。

添加 extlinux/extlinux.conf 用于发行版引导。


对于 armv7

您需要更改调试 UART 的基地址,您的板的根分区。
请参考 Rockchip Linux 分区定义 的 rootfs 分区和引导到闪存的位置。
在所有这些文件都准备好之后,我们将文件写入引导分区
armv8 的文件夹树(rk3399,rk3328):

armv7(rk3288) 的文件夹树,rootfs 是可选的,我们通常使用压缩的 'zImage':

生成 ext2fs 引导分区
通过 genext2fs:

根据瑞芯微分区定义,你需要刷这个镜像来启动偏移为0x8000的分区。
生成fatfs引导分区
在fatfs中生成boot.img
下面的命令可以生成一个fatfs boot.img

完毕!
将此 boot.img 刷写到启动分区,在 Rockchip 分区定义中偏移 0x8000。
通过目标中的 U-Boot 更新 boot.img
刷机并启动 U-Boot 后,从默认分区表写入 gpt 表

将目标连接到 PC 并在命令行中启动 ums:

我们应该能够看到一个设备连接到 PC,格式化并将数据复制到分区(例如 dev/sdb6)。

完毕!
从 U-Boot 启动
如果您使用 genext2fs 生成 boot.img,则需要在 U-Boot 命令行中写入 gpt 表:

然后从 eMMC 启动或重置:

如果一切正常,您应该能够看到这样的 U-Boot 日志:

原作者:Rockchip wiki
|