summaryrefslogtreecommitdiff
path: root/platform/common
AgeCommit message (Collapse)Author
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-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-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-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-08platform: clint: Allow running on 32-bit systemsAlistair Francis
Signed-off-by: Alistair Francis <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2019-01-23lib: Remove source_hart and hartid parameter from IPI callbacksAnup patel
The source_hart and hartid parameter is really not required in IPI callbacks of sbi_platform because current hartid can always be obtained by calling sbi_current_hartid() API. Signed-off-by: Anup Patel <[email protected]>
2019-01-18platform: Fix compile error caused by standard includesAnup Patel
Avoid using standard includes namely stdint.h, string.h, stdlib.h, etc. All standard include except stddef.h give compilation error due to differences in RISC-V toolchain configuration. Typically, the compilation error is related to "gnu-stubs-lp64.h". This patch fixes compile error caused by standard includes by providing substitutes of definetions provided by standard includes wherever required. Signed-off-by: Anup Patel <[email protected]>
2019-01-18platform: No need to pass context id for plic fixup.Atish Patra
PLIC DT entry fixup can be done by comparing external interrupt number instead of context id. No need to invoke fixup for each plic context. Signed-off-by: Atish Patra <[email protected]>
2019-01-18platform: Remove string functions from tinyfdt.cAtish Patra
There are couple of string function defined in platform code. We no longer need them as we can directly link minimal libc. Every platform required to inclde this as PLIC driver required libc functions. Signed-off-by: Atish Patra <[email protected]>
2019-01-18platform: Include libfdt & libc.Atish Patra
Signed-off-by: Atish Patra <[email protected]>
2019-01-18platform: Rename fdt.c to tinyfdt.cAtish Patra
Libfdt already have fdt.c and fdt.h. Rename both fdt.* present in openSBI to tinyfdt.* Signed-off-by: Atish Patra <[email protected]>
2019-01-18platform: Add libfdt support.Atish Patra
Some of the platform (i.e. SiFive FU540) requires Device Tree modification before it is passed to higher stages. Add libfdt support now to help this process. Libfdt should only be included per platform basis. Signed-off-by: Atish Patra <[email protected]>
2019-01-18platform: Add minimal libc support.Atish Patra
libfdt requires minimal libc support. Absoultely minimum functions are added in libc. Signed-off-by: Atish Patra <[email protected]>
2018-12-21Disable all interrupts during warm irqchip init.Atish Patra
M mode is not expected to recieve any interrupts. S mode interrupts shouldn't be enabled in M mode. Signed-off-by: Atish Patra <[email protected]>
2018-12-21Fix plic warm init in common code.Anup Patel
Unleashed doesn't have S mode for hart 0. PLIC register base calculation is current wrong because of that. Signed-off-by: Atish Patra <[email protected]> Signed-off-by: Anup Patel <[email protected]>
2018-12-21top: Rename "plat" to "platform" everywhereAnup Patel
This patch renames "plat" to "platform" everywhere for better readablility. Signed-off-by: Anup Patel <[email protected]>