summaryrefslogtreecommitdiff
path: root/platform
AgeCommit message (Collapse)Author
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[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-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-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-21kendryte/k210: Add device tree supportDamien Le Moal
The Kendryte k210 board initial loader does not provide a device tree for the firmware and subsequent payload. Add the k210.dts device tree description file to solve this. This file describes only the SoC core components: CPUs, memory and PLIC. Automatically compile and add this file to the firmware generated using the FW_PAYLOAD_FDT_PATH configuration parameter. Signed-off-by: Damien Le Moal <[email protected]>
2019-01-21kendryte/k210: Fix consoleDamien Le Moal
Clear console input when intializing it. Signed-off-by: Damien Le Moal <[email protected]>
2019-01-21build: Introduce FW_PAYLOAD_ALIGNDamien Le Moal
The firmware payload offset defined by FW_PAYLOAD_OFFSET must specify a value large enough so the the payload does not overlap with the base firmware data, bss and text. For platforms without any strong requirement on the payload address, introduce the FW_PAYLOAD_ALIGN build parameter to automatically place the payload right after the base firmware at an address aligned with the defined value. Either FW_PAYLOAD_OFFSET or FW_PAYLOAD_ALIGN should be defined by a platform configuration. If both FW_PAYLOAD_OFFSET and FW_PAYLOAD_ALIGN are defined by a platform, FW_PAYLOAD_OFFSET has precedence and is used for building the final firmawre image. Using FW_PAYLOAD_ALIGN=4096 with the Kendryte platform rather than the abitrary FW_PAYLOAD_OFFSET=0x10000 value reduces the final firmware image size by about 20KB. Add a description of the FW_PAYLOAD_ALIGN configuration parameter in the fw_payload documentation file as well. And while at it, also fix various grammar and style issues in that file.. Signed-off-by: Damien Le Moal <[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: Modify DT using libfdtAtish Patra
Perform following DT updates. 1. Mask hart if mmu is not supported. 2. Add stdout-path under chosen node. 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]>
2019-01-03platform: kendryte/k210: Simplify sysctl codeDamien Le Moal
Simplify sysctl.c code to only the used CPU freqency function. This reduces the size of the final firmware by 4KB. Signed-off-by: Damien Le Moal <[email protected]>
2019-01-03platform: kendryte/k210: Declare local function staticDamien Le Moal
k210_console_putc() and k210_console_init() are local functions. Declare them as static. Signed-off-by: Damien Le Moal <[email protected]>
2018-12-31platform: Fix author name for Kendryte K210 platformAnup Patel
The Kendryte K210 platform support was contributed by Damien hence fix author name. Signed-off-by: Anup Patel <[email protected]>
2018-12-31platform: Rename sifive/hifive_u540 to sifive/fu540Anup Patel
We rename sifive/hifive_u540 platform support to sifive/fu540 to match the SoC name which is SiFive FU540 (as-per user manual). In fact, we can expect no (or very minimal) board specific quirks in sifive/fu540 platform support. These board specific quirks can be turned on/off in-future using PLATFORM_<xyz> make command-line option. Signed-off-by: Anup Patel <[email protected]> Signed-off-by: Atish Patra <[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-22platform: Remove PLAT_HART_COUNT and PLAT_HART_STACK_SIZEAnup Patel
The PLAT_HART_COUNT and PLAT_HART_STACK_SIZE are only used by platform code so no need of exposing these to everyone by adding it to platform-cppflags-y. Signed-off-by: Anup Patel <[email protected]>
2018-12-22platform: Remove PLAT_NAME from all platformsAnup Patel
The PLAT_NAME is used only in platform.c for all platforms hence remove it. Signed-off-by: Anup Patel <[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-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-21Fix plic warm init in platform code.Anup Patel
Pass S-Mode and M-mode context id separately to common warm init. Signed-off-by: Atish Patra <[email protected]> Signed-off-by: Anup Patel <[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-21Move hardcoded uart constant to macros.Atish Patra
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-21platform: kendryte/k210: Don't include math.hAnup Patel
The math.h is not required anymore and it also gives compile error for certain toolchains hence thsi patch removes math.h include from kendryte/k210/sysctl.c. Signed-off-by: Anup Patel <[email protected]>
2018-12-21Kendryte-k210: Remove unnecessary asm functionsDamien Le Moal
Use functions defined in sbi/riscv_asm.h. Signed-off-by: Damien Le Moal <[email protected]>
2018-12-21Update Kendryte k210 supportDamien Le Moal
Booting now. 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-21top: Rename "plat" to "platform" everywhereAnup Patel
This patch renames "plat" to "platform" everywhere for better readablility. Signed-off-by: Anup Patel <[email protected]>