aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-05-03mmc: Read eMMC partition access bits before card resetCHECK/eMMC-partconf-checkPali Rohár1-3/+28
eMMC specification in section "Access partitions" says that all reset events will restore the access bits in PARTITION_CONFIG CSD register to default User Data Area value (0b000). So read partition access bits from PARTITION_CONFIG CSD register before issuing card reset. This allows SPL/U-Boot to get information which eMMC partition was in use before SPL/U-Boot was booted. For some platforms this is the way how to determinate boot partition from which BootROM loaded SPL. Signed-off-by: Pali Rohár <pali@kernel.org>
2023-05-03tools: kwboot: Fix MMC partitions documentationPali Rohár1-3/+6
Boot configuration stored in EXT_CSD_PART_CONF register is completely ignored by BootROM. Fixes: fa03279e198d ("tools: kwboot: Add image type documentation") Signed-off-by: Pali Rohár <pali@kernel.org>
2023-05-02Merge branch '2023-05-01-assorted-powerpc-updates'Tom Rini12-203/+79
- A number of PCI fixes, and one Kconfig cleanup for PowerPC platforms
2023-05-02pci: auto: Remove PCI_CLASS_PROCESSOR_POWERPC autoconfig casePali Rohár1-4/+0
PCI autoconfig case for PCI_CLASS_PROCESSOR_POWERPC just prints debug message and then calls autoconfig setup code like for any other standard endpoint device. We do not need special debug message for it, so remove this case and handle PCI_CLASS_PROCESSOR_POWERPC via default code path. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2023-05-01pci: mpc85xx: Do not access PCI BARs registers of BDF address 00:00.0Pali Rohár1-0/+12
At BDF address 00:00.0 is fictional device which PCI configuration header is for configuring mpc85xx PCI controller itself. PCI config space of this device has ATMU inbound registers on position of PCI BARs. Trying to do PCI auto configuration of this device cause rewriting ATMU inbound registers. To avoid it, do not allow overwriting registers at BARs positions. And because this device does not have any PCI memory, return zeros when trying to read PCI BARs config space registers. It signals to auto configuration tool to not allocate any PCI memory for this device. This information is taken from MPC8544E Reference Manual, sections 17.3.1.3, 17.3.1.1.1, 17.3.2 and 17.3.2.11. Available at NXP website: https://www.nxp.com/docs/en/reference-manual/MPC8544ERM.pdf Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Heiko Schocher <hs@denx.de> Tested-by: Heiko Schocher <hs@denx.de>
2023-05-01pci: mpc85xx: Do not try to access extended PCIe registersPali Rohár1-2/+10
Driver pci_mpc85xx.c is PCI controller driver for old PCI Local Bus, which does not support access to extended PCIe registers (above 0xff), as opposite of the PCIe driver pcie_fsl.c for the same platform. So do not try to access extended PCIe registers as it cannot work. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Heiko Schocher <hs@denx.de> Tested-by: Heiko Schocher <hs@denx.de>
2023-05-01pci: mpc85xx: Allow 8/16-bit access to PCI config spacePali Rohár1-2/+24
This Freescale mpc85xx PCI controller should support 8-bit and 16-bit read and write access to PCI config space as described in more Freescale reference manuals. This change fixes issue that 8-bit and 16-bit write to PCI config space caused to clear adjacent bits of 32-bit PCI register. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Heiko Schocher <hs@denx.de> Tested-by: Heiko Schocher <hs@denx.de>
2023-05-01pci: mpc85xx: Add missing sync() after writing to PCI config spacePali Rohár1-0/+1
On PowerPC we should use barrier after store operation to HW register. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Heiko Schocher <hs@denx.de> Tested-by: Heiko Schocher <hs@denx.de>
2023-05-01mpc83xx: Don't allow W and G bits in IBATsChristophe Leroy10-195/+32
The "Programming Environments Manual for 32-Bit Implementations of the PowerPC™ Architecture" says "W and G bits are not defined for IBAT registers. Attempting to write to these bits causes boundedly-undefined results" The "e300 Power Architecture™ Core Family Reference Manual" says the same: "Neither the W or G bits of the IBAT registers should be set. Attempting to write to these bits causes boundedly-undefined results." Remove the possibility to set those bytes. Fixes: 30915ab95d9 ("mpc83xx: Migrate BATS config to Kconfig") Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: Mario Six <mario.six@gdsys.cc>
2023-05-01Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-spiWIP/01May2023Tom Rini7-44/+231
- cadence-quadspi fixes (Apurva Nandan, Dhruva Gole) - CHIP_ERASE optimization (Marek Vasut) - fixups for s25fs512s (Takahiro Kuwano)
2023-05-01Prepare v2023.07-rc1v2023.07-rc1Tom Rini2-6/+5
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-05-01configs: Resync with savedefconfigTom Rini649-862/+745
Rsync all defconfig files using moveconfig.py Signed-off-by: Tom Rini <trini@konsulko.com>
2023-04-30Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxiWIP/30Apr2023Tom Rini52-152/+235
Please pull the second part of the sunxi pull request for this cycle. Another bunch of patches that replace old-school U-Boot hacks with proper DM based code, this time for the raw NAND flash driver, and the USB PHY VBUS detection code. Plus two smaller patches that were sitting in my inbox for a while. Gitlab CI passed. In lack of some supported board with NAND flash I couldn't really test this part, but apparently this was tested by the reviewer. I briefly ran the branch on some boards with USB-OTG, and this still worked.
2023-04-29Merge branch 'for-2023.07' of ↵WIP/29Apr2023Tom Rini40-346/+1668
https://source.denx.de/u-boot/custodians/u-boot-mpc8xx This pull request adds support for the last CPU board from CS GROUP France (previously CSSI). That CPU board called CMPCPRO has a mpc8321E CPU (Family PQII PRO hence its name) and can be plugged in place of the CMPC885 board. In order to support that new board, the following changes are included in this series: - Make the mpc8xx watchdog driver more generic for reusing it with mpc83xx - Fix various small problems on mpc83xx platform - Add a GPIO Driver for QE GPIOs - Add support for mpc832x into mpc83xx SPI driver - Refactor existing board code that will be shared with new board - Add the new board
2023-04-28Merge tag 'dm-pull-28apr23' of ↵WIP/28Apr2023Tom Rini34-101/+149
https://source.denx.de/u-boot/custodians/u-boot-dm sandbox and fdt bug fixes / tweaks various other minor fixes
2023-04-28fdt: Indicate that people should use the ofnode APISimon Glass1-0/+3
Add a note to the comment at the top of this file. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-04-28fdt_support: fix comments syntax errorHugo Villeneuve1-2/+2
Fix comments syntax error in fdt_node_offset_by_compat_reg() description: compatiable -> compatible Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28core: fdtaddr: use map_sysmem() as cast for the returnJohan Jonker2-2/+9
For the devfdt_get_addr_index_ptr() and devfdt_get_addr_size_index_ptr() function use map_sysmem() function as cast for the return for use in sandbox. Also fix sandbox test. Signed-off-by: Johan Jonker <jbx6244@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Drop second hunk: Signed-off-by: Simon Glass <sjg@chromium.org>
2023-04-28tools: Fall back to importlib_resources on Python 3.6Jan Kiszka3-3/+15
importlib.resources became part of 3.7 only. Allow using distros with 3.6 and the importlib_resources backport. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28test: fdt: Fix copyright messageMarek Vasut1-1/+1
Drop the map_to_sysmem() copy paste error. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28patman: fix class TestFunctionalHeinrich Schuchardt1-2/+2
Variable orig_dir cannot be used in the finally block if it has not be assigned outside of the try block. tools/patman/func_test.py:523:21: E0601: Using variable 'orig_dir' before assignment (used-before-assignment) tools/patman/func_test.py:691:21: E0601: Using variable 'orig_dir' before assignment (used-before-assignment) Fixes: fd70986a62af ("patman: Add a test that uses gitpython") Fixes: be051c0c7741 ("patman: Detect missing upstream in CountCommitsToBranch") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28binman: Use expanduser instead of HOMESimon Glass1-1/+1
There may not be a HOME environment variable, so use the os.expanduser() function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-04-28dm: core: introduce uclass_get_device_by_of_path()Rasmus Villemoes2-0/+23
There's quite a few instances of board-specific code doing off = fdt_path_offset(gd->fdt_blob, ...); ... ret = uclass_get_device_by_of_offset(..., off, &dev); looking for an eeprom or a pmic via some alias. Such code can be simplified a little if we have a helper for directly getting a device via device tree path (including being given as an alias). Implement it in terms of ofnode rather than raw offsets so that this will work whether live tree is enabled or not. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2023-04-28uclass: add uclass_find_device_by_phandle_id() helperRasmus Villemoes1-25/+19
The functions uclass_find_device_by_phandle() and uclass_get_device_by_phandle_id() both loop over a given uclass looking for a device with a given phandle. Factor that out to a common helper. For now, there are no (known potential) users of the new helper outside uclass.c, so make it static. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org> Fix warning on sandbox_spl; fix code style: Signed-off-by: Simon Glass <sjg@chromium.org>
2023-04-28sandbox: disable tracing before unmapping RAMPavel Skripkin1-0/+5
Currently doing 'reset' command in sandbox with tracing enabled causes SIGSEV ``` Hit any key to stop autoboot: 0 => => => reset resetting ... Segmentation fault (core dumped) ``` Tracing callback uses RAM buffer for storing tracing reports, but state_uninit() function unmaps whole RAM, which causes SIGSEV on umapped memory inside tracing subsystem. Fix it by disabling tracing before unmapping memory Signed-off-by: Pavel Skripkin <paskripkin@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Add missing check for CONFIG_TRACE: Signed-off-by: Simon Glass <sjg@chromium.org>
2023-04-28sandbox: correct posix_types.h defineHeinrich Schuchardt1-3/+4
arch/arm/include/asm/posix_types.h and arch/sandbox/include/asm/posix_types.h should use different defines. Add SPDX header. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28bootflow: Rework do_bootflow_menu() slightlyTom Rini1-12/+12
When building this with clang, we get a warning such as: cmd/bootflow.c:412:27: warning: variable 'bflow' is uninitialized when used here [-Wuninitialized] printf("Selected: %s\n", bflow->os_name ? bflow->os_name : bflow->name); ^~~~~ And a suggestion to just initialize bflow to NULL. This would however would be ensuring a bad dereference. Instead, looking at the function we rework things so that when CONFIG_EXPO is not enabled (and so, no UI) we error early and would never reach this point in the code. Simplify the rest slightly as well while at this. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28dm: core: Make aliases_lookup staticBin Meng1-1/+1
aliases_lookup is only referenced in of_access.c Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28drivers: tee: sandbox: Fix SCP03 control emulatorJorge Ramirez-Ortiz1-4/+11
Fix and document the Secure Channel Protocol03 emulator. Fixes: 5a8783c80c39 ("drivers: tee: sandbox: SCP03 control emulator") Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-04-28sandbox: fix return type of os_filesize()Heinrich Schuchardt3-4/+9
Given a file ../img of size 4294967296 with GPT partition table and partitions: => host bind 0 ../img => part list host 0 Disk host-0.blk not ready The cause is os_filesize() returning int. File sizes must use off_t. Correct all uses of os_filesize() too. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28MAINTAINERS: assign include/os.hHeinrich Schuchardt1-0/+1
os.h is only used by the sandbox. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28binman: Use unsigned long over typedef ulongAndrew Davis4-10/+4
The header binman_sym.h depends on ulong typedef but does not include types.h. This means the header must be included after including types.h or a header that includes it. We could include types.h but instead let's just switch from ulong to directly using unsigned long. This removes the need for typedef'ing it in some of the tests, so also remove those. Signed-off-by: Andrew Davis <afd@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28common: static fdt_simplefb_enable_existing_node()Heinrich Schuchardt2-2/+7
Function fdt_simplefb_enable_existing_node() should be static as it is not used outside common/fdt_simplefb.c. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28boot: vbe_simple: Fix vbe_simple_read_bootflow() dependencyBin Meng1-5/+7
vbe_simple_read_bootflow() calls vbe_simple_read_bootflow_fw() which is only available when BOOTMETH_VBE_SIMPLE_FW is on. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28sandbox: mark sandbox_exit() as no return.Heinrich Schuchardt3-3/+2
Fix a -Wimplicit-fallthrough warning in sandbox_sysreset_request(). Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28sandbox: spi: sandbox_sf_process_cmd() missing fallthroughHeinrich Schuchardt1-0/+1
Add a missing fallthrough macro to avoid a -Wimplicit-fallthrough warning. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28sandbox: fix sandbox_hub_submit_control_msg()Heinrich Schuchardt1-21/+9
Avoid incorrect fall through: A USB_RT_HUB request should not be treated as USB_RT_PORT. Simplify the coding: Avoid duplicate debug() statements. This fixes all -Wimplicit-fallthrough warnings. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28sandbox: fix fall through in sandbox_flash_bulk()Heinrich Schuchardt1-0/+1
Handling of SANDBOX_FLASH_EP_OUT should never fall through to SANDBOX_FLASH_EP_IN. This addresses a warning shown when compiling with -Wimplicit-fallthrough. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28board: cssi: Add CPU board CMPCPROChristophe Leroy11-0/+994
CSSI has another CPU board, similar to the CMPC885 board that get plugged on the two base boards MCR3000_2G and MIAE. That CPU board is called CMPCPRO because it has a MPC8321E CPU, also known as Power QUICC II PRO. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2023-04-28board: cssi: Move all mother board code into common.cChristophe Leroy4-133/+157
All the code used to manage the mother boards will be common to soon to come CPU board. Move all that code into common.c Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2023-04-28board: cssi: Refactor EEPROM readChristophe Leroy3-31/+40
On cmpc885 board, the ethernet addresses are stored in an EEPROM that is accessed through SPI. A 3 bytes command is sent to the chip then the content gets read. At the time being a single block access is performed, ignoring the first 3 bytes read. Reword the SPI transfer to first send 3 bytes then receive the content of the EEPROM so that there don't be 3 dummy bytes at the beginning of the buffer. And move the function into common.c so that it can be reused by the board that will be added in a future patch. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2023-04-28board: cssi: Create dedicated file for common sourcesChristophe Leroy4-53/+73
In preparation of the new cssi board called cmpcpro which we be introduce in a future patch, move common functions into a dedicated file in a common directory. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2023-04-28board: cssi: Migrate to hashed passwordChristophe Leroy2-2/+8
Use a hashed password instead of clear text in order to improve board security. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2023-04-28Kconfig: Remove an impossible conditionSamuel Holland1-1/+1
ARCH_SUNXI selects BINMAN, so the condition "!BINMAN && ARCH_SUNXI" is impossible to satisfy. Signed-off-by: Samuel Holland <samuel@sholland.org> Acked-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-04-28phy: sun4i-usb: Do not drive VBUS with external VBUS presentSamuel Holland1-0/+6
It is possible to use host-side USB with externally-provided VBUS. For example, some USB OTG cables have an extra power input which powers both the board and the USB peripheral. To support this setup, skip enabling the VBUS switch/regulator if VBUS voltage is already present. This behavior matches the Linux PHY driver. Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-04-28gpio: axp/sunxi: Remove virtual VBUS detection GPIOSamuel Holland7-27/+5
Now that this functionality is modeled using the device tree and regulator uclass, the named GPIO is not referenced anywhere. Remove it. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-04-28sunxi: Switch to PMIC USB power supply VBUS detectionSamuel Holland23-23/+25
Update boards to use the USB power supply driver, as referenced in the device tree, instead of a virtual GPIO. This removes the need for some DM-incompatible special cases in the GPIO driver. The following five boards used AXP0-VBUS-DETECT in their config, but are missing the "usb0_vbus_power-supply" property in their device tree: - Ainol_AW1_defconfig / sun7i-a20-ainol-aw1 - Cubieboard4_defconfig / sun9i-a80-cubieboard4 - Merrii_A80_Optimus_defconfig / sun9i-a80-optimus - Yones_Toptech_BD1078_defconfig / sun7i-a20-yones-toptech-bd1078 - Yones_Toptech_BS1078_V2_defconfig / sun6i-a31s-yones-toptech-bs1078-v2 None of those five boards have the MUSB controller (USB OTG) enabled in their device trees, so this change should not break anything for them. Additionally, the following board intentionally omits the property because VBUS is always enabled: - Nintendo_NES_Classic_Edition_defconfig / sun8i-r16-nintendo-nes-classic The PHY driver already assumes VBUS is enabled when no detection method is available, so again this will not cause any problems. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-04-28power: regulator: Add a driver for the AXP USB power supplySamuel Holland3-0/+57
This driver reports the presence/absence of voltage on the PMIC's USB VBUS pin. This information is used by the USB PHY driver. The corresponding Linux driver uses the power supply class, which does not exist in U-Boot. UCLASS_REGULATOR seems to be the closest match. Signed-off-by: Samuel Holland <samuel@sholland.org> Acked-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-04-28mtd: nand: sunxi: Pass the device to the init functionSamuel Holland1-19/+20
This more closely matches the U-Boot driver to the Linux version. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Michael Trimarchi <micahel@amarulasolutions.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-04-28mtd: nand: sunxi: Convert to the driver modelSamuel Holland2-37/+49
Clocks, resets, and pinmuxes are now handled by the driver model, so the only thing the "board" code needs to do is load the driver. This matches the pattern used by other DM raw NAND drivers (there is no NAND uclass). The actual board code is now only needed in SPL. Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>