summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-04-25bootstd: Add a bootdev commandSimon Glass6-0/+134
Add a 'bootdev' command to handle listing and selection of bootdevs. Disable standard boot for a few boards which otherwise run out of space. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25bootstd: Add support for bootflowsSimon Glass6-3/+475
Add support for bootflows, including maintaining a list of them and iterating to find them. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25bootstd: Add the bootmeth uclass and helpersSimon Glass7-2/+605
A bootmeth is a method of locating an operating system. For now, just add the uclass itself. Drivers for particular bootmeths are added later. If no bootmeths devices are included in the devicetree, create them automatically. This avoids the need for boilerplate in the devicetree files. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25bootstd: Add the bootdev uclassSimon Glass6-1/+928
A 'bootdev' is a device which can be used to boot an operating system. It is a child of the media device (e.g. MMC) which handles reading files from that device, such as a bootflow file. Add a uclass for bootdev and the various helpers needed to make it work. Also add a binding file, empty for now. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25bootstd: Add the bootstd uclass and core implementationSimon Glass9-0/+302
The 'bootstd' device provides the central information about U-Boot standard boot. Add a uclass for bootstd and the various helpers needed to make it work. Also add a binding file. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25bootstd: Add the concept of a bootflowSimon Glass2-0/+265
A bootflow encapsulates the process used to boot an operating system. It typically has a control file (such as extlinux.conf) and information about which 'bootdev' it came from. Add the header file for this first, since it is needed by all other files. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25fs: Add a function to set the filesystem typeSimon Glass2-0/+16
When sandbox is used with hostfs we won't have a block device, but still must set up the filesystem type before any filesystem operation, such as loading a file. Add a function to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25dm: blk: Add a function to return the device typeSimon Glass2-0/+15
Use the uclass name to get the device type for a block device. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25test: dm: Restart USB before assuming it is stoppedSimon Glass1-0/+6
Update the blk test to stop USB first, in case another test has started it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25test: fastboot: Avoid using mmc1Simon Glass1-2/+2
The bootflow tests need to use an MMC with an associated backing file containing a filesystem. Update the fastboot tests to cope with this. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25dm: core: Allow finding a uclass device by partial nameSimon Glass4-4/+42
In some cases two devices are related and the only way to tell is to check that the names partially patch. Add a way to check this without needing to create a new string for the comparison. Fix the comment for device_find_child_by_namelen() while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25dm: core: Rename and fix uclass_get_by_name_len()Simon Glass3-6/+9
It seems that namelen is more common in U-Boot. Rename this function to fit in better. Also fix a bug where it breaks the operation of uclass_get_by_name() and add a test. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reported-by: Tim Harvey <tharvey@gateworks.com>
2022-04-25lib: Add a way to find the postiion of a trailing numberSimon Glass3-3/+42
At present it is not possible to find out which part of the string is the number part and which is before it. Add a new variant which provides this feature, so we can separate the two in the caller. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25lib: Fix a few bugs in trailing_strtoln()Simon Glass3-5/+11
At present this has a minor bug in that it reads the byte before the start of the string, if it is empty. Also it doesn't handle a non-numeric prefix which is only one character long. Fix these bugs with a reworked implementation. Add a test for the second case. The first one is hard to test. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25lib: Correct comment formatting to avoid sphinx problemsSimon Glass1-46/+46
Tweak a few comments to kep sphinx happy, in case we want to include this file one day. Also fix the 'exxamine' typo. Patch-notes: This uses: sed -i 's/@param \(\S*\)\s*/@\1: /' include/vsprintf.h to convert the @param to the new format. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25test: Add tests for trailing_strtol()Simon Glass2-2/+21
This function currently has no tests. Add some. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25lib: Move string tests to the string moduleSimon Glass2-40/+40
A few string tests were added to the print module by mistake. Move them. Signed-off-by: Simon Glass <sjg@chromium.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 presentMark 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-pmicTom 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 validPeng 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>
2022-04-21include/configs: drop COUNTER_FREQUENCYPeng Fan69-155/+2
Since we have CONFIG_COUNTER_FREQUENCY enabled, no need COUNTER_FREQUENCY Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-04-21configs: set CONFIG_COUNTER_FREQUENCYPeng Fan184-4/+184
Set CONFIG_COUNTER_FREQUENCY according to COUNTER_FREQUENCY in config header file. Signed-off-by: Peng Fan <peng.fan@nxp.com> [trini: Re-run migration]
2022-04-21arch: arm: Kconfig: set default COUNTER_FREQUENCYPeng Fan1-0/+5
Set default COUNTER_FREQUENCY according to config header file under include/configs/ i.MX6UL/ULL/7D/8QM/8QXP all has system counter frequency run at 8MHz, so set default value for them. SUNXI/EXYNOS/ROCKCHIP_RK3128/ROCKCHIP_RK3288/ROCKCHIP_RK322X/ROCKCHIP_RK3036 at 24MHz. ARCH_LX2160A at 25MHz ARCH_ZYNQMP at 100MHz
2022-04-21arch: arm: move COUNTER_FREQUENCY from versal to armPeng Fan2-6/+12
Make COUNTER_FREQUENCY usable to armv8 and armv7-a, not limited to versal. And update help message. Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-04-21xilinx: versal: board: use CONFIG_COUNTER_FREQUENCYPeng Fan1-1/+1
Since versal has CONFIG_COUNTER_FREQUENCY, so use it. And COUNTER_FREQUENCY will be dropped. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com>
2022-04-21misc: atsha204a: Remove duplicate CRC-16 implementationPali Rohár2-119/+4
ATSHA204A uses bit-reversed checksum of standard CRC-16 with polynomial x^16 + x^15 + x^2 + 1. This ATSHA204A specific checksum can be calculated just by using common U-Boot functions bitrev16() and crc16(). So replace custom driver CRC-16 implementation by common U-Boot functions. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-04-21fs: ext4: Use CRC-16 implementation from linux/crc16.hPali Rohár5-84/+6
Implementation in linux/crc16.h provides standard CRC-16 algorithm with polynomial x^16 + x^15 + x^2 + 1. Use it and remove duplicate ext4 CRC-16 specific code. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-04-21crc16: Move standard CRC-16 implementation from ubifs to libPali Rohár4-1/+5
This implementation provides standard CRC-16 algorithm with polynomial x^16 + x^15 + x^2 + 1. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-04-21crc16: Rename fs/ubifs/crc16.h to include/linux/crc16.hPali Rohár4-3/+3
File fs/ubifs/crc16.h is standard linux's crc16.h include file. So move it from fs/ubifs to include/linux where are also other linux include files. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>