mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 07:31:15 +00:00
Prepare v2023.10-rc4
-----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmT17FsACgkQFHw5/5Y0 tywn0gwAlRs5NZ4ierzvDiLQEvYgV6E+lLccwyf8mMfJVHicrrW/ckxqJGS2mrLz IoA0pO1oF/HFfR/0pgx9Pb2kuIK1tkCeVNYW6t9EDbEJzrbfdvykBcSB4wgKYpgB ZgCga0jsPNM951Y3a3TElNEet4pVTZrDLu0E2UR6zNzr5hpKnfoQTZRfBI1MyCq4 w4/Eo2wAnnaV1lcobg9LzM6uyDnETxWyTI7DIJYSqkEgT0WcF6zrdW55MaXtrPo5 RZ4q5MTJQwqnTV5awsmgEt8PSC+XQcPHMPrVCwoOZAdru+5zO3AWpbqq1q6K+y9U FEsaJ6HGn5BdITgmIK/lb8oTekfOkDPFF3WuFp5bZ6L0A63ANu/MMWHELyyt5+0z TlnU94PVxiLnPMzZtfBPWRQ3jIU5qltJaoW0pKwsoa7P8iUd1WZgYyN+G9WPgwFr XUemGRNkgnWfRoxcKGbaYDSB0Llp6m/zqPlGfhlt0ZKXc6igLu3/egRh7/8zLR0i y9uBKG45 =s9vZ -----END PGP SIGNATURE----- Merge tag 'v2023.10-rc4' into next Prepare v2023.10-rc4
This commit is contained in:
commit
ddec4cae62
72 changed files with 1218 additions and 455 deletions
|
@ -468,6 +468,7 @@ stages:
|
|||
- stage: world_build
|
||||
jobs:
|
||||
- job: build_the_world
|
||||
timeoutInMinutes: 0 # Use the maximum allowed
|
||||
displayName: 'Build the World'
|
||||
pool:
|
||||
vmImage: $(ubuntu_vm)
|
||||
|
|
|
@ -1016,7 +1016,6 @@ F: tools/mkeficapsule.c
|
|||
|
||||
ENVIRONMENT
|
||||
M: Joe Hershberger <joe.hershberger@ni.com>
|
||||
R: Wolfgang Denk <wd@denx.de>
|
||||
S: Maintained
|
||||
F: env/
|
||||
F: include/env*
|
||||
|
@ -1026,7 +1025,6 @@ F: tools/mkenvimage.c
|
|||
|
||||
ENVIRONMENT AS TEXT
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
R: Wolfgang Denk <wd@denx.de>
|
||||
S: Maintained
|
||||
F: doc/usage/environment.rst
|
||||
F: scripts/env2string.awk
|
||||
|
@ -1344,8 +1342,7 @@ F: drivers/power/
|
|||
F: include/power/
|
||||
|
||||
POWERPC
|
||||
M: Wolfgang Denk <wd@denx.de>
|
||||
S: Maintained
|
||||
S: Orphan (Since 2022-10-21)
|
||||
F: arch/powerpc/
|
||||
|
||||
POWERPC MPC8XX
|
||||
|
|
8
Makefile
8
Makefile
|
@ -3,7 +3,7 @@
|
|||
VERSION = 2023
|
||||
PATCHLEVEL = 10
|
||||
SUBLEVEL =
|
||||
EXTRAVERSION = -rc3
|
||||
EXTRAVERSION = -rc4
|
||||
NAME =
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
@ -1328,11 +1328,6 @@ u-boot.ldr: u-boot
|
|||
# Use 'make BINMAN_VERBOSE=3' to set vebosity level
|
||||
default_dt := $(if $(DEVICE_TREE),$(DEVICE_TREE),$(CONFIG_DEFAULT_DEVICE_TREE))
|
||||
|
||||
# Temporary workaround for Venice boards
|
||||
ifneq ($(CONFIG_TARGET_IMX8MM_VENICE),$(CONFIG_TARGET_IMX8MN_VENICE),$(CONFIG_TARGET_IMX8MP_VENICE),)
|
||||
ignore_dups := --ignore-dup-phandles
|
||||
endif
|
||||
|
||||
quiet_cmd_binman = BINMAN $@
|
||||
cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
|
||||
$(foreach f,$(BINMAN_TOOLPATHS),--toolpath $(f)) \
|
||||
|
@ -1354,7 +1349,6 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
|
|||
-a spl-dtb=$(CONFIG_SPL_OF_REAL) \
|
||||
-a tpl-dtb=$(CONFIG_TPL_OF_REAL) \
|
||||
-a pre-load-key-path=${PRE_LOAD_KEY_PATH} \
|
||||
$(ignore_dups) \
|
||||
$(BINMAN_$(@F))
|
||||
|
||||
OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex
|
||||
|
|
|
@ -41,9 +41,11 @@
|
|||
};
|
||||
};
|
||||
|
||||
/* This cannot work since it refers to a template node
|
||||
&binman_configuration {
|
||||
loadables = "atf", "fip";
|
||||
};
|
||||
*/
|
||||
|
||||
&fec1 {
|
||||
phy-reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
configurations {
|
||||
default = "@config-DEFAULT-SEQ";
|
||||
|
||||
binman_configuration: @config-SEQ {
|
||||
@config-SEQ {
|
||||
description = "NAME";
|
||||
fdt = "fdt-SEQ";
|
||||
firmware = "uboot";
|
||||
|
|
|
@ -204,7 +204,7 @@
|
|||
configurations {
|
||||
default = "@config-DEFAULT-SEQ";
|
||||
|
||||
binman_configuration: @config-SEQ {
|
||||
@config-SEQ {
|
||||
description = "NAME";
|
||||
fdt = "fdt-SEQ";
|
||||
firmware = "uboot";
|
||||
|
|
|
@ -162,6 +162,8 @@
|
|||
};
|
||||
};
|
||||
|
||||
/* This cannot work since it refers to a template node
|
||||
&binman_configuration {
|
||||
loadables = "atf", "fip";
|
||||
};
|
||||
*/
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
type = "flat_dt";
|
||||
compression = "none";
|
||||
|
||||
uboot_fdt_blob: blob-ext {
|
||||
blob-ext {
|
||||
filename = "u-boot.dtb";
|
||||
};
|
||||
};
|
||||
|
@ -155,7 +155,7 @@
|
|||
configurations {
|
||||
default = "@config-DEFAULT-SEQ";
|
||||
|
||||
binman_configuration: @config-SEQ {
|
||||
@config-SEQ {
|
||||
description = "NAME";
|
||||
fdt = "fdt-SEQ";
|
||||
firmware = "uboot";
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
configurations {
|
||||
default = "@config-DEFAULT-SEQ";
|
||||
|
||||
binman_configuration: @config-SEQ {
|
||||
@config-SEQ {
|
||||
description = "NAME";
|
||||
fdt = "fdt-SEQ";
|
||||
firmware = "uboot";
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
os = "arm-trusted-firmware";
|
||||
load = <CONFIG_K3_ATF_LOAD_ADDR>;
|
||||
entry = <CONFIG_K3_ATF_LOAD_ADDR>;
|
||||
atf: atf-bl31 {
|
||||
atf-bl31 {
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -53,7 +53,7 @@
|
|||
os = "tee";
|
||||
load = <0x9e800000>;
|
||||
entry = <0x9e800000>;
|
||||
tee: tee-os {
|
||||
tee-os {
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -78,7 +78,7 @@
|
|||
compression = "none";
|
||||
load = <CONFIG_SPL_TEXT_BASE>;
|
||||
entry = <CONFIG_SPL_TEXT_BASE>;
|
||||
u_boot_spl_nodtb: blob-ext {
|
||||
blob-ext {
|
||||
filename = "spl/u-boot-spl-nodtb.bin";
|
||||
};
|
||||
};
|
||||
|
@ -88,7 +88,7 @@
|
|||
type = "flat_dt";
|
||||
arch = "arm";
|
||||
compression = "none";
|
||||
spl_am65x_evm_dtb: blob-ext {
|
||||
blob-ext {
|
||||
filename = "spl/dts/k3-am65-iot2050-spl.dtb";
|
||||
};
|
||||
};
|
||||
|
|
|
@ -108,14 +108,6 @@
|
|||
bootph-all;
|
||||
};
|
||||
|
||||
&scmi_shm {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
&scmi_sram {
|
||||
bootph-all;
|
||||
};
|
||||
|
||||
&syscfg {
|
||||
bootph-all;
|
||||
};
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
linaro,optee-channel-id = <0>;
|
||||
shmem = <&scmi_shm>;
|
||||
|
||||
scmi_clk: protocol@14 {
|
||||
reg = <0x14>;
|
||||
|
@ -106,19 +105,6 @@
|
|||
interrupt-parent = <&intc>;
|
||||
ranges;
|
||||
|
||||
scmi_sram: sram@2ffff000 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0x2ffff000 0x1000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0 0x2ffff000 0x1000>;
|
||||
|
||||
scmi_shm: scmi-sram@0 {
|
||||
compatible = "arm,scmi-shmem";
|
||||
reg = <0 0x80>;
|
||||
};
|
||||
};
|
||||
|
||||
timers2: timer@40000000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
linaro,optee-channel-id = <0>;
|
||||
shmem = <&scmi_shm>;
|
||||
|
||||
scmi_clk: protocol@14 {
|
||||
reg = <0x14>;
|
||||
|
@ -60,21 +59,6 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
soc {
|
||||
scmi_sram: sram@2ffff000 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0x2ffff000 0x1000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0 0x2ffff000 0x1000>;
|
||||
|
||||
scmi_shm: scmi-sram@0 {
|
||||
compatible = "arm,scmi-shmem";
|
||||
reg = <0 0x80>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
®11 {
|
||||
|
|
|
@ -24,14 +24,6 @@ config SPL_TEXT_BASE
|
|||
depends on SPL
|
||||
default 0x00912000
|
||||
|
||||
config OPTEE_TZDRAM_SIZE
|
||||
hex "Amount of Trust-Zone RAM for the OPTEE image"
|
||||
default 0x0000000
|
||||
depends on OPTEE_LIB
|
||||
help
|
||||
The size of pre-allocated Trust Zone DRAM to allocate for the OPTEE
|
||||
runtime.
|
||||
|
||||
choice
|
||||
prompt "MX7 board select"
|
||||
optional
|
||||
|
|
|
@ -66,7 +66,7 @@ static inline bool supports_extension(char ext)
|
|||
#endif /* CONFIG_CPU */
|
||||
}
|
||||
|
||||
static int riscv_cpu_probe(void)
|
||||
static int riscv_cpu_probe(void *ctx, struct event *event)
|
||||
{
|
||||
#ifdef CONFIG_CPU
|
||||
int ret;
|
||||
|
@ -79,6 +79,7 @@ static int riscv_cpu_probe(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
EVENT_SPY(EVT_DM_POST_INIT_R, riscv_cpu_probe);
|
||||
|
||||
/*
|
||||
* This is called on secondary harts just after the IPI is init'd. Currently
|
||||
|
@ -95,7 +96,7 @@ int riscv_cpu_setup(void)
|
|||
{
|
||||
int ret;
|
||||
|
||||
ret = riscv_cpu_probe();
|
||||
ret = riscv_cpu_probe(ctx, event);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -149,12 +150,6 @@ EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, riscv_cpu_setup);
|
|||
|
||||
int arch_early_init_r(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = riscv_cpu_probe();
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (IS_ENABLED(CONFIG_SYSRESET_SBI))
|
||||
device_bind_driver(gd->dm_root, "sbi-sysreset",
|
||||
"sbi-sysreset", NULL);
|
||||
|
|
77
board/raspberrypi/rpi/rpi.env
Normal file
77
board/raspberrypi/rpi/rpi.env
Normal file
|
@ -0,0 +1,77 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
|
||||
/* environment for Raspberry Pi boards */
|
||||
|
||||
dhcpuboot=usb start; dhcp u-boot.uimg; bootm
|
||||
|
||||
/* Environment */
|
||||
stdin=serial,usbkbd
|
||||
stdout=serial,vidconsole
|
||||
stderr=serial,vidconsole
|
||||
|
||||
/* DFU over USB/UDC */
|
||||
#ifdef CONFIG_CMD_DFU
|
||||
dfu_alt_info=u-boot.bin fat 0 1;uboot.env fat 0 1;
|
||||
config.txt fat 0 1;
|
||||
#ifdef CONFIG_ARM64
|
||||
dfu_alt_info+=Image fat 0 1
|
||||
#else
|
||||
dfu_alt_info+=zImage fat 0 1
|
||||
#endif
|
||||
#endif /* CONFIG_CMD_DFU */
|
||||
|
||||
/*
|
||||
* Memory layout for where various images get loaded by boot scripts:
|
||||
*
|
||||
* I suspect address 0 is used as the SMP pen on the RPi2, so avoid this.
|
||||
*
|
||||
* Older versions of the boot firmware place the firmware-loaded DTB at 0x100,
|
||||
* newer versions place it in high memory. So prevent U-Boot from doing its own
|
||||
* DTB + initrd relocation so that we won't accidentally relocate the initrd
|
||||
* over the firmware-loaded DTB and generally try to lay out things starting
|
||||
* from the bottom of RAM.
|
||||
*
|
||||
* kernel_addr_r has different constraints on ARM and Aarch64. For 32-bit ARM,
|
||||
* it must be within the first 128M of RAM in order for the kernel's
|
||||
* CONFIG_AUTO_ZRELADDR option to work. The kernel itself will be decompressed
|
||||
* to 0x8000 but the decompressor clobbers 0x4000-0x8000 as well. The
|
||||
* decompressor also likes to relocate itself to right past the end of the
|
||||
* decompressed kernel, so in total the sum of the compressed and
|
||||
* decompressed kernel needs to be reserved.
|
||||
*
|
||||
* For Aarch64, the kernel image is uncompressed and must be loaded at
|
||||
* text_offset bytes (specified in the header of the Image) into a 2MB
|
||||
* boundary. The 'booti' command relocates the image if necessary. Linux uses
|
||||
* a default text_offset of 0x80000. In summary, loading at 0x80000
|
||||
* satisfies all these constraints and reserving memory up to 0x02400000
|
||||
* permits fairly large (roughly 36M) kernels.
|
||||
*
|
||||
* scriptaddr and pxefile_addr_r can be pretty much anywhere that doesn't
|
||||
* conflict with something else. Reserving 1M for each of them at
|
||||
* 0x02400000-0x02500000 and 0x02500000-0x02600000 should be plenty.
|
||||
*
|
||||
* On ARM, both the DTB and any possible initrd must be loaded such that they
|
||||
* fit inside the lowmem mapping in Linux. In practice, this usually means not
|
||||
* more than ~700M away from the start of the kernel image but this number can
|
||||
* be larger OR smaller depending on e.g. the 'vmalloc=xxxM' command line
|
||||
* parameter given to the kernel. So reserving memory from low to high
|
||||
* satisfies this constraint again. Reserving 1M at 0x02600000-0x02700000 for
|
||||
* the DTB leaves rest of the free RAM to the initrd starting at 0x02700000.
|
||||
* Even with the smallest possible CPU-GPU memory split of the CPU getting
|
||||
* only 64M, the remaining 25M starting at 0x02700000 should allow quite
|
||||
* large initrds before they start colliding with U-Boot.
|
||||
*/
|
||||
#ifdef CONFIG_ARM64
|
||||
fdt_high=ffffffffffffffff
|
||||
initrd_high=ffffffffffffffff
|
||||
#else
|
||||
fdt_high=ffffffff
|
||||
initrd_high=ffffffff
|
||||
#endif
|
||||
kernel_addr_r=0x00080000
|
||||
scriptaddr=0x02400000
|
||||
pxefile_addr_r=0x02500000
|
||||
fdt_addr_r=0x02600000
|
||||
ramdisk_addr_r=0x02700000
|
||||
|
||||
boot_targets=mmc usb pxe dhcp
|
|
@ -1442,7 +1442,7 @@ config AUTOBOOT_MENU_SHOW
|
|||
This enables the boot menu, controlled by environment variables
|
||||
defined by the board. The menu starts after running the 'preboot'
|
||||
environmnent variable (if enabled) and before handling the boot delay.
|
||||
See README.bootmenu for more details.
|
||||
See doc/usage/cmd/bootmenu.rst for more details.
|
||||
|
||||
config BOOTMENU_DISABLE_UBOOT_CONSOLE
|
||||
bool "Disallow bootmenu to enter the U-Boot console"
|
||||
|
|
|
@ -184,7 +184,8 @@ static const struct udevice_id extlinux_bootmeth_ids[] = {
|
|||
{ }
|
||||
};
|
||||
|
||||
U_BOOT_DRIVER(bootmeth_extlinux) = {
|
||||
/* Put an number before 'extlinux' to provide a default ordering */
|
||||
U_BOOT_DRIVER(bootmeth_1extlinux) = {
|
||||
.name = "bootmeth_extlinux",
|
||||
.id = UCLASS_BOOTMETH,
|
||||
.of_match = extlinux_bootmeth_ids,
|
||||
|
|
|
@ -243,7 +243,8 @@ static const struct udevice_id script_bootmeth_ids[] = {
|
|||
{ }
|
||||
};
|
||||
|
||||
U_BOOT_DRIVER(bootmeth_script) = {
|
||||
/* Put an number before 'script' to provide a default ordering */
|
||||
U_BOOT_DRIVER(bootmeth_2script) = {
|
||||
.name = "bootmeth_script",
|
||||
.id = UCLASS_BOOTMETH,
|
||||
.of_match = script_bootmeth_ids,
|
||||
|
|
24
cmd/gpt.c
24
cmd/gpt.c
|
@ -689,12 +689,13 @@ static int gpt_enumerate(struct blk_desc *desc)
|
|||
int ret;
|
||||
int i;
|
||||
|
||||
if (part_drv->test(desc))
|
||||
continue;
|
||||
|
||||
for (i = 1; i < part_drv->max_entries; i++) {
|
||||
ret = part_drv->get_info(desc, i, &pinfo);
|
||||
if (ret) {
|
||||
/* no more entries in table */
|
||||
break;
|
||||
}
|
||||
if (ret)
|
||||
continue;
|
||||
|
||||
ptr = &part_list[str_len];
|
||||
tmp_len = strlen((const char *)pinfo.name);
|
||||
|
@ -709,9 +710,10 @@ static int gpt_enumerate(struct blk_desc *desc)
|
|||
/* One byte for space(" ") delimiter */
|
||||
ptr[tmp_len] = ' ';
|
||||
}
|
||||
if (*part_list)
|
||||
part_list[strlen(part_list) - 1] = 0;
|
||||
break;
|
||||
}
|
||||
if (*part_list)
|
||||
part_list[strlen(part_list) - 1] = 0;
|
||||
debug("setenv gpt_partition_list %s\n", part_list);
|
||||
|
||||
return env_set("gpt_partition_list", part_list);
|
||||
|
@ -740,7 +742,7 @@ static int gpt_setenv_part_variables(struct disk_partition *pinfo, int i)
|
|||
if (ret)
|
||||
goto fail;
|
||||
|
||||
ret = env_set_ulong("gpt_partition_entry", i);
|
||||
ret = env_set_hex("gpt_partition_entry", i);
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
|
@ -784,10 +786,8 @@ static int gpt_setenv(struct blk_desc *desc, const char *name)
|
|||
|
||||
for (i = 1; i < part_drv->max_entries; i++) {
|
||||
ret = part_drv->get_info(desc, i, &pinfo);
|
||||
if (ret) {
|
||||
/* no more entries in table */
|
||||
break;
|
||||
}
|
||||
if (ret)
|
||||
continue;
|
||||
|
||||
if (!strcmp(name, (const char *)pinfo.name)) {
|
||||
/* match found, setup environment variables */
|
||||
|
@ -1058,8 +1058,6 @@ U_BOOT_CMD(gpt, CONFIG_SYS_MAXARGS, 1, do_gpt,
|
|||
" gpt_partition_name, gpt_partition_entry\n"
|
||||
" gpt enumerate mmc 0\n"
|
||||
" - store list of partitions to gpt_partition_list environment variable\n"
|
||||
" read <interface> <dev>\n"
|
||||
" - read GPT into a data structure for manipulation\n"
|
||||
" gpt guid <interface> <dev>\n"
|
||||
" - print disk GUID\n"
|
||||
" gpt guid <interface> <dev> <varname>\n"
|
||||
|
|
|
@ -144,10 +144,10 @@ static void printf_str(struct print_inf *inf, char *format, ...)
|
|||
i = vsnprintf(inf->str + inf->offset, remaining, format, args);
|
||||
va_end(args);
|
||||
|
||||
if (i >= remaining)
|
||||
inf->error |= PRINT_TRUNCATED_ERROR;
|
||||
else if (i < 0)
|
||||
if (i < 0)
|
||||
inf->error |= PRINT_CONVERSION_ERROR;
|
||||
else if ((unsigned int)i >= remaining)
|
||||
inf->error |= PRINT_TRUNCATED_ERROR;
|
||||
else
|
||||
inf->offset += i;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ const char *const type_name[] = {
|
|||
|
||||
/* Events related to driver model */
|
||||
"dm_post_init_f",
|
||||
"dm_post_init_r",
|
||||
"dm_pre_probe",
|
||||
"dm_post_probe",
|
||||
"dm_pre_remove",
|
||||
|
|
|
@ -70,7 +70,7 @@ CONFIG_NET_RETRY_COUNT=10
|
|||
CONFIG_BOOTP_SEND_HOSTNAME=y
|
||||
CONFIG_SPL_DM=y
|
||||
CONFIG_SPL_DM_SEQ_ALIAS=y
|
||||
CONFIG_SCSI_AHCI=y
|
||||
CONFIG_DWC_AHCI=y
|
||||
CONFIG_DFU_MMC=y
|
||||
CONFIG_DFU_RAM=y
|
||||
CONFIG_USB_FUNCTION_FASTBOOT=y
|
||||
|
@ -102,7 +102,7 @@ CONFIG_PMIC_PALMAS=y
|
|||
CONFIG_DM_REGULATOR=y
|
||||
CONFIG_DM_REGULATOR_PALMAS=y
|
||||
CONFIG_PALMAS_POWER=y
|
||||
CONFIG_SCSI_AHCI_PLAT=y
|
||||
CONFIG_DM_SCSI=y
|
||||
CONFIG_DM_SERIAL=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_DM_SPI=y
|
||||
|
|
|
@ -81,3 +81,4 @@ CONFIG_MTK_SPIM=y
|
|||
CONFIG_LZO=y
|
||||
CONFIG_HEXDUMP=y
|
||||
# CONFIG_EFI_LOADER is not set
|
||||
CONFIG_LMB_MAX_REGIONS=64
|
||||
|
|
|
@ -69,3 +69,4 @@ CONFIG_MTK_SPIM=y
|
|||
CONFIG_LZO=y
|
||||
CONFIG_HEXDUMP=y
|
||||
# CONFIG_EFI_LOADER is not set
|
||||
CONFIG_LMB_MAX_REGIONS=64
|
||||
|
|
|
@ -12,8 +12,8 @@ CONFIG_DEFAULT_DEVICE_TREE="bcm2835-rpi-zero-w"
|
|||
CONFIG_SYS_PROMPT="U-Boot> "
|
||||
CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
CONFIG_SYS_LOAD_ADDR=0x1000000
|
||||
CONFIG_BOOTSTD_DEFAULTS=y
|
||||
CONFIG_OF_BOARD_SETUP=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_USE_PREBOOT=y
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
# CONFIG_DISPLAY_BOARDINFO is not set
|
||||
|
|
|
@ -13,8 +13,8 @@ CONFIG_DEFAULT_DEVICE_TREE="bcm2836-rpi-2-b"
|
|||
CONFIG_SYS_PROMPT="U-Boot> "
|
||||
CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
CONFIG_SYS_LOAD_ADDR=0x1000000
|
||||
CONFIG_BOOTSTD_DEFAULTS=y
|
||||
CONFIG_OF_BOARD_SETUP=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_USE_PREBOOT=y
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
# CONFIG_DISPLAY_BOARDINFO is not set
|
||||
|
|
|
@ -12,8 +12,8 @@ CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b"
|
|||
CONFIG_SYS_PROMPT="U-Boot> "
|
||||
CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
CONFIG_SYS_LOAD_ADDR=0x1000000
|
||||
CONFIG_BOOTSTD_DEFAULTS=y
|
||||
CONFIG_OF_BOARD_SETUP=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_USE_PREBOOT=y
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
# CONFIG_DISPLAY_BOARDINFO is not set
|
||||
|
|
|
@ -11,8 +11,8 @@ CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b-plus"
|
|||
CONFIG_SYS_PROMPT="U-Boot> "
|
||||
CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
CONFIG_SYS_LOAD_ADDR=0x1000000
|
||||
CONFIG_BOOTSTD_DEFAULTS=y
|
||||
CONFIG_OF_BOARD_SETUP=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_USE_PREBOOT=y
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
# CONFIG_DISPLAY_BOARDINFO is not set
|
||||
|
|
|
@ -11,8 +11,8 @@ CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b"
|
|||
CONFIG_SYS_PROMPT="U-Boot> "
|
||||
CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
CONFIG_SYS_LOAD_ADDR=0x1000000
|
||||
CONFIG_BOOTSTD_DEFAULTS=y
|
||||
CONFIG_OF_BOARD_SETUP=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_USE_PREBOOT=y
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
# CONFIG_DISPLAY_BOARDINFO is not set
|
||||
|
|
|
@ -10,9 +10,9 @@ CONFIG_SYS_PROMPT="U-Boot> "
|
|||
CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
CONFIG_DM_RESET=y
|
||||
CONFIG_SYS_LOAD_ADDR=0x1000000
|
||||
CONFIG_BOOTSTD_DEFAULTS=y
|
||||
CONFIG_PCI=y
|
||||
CONFIG_OF_BOARD_SETUP=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_USE_PREBOOT=y
|
||||
CONFIG_PREBOOT="pci enum; usb start;"
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
|
|
|
@ -10,9 +10,9 @@ CONFIG_SYS_PROMPT="U-Boot> "
|
|||
CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
CONFIG_DM_RESET=y
|
||||
CONFIG_SYS_LOAD_ADDR=0x1000000
|
||||
CONFIG_BOOTSTD_DEFAULTS=y
|
||||
CONFIG_PCI=y
|
||||
CONFIG_OF_BOARD_SETUP=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_USE_PREBOOT=y
|
||||
CONFIG_PREBOOT="pci enum; usb start;"
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
|
|
|
@ -10,9 +10,9 @@ CONFIG_SYS_PROMPT="U-Boot> "
|
|||
CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
CONFIG_DM_RESET=y
|
||||
CONFIG_SYS_LOAD_ADDR=0x1000000
|
||||
CONFIG_BOOTSTD_DEFAULTS=y
|
||||
CONFIG_PCI=y
|
||||
CONFIG_OF_BOARD_SETUP=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_USE_PREBOOT=y
|
||||
CONFIG_PREBOOT="pci enum; usb start;"
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
|
|
|
@ -12,8 +12,8 @@ CONFIG_DEFAULT_DEVICE_TREE="bcm2835-rpi-b"
|
|||
CONFIG_SYS_PROMPT="U-Boot> "
|
||||
CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
CONFIG_SYS_LOAD_ADDR=0x1000000
|
||||
CONFIG_BOOTSTD_DEFAULTS=y
|
||||
CONFIG_OF_BOARD_SETUP=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_USE_PREBOOT=y
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
# CONFIG_DISPLAY_BOARDINFO is not set
|
||||
|
|
9
doc/api/event.rst
Normal file
9
doc/api/event.rst
Normal file
|
@ -0,0 +1,9 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
Events
|
||||
======
|
||||
|
||||
The concept of events is decribed :doc:`here <../develop/event>`.
|
||||
|
||||
.. kernel-doc:: include/event.h
|
||||
:internal:
|
|
@ -10,6 +10,7 @@ U-Boot API documentation
|
|||
dfu
|
||||
dm
|
||||
efi
|
||||
event
|
||||
getopt
|
||||
linker_lists
|
||||
lmb
|
||||
|
|
|
@ -38,9 +38,10 @@ and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel
|
|||
with appended dtb, so let's mimic linux to satisfy stock bootloader.
|
||||
|
||||
Boards
|
||||
------------
|
||||
------
|
||||
|
||||
starqlte
|
||||
^^^^^^^^^^^^
|
||||
^^^^^^^^
|
||||
|
||||
The starqltechn is a production board for Samsung S9 (SM-G9600) phone,
|
||||
based on the Qualcomm SDM845 SoC.
|
||||
|
@ -149,7 +150,11 @@ Steps:
|
|||
mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \
|
||||
--output boot.img --pagesize 4096 --base 0x80000000
|
||||
|
||||
- Flash boot.img using db845c fastboot method.
|
||||
- Flash boot.img using db845c fastboot method:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo fastboot flash boot boot.img
|
||||
|
||||
More information can be found on the `DragonBoard 845c page`_.
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ Boot Flow:
|
|||
Below is the pictorial representation of boot flow:
|
||||
|
||||
.. image:: img/boot_diagram_k3_current.svg
|
||||
:alt: Boot flow diagram
|
||||
|
||||
- Here TIFS acts as master and provides all the critical services. R5/A53
|
||||
requests TIFS to get these services done as shown in the above diagram.
|
||||
|
@ -102,13 +103,13 @@ Set the variables corresponding to this platform:
|
|||
|
||||
3. U-Boot:
|
||||
|
||||
* 4.1 R5:
|
||||
* 3.1 R5:
|
||||
|
||||
.. include:: ../ti/k3.rst
|
||||
:start-after: .. k3_rst_include_start_build_steps_spl_r5
|
||||
:end-before: .. k3_rst_include_end_build_steps_spl_r5
|
||||
|
||||
* 4.2 A53:
|
||||
* 3.2 A53:
|
||||
|
||||
.. include:: ../ti/k3.rst
|
||||
:start-after: .. k3_rst_include_start_build_steps_uboot
|
||||
|
@ -141,10 +142,12 @@ Image formats:
|
|||
- tiboot3.bin
|
||||
|
||||
.. image:: img/multi_cert_tiboot3.bin.svg
|
||||
:alt: tiboot3.bin image format
|
||||
|
||||
- tispl.bin
|
||||
|
||||
.. image:: img/dm_tispl.bin.svg
|
||||
:alt: tispl.bin image format
|
||||
|
||||
A53 SPL DDR Memory Layout
|
||||
-------------------------
|
||||
|
|
|
@ -46,6 +46,7 @@ applications. This should happen before running Linux.
|
|||
instead use Falcon boot flow to reduce boot time.
|
||||
|
||||
.. image:: img/boot_diagram_am65.svg
|
||||
:alt: Boot flow diagram
|
||||
|
||||
- Here DMSC acts as master and provides all the critical services. R5/A53
|
||||
requests DMSC to get these services done as shown in the above diagram.
|
||||
|
@ -102,13 +103,13 @@ Set the variables corresponding to this platform:
|
|||
|
||||
3. U-Boot:
|
||||
|
||||
* 4.1 R5:
|
||||
* 3.1 R5:
|
||||
|
||||
.. include:: k3.rst
|
||||
:start-after: .. k3_rst_include_start_build_steps_spl_r5
|
||||
:end-before: .. k3_rst_include_end_build_steps_spl_r5
|
||||
|
||||
* 4.2 A53:
|
||||
* 3.2 A53:
|
||||
|
||||
.. include:: k3.rst
|
||||
:start-after: .. k3_rst_include_start_build_steps_uboot
|
||||
|
@ -122,13 +123,13 @@ Each SoC variant (GP and HS) requires a different source for these files.
|
|||
|
||||
- GP
|
||||
|
||||
* tiboot3-am65x_sr2-gp-evm.bin, sysfw-am65x_sr2-gp-evm.itb from step 4.1
|
||||
* tispl.bin_unsigned, u-boot.img_unsigned from step 4.2
|
||||
* tiboot3-am65x_sr2-gp-evm.bin, sysfw-am65x_sr2-gp-evm.itb from step 3.1
|
||||
* tispl.bin_unsigned, u-boot.img_unsigned from step 3.2
|
||||
|
||||
- HS
|
||||
|
||||
* tiboot3-am65x_sr2-hs-evm.bin, sysfw-am65x_sr2-hs-evm.itb from step 4.1
|
||||
* tispl.bin, u-boot.img from step 4.2
|
||||
* tiboot3-am65x_sr2-hs-evm.bin, sysfw-am65x_sr2-hs-evm.itb from step 3.1
|
||||
* tispl.bin, u-boot.img from step 3.2
|
||||
|
||||
Image formats:
|
||||
--------------
|
||||
|
@ -136,14 +137,17 @@ Image formats:
|
|||
- tiboot3.bin
|
||||
|
||||
.. image:: img/no_multi_cert_tiboot3.bin.svg
|
||||
:alt: tiboot3.bin image format
|
||||
|
||||
- tispl.bin
|
||||
|
||||
.. image:: img/nodm_tispl.bin.svg
|
||||
:alt: tispl.bin image format
|
||||
|
||||
- sysfw.itb
|
||||
|
||||
.. image:: img/sysfw.itb.svg
|
||||
:alt: sysfw.itb image format
|
||||
|
||||
eMMC:
|
||||
-----
|
||||
|
@ -185,6 +189,7 @@ used:
|
|||
eMMC layout:
|
||||
|
||||
.. image:: img/emmc_am65x_evm_boot0.svg
|
||||
:alt: emmc boot partition layout
|
||||
|
||||
Kernel image and DT are expected to be present in the /boot folder of rootfs.
|
||||
To boot kernel from eMMC, use the following commands:
|
||||
|
@ -220,6 +225,7 @@ addresses.
|
|||
Flash layout for OSPI:
|
||||
|
||||
.. image:: img/ospi_sysfw.svg
|
||||
:alt: OSPI flash partition layout
|
||||
|
||||
Kernel Image and DT are expected to be present in the /boot folder of UBIFS
|
||||
ospi.rootfs just like in SD card case. U-Boot looks for UBI volume named
|
||||
|
|
|
@ -35,6 +35,7 @@ Boot Flow:
|
|||
Below is the pictorial representation of boot flow:
|
||||
|
||||
.. image:: img/boot_diagram_k3_current.svg
|
||||
:alt: Boot flow diagram
|
||||
|
||||
- Here DMSC acts as master and provides all the critical services. R5/A72
|
||||
requests DMSC to get these services done as shown in the above diagram.
|
||||
|
@ -91,13 +92,13 @@ Set the variables corresponding to this platform:
|
|||
|
||||
3. U-Boot:
|
||||
|
||||
* 4.1 R5:
|
||||
* 3.1 R5:
|
||||
|
||||
.. include:: k3.rst
|
||||
:start-after: .. k3_rst_include_start_build_steps_spl_r5
|
||||
:end-before: .. k3_rst_include_end_build_steps_spl_r5
|
||||
|
||||
* 4.2 A72:
|
||||
* 3.2 A72:
|
||||
|
||||
.. include:: k3.rst
|
||||
:start-after: .. k3_rst_include_start_build_steps_uboot
|
||||
|
@ -111,18 +112,18 @@ variant (GP, HS-FS, HS-SE) requires a different source for these files.
|
|||
|
||||
- GP
|
||||
|
||||
* tiboot3-j7200-gp-evm.bin from step 4.1
|
||||
* tispl.bin_unsigned, u-boot.img_unsigned from step 4.2
|
||||
* tiboot3-j7200-gp-evm.bin from step 3.1
|
||||
* tispl.bin_unsigned, u-boot.img_unsigned from step 3.2
|
||||
|
||||
- HS-FS
|
||||
|
||||
* tiboot3-j7200_sr2-hs-fs-evm.bin from step 4.1
|
||||
* tispl.bin, u-boot.img from step 4.2
|
||||
* tiboot3-j7200_sr2-hs-fs-evm.bin from step 3.1
|
||||
* tispl.bin, u-boot.img from step 3.2
|
||||
|
||||
- HS-SE
|
||||
|
||||
* tiboot3-j7200_sr2-hs-evm.bin from step 4.1
|
||||
* tispl.bin, u-boot.img from step 4.2
|
||||
* tiboot3-j7200_sr2-hs-evm.bin from step 3.1
|
||||
* tispl.bin, u-boot.img from step 3.2
|
||||
|
||||
Image formats:
|
||||
--------------
|
||||
|
@ -130,12 +131,12 @@ Image formats:
|
|||
- tiboot3.bin
|
||||
|
||||
.. image:: img/j7200_tiboot3.bin.svg
|
||||
:alt: tiboot3.bin image format
|
||||
|
||||
- tispl.bin
|
||||
|
||||
.. image:: img/dm_tispl.bin.svg
|
||||
|
||||
|
||||
:alt: tispl.bin image format
|
||||
|
||||
Switch Setting for Boot Mode
|
||||
----------------------------
|
||||
|
@ -191,6 +192,7 @@ Size of u-boot.img is taken 4MB for refernece,
|
|||
But this is subject to change depending upon atf, optee size
|
||||
|
||||
.. image:: img/emmc_j7200_evm_boot01.svg
|
||||
:alt: Traditional eMMC boot partition layout
|
||||
|
||||
In case of UDA FS mode booting, following is layout.
|
||||
|
||||
|
@ -198,6 +200,7 @@ All boot images tiboot3.bin, tispl and u-boot should be written to
|
|||
fat formatted UDA FS as file.
|
||||
|
||||
.. image:: img/emmc_j7200_evm_udafs.svg
|
||||
:alt: eMMC UDA boot partition layout
|
||||
|
||||
In case of booting from eMMC, write above images into raw or UDA FS.
|
||||
and set mmc partconf accordingly.
|
||||
|
|
|
@ -40,6 +40,7 @@ Boot flow is similar to that of AM65x SoC and extending it with remoteproc
|
|||
support. Below is the pictorial representation of boot flow:
|
||||
|
||||
.. image:: img/boot_diagram_j721e.svg
|
||||
:alt: Boot flow diagram
|
||||
|
||||
- Here DMSC acts as master and provides all the critical services. R5/A72
|
||||
requests DMSC to get these services done as shown in the above diagram.
|
||||
|
@ -96,13 +97,13 @@ Set the variables corresponding to this platform:
|
|||
|
||||
3. U-Boot:
|
||||
|
||||
* 4.1 R5:
|
||||
* 3.1 R5:
|
||||
|
||||
.. include:: k3.rst
|
||||
:start-after: .. k3_rst_include_start_build_steps_spl_r5
|
||||
:end-before: .. k3_rst_include_end_build_steps_spl_r5
|
||||
|
||||
* 4.2 A72:
|
||||
* 3.2 A72:
|
||||
|
||||
.. include:: k3.rst
|
||||
:start-after: .. k3_rst_include_start_build_steps_uboot
|
||||
|
@ -117,18 +118,18 @@ files.
|
|||
|
||||
- GP
|
||||
|
||||
* tiboot3-j721e-gp-evm.bin, sysfw-j721e-gp-evm.itb from step 4.1
|
||||
* tispl.bin_unsigned, u-boot.img_unsigned from step 4.2
|
||||
* tiboot3-j721e-gp-evm.bin, sysfw-j721e-gp-evm.itb from step 3.1
|
||||
* tispl.bin_unsigned, u-boot.img_unsigned from step 3.2
|
||||
|
||||
- HS-FS
|
||||
|
||||
* tiboot3-j721e_sr2-hs-fs-evm.bin, sysfw-j721e_sr2-hs-fs-evm.itb from step 4.1
|
||||
* tispl.bin, u-boot.img from step 4.2
|
||||
* tiboot3-j721e_sr2-hs-fs-evm.bin, sysfw-j721e_sr2-hs-fs-evm.itb from step 3.1
|
||||
* tispl.bin, u-boot.img from step 3.2
|
||||
|
||||
- HS-SE
|
||||
|
||||
* tiboot3-j721e_sr2-hs-evm.bin, sysfw-j721e_sr2-hs-evm.itb from step 4.1
|
||||
* tispl.bin, u-boot.img from step 4.2
|
||||
* tiboot3-j721e_sr2-hs-evm.bin, sysfw-j721e_sr2-hs-evm.itb from step 3.1
|
||||
* tispl.bin, u-boot.img from step 3.2
|
||||
|
||||
Image formats:
|
||||
--------------
|
||||
|
@ -136,14 +137,17 @@ Image formats:
|
|||
- tiboot3.bin
|
||||
|
||||
.. image:: img/no_multi_cert_tiboot3.bin.svg
|
||||
:alt: tiboot3.bin image format
|
||||
|
||||
- tispl.bin
|
||||
|
||||
.. image:: img/dm_tispl.bin.svg
|
||||
:alt: tispl.bin image format
|
||||
|
||||
- sysfw.itb
|
||||
|
||||
.. image:: img/sysfw.itb.svg
|
||||
:alt: sysfw.itb image format
|
||||
|
||||
R5 Memory Map:
|
||||
--------------
|
||||
|
@ -213,6 +217,7 @@ addresses.
|
|||
Flash layout for OSPI:
|
||||
|
||||
.. image:: img/ospi_sysfw.svg
|
||||
:alt: OSPI flash partition layout
|
||||
|
||||
Firmwares:
|
||||
----------
|
||||
|
|
|
@ -48,6 +48,7 @@ including a 32bit U-Boot SPL, (called the wakup SPL) that ROM will jump
|
|||
to after it has finished loading everything into internal SRAM.
|
||||
|
||||
.. image:: img/boot_flow_01.svg
|
||||
:alt: Boot flow up to wakeup domain SPL
|
||||
|
||||
The wakeup SPL, running on a wakeup domain core, will initialize DDR and
|
||||
any peripherals needed load the larger binaries inside the `tispl.bin`
|
||||
|
@ -57,6 +58,7 @@ starting with Trusted Firmware-A (TF-A), before moving on to start
|
|||
OP-TEE and the main domain's U-Boot SPL.
|
||||
|
||||
.. image:: img/boot_flow_02.svg
|
||||
:alt: Boot flow up to main domain SPL
|
||||
|
||||
The main domain's SPL, running on a 64bit application core, has
|
||||
virtually unlimited space (billions of bytes now that DDR is working) to
|
||||
|
@ -65,6 +67,7 @@ which loads more firmware into the micro-controller & wakeup domains and
|
|||
finally prepare the main domain to run Linux.
|
||||
|
||||
.. image:: img/boot_flow_03.svg
|
||||
:alt: Complete boot flow up to Linux
|
||||
|
||||
This is the typical boot flow for all K3 based SoCs, however this flow
|
||||
offers quite a lot in the terms of flexibility, especially on High
|
||||
|
@ -121,11 +124,30 @@ online
|
|||
| **source:** https://github.com/OP-TEE/optee_os.git
|
||||
| **branch:** master
|
||||
|
||||
* **TI Firmware (TIFS, DM, DSMC)**
|
||||
* **TI Firmware (TIFS, DM, SYSFW)**
|
||||
|
||||
| **source:** https://git.ti.com/git/processor-firmware/ti-linux-firmware.git
|
||||
| **branch:** ti-linux-firmware
|
||||
|
||||
.. note::
|
||||
|
||||
The TI Firmware required for functionality of the system can be
|
||||
one of the following combination (see platform specific boot diagram for
|
||||
further information as to which component runs on which processor):
|
||||
|
||||
* **TIFS** - TI Foundational Security Firmware - Consists of purely firmware
|
||||
meant to run on the security enclave.
|
||||
* **DM** - Device Management firmware also called TI System Control Interface
|
||||
server (TISCI Server) - This component purely plays the role of managing
|
||||
device resources such as power, clock, interrupts, dma etc. This firmware
|
||||
runs on a dedicated or multi-use microcontroller outside the security
|
||||
enclave.
|
||||
|
||||
OR
|
||||
|
||||
* **SYSFW** - System firmware - consists of both TIFS and DM both running on
|
||||
the security enclave.
|
||||
|
||||
.. k3_rst_include_end_boot_sources
|
||||
|
||||
Build Procedure
|
||||
|
@ -173,13 +195,13 @@ All of that to say you will need both a 32bit and 64bit cross compiler
|
|||
.. k3_rst_include_end_common_env_vars_desc
|
||||
|
||||
.. k3_rst_include_start_common_env_vars_defn
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
$ export CC32=arm-linux-gnueabihf-
|
||||
$ export CC64=aarch64-linux-gnu-
|
||||
$ export LNX_FW_PATH=path/to/ti-linux-firmware
|
||||
$ export TFA_PATH=path/to/trusted-firmware-a
|
||||
$ export OPTEE_PATH=path/to/optee_os
|
||||
export CC32=arm-linux-gnueabihf-
|
||||
export CC64=aarch64-linux-gnu-
|
||||
export LNX_FW_PATH=path/to/ti-linux-firmware
|
||||
export TFA_PATH=path/to/trusted-firmware-a
|
||||
export OPTEE_PATH=path/to/optee_os
|
||||
.. k3_rst_include_end_common_env_vars_defn
|
||||
|
||||
We will also need some common environment variables set up for the various
|
||||
|
@ -223,11 +245,11 @@ Building tiboot3.bin
|
|||
uses the split binary flow)
|
||||
|
||||
.. k3_rst_include_start_build_steps_spl_r5
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
$ # inside u-boot source
|
||||
$ make $UBOOT_CFG_CORTEXR
|
||||
$ make CROSS_COMPILE=$CC32 BINMAN_INDIRS=$LNX_FW_PATH
|
||||
# inside u-boot source
|
||||
make $UBOOT_CFG_CORTEXR
|
||||
make CROSS_COMPILE=$CC32 BINMAN_INDIRS=$LNX_FW_PATH
|
||||
.. k3_rst_include_end_build_steps_spl_r5
|
||||
|
||||
At this point you should have all the needed binaries to boot the wakeup
|
||||
|
@ -259,11 +281,11 @@ firmware if your device using a split firmware.
|
|||
application cores on the main domain.
|
||||
|
||||
.. k3_rst_include_start_build_steps_tfa
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
$ # inside trusted-firmware-a source
|
||||
$ make CROSS_COMPILE=$CC64 ARCH=aarch64 PLAT=k3 SPD=opteed $TFA_EXTRA_ARGS \
|
||||
TARGET_BOARD=$TFA_BOARD
|
||||
# inside trusted-firmware-a source
|
||||
make CROSS_COMPILE=$CC64 ARCH=aarch64 PLAT=k3 SPD=opteed $TFA_EXTRA_ARGS \
|
||||
TARGET_BOARD=$TFA_BOARD
|
||||
.. k3_rst_include_end_build_steps_tfa
|
||||
|
||||
Typically all `j7*` devices will use `TARGET_BOARD=generic` or `TARGET_BOARD
|
||||
|
@ -275,11 +297,11 @@ use the `lite` option.
|
|||
using the TrustZone technology built into the core.
|
||||
|
||||
.. k3_rst_include_start_build_steps_optee
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
$ # inside optee_os source
|
||||
$ make CROSS_COMPILE=$CC32 CROSS_COMPILE64=$CC64 CFG_ARM64_core=y $OPTEE_EXTRA_ARGS \
|
||||
PLATFORM=$OPTEE_PLATFORM
|
||||
# inside optee_os source
|
||||
make CROSS_COMPILE=$CC32 CROSS_COMPILE64=$CC64 CFG_ARM64_core=y $OPTEE_EXTRA_ARGS \
|
||||
PLATFORM=$OPTEE_PLATFORM
|
||||
.. k3_rst_include_end_build_steps_optee
|
||||
|
||||
4. Finally, after TF-A has initialized the main domain and OP-TEE has
|
||||
|
@ -287,11 +309,11 @@ use the `lite` option.
|
|||
64bit core in the main domain.
|
||||
|
||||
.. k3_rst_include_start_build_steps_uboot
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
$ # inside u-boot source
|
||||
$ make $UBOOT_CFG_CORTEXA
|
||||
$ make CROSS_COMPILE=$CC64 BINMAN_INDIRS=$LNX_FW_PATH \
|
||||
# inside u-boot source
|
||||
make $UBOOT_CFG_CORTEXA
|
||||
make CROSS_COMPILE=$CC64 BINMAN_INDIRS=$LNX_FW_PATH \
|
||||
BL31=$TFA_PATH/build/k3/$TFA_BOARD/release/bl31.bin \
|
||||
TEE=$OPTEE_PATH/out/arm-plat-k3/core/tee-raw.bin
|
||||
.. k3_rst_include_end_build_steps_uboot
|
||||
|
@ -386,14 +408,14 @@ and the same can be extended to other platforms
|
|||
be passing to mkimage for signing the fitImage and embedding the key in
|
||||
the u-boot dtb.
|
||||
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
mkimage -r -f fitImage.its -k $UBOOT_PATH/board/ti/keys -K
|
||||
$UBOOT_PATH/build/a72/dts/dt.dtb
|
||||
|
||||
For signing a secondary platform, pass the -K parameter to that DTB
|
||||
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
mkimage -f fitImage.its -k $UBOOT_PATH/board/ti/keys -K
|
||||
$UBOOT_PATH/build/a72/arch/arm/dts/k3-j721e-sk.dtb
|
||||
|
@ -452,10 +474,11 @@ then the saveenv command and can be used across various bootmodes too.
|
|||
|
||||
**Writing to MMC/EMMC**
|
||||
|
||||
.. code-block::
|
||||
.. prompt:: bash
|
||||
:prompts: =>
|
||||
|
||||
=> env export -t $loadaddr <list of variables>
|
||||
=> fatwrite mmc ${mmcdev} ${loadaddr} ${bootenvfile} ${filesize}
|
||||
env export -t $loadaddr <list of variables>
|
||||
fatwrite mmc ${mmcdev} ${loadaddr} ${bootenvfile} ${filesize}
|
||||
|
||||
**Reading from MMC/EMMC**
|
||||
|
||||
|
@ -465,10 +488,11 @@ mmcdev) and set the environments.
|
|||
If manually needs to be done then the environment can be read from the
|
||||
filesystem and then imported
|
||||
|
||||
.. code-block::
|
||||
.. prompt:: bash
|
||||
:prompts: =>
|
||||
|
||||
=> fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
|
||||
=> env import -t ${loadaddr} ${filesize}
|
||||
fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
|
||||
env import -t ${loadaddr} ${filesize}
|
||||
|
||||
.. _k3_rst_refer_openocd:
|
||||
|
||||
|
@ -486,6 +510,7 @@ generation device.
|
|||
The overall structure of this setup is in the following figure.
|
||||
|
||||
.. image:: img/openocd-overview.svg
|
||||
:alt: Overview of OpenOCD setup.
|
||||
|
||||
.. note::
|
||||
|
||||
|
@ -524,7 +549,7 @@ Refer to the release notes corresponding to the `OpenOCD version
|
|||
box support by OpenOCD. The board-specific documentation will
|
||||
cover the details and any adapter/dongle recommendations.
|
||||
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
openocd -v
|
||||
|
||||
|
@ -542,21 +567,21 @@ systems, but equivalent instructions should exist for systems with
|
|||
other package managers. Please refer to the `OpenOCD Documentation
|
||||
<https://openocd.org/>`_ for more recent installation steps.
|
||||
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
$ # Check the packages to be installed: needs deb-src in sources.list
|
||||
$ sudo apt build-dep openocd
|
||||
$ # The following list is NOT complete - please check the latest
|
||||
$ sudo apt-get install libtool pkg-config texinfo libusb-dev \
|
||||
# Check the packages to be installed: needs deb-src in sources.list
|
||||
sudo apt build-dep openocd
|
||||
# The following list is NOT complete - please check the latest
|
||||
sudo apt-get install libtool pkg-config texinfo libusb-dev \
|
||||
libusb-1.0.0-dev libftdi-dev libhidapi-dev autoconf automake
|
||||
$ git clone https://github.com/openocd-org/openocd.git openocd
|
||||
$ cd openocd
|
||||
$ git submodule init
|
||||
$ git submodule update
|
||||
$ ./bootstrap
|
||||
$ ./configure --prefix=/usr/local/
|
||||
$ make -j`nproc`
|
||||
$ sudo make install
|
||||
git clone https://github.com/openocd-org/openocd.git openocd
|
||||
cd openocd
|
||||
git submodule init
|
||||
git submodule update
|
||||
./bootstrap
|
||||
./configure --prefix=/usr/local/
|
||||
make -j`nproc`
|
||||
sudo make install
|
||||
|
||||
.. note::
|
||||
|
||||
|
@ -572,28 +597,28 @@ The step is not necessary if the distribution supports the OpenOCD, but
|
|||
if building from a source, ensure that the udev rules are installed
|
||||
correctly to ensure a sane system.
|
||||
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
# Go to the OpenOCD source directory
|
||||
$ cd openocd
|
||||
# Copy the udev rules to the correct system location
|
||||
$ sudo cp ./contrib/60-openocd.rules \
|
||||
./src/JTAG/drivers/libjaylink/contrib/99-libjaylink.rules \
|
||||
cd openocd
|
||||
Copy the udev rules to the correct system location
|
||||
sudo cp ./contrib/60-openocd.rules \
|
||||
./src/jtag/drivers/libjaylink/contrib/99-libjaylink.rules \
|
||||
/etc/udev/rules.d/
|
||||
# Get Udev to load the new rules up
|
||||
$ sudo udevadm control --reload-rules
|
||||
sudo udevadm control --reload-rules
|
||||
# Use the new rules on existing connected devices
|
||||
$ sudo udevadm trigger
|
||||
sudo udevadm trigger
|
||||
|
||||
Step 2: Setup GDB
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Most systems come with gdb-multiarch package.
|
||||
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
# Install gdb-multiarch package
|
||||
$ sudo apt-get install gdb-multiarch
|
||||
sudo apt-get install gdb-multiarch
|
||||
|
||||
Though using GDB natively is normal, developers with interest in using IDE
|
||||
may find a few of these interesting:
|
||||
|
@ -769,7 +794,7 @@ Code modification
|
|||
In this example, we will debug ``board_init_f`` inside
|
||||
``arch/arm/mach-k3/{soc}_init.c``. Since some sections of U-Boot
|
||||
will be executed multiple times during the bootup process of K3
|
||||
devices, we will need to include either ``CONFIG_CPU_ARM64`` or
|
||||
devices, we will need to include either ``CONFIG_ARM64`` or
|
||||
``CONFIG_CPU_V7R`` to catch the CPU at the desired place during the
|
||||
bootup process (Main or Wakeup domains). For example, modify the
|
||||
file as follows (depending on need):
|
||||
|
@ -787,7 +812,7 @@ Code modification
|
|||
}
|
||||
...
|
||||
/* Code to run on the ARMV8 (Main Domain) */
|
||||
if (IS_ENABLED(CONFIG_CPU_ARM64)) {
|
||||
if (IS_ENABLED(CONFIG_ARM64)) {
|
||||
volatile int x = 1;
|
||||
while(x) {};
|
||||
}
|
||||
|
@ -806,7 +831,7 @@ Startup OpenOCD to debug the platform as follows:
|
|||
|
||||
.. k3_rst_include_start_openocd_cfg_XDS110
|
||||
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
openocd -f board/{board_of_choice}.cfg
|
||||
|
||||
|
@ -820,7 +845,7 @@ Startup OpenOCD to debug the platform as follows:
|
|||
<https://github.com/openocd-org/openocd/blob/master/tcl/target/ti_k3.cfg#L59>`_
|
||||
to decide if the SoC is supported or not.
|
||||
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
openocd -f openocd_connect.cfg
|
||||
|
||||
|
@ -895,7 +920,7 @@ To debug using this server, use GDB directly or your preferred
|
|||
GDB-based IDE. To start up GDB in the terminal, run the following
|
||||
command.
|
||||
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
gdb-multiarch
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0+
|
||||
.. SPDX-License-Identifier: GPL-2.0-or-later
|
||||
.. sectionauthor:: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
||||
|
||||
Apalis iMX8QM V1.0B Module
|
||||
==========================
|
||||
Apalis iMX8 Module
|
||||
==================
|
||||
|
||||
- SoM: https://www.toradex.com/computer-on-modules/apalis-arm-family/nxp-imx-8
|
||||
- Carrier board: https://www.toradex.com/products/carrier-board/apalis-evaluation-board
|
||||
|
||||
Quick Start
|
||||
-----------
|
||||
|
@ -49,6 +53,7 @@ Copy the following firmware to the U-Boot folder:
|
|||
|
||||
Build U-Boot
|
||||
------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make apalis-imx8_defconfig
|
||||
|
@ -61,8 +66,8 @@ Get the latest version of the universal update utility (uuu) aka ``mfgtools 3.0`
|
|||
|
||||
https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FNXPmicro%2Fmfgtools%2Freleases
|
||||
|
||||
Put the module into USB recovery aka serial downloader mode, connect USB device
|
||||
to your host and execute uuu:
|
||||
Put the module into USB recovery aka serial downloader mode, connect the USB
|
||||
device to your host and execute ``uuu``:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
@ -80,3 +85,10 @@ partition and boot:
|
|||
setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200
|
||||
mmc dev 0 1
|
||||
mmc write ${loadaddr} 0x0 ${blkcnt}
|
||||
|
||||
As a convenience, instead of the last three commands, one may also use the
|
||||
update U-Boot wrapper:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
> run update_uboot
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0+
|
||||
.. SPDX-License-Identifier: GPL-2.0-or-later
|
||||
.. sectionauthor:: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
||||
|
||||
Colibri iMX8QXP V1.0D Module
|
||||
============================
|
||||
Colibri iMX8X Module
|
||||
====================
|
||||
|
||||
- SoM: https://www.toradex.com/computer-on-modules/colibri-arm-family/nxp-imx-8x
|
||||
- Carrier board: https://www.toradex.com/products/carrier-board/colibri-evaluation-board
|
||||
|
||||
Quick Start
|
||||
-----------
|
||||
|
@ -23,18 +27,19 @@ Get and Build the ARM Trusted Firmware
|
|||
|
||||
Get scfw_tcm.bin and ahab-container.img
|
||||
---------------------------------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ wget https://github.com/toradex/i.MX-System-Controller-Firmware/raw/master/src/scfw_export_mx8qx_b0/build_mx8qx_b0/mx8qx-colibri-scfw-tcm.bin
|
||||
$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-seco-3.7.4.bin
|
||||
$ sh imx-seco-3.7.4.bin --auto-accept
|
||||
$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-seco-3.8.1.bin
|
||||
$ sh imx-seco-3.8.1.bin --auto-accept
|
||||
|
||||
Copy the following firmware to the U-Boot folder:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ cp imx-atf/build/imx8qx/release/bl31.bin .
|
||||
$ cp imx-seco-3.7.4/firmware/seco/mx8qxc0-ahab-container.img mx8qx-ahab-container.img
|
||||
$ cp imx-seco-3.8.1/firmware/seco/mx8qxc0-ahab-container.img mx8qx-ahab-container.img
|
||||
|
||||
Build U-Boot
|
||||
------------
|
||||
|
@ -51,8 +56,8 @@ Get the latest version of the universal update utility (uuu) aka ``mfgtools 3.0`
|
|||
|
||||
https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FNXPmicro%2Fmfgtools%2Freleases
|
||||
|
||||
Put the module into USB recovery aka serial downloader mode, connect USB device
|
||||
to your host and execute ``uuu``:
|
||||
Put the module into USB recovery aka serial downloader mode, connect the USB
|
||||
device to your host and execute ``uuu``:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
@ -61,7 +66,8 @@ to your host and execute ``uuu``:
|
|||
Flash the U-Boot Binary into the eMMC
|
||||
-------------------------------------
|
||||
|
||||
Burn the ``u-boot-dtb.imx`` binary to the primary eMMC hardware boot area partition:
|
||||
Burn the ``u-boot-dtb.imx`` binary to the primary eMMC hardware boot area
|
||||
partition and boot:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
@ -69,3 +75,10 @@ Burn the ``u-boot-dtb.imx`` binary to the primary eMMC hardware boot area partit
|
|||
setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200
|
||||
mmc dev 0 1
|
||||
mmc write ${loadaddr} 0x0 ${blkcnt}
|
||||
|
||||
As a convenience, instead of the last three commands, one may also use the
|
||||
update U-Boot wrapper:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
> run update_uboot
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0+
|
||||
.. SPDX-License-Identifier: GPL-2.0-or-later
|
||||
.. sectionauthor:: Igor Opaniuk <igor.opaniuk@toradex.com>
|
||||
|
||||
Colibri iMX7
|
||||
============
|
||||
Colibri iMX7 Modules
|
||||
====================
|
||||
|
||||
- SoM: https://www.toradex.com/computer-on-modules/colibri-arm-family/nxp-freescale-imx7
|
||||
- Carrier board: https://www.toradex.com/products/carrier-board/colibri-evaluation-board
|
||||
|
||||
Quick Start
|
||||
-----------
|
||||
|
@ -21,11 +25,11 @@ Build U-Boot
|
|||
$ make colibri_imx7_emmc_defconfig # For NAND: colibri_imx7_defconfig
|
||||
$ make
|
||||
|
||||
After build succeeds, you will obtain final ``u-boot-dtb.imx`` IMX specific
|
||||
image, ready for flashing (but check next section for additional
|
||||
After the build succeeds, you will obtain the final ``u-boot-dtb.imx`` IMX
|
||||
specific image, ready for flashing (but check next section for additional
|
||||
adjustments).
|
||||
|
||||
Final IMX program image includes (section ``6.6.7`` from `IMX7DRM
|
||||
The final IMX program image includes (section ``6.6.7`` from `IMX7DRM
|
||||
<https://www.nxp.com/webapp/Download?colCode=IMX7DRM>`_):
|
||||
|
||||
* **Image vector table** (IVT) for BootROM
|
||||
|
@ -34,21 +38,20 @@ Final IMX program image includes (section ``6.6.7`` from `IMX7DRM
|
|||
* **Device configuration data**
|
||||
* **User image**: U-Boot image (``u-boot-dtb.bin``)
|
||||
|
||||
|
||||
IMX image adjustments prior to flashing
|
||||
---------------------------------------
|
||||
|
||||
1. U-Boot for both Colibri iMX7 NAND and eMMC versions
|
||||
is built with HABv4 support (`AN4581.pdf
|
||||
<https://www.nxp.com/docs/en/application-note/AN4581.pdf>`_)
|
||||
enabled by default, which requires to generate a proper
|
||||
enabled by default, which requires generating a proper
|
||||
Command Sequence File (CSF) by srktool from NXP (not included in the
|
||||
U-Boot tree, check additional details in introduction_habv4.txt)
|
||||
and concatenate it to the final ``u-boot-dtb.imx``.
|
||||
|
||||
2. In case if you don't want to generate a proper ``CSF`` (for any reason),
|
||||
you still need to pad the IMX image so i has the same size as specified in
|
||||
in **Boot Data** section of IMX image.
|
||||
2. In case you don't want to generate a proper ``CSF`` (for any reason),
|
||||
you still need to pad the IMX image so it has the same size as specified in
|
||||
the **Boot Data** section of the IMX image.
|
||||
To obtain this value, run:
|
||||
|
||||
.. code-block:: bash
|
||||
|
@ -78,11 +81,11 @@ and then pad the image:
|
|||
$ objcopy -I binary -O binary --pad-to 0xa7c60 --gap-fill=0x00 \
|
||||
u-boot-dtb.imx u-boot-dtb.imx.zero-padded
|
||||
|
||||
3. Also, according to requirement from ``6.6.7.1``, the final image
|
||||
should have ``0x400`` offset for initial IVT table.
|
||||
3. Also, according to the requirement from ``6.6.7.1``, the final image
|
||||
should have ``0x400`` offset for the initial IVT table.
|
||||
|
||||
For eMMC setup we handle this by flashing it to ``0x400``, howewer
|
||||
for NAND setup we adjust the image prior to flashing, adding padding in the
|
||||
For eMMC setup we handle this by flashing it to ``0x400``, however
|
||||
for NAND setup we adjust the image prior to flashing, adding padding at the
|
||||
beginning of the image.
|
||||
|
||||
.. code-block:: bash
|
||||
|
@ -97,7 +100,6 @@ boot area partition:
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
|
||||
=> load mmc 1:1 $loadaddr u-boot-dtb.imx.zero-padded
|
||||
=> setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200
|
||||
=> mmc dev 0 1
|
||||
|
@ -117,8 +119,8 @@ Flash U-Boot IMX image to NAND
|
|||
Using update_uboot script
|
||||
-------------------------
|
||||
|
||||
You can also usb U-Boot env update_uboot script,
|
||||
which wraps all eMMC/NAND specific command invocation:
|
||||
You can also use U-Boot env update_uboot script,
|
||||
which wraps all eMMC/NAND specific command invocations:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
|
|
@ -24,12 +24,14 @@ For an overview of the TI AM62 SoC boot flow please head over to:
|
|||
|
||||
Sources:
|
||||
--------
|
||||
|
||||
.. include:: ../ti/k3.rst
|
||||
:start-after: .. k3_rst_include_start_boot_sources
|
||||
:end-before: .. k3_rst_include_end_boot_sources
|
||||
|
||||
Build procedure:
|
||||
----------------
|
||||
|
||||
0. Setup the environment variables:
|
||||
|
||||
.. include:: ../ti/k3.rst
|
||||
|
@ -50,7 +52,7 @@ Set the variables corresponding to this platform:
|
|||
$ export UBOOT_CFG_CORTEXR=verdin-am62_r5_defconfig
|
||||
$ export UBOOT_CFG_CORTEXA=verdin-am62_a53_defconfig
|
||||
$ export TFA_BOARD=lite
|
||||
$ # we dont use any extra TFA parameters
|
||||
$ # we don't use any extra TFA parameters
|
||||
$ unset TFA_EXTRA_ARGS
|
||||
$ export OPTEE_PLATFORM=k3-am62x
|
||||
$ export OPTEE_EXTRA_ARGS="CFG_WITH_SOFTWARE_PRNG=y"
|
||||
|
@ -72,12 +74,24 @@ Flash to eMMC
|
|||
=> fatload mmc 1 ${loadaddr} u-boot.img
|
||||
=> mmc write ${loadaddr} 0x1400 0x2000
|
||||
|
||||
As a convenience, instead of having to remember all those addresses and sizes,
|
||||
one may also use the update U-Boot wrappers:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
> tftpboot ${loadaddr} tiboot3-am62x-gp-verdin.bin
|
||||
> run update_tiboot3
|
||||
|
||||
> tftpboot ${loadaddr} tispl.bin
|
||||
> run update_tispl
|
||||
|
||||
> tftpboot ${loadaddr} u-boot.img
|
||||
> run update_uboot
|
||||
|
||||
Boot
|
||||
----
|
||||
|
||||
Output:
|
||||
|
||||
.. code-block:: none
|
||||
Output::
|
||||
|
||||
U-Boot SPL 2023.10-rc1-00210-gb678170a34c (Aug 03 2023 - 00:09:14 +0200)
|
||||
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.1--v09.00.01 (Kool Koala)')
|
||||
|
|
|
@ -46,6 +46,7 @@ Get the DDR Firmware
|
|||
|
||||
Build U-Boot
|
||||
------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ export CROSS_COMPILE=aarch64-linux-gnu-
|
||||
|
@ -61,7 +62,7 @@ Flash to eMMC
|
|||
> setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200
|
||||
> mmc dev 0 1 && mmc write ${loadaddr} 0x2 ${blkcnt}
|
||||
|
||||
As a convenience, instead of the last two commands one may also use the update
|
||||
As a convenience, instead of the last two commands, one may also use the update
|
||||
U-Boot wrapper:
|
||||
|
||||
.. code-block:: bash
|
||||
|
@ -71,16 +72,14 @@ U-Boot wrapper:
|
|||
Boot
|
||||
----
|
||||
|
||||
ATF, U-Boot proper and u-boot.dtb images are packed into FIT image,
|
||||
ATF, U-Boot proper and u-boot.dtb images are packed into a FIT image,
|
||||
which is loaded and parsed by SPL.
|
||||
|
||||
Boot sequence is:
|
||||
|
||||
* SPL ---> ATF (TF-A) ---> U-Boot proper
|
||||
|
||||
Output:
|
||||
|
||||
.. code-block:: none
|
||||
Output::
|
||||
|
||||
U-Boot SPL 2021.10-rc2-00028-gee010ba1129 (Aug 23 2021 - 16:56:02 +0200)
|
||||
Normal Boot
|
||||
|
|
|
@ -46,6 +46,7 @@ Get the DDR Firmware
|
|||
|
||||
Build U-Boot
|
||||
------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ export CROSS_COMPILE=aarch64-linux-gnu-
|
||||
|
@ -61,7 +62,7 @@ Flash to eMMC
|
|||
> setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200
|
||||
> mmc dev 2 1 && mmc write ${loadaddr} 0x0 ${blkcnt}
|
||||
|
||||
As a convenience, instead of the last two commands one may also use the update
|
||||
As a convenience, instead of the last two commands, one may also use the update
|
||||
U-Boot wrapper:
|
||||
|
||||
.. code-block:: bash
|
||||
|
@ -71,16 +72,14 @@ U-Boot wrapper:
|
|||
Boot
|
||||
----
|
||||
|
||||
ATF, U-Boot proper and u-boot.dtb images are packed into FIT image,
|
||||
ATF, U-Boot proper and u-boot.dtb images are packed into a FIT image,
|
||||
which is loaded and parsed by SPL.
|
||||
|
||||
Boot sequence is:
|
||||
|
||||
* SPL ---> ATF (TF-A) ---> U-Boot proper
|
||||
|
||||
Output:
|
||||
|
||||
.. code-block:: none
|
||||
Output::
|
||||
|
||||
U-Boot SPL 2022.04-rc1-00164-g21a0312611-dirty (Feb 07 2022 - 11:34:04 +0100)
|
||||
Quad die, dual rank failed, attempting dual die, single rank configuration.
|
||||
|
|
11
doc/build/documentation.rst
vendored
11
doc/build/documentation.rst
vendored
|
@ -5,6 +5,17 @@ Building documentation
|
|||
|
||||
The U-Boot documentation is based on the Sphinx documentation generator.
|
||||
|
||||
In addition to the Python packages listed in ``doc/sphinx/requirements.txt``,
|
||||
the following dependencies are needed to build the documentation:
|
||||
|
||||
* fontconfig
|
||||
|
||||
* graphviz
|
||||
|
||||
* imagemagick
|
||||
|
||||
* texinfo (if building the `Infodoc documentation`_)
|
||||
|
||||
HTML documentation
|
||||
------------------
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ needs_sphinx = '2.4.4'
|
|||
extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include',
|
||||
'kfigure', 'sphinx.ext.ifconfig', # 'automarkup',
|
||||
'maintainers_include', 'sphinx.ext.autosectionlabel',
|
||||
'kernel_abi', 'kernel_feat']
|
||||
'kernel_abi', 'kernel_feat', 'sphinx-prompt']
|
||||
|
||||
#
|
||||
# cdomain is badly broken in Sphinx 3+. Leaving it out generates *most*
|
||||
|
|
|
@ -132,6 +132,9 @@ above bootdev scanning.
|
|||
Controlling ordering
|
||||
--------------------
|
||||
|
||||
By default, faster bootdevs (or those which are assumed to be faster) are used
|
||||
first, since they are more likely to be able to boot the device quickly.
|
||||
|
||||
Several options are available to control the ordering of boot scanning:
|
||||
|
||||
|
||||
|
@ -151,6 +154,10 @@ bootdevs and their sequence numbers.
|
|||
bootmeths
|
||||
~~~~~~~~~
|
||||
|
||||
By default bootmeths are checked in name order. Use `bootmeth list` to see the
|
||||
ordering. Note that the `extlinux` and `script` bootmeth is first, to preserve the behaviour
|
||||
used by the old distro scripts.
|
||||
|
||||
This environment variable can be used to control the list of bootmeths used and
|
||||
their ordering for example::
|
||||
|
||||
|
@ -164,7 +171,6 @@ controlled by aliases.
|
|||
The :ref:`usage/cmd/bootmeth:bootmeth command` (`bootmeth order`) operates in
|
||||
the same way as setting this variable.
|
||||
|
||||
|
||||
Bootdev uclass
|
||||
--------------
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ For the next scheduled release, release candidates were made on::
|
|||
|
||||
* U-Boot v2023.10-rc3 was released on Mon 21 August 2023.
|
||||
|
||||
.. * U-Boot v2023.10-rc4 was released on Mon 04 September 2023.
|
||||
* U-Boot v2023.10-rc4 was released on Mon 04 September 2023.
|
||||
|
||||
.. * U-Boot v2023.10-rc5 was released on Mon 18 September 2023.
|
||||
|
||||
|
|
|
@ -254,6 +254,90 @@ This shows running with serial enabled (see `include/configs/efi-x86_app.h`)::
|
|||
|
||||
=> QEMU: Terminated
|
||||
|
||||
Run on VirtualBox (x86_64)
|
||||
--------------------------
|
||||
|
||||
Enable EFI
|
||||
~~~~~~~~~~
|
||||
At settings for virtual machine the flag at **System->Motherboard->Enable EFI
|
||||
(special OSes only)** has to be enabled.
|
||||
|
||||
Installation
|
||||
~~~~~~~~~~~~
|
||||
Provide the preinstalled Linux system as a Virtual Disk Image (VDI) and assign
|
||||
it to a SATA controller (type AHCI) using the settings for the virtual machine
|
||||
at menu item **System->Storage->Controller:SATA**.
|
||||
|
||||
For the following description three GPT partitions are assumed:
|
||||
|
||||
- Partition 1: formatted as FAT file-system and marked as EFI system partition
|
||||
(partition type 0xEF00) used for the U-Boot EFI binary. (If VirtualBox is UEFI
|
||||
compliant, it should recognize the ESP as the boot partition.)
|
||||
|
||||
- Partition 2: formatted as **ext4**, used for root file system
|
||||
|
||||
Create an extlinux.conf or a boot script
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Following files are assumed to be located at system for boot configuration::
|
||||
|
||||
Partition File Comment
|
||||
1 EFI/BOOT/BOOTX64.efi # renamed U-Boot EFI image
|
||||
1 Image # Linux image
|
||||
1 Initrd # Initramfs of Linux
|
||||
|
||||
**EFI/BOOT/BOOTX64.efi** is a renamed build result **u-boot-payload.efi**, built with
|
||||
**efi-x86_payload64_defconfig** configuration.
|
||||
|
||||
Boot script
|
||||
~~~~~~~~~~~
|
||||
|
||||
The boot script **boot.scr** is assumed to be located at::
|
||||
|
||||
Partition File Comment
|
||||
1 boot.scr # Boot script, generated with mkimage from template
|
||||
|
||||
Content of **boot.scr**:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
ext4load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${prefix}Image
|
||||
setenv kernel_size ${filesize}
|
||||
ext4load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} ${prefix}Initrd
|
||||
setenv initrd_size ${filesize}
|
||||
zboot ${kernel_addr_r} ${kernel_size} ${ramdisk_addr_r} ${initrd_size}
|
||||
|
||||
Extlinux configuration
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Alternatively a configuration **extlinux.conf** can be used. **extlinux.conf**
|
||||
is assumed to be located at::
|
||||
|
||||
Partition File Comment
|
||||
1 extlinux/extlinux.conf # Extlinux boot configuration
|
||||
|
||||
Content of **extlinux.conf**:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
default l0
|
||||
menu title U-Boot menu
|
||||
prompt 0
|
||||
timeout 50
|
||||
|
||||
label l0
|
||||
menu label Linux
|
||||
linux /Image
|
||||
initrd /Initrd
|
||||
|
||||
|
||||
Additionally something like (sda is assumed as disk device):
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
append root=/dev/sda2 console=tty0 console=ttyS0,115200n8 rootwait rw
|
||||
|
||||
|
||||
|
||||
Future work
|
||||
-----------
|
||||
|
|
|
@ -3,9 +3,18 @@
|
|||
U-Boot Talks
|
||||
============
|
||||
|
||||
U-Boot is a topic at various conferences each year. These talkes might help you
|
||||
learn a bit about U-Boot.
|
||||
U-Boot is a topic at various conferences each year. These talks might help you
|
||||
learn a bit about U-Boot:
|
||||
|
||||
See elinux_talks_ for a list.
|
||||
* `Tutorial: Introduction to the Embedded Boot Loader U-boot - Behan Webster,
|
||||
Converse in Code <https://www.youtube.com/watch?v=INWghYZH3hI>`__
|
||||
from Embedded Linux Conference 2020
|
||||
(`slides <https://cm.e-ale.org/2020/ELC2020/intro-to-u-boot/intro-to-u-boot-2020.pdf>`__).
|
||||
|
||||
* `Recent Advances in U-Boot - Simon Glass, Google Inc.
|
||||
<https://www.youtube.com/watch?v=YlJBsVZJkDI>`__
|
||||
from Embedded Linux Conference 2023.
|
||||
|
||||
See elinux_talks_ for a more comprehensive list.
|
||||
|
||||
.. _elinux_talks: https://elinux.org/Boot_Loaders#U-Boot
|
||||
|
|
|
@ -15,6 +15,7 @@ requests==2.31.0
|
|||
six==1.16.0
|
||||
snowballstemmer==2.2.0
|
||||
Sphinx==3.4.3
|
||||
sphinx-prompt==1.5.0
|
||||
sphinx-rtd-theme==1.0.0
|
||||
sphinxcontrib-applehelp==1.0.2
|
||||
sphinxcontrib-devhelp==1.0.2
|
||||
|
|
184
doc/usage/cmd/gpt.rst
Normal file
184
doc/usage/cmd/gpt.rst
Normal file
|
@ -0,0 +1,184 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
gpt command
|
||||
===========
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
gpt enumerate <interface> <dev>
|
||||
gpt guid <interface> <dev> [<varname>]
|
||||
gpt read <interface> <dev> [<varname>]
|
||||
gpt rename <interface> <dev> <part> <name>
|
||||
gpt repair <interface> <dev>
|
||||
gpt setenv <interface> <dev> <partition name>
|
||||
gpt swap <interface> <dev> <name1> <name2>
|
||||
gpt verify <interface> <dev> [<partition string>]
|
||||
gpt write <interface> <dev> <partition string>
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
The gpt command lets users read, create, modify, or verify the GPT (GUID
|
||||
Partition Table) partition layout.
|
||||
|
||||
Common arguments:
|
||||
|
||||
interface
|
||||
interface for accessing the block device (mmc, sata, scsi, usb, ....)
|
||||
|
||||
dev
|
||||
device number
|
||||
|
||||
partition string
|
||||
Describes the GPT partition layout for a disk. The syntax is similar to
|
||||
the one used by the :doc:`mbr command <mbr>` command. The string contains
|
||||
one or more partition descriptors, each separated by a ";". Each descriptor
|
||||
contains one or more fields, with each field separated by a ",". Fields are
|
||||
either of the form "key=value" to set a specific value, or simple "flag" to
|
||||
set a boolean flag
|
||||
|
||||
The first descriptor can optionally be used to describe parameters for the
|
||||
whole disk with the following fields:
|
||||
|
||||
* uuid_disk=UUID - Set the UUID for the disk
|
||||
|
||||
Partition descriptors can have the following fields:
|
||||
|
||||
* name=<NAME> - The partition name, required
|
||||
* start=<BYTES> - The partition start offset in bytes, required
|
||||
* size=<BYTES> - The partition size in bytes or "-" to expand it to the whole free area
|
||||
* bootable - Set the legacy bootable flag
|
||||
* uuid=<UUID> - The partition UUID, optional if CONFIG_RANDOM_UUID=y is enabled
|
||||
* type=<UUID> - The partition type GUID, requires CONFIG_PARTITION_TYPE_GUID=y
|
||||
|
||||
|
||||
If 'uuid' is not specified, but CONFIG_RANDOM_UUID is enabled, a random UUID
|
||||
will be generated for the partition
|
||||
|
||||
gpt enumerate
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
Sets the variable 'gpt_partition_list' to be a list of all the partition names
|
||||
on the device.
|
||||
|
||||
gpt guid
|
||||
~~~~~~~~
|
||||
|
||||
Report the GUID of a disk. If 'varname' is specified, the command will set the
|
||||
variable to the GUID, otherwise it will be printed out.
|
||||
|
||||
gpt read
|
||||
~~~~~~~~
|
||||
|
||||
Prints the current state of the GPT partition table. If 'varname' is specified,
|
||||
the variable will be filled with a partition string in the same format as a
|
||||
'<partition string>', suitable for passing to other 'gpt' commands. If the
|
||||
argument is omitted, a human readable description is printed out.
|
||||
CONFIG_CMD_GPT_RENAME=y is required.
|
||||
|
||||
gpt rename
|
||||
~~~~~~~~~~
|
||||
|
||||
Renames all partitions named 'part' to be 'name'. CONFIG_CMD_GPT_RENAME=y is
|
||||
required.
|
||||
|
||||
gpt repair
|
||||
~~~~~~~~~~
|
||||
|
||||
Repairs the GPT partition tables if it they become corrupted.
|
||||
|
||||
gpt setenv
|
||||
~~~~~~~~~~
|
||||
|
||||
The 'gpt setenv' command will set a series of environment variables with
|
||||
information about the partition named '<partition name>'. The variables are:
|
||||
|
||||
gpt_partition_addr
|
||||
the starting offset of the partition in blocks as a hexadecimal number
|
||||
|
||||
gpt_partition_size
|
||||
the size of the partition in blocks as a hexadecimal number
|
||||
|
||||
gpt_partition_name
|
||||
the name of the partition
|
||||
|
||||
gpt_partition_entry
|
||||
the partition number in the table, e.g. 1, 2, 3, etc.
|
||||
|
||||
gpt swap
|
||||
~~~~~~~~
|
||||
|
||||
Changes the names of all partitions that are named 'name1' to be 'name2', and
|
||||
all partitions named 'name2' to be 'name1'. CONFIG_CMD_GPT_RENAME=y is
|
||||
required.
|
||||
|
||||
gpt verify
|
||||
~~~~~~~~~~
|
||||
|
||||
Sets return value $? to 0 (true) if the partition layout on the
|
||||
specified disk matches the one in the provided partition string, and 1 (false)
|
||||
if it does not match. If no partition string is specified, the command will
|
||||
check if the disk is partitioned or not.
|
||||
|
||||
gpt write
|
||||
~~~~~~~~~
|
||||
|
||||
(Re)writes the partition table on the disk to match the provided
|
||||
partition string. It returns 0 on success or 1 on failure.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
To use the 'gpt' command you must specify CONFIG_CMD_GPT=y. To enable 'gpt
|
||||
read', 'gpt swap' and 'gpt rename', you must specify CONFIG_CMD_GPT_RENAME=y.
|
||||
|
||||
Examples
|
||||
~~~~~~~~
|
||||
Create 6 partitions on a disk::
|
||||
|
||||
=> setenv gpt_parts 'uuid_disk=bec9fc2a-86c1-483d-8a0e-0109732277d7;
|
||||
name=boot,start=4M,size=128M,bootable,type=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7,
|
||||
name=rootfs,size=3072M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;
|
||||
name=system-data,size=512M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;
|
||||
name=[ext],size=-,type=0fc63daf-8483-4772-8e79-3d69d8477de4;
|
||||
name=user,size=-,type=0fc63daf-8483-4772-8e79-3d69d8477de4;
|
||||
name=modules,size=100M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;
|
||||
name=ramdisk,size=8M,type=0fc63daf-8483-4772-8e79-3d69d8477de4
|
||||
=> gpt write mmc 0 $gpt_parts
|
||||
|
||||
|
||||
Verify that the device matches the partition layout described in the variable
|
||||
$gpt_parts::
|
||||
|
||||
=> gpt verify mmc 0 $gpt_parts
|
||||
|
||||
|
||||
Get the information about the partition named 'rootfs'::
|
||||
|
||||
=> gpt setenv mmc 0 rootfs
|
||||
=> echo ${gpt_partition_addr}
|
||||
2000
|
||||
=> echo ${gpt_partition_size}
|
||||
14a000
|
||||
=> echo ${gpt_partition_name}
|
||||
rootfs
|
||||
=> echo ${gpt_partition_entry}
|
||||
2
|
||||
|
||||
Get the list of partition names on the disk::
|
||||
|
||||
=> gpt enumerate
|
||||
=> echo gpt_partition_list
|
||||
boot rootfs system-data [ext] user modules ramdisk
|
||||
|
||||
|
||||
Get the GUID for a disk::
|
||||
|
||||
=> gpt guid mmc 0
|
||||
bec9fc2a-86c1-483d-8a0e-0109732277d7
|
||||
=> gpt guid mmc gpt_disk_uuid
|
||||
=> echo ${gpt_disk_uuid}
|
||||
bec9fc2a-86c1-483d-8a0e-0109732277d7
|
|
@ -4,6 +4,7 @@ Use U-Boot
|
|||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
spl_boot
|
||||
blkmap
|
||||
dfu
|
||||
environment
|
||||
|
@ -65,6 +66,7 @@ Shell commands
|
|||
cmd/for
|
||||
cmd/fwu_mdata
|
||||
cmd/gpio
|
||||
cmd/gpt
|
||||
cmd/host
|
||||
cmd/imxtract
|
||||
cmd/load
|
||||
|
|
321
doc/usage/spl_boot.rst
Normal file
321
doc/usage/spl_boot.rst
Normal file
|
@ -0,0 +1,321 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
Booting from TPL/SPL
|
||||
====================
|
||||
|
||||
The main U-Boot binary may be too large to be loaded directly by the Boot ROM.
|
||||
This was the original driver for splitting up U-Boot into multiple boot stages.
|
||||
|
||||
U-Boot typically goes through the following boot phases where TPL, VPL, and SPL
|
||||
are optional. While many boards use SPL only few use TPL.
|
||||
|
||||
TPL
|
||||
Tertiary Program Loader. Very early init, as tiny as possible. This loads SPL
|
||||
(or VPL if enabled).
|
||||
|
||||
VPL
|
||||
Verifying Program Loader. Optional verification step, which can select one of
|
||||
several SPL binaries, if A/B verified boot is enabled. Implementation of the
|
||||
VPL logic is work-in-progress. For now it just boots into SPL.
|
||||
|
||||
SPL
|
||||
Secondary Program Loader. Sets up SDRAM and loads U-Boot proper. It may also
|
||||
load other firmware components.
|
||||
|
||||
U-Boot
|
||||
U-Boot proper. This is the only stage containing command. It also implements
|
||||
logic to load an operating system, e.g. via UEFI.
|
||||
|
||||
.. note::
|
||||
|
||||
The naming convention on the PowerPC architecture deviates from the other
|
||||
archtitectures. Here the boot sequence is SPL->TPL->U-Boot.
|
||||
|
||||
Further usages for U-Boot SPL comprise:
|
||||
|
||||
* launching BL31 of ARM Trusted Firmware which invokes U-Boot as BL33
|
||||
* launching EDK II
|
||||
* launching Linux, e.g. :doc:`Falcon Mode <../develop/falcon>`
|
||||
* launching RISC-V OpenSBI which invokes main U-Boot
|
||||
|
||||
Target binaries
|
||||
---------------
|
||||
|
||||
Binaries loaded by SPL/TPL can be:
|
||||
|
||||
* raw binaries where the entry address equals the start address. This is the
|
||||
only binary format supported by TPL.
|
||||
* :doc:`FIT <fit/index>` images
|
||||
* legacy U-Boot images
|
||||
|
||||
Configuration
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
Raw images are only supported in SPL if CONFIG_SPL_RAW_IMAGE_SUPPORT=y.
|
||||
|
||||
CONFIG_SPL_FIT=y and CONFIG_SPL_LOAD_FIT=y are needed to load FIT images.
|
||||
|
||||
CONFIG_SPL_LEGACY_IMAGE_FORMAT=y is needed to load legacy U-Boot images.
|
||||
CONFIG_SPL_LEGACY_IMAGE_CRC_CHECK=y enables checking the CRC32 of legacy U-Boot
|
||||
images.
|
||||
|
||||
Image load methods
|
||||
------------------
|
||||
|
||||
The image boot methods available for a board must be defined in two places:
|
||||
|
||||
The board code implements a function board_boot_order() enumerating up to
|
||||
five boot methods and the sequence in which they are tried. (The maximum
|
||||
number of boot methods is currently hard coded as variable spl_boot_list[]).
|
||||
If there is only one boot method function, spl_boot_device() may be implemented
|
||||
instead.
|
||||
|
||||
The configuration controls which of these boot methods are actually available.
|
||||
|
||||
Loading from block devices
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
MMC1, MMC2, MMC2_2
|
||||
These methods read an image from SD card or eMMC. The first digit after
|
||||
'MMC' indicates the device number. Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_MMC=y or CONFIG_TPL_MMC=y
|
||||
|
||||
To use a PCI connected MMC controller you need to additionally specify:
|
||||
|
||||
* CONFIG_SPL_PCI=y
|
||||
|
||||
* CONFIG_SPL_PCI_PNP=y
|
||||
|
||||
* CONFIG_MMC=y
|
||||
|
||||
* CONFIG_MMC_PCI=y
|
||||
|
||||
* CONFIG_MMC_SDHCI=y
|
||||
|
||||
To load from a file system use:
|
||||
|
||||
* CONFIG_SPL_FS_FAT=y or CONFIG_SPL_FS_EXT=y
|
||||
|
||||
* CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="<filepath>"
|
||||
|
||||
NVMe
|
||||
This methods load the image from an NVMe drive.
|
||||
Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_PCI=y
|
||||
|
||||
* CONFIG_SPL_PCI_PNP=y
|
||||
|
||||
* CONFIG_SPL_NVME=y
|
||||
|
||||
* CONFIG_SPL_NVME_PCI=y
|
||||
|
||||
* CONFIG_SPL_NVME_BOOT_DEVICE (number of the NVMe device)
|
||||
|
||||
* CONFIG_SYS_NVME_BOOT_PARTITION (partition to read from)
|
||||
|
||||
To load from a file system use:
|
||||
|
||||
* CONFIG_SPL_FS_FAT=y or CONFIG_SPL_FS_EXT=y
|
||||
|
||||
* CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="<filepath>"
|
||||
|
||||
SATA
|
||||
This method reads an image from a SATA drive.
|
||||
Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_SATA=y or CONFIG_TPL_SATA=y
|
||||
|
||||
To use a PCIe connecte SATA controller you additionally need:
|
||||
|
||||
* CONFIG_SPL_PCI=y
|
||||
|
||||
* CONFIG_SPL_SATA=y
|
||||
|
||||
* CONFIG_SPL_AHCI_PCI=y
|
||||
|
||||
* CONFIG_SPL_PCI_PNP=y
|
||||
|
||||
To load from a file system use:
|
||||
|
||||
* CONFIG_SPL_FS_FAT=y
|
||||
|
||||
* CONFIG_SYS_SATA_FAT_BOOT_PARTITION=<partition number>
|
||||
|
||||
* CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="<filepath>"
|
||||
|
||||
USB
|
||||
The USB method loads an image from a USB block device.
|
||||
Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_USB_HOST=y
|
||||
|
||||
* CONFIG_SPL_USB_STORAGE=y
|
||||
|
||||
To use a PCI connected USB 3.0 controller you additionally need:
|
||||
|
||||
* CONFIG_SPL_FS_FAT=y
|
||||
|
||||
* CONFIG_SPL_PCI=y
|
||||
|
||||
* CONFIG_SPL_PCI_PNP=y
|
||||
|
||||
* CONFIG_USB=y
|
||||
|
||||
* CONFIG_USB_XHCI_HCD=y
|
||||
|
||||
* CONFIG_USB_XHCI_PCI=y
|
||||
|
||||
To load from a file system use:
|
||||
|
||||
* CONFIG_SPL_FS_FAT=y or CONFIG_SPL_FS_EXT=y
|
||||
|
||||
* CONFIG_SYS_USB_FAT_BOOT_PARTITION=<partition number>
|
||||
|
||||
* CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="<filepath>"
|
||||
|
||||
Loading from raw flash devices
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
NAND
|
||||
This method loads the image from NAND flash. To read from raw NAND the
|
||||
following configuration settings are required:
|
||||
|
||||
* CONFIG_SPL_NAND_SUPPORT=y or CONFIG_TPL_NAND_SUPPORT=y
|
||||
|
||||
If CONFIG_SPL_NAND_RAW_ONLY=y only raw images can be loaded.
|
||||
|
||||
For using UBI (Unsorted Block Images) volumes to read from NAND the
|
||||
following configuration settings are required:
|
||||
|
||||
* CONFIG_SPL_UBI=y or CONFIG_TPL_UBI=y
|
||||
|
||||
The UBI volume to read can either be specified
|
||||
|
||||
* by name using CONFIG_SPL_UBI_LOAD_BY_VOLNAME or
|
||||
|
||||
* by number using CONFIG_SPL_UBI_LOAD_MONITOR_ID.
|
||||
|
||||
NOR
|
||||
This method loads the image from NOR flash.
|
||||
Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_NOR_SUPPORT=y or CONFIG_TPL_NOR_SUPPORT=y
|
||||
|
||||
OneNAND
|
||||
This methods loads the image from a OneNAND device. To read from raw OneNAND
|
||||
the following configuration settings are required:
|
||||
|
||||
* CONFIG_SPL_ONENAND_SUPPORT=y or CONFIG_TPL_ONENAND_SUPPORT=y
|
||||
|
||||
For using the Ubi file system to read from NAND the following configuration
|
||||
settings are required:
|
||||
|
||||
* CONFIG_SPL_UBI=y or CONFIG_TPL_UBI=y
|
||||
|
||||
SPI
|
||||
This method loads an image form SPI NOR flash.
|
||||
Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_DM_SPI=y
|
||||
|
||||
* CONFIG_SPL_SPI_FLASH=y
|
||||
|
||||
* CONFIG_SPI_LOAD=y or CONFIG_TPL_SPI_LOAD=y
|
||||
|
||||
|
||||
Sunxi SPI
|
||||
This method which is specific to Allwinner SoCs loads an image form SPI NOR
|
||||
flash. Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_SPI_SUNXI=y
|
||||
|
||||
Loading from other devices
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
BOOTROM
|
||||
The binary is loaded by the boot ROM.
|
||||
Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_BOOTROM_SUPPORT=y or CONFIG_TPL_BOOTROM_SUPPORT=y
|
||||
|
||||
DFU
|
||||
:doc:`Device Firmware Upgrade <dfu>` is used to load the binary into RAM.
|
||||
Required configuration settings include:
|
||||
|
||||
* CONFIG_DFU=y
|
||||
|
||||
* CONFIG_SPL_RAM_SUPPORT=y or CONFIG TPL_RAM_SUPPORT=y
|
||||
|
||||
Ethernet
|
||||
This method loads an image over Ethernet. The BOOTP protocol is used to find
|
||||
a TFTP server and binary name. The binary is downloaded via the TFTP
|
||||
protocol. Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_NET=y or CONFIG_TPL_NET=y
|
||||
|
||||
* CONFIG_SPL_ETH_DEVICE=y or CONFIG_DM_USB_GADGET=y
|
||||
|
||||
FEL
|
||||
This method does not actually load an image for U-Boot.
|
||||
FEL is a routine contained in the boot ROM of Allwinner SoCs which serves
|
||||
for the initial programming or recovery via USB
|
||||
|
||||
RAM
|
||||
This method uses an image preloaded into RAM.
|
||||
Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_RAM_SUPPORT=y or CONFIG_TPL_RAM_SUPPORT=y
|
||||
|
||||
* CONFIG_RAM_DEVICE=y
|
||||
|
||||
Sandbox file
|
||||
On the sandbox this method loads an image from the host file system.
|
||||
|
||||
Sandbox image
|
||||
On the sandbox this method loads an image from the host file system.
|
||||
|
||||
Semihosting
|
||||
When running in an ARM or RISC-V virtual machine the semihosting method can
|
||||
be used to load an image from the host file system.
|
||||
Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_SEMIHOSTING=y
|
||||
|
||||
* CONFIG_SPL_SEMIHOSTING_FALLBACK=y
|
||||
|
||||
* CONFIG_SPL_FS_LOAD_PAYLOAD_NAME=<path to file>
|
||||
|
||||
UART
|
||||
This method loads an image via the Y-Modem protocol from the UART.
|
||||
Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_YMODEM_SUPPORT=y or CONFIG_TPL_YMODEM_SUPPORT=y
|
||||
|
||||
USB SDP
|
||||
This method loads the image using the Serial Download Protocol as
|
||||
implemented by the boot ROM of the i.MX family of SoCs.
|
||||
|
||||
Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_SERIAL=y
|
||||
|
||||
* CONFIG_SPL_USB_SDP_SUPPORT=y or CONFIG_TPL_USB_SDP_SUPPORT
|
||||
|
||||
VBE Simple
|
||||
This method is used by the VPL stage to extract the next stage image from
|
||||
the loaded image.
|
||||
|
||||
Required configuration settings include:
|
||||
|
||||
* CONFIG_VPL=y
|
||||
|
||||
* CONFIG_SPL_BOOTMETH_VBE_SIMPLE_FW=y or CONFIG_TPL_BOOTMETH_VBE_SIMPLE_FW=y
|
||||
|
||||
XIP
|
||||
This method executes an image in place.
|
||||
|
||||
Required configuration settings include:
|
||||
|
||||
* CONFIG_SPL_XIP_SUPPORT
|
|
@ -436,8 +436,10 @@ int dm_init_and_scan(bool pre_reloc_only)
|
|||
return ret;
|
||||
}
|
||||
}
|
||||
if (CONFIG_IS_ENABLED(DM_EVENT) && !(gd->flags & GD_FLG_RELOC)) {
|
||||
ret = event_notify_null(EVT_DM_POST_INIT_F);
|
||||
if (CONFIG_IS_ENABLED(DM_EVENT)) {
|
||||
ret = event_notify_null(gd->flags & GD_FLG_RELOC ?
|
||||
EVT_DM_POST_INIT_R :
|
||||
EVT_DM_POST_INIT_F);
|
||||
if (ret)
|
||||
return log_msg_ret("ev", ret);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include <linux/delay.h>
|
||||
#include <linux/err.h>
|
||||
#include <clk.h>
|
||||
#include <dm/device_compat.h>
|
||||
#include <power/regulator.h>
|
||||
|
||||
#define PHY_CTRL0 0x0
|
||||
#define PHY_CTRL0_REF_SSP_EN BIT(2)
|
||||
|
@ -76,11 +78,10 @@ enum imx8mpq_phy_type {
|
|||
};
|
||||
|
||||
struct imx8mq_usb_phy {
|
||||
#if CONFIG_IS_ENABLED(CLK)
|
||||
struct clk phy_clk;
|
||||
#endif
|
||||
void __iomem *base;
|
||||
enum imx8mpq_phy_type type;
|
||||
struct udevice *vbus_supply;
|
||||
};
|
||||
|
||||
static const struct udevice_id imx8mq_usb_phy_of_match[] = {
|
||||
|
@ -173,15 +174,23 @@ static int imx8mq_usb_phy_power_on(struct phy *usb_phy)
|
|||
struct udevice *dev = usb_phy->dev;
|
||||
struct imx8mq_usb_phy *imx_phy = dev_get_priv(dev);
|
||||
u32 value;
|
||||
|
||||
#if CONFIG_IS_ENABLED(CLK)
|
||||
int ret;
|
||||
ret = clk_enable(&imx_phy->phy_clk);
|
||||
if (ret) {
|
||||
printf("Failed to enable usb phy clock\n");
|
||||
return ret;
|
||||
|
||||
if (CONFIG_IS_ENABLED(CLK)) {
|
||||
ret = clk_enable(&imx_phy->phy_clk);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to enable usb phy clock: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (CONFIG_IS_ENABLED(DM_REGULATOR) && imx_phy->vbus_supply) {
|
||||
ret = regulator_set_enable_if_allowed(imx_phy->vbus_supply, true);
|
||||
if (ret && ret != -ENOSYS) {
|
||||
dev_err(dev, "Failed to enable VBUS regulator: %d\n", ret);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Disable rx term override */
|
||||
value = readl(imx_phy->base + PHY_CTRL6);
|
||||
|
@ -189,6 +198,11 @@ static int imx8mq_usb_phy_power_on(struct phy *usb_phy)
|
|||
writel(value, imx_phy->base + PHY_CTRL6);
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
if (CONFIG_IS_ENABLED(CLK))
|
||||
clk_disable(&imx_phy->phy_clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int imx8mq_usb_phy_power_off(struct phy *usb_phy)
|
||||
|
@ -196,15 +210,23 @@ static int imx8mq_usb_phy_power_off(struct phy *usb_phy)
|
|||
struct udevice *dev = usb_phy->dev;
|
||||
struct imx8mq_usb_phy *imx_phy = dev_get_priv(dev);
|
||||
u32 value;
|
||||
int ret;
|
||||
|
||||
/* Override rx term to be 0 */
|
||||
value = readl(imx_phy->base + PHY_CTRL6);
|
||||
value |= PHY_CTRL6_RXTERM_OVERRIDE_SEL;
|
||||
writel(value, imx_phy->base + PHY_CTRL6);
|
||||
|
||||
#if CONFIG_IS_ENABLED(CLK)
|
||||
clk_disable(&imx_phy->phy_clk);
|
||||
#endif
|
||||
if (CONFIG_IS_ENABLED(CLK))
|
||||
clk_disable(&imx_phy->phy_clk);
|
||||
|
||||
if (CONFIG_IS_ENABLED(DM_REGULATOR) && imx_phy->vbus_supply) {
|
||||
ret = regulator_set_enable_if_allowed(imx_phy->vbus_supply, false);
|
||||
if (ret && ret != -ENOSYS) {
|
||||
dev_err(dev, "Failed to disable VBUS regulator: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -224,6 +246,7 @@ struct phy_ops imx8mq_usb_phy_ops = {
|
|||
int imx8mq_usb_phy_probe(struct udevice *dev)
|
||||
{
|
||||
struct imx8mq_usb_phy *priv = dev_get_priv(dev);
|
||||
int ret;
|
||||
|
||||
priv->type = dev_get_driver_data(dev);
|
||||
priv->base = dev_read_addr_ptr(dev);
|
||||
|
@ -231,16 +254,22 @@ int imx8mq_usb_phy_probe(struct udevice *dev)
|
|||
if (!priv->base)
|
||||
return -EINVAL;
|
||||
|
||||
#if CONFIG_IS_ENABLED(CLK)
|
||||
int ret;
|
||||
|
||||
/* Assigned clock already set clock */
|
||||
ret = clk_get_by_name(dev, "phy", &priv->phy_clk);
|
||||
if (ret) {
|
||||
printf("Failed to get usb phy clock\n");
|
||||
return ret;
|
||||
if (CONFIG_IS_ENABLED(CLK)) {
|
||||
ret = clk_get_by_name(dev, "phy", &priv->phy_clk);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to get usb phy clock %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (CONFIG_IS_ENABLED(DM_REGULATOR)) {
|
||||
ret = device_get_supply_regulator(dev, "vbus-supply",
|
||||
&priv->vbus_supply);
|
||||
if (ret && ret != -ENOENT) {
|
||||
dev_err(dev, "Failed to get VBUS regulator: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -145,7 +145,8 @@ static int dwc3_generic_remove(struct udevice *dev,
|
|||
struct dwc3 *dwc3 = &priv->dwc3;
|
||||
|
||||
if (CONFIG_IS_ENABLED(DM_GPIO) &&
|
||||
device_is_compatible(dev->parent, "xlnx,zynqmp-dwc3")) {
|
||||
device_is_compatible(dev->parent, "xlnx,zynqmp-dwc3") &&
|
||||
priv->ulpi_reset) {
|
||||
struct gpio_desc *ulpi_reset = priv->ulpi_reset;
|
||||
|
||||
dm_gpio_free(ulpi_reset->dev, ulpi_reset);
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
#include <asm/arch/base.h>
|
||||
#endif
|
||||
|
||||
/* Architecture, CPU, etc.*/
|
||||
|
||||
/* Use SoC timer for AArch32, but architected timer for AArch64 */
|
||||
#ifndef CONFIG_ARM64
|
||||
#define CFG_SYS_TIMER_RATE 1000000
|
||||
|
@ -33,136 +31,4 @@
|
|||
*/
|
||||
#define CFG_SYS_SDRAM_SIZE SZ_128M
|
||||
|
||||
/* Devices */
|
||||
/* LCD */
|
||||
|
||||
/* DFU over USB/UDC */
|
||||
#ifdef CONFIG_CMD_DFU
|
||||
#ifdef CONFIG_ARM64
|
||||
#define KERNEL_FILENAME "Image"
|
||||
#else
|
||||
#define KERNEL_FILENAME "zImage"
|
||||
#endif
|
||||
|
||||
#define ENV_DFU_SETTINGS \
|
||||
"dfu_alt_info=u-boot.bin fat 0 1;uboot.env fat 0 1;" \
|
||||
"config.txt fat 0 1;" \
|
||||
KERNEL_FILENAME " fat 0 1\0"
|
||||
#else
|
||||
#define ENV_DFU_SETTINGS ""
|
||||
#endif
|
||||
|
||||
/* Console configuration */
|
||||
|
||||
/* Environment */
|
||||
|
||||
/* Shell */
|
||||
|
||||
/* Environment */
|
||||
#define ENV_DEVICE_SETTINGS \
|
||||
"stdin=serial,usbkbd\0" \
|
||||
"stdout=serial,vidconsole\0" \
|
||||
"stderr=serial,vidconsole\0"
|
||||
|
||||
#ifdef CONFIG_ARM64
|
||||
#define FDT_HIGH "ffffffffffffffff"
|
||||
#define INITRD_HIGH "ffffffffffffffff"
|
||||
#else
|
||||
#define FDT_HIGH "ffffffff"
|
||||
#define INITRD_HIGH "ffffffff"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Memory layout for where various images get loaded by boot scripts:
|
||||
*
|
||||
* I suspect address 0 is used as the SMP pen on the RPi2, so avoid this.
|
||||
*
|
||||
* Older versions of the boot firmware place the firmware-loaded DTB at 0x100,
|
||||
* newer versions place it in high memory. So prevent U-Boot from doing its own
|
||||
* DTB + initrd relocation so that we won't accidentally relocate the initrd
|
||||
* over the firmware-loaded DTB and generally try to lay out things starting
|
||||
* from the bottom of RAM.
|
||||
*
|
||||
* kernel_addr_r has different constraints on ARM and Aarch64. For 32-bit ARM,
|
||||
* it must be within the first 128M of RAM in order for the kernel's
|
||||
* CONFIG_AUTO_ZRELADDR option to work. The kernel itself will be decompressed
|
||||
* to 0x8000 but the decompressor clobbers 0x4000-0x8000 as well. The
|
||||
* decompressor also likes to relocate itself to right past the end of the
|
||||
* decompressed kernel, so in total the sum of the compressed and and
|
||||
* decompressed kernel needs to be reserved.
|
||||
*
|
||||
* For Aarch64, the kernel image is uncompressed and must be loaded at
|
||||
* text_offset bytes (specified in the header of the Image) into a 2MB
|
||||
* boundary. The 'booti' command relocates the image if necessary. Linux uses
|
||||
* a default text_offset of 0x80000. In summary, loading at 0x80000
|
||||
* satisfies all these constraints and reserving memory up to 0x02400000
|
||||
* permits fairly large (roughly 36M) kernels.
|
||||
*
|
||||
* scriptaddr and pxefile_addr_r can be pretty much anywhere that doesn't
|
||||
* conflict with something else. Reserving 1M for each of them at
|
||||
* 0x02400000-0x02500000 and 0x02500000-0x02600000 should be plenty.
|
||||
*
|
||||
* On ARM, both the DTB and any possible initrd must be loaded such that they
|
||||
* fit inside the lowmem mapping in Linux. In practice, this usually means not
|
||||
* more than ~700M away from the start of the kernel image but this number can
|
||||
* be larger OR smaller depending on e.g. the 'vmalloc=xxxM' command line
|
||||
* parameter given to the kernel. So reserving memory from low to high
|
||||
* satisfies this constraint again. Reserving 1M at 0x02600000-0x02700000 for
|
||||
* the DTB leaves rest of the free RAM to the initrd starting at 0x02700000.
|
||||
* Even with the smallest possible CPU-GPU memory split of the CPU getting
|
||||
* only 64M, the remaining 25M starting at 0x02700000 should allow quite
|
||||
* large initrds before they start colliding with U-Boot.
|
||||
*/
|
||||
#define ENV_MEM_LAYOUT_SETTINGS \
|
||||
"fdt_high=" FDT_HIGH "\0" \
|
||||
"initrd_high=" INITRD_HIGH "\0" \
|
||||
"kernel_addr_r=0x00080000\0" \
|
||||
"scriptaddr=0x02400000\0" \
|
||||
"pxefile_addr_r=0x02500000\0" \
|
||||
"fdt_addr_r=0x02600000\0" \
|
||||
"ramdisk_addr_r=0x02700000\0"
|
||||
|
||||
#if IS_ENABLED(CONFIG_CMD_MMC)
|
||||
#define BOOT_TARGET_MMC(func) \
|
||||
func(MMC, mmc, 0) \
|
||||
func(MMC, mmc, 1) \
|
||||
func(MMC, mmc, 2)
|
||||
#else
|
||||
#define BOOT_TARGET_MMC(func)
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_CMD_USB)
|
||||
#define BOOT_TARGET_USB(func) func(USB, usb, 0)
|
||||
#else
|
||||
#define BOOT_TARGET_USB(func)
|
||||
#endif
|
||||
|
||||
#if CONFIG_IS_ENABLED(CMD_PXE)
|
||||
#define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
|
||||
#else
|
||||
#define BOOT_TARGET_PXE(func)
|
||||
#endif
|
||||
|
||||
#if CONFIG_IS_ENABLED(CMD_DHCP)
|
||||
#define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
|
||||
#else
|
||||
#define BOOT_TARGET_DHCP(func)
|
||||
#endif
|
||||
|
||||
#define BOOT_TARGET_DEVICES(func) \
|
||||
BOOT_TARGET_MMC(func) \
|
||||
BOOT_TARGET_USB(func) \
|
||||
BOOT_TARGET_PXE(func) \
|
||||
BOOT_TARGET_DHCP(func)
|
||||
|
||||
#include <config_distro_bootcmd.h>
|
||||
|
||||
#define CFG_EXTRA_ENV_SETTINGS \
|
||||
"dhcpuboot=usb start; dhcp u-boot.uimg; bootm\0" \
|
||||
ENV_DEVICE_SETTINGS \
|
||||
ENV_DFU_SETTINGS \
|
||||
ENV_MEM_LAYOUT_SETTINGS \
|
||||
BOOTENV
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,17 +19,79 @@
|
|||
* @EVT_DM_PRE_PROBE: Device is about to be probed
|
||||
*/
|
||||
enum event_t {
|
||||
EVT_NONE,
|
||||
/**
|
||||
* @EVT_NONE: This zero value is not used for events.
|
||||
*/
|
||||
EVT_NONE = 0,
|
||||
|
||||
/**
|
||||
* @EVT_TEST: This event is used in unit tests.
|
||||
*/
|
||||
EVT_TEST,
|
||||
|
||||
/* Events related to driver model */
|
||||
/**
|
||||
* @EVT_DM_POST_INIT_F:
|
||||
* This event is triggered after pre-relocation initialization of the
|
||||
* driver model. Its parameter is NULL.
|
||||
* A non-zero return code from the event handler let's the boot process
|
||||
* fail.
|
||||
*/
|
||||
EVT_DM_POST_INIT_F,
|
||||
|
||||
/**
|
||||
* @EVT_DM_POST_INIT_R:
|
||||
* This event is triggered after post-relocation initialization of the
|
||||
* driver model. Its parameter is NULL.
|
||||
* A non-zero return code from the event handler let's the boot process
|
||||
* fail.
|
||||
*/
|
||||
EVT_DM_POST_INIT_R,
|
||||
|
||||
/**
|
||||
* @EVT_DM_PRE_PROBE:
|
||||
* This event is triggered before probing a device. Its parameter is the
|
||||
* device to be probed.
|
||||
* A non-zero return code from the event handler lets the device not
|
||||
* being probed.
|
||||
*/
|
||||
EVT_DM_PRE_PROBE,
|
||||
|
||||
/**
|
||||
* @EVT_DM_POST_PROBE:
|
||||
* This event is triggered after probing a device. Its parameter is the
|
||||
* device that was probed.
|
||||
* A non-zero return code from the event handler leaves the device in
|
||||
* the unprobed state and therefore not usable.
|
||||
*/
|
||||
EVT_DM_POST_PROBE,
|
||||
|
||||
/**
|
||||
* @EVT_DM_PRE_REMOVE:
|
||||
* This event is triggered after removing a device. Its parameter is
|
||||
* the device to be removed.
|
||||
* A non-zero return code from the event handler stops the removal of
|
||||
* the device before any changes.
|
||||
*/
|
||||
EVT_DM_PRE_REMOVE,
|
||||
|
||||
/**
|
||||
* @EVT_DM_POST_REMOVE:
|
||||
* This event is triggered before removing a device. Its parameter is
|
||||
* the device that was removed.
|
||||
* A non-zero return code stops from the event handler the removal of
|
||||
* the device after all removal changes. The previous state is not
|
||||
* restored. All children will be gone and the device may not be
|
||||
* functional.
|
||||
*/
|
||||
EVT_DM_POST_REMOVE,
|
||||
|
||||
/* Init hooks */
|
||||
/**
|
||||
* @EVT_MISC_INIT_F:
|
||||
* This event is triggered during the initialization sequence before
|
||||
* relocation. Its parameter is NULL.
|
||||
* A non-zero return code from the event handler let's the boot process
|
||||
* fail.
|
||||
*/
|
||||
EVT_MISC_INIT_F,
|
||||
|
||||
/*
|
||||
|
@ -53,15 +115,39 @@ enum event_t {
|
|||
*/
|
||||
EVT_LAST_STAGE_INIT,
|
||||
|
||||
/* Fpga load hook */
|
||||
/**
|
||||
* @EVT_FPGA_LOAD:
|
||||
* The FPGA load hook is called after loading an FPGA with a new binary.
|
||||
* Its parameter is of type struct event_fpga_load and contains
|
||||
* information about the loaded image.
|
||||
*/
|
||||
EVT_FPGA_LOAD,
|
||||
|
||||
/* Device tree fixups before booting */
|
||||
/**
|
||||
* @EVT_FT_FIXUP:
|
||||
* This event is triggered during device-tree fix up after all
|
||||
* other device-tree fixups have been executed.
|
||||
* Its parameter is of type struct event_ft_fixup which contains
|
||||
* the address of the device-tree to fix up and the list of images to be
|
||||
* booted.
|
||||
* A non-zero return code from the event handler let's booting the
|
||||
* images fail.
|
||||
*/
|
||||
EVT_FT_FIXUP,
|
||||
|
||||
/* To be called once, before calling main_loop() */
|
||||
/**
|
||||
* @EVT_MAIN_LOOP:
|
||||
* This event is triggered immediately before calling main_loop() which
|
||||
* is the entry point of the command line. Its parameter is NULL.
|
||||
* A non-zero return value causes the boot to fail.
|
||||
*/
|
||||
EVT_MAIN_LOOP,
|
||||
|
||||
/**
|
||||
* @EVT_COUNT:
|
||||
* This constants holds the maximum event number + 1 and is used when
|
||||
* looping over all event classes.
|
||||
*/
|
||||
EVT_COUNT
|
||||
};
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend,
|
|||
int video_sync(struct udevice *vid, bool force);
|
||||
|
||||
/**
|
||||
* video_sync_all() - Sync all devices' frame buffers with there hardware
|
||||
* video_sync_all() - Sync all devices' frame buffers with their hardware
|
||||
*
|
||||
* This calls video_sync() on all active video devices.
|
||||
*/
|
||||
|
|
|
@ -73,9 +73,9 @@ obj-$(CONFIG_ECDSA) += ecdsa/
|
|||
obj-$(CONFIG_$(SPL_)RSA) += rsa/
|
||||
obj-$(CONFIG_HASH) += hash-checksum.o
|
||||
obj-$(CONFIG_BLAKE2) += blake2/blake2b.o
|
||||
obj-$(CONFIG_SHA1) += sha1.o
|
||||
obj-$(CONFIG_SHA256) += sha256.o
|
||||
obj-$(CONFIG_SHA512) += sha512.o
|
||||
obj-$(CONFIG_$(SPL_)SHA1) += sha1.o
|
||||
obj-$(CONFIG_$(SPL_)SHA256) += sha256.o
|
||||
obj-$(CONFIG_$(SPL_)SHA512) += sha512.o
|
||||
obj-$(CONFIG_CRYPT_PW) += crypt/
|
||||
obj-$(CONFIG_$(SPL_)ASN1_DECODER) += asn1_decoder.o
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ static volatile gd_t *efi_gd, *app_gd;
|
|||
|
||||
static efi_status_t efi_uninstall_protocol
|
||||
(efi_handle_t handle, const efi_guid_t *protocol,
|
||||
void *protocol_interface);
|
||||
void *protocol_interface, bool preserve);
|
||||
|
||||
/* 1 if inside U-Boot code, 0 if inside EFI payload code */
|
||||
static int entry_count = 1;
|
||||
|
@ -207,6 +207,36 @@ static bool efi_event_is_queued(struct efi_event *event)
|
|||
return !!event->queue_link.next;
|
||||
}
|
||||
|
||||
/**
|
||||
* efi_purge_handle() - Clean the deleted handle from the various lists
|
||||
* @handle: handle to remove
|
||||
*
|
||||
* Return: status code
|
||||
*/
|
||||
static efi_status_t efi_purge_handle(efi_handle_t handle)
|
||||
{
|
||||
struct efi_register_notify_event *item;
|
||||
|
||||
if (!list_empty(&handle->protocols))
|
||||
return EFI_ACCESS_DENIED;
|
||||
/* The handle is about to be freed. Remove it from events */
|
||||
list_for_each_entry(item, &efi_register_notify_events, link) {
|
||||
struct efi_protocol_notification *hitem, *hnext;
|
||||
|
||||
list_for_each_entry_safe(hitem, hnext, &item->handles, link) {
|
||||
if (handle == hitem->handle) {
|
||||
list_del(&hitem->link);
|
||||
free(hitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* The last protocol has been removed, delete the handle. */
|
||||
list_del(&handle->link);
|
||||
free(handle);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* efi_process_event_queue() - process event queue
|
||||
*/
|
||||
|
@ -615,7 +645,7 @@ static efi_status_t efi_remove_all_protocols(const efi_handle_t handle)
|
|||
efi_status_t ret;
|
||||
|
||||
ret = efi_uninstall_protocol(handle, &protocol->guid,
|
||||
protocol->protocol_interface);
|
||||
protocol->protocol_interface, true);
|
||||
if (ret != EFI_SUCCESS)
|
||||
return ret;
|
||||
}
|
||||
|
@ -639,10 +669,7 @@ efi_status_t efi_delete_handle(efi_handle_t handle)
|
|||
return ret;
|
||||
}
|
||||
|
||||
list_del(&handle->link);
|
||||
free(handle);
|
||||
|
||||
return ret;
|
||||
return efi_purge_handle(handle);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1356,6 +1383,8 @@ reconnect:
|
|||
* @handle: handle from which the protocol shall be removed
|
||||
* @protocol: GUID of the protocol to be removed
|
||||
* @protocol_interface: interface to be removed
|
||||
* @preserve: preserve or delete the handle and remove it from any
|
||||
* list it participates if no protocols remain
|
||||
*
|
||||
* This function DOES NOT delete a handle without installed protocol.
|
||||
*
|
||||
|
@ -1363,7 +1392,7 @@ reconnect:
|
|||
*/
|
||||
static efi_status_t efi_uninstall_protocol
|
||||
(efi_handle_t handle, const efi_guid_t *protocol,
|
||||
void *protocol_interface)
|
||||
void *protocol_interface, bool preserve)
|
||||
{
|
||||
struct efi_handler *handler;
|
||||
struct efi_open_protocol_info_item *item;
|
||||
|
@ -1397,6 +1426,14 @@ static efi_status_t efi_uninstall_protocol
|
|||
goto out;
|
||||
}
|
||||
r = efi_remove_protocol(handle, protocol, protocol_interface);
|
||||
if (r != EFI_SUCCESS)
|
||||
return r;
|
||||
/*
|
||||
* We don't care about the return value here since the
|
||||
* handle might have more protocols installed
|
||||
*/
|
||||
if (!preserve)
|
||||
efi_purge_handle(handle);
|
||||
out:
|
||||
return r;
|
||||
}
|
||||
|
@ -1422,15 +1459,10 @@ static efi_status_t EFIAPI efi_uninstall_protocol_interface
|
|||
|
||||
EFI_ENTRY("%p, %pUs, %p", handle, protocol, protocol_interface);
|
||||
|
||||
ret = efi_uninstall_protocol(handle, protocol, protocol_interface);
|
||||
ret = efi_uninstall_protocol(handle, protocol, protocol_interface, false);
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto out;
|
||||
|
||||
/* If the last protocol has been removed, delete the handle. */
|
||||
if (list_empty(&handle->protocols)) {
|
||||
list_del(&handle->link);
|
||||
free(handle);
|
||||
}
|
||||
out:
|
||||
return EFI_EXIT(ret);
|
||||
}
|
||||
|
@ -2785,7 +2817,7 @@ static efi_status_t EFIAPI
|
|||
efi_uninstall_multiple_protocol_interfaces_int(efi_handle_t handle,
|
||||
efi_va_list argptr)
|
||||
{
|
||||
const efi_guid_t *protocol;
|
||||
const efi_guid_t *protocol, *next_protocol;
|
||||
void *protocol_interface;
|
||||
efi_status_t ret = EFI_SUCCESS;
|
||||
size_t i = 0;
|
||||
|
@ -2795,25 +2827,34 @@ efi_uninstall_multiple_protocol_interfaces_int(efi_handle_t handle,
|
|||
return EFI_INVALID_PARAMETER;
|
||||
|
||||
efi_va_copy(argptr_copy, argptr);
|
||||
protocol = efi_va_arg(argptr, efi_guid_t*);
|
||||
for (;;) {
|
||||
protocol = efi_va_arg(argptr, efi_guid_t*);
|
||||
/*
|
||||
* If efi_uninstall_protocol() fails we need to be able to
|
||||
* reinstall the previously uninstalled protocols on the same
|
||||
* handle.
|
||||
* Instead of calling efi_uninstall_protocol(...,..., false)
|
||||
* and potentially removing the handle, only allow the handle
|
||||
* removal on the last protocol that we requested to uninstall.
|
||||
* That way we can preserve the handle in case the latter fails
|
||||
*/
|
||||
bool preserve = true;
|
||||
|
||||
if (!protocol)
|
||||
break;
|
||||
protocol_interface = efi_va_arg(argptr, void*);
|
||||
next_protocol = efi_va_arg(argptr, efi_guid_t*);
|
||||
if (!next_protocol)
|
||||
preserve = false;
|
||||
ret = efi_uninstall_protocol(handle, protocol,
|
||||
protocol_interface);
|
||||
protocol_interface, preserve);
|
||||
if (ret != EFI_SUCCESS)
|
||||
break;
|
||||
i++;
|
||||
protocol = next_protocol;
|
||||
}
|
||||
if (ret == EFI_SUCCESS) {
|
||||
/* If the last protocol has been removed, delete the handle. */
|
||||
if (list_empty(&handle->protocols)) {
|
||||
list_del(&handle->link);
|
||||
free(handle);
|
||||
}
|
||||
if (ret == EFI_SUCCESS)
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* If an error occurred undo all changes. */
|
||||
for (; i; --i) {
|
||||
|
@ -3712,7 +3753,7 @@ static efi_status_t EFIAPI efi_reinstall_protocol_interface(
|
|||
new_interface);
|
||||
|
||||
/* Uninstall protocol but do not delete handle */
|
||||
ret = efi_uninstall_protocol(handle, protocol, old_interface);
|
||||
ret = efi_uninstall_protocol(handle, protocol, old_interface, true);
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto out;
|
||||
|
||||
|
|
|
@ -23,8 +23,10 @@ int hash_calculate(const char *name,
|
|||
struct hash_algo *algo;
|
||||
int ret = 0;
|
||||
void *ctx;
|
||||
uint32_t i;
|
||||
i = 0;
|
||||
int i;
|
||||
|
||||
if (region_count < 1)
|
||||
return -EINVAL;
|
||||
|
||||
ret = hash_progressive_lookup_algo(name, &algo);
|
||||
if (ret)
|
||||
|
|
|
@ -11,6 +11,14 @@ config OPTEE_IMAGE
|
|||
This option enable the OPTEE specific checks done before booting
|
||||
an OPTEE image created with mkimage
|
||||
|
||||
config OPTEE_TZDRAM_SIZE
|
||||
hex "Amount of Trust-Zone RAM for the OPTEE image"
|
||||
default 0x0000000
|
||||
depends on OPTEE_LIB
|
||||
help
|
||||
The size of pre-allocated Trust Zone DRAM to allocate for the OPTEE
|
||||
runtime.
|
||||
|
||||
config BOOTM_OPTEE
|
||||
bool "Support OPTEE bootm command"
|
||||
select BOOTM_LINUX
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
extern U_BOOT_DRIVER(bootmeth_cros);
|
||||
extern U_BOOT_DRIVER(bootmeth_script);
|
||||
extern U_BOOT_DRIVER(bootmeth_2script);
|
||||
|
||||
static int inject_response(struct unit_test_state *uts)
|
||||
{
|
||||
|
@ -532,7 +532,7 @@ static int prep_mmc_bootdev(struct unit_test_state *uts, const char *mmc_dev,
|
|||
|
||||
/* Enable the script bootmeth too */
|
||||
ut_assertok(uclass_first_device_err(UCLASS_BOOTSTD, &bootstd));
|
||||
ut_assertok(device_bind(bootstd, DM_DRIVER_REF(bootmeth_script),
|
||||
ut_assertok(device_bind(bootstd, DM_DRIVER_REF(bootmeth_2script),
|
||||
"bootmeth_script", 0, ofnode_null(), &dev));
|
||||
|
||||
/* Enable the cros bootmeth if needed */
|
||||
|
|
|
@ -126,8 +126,6 @@ controlled by a description in the board device tree.'''
|
|||
help='Comma-separated list of bintools to consider missing (for testing)')
|
||||
build_parser.add_argument('-i', '--image', type=str, action='append',
|
||||
help='Image filename to build (if not specified, build all)')
|
||||
build_parser.add_argument('--ignore-dup-phandles', action='store_true',
|
||||
help='Temporary option to ignore duplicate phandles')
|
||||
build_parser.add_argument('-I', '--indir', action='append',
|
||||
help='Add a path to the list of directories to use for input files')
|
||||
build_parser.add_argument('-m', '--map', action='store_true',
|
||||
|
|
|
@ -22,7 +22,6 @@ from binman import bintool
|
|||
from binman import cbfs_util
|
||||
from binman import elf
|
||||
from binman import entry
|
||||
from dtoc import fdt
|
||||
from dtoc import fdt_util
|
||||
from u_boot_pylib import command
|
||||
from u_boot_pylib import tools
|
||||
|
@ -817,10 +816,6 @@ def Binman(args):
|
|||
cbfs_util.VERBOSE = args.verbosity > 2
|
||||
state.use_fake_dtb = args.fake_dtb
|
||||
|
||||
# Temporary hack
|
||||
if args.ignore_dup_phandles: # pragma: no cover
|
||||
fdt.IGNORE_DUP_PHANDLES = True
|
||||
|
||||
# Normally we replace the 'u-boot' etype with 'u-boot-expanded', etc.
|
||||
# When running tests this can be disabled using this flag. When not
|
||||
# updating the FDT in image, it is not needed by binman, but we use it
|
||||
|
|
|
@ -15,9 +15,6 @@ from libfdt import QUIET_NOTFOUND
|
|||
from u_boot_pylib import tools
|
||||
from u_boot_pylib import tout
|
||||
|
||||
# Temporary hack
|
||||
IGNORE_DUP_PHANDLES = False
|
||||
|
||||
# This deals with a device tree, presenting it as an assortment of Node and
|
||||
# Prop objects, representing nodes and properties, respectively. This file
|
||||
# contains the base classes and defines the high-level API. You can use
|
||||
|
@ -342,11 +339,10 @@ class Node:
|
|||
if phandle:
|
||||
dup = self._fdt.phandle_to_node.get(phandle)
|
||||
if dup:
|
||||
if not IGNORE_DUP_PHANDLES:
|
||||
raise ValueError(
|
||||
f'Duplicate phandle {phandle} in nodes {dup.path} and {self.path}')
|
||||
else:
|
||||
self._fdt.phandle_to_node[phandle] = self
|
||||
raise ValueError(
|
||||
f'Duplicate phandle {phandle} in nodes {dup.path} and {self.path}')
|
||||
|
||||
self._fdt.phandle_to_node[phandle] = self
|
||||
|
||||
offset = fdt_obj.first_subnode(self.Offset(), QUIET_NOTFOUND)
|
||||
while offset >= 0:
|
||||
|
|
Loading…
Reference in a new issue