summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-01-04Makefile: Force GCC to preprocess the linker fileAlistair Francis1-1/+1
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>
2019-01-04Makefile: Convert to a more standard formatAlistair Francis1-38/+41
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>
2019-01-04Makefile: Use generic flags for the firmwareAlistair Francis2-7/+9
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-01-04Makefile: Use generic flags for the platformAlistair Francis1-7/+10
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-01-04Makefile: Support verbosity using standard V=1Alistair Francis1-36/+26
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>
2019-01-04lib: Handle misaligned load/store on FP regsAnup Patel1-2/+50
This patch extends misaligned load/store trap handling to handle FP regs as well. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-01-04include: Add hard FP access macros and definesAnup Patel5-7/+259
This patch adds hardware floating-point (hard FP) access macros and defines. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-01-03Merge pull request #16 from damien-lemoal/masterAlistair Francis5-1918/+29
Various fixes
2019-01-03platform: kendryte/k210: Simplify sysctl codeDamien Le Moal3-1909/+20
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>
2019-01-03platform: kendryte/k210: Declare local function staticDamien Le Moal1-2/+2
k210_console_putc() and k210_console_init() are local functions. Declare them as static. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2019-01-03Makefile: Fix messagesDamien Le Moal1-7/+7
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>
2019-01-03include: Remove redundant tmp0 from struct sbi_scratchAnup Patel2-12/+9
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>
2019-01-02include: Move RISCV_TRAP_REGS_xyz defines to sbi_trap.hAnup Patel3-109/+114
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>
2019-01-02include: Move RISCV_PLATFORM_xyz defines to sbi_platform.hAnup Patel3-9/+14
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>
2019-01-02include: Move RISCV_SCRATCH_xyz defines to sbi_scratch.hAnup Patel3-24/+30
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>
2019-01-02include: Replace #csr with __ASM_STR(csr) in csr_xyz() macrosAnup Patel1-5/+5
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>
2019-01-02include: Remove redundant csr_read_n() and csr_write_n()Anup Patel2-59/+42
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>
2018-12-31docs: Add documenation for QEMU platformsAnup Patel2-0/+101
This patch adds documentation for qemu/virt and qemu/sifive_u platform supports. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2018-12-31top: Minor typo fixes in top-level README.mdAnup Patel1-12/+9
This patch does minor typo fixes in top-level README.md. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2018-12-31lib: Redirect illegal instruction trap to S-mode when not handledAnup Patel4-6/+56
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>
2018-12-31platform: Fix author name for Kendryte K210 platformAnup Patel3-3/+3
The Kendryte K210 platform support was contributed by Damien hence fix author name. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2018-12-31platform: Rename sifive/hifive_u540 to sifive/fu540Anup Patel4-174/+174
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>
2018-12-27lib: Print mtval in sbi_trap_error()Anup Patel1-11/+11
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>
2018-12-27lib: Rename target_hart parameter to hartid for PMP platform callbacksAnup Patel4-13/+13
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>
2018-12-27lib: Simplify sbi_platform timer_init() hooksAnup Patel8-48/+61
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>
2018-12-27lib: Simplify sbi_platform ipi_init() hooksAnup Patel8-48/+60
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>
2018-12-27lib: Simplify sbi_platform irqchip_init() hooksAnup Patel6-69/+66
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>
2018-12-27lib: Simplify sbi_platform early_init() and final_init() hooksAnup Patel8-69/+47
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>
2018-12-27firmware: Rename fw_common.S to fw_base.SAnup Patel6-4/+4
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>
2018-12-27top: Improve 'clean' and 'distclean' makefile targetsAnup Patel1-7/+14
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>
2018-12-27top: Improve inst_file_list() in Makefile for payloads installationAnup Patel1-7/+11
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>
2018-12-27firmware: Use dummy payload for FW_PAYLOADAnup Patel3-6/+22
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>
2018-12-27firmware: Add separate dummy payload for FW_PAYLOADAnup Patel4-0/+220
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>
2018-12-27lib: Move ECALL defines to sbi_ecall_interface.hAnup Patel2-10/+40
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>
2018-12-26lib: Add misaligned load/store trap handlingAnup Patel4-1/+166
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>
2018-12-26lib: Move instruction encoding macros to riscv_encoding.hAnup Patel3-65/+117
This patch moves all instruction encoding macros to riscv_encoding.h. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2018-12-26top: Rename back CROSS_COMPILE_PREFIX to CROSS_COMPILEAnup Patel2-8/+8
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>
2018-12-25README: UpdateDamien Le Moal1-70/+100
Some rewrite with a more formal style. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2018-12-25Makefile: Fix cleanDamien Le Moal1-1/+1
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>
2018-12-25Makefile: Rename CROSS_COMPILE to CROSS_COMPILE_PREFIXDamien Le Moal2-10/+11
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>
2018-12-22Merge pull request #4 from riscv/avpatel/masterAtish Patra13-80/+94
Remove PLAT_<xyz> defines from platform and firmwares
2018-12-22top: Typo fix in top-level README.mdAnup Patel1-1/+1
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>
2018-12-22platform: Remove PLAT_HART_COUNT and PLAT_HART_STACK_SIZEAnup Patel9-40/+40
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>
2018-12-22firmware: Don't depend on PLAT_HART_COUNT and PLAT_HART_STACK_SIZEAnup Patel2-4/+11
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>
2018-12-22firmware: Remove stack section from common linker scriptAnup Patel2-31/+42
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>
2018-12-22platform: Remove PLAT_NAME from all platformsAnup Patel8-8/+4
The PLAT_NAME is used only in platform.c for all platforms hence remove it. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2018-12-22Merge pull request #3 from riscv/unleashed_working_12_21Anup Patel10-43/+110
Unleashed working 12 21
2018-12-22Disable all interrupts during warm irqchip init.Atish Patra1-1/+6
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>
2018-12-22Introduce hart disabled parameter in platform.Atish Patra8-7/+24
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>
2018-12-22Fix plic warm init in platform code.Anup Patel4-7/+49
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>