aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-05-02arm: mvebu: turris_omnia: Extract code for disabling sata/pciePali Rohár
Move code for disabling sata and pcie DT nodes to own functions, so this code can be called from other places in follow up patches. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-05-02arm: mvebu: turris_omnia: Allow to configure mSATA slot via env variablePali Rohár
Some PCIe-based MiniPCIe cards are broken and they do not ground PIN 43 which is required by PCIe mini CEM specs. Such broken cards are incorrectly detected as mSATA cards because SATA specs requires that PIN 43 on mSATA cards has to be disconnected. PIN 43 on Turris Omnia is used only for MiniPCIe/mSATA card detection by software in U-Boot SPL. Allow to override that U-Boot SPL detection by a new "omnia_msata_slot" env variable (to value "pcie" or "sata") so broken MiniPCIe cards can be used in combo mSATA/MiniPCIe slot too. As configuration of PCIe vs SATA functionality is done in U-Boot SPL, it is required to change env variable in permanent storage and reset the board to take effect. To force PCIe mode for broken MiniPCIe cards, call U-Boot commands: => setenv omnia_msata_slot pcie => saveenv => reset Signed-off-by: Pali Rohár <pali@kernel.org>
2022-05-02arm: mvebu: turris_omnia: Define only one serdes map variablePali Rohár
By default use primary serdes map with PCIe function in combined miniPCIe/mSATA slot. When SATA is detected change serdes map variable at runtime. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-05-02arm: mvebu: turris_omnia: Enable ENV support in SPLPali Rohár
Allow to read ENV variables also in SPL on Turris Omnia. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-05-02arm: mvebu: turris_omnia: Provide env_sf_get_env_addr() functionPali Rohár
BootROM maps SPI Flash to fixed address 0xD4000000 and this mapping is active also when BootROM is executing binary kwbimage headers, which includes also U-Boot SPL. Therefore no initialization code is required to access SPI Flags from U-Boot SPL. In proper U-Boot it is remapped to other location. So in mvebu implementation of env_sf_get_env_addr() function returns 0xD4000000 when running in SPL and NULL when in proper U-Boot. This change would allow to use U-Boot ENV in U-Boot SPL. Normally it is not possible to read ENV because it is too big and U-Boot SPL does not have such big malloc() pool to real all ENV variables. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2022-05-02env: sf: Allow to use env_sf_init_addr() at any stagePali Rohár
In some cases it makes sense to use env_sf_init_addr() also in SPL mode. Allow it for boards by providing custom implementation of weak function env_sf_get_env_addr(). When this function returns NULL it signals that address is invalid, like config option CONFIG_ENV_ADDR. There is no change in default behavior or in config options. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-04-29Merge tag 'efi-2022-07-rc2' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-07-rc2 UEFI: * fix UEFI booting after integration of UEFI sub-system with driver model * avoid random return values from devpath_is_partition() * minor code clean ups
2022-04-29Merge branch '2022-04-29-fuzzing-and-asan-fixes'Tom Rini
To quote the author: I've been experimenting with ASAN on sandbox and turned up a few issues that are fixed in this series. Basic ASAN was easy to turn on, but integrating with dlmalloc was messier and fairly intrusive. Even when I had it working, there was only a small redzone between allocations which limits the usefulness. I saw another series on the list by Sean Anderson to enable valgrind which was finding a different set of issues, though there was one overlap that Sean is fixing with "[PATCH] IOMUX: Fix access past end of console_devices". With these issues fixed, I was able to run the dm tests without any ASAN issues. There are a couple of leaks reported at the end, but that's for another day.
2022-04-29test: dm: devres: Remove use-after-freeAndrew Scull
Use-after-free shouldn't be used, even in tests. It's bad practice and makes the test brittle. Signed-off-by: Andrew Scull <ascull@google.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-29test: Fix pointer overrun in dm_test_devm_regmap()Andrew Scull
This tests calls regmap_read() which takes a uint pointer as an output parameter. The test was passing a pointer to a u16 which resulted in an overflow when the output was written. Fix this by following the regmap_read() API and passing a uint pointer instead. Signed-off-by: Andrew Scull <ascull@google.com> Cc: Simon Glass <sjg@chromium.org> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Jean-Jacques Hiblot <jjhiblot@ti.com> Cc: Pratyush Yadav <p.yadav@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-29sound: Fix buffer overflow in square wave generationAndrew Scull
Data is written for each channel but is only tracked as having one channel written. This resulted in a buffer overflow and corruption of the allocator's metadata which caused further problems when the buffer was later freed. This could be observed with sandbox unit tests. Resolve the overflow by tracking the writes for each channel. Fixes: f987177db9 ("dm: sound: Use the correct number of channels for sound") Signed-off-by: Andrew Scull <ascull@google.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-29usb: sandbox: Bounds check read from bufferAndrew Scull
The buffer is 512 bytes but read requests can be 800 bytes. Limit the request to the size of the buffer. Signed-off-by: Andrew Scull <ascull@google.com> Cc: Simon Glass <sjg@chromium.org> Cc: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-29usb: sandbox: Check for string end in copy_to_unicode()Andrew Scull
When copying the string in copy_to_unicode(), check for the null terminator in each position, not just at the start, to avoid reading beyond the end of the string. Signed-off-by: Andrew Scull <ascull@google.com> Cc: Simon Glass <sjg@chromium.org> Cc: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-29x86: sandbox: Add missing PCI bar to barinfoAndrew Scull
There are expecte to be bars 0 through 5, but the last of these was missing leading to an read beyond the buffer. Add the missing element with zero values. Signed-off-by: Andrew Scull <ascull@google.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-29acpi: Fix buffer overflow in do_acpi_dump()Andrew Scull
When do_acpi_dump() converts the table name to upper case, pass the actual size of the output buffer so that the null terminator doesn't get written beyond the end of the buffer. Signed-off-by: Andrew Scull <ascull@google.com> Cc: Simon Glass <sjg@chromium.org> Cc: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Cc: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-29doc: Correct position of gdb '--args' parameterAndrew Scull
The '--args' parameter to gdb comes before the binary that the debugger will be attached to rather than after the binary and before the arguments. Fix that in the docs. Signed-off-by: Andrew Scull <ascull@google.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-29efi_loader: call efi_init_early() earlierHeinrich Schuchardt
efi_init_early() creates an event hook for block device probing. It has to be called before any block device is probed. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-04-29efi_loader: disk: allow blk devices even without UCLASS_PARTITIONAKASHI Takahiro
While GPT partition is mandated in UEFI specification, CONFIG_PARTITION is seen optional under the current implementation. So modify efi_disk_rw_blocks() to allow accepting UCLASS_BLK devices. Fixes: commit d97e98c887ed ("efi_loader: disk: use udevice instead of blk_desc") Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Mark Kettenis <kettenis@openbsd.org>
2022-04-29efi_loader: simplify efi_add_conventional_memory_map()Heinrich Schuchardt
Remove redundant constraint. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-04-29efi_loader: simplify try_load_entry()Heinrich Schuchardt
Use function efi_create_indexed_name() to create the BootXXXX variable name. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-04-29efi: fix devpath_is_partition()Heinrich Schuchardt
If the path consists only of an end node, it does not refer to a partition. Avoid returning a random value from the stack in this case. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-04-29efi_loader: don't call log with __func__ as parameterHeinrich Schuchardt
The log functions print file name, line number, and function name if selected via the log command or customizing. Don't print the function name twice. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-04-28Merge branch '2022-04-28-led-updates'Tom Rini
- DM GPIO bugfix - LED related code clean-ups - Fix some of the DM/LED tests - Update the LED dt binding doc
2022-04-28dt-bindings: leds: import common led bindings from linux 5.17Pali Rohár
This allows usage of LED_COLOR_ID_RGB macro in DTS files. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-04-28test: dm: pinmux: Get LED2 udevice in the pinmux testMarek Vasut
The UT reinitializes the pin controller state, get LED2 udevice to trigger its probe and configure the pin controller pin state as it is expected by the test. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
2022-04-28test: dm: led: Fix LED enumerationMarek Vasut
The GPIO LED driver no longer considers the top level node an LED, because it is not an LED. With this bug fixed, the LED enumeration has changed. Update the test accordingly. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
2022-04-28led: Drop led_default_state()Marek Vasut
This function is empty, drop it. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-04-28led: gpio: Use NOP uclass driver for top-level nodeMarek Vasut
The top level DT node of gpio-leds is not a LED itself, bind NOP uclass driver to it, and bind different LED uclass driver to its subnodes which represent the actual LEDs. This simplifies the probe() implementation and fixes the bogus top-level not-an-LED in 'led list' command output: ``` => led list led Error -121 <--- This is removed/fixed by this patch green:user0 off ``` Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-04-28led: gpio: Check device compatible string to determine the top level nodeMarek Vasut
Since 2d1deaf88ed ("led: gpio: Drop duplicate OF "label" property parsing"), all LED nodes have some sort of label. Use device_is_compatible(..."leds-gpio") to determine whether this is a top-level node, since it is only the top level node which is compatible with "leds-gpio", the GPIO LEDs subnodes are not. Fixes: 2d1deaf88ed ("led: gpio: Drop duplicate OF "label" property parsing") Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-04-28led: Mark device instance with DM_FLAG_PROBE_AFTER_BINDMarek Vasut
Calling device_probe() from uclass .post_bind() callback has all kinds of odd side-effects, e.g. device instances not being available just yet. Make use of the DM_FLAG_PROBE_AFTER_BIND instead, mark device instances which need to be probe()d in order to configure the LED default state with this flag and let the DM core do the device_probe() at the right time instead. Fixes: 72675b063b6 ("led: Configure LED default-state on boot") Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-04-28dm: core: Add DM_FLAG_PROBE_AFTER_BIND flagMarek Vasut
Introduce DM_FLAG_PROBE_AFTER_BIND flag, which can be set by driver or uclass in .bind(), to indicate such driver instance should be probe()d once binding of all devices is complete. This is useful in case the driver determines that hardware initialization is mandatory on boot, and such initialization happens only in probe(). This also solves the inability to call device_probe() from .bind(). Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-04-27Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xxTom Rini
fsl-qoriq: Fixes and updates on fsl-layerscape mpc85xx: fixes and code cleanup
2022-04-27Merge tag 'u-boot-amlogic-20220427' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-amlogic - Add AXG support for SARADC, including minimal ao-clk driver - Update Amlogic documentation for Matrix & Jethub D1
2022-04-26doc: boards: amlogic: update jethub d1 specificationsVyacheslav Bocharov
Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> [narmstrong: removed trailing whitespaces and fixed sphinx build error] Link: https://lore.kernel.org/r/20220426052633.3027932-2-adeep@lexina.in
2022-04-26Merge tag 'u-boot-at91-2022.07-b' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-at91 Second set of u-boot-at91 features for the 2022.07 cycle: This feature set includes the new driver for the AT91 reset controller, a new board called sam9x60 curiosity, and several other fixes and clean-ups (sama7g5ek qspi clock, impedance; remove unused code, introduce Kconfig symbols for SPL timers)
2022-04-26cpu: 83xx: Add missing dependency on CPU_MPC83XXMichal Simek
It looks quite weird that for non PPC platforms cpu driver for MPC83xx can be selected. That's why define proper dependency. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26board: ls1046afrwy: Remove Manish Tomar's emailSean Anderson
Manish Tomar's email bounces. Remove it, and reassign the config he was maintaining to the primary maintainer for the board. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26pci: fsl: Change compatible string for mpc8548 to "fsl, mpc8548-pcie"Pali Rohár
Upstream Linux kernel uses for mpc8548-based PCIe controllers compatible string "fsl,mpc8548-pcie". So change U-Boot fsl PCIe driver and all DTS files to use "fsl,mpc8548-pcie" instead of "fsl,pcie-mpc8548" to be compatible with Linux kernel. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26powerpc: dts: p2020: Set dfsrr property for i2c nodesPali Rohár
Linux kernel dts files pq3-i2c-*.dtsi also sets this dfsrr property for i2c nodes. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26powerpc: dts: p2020: Define L2 cache nodePali Rohár
Copy definition of L2 cache node from upstream Linux kernel P2020 dts files. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26powerpc: dts: p2020: Make usb@22000 node compatible for Linux kernel driverPali Rohár
Linux P2020 USB kernel driver uses compatible string fsl-usb2-dr-v1.6 and needs more DT properties. Copy P2020 usb@22000 properties from upstream Linux kernel. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26powerpc: dts: p2020: Add missing interrupts property to spi@7000 nodePali Rohár
interrupts property for spi@7000 node is needed for compatibility with Linux kernel. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26powerpc: dts: p2020: Do not automatically disable spi@7000 node in ↵Pali Rohár
p2020-post.dtsi Device tree include file p2020-post.dtsi should be included after the board device tree file and overrides settings of the board. So it should not disable some node as board cannot enable it via normal way (it has to enable it after inclusion of p2020-post.dtsi file). Fix it by removal of explicit disable in p2020-post.dtsi file and then remove explicit post-post enable in all P2020 board device tree files. Currently no P2020 board has spi@7000 node disabled. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26powerpc: dts: p2020: Add Linux compatible string and property for eSDHCPali Rohár
Linux kernel eSDHC driver for P2020 requires additional compatible string fsl,p2020-esdhc and interrupts property. Add them to p2020-post.dtsi file to make U-Boot board DTS files compatible for Linux kernel. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26powerpc: dts: p2020: Add ptp_clock@24e00 node via pq3-etsec1-timer-0.dtsiPali Rohár
Import pq3-etsec1-timer-0.dtsi device tree include file from upstream Linux kernel for P2020. This allows U-Boot to use P2020 device tree files from upstream Linux kernel which reference ptp_clock@24e00 device. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26powerpc: dts: p2020: Make PCIe nodes compatible for Linux kernel driverPali Rohár
Linux P2020 PCIe kernel driver uses compatible string fsl,mpc8548-pcie and needs more DT properties. Copy P2020 PCIe nodes and definitions from upstream Linux kernel. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26powerpc: dts: p2020: Add gpio-controller@fc00 node via pq3-gpio-0.dtsiPali Rohár
Import pq3-gpio-0.dtsi device tree include file from upstream Linux kernel for P2020. This allows U-Boot to use P2020 device tree files from upstream Linux kernel which reference gpio-controller@fc00 device. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26board: freescale: p1_p2_rdb_pc: Define SW macros for lower and upper NOR banksPali Rohár
Replace hardcoded i2c hex values for NOR banks by named SW macros in map_lowernorbank/map_uppernorbank env commands. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26board: freescale: p1_p2_rdb_pc: Use named macros for i2c bus num and addressPali Rohár
Replace hardcoded boot i2c bus num and address by existing macros when generating env for CONFIG_EXTRA_ENV_SETTINGS. Same macros are used in U-Boot board code when reading information from boot i2c data. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-04-26board: freescale: p1_p2_rdb_pc: Fix env $vscfw_addrPali Rohár
Do not stringify env $vscfw_addr two times (once implicitly via string operator "" and second time explicitly via __stringify() macro) and allow to compile U-Boot without CONFIG_VSC7385_ENET (when __VSCFW_ADDR was not defined and so macro name was stringified into CONFIG_EXTRA_ENV_SETTINGS). Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>