瑞芯微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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM