summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2019-02-22include: Bump-up version to 0.2v0.2Anup Patel
This patch increases OpenSBI version to 0.2. Signed-off-by: Anup Patel <[email protected]>
2019-02-20firmware: Improve low-level trap handler for M-mode to M-mode trapsAnup Patel
This patch extends our low-level trap handler in fw_base.S for handling M-mode to M-mode traps without overwritting stack. Signed-off-by: Anup Patel <[email protected]>
2019-02-20include: Add PRILX define to help print unsigned longAnup Patel
The unsigned long is always machine word size. This means it is 4 bytes on 32bit system and 8 bytes on 64bit system. This patch adds PRILX define for sbi_printf() which will help us print unsigned long without worrying whether it is 32bit or 64bit system. Signed-off-by: Anup Patel <[email protected]>
2019-02-14lib: 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-08firmware: Use lw instead of lwu for 32-bit architecturesAlistair Francis
Signed-off-by: Alistair Francis <[email protected]>
2019-02-05riscv_asm.h: Use CSR_<FOO> instead of <foo> for csr_read()Olof Johansson
Some toolchains might not have all the CSRs available (as seen with GCC 7.2). So, instead use the defined CSR_ values. Signed-off-by: Olof Johansson <[email protected]>
2019-01-25include: Add separate header for OpenSBI versionAnup Patel
Currently, the OpenSBI version is in top-level Makefile so firmware linking to OpenSBI static library have no-way to know OpenSBI version. This patch moves OpenSBI version from top-level Makefile to sbi/sbi_version.h header which provides OPENSBI_VERSION_MAJOR and OPENSBI_VERSION_MINOR defines. NOTE: the SBI spec (or SBI ecall interface) version is different. The SBI spec version is provided by functions sbi_ecall_version_major() and sbi_ecall_version_minor(). Signed-off-by: Anup Patel <[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: Use TRUE/FALSE as return values in sbi_platform_hart_disabled()Anup Patel
The sbi_platform_hart_disabled() returns bool hence explicitly return TRUE or FALSE instead of 1 or 0. 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-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 <[email protected]>
2019-01-23include: Update documentation of sbi_platform after callback cleanupAnup Patel
The prototypes of sbi_platform callbacks have changed hence we update related documentation. 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 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 <[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-23lib: Remove hartid paramter from early_init() and final_init() callbacksAnup Patel
We simplify early_init() and final_init() callbacks of sbi_platform by removing "hartid" parameter. Signed-off-by: Anup Patel <[email protected]>
2019-01-22lib: Add doxygen style documentation for sbi_platformAnup Patel
This patch adds doxygen style documenation for struct sbi_platform and related functions/macros/defines. Signed-off-by: Anup Patel <[email protected]>
2019-01-22lib: Add atomic bit set/clear operations.Atish Patra
Add addtional functionlities for set/clear bits atomically. Signed-off-by: Atish Patra <[email protected]>
2019-01-21sbi: Add ecall helpersDamien Le Moal
Define sbi_ecall_console_puts() using sbi_ecall_console_putchar() renamed as sbi_ecall_console_putc() and remove the hardcoded version of the same funtion in the test payload code. Signed-off-by: Damien Le Moal <[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-16include: Add documentation for sbi_trap_regs and friendsAnup Patel
This patch adds doxygen style documentation for struct sbi_trap_regs and related macros/defines/functions. Signed-off-by: Anup Patel <[email protected]>
2019-01-16include: Add __packed define for packed structuresAnup Patel
This patch adds __packed define for specifying packed attribute of structures. Signed-off-by: Anup Patel <[email protected]>
2019-01-16include: Add documentation for sbi_scratch and friendsAnup Patel
This patch adds doxygen style documentation for struct sbi_scratch and related helper macros/defines. Signed-off-by: Anup Patel <[email protected]>
2019-01-16lib: Add documentation for sbi_init() APIAnup Patel
This patch adds doxygen style documentation for sbi_init() API. Signed-off-by: Anup Patel <[email protected]>
2019-01-16include: Add __noreturn define for noreturn function attributeAnup Patel
There are quite a few noreturn functions in OpenSBI hence we add commong __noreturn define for noreturn functin attribute. Signed-off-by: Anup Patel <[email protected]>
2019-01-03include: Add hard FP access macros and definesAnup Patel
This patch adds hardware floating-point (hard FP) access macros and defines. Signed-off-by: Anup Patel <[email protected]>
2019-01-02include: Remove redundant tmp0 from struct sbi_scratchAnup Patel
The tmp0 member was added in struct sbi_scratch to assist register save/restore at time of trap handling. This tmp0 is not unsed any more hence removing it. Signed-off-by: Anup Patel <[email protected]>
2019-01-02include: Move RISCV_TRAP_REGS_xyz defines to sbi_trap.hAnup Patel
The struct sbi_trap_regs related defines RISCV_TRAP_REGS_xyz should be in sbi_trap.h so that we can keep these defines in-sync with changes in struct sbi_trap_regs. Signed-off-by: Anup Patel <[email protected]>
2019-01-02include: Move RISCV_PLATFORM_xyz defines to sbi_platform.hAnup Patel
The struct sbi_platform related defines RISCV_PLATFORM_xyz should be in sbi_platform.h so that we can keep these defines in-sync with changes in struct sbi_platform. Signed-off-by: Anup Patel <[email protected]>
2019-01-02include: Move RISCV_SCRATCH_xyz defines to sbi_scratch.hAnup Patel
The struct sbi_scratch related defines RISCV_SCRATCH_xyz should be in sbi_scratch.h so that we can keep these defines in-sync with changes in struct sbi_scratch. Signed-off-by: Anup Patel <[email protected]>
2019-01-02include: Replace #csr with __ASM_STR(csr) in csr_xyz() macrosAnup Patel
We replace #csr with __ASM_STR(csr) in all csr_xyz() macros so that we can pass CSR number instead of CSR name when GCC is not aware of CSR name. Signed-off-by: Anup Patel <[email protected]>
2019-01-02include: Remove redundant csr_read_n() and csr_write_n()Anup Patel
The patch removes redundant csr_read_n() and csr_write_n() because same thing can be achieved by using __ASM_STR() macro in csr_read() and csr_write() macros. Signed-off-by: Anup Patel <[email protected]>
2018-12-31lib: Redirect illegal instruction trap to S-mode when not handledAnup Patel
Currently, we fail with error SBI_ENOTSUPP when we are not able to handle illegal instruction trap. Instead, we should just redirect illegal instruction trap to S-mode when not handled. This redirection of illegal instruction trap will help lazy save/restore of floating point registers to work correctly in Linux kernel. Signed-off-by: Anup Patel <[email protected]>
2018-12-27lib: Rename target_hart parameter to hartid for PMP platform callbacksAnup Patel
We rename target_hart parameter of PMP platform callbacks to hartid for clarity because the parameter represents current hartid. Signed-off-by: Anup Patel <[email protected]>
2018-12-27lib: Simplify sbi_platform timer_init() hooksAnup Patel
Instead of having separate timer_init() hooks for cold and warm boot, this patch updates struct sbi_platform to have just one timer_init() hook. The type of boot (cold or warm) is now a boolean flag parameter for the updated timer_init() hook. Signed-off-by: Anup Patel <[email protected]>
2018-12-27lib: Simplify sbi_platform ipi_init() hooksAnup Patel
Instead of having separate ipi_init() hooks for cold and warm boot, this patch updates struct sbi_platform to have just one ipi_init() hook. The type of boot (cold or warm) is now a boolean flag parameter for the updated ipi_init() hook. Signed-off-by: Anup Patel <[email protected]>
2018-12-27lib: Simplify sbi_platform irqchip_init() hooksAnup Patel
Instead of having separate irqchip_init() hooks for cold and warm boot, this patch updates struct sbi_platform to have just one irqchip_init() hook. The type of boot (cold or warm) is now a boolean flag parameter for the updated irqchip_init() hook. Signed-off-by: Anup Patel <[email protected]>
2018-12-27lib: Simplify sbi_platform early_init() and final_init() hooksAnup Patel
Instead of having separate early_init() and final_init() hooks for cold and warm boot, this patch updates struct sbi_platform to have just one early_init() and one final_init() hook. The type of boot (cold or warm) is now a boolean flag parameter for the updated early_init() and final_init() hooks. Signed-off-by: Anup Patel <[email protected]>
2018-12-27lib: Move ECALL defines to sbi_ecall_interface.hAnup Patel
This patch moves all ECALL defines to sbi_ecall_interface.h so that it can be shared with firmware payloads. Signed-off-by: Anup Patel <[email protected]>
2018-12-26lib: Add misaligned load/store trap handlingAnup Patel
We generally don't get misaligned load/store traps from Linux/U-Boot compiled using GCC 8.2 or higher but this is not true with older GCC toolchains. To tackle this we add misaligned load/store trap handling adopted from BBL sources but much more simpler. (Note: BBL sources can be found at https://github.com/riscv/riscv-pk.git) Signed-off-by: Anup Patel <[email protected]>
2018-12-26lib: Move instruction encoding macros to riscv_encoding.hAnup Patel
This patch moves all instruction encoding macros to riscv_encoding.h. Signed-off-by: Anup Patel <[email protected]>
2018-12-22firmware: Don't depend on PLAT_HART_COUNT and PLAT_HART_STACK_SIZEAnup Patel
The hart_count and hart_stack_size information is already available in "struct sbi_platform" so we use that instead of depending on PLAT_HART_COUNT and PLAT_HART_STACK_SIZE. Signed-off-by: Anup Patel <[email protected]>
2018-12-21Introduce hart disabled parameter in platform.Atish Patra
As of now, uboot doesn't have support for SMP. Moreover, unleashed board has a E51 hart which doesn't not support S mode. We should only boot only 1 non-zero hart. Signed-off-by: Atish Patra <[email protected]>
2018-12-21Introduce HAS_MFAULTS_DELEGATION featureDamien Le Moal
Conditionnally delegate page fault exceptions from M mode to S mode based on the platform features. Signed-off-by: Damien Le Moal <[email protected]>
2018-12-21Introduce sbi_current_hartid()Damien Le Moal
Use this helper instead of hardcoding csr_read(mhartid). Signed-off-by: Damien Le Moal <[email protected]>
2018-12-21Cleanup and rename sbi_hart_boot_next()Damien Le Moal
Cleanup sbi_hart_boot_nexti() code, adding messages for clarity and rename the function to sbi_hart_switch_mode() to reflect what the function actually does. Signed-off-by: Damien Le Moal <[email protected]>
2018-12-21Refine platform features controlDamien Le Moal
Allow a platform to report its supported features in more details. The new features defined are: * SBI_PLATFORM_HAS_PMP * SBI_PLATFORM_HAS_SCOUNTEREN * SBI_PLATFORM_HAS_MCOUNTEREN In addition, define the macro SBI_PLATFORM_DEFAULT_FEATURES as the set of features that are generally expected to be supported by a Linux capable platform. Operations touching the features controlled with these falgs are not executed if the platform does not set the corresponding feature flags. Signed-off-by: Damien Le Moal <[email protected]>
2018-12-20Use wfi for coldboot finish call.Atish Patra
Signed-off-by: Atish Patra <[email protected]>
2018-12-11Initial commit.Anup Patel
Signed-off-by: Anup Patel <[email protected]>