summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-10-10cmd: blk_common: Use macros for the return valuesBin Meng1-7/+7
Avoid using magic number 0/1 for the command result. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-10-10blk: blkmap: Support mapping to device of any block sizeBin Meng1-5/+5
At present if a device to map has a block size other than 512, the blkmap map process just fails. There is no reason why we can't just use the block size of the mapped device. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-10cmd: blkmap: Make map_handlers[] and its .fn staticBin Meng1-3/+4
These are only used in cmd/blkmap.c. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-10blk: blkmap: Make bind/unbind routines staticBin Meng1-2/+2
These 2 are only used in drivers/block/blkmap.c. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-10cmd: host: Print out the block size of the host deviceBin Meng2-13/+14
It's useful if we can print out the block size of the host device in the "host info" command. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-10blk: host_dev: Sanity check on the size of host backing fileBin Meng1-0/+5
Since we are emulating a block device, its size should be multiple of the configured block size. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-10blk: host_dev: Make host_sb_detach_file() and host_sb_ops staticBin Meng1-2/+2
They are only used in drivers/block/host_dev.c. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-10blk: sandbox: Support binding a device with a given logical block sizeBin Meng5-14/+37
Allow optionally set the logical block size of the host device to bind in the "host bind" command. If not given, defaults to 512. Signed-off-by: Bin Meng <bmeng@tinylab.org>
2023-10-10cmd: host: Mandate the filename parameter in the 'bind' commandBin Meng1-3/+3
At present the host bind command does not require filename to be provided. When it is not given NULL is passed to the host device driver, which ends up failure afterwards. Change to mandate the filename so that it is useful. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-10blk: Use a macro for the typical block sizeBin Meng10-10/+16
Avoid using the magic number 512 directly. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-10Merge branch '2023-10-09-assorted-fixes'Tom Rini146-698/+115
- Cleanup how we pick what to launch in SPL, a few test changes, some TI K3 platform updates, top-level Makefile fixes and related cleanup, correct a problem with LMB overlap, other assorted fixes.
2023-10-09test: Fix SPL tests not being runSean Anderson1-1/+2
SPL doesn't have OF_LIVE enabled, so we can only run tests with a flat tree. Don't skip them even if they don't use the devicetree. Fixes: 6ec5178c0ef ("test: Skip flat-tree tests if devicetree is not used") Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-09board/km/cent2: Fix buffer overflow when fixing MAC addressFrancois Berder1-1/+1
String "/soc/fman/ethernet@e8000" is 25 bytes long and not 24 due to extra byte for null character at the end. Signed-off-by: Francois Berder <fberder@outlook.fr>
2023-10-09stdio: fix stdio_deregister_dev()Heinrich Schuchardt2-4/+5
When copying the name of a stdio device we must ensure that it is NUL terminated before passing it to strcmp() to avoid a buffer overrun. Truncating the name field leads to failure to deregister a stdio device. When copying we must ensure that the name field sizes match. Addresses-Coverity-ID: 350462 String not null terminated Fixes: 5294e97832a6 ("stdio: extend "name" to 32 symbols") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-09dm: serial: fix serial_post_probe()Heinrich Schuchardt1-1/+1
The size of the name of a udevice is not limited. When setting the fixed sized name field of a stdio device we must ensure that the target string is NUL terminated to avoid buffer overflows. Fixes: 57d92753d4ca ("dm: Add a uclass for serial devices") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-09spl: Jump to image at end of board_init_rJonas Karlman1-5/+7
spl_board_prepare_for_boot() is not called before jumping/invoking atf, optee, opensbi or linux images. Jump to image at the end of board_init_r() to fix this. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-09spl: add __noreturn attribute to spl_invoke_atf functionChanho Park2-5/+5
spl_invoke_atf function will not be returned to SPL. Thus, we need to set __noreturn function attribute to the function. Signed-off-by: Chanho Park <chanho61.park@samsung.com>
2023-10-09tools: iot2050-sign-fw.sh: Make localization of tools dir more robustJan Kiszka1-4/+6
When building in-tree, there is no source link. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2023-10-09arm: mach-k3: common: fix compile warnings with PHYS_64BIT on 32bitMatthias Schiffer2-3/+3
Use uintptr_t instead of phys_addr_t where appropriate, so passing the addresses to writel() doesn't result in compile warnings when PHYS_64BIT is set for 32bit builds (which is actually a useful configuration, as the K3 SoC family boots from an R5 SPL, which may pass bank information based on gd->bd->bi_dram to fdt_fixup_memory_banks() etc., so PHYS_64BIT is needed for fixing up the upper bank). Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
2023-10-09test/py: sleep: Add a test for the time commandLove Kumar1-0/+18
Execute "time <sleep cmd>", and validate that it gives the approximately the correct amount of command execution time. Signed-off-by: Love Kumar <love.kumar@amd.com>
2023-10-09mailbox: k3-sec-proxy: fix error handling for missing scfg in FDTMatthias Schiffer1-1/+1
The wrong field was checked. Fixes: f9aa41023bd9 ("mailbox: Introduce K3 Secure Proxy Driver") Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Reviewed-by: Nishanth Menon <nm@ti.com>
2023-10-09test: lmb: Add test for coalescing and overlap rangeUdit Kumar1-1/+12
Add test case for an address range which is coalescing with one of range and overlapping with next range Cc: Simon Glass <sjg@google.com> Signed-off-by: Udit Kumar <u-kumar1@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-09lmb: remove overlapping region with next rangeUdit Kumar1-4/+33
In case of new memory range to be added is coalesced with any already added non last lmb region. And there is possibility that, then region in which new memory range added is not adjacent to next region. But have some sections are overlapping. So along with adjacency check with next lmb region, check for overlap should be done. In case overlap is found, adjust and merge these two lmb region into one. Reported-by: Suman Anna <s-anna@ti.com> Signed-off-by: Udit Kumar <u-kumar1@ti.com>
2023-10-09exynos: Cleanup exynos_initTom Rini12-63/+16
- None of the callers perform error checking and based on the non-empty versions of this function, there's no checking to be done, so make this a void. - Add a default weak version of the function. - Remove the empty versions of exynos_init now that we have a weak version. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-10-09board: Remove essentially empty board files and MakefilesTom Rini115-601/+0
As part of reviewing a new platform, Daniel Schwierzeck noted that we can have an empty Makefile in the board directory and don't need an empty board.c file as well. Further with further cleanup in the Makefile we can now omit the Makefile entirely. Remove a number of now unnecessary board.c and Makefiles. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-10-09Makefile: Allow for board directories to not have a MakefileTom Rini2-2/+2
It is entirely possible at this point to have platforms in U-Boot that do not have board-specific C code (just Kconfig or environment) and so make it optional to have to descend in to and then build in the board directory. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-10-09ARM: vexpress_ca9x4: Add missing flash width config optionPatryk Biel1-0/+1
Allow for a proper configuration of CFI flash banks avaialble on the vexpress_ca9x4 board. Without this option, the CFI flash incorrectly detects that the board has two banks of 32MB flash devices, while in reality, the board provides two flash banks, each with 64MB size. As a result, it becomes impossible to e.g. to save u-boot env in flash. According to device tree for this board and its implementation in QEMU, the CFI width should be set to 32 bits. After applying this fix, CFI flash will correctly detect both flash banks each with a size of 64MB. As as result the functionality of e.g. saving u-boot env will work correctly. Tested on QEMU 6.2.0. Cc: Kristian Amlie <kristian.amlie@northern.tech> Signed-off-by: Patryk Biel <pbiel7@gmail.com> Reviewed-by: Kristian Amlie <kristian.amlie@northern.tech>
2023-10-09bootstd: use ARCH_DMA_MINALIGN in memalign() when allocating memoryTony Dinh1-1/+1
Use ARCH_DMA_MINALIGN in memalign() when allocating memory to read the script from the media. Ref: https://lore.kernel.org/u-boot/CAJaLiFy05F3Cr4X4G2mVkppXnBEFZrHQ+5CngYN8eJPg8ENWkg@mail.gmail.com/T/#m26daadc2463fe653b814a94e6309e5e6bb6be1d1 Note: this patch depends on the previous patch https://patchwork.ozlabs.org/project/uboot/patch/20230917230649.30357-1-mibodhi@gmail.com/ Signed-off-by: Tony Dinh <mibodhi@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-09Makefile: Force regeneration of env.txtAndrew Davis1-1/+1
If the source .env file changes to one that is also older than the generated env.txt file then the .env file is not regenerated. This means when switching board configs we do not regenerate the env. This can be tested with: $ make j721e_evm_a72_defconfig $ make # this may fail to complete but that is okay for this test $ make am64x_evm_a53_defconfig $ make $ vim include/generated/env.txt Note this is still the J721e env not the AM64 config as expected. As ENV_FILE is set based on configuration, regenerate anytime autoconf.h changes. Signed-off-by: Andrew Davis <afd@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-08Merge tag 'u-boot-rockchip-20231007' of ↵Tom Rini69-472/+5226
https://source.denx.de/u-boot/custodians/u-boot-rockchip - Add Board: rk3568 Bananapi R2Pro; - Update pcie bifurcation support; - dwc_eth_qos controller support for rk3568 and rk3588; - Compressed binary support for U-Boot on rockchip platform; - dts and config updates for different board and soc; [ trini: Fix conflict on include/spl.h ] Signed-off-by: Tom Rini <trini@konsulko.com>
2023-10-07rockchip: rk356x-u-boot: Add bootph-all to i2c0_xfer pinctrl nodeJonas Karlman1-0/+8
A RK8XX PMIC is typically using i2c0 on RK356x devices. Add bootph-all to required pinctrl nodes to simplify use of the prevent booting on power plug-in option in SPL. With the following Kconfig options and nodes in u-boot.dtsi the prevent booting on power plug-in option can work in SPL. CONFIG_ROCKCHIP_RK8XX_DISABLE_BOOT_ON_POWERON=y CONFIG_SPL_I2C=y CONFIG_SPL_POWER=y CONFIG_SPL_PINCTRL=y CONFIG_SPL_PMIC_RK8XX=y &i2c0 { bootph-pre-ram; }; &rk817 { bootph-pre-ram; regulators { bootph-pre-ram; }; }; Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-07power: pmic: rk8xx: Fix power-on source check in SPLJonas Karlman1-7/+13
The commit 30975fb73d51 ("rockchip: Add option to prevent booting on power plug-in") introduce an option to prevent booting a device when the device was powered on due to power plug-in instead of pressing a power button. This feature works by checking the power-on source during PMIC probe and powers off the device if power-on source was power plug-in. This check currently runs very late at PMIC probe in U-Boot proper. Fix so that the power-on source check can work at probe time in SPL. Also enable probe after bind and remove the PMIC banner in SPL. With this we can use ROCKCHIP_RK8XX_DISABLE_BOOT_ON_POWERON and SPL_PMIC_RK8XX to power off the device very quickly after TPL instead of after TF-A and U-Boot proper has been loaded and run. DDR V1.18 f366f69a7d typ 23/07/17-15:48:58 ln LP4/4x derate en, other dram:1x trefi ddrconfig:7 LPDDR4X, 324MHz BW=32 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=16 Size=8192MB change to: 324MHz clk skew:0x64 change to: 528MHz clk skew:0x58 change to: 780MHz clk skew:0x58 change to: 1056MHz(final freq) clk skew:0x40 out Power Off due to plug-in event Fixes: 30975fb73d51 ("rockchip: Add option to prevent booting on power plug-in") Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2023-10-07rockchip: rk356x: Enable poweroff commandJonas Karlman4-0/+4
With PMIC_RK8XX, SYSRESET and CMD_POWEROFF options enabled it is possible to power down a board using the poweroff command and turn the board back on using a power button. Enable the poweroff command on RK356x boards that have a button wired to PMIC pwron. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-07power: pmic: rk8xx: Use sysreset implementation of the poweroff commandJonas Karlman1-0/+1
Select SYSRESET_CMD_POWEROFF to use the sysreset implementation of the poweroff command when PMIC_RK8XX is enabled. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-07configs: rockchip: rk3308: enable CONFIG_OF_LIBFDT_OVERLAYFUKAUMI Naoki2-0/+2
enable CONFIG_OF_LIBFDT_OVERLAY and use it on Radxa ROCK Pi S. Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
2023-10-07configs: rockchip: rk3308: use CONFIG_DEFAULT_FDT_FILEFUKAUMI Naoki4-1/+5
all rk3308 boards should use their own dtb file. also, change fdt_addr_r to avoid following error: "ERROR: Did not find a cmdline Flattened Device Tree" it happens on Radxa ROCK Pi S (256MB/512MB) with kernel built from Radxa BSP. Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
2023-10-07arm: dts: rockchip: rock-5b: add support for PCIe3 and NVMeFUKAUMI Naoki2-0/+34
this patch adds support for PCIe3 (M.2 M key) and enables NVMe. => pci BusDevFun VendorId DeviceId Device Class Sub-Class _____________________________________________________________ 00.00.00 0x1d87 0x3588 Bridge device 0x04 01.00.00 0x10ec 0x8125 Network controller 0x00 02.00.00 0x1d87 0x3588 Bridge device 0x04 03.00.00 0x1179 0x011a Mass storage controller 0x08 => nvme scan => nvme info Device 0: Vendor: 0x1179 Rev: AGHA4101 Prod: 79CA20WPKRYN Type: Hard Disk Capacity: 488386.3 MB = 476.9 GB (1000215216 x 512) Signed-off-by: FUKAUMI Naoki <naoki@radxa.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-07arm: dts: rockchip: sync DT for RK3588 series with LinuxFUKAUMI Naoki14-289/+2866
Sync the device tree for RK3588 series with Linux 6.6-rc1. Signed-off-by: FUKAUMI Naoki <naoki@radxa.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-07configs: rockchip: rock-pi-s: use default bootdelay (2s)FUKAUMI Naoki1-1/+0
align with other boards. Signed-off-by: FUKAUMI Naoki <naoki@radxa.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-07configs: rockchip: add DOS_PARTITION to RK3308 boards defconfigMassimo Pegorer3-3/+3
Without DOS_PARTITION support U-Boot is not able to boot an OS stored into an SD card with MBR partitions table. This is still a quite common case so add DOS_PARTITION (only for U-Boot proper build) to Rockchip RK3308 EVB, Radxa ROCK Pi S and Firefly roc-rk3308-cc boards: they are the only RK boards missing of DOS_PARTITION. Reported-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com> Signed-off-by: Massimo Pegorer <massimo.pegorer+oss@gmail.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-07board: rockchip: Add Bananapi R2Pro BoardFrank Wunderlich6-0/+973
Add Bananapi R2 Pro board. tested: - sdcard - both front usb-ports - sata - wan-port lan-ports are connected to mt7531 switch where driver needs to be separated from mtk ethernet-driver. Signed-off-by: Frank Wunderlich <frank-w@public-files.de> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Jonas Karlman <jonas@kwiboo.se>
2023-10-07configs: rockchip: Enable ethernet driver on RK3588 boardsJonas Karlman5-10/+7
Enable DWC_ETH_QOS_ROCKCHIP and related PHY driver on RK3588 boards that have an enabled gmac node and drop ETH_DESIGNWARE and GMAC_ROCKCHIP for remaining RK3588 boards. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-07configs: rockchip: Enable ethernet driver on RK356x boardsJonas Karlman11-6/+35
Enable DWC_ETH_QOS_ROCKCHIP and related PHY driver on RK356x boards that have an enabled gmac node. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-07net: dwc_eth_qos_rockchip: Add support for RK3588Jonas Karlman2-4/+182
Add rk_gmac_ops and other special handling that is needed for GMAC to work on RK3588. rk_gmac_ops was ported from linux commits: 2f2b60a0ec28 ("net: ethernet: stmmac: dwmac-rk: Add gmac support for rk3588") 88619e77b33d ("net: stmmac: rk3588: Allow multiple gmac controller") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-10-07net: dwc_eth_qos: Add glue driver for GMAC on Rockchip RK3568Jonas Karlman5-2/+374
Add a new glue driver for Rockchip SoCs, i.e RK3568, with a GMAC based on Synopsys DWC Ethernet QoS IP. rk_gmac_ops was ported from linux commit: 3bb3d6b1c195 ("net: stmmac: Add RK3566/RK3568 SoC support") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-10-07net: dwc_eth_qos: Stop spam of RX packet not available messageJonas Karlman1-5/+3
Remove spam of RX packet not available debug messages when waiting to receive a packet. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-10-07net: dwc_eth_qos: Return error code when start failsJonas Karlman1-0/+2
Return error code when phy_connect fails or no link can be established. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-10-07net: dwc_eth_qos: Drop unused rx_pkt from eqos_privJonas Karlman2-12/+0
rx_pkt is allocated and not used for anything, remove it. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-10-07rockchip: Add support to generate LZMA compressed U-boot binaryManoj Sai1-0/+4
Add support for generating a LZMA-compressed U-boot binary with the help of binman, if CONFIG_SPL_LZMA is selected. Signed-off-by: Manoj Sai <abbaraju.manojsai@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-07rockchip: Add support to generate GZIP compressed U-boot binaryManoj Sai1-0/+7
Add support for generating a GZIP-compressed U-boot binary with the help of binman, if CONFIG_SPL_GZIP is selected. Signed-off-by: Manoj Sai <abbaraju.manojsai@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>