aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-07-23reboot-mode: read the boot mode from RTC memoryNandor Han
RTC devices could provide battery-backed memory that can be used for storing the reboot mode magic value. Add a new reboot-mode back-end that uses RTC to store the reboot-mode magic value. The driver also supports both endianness modes. Signed-off-by: Nandor Han <nandor.han@vaisala.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23reboot-mode: read the boot mode from GPIOs statusNandor Han
A use case for controlling the boot mode is when the user wants to control the device boot by pushing a button without needing to go in user-space. Add a new backed for reboot mode where GPIOs are used to control the reboot-mode. The driver is able to scan a predefined list of GPIOs and return the magic value. Having the modes associated with the magic value generated based on the GPIO values, allows the reboot mode uclass to select the proper mode. Signed-off-by: Nandor Han <nandor.han@vaisala.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23reboot-mode: add support for reboot mode controlNandor Han
A new driver uclass is created to handle the reboot mode control. The new uclass driver is updating an environment variable with the configured reboot mode. The mode is extracted from a map provided at initialization time. The map contains a list of modes and associated ids. Signed-off-by: Nandor Han <nandor.han@vaisala.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23Merge branch '2021-07-23-assorted-fixes'Tom Rini
- Assorted FIT, optee, pcf8575, mux, vexpress64 and distro bootcmd fixes. - Allow pinmux status to take pin names
2021-07-23net: remove CONFIG_NET_MULTI (again)Michal Simek
CONFIG_NET_MULTI has been removed long time ago by commit 795428fc679f ("net: remove CONFIG_NET_MULTI") but 4 boards were added later which wasn't found. The patch is removing this reference from 4 boards. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
2021-07-23mux: correct prototype for mux_control_try_select()Patrick Wildt
The macro should be passed a state, which should be passed to the actual function. Otherwise using that macro would yield a build error. Signed-off-by: Patrick Wildt <patrick@blueri.se> Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
2021-07-23arm: vexpress64: juno: Enable distro_bootcmd functionalityAndre Przywara
The ARM Juno boards can be used as somewhat decent machines to run off-the-shelf distributions, with USB, SATA, GBit Ethernet and 8GB of DRAM. With stable DTs in the board's NOR flash this would work really nicely, however the default boot command is to fetch a kernel and an initrd from the on-board NOR flash, which sounds somewhat embedded. Include the config_distro_bootcmd.h header and define the available devices (starting with USB, to catch USB installer sticks) to make distributions and UEFI work out of the box. The NOR flash kernel functionality is still preserved as the last resort, should all other methods fail. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2021-07-23distro_boot: Fix block device after DHCP boot sequenceAndre Przywara
The generic distro boot sequence iterates over several types of devices, trying one after another. In doing do, it starts with setting the "devtype" variable, then uses this later in more generic commands. Now most (block) device types use a local variable for that, but DHCP puts the type into the environment, where it shadows any local variables. As a consequence any boot attempt after bootcmd_dhcp has been run fails: =========================== VExpress64# run bootcmd_dhcp ... VExpress64# run bootcmd_sata0 SATA#0: (3.0 Gbps) SATA#1: (No RDY) Device 0: Model: 16GB SATA Flash Drive .... ... is now current device Couldn't find partition dhcp 0:1 =========================== This problem typically doesn't show, because DHCP is mostly the last command to try, but is a problem when this order is different, or when distro_bootcmd or bootcmd_xxx are run separately or multiple times. Let bootcmd_dhcp use a local variable, as the other kids do, to make the order of boot commands irrelevant, and allow repeated calls. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23Kconfig.boot: Make 0x0 the default SYS_TEXT_BASE for POSITION_INDEPENDENTTom Rini
When we build U-Boot with POSITION_INDEPENDENT we must have SYS_TEXT_BASE be set to zero. Make this the default in that case. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2021-07-23fit: Allow external data for FDTsJohn Keeping
Switch to fit_image_get_data_and_size() for consistency with all other data loaded from FIT. Signed-off-by: John Keeping <john@metanate.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23cmd: part: Correct error handlingAnders Dellien
As 'part_get_info_by_name' now returns more status codes than just -1 to indicate failure, we need to update the return value check. Signed-off-by: Anders Dellien <anders.dellien@arm.com> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2021-07-23i2c: pcf8575: Add support for 8 bit I2C IO expanders (like pca8574)Lukasz Majewski
This patch add support for using NXP's pca8574 I2C IO expander, which has only 8 IO lines. After this change the .data member's information from struct udevice_id are used to either sent one or two bytes. Moreover, the '_le16' suffix from pcf8575_i2c_{write|read}_le16() functions have been removed as now we also sent 8 bit data. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
2021-07-23i2c: pcf8575: Remove not used members of pcf8575_chip structureLukasz Majewski
Those members are not used anymore as ones from gpio_dev_priv structure (when DM_GPIO support is enabled) are used instead. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
2021-07-23cmd: pinmux: support pin name in status commandPatrick Delaunay
Allow pin name parameter for pimux staus command, as gpio command to get status of one pin. The possible usage of the command is: > pinmux dev pinctrl > pinmux status > pinmux status -a > pinmux status <pin-name> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23cmd: pinmux: update result of do_statusPatrick Delaunay
Update the result of do_status and always returns a CMD_RET_ value (-ENOSYS was a possible result of show_pinmux). This patch also adds pincontrol name in error messages (dev->name) and treats correctly the status sub command when pin-controller device is not selected. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23tee: optee: sync cache on pre-reloc OP-TEE invocationEtienne Carriere
This change ensures both U-Boot and OP-TEE see the same content from shared memory when OP-TEE is invoked prior U-Boot relocation. This change is required since U-Boot may execute with data cache off while OP-TEE always enables cache on memory shared with U-Boot. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-07-23spl: use CONFIG_IS_ENABLED(LOAD_FIT_FULL)John Keeping
It's possible that LOAD_FIT_FULL will have different values for TPL and SPL, in which case just checking CONFIG_SPL_LOAD_FIT_FULL causes this to be compiled in to the TPL even though functions and struct members it depends on are not. Use CONFIG_IS_ENABLED() to ensure the correct TPL/SPL variant is checked. Signed-off-by: John Keeping <john@metanate.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-22Merge branch 'network_master' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-net
2021-07-22net: fsl-mc: fix logically dead codeCosmin-Florin Aluchenesei
The result of dpio_close() is actually taken into account. Signed-off-by: Cosmin-Florin Aluchenesei <aluchenesei.cosmin-florin@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-07-22drivers: net: aquantia: fix unsigned compared against 0Cosmin-Florin Aluchenesei
Change the reg variable to not be unsigned so that we not get into an unsigned compared against 0. Signed-off-by: Cosmin-Florin Aluchenesei <aluchenesei.cosmin-florin@nxp.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-07-22net: define LOG_CATEGORYPatrick Delaunay
Define LOG_CATEGORY to allow filtering with log command. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-07-22net: dwc_eth_qos: define LOG_CATEGORYPatrick Delaunay
Define LOG_CATEGORY to allow filtering with log command. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-07-22net: eth-phy: define LOG_CATEGORYPatrick Delaunay
Define LOG_CATEGORY to allow filtering with log command. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-07-22net: dwc: add a common empty ops eqos_null_opsPatrick Delaunay
Add a common empty ops: eqos_null_ops() to remove the duplicated empty functions and reduce the driver size for stm32 and imx config. This patch also aligns the prototype of ops 'eqos_stop_clks' with other eqos ops by adding return value. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-07-22net: dwc_eth_qos: use generic ethernet phy for stm32 variantPatrick Delaunay
Use the generic ethernet phy which already manages the correct binding for gpio reset, including the assert an deassert delays. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-07-22net: dwc_eth_qos: remove the field phyaddr of the struct eqos_privPatrick Delaunay
Since the commit commit 6a895d039ba7 ("net: Update eQos driver and FEC driver to use eth phy interfaces") the field phyaddr of driver private data struct eqos_priv is no more used in eqos_start() for the phy_connect() parameter. Now this variable is only initialized in eqos_probe_resources_stm32() it can be removed. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-07-22net: eth-phy: manage subnode mdio0Patrick Delaunay
Bind any subnode with name beginning by mdio, mdio0 for example, and not only the "mdio" as namei of subnode. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-07-22net: eth-phy: use dev_dbg and log_noticePatrick Delaunay
Replace debug trace and printf to log macros: - debug() replaced by dev_dbg() when device is available, this macro indicate the device name since commit ceb70bb870ac ("dm: Print device name in dev_xxx like Linux") - printf() replaced by log_notice() to allow dispatch to log backends. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-07-22net: eth-phy: add support of device tree configuration for gpio resetPatrick Delaunay
The gpio reset and the assert or deassert delay are defined in generic binding of the ethernet phy in Linux: Documentation/devicetree/bindings/net/ethernet-phy.yaml reset-gpios: maxItems: 1 description: The GPIO phandle and specifier for the PHY reset signal. reset-assert-us: description: Delay after the reset was asserted in microseconds. If this property is missing the delay will be skipped. reset-deassert-us: description: Delay after the reset was deasserted in microseconds. If this property is missing the delay will be skipped. See also U-Boot: doc/device-tree-bindings/net/phy.txt This patch adds the parsing of this common DT properties in the u-class "eth_phy_generic", used by default in the associated driver "eth_phy_generic_drv" This parsing function eth_phy_of_to_plat can be reused by other ethernet phy drivers for this uclass UCLASS_ETH_PHY. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-07-22net: Use phys_addr_t for SMC net device addressesPeter Hoyes
Use same type as eth_device->iobase and support addresses greater than INT_MAX. Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
2021-07-22Merge tag 'dm-pull-21jul21' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-dm dtoc improvements to show better warnings minor test build fixes sandbox fixes for SDL2 and running TPL bloblist resize feature binman multithreading
2021-07-22Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriqTom Rini
fsl-qoriq: Update mc firmware size, address in LS1088A, LS2088A, LX2 Updates on ls1043aqds, ls1043ardb Refactor I2C MUX Code on fsl-qoriq platforms.
2021-07-21Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscvTom Rini
2021-07-21dm: core: fix no null pointer detection in ofnode_get_addr_size_index()Chen Guanqiao
Fixed a defect of a null pointer being discovered by Coverity Scan: CID 331544: Null pointer dereferences (REVERSE_INULL) Null-checking "size" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Signed-off-by: Chen Guanqiao <chenguanqiao@kuaishou.com>
2021-07-21sandbox: don't set SA_NODEFER in signal handlerHeinrich Schuchardt
The sandbox can handle signals. Due to a damaged global data pointer additional exceptions in the signal handler may occur leading to an endless loop. In this case leave the handling of the secondary exception to the operating system. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-21binman: Add basic support for debugging performanceSimon Glass
One of binman's attributes is that it is extremely fast, at least for a Python program. Add some simple timing around operations that might take a while, such as reading an image and compressing it. This should help to maintain the performance as new features are added. This is for debugging purposes only. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21patman: Use bytearray instead of stringSimon Glass
If the process outputs a lot of data on stdout this can be quite slow, since the bytestring is regenerated each time. Use a bytearray instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21binman: Use bytearray instead of stringSimon Glass
This is faster if data is being concatenated. Update the section and collection etypes. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21binman: Split node-reading out from constructor in filesSimon Glass
The constructor should not read the node information. Move it to the ReadNode() method instead. This allows this etype to be subclassed. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21binman: Support multithreading for building imagesSimon Glass
Some images may take a while to build, e.g. if they are large and use slow compression. Support compiling sections in parallel to speed things up. Signed-off-by: Simon Glass <sjg@chromium.org> (fixed to use a separate test file to fix flakiness)
2021-07-21binman: Put compressed data into separate filesSimon Glass
At present compression uses the same temporary file for all invocations. With multithreading this causes the data to become corrupted. Use a different filename each time. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21log: Allow padding of the function nameSimon Glass
At present when function names are logged, the output is a little hard to read since every function is a different length. Add a way to pad the names so that the log messages line up vertically. This doesn't work if the function name is very long, but it makes a big difference in most cases. Use 20 characters as a default since this covers the vast majority of functions. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21blk: Support iterationSimon Glass
It is useful to be able to iterate over block devices. Typically there are fixed and removable devices. For security reasons it is sometimes useful to ignore removable devices since they are under user control. Add iterators which support selecting the block-device type. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21sandbox: mmc: Support fixed MMC devicesSimon Glass
Add support for reading devicetree flags for MMC devices. With this we can distinguish between fixed and removable drives. Note that this information is only available when the device is probed, not when it is bound, since it is read in the of_to_plat() method. This could be changed if needed later. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-07-21spl: Provide more information on boot failureSimon Glass
If SPL fails to boot, try to provide an error code to indicate what is wrong. For example, if a uclass is missing, this can return -EPFNOSUPPORT (-96) which provides useful information. Add a helper for accessing the image-loader name so we can drop the use of #ifdefs in this code. Put this feature behind a CONFIG_SHOW_ERRORS option to avoid increasing the code size. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21image: Allow @ in node names when not using signaturesSimon Glass
If signature verification is not in use we don't need to worry about the risk of using @ in node names. Update fit_image_verify() to allow it if the function is not enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21bloblist: Correct condition in bloblist_addrec()Simon Glass
It is possible to add a blob that ends at the end of the bloblist, but at present this is not supported. Fix it and add a regression test for this case. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21bloblist: Tidy up a few API commentsSimon Glass
Some comments for struct bloblist_hdr are a bit ambiguous. Update them to clarify the meaning more precisely. Also document bloblist_get_stats() properly. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21bloblist: Support resizing a blobSimon Glass
Sometimes a blob needs to expand, e.g. because it needs to hold more log data. Add support for this. Note that the bloblist must have sufficient spare space for this to work. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21cros_ec: Use standard calls for recovery-request checkingSimon Glass
Rather than calling directly into the sandbox SDL code, we can use the normal U-Boot console handling for this feature. Update the code, to make it more generic. Signed-off-by: Simon Glass <sjg@chromium.org>