aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-09-26Merge tag 'xilinx-for-v2023.01-rc1-v2' of ↵WIP/26Sep2022-nextTom Rini38-54/+976
https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze into next Xilinx changes for v2023.01-rc1 (round 2) xilinx: - Add support for new Versal NET SOC zynqmp: - Use mdio bus for ethernet phy description - Wire ethernet phy reset via i2c-gpio versal: - Config cleanup
2022-09-26Merge branch 'next' of https://gitlab.denx.de/u-boot/custodians/u-boot-riscv ↵Tom Rini27-1287/+217
into next
2022-09-26arm64: versal-net: Add support for mini configurationMichal Simek4-0/+161
Versal NET mini configuration is designed for running memory test. Current output is on DCC but changing serial0 alias to pl011 will move console to serial port. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/aec3f41a4cc48c45b8f07dd6e423d5838dbcc9d7.1663589964.git.michal.simek@amd.com
2022-09-26arm64: versal-net: Add defconfig for Versal NETMichal Simek2-25/+134
Use one defconfig for supporting multiple different platforms. DTB reselection is enabled to choose DT based on SOC detection. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/82cc7c1ca8850270cc2ebc992d835a37aa3d236f.1663589964.git.michal.simek@amd.com
2022-09-26reset: zynqmp: Enable reset driver for Versal NETJay Buddhabhatti1-0/+1
Enable zynqmp reset driver for Versal NET. Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/c8c26618f87d8451c6ffa9487809a24718bff6a7.1663589964.git.michal.simek@amd.com
2022-09-26mailbox: zynqmp: Enable ipi mailbox driver for Versal NETJay Buddhabhatti1-1/+1
Enable mailbox configs for Versal NET. Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/b3a9a6a58b74d17e2ec5f60617fa42062fbab951.1663589964.git.michal.simek@amd.com
2022-09-26firmware: zynqmp: Add Versal NET compatible stringJay Buddhabhatti1-0/+1
Add compatible string for Versal NET. Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/ec73f786e1c89094752ff3693f6f0fb4536c85c5.1663589964.git.michal.simek@amd.com
2022-09-26clk: versal: Enable clock driver for Versal NETJay Buddhabhatti2-1/+2
Add support for Versal NET compatible string in clock driver. Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/20a35d0c1ffcc222fbe93dd406cdd0aff92f5223.1663589964.git.michal.simek@amd.com
2022-09-26spi: zynqmp_gqspi: Add support for Versal NETMichal Simek1-1/+2
Add support for Versal NET platform. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/f374e9a81f2d85de1240029f3ba5f6423cfa0680.1663589964.git.michal.simek@amd.com
2022-09-26spi: cadence_qspi: Add support for Versal NET platformMichal Simek3-2/+7
Trivial changes to support cadence ospi driver for Versal NET platform. Also avoid ospi flash reset for now. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/0789141f432189aab69bc496fe33e0218d1d7510.1663589964.git.michal.simek@amd.com
2022-09-26arm64: versal-net: Add support for Versal NET platformMichal Simek19-7/+614
Versal NET platform is based on Versal chip which is reusing a lot of IPs. For more information about new IPs please take a look at DT which describe currently supported devices. The patch is adding architecture and board support with soc detection algorithm. Generic setting should be very similar to Versal but it will likely diverge in longer run. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/320206853dc370ce290a4e7b6d0bb26b05206021.1663589964.git.michal.simek@amd.com
2022-09-26riscv: ae350: Disable AVAILABLE_HARTSRick Chen2-0/+2
Disable AVAILABLE_HARTS mechanism to make sure that all harts can boot to Kernel shell successfully. Signed-off-by: Rick Chen <rick@andestech.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2022-09-26riscv: Introduce AVAILABLE_HARTSRick Chen6-5/+23
In SMP all harts will register themself in available_hart during start up. Then main hart will send IPI to other harts according to this variables. But this mechanism may not guarantee that all other harts can jump to next stage. When main hart is sending IPI to other hart according to available_harts, but other harts maybe still not finish the registration. Then the SMP booting will miss some harts finally. So let it become an option and it will be enabled by default. Please refer to the discussion: https://www.mail-archive.com/u-boot@lists.denx.de/msg449997.html Signed-off-by: Rick Chen <rick@andestech.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2022-09-26spl: introduce SPL_XIP to configNikita Shubin8-8/+15
U-Boot and SPL don't necessary share the same location, so we might end with U-Boot SPL in read-only memory (XIP) and U-Boot in read-write memory. In case of non XIP boot mode, we rely on such variables as "hart_lottery" and "available_harts_lock" which we use as atomics. The problem is that CONFIG_XIP also propagate to main U-Boot, not only SPL, so we need CONFIG_SPL_XIP to distinguish SPL XIP from other XIP modes. This adds an option special for SPL to behave it in XIP manner and we don't use hart_lottery and available_harts_lock, during start proccess. Signed-off-by: Nikita Shubin <n.shubin@yadro.com> Reviewed-by: Rick Chen <rick@andestech.com>
2022-09-25Merge tag 'dm-next-25sep22' of ↵WIP/25Sep2022-nextTom Rini48-404/+765
https://gitlab.denx.de/u-boot/custodians/u-boot-dm into next sandbox SCSI conversion to driver model final patch for blk improvements
2022-09-25sandbox: Add a test for SCSISimon Glass5-0/+58
Add a simple uclass test for SCSI. It reads the partition table from a disk image and checks that it looks correct. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25sandbox: Convert to use driver model for SCSISimon Glass9-29/+135
At present sandbox is producing a warning about SCSI migration. Drop the legacy code and replace it with a new implementation. Also drop the SATA command, which does not work with driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25sandbox: scsi: Move request-handling code to scsi_emulSimon Glass4-77/+109
Move this code into the emulator file so it can be used by multiple drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25sandbox: Enable SCSI for all buildsSimon Glass5-2/+22
This will be needed to run unit tests, once the SCSI code is used for USB as well. Enable it for all sandbox builds. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25sandbox: scsi: Move structs to header fileSimon Glass2-26/+55
Move these to the SCSI header file so we can access them from multiple emulators. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25sandbox: scsi: Remove setup calls from handle_read()Simon Glass1-7/+22
Move the device-specific code out into the top-level function. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25sandbox: scsi: Move reply setup out of helperSimon Glass1-13/+9
Move this code out of the helper function so we can (later) add it as part of the shared emulation code. Set a default value of 0 for buff_used since that is what we use when there is an error. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25sandbox: scsi: Move file size into shared structSimon Glass2-4/+5
Move this information into struct scsi_emul_info so we can use it in common code. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25sandbox: scsi: Move block size into shared structSimon Glass2-5/+8
Move this information into struct scsi_emul_info so we can use it in common code. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25scsi: Move vendor/product info into the shared structSimon Glass2-6/+9
Move this information into struct scsi_emul_info so we can use it in common code. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25sandbox: Move buffer to scsi_emul_infoSimon Glass2-11/+35
Move the buffer into this struct so it can be shared between different implementations. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25scsi: Move core emulation state into a new structSimon Glass2-30/+62
In preparation for sharing the emulation code between two drivers, move some of the fields into a new struct. Use a separate header file so it can be used by various drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25scsi: Move cmd_phase enum to the headerSimon Glass2-15/+22
This can be used by common files, so move it to the SCSI header and rename it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25sandbox: usb: Rename transfer_len in protocol structSimon Glass1-3/+3
This has the same name as a field in our local private struct, which is confusing. Change the name to xfer_len instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25scsi: Tidy up comments for struct scsi_cmdSimon Glass1-18/+38
These comments are bit of a mess. Tidy them up to match the correct coding style. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25blk: Rename if_type to uclass_idSimon Glass28-232/+231
Use the word 'uclass' instead of 'if_type' to complete the conversion. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-25sandbox: unblock signal before calling execv()Heinrich Schuchardt1-0/+16
The following faulty behavior was observed. The sandbox configured with CONFIG_SANDBOX_CRASH_RESET=y was invoked with ./u-boot -T -S After executing `exception undefined' the sandbox reboots. When executing `exception undefined' the sandbox exits with SIGSEGV. The expected behavior is that the sandbox should reboot again. If we are relaunching the sandbox in a signal handler, we have to unblock the respective signal before calling execv(). See signal(7) man-page. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-24Merge branch '2022-09-24-add-console-flush' into nextTom Rini15-43/+205
To quote the author: On certain places it is required to flush output print buffers to ensure that text strings were sent to console or serial devices. For example when printing message that U-Boot is going to boot kernel or when U-Boot is going to change baudrate of terminal device. Some console devices, like UART, have putc/puts functions which just put characters into HW transmit queue and do not wait until all data are transmitted. Doing some sensitive operations (like changing baudrate or starting kernel which resets UART HW) cause that U-Boot messages are lost. Therefore introduce a new flush() function, implement it for all serial devices via pending(false) callback and use this new flush() function on sensitive places after which output device may go into reset state. This change fixes printing of U-Boot messages: "## Starting application at ..." "## Switch baudrate to ..." In addition, take a patch from Heinrich to rename some EFI test functions in order to not conflict with this series.
2022-09-24boot: Call flush() before bootingPali Rohár3-0/+4
In a lot of cases kernel resets UART HW. To ensure that U-Boot messages printed before booting the kernel are not lost, call new U-Boot console flush() function. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-24serial: Call flush() before changing baudratePali Rohár2-0/+6
Changing baudrate is a sensitive operation. To ensure that U-Boot messages printed before changing baudrate are not lost, call new U-Boot console flush() function. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-24serial: Implement serial_flush() function for console flush() fallbackPali Rohár4-0/+26
Like in all other console functions, implement also serial_flush() function as a fallback int console flush() function. Flush support is available only when config option CONSOLE_FLUSH_SUPPORT is enabled. So when it is disabled then provides just empty static inline function serial_flush(). Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-24serial: Implement flush callbackPali Rohár1-0/+20
UART drivers have putc/puts functions which just put characters into HW transmit queue and do not wait until all data are transmitted. Implement flush callback via serial driver's pending(false) callback which waits until HW transmit all characters from the queue. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-24console: Implement flush() functionPali Rohár5-0/+92
On certain places it is required to flush output print buffers to ensure that text strings were sent to console or serial devices. For example when printing message that U-Boot is going to boot kernel or when U-Boot is going to change baudrate of terminal device. Therefore introduce a new flush() and fflush() functions into console code. These functions will call .flush callback of associated stdio_dev device. As this function may increase U-Boot side, allow to compile U-Boot without this function. For this purpose there is a new config CONSOLE_FLUSH_SUPPORT which is enabled by default and can be disabled. It is a good idea to have this option enabled for all boards which have enough space for it. When option is disabled when U-Boot defines just empty static inline function fflush() to avoid ifdefs in other code. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-24sandbox: Add function os_flush()Pali Rohár2-0/+13
It flushes stdout. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-24efi_selftest: prefix test functions with efi_st_Heinrich Schuchardt1-43/+44
An upcoming patch set creates a global function flush(). To make debugging easier we should not use the same name for a static function. Rename static functions in the LoadImage() unit test adding an efi_st_ prefix. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-09-23Merge branch '2022-09-23-4gb-ddr-in-32bit-ppc' into nextTom Rini41-50/+131
To quote the author, for the first 9 patches: This patch series fixes U-Boot code to correctly handle RAM size larger than 2 GB and then fixes fsl ddr driver to do not crash U-Boot when 4 GB DDR module is detected when U-Boot operates in 32-bit mode (as opposite of the 36-bit mode). With this patch series it is possible to boot 32-bit U-Boot with 4 GB SODIMM DDR3 module without crashes. U-Boot will still use just CONFIG_MAX_MEM_MAPPED amount of RAM, but it is better than crashing due to the truncating of 4GB value to 32-bit number (which is zero). I tested this patch series on powerpc P2020 based board but only with U-Boot v2022.04 because U-Boot master branch is still broken on P2020. And then the final two patches here are (in my mind at least) related clean-ups.
2022-09-23board_f: show_dram_config: Print also real DRAM sizeWIP/2022-09-23-4gb-ddr-in-32bit-ppcPali Rohár1-1/+36
32-bit U-Boot builds cannot use more than around 2 GB of DDR memory. But on some platforms/boards it is possible to connect also 4 GB SODIMM DDR memory. U-Boot currently prints only effective size of RAM which can use, which may be misleading as somebody would expect that this line prints total size of connected DDR modules. So change show_dram_config code to prints both real and effective DRAM size if they are different. If they are same then print just one number like before. It is possible that effective size is just few bytes smaller than the real size, so print both numbers only in case function print_size() prints formats them differently. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-23display_options: print_size: Fix order overflowPali Rohár2-0/+9
Function print_size() round size to the nearst value with one decimal fraction number. But in special cases also unit order may overflow. For example value 1073689396 is printed as "1024 MiB" and value 1073741824 as "1 GiB". Fix this issue by detecting order overflow and increasing unit order. With this change also value 1073689396 is printed as "1 GiB". Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-23powerpc/mpc85xx: Fix re-align of unmapped DDR memory message for non-SPL buildsPali Rohár1-0/+3
During init_dram() is called also setup_ddr_tlbs_phys() function which may print message about unmapped DDR memory. So in this case print also re-aligning filler after unmapped DDR memory message. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-23powerpc/mpc85xx: Explain TLB unmapped memory messagePali Rohár1-1/+1
Currently U-Boot SPL prints just generic message "2 GiB left unmapped". Change it to more detailed "2 GiB of DDR memory left unmapped in U-Boot". This is just U-Boot configuration and operating system may map more (or also less) memory. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-23ddr: fsl: Fix re-align of verbose DRAM information for non-SPL buildsPali Rohár1-0/+3
During init_dram() is called also compute_lowest_common_dimm_parameters() function which prints multi-line detailed output. So print also re-aligning filler after "Detected ?DIMM" line to have "DRAM: " output aligned. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-23ddr: fsl: Allow to detect 4 GB DDR modules in 32-bit modePali Rohár1-4/+10
U-Boot core code already handles the case when RAM size is bigger than CONFIG_MAX_MEM_MAPPED. So there is no need to do duplicate check in fsl ddr driver for CONFIG_MAX_MEM_MAPPED. Instead simplify code to just check if RAM size can be representable in phys_size_t type. And avoid printing warning if phys_size_t is just 1 byte smaller than RAM size, which is the typical situation with 4 GB DDR module. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-23ddr: fsl: Fix fsl_ddr_sdram_size() for 4GB modules with 32-bit phys_size_tPali Rohár1-0/+4
Function fsl_ddr_compute() always return size in unsigned long long type, but function fsl_ddr_sdram_size() returns size in phys_size_t type. When 36-bit addressing mode is not enabled then phys_size_t type is only 32-bit and thus it cannot store value 4GB (0x100000000). Function fsl_ddr_sdram_size() in this case returns truncated value 0x0. Fix this issue by returning the highest representable value, which is 0xffffffff (4GB - 1 byte). This change fixes crashing of proper U-Boot because it detected 4 GB module as RAM with zero size. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-23ddr: fsl: Fix checking for maximal mappable memoryPali Rohár1-5/+14
Check needs to be done against CONFIG_MAX_MEM_MAPPED macro and not fixed size 4GB (as CONFIG_MAX_MEM_MAPPED can be lower and for example for e500 cores it is just 2GB). Also fix printf re-align, which should be applied only for non-SPL builds, during init_dram() call. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-09-23board_f: Fix printing gd->ram_size and gd->ram_topPali Rohár1-2/+2
Members gd->ram_size and gd->ram_top are of type phys_addr_t which does not have to fit into ulong type. So cast them into unsigned long long. Fixes: 37dc958947ed ("global_data.h: Change ram_top type to phys_addr_t") Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>