summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* acpigen: Support writing a lengthSimon Glass2020-07-172-1/+49
| | | | | | | | | | | It is convenient to write a length value for preceding a block of data. Of course the length is not known or is hard to calculate a priori. So add a way to mark the start on a stack, so the length can be updated when known. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* acpi: Support generation of SPI descriptorSimon Glass2020-07-172-2/+41
| | | | | | | | Add a function to write a SPI descriptor to the generated ACPI code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* acpi: Support generation of I2C descriptorSimon Glass2020-07-171-0/+33
| | | | | | | | Add a function to write a GPIO descriptor to the generated ACPI code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* acpi: Support generation of a GPIO/irq for a deviceSimon Glass2020-07-171-0/+15
| | | | | | | | | | | | Some devices use interrupts but some use GPIOs. Since these are fully specified in the device tree we can automatically produce the correct ACPI descriptor for a device. Add a function to handle this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* acpi: Support generation of GPIO descriptorSimon Glass2020-07-171-0/+22
| | | | | | | | | | Add a function to write a GPIO descriptor to the generated ACPI code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: Drop comment about the type always being ACPI_GPIO_TYPE_IO] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* acpi: Support string outputSimon Glass2020-07-171-0/+19
| | | | | | | | Add support for output of strings and streams of bytes. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* gpio: Add a method to convert a GPIO to ACPISimon Glass2020-07-172-0/+117
| | | | | | | | | | When generating ACPI tables we need to convert GPIOs in U-Boot to the ACPI structures required by ACPI. This is a SoC-specific conversion and cannot be handled by generic code, so add a new GPIO method to do the conversion. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* acpi: Support generation of interrupt descriptorSimon Glass2020-07-171-0/+15
| | | | | | | | | Add a function to write an interrupt descriptor to the generated ACPI code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* acpi: Support generation of ACPI codeSimon Glass2020-07-172-0/+51
| | | | | | | | | | | | | | Add a new file to handle generating ACPI code programatically. This is used when information must be dynamically added to the tables, e.g. the SSDT. Initial support is just for writing simple values. Also add a 'base' value so that the table can be freed. This likely doesn't happen in normal code, but is nice to do in tests. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* irq: Add a method to convert an interrupt to ACPISimon Glass2020-07-172-0/+102
| | | | | | | | | | When generating ACPI tables we need to convert IRQs in U-Boot to the ACPI structures required by ACPI. This is a SoC-specific conversion and cannot be handled by generic code, so add a new IRQ method to do the conversion. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* acpi: Add a way to check device statusSimon Glass2020-07-171-0/+28
| | | | | | | | | | At present U-Boot does not support the different ACPI status values, but it is best to put this logic in a central place. Add a function to get the device status. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* acpi: Add a function to get a device path and scopeSimon Glass2020-07-171-0/+44
| | | | | | | | | Add a function to build up the ACPI path for a device and another for its scope. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* timer: Allow delays with a 32-bit microsecond timerSimon Glass2020-07-171-0/+11
| | | | | | | | | | | The current get_timer_us() uses 64-bit arithmetic on 32-bit machines. When implementing microsecond-level timeouts, 32-bits is plenty. Add a new function that uses an unsigned long. On 64-bit machines this is still 64-bit, but this doesn't introduce a penalty. On 32-bit machines it is more efficient. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* efi_loader: describe EFI_VAR_FILE_MAGICHeinrich Schuchardt2020-07-161-1/+5
| | | | | | | Add documentation for EFI_VAR_FILE_MAGIC used in the file format for UEFI variables. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: pre-seed UEFI variablesHeinrich Schuchardt2020-07-162-0/+10
| | | | | | | | Include a file with the initial values for non-volatile UEFI variables into the U-Boot binary. If this variable is set, changes to variable PK will not be allowed. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: identify PK, KEK, db, dbx correctlyHeinrich Schuchardt2020-07-161-0/+19
| | | | | | | | | | To determine if a varible is on the of the authentication variables PK, KEK, db, dbx we have to check both the name and the GUID. Provide a function converting the variable-name/guid pair to an enum and use it consistently. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: restructure code for TEE variablesHeinrich Schuchardt2020-07-161-0/+7
| | | | | | | When using secure boot functions needed both for file and TEE based UEFI variables have to be moved to the common code module efi_var_common.c. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: display RO attribute with TEE-backed variablesIlias Apalodimas2020-07-161-0/+43
| | | | | | | | A previous commit adds support for displaying variables RO flag. Let's add it on the TEE backed variable storage as well. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* Merge tag 'ti-v2020.10-rc1' of ↵Tom Rini2020-07-143-49/+9
|\ | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-ti - Sync DMA and CPSW DT bindings for K3 devices - Other minor fixes for mmc and other TI devices
| * ARM: da850-evm: Unify config options with KconfigAdam Ford2020-07-131-18/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two options that are currently whitelisted, but they are redundant, because there are not necessary since Kconfig options exist to basically state the same thing. CONFIG_DIRECT_NOR_BOOT and CONFIG_USE_NOR are both set together and only used by the da850 when booting from NOR, however the only time CONFIG_MTD_NOR_FLASH is configured is when booting from NOR. Since NOR doesn't need SPL, the options for SPL can be moved to a check for building SPL instead of checking for NOR. This patch removes the checks for these two config options and unifies the checks around the Kconfig option of CONFIG_MTD_NOR_FLASH. Since this board is the only board that uses these two config options, they can be removed from the whitelist table. Signed-off-by: Adam Ford <aford173@gmail.com>
| * soc: ti: k3-ringacc: Add an API to request pair of ringsVignesh Raghavendra2020-07-131-0/+4
| | | | | | | | | | | | | | | | | | | | Add new API k3_ringacc_request_rings_pair() to request pair of rings at once, as in the most case Rings are used with DMA channels which required to request pair of rings - one to feed DMA with descriptors (TX/RX FDQ) and one to receive completions (RX/TX CQ). This will allow to simplify Ringacc API users. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
| * arm: dts: k3-am65/j721e: Sync DMA DT bindings from Kernel DTVignesh Raghavendra2020-07-131-31/+0
| | | | | | | | | | | | | | | | Sync DT bindings from kernel DT and move them to out of -u-boot.dtsi files. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
* | Merge tag 'efi-2020-10-rc1-3' of ↵Tom Rini2020-07-135-7/+219
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-10-rc1 (3) Up to now UEFI variables where stored in U-Boot environment variables. Saving UEFI variables was not possible without saving the U-Boot environment variables. With this patch series file ubootefi.var in the EFI system partition is used for saving UEFI variables. Furthermore the UEFI variables are exposed for reading at runtime. Code corrections for UEFI secure boot are provided. A buffer overrun in the RSA library is fixed.
| * efi_loader: memory buffer for variablesHeinrich Schuchardt2020-07-111-0/+54
| | | | | | | | | | | | | | | | | | Saving UEFI variable as encoded U-Boot environment variables does not allow support at runtime. Provide functions to manage a memory buffer with UEFI variables. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: new function efi_memcpy_runtime()Heinrich Schuchardt2020-07-111-0/+3
| | | | | | | | | | | | Provide a memcpy() function that we can use at UEFI runtime. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: optional pointer for ConvertPointerHeinrich Schuchardt2020-07-111-0/+2
| | | | | | | | | | | | | | If the EFI_OPTIONAL_PTR is set in DebugDisposition, a NULL pointer does not constitute an invalid parameter. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: export efi_convert_pointer()Heinrich Schuchardt2020-07-111-0/+3
| | | | | | | | | | | | | | | | | | | | We need ConvertPointer() to adjust pointers when implementing runtime services within U-Boot. After ExitBootServices() gd is not available anymore. So we should not use EFI_ENTRY() and EFI_EXIT(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: UEFI variable persistenceHeinrich Schuchardt2020-07-111-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | Persist non-volatile UEFI variables in a file on the EFI system partition. The file is written whenever a non-volatile UEFI variable is changed after initialization of the UEFI sub-system. The file is read during the UEFI sub-system initialization to restore non-volatile UEFI variables. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: separate UEFI variable API from implemementationHeinrich Schuchardt2020-07-111-0/+39
| | | | | | | | | | | | | | Separate the remaining UEFI variable API functions GetNextVariableName and QueryVariableInfo() from internal functions implementing them. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: prepare for read only OP-TEE variablesHeinrich Schuchardt2020-07-111-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have two implementations of UEFI variables: * variables provided via an OP-TEE module * variables stored in the U-Boot environment Read only variables are up to now only implemented in the U-Boot environment implementation. Provide a common interface for both implementations that allows handling read-only variables. As variable access is limited to very few source files put variable related definitions into new include efi_variable.h instead of efi_loader. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * lib: rsa: export rsa_verify_with_pkey()AKASHI Takahiro2020-07-111-0/+3
| | | | | | | | | | | | | | | | | | This function will be used to implement public_key_verify_signature() in a later patch. rsa_verify() is not suitable here because calculation of message digest is not necessary. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader: image_loader: add digest-based verification for signed imageAKASHI Takahiro2020-07-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case that a type of certificate in "db" or "dbx" is EFI_CERT_X509_SHA256_GUID, it is actually not a certificate which contains a public key for RSA decryption, but a digest of image to be loaded. If the value matches to a value calculated from a given binary image, it is granted for loading. With this patch, common digest check code, which used to be used for unsigned image verification, will be extracted from efi_signature_verify_with_sigdb() into efi_signature_lookup_digest(), and extra step for digest check will be added to efi_image_authenticate(). Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * efi_loader: image_loader: verification for all signatures should passAKASHI Takahiro2020-07-111-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A signed image may have multiple signatures in - each WIN_CERTIFICATE in authenticode, and/or - each SignerInfo in pkcs7 SignedData (of WIN_CERTIFICATE) In the initial implementation of efi_image_authenticate(), the criteria of verification check for multiple signatures case is a bit ambiguous and it may cause inconsistent result. With this patch, we will make sure that verification check in efi_image_authenticate() should pass against all the signatures. The only exception would be - the case where a digest algorithm used in signature is not supported by U-Boot, or - the case where parsing some portion of authenticode has failed In those cases, we don't know how the signature be handled and should just ignore them. Please note that, due to this change, efi_signature_verify_with_sigdb()'s function prototype will be modified, taking "dbx" as well as "db" instead of outputing a "certificate." If "dbx" is null, the behavior would be the exact same as before. The function's name will be changed to efi_signature_verify() once current efi_signature_verify() has gone due to further improvement in intermediate certificates support. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * lib/crypto: use qualified path for x509_parser.hHeinrich Schuchardt2020-07-111-1/+1
| | | | | | | | | | | | Use the path relative to /include for x509_parser.h in pkcs7_parser.h. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-spiTom Rini2020-07-1111-1798/+0
|\ \ | | | | | | | | | | | | | | | | | | - Enable DM_SPI on siemens omap boards (Jagan) - Dropped some non-dm supported omap3 boards (Jagan) - Dropped non-dm code in omap3 spi driver (Jagan) - Dropped non-dm code in kirkwood spi driver (Bhargav)
| * | arm: Remove mx31pdk boardJagan Teki2020-07-091-141/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DM, OF_CONTROL, DM_SPI and other driver model migration deadlines are expired for this board. Remove it. Acked-by: Magnus Lilja <lilja.magnus@gmail.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
| * | arm: Remove pengwyn boardJagan Teki2020-07-091-166/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OF_CONTROL, DM_SPI and other driver model migration deadlines are expired for this board. Remove it. Cc: Lothar Felten <lothar.felten@gmail.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
| * | arm: Remove pepper boardJagan Teki2020-07-091-78/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OF_CONTROL, DM_SPI and other driver model migration deadlines are expired for this board. Remove it. Cc: Ash Charles <ash@gumstix.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
| * | arm: Remove bav335x boardJagan Teki2020-07-091-475/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OF_CONTROL, DM_SPI and other driver model migration deadlines are expired for this board. Remove it. Cc: Gilles Gameiro <gilles@gigadevices.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
| * | arm: Remove cairo boardJagan Teki2020-07-091-215/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OF_CONTROL, DM_SPI and other driver model migration deadlines are expired for this board. Drop it. Cc: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
| * | logicpd: Drop omap3 zoom1Jagan Teki2020-07-091-131/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OF_CONTROL, DM_SPI and other driver model migration deadlines are expired for this board. Drop it. Cc: Nishanth Menon <nm@ti.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
| * | arm: Remove overo boardJagan Teki2020-07-092-220/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OF_CONTROL, DM_SPI and other driver model migration deadlines are expired for this board. Drop it. Cc: Ash Charles <ash@gumstix.com> Cc: Steve Sakoman <sakoman@gmail.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
| * | arm: Remove cm_t35 boardJagan Teki2020-07-091-249/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DM, DM_SPI and other driver model migration deadlines are expired for this board. Remove it. Cc: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
| * | arm: Remove cm_t54 boardJagan Teki2020-07-091-120/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DM, DM_SPI and other driver model migration deadlines are expired for this board. Remove it. Cc: Dmitry Lifshitz <lifshitz@compulab.co.il> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
| * | siemens: draco: Enable DM_SPI, DM_SPI_FLASHJagan Teki2020-07-091-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Enable DM_SPI, DM_SPI_FLASH for siemens draco board. Build is fine, but not tested. Cc: Samuel Egli <samuel.egli@siemens.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
* | | Merge tag 'uniphier-v2020.10' of ↵Tom Rini2020-07-111-22/+2
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-uniphier UniPhier SoC updates for v2020.10 - remove workaround for Cortex-A72 - increase U-Boot proper size to 2MB - sync DT with Linux - add system bus controller driver - improve serial driver - add reset assertion to Denali NAND driver
| * | ARM: uniphier: remove support for NOR Flash on support cardMasahiro Yamada2020-07-111-20/+0
| | | | | | | | | | | | | | | | | | | | | I actually do not see this used these days because eMMC or NAND is used for non-volatile devices. Dump the burden to maintain this crappy code. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
| * | ARM: uniphier: increase CONFIG_SYS_MONITOR_LEN to 2MBMasahiro Yamada2020-07-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I increased the maximum U-Boot proper size from time to time, but configs/uniphier_v7_defconfig hit the current limit 832KB. Some historical info: In the initial support, the max size was 512MB. Commit 58d702274c09 ("ARM: uniphier: increase CONFIG_SYS_MONITOR_LEN") increased it to 576KB, and commit 3ce5b1a8d86d ("ARM: uniphier: move SPL stack address") moved the SPL stack location to avoid the memory map conflict. It was the solution to increase the size without changing the NOR boot image map. commit 1a4bd3a095b2 ("ARM: uniphier: increase CONFIG_SYS_MONITOR_LEN again") ended up with increasing the max size again, breaking the NOR boot image map. The limit was set to 832KB, otherwise the SPL stack would overwrite the U-Boot proper image: CONFIG_SPL_STACK - CONFIG_SYS_UBOOT_BASE + sizeof(struct image_header) = 0xd0000 To increase CONFIG_SYS_MONITOR_LEN even more, the SPL stack must be moved somewhere. I put it back to the original location prior to commit 3ce5b1a8d86d. With this change, there is no more practical size limit. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* | | Merge tag 'dm-pull-10jul20' of ↵Tom Rini2020-07-107-6/+61
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-dm of-platdata: better phandle and compatible-string support patman support for Python3 on Ubuntu 14.04 new checkpatch check to avoid #ifdefs
| * | dtoc: extend dtoc to use struct driver_info when linking nodesWalter Lozano2020-07-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current implementation, when dtoc parses a dtb to generate a struct platdata it converts the information related to linked nodes as pointers to struct platdata of destination nodes. By doing this, it makes difficult to get pointer to udevices created based on these information. This patch extends dtoc to use struct driver_info when populating information about linked nodes, which makes it easier to later get the devices created. In this context, reimplement functions like clk_get_by_index_platdata() which made use of the previous approach. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>