Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dilusense DLFR100 RK3399 4+32 #1522

Closed
chamoyo opened this issue Jul 5, 2023 · 2 comments
Closed

Dilusense DLFR100 RK3399 4+32 #1522

chamoyo opened this issue Jul 5, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation new box Research Fills in the Blanks support This need is supported

Comments

@chamoyo
Copy link

chamoyo commented Jul 5, 2023

Device Information | 设备信息

  • SOC:RK3399
  • Model:Dilusense DLFR100
  • Network Card:RTL8211E & RTL8111F
  • HDMI:2.0
  • USB:3.0
  • RAM:4GB
  • eMMC:32G

94aa6b090ca6e561de91ed2ae263c68

2eda781808f26dcbe04987a0e8e3ab0

2dd363d362e24f82a683d64c6b847d5
fc74a8a79b40189ce17710c6e83bcb5

@ophub ophub added documentation Improvements or additions to documentation support This need is supported new box Research Fills in the Blanks labels Jul 5, 2023
@ophub
Copy link
Owner

ophub commented Jul 6, 2023

第一部分:u-boot的源文件来源及编译过程

编译脚本使用的 https://github.com/cm9vdA/build-linux
u-boot和dts使用的 https://github.com/coolsnowwolf/lede 的源文件,文件路径见下面描述部分
U-BOOT使用源码: https://github.com/u-boot/u-boot (branch: v2023.01)
rkbin使用源码: https://github.com/rockchip-linux/rkbin

  • 创建编译目录

cd ~/xxx

进入编译目录

mkdir dlfr100
cd dlfr100
  • clone rkbin

https://github.com/rockchip-linux/rkbin

  • clone u-boot 源码

git clone https://github.com/u-boot/u-boot

检出指定版本的 tags(v2023.01)

cd u-boot
git checkout -b v2023.01 v2023.01

查看检出结果正确
git branch -a

使用lede的补丁生成u-boot源码
如果不是补丁,是u-boot源码文件的可以跳过使用补丁添加文件这步,直接把源文件添加到第四步的build-linux相应目录即可。
wget -qO- https://raw.githubusercontent.com/coolsnowwolf/lede/master/package/boot/uboot-rockchip/patches/309-rockchip-rk3399-Add-support-for-dilusense-dlfr100.patch | patch -p1

执行完反馈的添加情况:


patching file arch/arm/dts/rk3399-dlfr100.dts
patching file arch/arm/dts/rk3399-dlfr100-u-boot.dtsi
patching file configs/dilusense-dlfr100-rk3399_defconfig

返回上级目录继续添加其他
cd ../

  • clone u-boot 编译仓库

git clone https://github.com/cm9vdA/build-linux
cd build-linux

根据 build-linux 仓库的使用方法,把上面生成的u-boot文件复制到这个仓库指定目录里

cp   ../u-boot/arch/arm/dts/rk3399-dlfr100.dts   boot/dts/rockchip/mainline
cp   ../u-boot/arch/arm/dts/rk3399-dlfr100-u-boot.dtsi   boot/dts/rockchip/mainline
cp  ../u-boot/configs/dilusense-dlfr100-rk3399_defconfig   u-boot/rockchip/u-boot-2023.01
  • 按仓库说明编辑 u-boot 参数设置

vi env/common/build_uboot_aarch64

我的环境:ubuntu22.04 x86_64。如果是在armbian里编译时,因为需要先编译ATF,所以两个工具链都下载
下载需要的工具链,解压缩到你指定的存放路径
修改配置文件,根据自己工具链的路径和名称修改,我修改后的内容如下:

TOOLCHAIN_PATH=/usr/local/toolchain
TOOLCHAIN_NAME=arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-elf
ARM_TOOLCHAIN_NAME=arm-gnu-toolchain-12.2.rel1-aarch64-arm-none-eabi

export ARCH=arm
export CROSS_COMPILE=aarch64-none-elf-

添加u-boot编译模版build_uboot_dlfr100
vi env/build_uboot_dlfr100
内容根据上述u-boot的文件名,填写如下

# Common Config
source ${SCRIPT_PATH}/env/common/build_uboot_aarch64

# Board Info
BOARD_NAME="DLFR100 RK3399"
CPU_INFO="Rockchip RK3399"
DEFCONFIG="dilusense-dlfr100-rk3399_defconfig"
VENDOR="rockchip"
DT_FILE="rk3399-dlfr100"

# ATF
# git clone https://github.com/ARM-software/arm-trusted-firmware.git
# make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399
ATF_PLAT="rk3399"
export BL31=${SCRIPT_PATH}/u-boot/rockchip/common/rk3399_bl31.elf
  • 创建 u-boot 编译目录

mkdir mkuboot
cd mkuboot
  • 按仓库说明创建编译脚本软连接

ln -sf ../u-boot uboot
ln -sf ../build-linux/mk_uboot.sh build_uboot_dlfr100
  • 编译 u-boot

./build_uboot_dlfr100
1生成配置,再次运行选3开始编译(过程中可能报错,看错误提示缺少什么,安装对应的编译依赖包后重试)

  • 查看编译好的 u-boot:

cd .build_uboot
ls
  • 复制出 u-boot 备用

mkdir ../dlfr100-uboot
cp  -f  idbloader.img  ../dlfr100-uboot
cp  -f  u-boot.itb  ../dlfr100-uboot

第二部分:dtb文件的编译过程

  • 使用的dts文件

https://github.com/coolsnowwolf/lede/blob/master/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3399-dlfr100.dts

  • 添加内核源码

git clone https://github.com/unifreq/linux-6.1.y
cd linux-6.1.y

将上面的rk3399-dlfr100.dts文件放入arch/arm64/boot/dts/rockchip 目录下
编辑此目录下的Makefile文件,添加一行
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-dlfr100.dtb

  • 编译dtb

根据自己的环境编译得到 rk3399-dlfr100.dtb 文件。
根据测试,这个dts文件在5.4.y, 5.10.y, 5.15.y, 6.1.y 内核源码库里都可以正常编译。

@ophub
Copy link
Owner

ophub commented Jul 6, 2023

编译好的在 https://github.com/ophub/amlogic-s9xxx-armbian/releases 里可以下载,搜 rk3399-dlfr100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation new box Research Fills in the Blanks support This need is supported
Projects
None yet
Development

No branches or pull requests

2 participants