summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'dm-pull-8jan20' of git://git.denx.de/u-boot-dmWIP/09Jan2020Tom Rini2020-01-0927-297/+767
|\ | | | | | | dm: Increased separation of ofdata_to_platdata() and probe methods
| * log: Include missing header for log.hSean Anderson2020-01-071-0/+1
| | | | | | | | | | | | | | log.h references cmd_tbl_t but command.h was not included Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * dm: Add a debug message when devices are skipped pre-relocSean Anderson2020-01-071-1/+3
| | | | | | | | | | | | | | | | | | This adds a message to lists_bind_fdt when it skips initializing a device pre-relocation. I've had a couple errors where a device didn't initialize properly because one of its dependencies was missing. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
| * Include missing headers for fdt_support.hSean Anderson2020-01-071-0/+1
| | | | | | | | | | | | | | fdt_support.h is missing declarations for bd_t. Including asm/u-boot.h pulls in the definition. Signed-off-by: Sean Anderson <seanga2@gmail.com>
| * binman: fix default filename of u-boot-with-ucode-ptr in documentationMasahiro Yamada2020-01-072-2/+2
| | | | | | | | | | | | | | | | The suffix should be ".bin" instead of ".dtb" . Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * dm: devres: Add a new OFDATA phaseSimon Glass2020-01-074-9/+37
| | | | | | | | | | | | | | Since the ofdata_to_platdata() method can allocate resources, add it as a new devres phase. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: devres: Use an enum for the allocation phaseSimon Glass2020-01-071-6/+16
| | | | | | | | | | | | | | | | At present we only support two phases where devres can be used: bind and probe. This is handled with a boolean. We want to add a new phase (platdata), so change this to an enum. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: devres: Add testsSimon Glass2020-01-074-0/+212
| | | | | | | | | | | | | | The devres functionality has very few users in U-Boot, but it still should have tests. Add a few basic tests of the main functions. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: test: Add a test driver for devresSimon Glass2020-01-074-0/+61
| | | | | | | | | | | | | | Add a driver which does devres allocations so that we can write tests for devres. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: devres: Convert to use loggingSimon Glass2020-01-072-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | At present when CONFIG_DEBUG_DEVRES is enabled, U-Boot prints log messages to the console with every devres allocation/free event. This causes most tests to fail since the console output is not as expected. In particular this prevents us from adding a device to sandbox which uses devres in its bind method. Move devres over to use U-Boot's logging feature instead, and add a new category for devres. Signed-off-by: Simon Glass <sjg@chromium.org>
| * test: Add functions to find the amount of allocated memorySimon Glass2020-01-072-0/+30
| | | | | | | | | | | | | | | | | | The malloc() implementations provides a way of finding out the approximate amount of memory that is allocated. Add helper functions to make it easier to access this and see changes over time. This is useful for tests that want to check if memory has been allocated or freed. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: devres: Create a new devres header fileSimon Glass2020-01-072-254/+270
| | | | | | | | | | | | | | | | | | | | At present these functions are lumped in with the core device functions. They have their own #ifdef to control their availability, so it seems better to split them out. Move them into their own header file. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Add a new flag to track platform dataSimon Glass2020-01-073-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | We want to avoid allocating platform data twice. This could happen if device_probe() is called after device_ofdata_to_platdata() for the same device. Add a flag to track whether device_ofdata_to_platdata() has been called on a device. Check the flag to make sure it doesn't happen twice, and clear the flag when the data is freed. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Export a new function to read platdataSimon Glass2020-01-072-2/+43
| | | | | | | | | | | | | | | | | | | | Add a new internal function, device_ofdata_to_platdata() to handle allocating private space associated with each device and reading the platform data from the device tree. Call this new function from device_probe(). Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Add a comment for DM_FLAG_OF_PLATDATASimon Glass2020-01-071-0/+1
| | | | | | | | | | | | This flag is missing a comment. Add one. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Allocate parent data separate from probing parentSimon Glass2020-01-071-8/+11
| | | | | | | | | | | | | | | | At present the parent is probed before the child's ofdata_to_platdata() method is called. Adjust the logic slightly so that probing parents is not done until afterwards. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Move ofdata_to_platdata() call earlierSimon Glass2020-01-071-7/+7
| | | | | | | | | | | | | | | | This method is supposed to extract platform data from the device tree. It should be done before the device itself is probed. Move it earlier in the device_probe() function. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Don't clear active flag twice when probe() failsSimon Glass2020-01-071-3/+1
| | | | | | | | | | | | Remove this duplicated code, since the 'fail' label does this immediately. Signed-off-by: Simon Glass <sjg@chromium.org>
| * aspeed: ast2500: Read clock ofdata in the correct methodSimon Glass2020-01-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present the clock driver reads its ofdata in the probe() method. This is not correct although it is often harmless. However in this case it causes a problem, something like this: - ast_get_scu() is called (from somewhere) to get the SCI address - this probes the clock - first sets up ofdata (which does nothing at present) - DM marks clock device as active - DM calls pinctrl - pinctrl probes and calls ast_get_scu() in ast2500_pinctrl_probe() - ast_get_scu() probes the clock, but sees it already marked as probed - ast_get_scu() accesses the clock's private data, with scu as NULL - DM calls clock probe function ast2500_clk_probe() which reads scu By putting the read of scu into the correct method, scu is read as part of ofdata setup, and everything is OK. Note: This problem did not matter until now since DM always probed all parents before reading a child's ofdata. The fact that pinctrl is a child of clock seems to trigger this strange bug. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Cédric Le Goater <clg@kaod.org>
| * pci: Print a warning if the bus is accessed before probingSimon Glass2020-01-071-0/+13
| | | | | | | | | | | | | | | | It is not possible to access a device on a PCI bus that has not yet been probed, since the bus number is not known. Add a warning to catch this error. Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: apl: Avoid accessing the PCI bus before it is probedSimon Glass2020-01-072-11/+29
| | | | | | | | | | | | | | | | The PCI bus is not actually probed by the time the ofdata_to_platdata() method is called since that happens in the uclass's post_probe() method. Update the PMC and P2SB drivers to access the bus in its probe() method. Signed-off-by: Simon Glass <sjg@chromium.org>
| * usb: Drop use of BUG_ON() and WARN_ON()Simon Glass2020-01-074-1/+13
| | | | | | | | | | | | | | | | | | | | | | These macros use __FILE__ which inserts the full path of the object file into U-Boot, thus increasing file size. Drop these usages. An older version of this patch was submitted here: http://patchwork.ozlabs.org/patch/1205784/ Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Use assert_noisy() in devresSimon Glass2020-01-071-3/+3
| | | | | | | | | | | | Use this macros instead of the linux ones, as the output is smaller. Signed-off-by: Simon Glass <sjg@chromium.org>
| * common: Add a noisy assert()Simon Glass2020-01-071-0/+14
| | | | | | | | | | | | | | | | | | | | Some U-Boot code uses BUG_ON() and WARN_ON() macros. These use __FILE__ which can include quite a large path, depending on how U-Boot is built. The existing assert() is only checked if DEBUG is enabled. Add a new one which is always checked, and prints a (smaller) error in that case. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2020-01-097-10/+71
|\ \ | | | | | | | | | - DFU updates
| * | x86: edison: Enable DFU timeoutAndy Shevchenko2020-01-071-0/+1
| | | | | | | | | | | | | | | | | | | | | The stock U-Boot on Intel Edison has timeout parameter for DFU command. Enable it here to be compatible with the original U-Boot configuration. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * | dfu: Add optional timeout parameterAndy Shevchenko2020-01-076-4/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the `dfu` command is called from the U-Boot environment, it now accepts an optional parameter that specifies a timeout (in seconds). If a DFU connection is not made within that time the `dfu` command exits (as it would if Ctrl+C was pressed). If the timeout is left empty or being zero the `dfu` command behaves as it does now. This is useful for allowing U-Boot to check to see if anything wants to upload new firmware before continuing to boot. The patch is based on the commit https://github.com/01org/edison-u-boot/commit/5e966ccc3c65c18c9783741fa04e0c45e021780c by Sebastien Colleur, which has been heavily reworked due to U-Boot changes in the past. Signed-off-by: Brad Campbell <bradjc5@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * | dfu: Refactor do_dfu() to handle optional argumentAndy Shevchenko2020-01-071-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | In the future we may utilize optional argument in 'dfu' command line. As a preparation for this, refactor do_dfu(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Lukasz Majewski <lukma@denx.de>
| * | dfu: Drop unused prototype of dfu_trigger_reset()Andy Shevchenko2020-01-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the commit 1cc03c5c53c0 ("dfu: Provide means to find difference between dfu-util -e and -R") the dangling ptototype appeared. Remove it here. Fixes: 1cc03c5c53c0 ("dfu: Provide means to find difference between dfu-util -e and -R") Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Stephen Warren <swarren@nvidia.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Lukasz Majewski <lukma@denx.de>
* | | Merge tag 'efi-2020-04-rc1' of ↵WIP/08Jan2020Tom Rini2020-01-0857-83/+1719
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-04-rc1 This pull request provides: * support for FIT images for UEFI binaries * drivers for hardware random number generators * an implementation of the EFI_RNG_PROTOCOL * a sub-command for efidebug to display configuration tables
| * | | efi_selftest: unit test for EFI_RNG_PROTOCOLHeinrich Schuchardt2020-01-072-0/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a unit test for the EFI_RNG_PROTOCOL. The list of algorithms is read. Two random numbers are generated. The test checks that the two numbers differ. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | | efi_rng_protocol: Install the efi_rng_protocol on the root nodeSughosh Ganu2020-01-073-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by the kernel for features like kaslr. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | | efi: qemu: arm64: Add efi_rng_protocol implementation for the platformSughosh Ganu2020-01-075-0/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the EFI_RNG_PROTOCOL routines for the qemu arm64 platform. EFI_RNG_PROTOCOL is an uefi boottime service which is invoked by the efi stub in the kernel for getting random seed for kaslr. The routines are platform specific, and use the virtio-rng device on the platform to get random data. The feature can be enabled through the following config CONFIG_EFI_RNG_PROTOCOL Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Changed SPDX header to use /* instead of //. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | | cmd: add rng commandHeinrich Schuchardt2020-01-073-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the RNG uclass we currently only have a test working on the sandbox. Provide a command to test the hardware random number generator on non-sandbox systems. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | | virtio: rng: Add a random number generator(rng) driverSughosh Ganu2020-01-075-1/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a driver for the virtio-rng device on the qemu platform. The device uses pci as a transport medium. The driver can be enabled with the following configs CONFIG_VIRTIO CONFIG_DM_RNG CONFIG_VIRTIO_PCI CONFIG_VIRTIO_RNG Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
| * | | test: rng: Add basic test for random number generator(rng) uclassSughosh Ganu2020-01-072-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a unit test for testing the rng uclass functionality using the sandbox rng driver. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | configs: sandbox: Enable random number generator(rng) deviceSughosh Ganu2020-01-072-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable support for random number generator on sandbox configs. This is aimed primarily at adding unit test support for rng uclass. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | sandbox: rng: Add a random number generator(rng) driverSughosh Ganu2020-01-074-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a sandbox driver for random number generation. Mostly aimed at providing a unit test for rng uclass. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | configs: stm32mp15: Enable random number generator(rng) deviceSughosh Ganu2020-01-073-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable support for the rng device on the stm32mp15 configs. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
| * | | stm32mp1: rng: Add a driver for random number generator(rng) deviceSughosh Ganu2020-01-073-0/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a driver for the rng device found on stm32mp1 platforms. The driver provides a routine for reading the random number seed from the hardware device. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Acked-by: Patrick Delaunay <patrick.delaunay@st.com> Remove a superfluous blank line Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | | clk: stm32mp1: Add a clock entry for RNG1 deviceSughosh Ganu2020-01-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an entry for allowing clock enablement for the random number generator peripheral, RNG1. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
| * | | dm: rng: Add random number generator(rng) uclassSughosh Ganu2020-01-077-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a uclass for reading a random number seed from a random number generator device. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | test/py: Create a test for launching UEFI binaries from FIT imagesCristian Ciocaltea2020-01-071-0/+458
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test verifies the implementation of the 'bootm' extension that handles UEFI binaries inside FIT images (enabled via CONFIG_BOOTM_EFI). Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | | doc: uefi.rst: Document launching UEFI binaries from FIT imagesCristian Ciocaltea2020-01-071-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new section "Launching a UEFI binary from a FIT image" documenting the usage of the CONFIG_BOOTM_EFI extension to bootm command that offers a verified boot alternative for UEFI binaries such as GRUB2. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | | doc: Add sample uefi.its image description fileCristian Ciocaltea2020-01-071-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds an example FIT image description file demonstrating the usage of bootm command to securely launch UEFI binaries. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | | bootm: Add a bootm command for type IH_OS_EFICristian Ciocaltea2020-01-072-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for booting EFI binaries contained in FIT images. A typical usage scenario is chain-loading GRUB2 in a verified boot environment. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | | image: Add IH_OS_EFI for EFI chain-load bootCristian Ciocaltea2020-01-073-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new OS type to be used for chain-loading an EFI compatible firmware or boot loader like GRUB2, possibly in a verified boot scenario. Bellow is sample ITS file that generates a FIT image supporting secure boot. Please note the presence of 'os = "efi";' line, which identifies the currently introduced OS type: / { #address-cells = <1>; images { efi-grub { description = "GRUB EFI"; data = /incbin/("bootarm.efi"); type = "kernel_noload"; arch = "arm"; os = "efi"; compression = "none"; load = <0x0>; entry = <0x0>; hash-1 { algo = "sha256"; }; }; }; configurations { default = "config-grub"; config-grub { kernel = "efi-grub"; signature-1 { algo = "sha256,rsa2048"; sign-images = "kernel"; }; }; }; }; Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | | cmd: efidebug: capitalize UEFIHeinrich Schuchardt2020-01-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | %s/uefi/UEFI/g Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | | cmd: efidebug: new sub-command tablesHeinrich Schuchardt2020-01-071-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | Provide sub-command for efidebug to list configuration tables. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | | cmd: efidebug: simplify get_guid_text()Heinrich Schuchardt2020-01-071-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we hit a matching GUID we can directly return the text. There is no need for a check after the loop. efi_guid_t is defined as 8 byte aligned but GUIDs in packed structures do not follow this alignment. Do not require the argument of get_guid_text() to be correctly aligned. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>