OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 4346|回复: 2

深圳视壮瑞芯微工控主板rk3399-uboot简单分析

[复制链接]

60

主题

62

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
417
金钱
417
注册时间
2018-4-2
在线时间
42 小时
发表于 2018-4-27 14:52:48 | 显示全部楼层 |阅读模式
深圳视壮瑞芯微工控主板rk3399-uboot简单分析

使用的配置文件是:

configs/rk3399_box_defconfig

CONFIG_RKCHIP_RK3399=y
CONFIG_PRODUCT_BOX=y
CONFIG_NORMAL_WORLD=y
CONFIG_SECOND_LEVEL_BOOTLOADER=y
CONFIG_BAUDRATE=1500000
CONFIG_ARM=y
CONFIG_ROCKCHIP_ARCH64=y
CONFIG_PLAT_RK33XX=y

下载uboot原生的代码和瑞芯微提供的源码进行对比,首先肯定对比一下Makefile发现差异如下:

ifeq ($(ARCHV),aarch64)

ifneq ($(wildcard ../toolchain/aarch64-linux-android-4.9),)
CROSS_COMPILE   ?= $(shell pwd)/../toolchain/aarch64-linux-android-4.9/bin/aarch64-linux-android-
endif
ifneq ($(wildcard ../prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin),)
CROSS_COMPILE   ?= $(shell pwd)/../prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
endif

else

ifneq ($(wildcard ../toolchain/arm-eabi-4.8),)
CROSS_COMPILE   ?= $(shell pwd)/../toolchain/arm-eabi-4.8/bin/arm-eabi-
endif
ifneq ($(wildcard ../toolchain/arm-eabi-4.7),)
CROSS_COMPILE   ?= $(shell pwd)/../toolchain/arm-eabi-4.7/bin/arm-eabi-
endif
ifneq ($(wildcard ../toolchain/arm-eabi-4.6),)
CROSS_COMPILE   ?= $(shell pwd)/../toolchain/arm-eabi-4.6/bin/arm-eabi-
endif
ifneq ($(wildcard ../prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin),)
CROSS_COMPILE   ?= $(shell pwd)/../prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi-
endif
ifneq ($(wildcard ../prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin),)
CROSS_COMPILE   ?= $(shell pwd)/../prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi-
endif
ifneq ($(wildcard ../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin),)
CROSS_COMPILE   ?= $(shell pwd)/../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
endif

endif # ARCHV=aarch64

这一段其实只是指定交叉编译工具链没什么好解释的。

ifdef CONFIG_ROCKCHIP
# rk uboot version should consist of two digits, as 01
RK_UBOOT_VERSION = 10

ifdef CONFIG_RKCHIP_RK3399
RKCHIP ?= RK3399
endif

RKCHIP ?= `sed -n "/CHIP=/s/CHIP=//p" RKBOOT.ini|tr -d '\r'`

UBOOTVERSION := $(UBOOTVERSION)$(if $(RKCHIP),-$(RKCHIP))$(if $(RK_UBOOT_VERSION),-$(RK_UBOOT_VERSION))

RK_SUBFIX = $(if $(RK_UBOOT_VERSION),.$(RK_UBOOT_VERSION)).bin

ifdef CONFIG_MERGER_TRUSTOS
ifdef CONFIG_RK_TOS_WITH_TA
RK_TOS_BIN ?= `sed -n "/TOSTA=/s/TOSTA=//p" ./tools/rk_tools/RKTRUST/$(RKCHIP)TOS.ini|tr -d '\r'`
else
RK_TOS_BIN ?= `sed -n "/TOS=/s/TOS=//p" ./tools/rk_tools/RKTRUST/$(RKCHIP)TOS.ini|tr -d '\r'`
endif
endif

RKLoader_uboot.bin: u-boot.bin
ifdef CONFIG_SECOND_LEVEL_BOOTLOADER
    $(if $(CONFIG_MERGER_MINILOADER), ./tools/boot_merger ./tools/rk_tools/RKBOOT/$(RKCHIP)MINIALL.ini &&) \
    $(if $(CONFIG_MERGER_TRUSTIMAGE), ./tools/trust_merger $(if $(CONFIG_RK_TRUSTOS), --subfix) \
                            ./tools/rk_tools/RKTRUST/$(RKCHIP)TRUST.ini &&) \
    $(if $(CONFIG_MERGER_TRUSTOS), ./tools/loaderimage --pack --trustos $(RK_TOS_BIN) trust.img &&) \
    ./tools/loaderimage --pack --uboot u-boot.bin uboot.img
else
    ./tools/boot_merger --subfix "$(RK_SUBFIX)" ./tools/rk_tools/RKBOOT/$(RKCHIP).ini
endif # CONFIG_SECOND_LEVEL_BOOTLOADER

endif # CONFIG_ROCKCHIP

RK3399 cmdline:

earlycon=uart8250,mmio32,0xff1a0000
swiotlb=1
androidboot.baseband=N/A
androidboot.selinux=disabled
androidboot.hardware=rk30board
androidboot.console=ttyFIQ0
init=/sbin/init
root=/dev/block/mtd/by-name/linuxroot rw rootwait
mtdparts=
rk29xxnand:
0x00002000@0x00002000(uboot),
0x00002000@0x00004000(trust),
0x00002000@0x00006000(misc),
0x00008000@0x00008000(resource),
0x0000A000@0x00010000(kernel),
0x0000E000@0x0001A000(boot),
0x00010000@0x00028000(recovery),
0x00038000@0x00038000(backup),
0x00040000@0x00070000(cache),
0x00200000@0x000B0000(system),
0x00008000@0x002B0000(metadata),
0x00002000@0x002B8000(baseparamer),
0x00010000@0x002BA000(ramfs),
0x00800000@0x002CA000(linuxroot),
-@0x00ACA000(userdata)
storagemedia=emmc
uboot_logo=0x02000000@0xf5c00000
loader.timestamp=2017-03-07_10:33:54
hdmi.vic=65536
androidboot.mode=emmc


TB2evzBk9fD8KJjSszhXXbIJFXa_!!1943326520.jpg
转载注明:http://bbs.videostrong.com/
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

60

主题

62

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
417
金钱
417
注册时间
2018-4-2
在线时间
42 小时
 楼主| 发表于 2018-5-17 15:13:16 | 显示全部楼层
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-4-20 02:13

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表