summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Anup Patel [Mon, 14 Jan 2019 06:18:38 +0000 (11:48 +0530)]
top: Update top-level README.md to build/install documentation PDF
This patch updates top-level README.md for steps required to build
and install documentation PDF.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Mon, 14 Jan 2019 06:55:01 +0000 (12:25 +0530)]
Makefile: Add make targets to build and install documentation
This patch extends top-level makefile to build and install
documentation. The 'docs' make target is for building the
documentation PDF whereas 'install_docs' make target is for
installing the documentation PDF.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Fri, 4 Jan 2019 03:15:36 +0000 (08:45 +0530)]
Makefile: Use '=' instead of '?=' for make variables
The '?=' will not assign value if the target make variable is
overriden via command-line or is set in environment variable.
On other hand, '=' will not assign value only if variable is
overriden via command-line parameter.
It is quite common to have CC, AS, CPP, LD, etc to be set as
environment variables pointing to native compiler and binutils.
If '-rR' option is not set in MAKEFLAGS then this results in
compile error because '?=' will use the native compiler and
binutils. If '-rR' option is set in MAKEFLAGS then this again
results in compile error because CC, AS, CPP, etc are set to
empty strings which causes '?=' to use empty string as compiler
and binutils.
To handle this, we use '?=' only when CROSS_COMPILE is not
defined and we use '=' when CROSS_COMPILE is defined.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Alistair Francis [Wed, 2 Jan 2019 22:44:35 +0000 (14:44 -0800)]
docs: Add a contributing document
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Alistair Francis [Wed, 2 Jan 2019 21:59:49 +0000 (13:59 -0800)]
Makefile: Force GCC to preprocess the linker file
To avoid this message (and subsequent errors):
warning: linker input file unused because linking not done
force GCC to treat the linker script preprocessing as a C file.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Alistair Francis [Sat, 22 Dec 2018 00:44:55 +0000 (16:44 -0800)]
Makefile: Convert to a more standard format
Convert the Makefile to a more standard format and don't forcefully
overwrite a users enviroment.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Alistair Francis [Sat, 22 Dec 2018 00:09:03 +0000 (16:09 -0800)]
Makefile: Use generic flags for the firmware
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Alistair Francis [Wed, 2 Jan 2019 18:16:15 +0000 (10:16 -0800)]
Makefile: Use generic flags for the platform
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Alistair Francis [Wed, 2 Jan 2019 18:14:40 +0000 (10:14 -0800)]
Makefile: Support verbosity using standard V=1
Instead of using a confusing and custom option, allow verbose Makefile
with the standard V=1.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Anup Patel [Thu, 3 Jan 2019 06:48:47 +0000 (12:18 +0530)]
lib: Handle misaligned load/store on FP regs
This patch extends misaligned load/store trap handling to
handle FP regs as well.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Thu, 3 Jan 2019 05:07:43 +0000 (10:37 +0530)]
include: Add hard FP access macros and defines
This patch adds hardware floating-point (hard FP) access
macros and defines.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Alistair Francis [Thu, 3 Jan 2019 15:52:42 +0000 (07:52 -0800)]
Merge pull request #16 from damien-lemoal/master
Various fixes
Damien Le Moal [Thu, 3 Jan 2019 05:32:25 +0000 (14:32 +0900)]
platform: kendryte/k210: Simplify sysctl code
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 <damien.lemoal@wdc.com>
Damien Le Moal [Thu, 3 Jan 2019 04:34:32 +0000 (13:34 +0900)]
platform: kendryte/k210: Declare local function static
k210_console_putc() and k210_console_init() are local functions. Declare
them as static.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Mon, 31 Dec 2018 04:00:39 +0000 (13:00 +0900)]
Makefile: Fix messages
Instead of printing the generic "<build_directory>" and
"<install_directory>" strings, print the actual paths for the build
and install directories during "make clean" and "make distclean".
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Anup Patel [Wed, 2 Jan 2019 09:21:30 +0000 (14:51 +0530)]
include: Remove redundant tmp0 from struct sbi_scratch
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 <anup.patel@wdc.com>
Anup Patel [Mon, 31 Dec 2018 07:07:28 +0000 (12:37 +0530)]
include: Move RISCV_TRAP_REGS_xyz defines to sbi_trap.h
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 <anup.patel@wdc.com>
Anup Patel [Mon, 31 Dec 2018 06:00:55 +0000 (11:30 +0530)]
include: Move RISCV_PLATFORM_xyz defines to sbi_platform.h
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 <anup.patel@wdc.com>
Anup Patel [Mon, 31 Dec 2018 05:49:20 +0000 (11:19 +0530)]
include: Move RISCV_SCRATCH_xyz defines to sbi_scratch.h
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 <anup.patel@wdc.com>
Anup Patel [Mon, 31 Dec 2018 04:59:49 +0000 (10:29 +0530)]
include: Replace #csr with __ASM_STR(csr) in csr_xyz() macros
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 <anup.patel@wdc.com>
Anup Patel [Mon, 31 Dec 2018 04:55:42 +0000 (10:25 +0530)]
include: Remove redundant csr_read_n() and csr_write_n()
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 <anup.patel@wdc.com>
Anup Patel [Fri, 28 Dec 2018 08:51:57 +0000 (14:21 +0530)]
docs: Add documenation for QEMU platforms
This patch adds documentation for qemu/virt and
qemu/sifive_u platform supports.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Fri, 28 Dec 2018 08:50:25 +0000 (14:20 +0530)]
top: Minor typo fixes in top-level README.md
This patch does minor typo fixes in top-level README.md.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Thu, 27 Dec 2018 16:09:13 +0000 (21:39 +0530)]
lib: Redirect illegal instruction trap to S-mode when not handled
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 <anup.patel@wdc.com>
Anup Patel [Fri, 28 Dec 2018 05:31:37 +0000 (11:01 +0530)]
platform: Fix author name for Kendryte K210 platform
The Kendryte K210 platform support was contributed by Damien
hence fix author name.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Fri, 28 Dec 2018 05:21:15 +0000 (10:51 +0530)]
platform: Rename sifive/hifive_u540 to sifive/fu540
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 <anup.patel@wdc.com>
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Anup Patel [Thu, 27 Dec 2018 04:36:38 +0000 (10:06 +0530)]
lib: Print mtval in sbi_trap_error()
The mtval CSR is very useful information when debugging hence
print it upon trap error in sbi_trap_error().
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Wed, 26 Dec 2018 13:19:55 +0000 (18:49 +0530)]
lib: Rename target_hart parameter to hartid for PMP platform callbacks
We rename target_hart parameter of PMP platform callbacks to
hartid for clarity because the parameter represents current
hartid.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Wed, 26 Dec 2018 13:14:54 +0000 (18:44 +0530)]
lib: Simplify sbi_platform timer_init() hooks
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 <anup.patel@wdc.com>
Anup Patel [Wed, 26 Dec 2018 13:06:11 +0000 (18:36 +0530)]
lib: Simplify sbi_platform ipi_init() hooks
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 <anup.patel@wdc.com>
Anup Patel [Wed, 26 Dec 2018 12:57:35 +0000 (18:27 +0530)]
lib: Simplify sbi_platform irqchip_init() hooks
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 <anup.patel@wdc.com>
Anup Patel [Wed, 26 Dec 2018 12:51:22 +0000 (18:21 +0530)]
lib: Simplify sbi_platform early_init() and final_init() hooks
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 <anup.patel@wdc.com>
Anup Patel [Wed, 26 Dec 2018 05:13:15 +0000 (10:43 +0530)]
firmware: Rename fw_common.S to fw_base.S
The fw_common.S is the base firmware extendend by fw_jump and
fw_payload. This patch renames fw_common.S to fw_base.S to
have more clear/intutive name for base firmware.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Wed, 26 Dec 2018 05:36:54 +0000 (11:06 +0530)]
top: Improve 'clean' and 'distclean' makefile targets
This improves 'clean' and 'distclean' makefile target as follows:
1. Remove only .o, .a, .elf, and .bin files for 'clean'
2. Remove .dep in-addition to what 'clean' does for 'distclean'
3. Remove default build and install directory for 'distclean'
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Mon, 24 Dec 2018 06:45:32 +0000 (12:15 +0530)]
top: Improve inst_file_list() in Makefile for payloads installation
We now have payloads sub-directory under firmware directory which
means payload BINs and ELFs should be installed under firmware/payloads.
This patch improves inst_file_list() to handle payloads sub-directory
under firmware installation directory.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Mon, 24 Dec 2018 05:23:10 +0000 (10:53 +0530)]
firmware: Use dummy payload for FW_PAYLOAD
We use recently added separate dummy payload for FW_PAYLOAD
when FW_PAYLOAD_PATH is not specified.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Wed, 26 Dec 2018 04:14:49 +0000 (09:44 +0530)]
firmware: Add separate dummy payload for FW_PAYLOAD
Currently, the default payload for FW_PAYLOAD is embedded
fw_payload.S itself. This means people have to hack fw_payload.S
if they want to have some temporary S-mode test code.
This patch adds a separate dummy payload for FW_PAYLOAD which
can be easily hacked for some S-mode testing.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Wed, 26 Dec 2018 04:12:26 +0000 (09:42 +0530)]
lib: Move ECALL defines to sbi_ecall_interface.h
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 <anup.patel@wdc.com>
Anup Patel [Mon, 24 Dec 2018 11:19:01 +0000 (16:49 +0530)]
lib: Add misaligned load/store trap handling
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 <anup.patel@wdc.com>
Anup Patel [Mon, 24 Dec 2018 11:15:00 +0000 (16:45 +0530)]
lib: Move instruction encoding macros to riscv_encoding.h
This patch moves all instruction encoding macros to
riscv_encoding.h.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Wed, 26 Dec 2018 05:27:15 +0000 (10:57 +0530)]
top: Rename back CROSS_COMPILE_PREFIX to CROSS_COMPILE
The name CROSS_COMPILE is an industry standard used across
open-source project to specify cross-compiler prefix.
In fact, distro build systems such as buildroot and yocto
assume CROSS_COMPILE to be supported by projects added
as packages to these build systems.
This patch rename back CROSS_COMPILE_PREFIX to CROSS_COMPILE.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Damien Le Moal [Tue, 25 Dec 2018 06:37:04 +0000 (15:37 +0900)]
README: Update
Some rewrite with a more formal style.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Tue, 25 Dec 2018 06:50:29 +0000 (15:50 +0900)]
Makefile: Fix clean
Clean was doing nothing. Fix it to remove all compiled files, leaving
only dependency files.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Tue, 25 Dec 2018 06:37:48 +0000 (15:37 +0900)]
Makefile: Rename CROSS_COMPILE to CROSS_COMPILE_PREFIX
Make it clear what this environment variable defines and update
the README.md file to explain that.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Atish Patra [Sat, 22 Dec 2018 18:02:52 +0000 (10:02 -0800)]
Merge pull request #4 from riscv/avpatel/master
Remove PLAT_<xyz> defines from platform and firmwares
Anup Patel [Sat, 22 Dec 2018 15:44:23 +0000 (21:14 +0530)]
top: Typo fix in top-level README.md
The platform specific options will be PLATFORM_<xyz> and not
PLAT_<xyz> hence this patch fixes typo in top-level README.md.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Sat, 22 Dec 2018 15:31:40 +0000 (21:01 +0530)]
platform: Remove PLAT_HART_COUNT and PLAT_HART_STACK_SIZE
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 <anup.patel@wdc.com>
Anup Patel [Sat, 22 Dec 2018 07:10:54 +0000 (12:40 +0530)]
firmware: Don't depend on PLAT_HART_COUNT and PLAT_HART_STACK_SIZE
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 <anup.patel@wdc.com>
Anup Patel [Sat, 22 Dec 2018 06:32:31 +0000 (12:02 +0530)]
firmware: Remove stack section from common linker script
We don't need a separate stack section for per-HART stack
instead we create per-HART stack at the end of firmware
(i.e. after _fw_end symbol).
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Sat, 22 Dec 2018 05:45:37 +0000 (11:15 +0530)]
platform: Remove PLAT_NAME from all platforms
The PLAT_NAME is used only in platform.c for all platforms hence
remove it.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Sat, 22 Dec 2018 15:12:48 +0000 (20:42 +0530)]
Merge pull request #3 from riscv/unleashed_working_12_21
Unleashed working 12 21
Atish Patra [Sat, 22 Dec 2018 05:31:12 +0000 (21:31 -0800)]
Disable all interrupts during warm irqchip init.
M mode is not expected to recieve any interrupts.
S mode interrupts shouldn't be enabled in M mode.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Atish Patra [Fri, 21 Dec 2018 19:29:28 +0000 (11:29 -0800)]
Introduce hart disabled parameter in platform.
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 <atish.patra@wdc.com>
Anup Patel [Fri, 21 Dec 2018 23:46:37 +0000 (15:46 -0800)]
Fix plic warm init in platform code.
Pass S-Mode and M-mode context id separately to common warm init.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Fri, 21 Dec 2018 23:45:14 +0000 (15:45 -0800)]
Fix plic warm init in common code.
Unleashed doesn't have S mode for hart 0.
PLIC register base calculation is current wrong because of that.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Atish Patra [Fri, 21 Dec 2018 23:16:59 +0000 (15:16 -0800)]
Move hardcoded uart constant to macros.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Damien Le Moal [Fri, 21 Dec 2018 10:19:54 +0000 (19:19 +0900)]
Introduce HAS_MFAULTS_DELEGATION feature
Conditionnally delegate page fault exceptions from M mode to S mode
based on the platform features.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Anup Patel [Fri, 21 Dec 2018 10:02:28 +0000 (15:32 +0530)]
platform: kendryte/k210: Don't include math.h
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 <anup.patel@wdc.com>
Anup Patel [Fri, 21 Dec 2018 09:35:59 +0000 (15:05 +0530)]
firmware: Remove redundant write to mideleg and medeleg
The mideleg and medeleg are already programmed in delegate_traps()
so no need to set it here.
Any CSR setup in our reference firmware becomes a requirement
for bootloader linking to libsbi.a so we should have minimum
possible CSR setup in our reference firmware.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Fri, 21 Dec 2018 09:15:14 +0000 (14:45 +0530)]
Revert "Fix FDT relocation"
This patch reverts "Fix FDT relocation" because it breaks
fw_jump firmware.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Fri, 21 Dec 2018 08:42:10 +0000 (14:12 +0530)]
lib: Remove prints from sbi_hart_switch_mode()
The sbi_hart_switch_mode() will be used by CPU hotplug. This means
if we have prints in sbi_hart_switch_mode() then these prints will
mix with Linux prints.
Being a runtime firmware, we should be verbose only at coldboot
time and error situations.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Fri, 21 Dec 2018 08:36:17 +0000 (14:06 +0530)]
lib: Fix delegate_traps() for Linux boot
commit
d403c70fb11fb55042ca3cef0dbe399ed87cc79b breaks Linux
booting because of fewer exceptions delegated to S-mode. This
patch fixes Linux booting by having all required exceptions
delegated to S-mode.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Damien Le Moal [Fri, 21 Dec 2018 09:12:58 +0000 (18:12 +0900)]
console: protect output with a spinlock
Avoid getting messages from multiple harts mingled into garbage text
with a spinlock serializing calls to sbi_puts() and sbi_printf().
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Fri, 21 Dec 2018 08:20:56 +0000 (17:20 +0900)]
Kendryte-k210: Remove unnecessary asm functions
Use functions defined in sbi/riscv_asm.h.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Fri, 21 Dec 2018 08:06:59 +0000 (17:06 +0900)]
Introduce sbi_current_hartid()
Use this helper instead of hardcoding csr_read(mhartid).
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Fri, 21 Dec 2018 07:44:53 +0000 (16:44 +0900)]
Cleanup and rename sbi_hart_boot_next()
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 <damien.lemoal@wdc.com>
Damien Le Moal [Fri, 21 Dec 2018 07:35:33 +0000 (16:35 +0900)]
Fiw comment typo
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Fri, 21 Dec 2018 00:14:44 +0000 (09:14 +0900)]
Update Kendryte k210 support
Booting now.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Fri, 21 Dec 2018 06:05:33 +0000 (15:05 +0900)]
Fix interrupt and exception delegation
When S mode is not supported, simply clear mideleg and medeleg.
Otherwise, set delegation from M-mode to S-mode, removing the page
fault exceptions as those would not happen in M-mode.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Fri, 21 Dec 2018 06:04:16 +0000 (15:04 +0900)]
Add a hang message
Make it clear that the end of the FW execution was reached without the
hand being passed to any payload.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Fri, 21 Dec 2018 05:58:23 +0000 (14:58 +0900)]
Add a banner
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Fri, 21 Dec 2018 05:48:42 +0000 (14:48 +0900)]
fw: Disable delegation
Also disable interrupts and exceptions delegation when clearing mie and
mip.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Fri, 21 Dec 2018 01:03:56 +0000 (10:03 +0900)]
Fix FDT relocation
Or rather, disable it if FW_PAYLOAD_FDT_ADDR is not defined. This
correspond to cases where the underlying FW that loaded and started
opensbi did not provide any FDT. In such case, the platform code will
need to prepare one.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Fri, 21 Dec 2018 00:13:37 +0000 (09:13 +0900)]
Refine platform features control
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 <damien.lemoal@wdc.com>
Atish Patra [Fri, 21 Dec 2018 05:36:20 +0000 (11:06 +0530)]
lib: Hang in sbi_hart_boot_next() if next mode is not supported
We should not jump to next stage if next mode (S-mode or U-mode)
is not supported by HART.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Fri, 21 Dec 2018 05:05:04 +0000 (10:35 +0530)]
top: Rename "plat" to "platform" everywhere
This patch renames "plat" to "platform" everywhere for better
readablility.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Fri, 21 Dec 2018 04:39:33 +0000 (10:09 +0530)]
lib: Introduce bitmap to track HARTs waiting for coldboot
On QEMU Virt, max supported HARTs are 8 but number of HARTs
actually depend on "-smp" command-line parameter passed to
QEMU. This creates problems in sbi_hart_wake_coldboot_harts()
because when number of HARTs are less than 8.
To tackle this, we introduce a bitmap to track HARTs waiting
for coldboot to finish. We wake only those HARTs who have
set their bit in coldboot bitmap.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Fri, 21 Dec 2018 04:22:27 +0000 (09:52 +0530)]
top: Rename "blob" to "firmware" everywhere
This patch renames "blob" to "firmware" everywhere for better
and intutive naming.
Signed-off-by: Anup Patel <anup@brainfault.org>
Anup Patel [Fri, 21 Dec 2018 02:21:59 +0000 (07:51 +0530)]
lib: sbi_hart: Remove unwanted sbi_printf()
This patch removes unwanted sbi_printf() from
sbi_hart_wait_for_coldboot().
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Thu, 20 Dec 2018 15:34:38 +0000 (21:04 +0530)]
docs: Add documentation for firmware blobs
This patch adds documentation for fw_jump and fw_payload
firmware blobs.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Thu, 20 Dec 2018 12:53:52 +0000 (18:23 +0530)]
top: More detailed top-level README.md
This patch adds more details to top-level README.md based on
current state of OpenSBI.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Fri, 21 Dec 2018 01:53:26 +0000 (07:23 +0530)]
Merge pull request #1 from riscv/atish_fix_1
Various fixes for unleashed board
Atish Patra [Thu, 20 Dec 2018 01:32:46 +0000 (17:32 -0800)]
Support unsigned long in sbi_printf
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Atish Patra [Tue, 18 Dec 2018 00:35:07 +0000 (16:35 -0800)]
Use wfi for coldboot finish call.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Atish Patra [Mon, 17 Dec 2018 23:31:49 +0000 (15:31 -0800)]
Fix baud rate divisor computation for U540.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Atish Patra [Mon, 17 Dec 2018 21:46:30 +0000 (13:46 -0800)]
Support /r/n as newline character.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Atish Patra [Mon, 17 Dec 2018 21:44:06 +0000 (13:44 -0800)]
HiFive Unleashed has 5 harts. Fix the config to reflect that.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Anup Patel [Thu, 20 Dec 2018 06:21:22 +0000 (11:51 +0530)]
plat: kendryte/k210: Enable fw_payload in config.mk
We can only use fw_payload blob on Kendryte K210 board
because there is no previous booting stage hence this
patch enables fw_payload for Kendryte K210 board.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Damien Le Moal [Thu, 20 Dec 2018 05:40:41 +0000 (14:40 +0900)]
plat: Add Kendryte k210 initial support
Only compiles for now, completely untested.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Thu, 20 Dec 2018 05:39:32 +0000 (14:39 +0900)]
blob: Fix comments
Add comments to assembler (not trivial to follow).
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Damien Le Moal [Thu, 20 Dec 2018 05:36:49 +0000 (14:36 +0900)]
Added .gitignore
Ignore build and install directories
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Anup Patel [Wed, 19 Dec 2018 13:02:49 +0000 (18:32 +0530)]
blob: payload: Add FW_PAYLOAD_FDT_PATH option
This patch extends fw_payload blob to provide FW_PAYLOAD_FDT_PATH
option using which we can embed custom FDT in .text section of
fw_payload blob. In other words, FW_PAYLOAD_FDT_PATH is an option
to forcefully override FDT passed by previous booting stage in
a1 register.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Wed, 19 Dec 2018 09:56:11 +0000 (15:26 +0530)]
blob: Rename FW_xyz_FDT_OFFSET to FW_xyz_FDT_ADDR
Instead of placing FDT (passed by previous booting stage) at a
location relative to next address we should have absolute
location of placing FDT so that we more freedom of placing FDT.
This will be particularly useful for platforms/boards with
very less RAM (such as Kendryte board).
Due to above motivation, we rename FW_xyz_FDT_OFFSET options
to FW_xyz_FDT_ADDR options and use FW_xyz_FDT_ADDR options as
absolute address for placing FDT.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Wed, 19 Dec 2018 09:35:45 +0000 (15:05 +0530)]
blob: Rename PLAT_TEXT_START to FW_TEXT_START
The PLAT_TEXT_START is only used by our firmware blobs hence
rename it to FW_TEXT_START.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Wed, 19 Dec 2018 09:23:26 +0000 (14:53 +0530)]
blob: payload: Introduce FW_PAYLOAD_OFFSET compile time option
This patch remove hard-coding of payload location in
fw_payload.elf.ldS by adding compile-time option
FW_PAYLOAD_OFFSET.
With the new compile-time option, payload will be placed
at PLAT_TEXT_START + FW_PAYLOAD_OFFSET address.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Damien Le Moal [Wed, 19 Dec 2018 08:02:53 +0000 (17:02 +0900)]
blob: Fix comment typos
Various typos fix.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Anup Patel [Sun, 16 Dec 2018 08:21:16 +0000 (13:51 +0530)]
plat: clint: Reduce use of atomic operation on IPI registers
Currently, we aggresively use atomic operation on CLINT IPI
register. This patch simplify CLINT IPI APIs by reducing use
of atomic operations. In future, we will gradually increase
use of atomic operations for CLINT IPI APIs.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Sun, 16 Dec 2018 04:35:39 +0000 (10:05 +0530)]
plat: Add separate platform support for QEMU sifive_u machine
The QEMU sifive_u machine is not excatly same as HiFive Unleashed
board hence we add separate platform support for QEMU sifive_u
machine.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Sat, 15 Dec 2018 13:00:58 +0000 (18:30 +0530)]
lib: Don't emulate CSR read for misa and mhartid
Emulation of CSR read for misa and mhartid was a workaround for
bootloader accessing these CSRs in S-mode. This patch removes
CSR read emulation for misa and mhartid.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Anup Patel [Tue, 11 Dec 2018 13:54:06 +0000 (19:24 +0530)]
Initial commit.
Signed-off-by: Anup Patel <anup.patel@wdc.com>