Prepare v2021.04-rc5

-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmBiRbMACgkQFHw5/5Y0
 tyz0KAv/T8glQGL6L2CYeLuwbs9tndQoaH2YNb3teNUJrqehBleJAQ6ubHP30d87
 rHrokJ4Zu3TC15sACrK4GOMvsAVkeCuU/jIqFJA4ieDZr8g7yfUMOZMsDiIFdd36
 Rdmi71Jtek/csyS5BfcUUYoXVbUCGQ8yAx7z0VrK0sqsqZYYJNwPmqgkR8U2ulNb
 FiLxwamFwH7+bsvcvHajO1dOyko0zR7GTisf/fOgmlHuF3BldqG4SDcNd528uEWb
 r3fXs2Ut6IaC/beCnmKUPVG3ZjdPtb+T230rRRhUOfjTwqR7SzXp5bTyzdgyw3gU
 rOgfi/mAGQPPG2E2fzPz0JCI1irbnkSE2fVJ4epaVUCoHIEsQQdy034aD3qLcHFY
 65ihEpRvCM7s9jfKX8XeIG4rKFB4i60TX5orzdMvx7wV3rxmPE9qQmF9lkD+fEA+
 TPuFtkjGmluSe+xWBVK7+6xuF6rcLEbNXuFWRi3qMSMgH8rtGfeJRonusOGPolwC
 jQ1T7szW
 =UJ/O
 -----END PGP SIGNATURE-----

Merge tag 'v2021.04-rc5' into next

Prepare v2021.04-rc5
This commit is contained in:
Tom Rini 2021-03-29 17:53:19 -04:00
commit 1057b1be75
45 changed files with 712 additions and 619 deletions

View file

@ -23,7 +23,7 @@ jobs:
%CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syyuu"
displayName: 'Update MSYS2'
- script: |
%CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm --needed -S make gcc bison flex diffutils openssl-devel"
%CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm --needed -Sy make gcc bison flex diffutils openssl-devel"
displayName: 'Install Toolchain'
- script: |
echo make tools-only_defconfig tools-only NO_SDL=1 > build-tools.sh

View file

@ -670,6 +670,7 @@ F: common/dfu.c
F: common/update.c
F: common/usb_storage.c
F: doc/api/dfu.rst
F: doc/usage/dfu.rst
F: drivers/dfu/
F: drivers/usb/gadget/
F: include/dfu.h

163
Makefile
View file

@ -3,7 +3,7 @@
VERSION = 2021
PATCHLEVEL = 04
SUBLEVEL =
EXTRAVERSION = -rc4
EXTRAVERSION = -rc5
NAME =
# *DOCUMENTATION*
@ -328,11 +328,6 @@ HOSTCC = $(call os_x_before, 10, 5, "cc", "gcc")
KBUILD_HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp")
KBUILD_HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress")
# since Lion (10.7) ASLR is on by default, but we use linker generated lists
# in some host tools which is a problem then ... so disable ASLR for these
# tools
KBUILD_HOSTLDFLAGS += $(call os_x_before, 10, 7, "", "-Xlinker -no_pie")
# macOS Mojave (10.14.X)
# Undefined symbols for architecture x86_64: "_PyArg_ParseTuple"
KBUILD_HOSTLDFLAGS += $(call os_x_after, 10, 14, "-lpython -dynamclib", "")
@ -1021,6 +1016,33 @@ quiet_cmd_cfgcheck = CFGCHK $2
cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \
$(srctree)/scripts/config_whitelist.txt $(srctree)
# Concat the value of all the CONFIGs (result is 'y' or 'yy', etc. )
got = $(foreach cfg,$(1),$($(cfg)))
# expected value 'y for each one
expect = $(foreach cfg,$(1),y)
# Show a deprecation message
# Args:
# 1: List of CONFIG_DM_... to migrate to (e.g. "CONFIG_DM_MMC CONFIG_BLK")
# 2: Name of component (e.g . "Ethernet drivers")
# 3: Release deadline (e.g. "v202.07")
# 4: Condition to require before checking (e.g. "$(CONFIG_NET)")
# Note: Script avoids bash construct, hence the strange double 'if'
# (patches welcome!)
define deprecated
if [ -n "$(strip $(4))" ]; then if [ "$(got)" != "$(expect)" ]; then \
echo >&2 "===================== WARNING ======================"; \
echo >&2 "This board does not use $(firstword $(1)) (Driver Model"; \
echo >&2 "for $(2)). Please update the board to use"; \
echo >&2 "$(firstword $(1)) before the $(3) release. Failure to"; \
echo >&2 "update by the deadline may result in board removal."; \
echo >&2 "See doc/driver-model/migration.rst for more info."; \
echo >&2 "===================================================="; \
fi; fi
endef
PHONY += inputs
inputs: $(INPUTS-y)
@ -1035,80 +1057,6 @@ endif
ifeq ($(CONFIG_DEPRECATED),y)
$(warning "You have deprecated configuration options enabled in your .config! Please check your configuration.")
ifeq ($(CONFIG_SPI),y)
ifneq ($(CONFIG_DM_SPI)$(CONFIG_OF_CONTROL),yy)
$(warning "The relevant config item with associated code will remove in v2019.07 release.")
endif
endif
endif
ifneq ($(CONFIG_DM),y)
@echo >&2 "===================== WARNING ======================"
@echo >&2 "This board does not use CONFIG_DM. CONFIG_DM will be"
@echo >&2 "compulsory starting with the v2020.01 release."
@echo >&2 "Failure to update may result in board removal."
@echo >&2 "See doc/driver-model/migration.rst for more info."
@echo >&2 "===================================================="
endif
ifeq ($(CONFIG_MMC),y)
ifneq ($(CONFIG_DM_MMC)$(CONFIG_BLK),yy)
@echo >&2 "===================== WARNING ======================"
@echo >&2 "This board does not use CONFIG_DM_MMC. Please update"
@echo >&2 "the board to use CONFIG_DM_MMC before the v2019.04 release."
@echo >&2 "Failure to update by the deadline may result in board removal."
@echo >&2 "See doc/driver-model/migration.rst for more info."
@echo >&2 "===================================================="
endif
endif
ifeq ($(CONFIG_USB),y)
ifneq ($(CONFIG_DM_USB)$(CONFIG_OF_CONTROL)$(CONFIG_BLK),yyy)
@echo >&2 "===================== WARNING ======================"
@echo >&2 "This board does not use CONFIG_DM_USB. Please update"
@echo >&2 "the board to use CONFIG_DM_USB before the v2019.07 release."
@echo >&2 "Failure to update by the deadline may result in board removal."
@echo >&2 "See doc/driver-model/migration.rst for more info."
@echo >&2 "===================================================="
endif
endif
ifeq ($(CONFIG_MVSATA_IDE),y)
@echo >&2 "===================== WARNING ======================"
@echo >&2 "This board does use CONFIG_MVSATA_IDE which is not"
@echo >&2 "ported to driver-model (DM) yet. Please update the storage"
@echo >&2 "controller driver to use CONFIG_AHCI before the v2019.07"
@echo >&2 "release."
@echo >&2 "Failure to update by the deadline may result in board removal."
@echo >&2 "See doc/driver-model/migration.rst for more info."
@echo >&2 "===================================================="
endif
ifeq ($(CONFIG_LIBATA),y)
ifneq ($(CONFIG_AHCI),y)
@echo >&2 "===================== WARNING ======================"
@echo >&2 "This board does use CONFIG_LIBATA but has CONFIG_AHCI not"
@echo >&2 "enabled. Please update the storage controller driver to use"
@echo >&2 "CONFIG_AHCI before the v2019.07 release."
@echo >&2 "Failure to update by the deadline may result in board removal."
@echo >&2 "See doc/driver-model/migration.rst for more info."
@echo >&2 "===================================================="
endif
endif
ifeq ($(CONFIG_PCI),y)
ifneq ($(CONFIG_DM_PCI),y)
@echo >&2 "===================== WARNING ======================"
@echo >&2 "This board does not use CONFIG_DM_PCI Please update"
@echo >&2 "the board to use CONFIG_DM_PCI before the v2019.07 release."
@echo >&2 "Failure to update by the deadline may result in board removal."
@echo >&2 "See doc/driver-model/migration.rst for more info."
@echo >&2 "===================================================="
endif
endif
ifneq ($(CONFIG_LCD)$(CONFIG_VIDEO),)
ifneq ($(CONFIG_DM_VIDEO),y)
@echo >&2 "===================== WARNING ======================"
@echo >&2 "This board does not use CONFIG_DM_VIDEO Please update"
@echo >&2 "the board to use CONFIG_DM_VIDEO before the v2019.07 release."
@echo >&2 "Failure to update by the deadline may result in board removal."
@echo >&2 "See doc/driver-model/migration.rst for more info."
@echo >&2 "===================================================="
endif
endif
ifeq ($(CONFIG_OF_EMBED),y)
@echo >&2 "===================== WARNING ======================"
@ -1118,38 +1066,6 @@ ifeq ($(CONFIG_OF_EMBED),y)
@echo >&2 "See doc/README.fdt-control for more info."
@echo >&2 "===================================================="
endif
ifeq ($(CONFIG_SPI_FLASH),y)
ifneq ($(CONFIG_DM_SPI_FLASH)$(CONFIG_OF_CONTROL),yy)
@echo >&2 "===================== WARNING ======================"
@echo >&2 "This board does not use CONFIG_DM_SPI_FLASH. Please update"
@echo >&2 "the board to use CONFIG_SPI_FLASH before the v2019.07 release."
@echo >&2 "Failure to update by the deadline may result in board removal."
@echo >&2 "See doc/driver-model/migration.rst for more info."
@echo >&2 "===================================================="
endif
endif
ifneq ($(CONFIG_WATCHDOG)$(CONFIG_HW_WATCHDOG),)
ifneq ($(CONFIG_WDT),y)
@echo >&2 "===================== WARNING ======================"
@echo >&2 "This board does not use CONFIG_WDT (DM watchdog support)."
@echo >&2 "Please update the board to use CONFIG_WDT before the"
@echo >&2 "v2019.10 release."
@echo >&2 "Failure to update by the deadline may result in board removal."
@echo >&2 "See doc/driver-model/migration.rst for more info."
@echo >&2 "===================================================="
endif
endif
ifneq ($(CONFIG_NET),)
ifneq ($(CONFIG_DM_ETH),y)
@echo >&2 "===================== WARNING ======================"
@echo >&2 "This board does not use CONFIG_DM_ETH (Driver Model"
@echo >&2 "for Ethernet drivers). Please update the board to use"
@echo >&2 "CONFIG_DM_ETH before the v2020.07 release. Failure to"
@echo >&2 "update by the deadline may result in board removal."
@echo >&2 "See doc/driver-model/migration.rst for more info."
@echo >&2 "===================================================="
endif
endif
ifneq ($(CONFIG_SPL_FIT_GENERATOR),)
@echo >&2 "===================== WARNING ======================"
@echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate"
@ -1157,6 +1073,29 @@ ifneq ($(CONFIG_SPL_FIT_GENERATOR),)
@echo >&2 "arch-specific scripts with no tests."
@echo >&2 "===================================================="
endif
ifneq ($(CONFIG_DM),y)
@echo >&2 "===================== WARNING ======================"
@echo >&2 "This board does not use CONFIG_DM. CONFIG_DM will be"
@echo >&2 "compulsory starting with the v2020.01 release."
@echo >&2 "Failure to update may result in board removal."
@echo >&2 "See doc/driver-model/migration.rst for more info."
@echo >&2 "===================================================="
endif
$(call deprecated,CONFIG_DM_MMC CONFIG_BLK,MMC,v2019.04,$(CONFIG_MMC))
$(call deprecated,CONFIG_DM_USB CONFIG_OF_CONTROL CONFIG_BLK,\
USB,v2019.07,$(CONFIG_USB))
$(call deprecated,CONFIG_AHCI,AHCI instead of CONFIG_MVSATA_IDE,v2019.07, \
$(CONFIG_MVSATA_IDE))
$(call deprecated,CONFIG_AHCI,AHCI,v2019.07, $(CONFIG_LIBATA))
$(call deprecated,CONFIG_DM_PCI,PCI,v2019.07,$(CONFIG_PCI))
$(call deprecated,CONFIG_DM_VIDEO,video,v2019.07,\
$(CONFIG_LCD)$(CONFIG_VIDEO))
$(call deprecated,CONFIG_DM_SPI_FLASH,SPI flash,v2019.07,\
$(CONFIG_SPI_FLASH))
$(call deprecated,CONFIG_WDT,DM watchdog,v2019.10,\
$(CONFIG_WATCHDOG)$(CONFIG_HW_WATCHDOG))
$(call deprecated,CONFIG_DM_ETH,Ethernet drivers,v2020.07,$(CONFIG_NET))
$(call deprecated,CONFIG_DM_I2C,I2C drivers,v2022.04,$(CONFIG_I2C))
@# Check that this build does not use CONFIG options that we do not
@# know about unless they are in Kconfig. All the existing CONFIG
@# options are whitelisted, so new ones should not be added.

View file

@ -115,7 +115,8 @@ void board_fit_image_post_process(void **p_image, size_t *p_size)
#if !IS_ENABLED(CONFIG_SPL_BUILD) && IS_ENABLED(CONFIG_FIT)
void board_prep_linux(bootm_headers_t *images)
{
if (!IS_ENABLED(CONFIG_SECURE_VAB_AUTH_ALLOW_NON_FIT_IMAGE)) {
if (IS_ENABLED(CONFIG_SOCFPGA_SECURE_VAB_AUTH) &&
!IS_ENABLED(CONFIG_SOCFPGA_SECURE_VAB_AUTH_ALLOW_NON_FIT_IMAGE)) {
/*
* Ensure the OS is always booted from FIT and with
* VAB signed certificate

View file

@ -30,3 +30,11 @@
spi-max-frequency = <10000000>; /* input clock */
};
};
&i2c0 {
status = "okay";
rtc@68 {
compatible = "dallas,ds1339";
reg = <0x68>;
};
};

View file

@ -34,6 +34,11 @@ T2080 includes the following functions and features:
- Support for hardware virtualization and partitioning enforcement
- QorIQ Platform's Trust Architecture 2.0
User Guide
----------
The T2080RDB User Guide is available on the web at
https://www.nxp.com/docs/en/user-guide/T2080RDBPCUG.pdf
Differences between T2080 and T2081
-----------------------------------
Feature T2080 T2081

View file

@ -369,7 +369,7 @@ static struct mmc_part *get_partition(AvbOps *ops, const char *partition)
}
ret = part_get_info_by_name(mmc_blk, partition, &part->info);
if (!ret) {
if (ret < 0) {
printf("Can't find partition '%s'\n", partition);
goto err;
}

View file

@ -1655,7 +1655,7 @@ int fit_check_format(const void *fit, ulong size)
/* mandatory / node 'timestamp' property */
if (!fdt_getprop(fit, 0, FIT_TIMESTAMP_PROP, NULL)) {
log_debug("Wrong FIT format: no timestamp\n");
return -ENODATA;
return -EBADMSG;
}
}

View file

@ -77,6 +77,8 @@ CONFIG_DM_PCI=y
CONFIG_DM_PCI_COMPAT=y
CONFIG_PCIE_FSL=y
CONFIG_SYS_QE_FMAN_FW_IN_NAND=y
CONFIG_DM_RTC=y
CONFIG_RTC_DS1307=y
CONFIG_SYS_NS16550=y
CONFIG_SPI=y
CONFIG_DM_SPI=y

View file

@ -74,6 +74,8 @@ CONFIG_DM_PCI=y
CONFIG_DM_PCI_COMPAT=y
CONFIG_PCIE_FSL=y
CONFIG_SYS_QE_FMAN_FW_IN_MMC=y
CONFIG_DM_RTC=y
CONFIG_RTC_DS1307=y
CONFIG_SYS_NS16550=y
CONFIG_SPI=y
CONFIG_DM_SPI=y

View file

@ -76,6 +76,8 @@ CONFIG_DM_PCI=y
CONFIG_DM_PCI_COMPAT=y
CONFIG_PCIE_FSL=y
CONFIG_SYS_QE_FMAN_FW_IN_SPIFLASH=y
CONFIG_DM_RTC=y
CONFIG_RTC_DS1307=y
CONFIG_SYS_NS16550=y
CONFIG_SPI=y
CONFIG_DM_SPI=y

View file

@ -61,6 +61,8 @@ CONFIG_DM_PCI=y
CONFIG_DM_PCI_COMPAT=y
CONFIG_PCIE_FSL=y
CONFIG_SYS_QE_FMAN_FW_IN_NOR=y
CONFIG_DM_RTC=y
CONFIG_RTC_DS1307=y
CONFIG_SYS_NS16550=y
CONFIG_SPI=y
CONFIG_DM_SPI=y

View file

@ -70,7 +70,7 @@ CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
CONFIG_I2C_DEFAULT_BUS_NUMBER=0
CONFIG_I2C_MUX=y
CONFIG_DM_MMC=y
CONFIG_MMC_HS400_SUPPORT=y
CONFIG_MMC_HS200_SUPPORT=y
CONFIG_FSL_ESDHC=y
CONFIG_FSL_ESDHC_SUPPORT_ADMA2=y
CONFIG_DM_SPI_FLASH=y

View file

@ -49,8 +49,9 @@ CONFIG_DM_MMC=y
CONFIG_FSL_ESDHC=y
CONFIG_MTD=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH_SPANSION=y
CONFIG_SPI_FLASH_EON=y
CONFIG_SPI_FLASH_STMICRO=y
CONFIG_SPI_FLASH_SST=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
CONFIG_PHYLIB=y
CONFIG_PHY_AQUANTIA=y

View file

@ -8,7 +8,7 @@ CONFIG_SYS_MEMTEST_START=0x80000000
CONFIG_SYS_MEMTEST_END=0x9fffffff
CONFIG_ENV_SIZE=0x2000
CONFIG_ENV_OFFSET=0x500000
CONFIG_ENV_SECT_SIZE=0x40000
CONFIG_ENV_SECT_SIZE=0x20000
CONFIG_DM_GPIO=y
CONFIG_FSPI_AHB_EN_4BYTE=y
CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
@ -55,8 +55,9 @@ CONFIG_DM_MMC=y
CONFIG_FSL_ESDHC=y
CONFIG_MTD=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH_SPANSION=y
CONFIG_SPI_FLASH_EON=y
CONFIG_SPI_FLASH_STMICRO=y
CONFIG_SPI_FLASH_SST=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
CONFIG_PHYLIB=y
CONFIG_PHY_AQUANTIA=y

View file

@ -7,7 +7,7 @@ CONFIG_SYS_MEMTEST_START=0x80000000
CONFIG_SYS_MEMTEST_END=0x9fffffff
CONFIG_ENV_SIZE=0x2000
CONFIG_ENV_OFFSET=0x500000
CONFIG_ENV_SECT_SIZE=0x40000
CONFIG_ENV_SECT_SIZE=0x20000
CONFIG_DM_GPIO=y
CONFIG_FSPI_AHB_EN_4BYTE=y
CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
@ -55,8 +55,9 @@ CONFIG_DM_MMC=y
CONFIG_FSL_ESDHC=y
CONFIG_MTD=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH_SPANSION=y
CONFIG_SPI_FLASH_EON=y
CONFIG_SPI_FLASH_STMICRO=y
CONFIG_SPI_FLASH_SST=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
CONFIG_PHYLIB=y
CONFIG_PHY_AQUANTIA=y

View file

@ -48,7 +48,6 @@ CONFIG_DM_MMC=y
CONFIG_FSL_ESDHC=y
CONFIG_MTD=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH_SPANSION=y
CONFIG_SPI_FLASH_STMICRO=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
CONFIG_PHYLIB=y

View file

@ -8,7 +8,7 @@ CONFIG_SYS_MEMTEST_START=0x80000000
CONFIG_SYS_MEMTEST_END=0x9fffffff
CONFIG_ENV_SIZE=0x2000
CONFIG_ENV_OFFSET=0x500000
CONFIG_ENV_SECT_SIZE=0x40000
CONFIG_ENV_SECT_SIZE=0x20000
CONFIG_DM_GPIO=y
CONFIG_FSPI_AHB_EN_4BYTE=y
CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
@ -54,7 +54,6 @@ CONFIG_DM_MMC=y
CONFIG_FSL_ESDHC=y
CONFIG_MTD=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH_SPANSION=y
CONFIG_SPI_FLASH_STMICRO=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
CONFIG_PHYLIB=y

View file

@ -50,7 +50,6 @@ CONFIG_FSL_ESDHC=y
CONFIG_MTD=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH_EON=y
CONFIG_SPI_FLASH_SPANSION=y
CONFIG_SPI_FLASH_STMICRO=y
CONFIG_SPI_FLASH_SST=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set

View file

@ -57,7 +57,6 @@ CONFIG_FSL_ESDHC=y
CONFIG_MTD=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH_EON=y
CONFIG_SPI_FLASH_SPANSION=y
CONFIG_SPI_FLASH_STMICRO=y
CONFIG_SPI_FLASH_SST=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set

View file

@ -46,7 +46,6 @@ CONFIG_MMC_HS400_SUPPORT=y
CONFIG_FSL_ESDHC=y
CONFIG_MTD=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH_SPANSION=y
CONFIG_SPI_FLASH_STMICRO=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
CONFIG_PHYLIB=y

View file

@ -55,7 +55,6 @@ CONFIG_MMC_HS400_SUPPORT=y
CONFIG_FSL_ESDHC=y
CONFIG_MTD=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH_SPANSION=y
CONFIG_SPI_FLASH_STMICRO=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
CONFIG_PHYLIB=y

View file

@ -55,7 +55,6 @@ CONFIG_MMC_HS400_SUPPORT=y
CONFIG_FSL_ESDHC=y
CONFIG_MTD=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH_SPANSION=y
CONFIG_SPI_FLASH_STMICRO=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
CONFIG_PHYLIB=y

View file

@ -1,311 +0,0 @@
# SPDX-License-Identifier: GPL-2.0+
Device Firmware Upgrade (DFU)
Overview:
The Device Firmware Upgrade (DFU) allows to download and upload firmware
to/from U-Boot connected over USB.
U-boot follows the Universal Serial Bus Device Class Specification for
Device Firmware Upgrade Version 1.1 the USB forum (DFU v1.1 in www.usb.org).
U-Boot implements this DFU capability (CONFIG_DFU) with the command dfu
(cmd/dfu.c / CONFIG_CMD_DFU) based on:
- the DFU stack (common/dfu.c and common/spl/spl_dfu.c), based on the
USB DFU download gadget (drivers/usb/gadget/f_dfu.c)
- The access to mediums is done in DFU backends (driver/dfu)
Today the supported DFU backends are:
- MMC (RAW or FAT / EXT2 / EXT3 / EXT4 file system / SKIP / SCRIPT)
- NAND
- RAM
- SF (serial flash)
- MTD (all MTD device: NAND, SPI-NOR, SPI-NAND,...)
- virtual
These DFU backends are also used by
- the dfutftp (see README.dfutftp)
- the thordown command (cmd/thordown.c and gadget/f_thor.c)
The "virtual" backend is a generic DFU backend to support a board specific
target (for example OTP), only based on the weak functions:
- dfu_write_medium_virt
- dfu_get_medium_size_virt
- dfu_read_medium_virt
Configuration Options:
CONFIG_DFU
CONFIG_DFU_OVER_USB
CONFIG_DFU_MMC
CONFIG_DFU_MTD
CONFIG_DFU_NAND
CONFIG_DFU_RAM
CONFIG_DFU_SF
CONFIG_DFU_SF_PART
CONFIG_DFU_TIMEOUT
CONFIG_DFU_VIRTUAL
CONFIG_CMD_DFU
Environment variables:
the dfu command uses 3 environments variables:
"dfu_alt_info" : the DFU setting for the USB download gadget with a semicolon
separated string of information on each alternate:
dfu_alt_info="<alt1>;<alt2>;....;<altN>"
when several devices are used, the format is:
- <interface> <dev>'='alternate list (';' separated)
- each interface is separated by '&'
dfu_alt_info=\
"<interface1> <dev1>=<alt1>;....;<altN>&"\
"<interface2> <dev2>=<altN+1>;....;<altM>&"\
...\
"<interfaceI> <devI>=<altY+1>;....;<altZ>&"
"dfu_bufsiz" : size of the DFU buffer, when absent, use
CONFIG_SYS_DFU_DATA_BUF_SIZE (8 MiB by default)
"dfu_hash_algo" : name of the hash algorithm to use
Commands:
dfu <USB_controller> [<interface> <dev>] list
list the alternate device defined in "dfu_alt_info"
dfu <USB_controller> [<interface> <dev>] [<timeout>]
start the dfu stack on the USB instance with the selected medium
backend and use the "dfu_alt_info" variable to configure the
alternate setting and link each one with the medium
The dfu command continue until receive a ^C in console or
a DFU detach transaction from HOST. If CONFIG_DFU_TIMEOUT option
is enabled and <timeout> parameter is present in the command line,
the DFU operation will be aborted automatically after <timeout>
seconds of waiting remote to initiate DFU session.
The possible values of <interface> are :
(with <USB controller> = 0 in the dfu command example)
"mmc" (for eMMC and SD card)
cmd: dfu 0 mmc <dev>
each element in "dfu_alt_info" =
<name> raw <offset> <size> [mmcpart <num>] raw access to mmc device
<name> part <dev> <part_id> [mmcpart <num>] raw access to partition
<name> fat <dev> <part_id> [mmcpart <num>] file in FAT partition
<name> ext4 <dev> <part_id> [mmcpart <num>] file in EXT4 partition
<name> skip 0 0 ignore flashed data
<name> script 0 0 execute commands in shell
with <partid> being the GPT or DOS partition index,
with <num> being the eMMC hardware partition number.
A value of environment variable dfu_alt_info for eMMC could be:
"u-boot raw 0x3e 0x800 mmcpart 1;bl2 raw 0x1e 0x1d mmcpart 1"
A value of environment variable dfu_alt_info for SD card could be:
"u-boot raw 0x80 0x800;uImage ext4 0 2"
If don't want to flash given image file to storage, use "skip" type
entity.
- It can be used to protect flashing wrong image for the specific board.
- Especailly, this layout will be useful when thor protocol is used,
which performs flashing in batch mode, where more than one file is
processed.
For example, if one makes a single tar file with support for the two
boards with u-boot-<board1>.bin and u-boot-<board2>.bin files, one
can use it to flash a proper u-boot image on both without a failure:
"u-boot-<board1>.bin raw 0x80 0x800; u-boot-<board2>.bin skip 0 0"
When flashing new system image requires do some more complex things
than just writing data to the storage medium, one can use 'script'
type. Data written to such entity will be executed as a command list
in the u-boot's shell. This for example allows to re-create partition
layout and even set new dfu_alt_info for the newly created paritions.
Such script would look like:
--->8---
setenv dfu_alt_info ...
setenv mbr_parts ...
mbr write ...
--->8---
Please note that this means that user will be able to execute any
arbitrary commands just like in the u-boot's shell.
"nand" (raw slc nand device)
cmd: dfu 0 nand <dev>
each element in "dfu_alt_info" =
<name> raw <offset> <size> raw access to mmc device
<name> part <dev> <part_id> raw acces to partition
<name> partubi <dev> <part_id> raw acces to ubi partition
with <partid> is the MTD partition index
"ram"
cmd: dfu 0 ram <dev>
(<dev> is not used for RAM target)
each element in "dfu_alt_info" =
<name> ram <offset> <size> raw access to ram
"sf" (serial flash : NOR)
cmd: dfu 0 sf <dev>
each element in "dfu_alt_info" =
<name> raw <offset> <size> raw access to sf device
<name> part <dev> <part_id> raw acces to partition
<name> partubi <dev> <part_id> raw acces to ubi partition
with <partid> is the MTD partition index
"mtd" (all MTD device: NAND, SPI-NOR, SPI-NAND,...)
cmd: dfu 0 mtd <dev>
with <dev> the mtd identifier as defined in mtd command
(nand0, nor0, spi-nand0,...)
each element in "dfu_alt_info" =
<name> raw <offset> <size> raw access to mtd device
<name> part <dev> <part_id> raw acces to partition
<name> partubi <dev> <part_id> raw acces to ubi partition
with <partid> is the MTD partition index
"virt"
cmd: dfu 0 virt <dev>
each element in "dfu_alt_info" =
<name>
<interface> and <dev> are absent:
the dfu command to use multiple devices
cmd: dfu 0 list
cmd: dfu 0
"dfu_alt_info" variable provides the list of <interface> <dev> with
alternate list separated by '&' with the same format for each <alt>
mmc <dev>=<alt1>;....;<altN>
nand <dev>=<alt1>;....;<altN>
ram <dev>=<alt1>;....;<altN>
sf <dev>=<alt1>;....;<altN>
mtd <dev>=<alt1>;....;<altN>
virt <dev>=<alt1>;....;<altN>
Callbacks:
The weak callback functions can be implemented to manage specific behavior
- dfu_initiated_callback : called when the DFU transaction is started,
used to initiase the device
- dfu_flush_callback : called at the end of the DFU write after DFU
manifestation, used to manage the device when
DFU transaction is closed
Host tools:
When U-Boot runs the dfu stack, the DFU host tools can be used
to send/receive firmwares on each configurated alternate.
For example dfu-util is a host side implementation of the DFU 1.1
specifications(http://dfu-util.sourceforge.net/) which works with U-Boot.
Usage:
Example 1: firmware located in eMMC or SD card, with:
- alternate 1 (alt=1) for SPL partition (GPT partition 1)
- alternate 2 (alt=2) for U-Boot partition (GPT partition 2)
The U-Boot configuration is:
U-Boot> env set dfu_alt_info "spl part 0 1;u-boot part 0 2"
U-Boot> dfu 0 mmc 0 list
DFU alt settings list:
dev: eMMC alt: 0 name: spl layout: RAW_ADDR
dev: eMMC alt: 1 name: u-boot layout: RAW_ADDR
Boot> dfu 0 mmc 0
On the Host side:
list the available alternate setting:
$> dfu-util -l
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Found DFU: [0483:5720] ver=0200, devnum=45, cfg=1, intf=0, path="3-1.3.1", \
alt=1, name="u-boot", serial="003A00203438510D36383238"
Found DFU: [0483:5720] ver=0200, devnum=45, cfg=1, intf=0, path="3-1.3.1", \
alt=0, name="spl", serial="003A00203438510D36383238"
To download to U-Boot, use -D option
$> dfu-util -a 0 -D u-boot-spl.bin
$> dfu-util -a 1 -D u-boot.bin
To upload from U-Boot, use -U option
$> dfu-util -a 0 -U u-boot-spl.bin
$> dfu-util -a 1 -U u-boot.bin
To request a DFU detach and reset the USB connection:
$> dfu-util -a 0 -e -R
Example 2: firmware located in NOR (sf) and NAND, with:
- alternate 1 (alt=1) for SPL partition (NOR GPT partition 1)
- alternate 2 (alt=2) for U-Boot partition (NOR GPT partition 2)
- alternate 3 (alt=3) for U-Boot-env partition (NOR GPT partition 3)
- alternate 4 (alt=4) for UBI partition (NAND GPT partition 1)
U-Boot> env set dfu_alt_info \
"sf 0:0:10000000:0=spl part 0 1;u-boot part 0 2; \
u-boot-env part 0 3&nand 0=UBI partubi 0,1"
U-Boot> dfu 0 list
DFU alt settings list:
dev: SF alt: 0 name: spl layout: RAW_ADDR
dev: SF alt: 1 name: ssbl layout: RAW_ADDR
dev: SF alt: 2 name: u-boot-env layout: RAW_ADDR
dev: NAND alt: 3 name: UBI layout: RAW_ADDR
U-Boot> dfu 0
$> dfu-util -l
Found DFU: [0483:5720] ver=9999, devnum=96, cfg=1,\
intf=0, alt=3, name="UBI", serial="002700333338511934383330"
Found DFU: [0483:5720] ver=9999, devnum=96, cfg=1,\
intf=0, alt=2, name="u-boot-env", serial="002700333338511934383330"
Found DFU: [0483:5720] ver=9999, devnum=96, cfg=1,\
intf=0, alt=1, name="u-boot", serial="002700333338511934383330"
Found DFU: [0483:5720] ver=9999, devnum=96, cfg=1,\
intf=0, alt=0, name="spl", serial="002700333338511934383330"
Same example with MTD backend
U-Boot> env set dfu_alt_info \
"mtd nor0=spl part 1;u-boot part 2;u-boot-env part 3&"\
"mtd nand0=UBI partubi 1"
U-Boot> dfu 0 list
using id 'nor0,0'
using id 'nor0,1'
using id 'nor0,2'
using id 'nand0,0'
DFU alt settings list:
dev: MTD alt: 0 name: spl layout: RAW_ADDR
dev: MTD alt: 1 name: u-boot layout: RAW_ADDR
dev: MTD alt: 2 name: u-boot-env layout: RAW_ADDR
dev: MTD alt: 3 name: UBI layout: RAW_ADDR
Example 3: firmware located in SD Card (mmc) and virtual partition on
OTP and PMIC not volatile memory
- alternate 1 (alt=1) for scard
- alternate 2 (alt=2) for OTP (virtual)
- alternate 3 (alt=3) for PMIC NVM (virtual)
U-Boot> env set dfu_alt_info \
"mmc 0=sdcard raw 0 0x100000&"\
"virt 0=otp" \
"virt 1=pmic"
U-Boot> dfu 0 list
DFU alt settings list:
dev: eMMC alt: 0 name: sdcard layout: RAW_ADDR
dev: VIRT alt: 1 name: otp layout: RAW_ADDR
dev: VIRT alt: 2 name: pmic layout: RAW_ADDR

View file

@ -99,3 +99,11 @@ Deadline: 2020.07
The network subsystem has supported the driver model since early 2015.
Maintainers should submit patches switching over to using CONFIG_DM_ETH and
other base driver model options in time for inclusion in the 2020.07 release.
CONFIG_DM_I2C
-------------
Deadline: 2021.10
The I2C subsystem has supported the driver model since early 2015.
Maintainers should submit patches switching over to using CONFIG_DM_I2C and
other base driver model options in time for inclusion in the 2021.10 release.

404
doc/usage/dfu.rst Normal file
View file

@ -0,0 +1,404 @@
.. SPDX-License-Identifier: GPL-2.0+
Device Firmware Upgrade (DFU)
=============================
Overview
--------
The Device Firmware Upgrade (DFU) allows to download and upload firmware
to/from U-Boot connected over USB.
U-boot follows the Universal Serial Bus Device Class Specification for
Device Firmware Upgrade Version 1.1 the USB forum (DFU v1.1 in www.usb.org).
U-Boot implements this DFU capability (CONFIG_DFU) with the command dfu
(cmd/dfu.c / CONFIG_CMD_DFU) based on:
- the DFU stack (common/dfu.c and common/spl/spl_dfu.c), based on the
USB DFU download gadget (drivers/usb/gadget/f_dfu.c)
- The access to mediums is done in DFU backends (driver/dfu)
Today the supported DFU backends are:
- MMC (RAW or FAT / EXT2 / EXT3 / EXT4 file system / SKIP / SCRIPT)
- NAND
- RAM
- SF (serial flash)
- MTD (all MTD device: NAND, SPI-NOR, SPI-NAND,...)
- virtual
These DFU backends are also used by
- the dfutftp (see README.dfutftp)
- the thordown command (cmd/thordown.c and gadget/f_thor.c)
The "virtual" backend is a generic DFU backend to support a board specific
target (for example OTP), only based on the weak functions:
- dfu_write_medium_virt
- dfu_get_medium_size_virt
- dfu_read_medium_virt
Configuration Options
---------------------
The following configuration option are relevant for device firmware upgrade:
* CONFIG_DFU
* CONFIG_DFU_OVER_USB
* CONFIG_DFU_MMC
* CONFIG_DFU_MTD
* CONFIG_DFU_NAND
* CONFIG_DFU_RAM
* CONFIG_DFU_SF
* CONFIG_DFU_SF_PART
* CONFIG_DFU_TIMEOUT
* CONFIG_DFU_VIRTUAL
* CONFIG_CMD_DFU
Environment variables
---------------------
The dfu command uses 3 environments variables:
dfu_alt_info
The DFU setting for the USB download gadget with a semicolon separated
string of information on each alternate::
dfu_alt_info="<alt1>;<alt2>;....;<altN>"
When several devices are used, the format is:
- <interface> <dev>'='alternate list (';' separated)
- each interface is separated by '&'::
dfu_alt_info=\
"<interface1> <dev1>=<alt1>;....;<altN>&"\
"<interface2> <dev2>=<altN+1>;....;<altM>&"\
...\
"<interfaceI> <devI>=<altY+1>;....;<altZ>&"
dfu_bufsiz
size of the DFU buffer, when absent, defaults to
CONFIG_SYS_DFU_DATA_BUF_SIZE (8 MiB by default)
dfu_hash_algo
name of the hash algorithm to use
Commands
--------
dfu <USB_controller> [<interface> <dev>] list
list the alternate device defined in *dfu_alt_info*
dfu <USB_controller> [<interface> <dev>] [<timeout>]
start the dfu stack on the USB instance with the selected medium
backend and use the *dfu_alt_info* variable to configure the
alternate setting and link each one with the medium
The dfu command continue until receive a ^C in console or
a DFU detach transaction from HOST. If CONFIG_DFU_TIMEOUT option
is enabled and <timeout> parameter is present in the command line,
the DFU operation will be aborted automatically after <timeout>
seconds of waiting remote to initiate DFU session.
The possible values of <interface> are (with <USB controller> = 0 in the dfu
command example)
mmc
for eMMC and SD card::
dfu 0 mmc <dev>
each element in *dfu_alt_info* being
* <name> raw <offset> <size> [mmcpart <num>] raw access to mmc device
* <name> part <dev> <part_id> [mmcpart <num>] raw access to partition
* <name> fat <dev> <part_id> [mmcpart <num>] file in FAT partition
* <name> ext4 <dev> <part_id> [mmcpart <num>] file in EXT4 partition
* <name> skip 0 0 ignore flashed data
* <name> script 0 0 execute commands in shell
with
partid
being the GPT or DOS partition index,
num
being the eMMC hardware partition number.
A value of environment variable *dfu_alt_info* for eMMC could be::
u-boot raw 0x3e 0x800 mmcpart 1;bl2 raw 0x1e 0x1d mmcpart 1
A value of environment variable *dfu_alt_info* for SD card could be::
u-boot raw 0x80 0x800;uImage ext4 0 2
If don't want to flash given image file to storage, use "skip" type
entity.
- It can be used to protect flashing wrong image for the specific board.
- Especailly, this layout will be useful when thor protocol is used,
which performs flashing in batch mode, where more than one file is
processed.
For example, if one makes a single tar file with support for the two
boards with u-boot-<board1>.bin and u-boot-<board2>.bin files, one
can use it to flash a proper u-boot image on both without a failure::
u-boot-<board1>.bin raw 0x80 0x800; u-boot-<board2>.bin skip 0 0
When flashing new system image requires do some more complex things
than just writing data to the storage medium, one can use 'script'
type. Data written to such entity will be executed as a command list
in the u-boot's shell. This for example allows to re-create partition
layout and even set new *dfu_alt_info* for the newly created paritions.
Such script would look like::
setenv dfu_alt_info ...
setenv mbr_parts ...
mbr write ...
Please note that this means that user will be able to execute any
arbitrary commands just like in the u-boot's shell.
nand
raw slc nand device::
dfu 0 nand <dev>
each element in *dfu_alt_info* being either of
* <name> raw <offset> <size> raw access to mmc device
* <name> part <dev> <part_id> raw acces to partition
* <name> partubi <dev> <part_id> raw acces to ubi partition
with
partid
is the MTD partition index
ram
raw access to ram::
dfu 0 ram <dev>
dev
is not used for RAM target
each element in *dfu_alt_info* being::
<name> ram <offset> <size> raw access to ram
sf
serial flash : NOR::
cmd: dfu 0 sf <dev>
each element in *dfu_alt_info* being either of:
* <name> raw <offset> <size> raw access to sf device
* <name> part <dev> <part_id> raw acces to partition
* <name> partubi <dev> <part_id> raw acces to ubi partition
with
partid
is the MTD partition index
mtd
all MTD device: NAND, SPI-NOR, SPI-NAND,...::
cmd: dfu 0 mtd <dev>
with
dev
the mtd identifier as defined in mtd command
(nand0, nor0, spi-nand0,...)
each element in *dfu_alt_info* being either of:
* <name> raw <offset> <size> forraw access to mtd device
* <name> part <dev> <part_id> for raw acces to partition
* <name> partubi <dev> <part_id> for raw acces to ubi partition
with
partid
is the MTD partition index
virt
virtual flash back end for DFU
::
cmd: dfu 0 virt <dev>
each element in *dfu_alt_info* being:
* <name>
<interface> and <dev> are absent, the dfu command to use multiple devices::
cmd: dfu 0 list
cmd: dfu 0
*dfu_alt_info* variable provides the list of <interface> <dev> with
alternate list separated by '&' with the same format for each <alt>::
mmc <dev>=<alt1>;....;<altN>
nand <dev>=<alt1>;....;<altN>
ram <dev>=<alt1>;....;<altN>
sf <dev>=<alt1>;....;<altN>
mtd <dev>=<alt1>;....;<altN>
virt <dev>=<alt1>;....;<altN>
Callbacks
---------
The weak callback functions can be implemented to manage specific behavior
dfu_initiated_callback
called when the DFU transaction is started, used to initiase the device
dfu_flush_callback
called at the end of the DFU write after DFU manifestation, used to manage
the device when DFU transaction is closed
Host tools
----------
When U-Boot runs the dfu stack, the DFU host tools can be used
to send/receive firmwares on each configurated alternate.
For example dfu-util is a host side implementation of the DFU 1.1
specifications(http://dfu-util.sourceforge.net/) which works with U-Boot.
Usage
-----
Example 1: firmware located in eMMC or SD card, with:
- alternate 1 (alt=1) for SPL partition (GPT partition 1)
- alternate 2 (alt=2) for U-Boot partition (GPT partition 2)
The U-Boot configuration is::
U-Boot> env set dfu_alt_info "spl part 0 1;u-boot part 0 2"
U-Boot> dfu 0 mmc 0 list
DFU alt settings list:
dev: eMMC alt: 0 name: spl layout: RAW_ADDR
dev: eMMC alt: 1 name: u-boot layout: RAW_ADDR
Boot> dfu 0 mmc 0
On the Host side:
list the available alternate setting::
$> dfu-util -l
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Found DFU: [0483:5720] ver=0200, devnum=45, cfg=1, intf=0, path="3-1.3.1", \
alt=1, name="u-boot", serial="003A00203438510D36383238"
Found DFU: [0483:5720] ver=0200, devnum=45, cfg=1, intf=0, path="3-1.3.1", \
alt=0, name="spl", serial="003A00203438510D36383238"
To download to U-Boot, use -D option
$> dfu-util -a 0 -D u-boot-spl.bin
$> dfu-util -a 1 -D u-boot.bin
To upload from U-Boot, use -U option
$> dfu-util -a 0 -U u-boot-spl.bin
$> dfu-util -a 1 -U u-boot.bin
To request a DFU detach and reset the USB connection:
$> dfu-util -a 0 -e -R
Example 2: firmware located in NOR (sf) and NAND, with:
- alternate 1 (alt=1) for SPL partition (NOR GPT partition 1)
- alternate 2 (alt=2) for U-Boot partition (NOR GPT partition 2)
- alternate 3 (alt=3) for U-Boot-env partition (NOR GPT partition 3)
- alternate 4 (alt=4) for UBI partition (NAND GPT partition 1)
::
U-Boot> env set dfu_alt_info \
"sf 0:0:10000000:0=spl part 0 1;u-boot part 0 2; \
u-boot-env part 0 3&nand 0=UBI partubi 0,1"
U-Boot> dfu 0 list
DFU alt settings list:
dev: SF alt: 0 name: spl layout: RAW_ADDR
dev: SF alt: 1 name: ssbl layout: RAW_ADDR
dev: SF alt: 2 name: u-boot-env layout: RAW_ADDR
dev: NAND alt: 3 name: UBI layout: RAW_ADDR
U-Boot> dfu 0
::
$> dfu-util -l
Found DFU: [0483:5720] ver=9999, devnum=96, cfg=1,\
intf=0, alt=3, name="UBI", serial="002700333338511934383330"
Found DFU: [0483:5720] ver=9999, devnum=96, cfg=1,\
intf=0, alt=2, name="u-boot-env", serial="002700333338511934383330"
Found DFU: [0483:5720] ver=9999, devnum=96, cfg=1,\
intf=0, alt=1, name="u-boot", serial="002700333338511934383330"
Found DFU: [0483:5720] ver=9999, devnum=96, cfg=1,\
intf=0, alt=0, name="spl", serial="002700333338511934383330"
Same example with MTD backend
::
U-Boot> env set dfu_alt_info \
"mtd nor0=spl part 1;u-boot part 2;u-boot-env part 3&"\
"mtd nand0=UBI partubi 1"
U-Boot> dfu 0 list
using id 'nor0,0'
using id 'nor0,1'
using id 'nor0,2'
using id 'nand0,0'
DFU alt settings list:
dev: MTD alt: 0 name: spl layout: RAW_ADDR
dev: MTD alt: 1 name: u-boot layout: RAW_ADDR
dev: MTD alt: 2 name: u-boot-env layout: RAW_ADDR
dev: MTD alt: 3 name: UBI layout: RAW_ADDR
Example 3
firmware located in SD Card (mmc) and virtual partition on OTP and PMIC not
volatile memory
- alternate 1 (alt=1) for scard
- alternate 2 (alt=2) for OTP (virtual)
- alternate 3 (alt=3) for PMIC NVM (virtual)
::
U-Boot> env set dfu_alt_info \
"mmc 0=sdcard raw 0 0x100000&"\
"virt 0=otp" \
"virt 1=pmic"
::
U-Boot> dfu 0 list
DFU alt settings list:
dev: eMMC alt: 0 name: sdcard layout: RAW_ADDR
dev: VIRT alt: 1 name: otp layout: RAW_ADDR
dev: VIRT alt: 2 name: pmic layout: RAW_ADDR

View file

@ -4,6 +4,7 @@ Use U-Boot
.. toctree::
:maxdepth: 1
dfu
fdt_overlays
fit
netconsole

View file

@ -21,6 +21,7 @@
#include <sata.h>
#include <scsi.h>
#include <syscon.h>
#include <dm/device_compat.h>
#define SYS_CFG 0x14
#define SYS_CFG_SATA_MSK GENMASK(31, 30)

View file

@ -1639,7 +1639,8 @@ static int msdc_drv_probe(struct udevice *dev)
else
cfg->f_min = host->src_clk_freq / (4 * 4095);
cfg->f_max = host->src_clk_freq;
if (cfg->f_max < cfg->f_min || cfg->f_max > host->src_clk_freq)
cfg->f_max = host->src_clk_freq;
cfg->b_max = 1024;
cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;

View file

@ -411,9 +411,16 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command,
/* READID must read all possible bytes while CEB is active */
case NAND_CMD_READID:
case NAND_CMD_PARAM: {
/*
* For READID, read 8 bytes that are currently used.
* For PARAM, read all 3 copies of 256-bytes pages.
*/
int len = 8;
int timing = IFC_FIR_OP_RB;
if (command == NAND_CMD_PARAM)
if (command == NAND_CMD_PARAM) {
timing = IFC_FIR_OP_RBCD;
len = 256 * 3;
}
ifc_out32(&ifc->ifc_nand.nand_fir0,
(IFC_FIR_OP_CW0 << IFC_NAND_FIR0_OP0_SHIFT) |
@ -423,12 +430,8 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command,
command << IFC_NAND_FCR0_CMD0_SHIFT);
ifc_out32(&ifc->ifc_nand.row3, column);
/*
* although currently it's 8 bytes for READID, we always read
* the maximum 256 bytes(for PARAM)
*/
ifc_out32(&ifc->ifc_nand.nand_fbcr, 256);
ctrl->read_bytes = 256;
ifc_out32(&ifc->ifc_nand.nand_fbcr, len);
ctrl->read_bytes = len;
set_addr(mtd, 0, 0, 0);
fsl_ifc_run_command(mtd);

View file

@ -22,6 +22,8 @@
#define NVME_AQ_DEPTH 2
#define NVME_SQ_SIZE(depth) (depth * sizeof(struct nvme_command))
#define NVME_CQ_SIZE(depth) (depth * sizeof(struct nvme_completion))
#define NVME_CQ_ALLOCATION ALIGN(NVME_CQ_SIZE(NVME_Q_DEPTH), \
ARCH_DMA_MINALIGN)
#define ADMIN_TIMEOUT 60
#define IO_TIMEOUT 30
#define MAX_PRP_POOL 512
@ -144,8 +146,14 @@ static __le16 nvme_get_cmd_id(void)
static u16 nvme_read_completion_status(struct nvme_queue *nvmeq, u16 index)
{
u64 start = (ulong)&nvmeq->cqes[index];
u64 stop = start + sizeof(struct nvme_completion);
/*
* Single CQ entries are always smaller than a cache line, so we
* can't invalidate them individually. However CQ entries are
* read only by the CPU, so it's safe to always invalidate all of them,
* as the cache line should never become dirty.
*/
ulong start = (ulong)&nvmeq->cqes[0];
ulong stop = start + NVME_CQ_ALLOCATION;
invalidate_dcache_range(start, stop);
@ -241,7 +249,7 @@ static struct nvme_queue *nvme_alloc_queue(struct nvme_dev *dev,
return NULL;
memset(nvmeq, 0, sizeof(*nvmeq));
nvmeq->cqes = (void *)memalign(4096, NVME_CQ_SIZE(depth));
nvmeq->cqes = (void *)memalign(4096, NVME_CQ_ALLOCATION);
if (!nvmeq->cqes)
goto free_nvmeq;
memset((void *)nvmeq->cqes, 0, NVME_CQ_SIZE(depth));
@ -339,7 +347,7 @@ static void nvme_init_queue(struct nvme_queue *nvmeq, u16 qid)
nvmeq->q_db = &dev->dbs[qid * 2 * dev->db_stride];
memset((void *)nvmeq->cqes, 0, NVME_CQ_SIZE(nvmeq->q_depth));
flush_dcache_range((ulong)nvmeq->cqes,
(ulong)nvmeq->cqes + NVME_CQ_SIZE(nvmeq->q_depth));
(ulong)nvmeq->cqes + NVME_CQ_ALLOCATION);
dev->online_queues++;
}
@ -481,6 +489,7 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid,
dma_addr_t dma_addr, u32 *result)
{
struct nvme_command c;
int ret;
memset(&c, 0, sizeof(c));
c.features.opcode = nvme_admin_get_features;
@ -488,12 +497,20 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid,
c.features.prp1 = cpu_to_le64(dma_addr);
c.features.fid = cpu_to_le32(fid);
ret = nvme_submit_admin_cmd(dev, &c, result);
/*
* TODO: add cache invalidate operation when the size of
* the DMA buffer is known
* TODO: Add some cache invalidation when a DMA buffer is involved
* in the request, here and before the command gets submitted. The
* buffer size varies by feature, also some features use a different
* field in the command packet to hold the buffer address.
* Section 5.21.1 (Set Features command) in the NVMe specification
* details the buffer requirements for each feature.
*
* At the moment there is no user of this function.
*/
return nvme_submit_admin_cmd(dev, &c, result);
return ret;
}
int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11,
@ -508,8 +525,14 @@ int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11,
c.features.dword11 = cpu_to_le32(dword11);
/*
* TODO: add cache flush operation when the size of
* the DMA buffer is known
* TODO: Add a cache clean (aka flush) operation when a DMA buffer is
* involved in the request. The buffer size varies by feature, also
* some features use a different field in the command packet to hold
* the buffer address. Section 5.21.1 (Set Features command) in the
* NVMe specification details the buffer requirements for each
* feature.
* At the moment the only user of this function is not using
* any DMA buffer at all.
*/
return nvme_submit_admin_cmd(dev, &c, result);

View file

@ -244,7 +244,7 @@ static int ls_pcie_ep_probe(struct udevice *dev)
int ret;
u32 svr;
pcie = devm_kmalloc(dev, sizeof(*pcie), GFP_KERNEL);
pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
if (!pcie)
return -ENOMEM;

View file

@ -254,7 +254,7 @@ static int ls_pcie_probe(struct udevice *dev)
pcie_rc->bus = dev;
pcie = devm_kmalloc(dev, sizeof(*pcie), GFP_KERNEL);
pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
if (!pcie)
return -ENOMEM;

View file

@ -23,6 +23,7 @@
enum ds_type {
ds_1307,
ds_1337,
ds_1339,
ds_1340,
m41t11,
mcp794xx,
@ -344,6 +345,7 @@ static const struct rtc_ops ds1307_rtc_ops = {
static const struct udevice_id ds1307_rtc_ids[] = {
{ .compatible = "dallas,ds1307", .data = ds_1307 },
{ .compatible = "dallas,ds1337", .data = ds_1337 },
{ .compatible = "dallas,ds1339", .data = ds_1339 },
{ .compatible = "dallas,ds1340", .data = ds_1340 },
{ .compatible = "microchip,mcp7941x", .data = mcp794xx },
{ .compatible = "st,m41t11", .data = m41t11 },

View file

@ -70,12 +70,25 @@ struct sys_info {
int mr_no; /* number of memory regions */
};
#undef CONFIG_SYS_64BIT_LBA
#ifdef CONFIG_SYS_64BIT_LBA
typedef u_int64_t lbasize_t;
#else
/*
* FIXME: Previously this code was:
*
* #undef CONFIG_SYS_64BIT_LBA
* #ifdef CONFIG_SYS_64BIT_LBA
* typedef u_int64_t lbasize_t;
* #else
* typedef unsigned long lbasize_t;
* #endif
*
* But we cannot just undefine CONFIG_SYS_64BIT_LBA, because then in
* api/api_storage.c the type signature of lbaint_t will be different if
* CONFIG_SYS_64BIT_LBA is enabled for the board, which can result in various
* bugs.
* So simply define lbasize_t as an unsigned long, since this was what was done
* anyway for at least 13 years, but don't undefine CONFIG_SYS_64BIT_LBA.
*/
typedef unsigned long lbasize_t;
#endif
typedef unsigned long lbastart_t;
#define DEV_TYP_NONE 0x0000

View file

@ -81,12 +81,6 @@
#define CONFIG_SYS_SCSI_MAX_LUN 1
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)
/* DSPI */
#ifdef CONFIG_FSL_DSPI
#define CONFIG_SPI_FLASH_SST
#define CONFIG_SPI_FLASH_EON
#endif
#ifndef SPL_NO_ENV
#undef CONFIG_EXTRA_ENV_SETTINGS
#define CONFIG_EXTRA_ENV_SETTINGS \

View file

@ -154,12 +154,6 @@
#endif
#endif
/* FlexSPI */
#ifdef CONFIG_NXP_FSPI
#define NXP_FSPI_FLASH_SIZE SZ_64M
#define NXP_FSPI_FLASH_NUM 1
#endif
/* GPIO */
#ifdef CONFIG_DM_GPIO
#ifndef CONFIG_MPC8XXX_GPIO

View file

@ -6,6 +6,8 @@
#ifndef __DM_TEST_H
#define __DM_TEST_H
struct udevice;
/**
* struct dm_test_cdata - configuration data for test instance
*

View file

@ -140,7 +140,7 @@
#define CSOR_NOR_ADM_SHIFT_SHIFT 13
#define CSOR_NOR_ADM_SHIFT(n) ((n) << CSOR_NOR_ADM_SHIFT_SHIFT)
/* Type of the NOR device hooked */
#define CSOR_NOR_NOR_MODE_AYSNC_NOR 0x00000000
#define CSOR_NOR_NOR_MODE_ASYNC_NOR 0x00000000
#define CSOR_NOR_NOR_MODE_AVD_NOR 0x00000020
/* Time for Read Enable High to Output High Impedance */
#define CSOR_NOR_TRHZ_MASK 0x0000001C

View file

@ -1163,7 +1163,7 @@ int fit_image_check_comp(const void *fit, int noffset, uint8_t comp);
* @fit: pointer to the FIT format image header
* @return 0 if OK, -ENOEXEC if not an FDT file, -EINVAL if the full FDT check
* failed (e.g. due to bad structure), -ENOMSG if the description is
* missing, -ENODATA if the timestamp is missing, -ENOENT if the /images
* missing, -EBADMSG if the timestamp is missing, -ENOENT if the /images
* path is missing
*/
int fit_check_format(const void *fit, ulong size);

File diff suppressed because it is too large Load diff

View file

@ -7,9 +7,7 @@
#include <common.h>
#include <command.h>
#if CONFIG_IS_ENABLED(EFI_LOADER) && !defined(API_BUILD)
#include <efi_api.h>
#endif
#include <display_options.h>
#include <log.h>
#include <version.h>

View file

@ -414,6 +414,8 @@ def mk_env_ext4(state_test_env):
if os.path.exists(persistent):
c.log.action('Disk image file ' + persistent + ' already exists')
else:
# Some distributions do not add /sbin to the default PATH, where mkfs.ext4 lives
os.environ["PATH"] += os.pathsep + '/sbin'
try:
u_boot_utils.run_and_log(c, 'dd if=/dev/zero of=%s bs=1M count=16' % persistent)
u_boot_utils.run_and_log(c, 'mkfs.ext4 %s' % persistent)

View file

@ -273,14 +273,14 @@ int rockchip_copy_image(int fd, struct image_tool_params *mparams);
#define INIT_SECTION(name) do { \
unsigned long name ## _len; \
char *__cat(pstart_, name) = getsectdata("__TEXT", \
char *__cat(pstart_, name) = getsectdata("__DATA", \
#name, &__cat(name, _len)); \
char *__cat(pstop_, name) = __cat(pstart_, name) + \
__cat(name, _len); \
__cat(__start_, name) = (void *)__cat(pstart_, name); \
__cat(__stop_, name) = (void *)__cat(pstop_, name); \
} while (0)
#define SECTION(name) __attribute__((section("__TEXT, " #name)))
#define SECTION(name) __attribute__((section("__DATA, " #name)))
struct image_type_params **__start_image_type, **__stop_image_type;
#else

View file

@ -278,7 +278,7 @@ static int create_fwbin(char *path, char *bin, efi_guid_t *guid,
}
data = malloc(bin_stat.st_size);
if (!data) {
printf("cannot allocate memory: %lx\n", bin_stat.st_size);
printf("cannot allocate memory: %zx\n", (size_t)bin_stat.st_size);
goto err_1;
}
f = fopen(path, "w");
@ -297,7 +297,7 @@ static int create_fwbin(char *path, char *bin, efi_guid_t *guid,
size = fwrite(&header, 1, sizeof(header), f);
if (size < sizeof(header)) {
printf("write failed (%lx)\n", size);
printf("write failed (%zx)\n", size);
goto err_3;
}
@ -306,13 +306,13 @@ static int create_fwbin(char *path, char *bin, efi_guid_t *guid,
capsule.payload_item_count = 1;
size = fwrite(&capsule, 1, sizeof(capsule), f);
if (size < (sizeof(capsule))) {
printf("write failed (%lx)\n", size);
printf("write failed (%zx)\n", size);
goto err_3;
}
offset = sizeof(capsule) + sizeof(u64);
size = fwrite(&offset, 1, sizeof(offset), f);
if (size < sizeof(offset)) {
printf("write failed (%lx)\n", size);
printf("write failed (%zx)\n", size);
goto err_3;
}
@ -329,17 +329,17 @@ static int create_fwbin(char *path, char *bin, efi_guid_t *guid,
size = fwrite(&image, 1, sizeof(image), f);
if (size < sizeof(image)) {
printf("write failed (%lx)\n", size);
printf("write failed (%zx)\n", size);
goto err_3;
}
size = fread(data, 1, bin_stat.st_size, g);
if (size < bin_stat.st_size) {
printf("read failed (%lx)\n", size);
printf("read failed (%zx)\n", size);
goto err_3;
}
size = fwrite(data, 1, bin_stat.st_size, f);
if (size < bin_stat.st_size) {
printf("write failed (%lx)\n", size);
printf("write failed (%zx)\n", size);
goto err_3;
}