aboutsummaryrefslogtreecommitdiff
path: root/platform
AgeCommit message (Collapse)Author
2019-08-23platform: Add Andes AE350 initial supportNylon Chen
This commit provides basic support for the AE350 platform. Signed-off-by: Zong Li <zongbox@gmail.com> Signed-off-by: Nylon Chen <nylon7@andestech.com>
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 <atish.patra@wdc.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
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 <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
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 <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Acked-by: Anup Patel <anup.patel@wdc.com>
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 <david.abdurachmanov@sifive.com> Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: David Abdurachmanov <david.abdurachmanov@sifive.com> Tested-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
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 <bmeng.cn@gmail.com> Acked-by: Anup Patel <anup.patel@wdc.com>
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 <atish.patra@wdc.com> Acked-by: Anup Patel <anup.patel@wdc.com>
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 <abner.chang@hpe.com> Acked-by: Anup Patel <anup.patel@wdc.com>
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 <abner.chang@hpe.com> Acked-by: Anup Patel <anup.patel@wdc.com>
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 <perister@ics.forth.gr>
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 <atish.patra@wdc.com> Acked-by: Anup Patel <anup.patel@wdc.com>
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 <atish.patra@wdc.com> Acked-by: Anup Patel <anup.patel@wdc.com>
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 <atish.patra@wdc.com> Acked-by: Anup Patel <anup.patel@wdc.com>
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 <bmeng.cn@gmail.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
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 <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
2019-04-25platform/common/libfdt: fix unnecessary multiple inclusionsXiang Wang
Signed-off-by: Xiang Wang <wxjstz@126.com>
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 <olof@lixom.net>
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 <olof@lixom.net>
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 <olof@lixom.net>
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 <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
2019-04-03kendryte/k210: Fix file headersDamien Le Moal
Add missing SPDX and copyright information. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
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 <bmeng.cn@gmail.com>
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 <bmeng.cn@gmail.com>
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 <bmeng.cn@gmail.com>
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 <bmeng.cn@gmail.com>
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 <wxjstz@126.com>
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 <xerpi.g.12@gmail.com> Suggested-by:Thadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br> Signed-off-by: Atish Patra <atish.patra@wdc.com>
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 <mick@ics.forth.gr>
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 <olof@lixom.net> Signed-off-by: Anup Patel <anup.patel@wdc.com>
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 <alistair.francis@wdc.com>
2019-02-15platform: fu540: Fix missing newlineAlistair Francis
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
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 <olof@lixom.net> Signed-off-by: Atish Patra <atish.patra@wdc.com>
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 <anup.patel@wdc.com>
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 <anup.patel@wdc.com>
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 <anup.patel@wdc.com>
2019-02-08platform: clint: Allow running on 32-bit systemsAlistair Francis
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-08platform: qemu/virt: Move kernel start address to 4MB allignedAlistair Francis
In order to support 32-bit guests move the start address to a 4MB allignment. As 64-bit kernels have a requirement on being 2MB alligned let's just make this the default for both 32 and 64 bit kernels. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-08platform: template: Move kernel start address to 4MB allignedAlistair Francis
In order to support 32-bit guests move the start address to a 4MB allignment. As 64-bit kernels have a requirement on being 2MB alligned let's just make this the default for both 32 and 64 bit kernels. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-08platform/qemu/virt: Dynamically calculate xlenAlistair Francis
The QEMU virt machine can be either 32 or 66 bit. Don't hard code the CPU bit length and instead let the compiler determine it. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-01-29platform: fu540: Provide a compile time option selective hart booting.Atish Patra
Currently, only hart 1 is enabled for fu540 platform to support U-boot. Introduce a compile time FU540_ENABLED_HART_MASK option so that specific harts can be selected for booting. As fu540 is a multicore, we should boot all cores by default except hart 0. Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-01-24platform: add template platform filesDamien Le Moal
Create commented template files to use as a base for new platforms support implementation. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2019-01-24all: Update copyright header in all filesAnup patel
This patch updates copyright header in all files as follows: 1. Makes "SPDX-License-Identifier: BSD-2-Clause" as first line 2. Change copyright year to 2019 for Western Digital Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-01-23include: Rename ipi_inject() to ipi_send() for sbi_platformAnup Patel
For better naming, we rename ipi_inject() to ipi_send() in struct sbi_platform. We also replace term "inject" with "send" in all related places. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-01-23include: Drop MMIO from SBI_PLATFORM_HAS_MMIO_TIMER_VALUEAnup Patel
It is not necessary that platform has MMIO-based timer value register. It can also have some custom (implementation specific) CSR for timer value. This patch renames SBI_PLATFORM_HAS_MMIO_TIMER_VALUE to SBI_PLATFORM_HAS_TIMER_VALUE to imply "platform timer value" instead of "mmio timer value". Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-01-23lib: Remove target_hart and hartid parameter from TIMER callbacksAnup Patel
The target_hart and hartid paramter of TIMER callbacks is not required because it always current hartid which can be obtained using sbi_current_hartid() API. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-01-23lib: Remove hartid parameter from IRQCHIP callbacksAnup Patel
The hartid parameter in IRQCHIP callbacks of sbi_platform is not required because current hartid can be determined using sbi_current_hartid() API. Signed-off-by: Anup Patel <anup.patel@wdc.com>