Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c278ea699 | ||
|
|
11b5c50909 | ||
|
|
4620af1c49 | ||
|
|
f893dfc3a9 | ||
|
|
768b87d25b | ||
|
|
7ffcf24660 | ||
|
|
395b2c31fd | ||
|
|
e8a0dc398f | ||
|
|
bdfcebbee0 | ||
|
|
99ef6887dc | ||
|
|
8331f26691 | ||
|
|
df2e7be349 | ||
|
|
24815c2659 | ||
|
|
3232b0a2e1 | ||
|
|
0998ee0ecb | ||
|
|
9d8e588745 | ||
|
|
35a27de948 | ||
|
|
2cbdfe444e | ||
|
|
7bcf47d022 | ||
|
|
7087014989 | ||
|
|
719e8aa2be | ||
|
|
f2a033a3d1 | ||
|
|
166eebc45f | ||
|
|
4fd0989c9d | ||
|
|
efbca75965 | ||
|
|
16e59e0f94 | ||
|
|
f01720ad95 |
@@ -818,3 +818,9 @@ tk1:
|
||||
variables:
|
||||
ROLE: tk1
|
||||
<<: *lab_dfn
|
||||
|
||||
# Firefly-RK3399 board running the rk3399-generic build
|
||||
vbe:
|
||||
variables:
|
||||
ROLE: vbe
|
||||
<<: *lab_dfn
|
||||
|
||||
@@ -46,7 +46,12 @@
|
||||
0x0 0xffa88800 0x0 0x1800
|
||||
0x0 0xffa8a000 0x0 0x2000
|
||||
0x0 0xffa8c000 0x0 0x1000>;
|
||||
#ifdef CONFIG_VPL
|
||||
bootph-pre-ram;
|
||||
bootph-some-ram;
|
||||
#else
|
||||
bootph-all;
|
||||
#endif
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@@ -93,6 +98,10 @@
|
||||
};
|
||||
|
||||
&sdmmc {
|
||||
#ifdef CONFIG_VPL
|
||||
bootph-pre-sram;
|
||||
bootph-verify;
|
||||
#endif
|
||||
bootph-pre-ram;
|
||||
bootph-some-ram;
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
compression = FIT_UBOOT_COMP;
|
||||
load = <CONFIG_TEXT_BASE>;
|
||||
entry = <CONFIG_TEXT_BASE>;
|
||||
phase = "u-boot";
|
||||
u-boot-nodtb {
|
||||
compress = FIT_UBOOT_COMP;
|
||||
};
|
||||
@@ -82,6 +83,7 @@
|
||||
arch = FIT_ARCH;
|
||||
os = "arm-trusted-firmware";
|
||||
compression = "none";
|
||||
phase = "u-boot";
|
||||
fit,load;
|
||||
fit,entry;
|
||||
fit,data;
|
||||
@@ -101,6 +103,7 @@
|
||||
arch = FIT_ARCH;
|
||||
os = "tee";
|
||||
compression = "none";
|
||||
phase = "u-boot";
|
||||
fit,load;
|
||||
fit,entry;
|
||||
fit,data;
|
||||
@@ -123,6 +126,7 @@
|
||||
compression = "none";
|
||||
load = <(CFG_SYS_SDRAM_BASE + 0x8400000)>;
|
||||
entry = <(CFG_SYS_SDRAM_BASE + 0x8400000)>;
|
||||
phase = "u-boot";
|
||||
|
||||
tee-os {
|
||||
};
|
||||
@@ -163,9 +167,11 @@
|
||||
};
|
||||
#endif /* HAS_FIT */
|
||||
|
||||
#ifndef CONFIG_VPL
|
||||
simple-bin {
|
||||
filename = "u-boot-rockchip.bin";
|
||||
pad-byte = <0xff>;
|
||||
skip-at-start = <0x8000>;
|
||||
|
||||
mkimage {
|
||||
filename = "idbloader.img";
|
||||
@@ -192,7 +198,11 @@
|
||||
#endif
|
||||
offset = <CONFIG_SPL_PAD_TO>;
|
||||
};
|
||||
|
||||
fdtmap {
|
||||
};
|
||||
};
|
||||
#endif /* !VPL */
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
|
||||
simple-bin-spi {
|
||||
@@ -224,7 +234,14 @@
|
||||
/* Sync with u-boot,spl-payload-offset if present */
|
||||
offset = <CONFIG_SYS_SPI_U_BOOT_OFFS>;
|
||||
};
|
||||
|
||||
fdtmap {
|
||||
};
|
||||
};
|
||||
#endif /* CONFIG_ROCKCHIP_SPI_IMAGE */
|
||||
};
|
||||
#endif /* CONFIG_SPL */
|
||||
|
||||
#ifdef CONFIG_VPL
|
||||
#include "rockchip-vpl-u-boot.dtsi"
|
||||
#endif
|
||||
|
||||
224
arch/arm/dts/rockchip-vpl-u-boot.dtsi
Normal file
224
arch/arm/dts/rockchip-vpl-u-boot.dtsi
Normal file
@@ -0,0 +1,224 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
|
||||
*/
|
||||
|
||||
/ {
|
||||
bootstd {
|
||||
bootph-verify;
|
||||
compatible = "u-boot,boot-std";
|
||||
|
||||
/*
|
||||
* This is used for the VBE OS-request tests. A FAT filesystem
|
||||
* created in a partition with the VBE information appearing
|
||||
* before the partition starts.
|
||||
*
|
||||
* Offsets are aligned to the media block-size, typically 0x200
|
||||
*
|
||||
* The start of the VBE area is set at 8MB, adjusted for the
|
||||
* skip-at-start offset. Before that is a block containing the
|
||||
* version information and before that is the state. These could
|
||||
* be stored in a different storage device if available, but so
|
||||
* far VBE only supports MMC.
|
||||
*
|
||||
* The total area size is 8MB which should be enough for a FIT
|
||||
* containing U-Boot and a number of devicetrees.
|
||||
*/
|
||||
firmware0 {
|
||||
bootph-verify;
|
||||
compatible = "fwupd,vbe-abrec";
|
||||
storage = "mmc0";
|
||||
area-start = <0x7f8000>;
|
||||
area-size = <0x800000>;
|
||||
state-offset = <(0x7f8000 - 0x400)>;
|
||||
state-size = <0x40>;
|
||||
version-offset = <(0x7f8000 - 0x200)>;
|
||||
version-size = <0x100>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&binman {
|
||||
template-1 {
|
||||
images {
|
||||
spl {
|
||||
description = "U-Boot SPL";
|
||||
type = "firmware";
|
||||
os = "u-boot";
|
||||
arch = FIT_ARCH;
|
||||
compression = "lz4";
|
||||
load = <CONFIG_SPL_TEXT_BASE>;
|
||||
entry = <CONFIG_SPL_TEXT_BASE>;
|
||||
phase = "spl";
|
||||
section {
|
||||
compress = "lz4";
|
||||
u-boot-spl-nodtb {
|
||||
};
|
||||
u-boot-spl-bss-pad {
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
configurations {
|
||||
@config-SEQ {
|
||||
fit,firmware = "atf-1", "u-boot", "spl";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
spl_template: template-2 {
|
||||
type = "fit";
|
||||
description = "FIT image for U-Boot SPL";
|
||||
#address-cells = <1>;
|
||||
fit,fdt-list = "of-list";
|
||||
fit,align = <512>;
|
||||
fit,external-offset = <0>;
|
||||
images {
|
||||
spl {
|
||||
description = "U-Boot SPL";
|
||||
type = "firmware";
|
||||
os = "u-boot";
|
||||
arch = FIT_ARCH;
|
||||
compression = "lz4";
|
||||
load = <CONFIG_SPL_TEXT_BASE>;
|
||||
entry = <CONFIG_SPL_TEXT_BASE>;
|
||||
section {
|
||||
compress = "lz4";
|
||||
u-boot-spl-nodtb {
|
||||
};
|
||||
u-boot-spl-bss-pad {
|
||||
};
|
||||
};
|
||||
};
|
||||
@fdt-SEQ {
|
||||
description = "fdt-NAME";
|
||||
compression = "none";
|
||||
type = "flat_dt";
|
||||
fit,fdt-phase = "spl";
|
||||
};
|
||||
};
|
||||
configurations {
|
||||
default = "@config-DEFAULT-SEQ";
|
||||
@config-SEQ {
|
||||
description = "NAME.dtb";
|
||||
fdt = "fdt-SEQ";
|
||||
fit,firmware = "spl";
|
||||
fit,loadables;
|
||||
fit,compatible;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
simple-bin {
|
||||
filename = "u-boot-rockchip.bin";
|
||||
pad-byte = <0xff>;
|
||||
skip-at-start = <0x8000>;
|
||||
|
||||
alternates-fdt {
|
||||
fdt-list-dir = "dts/upstream/src/arm64/rockchip";
|
||||
filename-pattern = "alt-NAME.bin";
|
||||
fdt-phase = "tpl";
|
||||
|
||||
mkimage {
|
||||
filename = "idbloader.img";
|
||||
args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
|
||||
multiple-data-files;
|
||||
|
||||
u-boot-tpl {
|
||||
symbols-base = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
vpl {
|
||||
type = "fit";
|
||||
offset = <(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 0x200)>;
|
||||
description = "FIT image for U-Boot TPL";
|
||||
#address-cells = <1>;
|
||||
fit,fdt-list = "of-list";
|
||||
fit,align = <512>;
|
||||
fit,external-offset = <0>;
|
||||
images {
|
||||
image-vpl {
|
||||
description = "U-Boot VPL";
|
||||
type = "firmware";
|
||||
os = "u-boot";
|
||||
arch = FIT_ARCH;
|
||||
compression = "lz4";
|
||||
load = <CONFIG_VPL_TEXT_BASE>;
|
||||
entry = <CONFIG_VPL_TEXT_BASE>;
|
||||
section {
|
||||
compress = "lz4";
|
||||
u-boot-vpl-nodtb {
|
||||
symbols-base = <0>;
|
||||
};
|
||||
u-boot-vpl-bss-pad {
|
||||
};
|
||||
};
|
||||
};
|
||||
@fdt-SEQ {
|
||||
description = "fdt-NAME";
|
||||
compression = "none";
|
||||
type = "flat_dt";
|
||||
fit,fdt-phase = "vpl";
|
||||
};
|
||||
};
|
||||
configurations {
|
||||
default = "@config-DEFAULT-SEQ";
|
||||
@config-SEQ {
|
||||
description = "NAME.dtb";
|
||||
fdt = "fdt-SEQ";
|
||||
fit,firmware = "image-vpl";
|
||||
fit,loadables;
|
||||
fit,compatible;
|
||||
};
|
||||
};
|
||||
};
|
||||
# ifdef CONFIG_BOOTMETH_VBE_ABREC
|
||||
vbe-a {
|
||||
type = "section";
|
||||
offset = <CONFIG_SPL_PAD_TO>;
|
||||
spl-a {
|
||||
insert-template = <&spl_template>;
|
||||
size = <0x100000>;
|
||||
};
|
||||
|
||||
u-boot-a {
|
||||
insert-template = <&fit_template>;
|
||||
};
|
||||
};
|
||||
vbe-b {
|
||||
type = "section";
|
||||
offset = <0x1000000>;
|
||||
spl-b {
|
||||
insert-template = <&spl_template>;
|
||||
size = <0x100000>;
|
||||
};
|
||||
|
||||
u-boot-b {
|
||||
insert-template = <&fit_template>;
|
||||
};
|
||||
};
|
||||
vbe-recovery {
|
||||
type = "section";
|
||||
offset = <0x1800000>;
|
||||
spl-recovery {
|
||||
insert-template = <&spl_template>;
|
||||
size = <0x100000>;
|
||||
};
|
||||
|
||||
u-boot-recovery {
|
||||
insert-template = <&fit_template>;
|
||||
};
|
||||
};
|
||||
# else /* CONFIG_BOOTMETH_VBE_SIMPLE */
|
||||
vbe {
|
||||
type = "fit";
|
||||
offset = <CONFIG_SPL_PAD_TO>;
|
||||
insert-template = <&fit_template>;
|
||||
};
|
||||
# endif /* VBE method */
|
||||
fdtmap {
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -30,6 +30,7 @@ enum {
|
||||
BOOT_DEVICE_XIP,
|
||||
BOOT_DEVICE_BOOTROM,
|
||||
BOOT_DEVICE_SMH,
|
||||
BOOT_DEVICE_VBE,
|
||||
BOOT_DEVICE_NONE
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -255,17 +255,18 @@ config ROCKCHIP_RK3399
|
||||
select ARM64
|
||||
select SUPPORT_SPL
|
||||
select SUPPORT_TPL
|
||||
select SUPPORT_VPL
|
||||
select SPL
|
||||
select SPL_ATF
|
||||
select SPL_BOARD_INIT if SPL
|
||||
select SPL_LOAD_FIT
|
||||
select SPL_CLK if SPL
|
||||
select SPL_CLK if SPL && !VPL
|
||||
select SPL_PINCTRL if SPL
|
||||
select SPL_RAM if SPL
|
||||
select SPL_REGMAP if SPL
|
||||
select SPL_SYSCON if SPL
|
||||
select TPL_HAVE_INIT_STACK if TPL
|
||||
select SPL_SEPARATE_BSS
|
||||
select VPL_HAVE_INIT_STACK if VPL
|
||||
select CLK
|
||||
select FIT
|
||||
select PINCTRL
|
||||
@@ -301,10 +302,11 @@ config ROCKCHIP_RK3399
|
||||
imply SYS_BOOTCOUNT_SINGLEWORD if BOOTCOUNT_LIMIT
|
||||
imply TPL_CLK
|
||||
imply TPL_DM
|
||||
imply TPL_DM_MMC if VPL
|
||||
imply TPL_LIBCOMMON_SUPPORT
|
||||
imply TPL_LIBGENERIC_SUPPORT
|
||||
imply TPL_OF_CONTROL
|
||||
imply TPL_RAM
|
||||
imply TPL_RAM if !VPL
|
||||
imply TPL_REGMAP
|
||||
imply TPL_ROCKCHIP_COMMON_BOARD
|
||||
imply TPL_SERIAL
|
||||
@@ -569,7 +571,7 @@ config SPL_ROCKCHIP_BACK_TO_BROM
|
||||
|
||||
config TPL_ROCKCHIP_BACK_TO_BROM
|
||||
bool "TPL returns to bootrom"
|
||||
default y
|
||||
default y if !VPL
|
||||
select ROCKCHIP_BROM_HELPER if !ROCKCHIP_RK3066
|
||||
select TPL_BOOTROM_SUPPORT
|
||||
depends on TPL
|
||||
@@ -602,6 +604,16 @@ config TPL_ROCKCHIP_COMMON_BOARD
|
||||
common board is a basic TPL board init which can be shared for most
|
||||
of SoCs to avoid copy-paste for different SoCs.
|
||||
|
||||
config VPL_ROCKCHIP_COMMON_BOARD
|
||||
bool "Rockchip VPL common board file"
|
||||
depends on VPL
|
||||
default y
|
||||
help
|
||||
Enable the VPL phase for rockchip, which selects which SPL/U-Boot
|
||||
will be used on each boot. With this flow, used by Verified Boot for
|
||||
Embedded (VBE), TPL is loaded by the boot ROM. Then TPL loads VPL,
|
||||
VPL loads SPL and SPL loads U-Boot.
|
||||
|
||||
config ROCKCHIP_EXTERNAL_TPL
|
||||
bool "Use external TPL binary"
|
||||
help
|
||||
@@ -700,6 +712,9 @@ config TPL_ROCKCHIP_EARLYRETURN_TO_BROM
|
||||
config SPL_MMC
|
||||
default y if !SPL_ROCKCHIP_BACK_TO_BROM
|
||||
|
||||
config TPL_MMC
|
||||
default y if !TPL_ROCKCHIP_BACK_TO_BROM
|
||||
|
||||
config ROCKCHIP_SPI_IMAGE
|
||||
bool "Build a SPI image for rockchip"
|
||||
help
|
||||
|
||||
@@ -8,11 +8,16 @@
|
||||
# inaccessible/protected memory (and the bootrom-helper assumes that
|
||||
# the stack-pointer is valid before switching to the U-Boot stack).
|
||||
obj-spl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
|
||||
obj-spl-$(CONFIG_SPL_ROCKCHIP_COMMON_BOARD) += spl.o spl-boot-order.o spl_common.o
|
||||
obj-spl-$(CONFIG_SPL_ROCKCHIP_COMMON_BOARD) += spl.o spl_common.o
|
||||
ifndef CONFIG_VPL
|
||||
obj-spl-$(CONFIG_SPL_ROCKCHIP_COMMON_BOARD) += spl-boot-order.o
|
||||
endif
|
||||
obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
|
||||
obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o spl_common.o
|
||||
obj-tpl-$(CONFIG_ROCKCHIP_PX30) += px30-board-tpl.o
|
||||
|
||||
obj-vpl-$(CONFIG_VPL_ROCKCHIP_COMMON_BOARD) += vpl.o
|
||||
|
||||
obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o
|
||||
|
||||
ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_TPL_BUILD),)
|
||||
@@ -49,9 +54,11 @@ obj-$(CONFIG_ROCKCHIP_RK3588) += rk3588/
|
||||
obj-$(CONFIG_ROCKCHIP_RV1108) += rv1108/
|
||||
obj-$(CONFIG_ROCKCHIP_RV1126) += rv1126/
|
||||
|
||||
# Clear out SPL objects, in case this is a TPL build
|
||||
# Clear out SPL objects, in case this is a TPL or VPL build
|
||||
obj-spl-$(CONFIG_TPL_BUILD) =
|
||||
obj-spl-$(CONFIG_VPL_BUILD) =
|
||||
|
||||
# Now add SPL/TPL objects back into the main build
|
||||
obj-$(CONFIG_XPL_BUILD) += $(obj-spl-y)
|
||||
obj-$(CONFIG_TPL_BUILD) += $(obj-tpl-y)
|
||||
obj-$(CONFIG_VPL_BUILD) += $(obj-vpl-y)
|
||||
|
||||
@@ -145,11 +145,20 @@ config TPL_LDSCRIPT
|
||||
default "arch/arm/mach-rockchip/u-boot-tpl-v8.lds"
|
||||
|
||||
config TPL_STACK
|
||||
default 0xff8effff
|
||||
default 0xff8eff00
|
||||
|
||||
config TPL_TEXT_BASE
|
||||
default 0xff8c2000
|
||||
|
||||
config VPL_LDSCRIPT
|
||||
default "arch/arm/mach-rockchip/u-boot-vpl-v8.lds"
|
||||
|
||||
config VPL_STACK
|
||||
default 0xff8eff00
|
||||
|
||||
config VPL_TEXT_BASE
|
||||
default 0xff8c2000
|
||||
|
||||
if BOOTCOUNT_LIMIT
|
||||
|
||||
config BOOTCOUNT_BOOTLIMIT
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* (C) Copyright 2019 Rockchip Electronics Co., Ltd
|
||||
*/
|
||||
|
||||
#include <bloblist.h>
|
||||
#include <cpu_func.h>
|
||||
#include <debug_uart.h>
|
||||
#include <dm.h>
|
||||
@@ -61,6 +62,9 @@ u32 spl_boot_device(void)
|
||||
{
|
||||
u32 boot_device = BOOT_DEVICE_MMC1;
|
||||
|
||||
if (IS_ENABLED(CONFIG_VPL))
|
||||
return BOOT_DEVICE_VBE;
|
||||
|
||||
#if defined(CONFIG_TARGET_CHROMEBOOK_JERRY) || \
|
||||
defined(CONFIG_TARGET_CHROMEBIT_MICKEY) || \
|
||||
defined(CONFIG_TARGET_CHROMEBOOK_MINNIE) || \
|
||||
@@ -130,6 +134,19 @@ void board_init_f(ulong dummy)
|
||||
|
||||
void spl_board_prepare_for_boot(void)
|
||||
{
|
||||
/*
|
||||
* TF-A is executed after SPL and before U-Boot. It removes our access
|
||||
* to the SRAM. So move the bloblist to RAM.
|
||||
*/
|
||||
if (xpl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(BLOBLIST_RELOC)) {
|
||||
ulong addr = CONFIG_IF_ENABLED_INT(BLOBLIST_RELOC,
|
||||
BLOBLIST_RELOC_ADDR);
|
||||
|
||||
log_debug("Relocating bloblist %p to %lx\n", gd_bloblist(),
|
||||
addr);
|
||||
bloblist_reloc(map_sysmem(addr, 0), bloblist_get_total_size());
|
||||
}
|
||||
|
||||
if (!IS_ENABLED(CONFIG_ARM64) || CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
|
||||
return;
|
||||
|
||||
|
||||
@@ -60,10 +60,12 @@ void board_init_f(ulong dummy)
|
||||
|
||||
tpl_board_init();
|
||||
|
||||
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
|
||||
if (ret) {
|
||||
printf("DRAM init failed: %d\n", ret);
|
||||
return;
|
||||
if (CONFIG_IS_ENABLED(RAM)) {
|
||||
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
|
||||
if (ret) {
|
||||
printf("DRAM init failed: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,5 +86,8 @@ int board_return_to_bootrom(struct spl_image_info *spl_image,
|
||||
|
||||
u32 spl_boot_device(void)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_VPL))
|
||||
return BOOT_DEVICE_VBE;
|
||||
|
||||
return BOOT_DEVICE_BOOTROM;
|
||||
}
|
||||
|
||||
@@ -26,9 +26,18 @@ SECTIONS
|
||||
.text : {
|
||||
. = ALIGN(8);
|
||||
CPUDIR/start.o (.text*)
|
||||
|
||||
/* put relocation code all together */
|
||||
_rcode_start = .;
|
||||
*(.text.rcode)
|
||||
*(.text.rdata)
|
||||
_rcode_end = .;
|
||||
|
||||
*(.text*)
|
||||
}
|
||||
|
||||
_rcode_size = _rcode_end - _rcode_start;
|
||||
|
||||
.rodata : {
|
||||
. = ALIGN(8);
|
||||
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
|
||||
@@ -55,6 +64,7 @@ SECTIONS
|
||||
. = ALIGN(8);
|
||||
__bss_end = .;
|
||||
}
|
||||
__bss_size = __bss_end - __bss_start;
|
||||
|
||||
/DISCARD/ : { *(.dynsym) }
|
||||
/DISCARD/ : { *(.dynstr*) }
|
||||
|
||||
107
arch/arm/mach-rockchip/u-boot-vpl-v8.lds
Normal file
107
arch/arm/mach-rockchip/u-boot-vpl-v8.lds
Normal file
@@ -0,0 +1,107 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2019
|
||||
* Rockchip Electronics Co., Ltd
|
||||
* Kever Yang<kever.yang@rock-chips.com>
|
||||
*
|
||||
* (C) Copyright 2013
|
||||
* David Feng <fenghua@phytium.com.cn>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
|
||||
*
|
||||
* (C) Copyright 2010
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Aneesh V <aneesh@ti.com>
|
||||
*/
|
||||
|
||||
OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
|
||||
OUTPUT_ARCH(aarch64)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
|
||||
.text : {
|
||||
. = ALIGN(8);
|
||||
__image_copy_start = .;
|
||||
CPUDIR/start.o (.text*)
|
||||
|
||||
/* put relocation code all together */
|
||||
//. = . + 0xc0;
|
||||
_rcode_start = .;
|
||||
*(.text.rcode)
|
||||
*(.text.rdata)
|
||||
_rcode_end = .;
|
||||
|
||||
*(.text*)
|
||||
}
|
||||
|
||||
.rodata : {
|
||||
. = ALIGN(8);
|
||||
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
|
||||
}
|
||||
|
||||
.data : {
|
||||
. = ALIGN(8);
|
||||
*(.data*)
|
||||
}
|
||||
|
||||
__u_boot_list : {
|
||||
. = ALIGN(8);
|
||||
KEEP(*(SORT(__u_boot_list*)));
|
||||
}
|
||||
|
||||
.image_copy_end : {
|
||||
. = ALIGN(8);
|
||||
*(.__image_copy_end)
|
||||
}
|
||||
|
||||
.end : {
|
||||
. = ALIGN(8);
|
||||
*(.__end)
|
||||
}
|
||||
|
||||
_image_binary_end = .;
|
||||
_end = .;
|
||||
__image_copy_end = .;
|
||||
|
||||
__bss_start = .;
|
||||
.bss_start (NOLOAD) : {
|
||||
. = ALIGN(8);
|
||||
KEEP(*(.__bss_start));
|
||||
}
|
||||
|
||||
.bss (NOLOAD) : {
|
||||
*(.bss*)
|
||||
. = ALIGN(8);
|
||||
}
|
||||
|
||||
.bss_end (NOLOAD) : {
|
||||
KEEP(*(.__bss_end));
|
||||
}
|
||||
__bss_end = .;
|
||||
__bss_size = __bss_end - __bss_start;
|
||||
|
||||
/DISCARD/ : { *(.dynsym) }
|
||||
/DISCARD/ : { *(.dynstr*) }
|
||||
/DISCARD/ : { *(.dynamic*) }
|
||||
/DISCARD/ : { *(.plt*) }
|
||||
/DISCARD/ : { *(.interp*) }
|
||||
/DISCARD/ : { *(.gnu*) }
|
||||
}
|
||||
|
||||
#if defined(CONFIG_TPL_MAX_SIZE)
|
||||
ASSERT(__image_copy_end - __image_copy_start < (CONFIG_TPL_MAX_SIZE), \
|
||||
"TPL image too big");
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_TPL_BSS_MAX_SIZE)
|
||||
ASSERT(__bss_end - __bss_start < (CONFIG_TPL_BSS_MAX_SIZE), \
|
||||
"TPL image BSS too big");
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_TPL_MAX_FOOTPRINT)
|
||||
ASSERT(__bss_end - _start < (CONFIG_TPL_MAX_FOOTPRINT), \
|
||||
"TPL image plus BSS too big");
|
||||
#endif
|
||||
53
arch/arm/mach-rockchip/vpl.c
Normal file
53
arch/arm/mach-rockchip/vpl.c
Normal file
@@ -0,0 +1,53 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2019 Rockchip Electronics Co., Ltd
|
||||
*/
|
||||
|
||||
#include <bootstage.h>
|
||||
#include <debug_uart.h>
|
||||
#include <dm.h>
|
||||
#include <hang.h>
|
||||
#include <init.h>
|
||||
#include <log.h>
|
||||
#include <ram.h>
|
||||
#include <spl.h>
|
||||
#include <version.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch-rockchip/bootrom.h>
|
||||
#include <linux/bitops.h>
|
||||
|
||||
#if CONFIG_IS_ENABLED(BANNER_PRINT)
|
||||
#include <timestamp.h>
|
||||
#endif
|
||||
|
||||
void board_init_f(ulong dummy)
|
||||
{
|
||||
int ret;
|
||||
|
||||
#if defined(CONFIG_DEBUG_UART) && defined(CONFIG_VPL_SERIAL)
|
||||
/*
|
||||
* Debug UART can be used from here if required:
|
||||
*
|
||||
* debug_uart_init();
|
||||
* printch('a');
|
||||
* printhex8(0x1234);
|
||||
* printascii("string");
|
||||
*/
|
||||
debug_uart_init();
|
||||
#ifdef CONFIG_VPL_BANNER_PRINT
|
||||
printascii("\nU-Boot VPL " PLAIN_VERSION " (" U_BOOT_DATE " - "
|
||||
U_BOOT_TIME ")\n");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
ret = spl_early_init();
|
||||
if (ret) {
|
||||
debug("spl_early_init() failed: %d\n", ret);
|
||||
hang();
|
||||
}
|
||||
}
|
||||
|
||||
u32 spl_boot_device(void)
|
||||
{
|
||||
return BOOT_DEVICE_VBE;
|
||||
}
|
||||
@@ -95,3 +95,9 @@ M: Jagan Teki <jagan@amarulasolutions.com>
|
||||
S: Maintained
|
||||
F: configs/rock-pi-n10-rk3399pro_defconfig
|
||||
F: arch/arm/dts/rk3399pro-rock-pi-n10*
|
||||
|
||||
RK3399-GENERIC-DDR3
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
S: Maintained
|
||||
F: configs/rk3399-generic-ddr3_defconfig
|
||||
F: arch/arm/dts/rockchip-vpl-u-boot.dtsi
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#define LOG_CATEGORY LOGC_BOOT
|
||||
|
||||
#include <bootmeth.h>
|
||||
#include <dm.h>
|
||||
#include <memalign.h>
|
||||
#include <mmc.h>
|
||||
@@ -81,3 +82,101 @@ int abrec_read_state(struct udevice *dev, struct abrec_state *state)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vbe_abrec_get_state_desc(struct udevice *dev, char *buf,
|
||||
int maxsize)
|
||||
{
|
||||
struct abrec_state state;
|
||||
int ret;
|
||||
|
||||
ret = abrec_read_state(dev, &state);
|
||||
if (ret)
|
||||
return log_msg_ret("read", ret);
|
||||
|
||||
if (maxsize < 30)
|
||||
return -ENOSPC;
|
||||
snprintf(buf, maxsize, "Version: %s\nVernum: %x/%x", state.fw_version,
|
||||
state.fw_vernum >> FWVER_KEY_SHIFT,
|
||||
state.fw_vernum & FWVER_FW_MASK);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vbe_abrec_read_bootflow(struct udevice *dev, struct bootflow *bflow)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (CONFIG_IS_ENABLED(BOOTMETH_VBE_ABREC_FW)) {
|
||||
if (vbe_phase() == VBE_PHASE_FIRMWARE) {
|
||||
ret = abrec_read_bootflow_fw(dev, bflow);
|
||||
if (ret)
|
||||
return log_msg_ret("fw", ret);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int vbe_abrec_read_file(struct udevice *dev, struct bootflow *bflow,
|
||||
const char *file_path, ulong addr,
|
||||
enum bootflow_img_t type, ulong *sizep)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (vbe_phase() == VBE_PHASE_OS) {
|
||||
ret = bootmeth_common_read_file(dev, bflow, file_path, addr,
|
||||
type, sizep);
|
||||
if (ret)
|
||||
return log_msg_ret("os", ret);
|
||||
}
|
||||
|
||||
/* To be implemented */
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static struct bootmeth_ops bootmeth_vbe_abrec_ops = {
|
||||
.get_state_desc = vbe_abrec_get_state_desc,
|
||||
.read_bootflow = vbe_abrec_read_bootflow,
|
||||
.read_file = vbe_abrec_read_file,
|
||||
};
|
||||
|
||||
static int bootmeth_vbe_abrec_probe(struct udevice *dev)
|
||||
{
|
||||
struct abrec_priv *priv = dev_get_priv(dev);
|
||||
int ret;
|
||||
|
||||
ret = abrec_read_priv(dev_ofnode(dev), priv);
|
||||
if (ret)
|
||||
return log_msg_ret("abp", ret);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bootmeth_vbe_abrec_bind(struct udevice *dev)
|
||||
{
|
||||
struct bootmeth_uc_plat *plat = dev_get_uclass_plat(dev);
|
||||
|
||||
plat->desc = "VBE A/B/recovery";
|
||||
plat->flags = BOOTMETHF_GLOBAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if CONFIG_IS_ENABLED(OF_REAL)
|
||||
static const struct udevice_id generic_simple_vbe_abrec_ids[] = {
|
||||
{ .compatible = "fwupd,vbe-abrec" },
|
||||
{ }
|
||||
};
|
||||
#endif
|
||||
|
||||
U_BOOT_DRIVER(vbe_abrec) = {
|
||||
.name = "vbe_abrec",
|
||||
.id = UCLASS_BOOTMETH,
|
||||
.of_match = of_match_ptr(generic_simple_vbe_abrec_ids),
|
||||
.ops = &bootmeth_vbe_abrec_ops,
|
||||
.bind = bootmeth_vbe_abrec_bind,
|
||||
.probe = bootmeth_vbe_abrec_probe,
|
||||
.flags = DM_FLAG_PRE_RELOC,
|
||||
.priv_auto = sizeof(struct abrec_priv),
|
||||
};
|
||||
|
||||
@@ -92,9 +92,13 @@ static int do_vbe_state(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
|
||||
printf("Phases:");
|
||||
for (i = PHASE_NONE; i < PHASE_COUNT; i++) {
|
||||
if (handoff->phases & (1 << i))
|
||||
printf(" %s", xpl_name(i));
|
||||
if (handoff->phases & (1 << i)) {
|
||||
int margin = handoff->reloc_margin[i];
|
||||
|
||||
printf(" %s", xpl_name(i));
|
||||
if (margin)
|
||||
printf(" (margin %x) ", margin);
|
||||
}
|
||||
}
|
||||
if (!handoff->phases)
|
||||
printf(" (none)");
|
||||
|
||||
@@ -1141,6 +1141,26 @@ config SPL_BLOBLIST_PASSAGE
|
||||
|
||||
endchoice
|
||||
|
||||
config SPL_BLOBLIST_RELOC
|
||||
bool "Relocate the bloblist before existing SPL"
|
||||
depends on BLOBLIST_FIXED
|
||||
help
|
||||
Some platforms locate the bloblist in SRAM in SPL. In some cases,
|
||||
the TF-A BL31 blob removes access to SRAM, e.g. with Rockchip RK3399.
|
||||
|
||||
Enable this option to make U-Boot copy the bloblist from SRAM to SDRAM
|
||||
before leaving SPL.
|
||||
|
||||
config SPL_BLOBLIST_RELOC_ADDR
|
||||
hex "Relocate the bloblist before existing SPL"
|
||||
depends on SPL_BLOBLIST_RELOC
|
||||
default BLOBLIST_ADDR
|
||||
help
|
||||
Sets the address to which the bloblist is relocated at the end of SPL.
|
||||
U-Boot proper uses this address when it starts up. Note that U-Boot
|
||||
always relocates the bloblist again as part of its own relocation
|
||||
process.
|
||||
|
||||
endif # SPL_BLOBLIST
|
||||
|
||||
if TPL_BLOBLIST
|
||||
|
||||
@@ -520,9 +520,22 @@ int bloblist_init(void)
|
||||
expected = (fixed && !xpl_is_first_phase()) || passage_valid();
|
||||
if (xpl_prev_phase() == PHASE_TPL && !IS_ENABLED(CONFIG_TPL_BLOBLIST))
|
||||
expected = false;
|
||||
if (fixed)
|
||||
if (fixed) {
|
||||
addr = IF_ENABLED_INT(CONFIG_BLOBLIST_FIXED,
|
||||
CONFIG_BLOBLIST_ADDR);
|
||||
|
||||
if (xpl_phase() == PHASE_BOARD_F &&
|
||||
IS_ENABLED(CONFIG_SPL_BLOBLIST_RELOC)) {
|
||||
ulong addr = IF_ENABLED_INT(CONFIG_SPL_BLOBLIST_RELOC,
|
||||
CONFIG_SPL_BLOBLIST_RELOC_ADDR);
|
||||
|
||||
log_debug("Using bloblist at %lx\n", addr);
|
||||
bloblist_reloc(map_sysmem(addr, 0),
|
||||
bloblist_get_total_size());
|
||||
}
|
||||
log_debug("bloblist addr=%lx\n", addr);
|
||||
}
|
||||
|
||||
size = CONFIG_BLOBLIST_SIZE;
|
||||
if (expected) {
|
||||
if (passage_valid()) {
|
||||
|
||||
@@ -97,7 +97,7 @@ config SPL_MAX_SIZE
|
||||
|
||||
config SPL_PAD_TO
|
||||
hex "Offset to which the SPL should be padded before appending the SPL payload"
|
||||
default 0x7f8000 if ARCH_ROCKCHIP
|
||||
default 0x800000 if ARCH_ROCKCHIP
|
||||
default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB
|
||||
default 0x11000 if ARCH_MX7 || (ARCH_MX6 && !MX6_OCRAM_256KB)
|
||||
default 0x10000 if ARCH_KEYSTONE
|
||||
@@ -573,6 +573,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
|
||||
default 0x200 if ARCH_SOCFPGA || ARCH_AT91
|
||||
default 0x300 if ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || \
|
||||
OMAP54XX || AM33XX || AM43XX || ARCH_K3
|
||||
default 0x800 if ARCH_ROCKCHIP && VPL
|
||||
default 0x4000 if ARCH_ROCKCHIP
|
||||
default 0x822 if TARGET_SIFIVE_UNLEASHED || TARGET_SIFIVE_UNMATCHED
|
||||
help
|
||||
|
||||
@@ -205,6 +205,8 @@ ulong spl_get_image_size(void)
|
||||
#ifdef CONFIG_VPL
|
||||
if (xpl_next_phase() == PHASE_VPL)
|
||||
return binman_sym(ulong, u_boot_vpl_any, size);
|
||||
|
||||
return 0; /* VBE handles this */
|
||||
#endif
|
||||
return xpl_next_phase() == PHASE_SPL ?
|
||||
binman_sym(ulong, u_boot_spl_any, size) :
|
||||
|
||||
@@ -4,11 +4,13 @@
|
||||
* Written by Simon Glass <sjg@chromium.org>
|
||||
*/
|
||||
|
||||
#include <bloblist.h>
|
||||
#include <gzip.h>
|
||||
#include <image.h>
|
||||
#include <log.h>
|
||||
#include <mapmem.h>
|
||||
#include <spl.h>
|
||||
#include <vbe.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/sections.h>
|
||||
@@ -58,8 +60,18 @@ static int setup_layout(struct spl_image_info *image, ulong *addrp)
|
||||
buf_size = rcode_base - base;
|
||||
uint need_size = image->size + image->fdt_size;
|
||||
margin = buf_size - need_size;
|
||||
|
||||
if (CONFIG_IS_ENABLED(BLOBLIST)) {
|
||||
struct vbe_handoff *handoff;
|
||||
|
||||
handoff = bloblist_find(BLOBLISTT_VBE,
|
||||
sizeof(struct vbe_handoff));
|
||||
if (handoff)
|
||||
handoff->reloc_margin[xpl_phase()] = margin;
|
||||
}
|
||||
|
||||
log_debug("spl_reloc %s->%s: margin%s%lx limit %lx fdt_size %lx base %lx avail %x image %x fdt %lx need %x\n",
|
||||
spl_phase_name(spl_phase()), spl_phase_name(spl_phase() + 1),
|
||||
xpl_name(xpl_phase()), xpl_name(xpl_phase() + 1),
|
||||
margin >= 0 ? " " : " -", abs(margin), limit, fdt_size, base,
|
||||
buf_size, image->size, image->fdt_size, need_size);
|
||||
if (margin < 0) {
|
||||
|
||||
@@ -23,7 +23,7 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-puma-haikou.dtb"
|
||||
CONFIG_CONSOLE_MUX=y
|
||||
CONFIG_DISPLAY_BOARDINFO_LATE=y
|
||||
CONFIG_SPL_MAX_SIZE=0x2e000
|
||||
CONFIG_SPL_PAD_TO=0x38000
|
||||
CONFIG_SPL_PAD_TO=0x40000
|
||||
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
|
||||
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
|
||||
CONFIG_SPL_I2C=y
|
||||
|
||||
@@ -26,7 +26,7 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/px30-ringneck-haikou.dtb"
|
||||
CONFIG_DISPLAY_BOARDINFO_LATE=y
|
||||
CONFIG_MISC_INIT_R=y
|
||||
CONFIG_SPL_MAX_SIZE=0x20000
|
||||
CONFIG_SPL_PAD_TO=0x38000
|
||||
CONFIG_SPL_PAD_TO=0x40000
|
||||
CONFIG_SPL_BOARD_INIT=y
|
||||
CONFIG_SPL_BOOTROM_SUPPORT=y
|
||||
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
|
||||
|
||||
125
configs/rk3399-generic-ddr3_defconfig
Normal file
125
configs/rk3399-generic-ddr3_defconfig
Normal file
@@ -0,0 +1,125 @@
|
||||
CONFIG_ARM=y
|
||||
CONFIG_SKIP_LOWLEVEL_INIT=y
|
||||
CONFIG_SPL_SYS_DCACHE_OFF=y
|
||||
CONFIG_COUNTER_FREQUENCY=24000000
|
||||
CONFIG_ARCH_ROCKCHIP=y
|
||||
CONFIG_TEXT_BASE=0x00200000
|
||||
CONFIG_SPL_LIBCOMMON_SUPPORT=y
|
||||
CONFIG_SPL_LIBGENERIC_SUPPORT=y
|
||||
CONFIG_NR_DRAM_BANKS=1
|
||||
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x3f00000
|
||||
CONFIG_SF_DEFAULT_SPEED=20000000
|
||||
CONFIG_ENV_OFFSET=0x3F8000
|
||||
CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3399-firefly"
|
||||
CONFIG_DM_RESET=y
|
||||
CONFIG_ROCKCHIP_RK3399=y
|
||||
CONFIG_SPL_STACK_R_ADDR=0x04000000
|
||||
CONFIG_TARGET_EVB_RK3399=y
|
||||
CONFIG_SPL_STACK=0xff8eff00
|
||||
CONFIG_SPL_TEXT_BASE=0xff8c2000
|
||||
CONFIG_SPL_BSS_MAX_SIZE=0x2000
|
||||
CONFIG_SPL_STACK_R=y
|
||||
CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x30000
|
||||
CONFIG_SYS_LOAD_ADDR=0x800800
|
||||
CONFIG_DEBUG_UART_BASE=0xFF1A0000
|
||||
CONFIG_DEBUG_UART_CLOCK=24000000
|
||||
CONFIG_PCI=y
|
||||
CONFIG_DEBUG_UART=y
|
||||
CONFIG_FIT_BEST_MATCH=y
|
||||
CONFIG_VPL_LOAD_FIT_FULL=y
|
||||
# CONFIG_VPL_FIT_PRINT is not set
|
||||
# CONFIG_VPL_FIT_SIGNATURE is not set
|
||||
# CONFIG_VPL_BOOTSTD is not set
|
||||
# CONFIG_BOOTMETH_VBE_SIMPLE is not set
|
||||
CONFIG_BOOTMETH_VBE_ABREC=y
|
||||
CONFIG_BOOTSTAGE=y
|
||||
CONFIG_BOOTSTAGE_REPORT=y
|
||||
CONFIG_USE_PREBOOT=y
|
||||
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-generic.dtb"
|
||||
CONFIG_LOG=y
|
||||
CONFIG_DISPLAY_BOARDINFO_LATE=y
|
||||
CONFIG_BLOBLIST=y
|
||||
CONFIG_BLOBLIST_FIXED=y
|
||||
CONFIG_BLOBLIST_ADDR=0xff8eff00
|
||||
CONFIG_BLOBLIST_SIZE=0x100
|
||||
CONFIG_SPL_MAX_SIZE=0x40000
|
||||
# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
|
||||
CONFIG_SPL_HAVE_INIT_STACK=y
|
||||
# CONFIG_SPL_SEPARATE_BSS is not set
|
||||
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1000
|
||||
CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
|
||||
CONFIG_TPL=y
|
||||
CONFIG_TPL_RELOC_LOADER=y
|
||||
CONFIG_VPL=y
|
||||
CONFIG_VPL_RELOC_LOADER=y
|
||||
CONFIG_CMD_BOOTZ=y
|
||||
CONFIG_CMD_GPT=y
|
||||
CONFIG_CMD_MMC=y
|
||||
CONFIG_CMD_PCI=y
|
||||
CONFIG_CMD_USB=y
|
||||
# CONFIG_CMD_SETEXPR is not set
|
||||
CONFIG_CMD_CACHE=y
|
||||
CONFIG_CMD_TIME=y
|
||||
CONFIG_CMD_BOOTSTAGE=y
|
||||
CONFIG_SPL_OF_CONTROL=y
|
||||
CONFIG_OF_LIST="rockchip/rk3399-nanopc-t4 rockchip/rk3399-nanopi-m4 rockchip/rk3399-nanopi-m4b rockchip/rk3399-nanopi-neo4 rockchip/rk3399-evb rockchip/rk3399-ficus rockchip/rk3399-firefly rockchip/rk3399-orangepi rockchip/rk3399-puma-haikou"
|
||||
CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
|
||||
CONFIG_ENV_IS_IN_MMC=y
|
||||
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
CONFIG_TPL_DM_SEQ_ALIAS=y
|
||||
CONFIG_VPL_REGMAP=y
|
||||
CONFIG_VPL_SYSCON=y
|
||||
CONFIG_SPL_CLK=y
|
||||
CONFIG_ROCKCHIP_GPIO=y
|
||||
CONFIG_SYS_I2C_ROCKCHIP=y
|
||||
CONFIG_MMC_DW=y
|
||||
CONFIG_MMC_DW_ROCKCHIP=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_MMC_SDHCI_ROCKCHIP=y
|
||||
CONFIG_PHY_REALTEK=y
|
||||
CONFIG_DM_ETH_PHY=y
|
||||
CONFIG_ETH_DESIGNWARE=y
|
||||
CONFIG_GMAC_ROCKCHIP=y
|
||||
CONFIG_NVME_PCI=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
|
||||
CONFIG_PHY_ROCKCHIP_TYPEC=y
|
||||
# CONFIG_SPL_DM_PMIC is not set
|
||||
CONFIG_PMIC_RK8XX=y
|
||||
CONFIG_REGULATOR_PWM=y
|
||||
CONFIG_REGULATOR_RK8XX=y
|
||||
CONFIG_PWM_ROCKCHIP=y
|
||||
CONFIG_BAUDRATE=1500000
|
||||
CONFIG_DEBUG_UART_SHIFT=2
|
||||
CONFIG_SYS_NS16550_MEM32=y
|
||||
CONFIG_SYSRESET=y
|
||||
# CONFIG_VPL_SYSRESET is not set
|
||||
CONFIG_USB=y
|
||||
# CONFIG_SPL_DM_USB is not set
|
||||
CONFIG_USB_XHCI_HCD=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_EHCI_GENERIC=y
|
||||
CONFIG_USB_DWC3=y
|
||||
CONFIG_USB_DWC3_GENERIC=y
|
||||
CONFIG_USB_HOST_ETHER=y
|
||||
CONFIG_USB_ETHER_ASIX=y
|
||||
CONFIG_USB_ETHER_ASIX88179=y
|
||||
CONFIG_USB_ETHER_MCS7830=y
|
||||
CONFIG_USB_ETHER_RTL8152=y
|
||||
CONFIG_USB_ETHER_SMSC95XX=y
|
||||
CONFIG_VIDEO=y
|
||||
CONFIG_DISPLAY=y
|
||||
CONFIG_VIDEO_ROCKCHIP=y
|
||||
CONFIG_DISPLAY_ROCKCHIP_HDMI=y
|
||||
CONFIG_VPL_USE_TINY_PRINTF=y
|
||||
CONFIG_SPL_TINY_MEMSET=y
|
||||
CONFIG_CMD_DHRYSTONE=y
|
||||
# CONFIG_SPL_SHA1 is not set
|
||||
# CONFIG_VPL_SHA1 is not set
|
||||
# CONFIG_VPL_SHA256 is not set
|
||||
CONFIG_TPL_CRC8=y
|
||||
CONFIG_TPL_LZ4=y
|
||||
CONFIG_VPL_LZ4=y
|
||||
# CONFIG_VPL_LZMA is not set
|
||||
CONFIG_ERRNO_STR=y
|
||||
10
contrib/README.rst
Normal file
10
contrib/README.rst
Normal file
@@ -0,0 +1,10 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
Contributions
|
||||
=============
|
||||
|
||||
The `contrib` directory contains software / files which have been contributed
|
||||
to the U-Boot project but are not maintained by the core developers.
|
||||
|
||||
Note to contributors: Each item must have at least an entry in this file. Be
|
||||
sure to add the appropriate GPL-2.0-or-later SPDX tag to files.
|
||||
@@ -519,6 +519,19 @@ config-flash.ini:
|
||||
[OUTPUT]
|
||||
PATH=RK30xxLoader_uboot.bin
|
||||
|
||||
Verified Boot for Embedded (VBE)
|
||||
--------------------------------
|
||||
|
||||
VBE is supported on rk3399 at present, with SDRAM being set up in SPL. The full
|
||||
A/B/recovery flow is supported in U-Boot.
|
||||
|
||||
To build this, use the rk3399-generic board, setting CONFIG_OF_LIST to the list
|
||||
of boards you want to support. All boards must use the same SDRAM type.
|
||||
|
||||
VBE uses internal SRAM (IRAM) for the TPL, VPL and early SPL phases. The stack
|
||||
stop is near the top of this (0xff8eff00) with the 256-byte bloblist immediately
|
||||
following.
|
||||
|
||||
TODO
|
||||
----
|
||||
|
||||
|
||||
1
doc/develop/contrib
Symbolic link
1
doc/develop/contrib
Symbolic link
@@ -0,0 +1 @@
|
||||
../../contrib/
|
||||
@@ -113,3 +113,11 @@ Historical documentation
|
||||
:maxdepth: 2
|
||||
|
||||
historical/index
|
||||
|
||||
Contributions
|
||||
-------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
contrib/README
|
||||
|
||||
@@ -194,6 +194,7 @@ struct io_setting {
|
||||
static bool phase_sdram_init(void)
|
||||
{
|
||||
return xpl_phase() == PHASE_TPL ||
|
||||
(IS_ENABLED(CONFIG_VPL) && xpl_phase() == PHASE_SPL) ||
|
||||
(!IS_ENABLED(CONFIG_TPL) &&
|
||||
!IS_ENABLED(CONFIG_ROCKCHIP_EXTERNAL_TPL) &&
|
||||
!not_xpl());
|
||||
@@ -3195,8 +3196,9 @@ U_BOOT_DRIVER(dmc_rk3399) = {
|
||||
.of_to_plat = rk3399_dmc_of_to_plat,
|
||||
.probe = rk3399_dmc_probe,
|
||||
.priv_auto = sizeof(struct dram_info),
|
||||
#if defined(CONFIG_TPL_BUILD) || \
|
||||
(!defined(CONFIG_TPL) && defined(CONFIG_XPL_BUILD))
|
||||
#if defined(CONFIG_VPL) && defined(CONFIG_SPL_BUILD) || \
|
||||
!defined(CONFIG_VPL) && defined(CONFIG_TPL_BUILD) || \
|
||||
!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)
|
||||
.plat_auto = sizeof(struct rockchip_dmc_plat),
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#define __VBE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <spl.h>
|
||||
|
||||
/**
|
||||
* enum vbe_phase_t - current phase of VBE
|
||||
@@ -47,12 +48,14 @@ enum vbe_pick_t {
|
||||
* @size: Size of the area containing the FIT
|
||||
* @phases: Indicates which phases used the VBE bootmeth (1 << PHASE_...)
|
||||
* @pick: Indicates which firmware pick was used (enum vbe_pick_t)
|
||||
* @reloc_margin: Indicates the number of bytes of margin coming into this phase
|
||||
*/
|
||||
struct vbe_handoff {
|
||||
ulong offset;
|
||||
ulong size;
|
||||
u8 phases;
|
||||
u8 pick;
|
||||
int reloc_margin[PHASE_COUNT];
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user