summaryrefslogtreecommitdiff
path: root/platform
AgeCommit message (Collapse)Author
2020-01-24platform: template: typo fix in system reboot/shutdown namesJiuyang Liu (Sequencer)
This patch does minor typo fix in system reboot/shutdown names in platform operations. Signed-off-by: Jiuyang Liu (Sequencer) <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Signed-off-by: Anup Patel <[email protected]>
2020-01-15platform: thead/c910: Don't set plic/clint address in warm bootLiu Yibin
Since all harts share the same plic/clint address now, setting them during cold boot is just fine. Signed-off-by: Liu Yibin <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2020-01-15platform: thead/c910: Don't enable L2 cache in warm bootLiu Yibin
Since all harts share the same L2 cache now, there's no need to Enable L2 cache in warm boot. Signed-off-by: Liu Yibin <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2020-01-09platform: thead/c910: Remove SBI_PLATFORM_HAS_PMPLiu Yibin
T-head c910 is a generic FPGA platform so we cannot define PMP configuration for it in OpenSBI because PMP configuration tend to be SOC specific. Signed-off-by: Liu Yibin <[email protected]> Reviewed-by: Atish Patra <[email protected]>
2020-01-02platform: Add T-head C910 initial supportLiu Yibin
This commit provides basic support for the Thead/C910 platform. Signed-off-by: Liu Yibin <[email protected]> Reviewed-by: Atish Patra <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2020-01-02lib: utils: Support CLINT with 32bit MMIO access on RV64 systemAnup Patel
It is possible to have a CLINT implementation which supports only 32bit MMIO accesses on RV64 system so this patch extends our CLINT driver such that platform code can specify whether CLINT supports 64bit MMIO access. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra<[email protected]> Reviewed-by: Zong Li <[email protected]>
2019-09-28kendryte/k210: remove unused fileDamien Le Moal
Commit 9dfe72057957 ("kendryte/k210: remove sysctl code") missed removing the file sysctl.c. Fix this here. Fixes: 9dfe72057957 ("kendryte/k210: remove sysctl code") Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Atish Patra <[email protected]>
2019-09-10lib: provide a platform specific tlb range flush thresholdAtish Patra
Currently, the tlb range flush threshold is fixed and set to 4k for all platforms. However, it should be platform specific as it completely depends upon how platform actually implements sfence instruction. Define a platform feature that allows every individual platform to set different values. If a platform doesn't define it, just use a page size as the threshold. Signed-off-by: Atish Patra <[email protected]> Reviewed-by: Bin Meng <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2019-09-05kendryte/k210: remove sysctl codeDamien Le Moal
Directly implement frequency discovery, making the sysctl code unnecessary. While at it, Move all macro definitions from platform.c into platform.h and cleanup that file, removing the need for the Apache 2.0 license and Canaan Inc copyright. Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Bin Meng <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2019-09-05kendryte/k210: Use sifive UART driverDamien Le Moal
The Kendryte K210 UARTHS is compatible with SiFive UART. So use the sifive uart driver and remove the k210 uarths platform code. Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Bin Meng <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2019-08-23platform: Add Andes AE350 initial supportNylon Chen
This commit provides basic support for the AE350 platform. Signed-off-by: Zong Li <[email protected]> Signed-off-by: Nylon Chen <[email protected]>
2019-08-16platform: Remove the ipi_sync method from all platforms.Atish Patra
OpenSBI manages outstanding TLB flush requests by queueing them in a fifo synchronously. An ipi sync which uses an atomic operation on MMIO address is no longer required. Remove the ipi sync method from platform header and all usage. Signed-off-by: Atish Patra <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2019-08-09platform: sifive: fu540: Expand FDT size before any patchingBin Meng
We should expand the FDT size before any patching, otherwise it's possible the "status" fix up might fail due to insufficient space. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2019-07-25treewide: Use conventional names for 32-bit and 64-bitBin Meng
There are several places in the source tree that have: 32bit, 32 bit, 64bit, 64 bit Fix by using the conventional names with a hyphen. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Lukas Auer <[email protected]> Acked-by: Anup Patel <[email protected]>
2019-07-24platform: sifive/fu540: Move FDT further upAnup Patel
This patch changes FW_xyz_FDT_ADDR to RAM_START+128MB (i.e. 0x88000000) so that next stage bootloader (i.e. U-Boot) has enough space to unpack bigger kernel images. Reported-by: David Abdurachmanov <[email protected]> Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Bin Meng <[email protected]> Reviewed-by: David Abdurachmanov <[email protected]> Tested-by: David Abdurachmanov <[email protected]>
2019-07-22platform: sifive: fu540: Use standard value string for cpu node statusBin Meng
Per device tree spec, the standard value string for the "status" property of a cpu node is either "okay" or "disabled". "masked" was once used but it is unfortunately a spec violation. Signed-off-by: Bin Meng <[email protected]> Acked-by: Anup Patel <[email protected]>
2019-07-02platform: Remove the HiFive Unleashed expansion board DT.Atish Patra
The Linux kernel will maintain the device tree (DT) for HiFive Unleashed from release v5.2-rc6. This DT is incompatible with previous DT present for Microsemi expansion board in OpenSBI. Since, OpenSBI will directly load the pre-built DTB from kernel now onwards, no need to keep the out-of-date DT in openSBI. Remove this DT and it's related documentation. Signed-off-by: Atish Patra <[email protected]> Acked-by: Anup Patel <[email protected]>
2019-06-29include: Add version info to struct sbi_platformAbner Chang
Add version control of sbi_platform structure - Add opensbi_version, this gives information of opensbi revision on which the sbi_platform table was created. - Add platform_version field in sbi_platform structure for platform level version control. Signed-off-by: Abner Chang <[email protected]> Acked-by: Anup Patel <[email protected]>
2019-06-29include: Move callbacks in sbi_platform to separate structAbner Chang
Move platform opensbi functions to sbi_platform_operations structure. Both sbi_platform and sbi_platform_operations structures are maintained by platform vendors. Signed-off-by: Abner Chang <[email protected]> Acked-by: Anup Patel <[email protected]>
2019-06-29Add support for Ariane FPGA SoCPanagiotis Peristerakis
This patch adds support for Ariane platform. We needed to enable PLIC interrupts early(like on BBL) due to some issue of the design. Otherwise, Linux would not get any external interrupts. Signed-off-by: Panagiotis Peristerakis <[email protected]>
2019-06-19platform: Enable all drivers by default.Atish Patra
The drivers and libfdt are built as libsbiutils.a instead of libplatsbi.a. libsbiutils.a are not built per platform specific. Thus, enable all drivers by default. Signed-off-by: Atish Patra <[email protected]> Acked-by: Anup Patel <[email protected]>
2019-06-19platform: Move platform common to lib/utils.Atish Patra
Currently, platform/common contains platform/non-platform specific common minimal drivers and libraries. This is helpful is all platforms are built within opensbi framework. Move them to lib/utils so that any external platform code also can reuse the minimalistic drivers or other common libraries. This patch doesn't introduce any functional changes. Signed-off-by: Atish Patra <[email protected]> Acked-by: Anup Patel <[email protected]>
2019-06-19lib: Include helper libc functions directly in libsbi.Atish Patra
libsbi needs some of the custom libc functions. It should be directly included in libsbi instead of platform specific libraries. Signed-off-by: Atish Patra <[email protected]> Acked-by: Anup Patel <[email protected]>
2019-05-30platform: qemu/sifive_u: Update the hart count to 4Bin Meng
Since QEMU commit 8b1d0714bfdd "riscv: sifive_u: Allow up to 4 CPUs to be created", the maximum number of hart for sifive_u is 4. Change our hart count to match that. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Atish Patra <[email protected]>
2019-05-10platform: Enable dynamic firmware for appropriate platformsAnup Patel
This patch enables FW_DYNAMIC option (i.e. dynamic firmware) for all appropriate/applicable platforms. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Alistair Francis <[email protected]>
2019-04-25platform/common/libfdt: fix unnecessary multiple inclusionsXiang Wang
Signed-off-by: Xiang Wang <[email protected]>
2019-04-24all: run clang-format and update checked-in filesOlof Johansson
Noisy commit, no functional changes. Generated with an current upstream clang-format and: clang-format -i $(find . -name \*.[ch]) Signed-off-by: Olof Johansson <[email protected]>
2019-04-24all: Annotate some tables to have clang-format leave them aloneOlof Johansson
One of the shortcomings of clang-format is that it doesn't allow for aligned define tables, which is used for a number of constants. Add annotation to disable the automatic formatting where needed. Signed-off-by: Olof Johansson <[email protected]>
2019-04-24libfdt: don't try to clang-formatOlof Johansson
Add an empty clang-format to disable reformatting of imported code and make it easier to merge in upstream changes of that project over time. Signed-off-by: Olof Johansson <[email protected]>
2019-04-09TOP: Allow building platform out-of-treeAnup Patel
This patch extends our current build-system for building platform sources which are not part of OpenSBI sources. For example: Let's say we have out-of-tree ABC platform sources. We place these sources under <XYZ>/ABC directory along with its config.mk and objects.mk. To build out-of-tree ABC platform from OpenSBI directory: $ make PLATFORM_DIR=<XYZ>/ABC OR $ make PLATFORM_DIR=<XYZ> PLATFORM=ABC To build out-of-tree ABC platform from <XYZ>/ABC directory: $ make PLATFORM_DIR=<XYZ>/ABC -C <path_to_opensbi> OR $ make PLATFORM_DIR=<XYZ> PLATFORM=ABC -C <path_to_opensbi> Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Alistair Francis <[email protected]>
2019-04-03kendryte/k210: Fix file headersDamien Le Moal
Add missing SPDX and copyright information. Signed-off-by: Damien Le Moal <[email protected]>
2019-03-18platform: plic: Fix comments of programming the interrupt enable registerBin Meng
The codes that currently program the interrupt enable register for S-mode disagrees with what the comments say. Fix the comments. While we are here, add one line comment to describe what is done for M-mode too. Signed-off-by: Bin Meng <[email protected]>
2019-03-14platform: plic: Bypass interrupt ID 0's priority programmingBin Meng
Per PLIC spec, interrupt ID 0 is defined to mean "no interrupt". We should bypass it. Signed-off-by: Bin Meng <[email protected]>
2019-03-14platform: plic: Fix plic_set_priority()Bin Meng
At present plic_set_priority() ignores the 'source' and the priority register to be programmed is constant. Fix it. Signed-off-by: Bin Meng <[email protected]>
2019-03-13platform: fu540: Fix cosmetic styling issuesBin Meng
There are some spaces or mixed usage of spaces and tabs in the macro definition. Change to use tab consistently. Signed-off-by: Bin Meng <[email protected]>
2019-03-06platform: Make the `platform` read-onlyXiang Wang
platform should be a read-only variable, if it is placed in the data segment, it may be exploited. Signed-off-by: Xiang Wang <[email protected]>
2019-03-05lib:platform: Fix sbi_getc return type.Atish Patra
As per the current SBI specification, sbi_getc should return an int instead of char. In case of FIFO is empty, return -1 as per the specification. Reported-by: Sergi Granell <[email protected]> Suggested-by:Thadeu Lima de Souza Cascardo <[email protected]> Signed-off-by: Atish Patra <[email protected]>
2019-02-19template: Fix some callback namesSergi Granell
2019-02-19template: Remove trailing ';'Sergi Granell
2019-02-19template: Fix typo in platform_final_initSergi Granell
There was a space instead of '_' in the function `platform_final_init`.
2019-02-18platform: qemu-virt: Implement system shutdownNick Kossifidis
In order for QEMU to be compatible with Spike, it implements a simple protocol used for reporting back the simulation's status, through the memory-mapped "test finisher" device. We use that protocol to make QEMU exit on system shutdown. Signed-off-by: Nick Kossifidis <[email protected]>
2019-02-15Merge pull request #59 from avpatel/make-runAlistair Francis
Add 'make run' command for platform specific run
2019-02-15Makefile: Add 'make run' command for platform specific runOlof Johansson
Makes for easy and quick build-run one-stop command. For now only added for qemu targets. It can be added for any platform having simulator/emulator (such as QEMU). Signed-off-by: Olof Johansson <[email protected]> Signed-off-by: Anup Patel <[email protected]>
2019-02-15platform: fu540: Initial commit of Microsemi device treeAlistair Francis
Add a device tree for th HiFive Unleashed that includes the Microsemi PCIe root complex. Once we have support for u-boot and in tree Linux kernel device trees this device tree should be removed. Signed-off-by: Alistair Francis <[email protected]>
2019-02-15platform: fu540: Fix missing newlineAlistair Francis
Signed-off-by: Alistair Francis <[email protected]>
2019-02-14platform: Use CSR_<FOO> instead of <foo> for csr_*()Atish Patra
Some older toolchains may not have all the csr's defined. Update all the csr functions to use the CSR_ #define values instead of the toolchain defined values. Suggested-by: Olof Johansson <[email protected]> Signed-off-by: Atish Patra <[email protected]>
2019-02-12Makefile: Set ABI, ISA and Code Model in top-level makeAnup Patel
This patch introduces following optional PLATFORM options: PLATFORM_RISCV_XLEN -> RISC-V register width PLATFORM_RISCV_ABI -> RISC-V GCC ABI PLATFORM_RISCV_ISA -> RISC-V GCC ISA string PLATFORM_RISCV_CODE_MODEL -> RISC-V GCC Code Model If the above options are not provided by platform config.mk or by command-line parameters then: 1. PLATFORM_RISCV_XLEN will be determined using toolchain capability 2. PLATFORM_RISCV_ABI, PLATFORM_RISCV_ISA, and PLATFORM_RISCV_CODE_MODEL is set to value best suited for generic libsbi.a As a result of these optional PLATFORM options, the platform-cflags-y and platform-asflags-y is further simplified for platform config.mk. Signed-off-by: Anup Patel <[email protected]>
2019-02-12platform: qemu: Set FW_JUMP_ADDR and FW_PAYLOAD_OFFSET as-per XLENAnup Patel
The current 4MB aligned FW_JUMP_ADDR and FW_PAYLOAD_OFFSET breaks U-Boot on QEMU virt and sifive_u machines. Instead of using 4MB aligned for both 32bit and 64bit systems, we use different values based compiler XLEN. Another advantage of this approach will be that our fw_payload.bin will smaller for 64bit systems. Signed-off-by: Anup Patel <[email protected]>
2019-02-12platform: template: Improve comments for FW_JUMP_ADDR and FW_PAYLOAD_OFFSETAnup Patel
Both FW_JUMP_ADDR and FW_PAYLOAD_OFFSET, should be: 1. 4MB aligned for 32bit system 2. 2MB aligned for 64bit system Explicitly specify the above details in config.mk comments for template platform. Signed-off-by: Anup Patel <[email protected]>
2019-02-08platform: clint: Allow running on 32-bit systemsAlistair Francis
Signed-off-by: Alistair Francis <[email protected]>