summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-02-15doc: imx: habv4: Move encrypted boot guideBreno Matheus Lima
All guides are currently located at doc/imx/habv4/guides/ directory. Move encrypted_boot.txt document to guides directory. Signed-off-by: Breno Lima <breno.lima@nxp.com>
2019-02-15doc: imx: habv4: Add Secure Boot guide for i.MX6 and i.MX7 SPL targetsBreno Matheus Lima
The current U-Boot implementation includes SPL targets for some NXP development boards: - mx6sabreauto_defconfig - mx6sabresd_defconfig - mx6ul_14x14_evk_defconfig - mx6ul_9x9_evk_defconfig Add additional steps needed to completly secure the bootloader image. Signed-off-by: Breno Lima <breno.lima@nxp.com>
2019-02-15doc: imx: habv4: Add Secure Boot guide for i.MX6 and i.MX7 non-SPL targetsBreno Matheus Lima
Add HABv4 documentation for non-SPL targets covering the following topics: - How to sign an securely boot an u-boot-dtb.imx image. - How to extend the root of trust for additional boot images. - Add 3 CSF examples. - Add IVT generation script example. Reviewed-by: Ye Li <ye.li@nxp.com> Reviewed-by: Utkarsh Gupta <utkarsh.gupta@nxp.com> Signed-off-by: Breno Lima <breno.lima@nxp.com>
2019-02-15doc: imx: habv4: Add HABv4 introductionBreno Matheus Lima
The HABv4 is supported in i.MX50, i.MX53, i.MX6, i.MX7, series and i.MX 8M, i.MX8MM devices. Add an introductory document containing the following topics: - HABv4 Introduction - HABv4 Secure Boot - HABv4 Encrypted Boot - HAB PKI tree generation - HAB Fast Authentication PKI tree generation - SRK Table and SRK Hash generation Reviewed-by: Ye Li <ye.li@nxp.com> Reviewed-by: Utkarsh Gupta <utkarsh.gupta@nxp.com> Signed-off-by: Breno Lima <breno.lima@nxp.com>
2019-02-15doc: imx: habv4: Remove extra hab directory for a cleaner documentation ↵Breno Matheus Lima
structure There is no need to have an extra hab directory under doc/imx/. Habv4 and AHAB documentation can be added directly in doc/imx/ for a cleaner documentation structure. Signed-off-by: Breno Lima <breno.lima@nxp.com>
2019-02-15ARM: dts: imx6ul-lite*: add DTS files for liteSOM and liteboardMarcin Niestroj
Import liteSOM and liteboard dts files from Linux v4.20. They will be used after transition to driver model and device-tree based boot. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-02-15MTD: nand: mxs_nand: Allow driver to auto setup ECC in SPLAdam Ford
The initialization of the NAND in SPL hard-coded ecc.bytes, ecc.size, and ecc.strength which may work for some NAND parts, but it not appropriate for others. With the pending patch "mxs_nand: Fix BCH read timeout error on boards requiring ECC" the driver can auto configure the ECC when these entries are blank. This patch has been tested in NAND flash with oob 64 and oob 128. Signed-off-by: Adam Ford <aford173@gmail.com> Tested-by: Jörg Krause <joerg.krause@embedded.rocks> Acked-by: Tim Harvey <tharvey@gateworks.com> Tested-by: Tim Harvey <tharvey@gateworks.com>
2019-02-15net: dm: fec: Fix regulator enable when using DM_REGULATORAdam Ford
When DM_REGULATOR is enabled, the driver attempts to call regulator_autoset() which expects the regulators to be on at boot and/or always on and fails if they are not true. For a more generic approach, this patch just calls regulator_set_enable() which shouldn't have such restrictions. Fixes: ad8c43cbcafb ("net: dm: fec: Support the phy-supply binding") Signed-off-by: Adam Ford <aford173@gmail.com> Tested-by: Martin Fuzzey <martin.fuzzey@flowbird.group> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-02-15ARM: imx6q_logic: Correct phy fixup for broken ethernetAdam Ford
The Ethernet has been broken for some time. This patch unifies this board with a few others that use a similar approach to enabling phy. This fixes ar8031 Ethernet controller so it works. Signed-off-by: Adam Ford <aford173@gmail.com>
2019-02-15ARM: imx6q_logic: Enable SPL Booting from NANDAdam Ford
This patch fixes a few values that were incorrect, and this now lets SPL boot from NAND. Signed-off-by: Adam Ford <aford173@gmail.com>
2019-02-15MTD: NAND: mxs_nand_init_dma: Make mxs_nand_init_dma staticAdam Ford
mxs_nand_init_dma is only referenced from mxs_nand.c. It's not referenced in any headers or outside code, so this patch defines it as static. Signed-off-by: Adam Ford <aford173@gmail.com>
2019-02-15MTD: mxs_nand: Fix BCH read timeout error on boards requiring ECCAdam Ford
The LogicPD board uses a Micron Flash with ECC. To boot this from SPL, the ECC needs to be correctly configured or the BCH engine times out. Signed-off-by: Adam Ford <aford173@gmail.com> Acked-by: Stefan Agner <stefan.agner@toradex.com> Tested-by: Jörg Krause <joerg.krause@embedded.rocks> Acked-by: Tim Harvey <tharvey@gateworks.com> Tested-by: Tim Harvey <tharvey@gateworks.com>
2019-02-15ddr: vybrid: Add calibration code to memory controler's (DDRMC) setup codeLukasz Majewski
This patch extends the vf610 DDR memory controller code to support SW leveling. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Agner <stefan.agner@toradex.com>
2019-02-15ddr: vybrid: Provide code to perform on-boot calibrationLukasz Majewski
This patch provides the code to calibrate the DDR's DQS to DQ signals (RDLVL). It is based on: VFxxx Controller Reference Manual, Rev. 0, 10/2016, page 1600 10.1.6.16.4.1 "Software Read Leveling in MC Evaluation Mode" and NXP's community thread: "Vybrid: About DDR leveling feature on DDRMC." https://community.nxp.com/thread/395323 Signed-off-by: Lukasz Majewski <lukma@denx.de>
2019-02-15ddr: vybrid: Add DDRMC calibration related registers (DQS to DQ)Lukasz Majewski
This commit provides extra defines needed for DDR memory controller calibration (read leveling performing). Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Agner <stefan.agner@toradex.com>
2019-02-13Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini
Patch queue for efi - 2019-02-13 Goodness this time around: - HII protocol, finally allows us to run the UEFI Shell! (experimantal, disabled by default) - efi selftest now available on Cortex-M - NVMe support for distro boot - Lots of code cleanup
2019-02-13efi_loader: fix EFI_FILE_PROTOCOL.GetInfo()Heinrich Schuchardt
We check the existence of files with fs_exist(). This function calls fs_close(). If we do not set the active block device again fs_opendir() fails and we do not set the flag EFI_FILE_DIRECTORY. Due to this error the `cd` command in the EFI shell fails. So let's add the missing set_blk_dev(fh) call. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13lib: vsprintf: avoid overflow printing UTF16 stringsHeinrich Schuchardt
We have to ensure while printing UTF16 strings that we do not exceed the end of the print buffer. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: Make HII a config optionAlexander Graf
Heinrich ran into issues with HII and iPXE which lead to #SErrors on his Odroid-C2 system. We definitely do not want to regress just yet, so let's not expose the HII protocols by default. Instead, let's make it a config option that people can play with This way, we can stabilize the code in tree without breaking any users. Once someone figures out, why this breaks iPXE (probably a NULL dereference), we can enable it by default. Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de> --- v1 -> v2: - Remove HII selftest as well v2 -> v3: - Make config option
2019-02-13arm: Leave smccc calls in .text when efi_loader=nAlexander Graf
Commit 81ea00838c6 ("efi_loader: PSCI reset and shutdown") put the SMCCC assembly code into the efi specific code section. This is wrong when we do not have EFI_LOADER enabled, as that strips efi runtime sections from the output binary Reported-by: Michal Simek <monstr@monstr.eu> Reported-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Tested-by: Michal Simek <monstr@monstr.eu> Fixes: 81ea00838c6 ("efi_loader: PSCI reset and shutdown") Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: debug output for HII protocolsHeinrich Schuchardt
For correct indention use EFI_PRINT() instead of debug(). For printing efi_uintn_t or size_t use the %zu or %zx format code. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_selftest: fix HII testsHeinrich Schuchardt
efi_st_printf() does not support format code %ld. Anyway the format code for size_t would be %zu which isn't supported either. We do not want any divisions to avoid invalid references to integer arithmetic routines, cf. https://gcc.gnu.org/onlinedocs/gccint/Integer-library-routines.html. As a simple remedy remove the noisy messages from the output. They are not relevant for automated testing. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_selftest: add HII database protocols testAKASHI Takahiro
This efi_selftest tests HII database protocol and HII string protocol. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi: hii: add HII config routing/access protocolsAKASHI Takahiro
This patch is a place holder for HII configuration routing protocol and HII configuration access protocol. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi: hii: add keyboard layout package supportAKASHI Takahiro
Allow for handling keyboard layout package in HII database protocol. A package can be added or deleted in HII database protocol, but we don't set 'current' keyboard layout as there is no driver that requests a keyboard layout. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi: hii: add guid package supportAKASHI Takahiro
Allow for handling GUID package in HII database protocol. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: Initial HII database protocolsLeif Lindholm
This patch provides enough implementation of the following protocols to run EDKII's Shell.efi and UEFI SCT: * EfiHiiDatabaseProtocol * EfiHiiStringProtocol Not implemented are: * ExportPackageLists() * RegisterPackageNotify()/UnregisterPackageNotify() * SetKeyboardLayout() (i.e. *current* keyboard layout) HII database protocol in this patch series can handle only: * GUID package * string package * keyboard layout package (The other packages, except Device path package, will be necessary for interactive and graphical UI.) Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13x86: do not use i386 code for x86_64 memory functionsHeinrich Schuchardt
arch/x86/lib/string.c contains assembler implementations of memcpy(), memmove(), and memset() written for i386. Don't use it on x86_64. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: GetNextVariableName() relies on REGEXHeinrich Schuchardt
Our implementation of GetNextVariableName() relies on CONFIG_REGEX=y. So EFI_LOADER has to select it. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: fix GetNextVariableNameHeinrich Schuchardt
Our current implementation of GetNextVariableName() first collects all EFI variables. If none is found at all hexport_r() returns a zero length string terminated by \0 and the value 1 as number of bytes in the returned buffer. In this case GetNextVariableName() has to return EFI_NOT_FOUND. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: do not use symbolic linksHeinrich Schuchardt
Symbolic links are not supported on all file systems, e.g. not on FAT. So it is not wise to use them in our source tree. Use a qualified path to refer to lib/efi_loader/efi_freestanding.c in scripts/Makefile.lib instead. Reported-by: Alexander Graf <agraf@suse.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> [agraf: Fix build with O=] Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: use library memcpy() in helloworld.efiHeinrich Schuchardt
Helloworld does not need its own memcpy() implementation anymore. Use the one provided in efi_freestanding.c. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: use freestanding library for efi appsHeinrich Schuchardt
GCC requires that freestanding programs provide memcpy(), memmove(), memset(), and memcmp(). Add the library functions when building a *.efi files. The EFI selftests might use other compilation flags. So use a symbolic link to provide lib/efi_selftest/efi_freestanding.c and compile it separately. Reported-by: Alexander Graf <agraf@suse.de> Fixes: 5be444d14b38 ("efi_loader: consistent build flags for EFI applications") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: provide freestanding libraryHeinrich Schuchardt
GCC requires that freestanding programs provide memcpy(), memmove(), memset(), and memcmp(). Provide the required library functions. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_selftest: fix variables test for GetNextVariableName()AKASHI Takahiro
There is a bug in efi variables test. Fix it with some cosmetic improvements. Please note that efi variables test still fails at QueryVariableInfo() and GetVariable(), but this is not due to a change in this patch. ==8<== Testing EFI API implementation Selected test: 'variables' Setting up 'variables' Setting up 'variables' succeeded Executing 'variables' .../u-boot/lib/efi_selftest/efi_selftest_variables.c(60): TODO: QueryVariableInfo failed .../u-boot/lib/efi_selftest/efi_selftest_variables.c(131): TODO: GetVariable returned wrong length 7 .../u-boot/lib/efi_selftest/efi_selftest_variables.c(133): TODO: GetVariable returned wrong value Executing 'variables' succeeded Boot services terminated Summary: 0 failures ==>8== Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: implement GetNextVariableName()AKASHI Takahiro
The current GetNextVariableName() is a placeholder. With this patch, it works well as expected. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> rebased on efi-next Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: comments for variable servicesHeinrich Schuchardt
Comment the functions implementing the runtime variable services. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: remove duplicate function mem2hex()Heinrich Schuchardt
Replace duplicate function mem2hex() by inline function bin2hex(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: eliminate duplicate function hex2mem()Heinrich Schuchardt
Use existing inline function hex2bin() instead of defining a new one. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: remove duplicate GUID definitionHeinrich Schuchardt
Remove duplicate definition o EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: consistent build flags for EFI applicationsHeinrich Schuchardt
At the same time adding and removing the -Os flag does not make any sense. Actually it leads to -Os not being used. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: use u16* for file nameHeinrich Schuchardt
UTF-16 strings in our code should all be u16 *. Fix an inconsistency for file names which may lead to a warning for printf("%ls", ). Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: fix CopyMem()Heinrich Schuchardt
CopyMem() must support overlapping buffers. So replace memcpy() by memmove(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: refactor switch to non-secure modeHeinrich Schuchardt
Refactor the switch from supervisor to hypervisor to a new function called at the beginning of do_bootefi(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_driver: simplify error messageHeinrich Schuchardt
Stating the function module is sufficient. We don't need file and line number. Anyway the format code for the line number was incorrect (should be %d). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_selftest: tpl unit test, check return valuesHeinrich Schuchardt
For some API calls checks for the return values are missing. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_selftest: events unit test, check return valuesHeinrich Schuchardt
For some API calls checks for the return values are missing. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_selftest: SNP unit test on sandboxHeinrich Schuchardt
Running the simple network protocol test on the sandbox requires setting the environment variable ethact to a network interface connected to a DHCP server and ethrotate to 'no'. So let's make it an on-request test on the sandbox (selectable by setting environment variable efi_selftest). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: efi_set_variable use const void *Heinrich Schuchardt
The SetVariable() runtime service does not change the data passed to it. So mark the parameter as constant. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: use const efi_guid_t * for variable servicesHeinrich Schuchardt
The runtime variable services never change GUIDs. So we should declare the GUID parameters as constant. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>