aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-04-24cmd: part: add explicit dependency on PARTITIONSWIP/24Apr2022AKASHI Takahiro2-1/+1
This is a follow-up patch for my "disk: don't compile in partition support for spl/tpl if not really necessary". "part" command is useful only if, at least, one of partition table types is selected. So it should have a dependency on PARTITIONS which is now automatically selected if one of partition table types is enabled. With this change, *_defconfig which explicitly selects CMD_PART but has no partition table types enabled should also be fixed. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2022-04-23Merge tag 'efi-2022-07-rc1-3' of ↵WIP/23Apr2022Tom Rini25-168/+789
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-07-rc1-3 Documentation: * Document image size parameter of bootefi command UEFI: * avoid building partition support in SPL/TPL where not required * improve integration of EFI subsystem and driver model * restore ability to boot arbitrary blob
2022-04-23efi_loader: disk: use udevice instead of blk_descAKASHI Takahiro1-6/+16
In most of all cases, we can avoid using blk_desc which is expected to be private to udevice(UCLASS_BLK), that is, the data should not be manipulated outside the device driver unless really needed. Now efi_disk's internally use dev_read/write() interfaces if CONFIG_PARTITIONS is enabled. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-23dm: disk: add read/write interfaces with udeviceAKASHI Takahiro2-0/+101
In include/blk.h, Simon suggested: ===> /* * These functions should take struct udevice instead of struct blk_desc, * but this is convenient for migration to driver model. Add a 'd' prefix * to the function operations, so that blk_read(), etc. can be reserved for * functions with the correct arguments. */ unsigned long blk_dread(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, void *buffer); unsigned long blk_dwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, const void *buffer); unsigned long blk_derase(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt); <=== So new interfaces are provided with this patch. They are expected to be used everywhere in U-Boot at the end. The exceptions are block device drivers, partition drivers and efi_disk which should know details of blk_desc structure. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2022-04-23efi_loader: disk: not delete BLK device for BLK(IF_TYPE_EFI_LOADER) devicesAKASHI Takahiro1-2/+6
When we create an efi_disk device with an UEFI application using driver binding protocol, the 'efi_driver' framework tries to create a corresponding block device(UCLASS_BLK/IF_TYPE_EFI). This will lead to calling a PROBE callback, efi_disk_probe(). In this case, however, we don't need to create another "efi_disk" device as we already have this device instance. So we should avoid recursively invoke further processing in the callback function. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-23efi_loader: disk: a helper function to delete efi_disk objectsAKASHI Takahiro1-0/+88
This function is expected to be called, in particular from dm's pre_remove hook, when associated block devices no longer exist. Add efi_disk_remove() function. This function removes an efi_disk object for a raw disk device (UCLASS_BLK) and related objects for its partitions (UCLASS_PARTITION). So this function is expected to be called through driver model's "remove" interface every time a raw disk device is to be disconnected. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-23efi_loader: disk: not create BLK device for BLK(IF_TYPE_EFI_LOADER) devicesAKASHI Takahiro1-3/+11
When we create an efi_disk device with an UEFI application using driver binding protocol, the 'efi_driver' framework tries to create a corresponding block device(UCLASS_BLK/IF_TYPE_EFI). This will lead to calling a PROBE callback, efi_disk_probe(). In this case, however, we don't need to create another "efi_disk" device as we already have this device instance. So we should avoid recursively invoke further processing in the callback function. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-23efi_loader: disk: a helper function to create efi_disk objects from udeviceAKASHI Takahiro5-103/+143
Add efi_disk_probe() function. This function creates an efi_disk object for a raw disk device (UCLASS_BLK) and additional objects for related partitions (UCLASS_PARTITION). So this function is expected to be called through driver model's "probe" interface every time one raw disk device is detected and activated. We assume that partition devices (UCLASS_PARTITION) have been created when this function is invoked. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2022-04-23efi_loader: split efi_init_obj_list() into two stagesAKASHI Takahiro4-12/+57
In the next commit, CONFIG_EFI_SETUP_EARLY will become mandated in order to support dynamic enumeration of efi_disk objects. This can, however, be problematic particularly in case of file-based variable storage (efi_variable.c, default). Non-volatile variables are to be restored from EFI system partition by efi_init_variables() in efi_init_obj_list(). When efi_init_obj_list() is called in board_init_r(), we don't know yet what disk devices we have since none of device probing commands (say, scsi rescan) has not been executed at that stage. So in this commit, a preparatory change is made; efi_init_obj_list() is broken into the two functions; * efi_init_early(), and * new efi_init_obj_list() Only efi_init_early() will be called in board_init_r(), which allows us to execute any of device probing commands, either though "preboot" variable or normal command line, before calling efi_init_obj_list() which is to be invoked at the first execution of an efi-related command (or at efi_launch_capsules()) as used to be. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2022-04-23dm: blk: add a device-probe hook for scanning disk partitionsAKASHI Takahiro1-0/+4
Now that all the block device drivers have enable a probe hook, we will call part_create_block_devices() to enumerate all the partitions and create associated udevices when a block device is detected. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-23dm: disk: add UCLASS_PARTITIONAKASHI Takahiro4-0/+167
NOTE: probably we have to update config dependencies, in particular, SPL/TPL_PRINTF? With this new function, UCLASS_PARTITION devices will be created as child nodes of UCLASS_BLK device. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2022-04-23test: dm: add tests for tag supportAKASHI Takahiro2-0/+85
The new test covers all tag-related interfaces. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-23dm: tag: add some documentAKASHI Takahiro1-0/+21
Some basic stuff about tag support is explained under doc/devlop/driver-model. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-23dm: tag: change ENOSPC to ENOMEMAKASHI Takahiro1-2/+2
ENOMEM is a more common error code for memory starvation. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-04-23bootmenu: fix menu API error handlingMasahisa Kojima1-2/+2
U-Boot menu framework(common/menu.c) returns 1 if it is successful, returns negative value if it fails. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-04-23disk: don't compile in partition support for spl/tpl if not really necessaryAKASHI Takahiro1-18/+19
Under the current Kconfigs, disk/part.c will be compiled in even if none of partition table types are enabled. This will lead to the size growth of SPL /TPL code. With this patch, CONFIG_PARTITIONS is selected only if, at least, one of CONFIG_*_PARTITION is enabled. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2022-04-23efi_loader: disk: compile efi_disk when CONFIG_BLKAKASHI Takahiro1-1/+1
Now we can build efi_loader with block device support (CONFIG_BLK) and without CONFIG_PARTITIONS. So change Makefile. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2022-04-23efi_loader: PARTITION_UUIDS should be optionalAKASHI Takahiro2-3/+8
In the current implementation, partition table support (either GPT or DOS) is not mandatory. So CONFIG_PARTITION_UUIDS should not be enabled (selected) unconditionally. Fixes: commit 17f8cda505e3 ("efi_loader: set partition GUID in device path for SIG_TYPE_GUID") Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-04-23sandbox: move a function prototypeAKASHI Takahiro2-1/+2
Since host_get_dev_errr() is defined in drivers/block/sandbox.c, the associated function prototype should be in a more appropriate header file. Fixes: commit 4101f6879256 ("dm: Drop the block_dev_desc_t typedef") Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2022-04-23disk: define nullified functions for !PARTITIONSAKASHI Takahiro1-0/+16
Some defconfig enables CMD_PART even if none of any partition table types (CONFIG_*_PARTITION) are enabled. This will lead to the size growth in SPL/TPL code since disk/part.c will be compiled in any way. We will change disk/Kconfig later so that CONFIG_PARTITIONS is only enabled when, at least, one of CONFIG_*_PARTITION is enabled. To make the build work (in particular, "part" command) correctly, a few functions should be defined as void functions in case of !CONFIG_PARTITIONS. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2022-04-23disk: enable function prototypes in part.h for SPL/TPLAKASHI Takahiro1-2/+2
Since CONFIG_[SPL|TPL]_PARTITIONS were introduced, part.h has not been updated. Due to this, while the build won't fail, some functionality may possibly break as some partition-related functions are nullified even though some partition table types are enabled for SPL/TPL. Fixes: commit 88ca8e26958b ("disk: Add an option for partitions in SPL") Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2022-04-23disk: include errno.h explicitly in part.hAKASHI Takahiro1-0/+1
Some errno numbers are used in defining inline functions. So "errno.h" should be explicitly included to avoid possible build errors. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2022-04-23doc: update bootefi man-pageHeinrich Schuchardt1-3/+18
A image_size parameter has been added to the bootefi parameter. Describe all parameters. Correct how the description of how the device-path in the loaded image protocol is determined. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-04-23cmd: bootefi: restore ability to boot arbitrary blobKyle Evans1-14/+22
Up until commit 5f59518a7b1ae ("efi_loader: setting boot device"), we could boot an arbitrary blob with bootefi. Indeed, efi_run_image() even has a special case for missing device paths indicating a payload that was directly loaded via JTAG, for example. Restore the ability to inject a UEFI payload into memory and `bootefi` it. If the address passed isn't the last PE-COFF loaded, then we'll wipe out the pre-existing DP/Image information and let efi_run_image() synthesize a memory device path. An image size is required if we're booting an arbitrary payload, and the FDT argument has been changed to accept `-`. The size could be deduced from the image header, but it's required anyways as an explicit acknowledgment that one's trying to boot an arbitrary payload rather than accidentally using the wrong address in the single-addr form. Fixes: 5f59518a7b1a ("efi_loader: setting boot device") Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-04-23tools: kwboot: Fix spelling of "followed" in kwboot.1Vagrant Cascadian1-1/+1
Fix spelling of "followed" in kwboot.1 manpage. Series: 2 Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2022-04-23doc: board: apple: Mention M1 Ultra supportMark Kettenis1-1/+2
U-Boot now supports the M1 Ultra SoC as found in the new Mac Studio. Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2022-04-23Merge branch '2022-04-22-assorted-updates'Tom Rini8-17/+91
- Add "-q" to fdt addr and use it in distro_bootcmd to make the user experience less scary reading in normal try/fail cases. - Let the adc update an environment variable like many other commands do - Fix TPL SEPARATE_BSS check when locating DTB - Allow ":" in PXE file names again - Two Apple M1 fixes
2022-04-22arm: apple: Point stdout-path to framebuffer when keyboard presentWIP/2022-04-22-assorted-updatesMark Kettenis2-0/+41
Unless you have a spare Apple Silicon machine, getting access to the serial port on Apple Silicon machines requires special hardware. Given that most machines come with a built-in screen the framebuffer is likely to be the most convenient output device for most users. While U-Boot will output to both serial and framebuffer, OSes might not. Therefore set stdout-path to point at /chosen/framebuffer when a keyboard is connected to the machine. This behaviour can be overridden by setting the "stdout" variable in the U-Boot environment. I addition to that keep the serial console as the default when running under the m1n1 hypervisor. The m1n1 hypervisor virtualizes the serial port such that it can be easily accessed from any other machine with a USB port. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Janne Grunau <j@jannau.net> Tested-by: Janne Grunau <j@jannau.net>
2022-04-22arm: apple: Don't clear framebufferMark Kettenis1-0/+2
Enable CONFIG_NO_FB_CLEAR to preserve the Asahi logo. Since that logo is drawn on a black background also enable CONFIG_SYS_WHITE_ON_BLACK such that text printed by U-Boot is still visible. Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2022-04-22Allow colon in PXE bootfile URLsLyle Franklin1-2/+7
- U-boot's PXE flow supports prefixing your bootfile name with an IP address to fetch from a server other than the DHCP server, e.g. `hostIPaddr:bootfilename`: https://github.com/u-boot/u-boot/commit/a93907c43f847f076dd0e34ee3b69b5e8e6d0d29 - However, this breaks bootfile paths which contain a colon, e.g. `f0:ad:4e:10:1b:87/7/pxelinux.cfg/default` - This patch checks whether the `hostIPaddr` prefix is a valid IP address before overriding the serverIP otherwise the whole bootfile path is preserved Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>
2022-04-22fdt: Add -q option to fdt addr for distro_bootcmdPeter Hoyes2-10/+26
distro_bootcmd uses this construct a few times to test $fdt_addr_r, and fall back on $fdtcontroladdr if not set/invalid: if fdt addr ${fdt_addr_r}; then ... else ... fi If the `fdt addr` test fails, it prints the following message on the console, suggesting there is an error when there is not: libfdt fdt_check_header(): FDT_ERR_BADMAGIC To remove this potentially confusing error message, this patch adds -q as a 'quiet' option for fdt addr, and uses this flag in config_distro_bootcmd.h Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
2022-04-22cmd: adc: Add support for storing ADC result in env variableMarek Vasut1-4/+14
Add the ability to save ADC conversion result in an environment variable. This is useful for further arbitrary processing by the U-Boot scripts. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-04-22fdt: Fix TPL SEPARATE_BSS check when locating DTBAndrew Abbott1-1/+1
Commit 690af71850149bf242502f688eca80fb302d1f76 changed this condition from an explicit IS_ENABLED(CONFIG_SPL_SEPARATE_BSS) to CONFIG_IS_ENABLED(SEPARATE_BSS) The documentation for CONFIG_IS_ENABLED() in include/linux/kconfig.h implies that we will get the correct behaviour, but the actual behaviour differs such that this condition is now always false. This stopped TPL being able to load the device tree blob at least on the ROCKPro64 board (RK3399 SoC), since the wrong device tree location was chosen. The issues causing this behaviour with CONFIG_IS_ENABLED() are: 1. The documentation implies that CONFIG_SPL_BUILD => CONFIG_SPL_<option> is considered before the TPL equivalent. Actually, the TPL options have higher priority - see definition of _CONFIG_PREFIX. 2. The documentation implies a fallthrough, eg. if CONFIG_SPL_BUILD is defined but the CONFIG_SPL_<option> is not, then it will proceed to check if CONFIG_TPL_BUILD Actually, if CONFIG_TPL_BUILD is defined, then it stops there and CONFIG_SPL_BUILD is not considered - see definition of _CONFIG_PREFIX. During TPL build, at least for the ROCKPro64, both CONFIG_TPL_BUILD and CONFIG_SPL_BUILD are defined, but because of the above, only TPL options are considered. Since there is no CONFIG_TPL_SEPARATE_BSS, this fails. Fixes: 690af71850 ("fdt: Correct condition for SEPARATE_BSS") Signed-off-by: Andrew Abbott <andrew@mirx.dev>
2022-04-22Merge https://gitlab.denx.de/u-boot/custodians/u-boot-pmicWIP/22Apr2022Tom Rini1-1/+1
2022-04-22Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usbTom Rini4-3/+23
2022-04-22configs: Resync with savedefconfigTom Rini84-125/+1
Resync all defconfig files using moveconfig.py Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-22power-domain: Fix use of uninitialized value in dev_power_domain_ctrlSean Anderson1-1/+1
If dev_count_phandle_with_args returns 0 or another error, then pd will never have been initialized by power_domain_get_by_index. Avoid comparing against pd.dev in this situation. Fixes: 3e4fcfa4bc ("power-domain: fix hang in endless loop on i.MX8") Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-04-22Merge https://gitlab.denx.de/u-boot/custodians/u-boot-watchdogTom Rini4-0/+137
- device-tree-bindings: watchdog: document common properties (Philippe) - nuvoton: Add support for Nuvoton (Jim)
2022-04-22Merge tag 'u-boot-imx-20220422' of ↵Tom Rini184-3023/+6016
https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20220422 ------------------- - Switch to DM_SERIAL - Drop MMCROOT - several cleanup CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/11815
2022-04-22Add support for TP-Link UE200 dongleOleksii Titov1-0/+2
Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Oleksii Titov <ootitov@gmail.com>
2022-04-22usb: dwc3: Add support for usb3-phy PHY configurationMichal Simek1-0/+18
When usb3-phy label is found, PHY driver is called and serdes line is initialized. This is preparation for serdes/psgtr driver to configure GT lines based on description in DT. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2022-04-22generic-phy: s/CONFIG_PHY/CONFIG_IS_ENABLED(PHY)/Michal Simek1-1/+1
Allow to disable PHY driver in SPL because it checks the CONFIG_SPL_PHY variable for SPL builds. The same change was done for usb by commit fd09c205fc57 ("usb: s/CONFIG_DM_USB/CONFIG_IS_ENABLED(DM_USB)/"). Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2022-04-22usb: gadget: ci: Make various ops constAdam Ford1-2/+2
ci_udc_ops and ci_ep_ops do not change their operations. Mark them as const. Signed-off-by: Adam Ford <aford173@gmail.com>
2022-04-22wdt: nuvoton: Add support for NuvotonJim Liu3-0/+125
Add watchdog controller driver for NPCM7xx/npcm8xx the wdt design of npcm750 and npcm845 is the same. so the driver can work on npcm750 and npcm845. about npcm845 wdt dtsi i will followed kernel dts name to use nuvoton,npcm750-wdt. Signed-off-by: Jim Liu <JJLIU0@nuvoton.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-22doc: device-tree-bindings: watchdog: document common propertiesPhilippe Reynes1-0/+12
Adds simple documentation about common properties for watchdog in the device tree. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-04-21Merge branch '2022-04-21-further-cleanups'Tom Rini283-524/+374
- Fix SPL_SYS_MALLOC_SIMPLE and non-SPL_FRAMEWORK boards (a large number of PowerPC platforms) - Remove duplication of crc16 functionality - Migrate COUNTER_FREQUENCY to CONFIG_COUNTER_FREQUENCY and have it in Kconfig
2022-04-21ARM: imx: imx8mn-evk: change environment address variablesHeiko Thiery3-6/+14
Currently the space between kernel_addr_r and the fdt_addr_r is only 32MB. To have enough space to load kernel images bigger than 32MB change the variables to a feasible value. The new environment variables layout is based on the scheme from "include/configs/ti_armv7_common.h". The CONFIG_SYS_LOAD_ADDR value is set to 0x42000000. With that we have the same value as for the kernel_addr_r. Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2022-04-21configs: imx: drop IMX_FEC_BASEPeng Fan17-18/+0
IMX_FEC_BASE is not used in these boards, so drop it. Reviewed-by: Fabio Estevam <festevam@denx.de> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-04-21imx8mm-cl-iot-gate: Remove redundant board_fix_fdt()Ying-Chun Liu (PaulLiu)1-5/+0
In arch/arm/mach-imx/imx8m/soc.c there's an implementation of board_fix_fdt() introduced by commit 35bb60787b88. Remove the redundant one to avoid failed to build from source when enabling CONFIG_OF_BOARD_FIXUP. Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> Cc: Fabio Estevam <festevam@gmail.com> Cc: uboot-imx <uboot-imx@nxp.com> Reviewed-by: Fabio Estevam <festevam@denx.de>
2022-04-21arm: set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is validWIP/2022-04-21-further-cleanupsPeng Fan9-13/+13
Since COUNTER_FREQUENCY is obselete, so set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is valid Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>