aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv
AgeCommit message (Collapse)Author
2024-06-04Merge tag 'v2024.07-rc4' into nextTom Rini
Prepare v2024.070-rc4
2024-05-30andes: Use UCCTLCOMMAND instead of MCCTLCOMMANDLeo Yu-Chi Liang
Use CSR_UCCTLCOMMAND instead of CSR_MCCTLCOMMAND to do cache flush operation in M-mode and S-mode. Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-05-30riscv: remove cache enablement in start.SLeo Yu-Chi Liang
Cache could be enabled in harts_early_init board-specific hook, so remove cache enablement in start.S Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-14andes: Unify naming policy for Andes related sourceLeo Yu-Chi Liang
Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-05-14riscv: simplify backtrace reportHeinrich Schuchardt
* We already have a header 'backtrace', there is no need to repeat the word backtrace on every line. * Add a blank line before the backtrace section of the crash report for improved readability. * If U-Boot is compiled without backtrace, there is no need to write a message at all. * Avoid #ifdef. We prefer functions to always be compiled and let the linker remove them if not needed. * Foresee 3 digits for the backtrace index. For testing the 'exception' command can be used. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-05-14board: starfive: function to read eMMC sizeHeinrich Schuchardt
The EEPROM provides information about the size of the eMMC. Provide a new function get_mmc_size_from_eeprom() to read it. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: E. Shattow <lucent@gmail.com>
2024-05-06global: Make <asm/global_data.h> include <asm/u-boot.h>Tom Rini
This follows the example of RISC-V where <asm/global_data.h> includes <asm/u-boot.h> directly as "gd" includes a reference to bd_info already and so the first must include the second anyhow. We then remove <asm/u-boot.h> from all of the places which include references to "gd" an so have <asm/global_data.h> already. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-02board: starfive: Rename spl_soc_init() to spl_dram_init()Lukas Funke
Rename spl_soc_init() to spl_dram_init() because the generic function name does not reflect what the function actually does. Also spl_dram_init() is commonly used for dram initialization and should be called from board_init_f(). Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2024-05-02board: sifive: Rename spl_soc_init() to spl_dram_init()Lukas Funke
Rename spl_soc_init() to spl_dram_init() because the generic function name does not reflect what the function actually does. Also spl_dram_init() is commonly used for dram initialization and should be called from board_init_f(). Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-05-02riscv: dts: sophgo: Add spi nor flash controller nodeKongyang Liu
Add spi nor flash controller node for cv18xx SoCs Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-05-02riscv: dts: sophgo: Add ethernet nodeKongyang Liu
Add ethernet node for cv1800b SoC Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-05-01cmd: sbi: add Supervisor Software Events extensionHeinrich Schuchardt
OpenSBI has implemented the Supervisor Software Events Extension. Allow detecting it in the sbi command. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-05-01riscv: andesv5: Set default cache line size to 64-bytesYu Chien Peter Lin
The instruction and data cache line sizes of Andes core are 64-byte. Select SYS_CACHE_SHIFT_6 for RISCV_NDS so the SYS_CACHELINE_SIZE is enabled with a default value. Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-18Revert "Merge patch series "pxe: Allow extlinux booting without CMDLINE ↵Tom Rini
enabled"" As reported by Jonas Karlman this series breaks booting on some AArch64 platforms with common use cases. For now the best path forward is to revert the series. This reverts commit 777c28460947371ada40868dc994dfe8537d7115, reversing changes made to ab3453e7b12daef47b9e91da2a2a3d48615dc6fc. Link: https://lore.kernel.org/u-boot/50dfa3d6-a1ca-4492-a3fc-8d8c56b40b43@kwiboo.se/ Signed-off-by: Tom Rini <trini@konsulko.com>
2024-04-10Merge patch series "pxe: Allow extlinux booting without CMDLINE enabled"Tom Rini
Simon Glass <sjg@chromium.org> says: This series is the culmanation of the current line of refactoring series. It adjusts pxe to call the booting functionality directly rather than going through the command-line interface. With this is is possible to boot using the extlinux bootmeth without the command line enabled. It also updates fastboot to do a similar thing.
2024-04-10treewide: Make arch-specific bootm code depend on BOOTMSimon Glass
Allow these functions to be compiled in when CONFIG_BOOTM is enabled, even if CONFIG_CMD_BOOTM is not. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Angelo Dureghello <angelo@kernel-space.org>
2024-04-10Merge tag 'xilinx-for-v2024.07-rc1' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-microblaze Xilinx changes for v2024.07-rc1 xilinx: - Do not call env_get_location when !ENV_IS_NOWHERE - Add FDT_FIXUP_PARTITIONS support - Fix legacy format MAC decoding zynqmp: - Enable semihosting SPL support - DT updates - Kconfig resort/cleanup - Don't describe second image/capsule if !SPL - Add support for dfu/capsule description via MTD - Support JTAG as alternative boot mode - Add support for TEG soc variant zynqmp-kria: - Wire usb4 boot device - Update SDIO tristate pin configuration - Disable SPI_FLASH_BAR to avoid issue with SPI after update mbv: - Enable SPL and binman - Small platform changes zynqmp-nand: - Error out in case of unsupported SW ECC - Clean error path versal-net: - Support multiple locations for variables
2024-04-09eeprom: starfive: function get_product_id_from_eeprom()Heinrich Schuchardt
Export a function get_product_id_from_eeprom() to read the product ID. This value can be used for fixing up the device-tree on JH7110 based products. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09riscv: starfive: MMC card detectHeinrich Schuchardt
The VisionFive 2 board uses GPIO 41 as card detect as documented in https://doc-en.rvspace.org/VisionFive2/PDF/SCH_RV002_V1.2A_20221216.pdf. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Acked-by: Minda Chen <minda.chen@starfivetech.com>
2024-04-09riscv: Move virtio scan to board_late_init()Łukasz Stelmach
When virtio_init() gets called from board_init() PCI isn't ready. Thus, virtio-over-PCI (e.g. network interfaces) devices can't be detected and used without additional `virtio scan` scan in the shell or a script. Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09riscv: support extension probing using riscv, isa-extensionsConor Dooley
A new property has been added, with an extensive rationale at [1], that can be used in place of "riscv,isa" to indicate what extensions are supported by a given platform that is a list of strings rather than a single string. There are some differences between the new property, "riscv,isa-extensions" and the incumbent "riscv,isa" - chief among them for the sake of parsing being the list of strings, as opposed to a string. Another advantage is strictly defined meanings for each string in a dt-binding, rather than deriving meaning from RVI standards. This will likely to some divergence over time, but U-Boot's current use of extension detection is very limited - there are just four callsites of supports_extension() in mainline U-Boot. These checks are limited to two checks for FPU support and two checks for "s" and "u". "s" and "u" are not supported by the new property, but they were also not permitted in "riscv,isa". These checks are only meaningful (or run) in M-Mode, in which case supports_extension() does not parse the devicetree anyway. Add support for the new property in U-Boot, prioritising it, before falling back to the, now deprecated, "riscv,isa" property if it is not present. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09riscv: don't read riscv, isa in the riscv cpu's get_desc()Conor Dooley
cpu_get_desc() for the RISC-V CPU currently reads "riscv,isa" to get the description, but it is no longer a required property and cannot be assummed to always be present, as the new "riscv,isa-extensions" and "riscv,isa-base" properties may be present instead. On RISC-V, cpu_get_desc() has two main uses - firstly providing an informational name for the CPU for smbios or at boot with DISPLAY_CPUINFO etc and secondly it forms the basis of ISA extension detection in supports_extension() as it returns (a portion of) an ISA string. cpu_get_desc() returns a string, which aligned with "riscv,isa" but the new property is a list of strings. Rather than add support for the list of strings property, which would require creating an isa string from "riscv,isa-extensions", modify the RISC-V CPU's implementaion of cpu_get_desc() return the first compatible as the cpu description instead. This may be fine for the informational cases, but it would break extension dtection, given supports_extension() expects cpu_get_desc() to return an ISA string. Call dev_read_string() directly in supports_extension() to get the contents of "riscv,isa" so that extension detection remains functional. As a knock-on affect of this change, extension detection is no longer broken for long ISA strings. Previously if the ISA string exceeded the 32 element array that supports_extension() passed to cpu_get_desc(), it would return ENOSPC and no extensions would be detected. This bug probably had no impact as U-Boot does not currently do anything meaningful with the results of supports_extension() and most SoCs supported by U-Boot don't have anywhere near that complex of an ISA string. The QEMU virt machine's CPUs do however, so extension detection doesn't work there. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09riscv: dts: sophgo: Add clk node and sdhci nodeKongyang Liu
Add clk node and sdhci node for cv18xx SoCs according to patches from Linux kernel. clk: https://lore.kernel.org/all/IA1PR20MB4953F9AD6792013B54636F05BB4F2@IA1PR20MB4953.namprd20.prod.outlook.com/ sdhci: https://lore.kernel.org/all/20240217144826.3944-1-jszhang@kernel.org/ Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09riscv: cache: Implement dcache for cv1800bKongyang Liu
Add dcache operations invalidate_dcache_range and flush_dcache_range for cv1800b. Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09riscv: cpu: cv1800b: Add support for cv1800b SoCKongyang Liu
Add Sophgo cv1800b SoC to support RISC-V arch. Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09riscv: add backtrace supportBen Dooks
When debugging, it is useful to have a backtrace to find out what is in the call stack as the previous function (RA) may not have been the culprit. Since this adds size to the build, do not add it by default and avoid putting it in the SPL build if not needed. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Tested-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-03-19Merge tag 'u-boot-socfpga-next-20240319' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-socfpga into next - A new driver in the misc to register setting from device tree. This also provides user a clean interface and all register settings are centralized in one place, device tree. - Enable Agilex5 platform for Intel product. Changes, modification and new files are created for board, dts, configs and makefile to create the base for Agilex5. Build-tested on SoC64 boards, boot tested on some of them.
2024-03-13Kconfig: move CONFIG_32/64BIT to arch/KconfigDan Carpenter
These configs are used in multiple places so put them in a shared Kconfig file. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-03-12riscv: dts: jh7110: Enable PLL node in SPLBo Gan
Previously PLL node was missing from SPL dts. This caused BUS_ROOT to stay on OSC clock (24Mhz). As a result, all peripherals have to run at a much lower frequency, and loading from sdcard/emmc is slow. Thus, enabling PLL node in dts to fix this. Signed-off-by: Bo Gan <ganboing@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-03-12riscv: cpu: improve multi-letter extension detection in supports_extension()Conor Dooley
The first multi-letter extension after the single-letter extensions does not have to be preceded by an underscore, which could cause the parser to mistakenly find a single-letter extension after the start of the multi-letter portion of the string. Three letters precede multi-letter extensions (s, x & z), none of which are valid single-letter extensions. The dt-binding also allows multi-letter extensions starting with h, but no such extension have been frozen or ratified, and the unprivileged spec no longer uses "h" as a prefix for multi-letter hypervisor extensions, having moved to "sh" instead. For that reason, modify the parser to stop at s, x & z to prevent this overrun, ignoring h. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-03-12riscv: dts: jh7110: fix indentationLeon M. Busch-George
Signed-off-by: Leon M. Busch-George <leon@georgemail.eu> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-03-12riscv: sifive: fu740: reduce DDR speed from 1866MT/s to 1600MT/sThomas Perrot
It appears that there is some timing marginality either in the board layout or the SoC that results in occasional data corruption on some boards. We observed this issue on some of the new HiFive Unmatched RevB boards during volume production as well as some of the original HiFive Unmatched boards from 2021 in our possession. This means that there are other boards out there that might have the issue too. We have done some limited testing with DDR4 at 1600MT/s and faulty boards (failing at 1866MT/s) passed. We plan further testing after we procure a temperature chamber. Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-03-01riscv: mbv: Enable SPL and binmanMichal Simek
Enable SPL and binman to generate u-boot.img (machine mode) and u-boot.itb (supervisor mode). DTB is placed at fixed address to ensure that it is 8 byte aligned which is not ensured when dtb is attached behind SPL binary that's why SPL and U-Boot are taking DTB from the same address. Also align addresses for both defconfigs. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/85506bce5580d448f095f267d029e3932c5e9990.1707911544.git.michal.simek@amd.com
2024-02-28efi_loader: set IMAGE_DLLCHARACTERISTICS_NX_COMPATHeinrich Schuchardt
The IMAGE_DLLCHARACTERISTICS_NX_COMPAT flag marks an EFI binary where the following conditions are met [1]: * Executable and writable sections are separated. * The application does not run self-modifying code. * The application uses the EFI_MEMORY_ATTRIBUTE_PROTOCOL when loading executable code. * The application does not assume that all memory ranges are usable. * The stack is not expected to be executable. The only EFI binaries U-Boot provides that do not fulfill these requirements are the EFI app and the EFI payload. Once we have implemented separation of writable and executable memory in U-Boot we can use the IMAGE_DLLCHARACTERISTICS_NX_COMPAT flag to decide if we will load an EFI binary. [1] New UEFI CA memory mitigation requirements for signing https://techcommunity.microsoft.com/t5/hardware-dev-center/new-uefi-ca-memory-mitigation-requirements-for-signing/ba-p/3608714 Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-01-31riscv: dts: starfive: add regulator deviceNam Cao
Add the axp15060 regulator device. OpenSBI uses this device to perform board reset and shutdown. Signed-off-by: Nam Cao <namcao@linutronix.de> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31riscv: dts: jh7110: add power management unit controller nodeNam Cao
JH7110 has a power management unit controller node. Add this node. This device is used by OpenSBI during board reset/shutdown. Signed-off-by: Nam Cao <namcao@linutronix.de> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31riscv: sophgo: milkv_duo: initial support addedKongyang Liu
Add support for Sophgo's Milk-V Duo board, only minimal device tree and serial console are enabled, and it can boot via vendor first stage bootloader. Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31riscv: dts: sophgo: add basic device tree for Milk-V Duo boardKongyang Liu
Import device tree from Linux kernel to add basic support for CPU, PLIC, UART and Timer. The name cv1800b in the filename represent the chip used on Milk-V Duo board. Signed-off-by: Kongyang Liu <seashell11234455@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31riscv: Support building with Clangkleines Filmröllchen
The -ffixed-gp option of GCC has an exact equivalent of -ffixed-x3 in Clang. Signed-off-by: kleines Filmröllchen <filmroellchen@serenityos.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-01-31cmd: sbi: add support for Debug Trigger ExtensionHeinrich Schuchardt
Detect and show if the SBI implements the Debug Trigger Extension. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31board: sifive: spl: Initialized the PWM setting in the SPL stageVincent Chen
LEDs and multiple fans can be controlled by SPL. This patch ensures that all fans have been enabled in the SPL stage. In addition, the LED's color will be set to yellow. Signed-off-by: Vincent Chen <vincent.chen@sifive.com> Co-developed-by: Nylon Chen <nylon.chen@sifive.com> Signed-off-by: Nylon Chen <nylon.chen@sifive.com> Co-developed-by: Zong Li <zong.li@sifve.com> Signed-off-by: Zong Li <zong.li@sifve.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-29riscv: separate .data and .text sections of EFI binariesHeinrich Schuchardt
EFI binaries should not contain sections that are both writable and executable. Separate the RX .text section from the RW .data section Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-01-29riscv: page align EFI binary sectionHeinrich Schuchardt
Change the alignment of the relocation code in EFI binaries to match page boundaries. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-01-29riscv: conflicting SPDX license linker scriptsHeinrich Schuchardt
Fix conflicting SPDX license information in linker scripts introduced by commit 7215787c4ea4 ("SPDX: Convert single license tags to Linux Kernel style"). Fixes: 7215787c4ea4 ("SPDX: Convert single license tags to Linux Kernel style") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-01-07riscv: add ACPI fields to global dataHeinrich Schuchardt
Add fields for the location of ACPI tables to the global data. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-12-27andes: cpu: Enable cache and TLB ECC supportLeo Yu-Chi Liang
Andes CPU supports cache and TLB ECC. Enable them by default. Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com> Reviewed-by: Yu Chien Peter Lin <peterlin@andestech.com>
2023-12-27andes: cpu: Enable memboost featureLeo Yu-Chi Liang
Andes CPU has memboost feature including prefetch, write-around and non-blocking load. Enable them by default. Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com> Reviewed-by: Yu Chien Peter Lin <peterlin@andestech.com>
2023-12-27andes: ae350: Implement cache switch via KconfigLeo Yu-Chi Liang
Kconfig provides SYS_[I|D]CACHE_OFF config options to switch off caches. Provide the corresponding implementation to the options. Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com> Reviewed-by: Yu Chien Peter Lin <peterlin@andestech.com>