summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-02-22include: Bump-up version to 0.2v0.2Anup Patel1-1/+1
This patch increases OpenSBI version to 0.2. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-02-22scripts: Add script for creating binary archiveAnup Patel1-0/+135
This patch adds scripts/create-binary-archive.sh which helps us create a common tarball containing headers, static library and firmware ELFs for all platforms. This script can be used for release purpose OR for compile testing all platforms. Example usage commands are as follows: 1) Binary release archive for 32bit systems ./scripts/create-binary-archive.sh -s "bin" -x 32 -d 2) Binary release archive for 64bit systems ./scripts/create-binary-archive.sh -s "bin" -d 3) Compile test for 32bit systems ./scripts/create-binary-archive.sh -x 32 -t 4) Compile test for 64bit systems ./scripts/create-binary-archive.sh -t Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-02-22Makefile: Rename compile_ld() to compile_elf()Anup Patel1-7/+7
The compile_ld() is actually used to create ELF files so the name is misleading hence this patch renames it to compile_elf(). We also rename LDFLAGS to ELFFLAGS because these will be used for ELF creation only. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-02-22doc: Fix root partition details for fu540.Atish Patra1-1/+5
Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-02-20firmware: Improve low-level trap handler for M-mode to M-mode trapsAnup Patel2-39/+57
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 <anup.patel@wdc.com>
2019-02-20include: Add PRILX define to help print unsigned longAnup Patel2-18/+20
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 <anup.patel@wdc.com>
2019-02-19template: Fix some callback namesSergi Granell1-3/+3
2019-02-19template: Remove trailing ';'Sergi Granell1-1/+1
2019-02-19template: Fix typo in platform_final_initSergi Granell1-1/+1
There was a space instead of '_' in the function `platform_final_init`.
2019-02-19docs: Update unleashed platform guide.Atish Patra1-35/+116
Following updates to fu540 platform guide. 1. Update a section about flashing the firmware binary to sdcard with correct partition identifier. 2. Refer the individual payload section. 3. Update uboot booting section. Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-02-19docs: Add a payload section describing different payloads.Atish Patra4-2/+68
Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-02-19docs: Wrap text to 80 columns.Atish Patra1-3/+8
Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-02-19docs: Update about toolchain section.Atish Patra1-0/+10
Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-02-19Makefile: Use sed instead of awk to parse OpenSBI versionAnup Patel1-2/+2
This patch replaces use of awk with sed in top-level makefile to parse OpenSBI version from include/sbi/sbi_version.h. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-02-19Makefile: Fix error evaluating OPENSBI_CC_XLENAnup Patel1-25/+25
We get following error evaluating OPENSBI_CC_XLEN on Ubuntu-18.04: /bin/sh: 1: Bad substitution This patch fixes above error by using "awk" in string assigned to OPENSBI_CC_XLEN and it also moves "Setup compilation commands" before OPENSBI_CC_XLEN. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-02-18lib: Fix mask shift in sbi_ipi_send_many()Anup Patel1-1/+1
The mask shift in for-loop of sbi_ipi_send_many() is broken with commit 918c1354b75c74b62f67c4e929551d643f035443 ("lib: Improve delivery of SBI_IPI_EVENT_HALT") This patch fix it. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-02-18lib: Fix small typo on sbi_ipi.cNick Kossifidis1-1/+1
2019-02-18lib: Improve delivery of SBI_IPI_EVENT_HALTNick Kossifidis1-13/+34
When sbi_ipi_send_many gets called with the current hartid included on pmask (or when pmask is NULL), and we send a HALT event, since the for loop works sequentially over all hartids on the mask, we may send a HALT event to the current hart before the loop finishes. So we will halt the current hart before it can deliver a HALT IPI to the rest and some harts will remain active. Make sure we send an IPI to the current hart after we've finished with everybody else. Signed-off-by: Nick Kossifidis <mick@ics.forth.gr>
2019-02-18platform: qemu-virt: Implement system shutdownNick Kossifidis1-1/+9
In order for QEMU to be compatible with Spike, it implements a simple protocol used for reporting back the simulation's status, through the memory-mapped "test finisher" device. We use that protocol to make QEMU exit on system shutdown. Signed-off-by: Nick Kossifidis <mick@ics.forth.gr>
2019-02-18lib: Send IPI for all harts to hang on system shutdownNick Kossifidis1-0/+8
In case the platform specific method for shutting down the system fails (or is not implemented), at least make sure that all harts hang instead of just the current hart. Signed-off-by: Nick Kossifidis <mick@ics.forth.gr>
2019-02-17Makefile: Fix the assignment of OPENSBI_CC_XLENAlistair Francis1-3/+3
Previously OPENSBI_CC_XLEN was not being correctly assigned either 32 or 64. It also was not assigned before config.mk was parsed. Ensure that it will always be assigned. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-16Merge pull request #59 from avpatel/make-runAlistair Francis4-6/+35
Add 'make run' command for platform specific run
2019-02-15Makefile: Add 'make run' command for platform specific runOlof Johansson4-6/+35
Makes for easy and quick build-run one-stop command. For now only added for qemu targets. It can be added for any platform having simulator/emulator (such as QEMU). Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-02-15docs: fu540: Add steps for the Microsemi Expansion boardAlistair Francis1-0/+10
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-15platform: fu540: Initial commit of Microsemi device treeAlistair Francis1-0/+588
Add a device tree for th HiFive Unleashed that includes the Microsemi PCIe root complex. Once we have support for u-boot and in tree Linux kernel device trees this device tree should be removed. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-15platform: fu540: Fix missing newlineAlistair Francis1-0/+1
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-15firmware: Ensure the payloads are 4 bit allignedAlistair Francis1-4/+5
We expect the payloads to be 4 bit alligned as we later AND them with ~0xf. As most of the addresses are manually specified we don't really need this, but better to be over cautious. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-15Makefile: Make sure ld is always aware of the target abi/emulationNick Kossifidis1-1/+3
On Makefile merge_objs calls ld without providing any hints on the target so on a multilib toolchain for example it will always pick the default one (elf64-littleriscv) which will then result a failure when compiling on RV32 since the objects will be 32bits and the target will be 64bits. The same happens on compile_ld that calls gcc without CFLAGS so it doesn't get mabi/march. With this patch OpenSBI compiles on RV32 (PLATFORM_RISCV_XLEN=32), I tested fw_jump.elf on qemu (but it doesn't boot the kernel yet -bbl also doesn't boot the kernel so it may be something else). Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
2019-02-14firmware: Use CSR_<FOO> instead of <foo> for csr*Atish Patra2-19/+20
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. Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-02-14platform: Use CSR_<FOO> instead of <foo> for csr_*()Atish Patra1-1/+1
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 <olof@lixom.net> Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-02-14lib: Use CSR_<FOO> instead of <foo> for csr_*()Atish Patra11-76/+84
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 <olof@lixom.net> Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-02-14docs: Use normal hyphen instead of non-breaking hyphenAtish Patra1-1/+1
Usage non-breaking hyphen breaks make docs as doxygen doesn't know how to handle this. Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-02-12Makefile: Set ABI, ISA and Code Model in top-level makeAnup Patel6-25/+46
This patch introduces following optional PLATFORM options: PLATFORM_RISCV_XLEN -> RISC-V register width PLATFORM_RISCV_ABI -> RISC-V GCC ABI PLATFORM_RISCV_ISA -> RISC-V GCC ISA string PLATFORM_RISCV_CODE_MODEL -> RISC-V GCC Code Model If the above options are not provided by platform config.mk or by command-line parameters then: 1. PLATFORM_RISCV_XLEN will be determined using toolchain capability 2. PLATFORM_RISCV_ABI, PLATFORM_RISCV_ISA, and PLATFORM_RISCV_CODE_MODEL is set to value best suited for generic libsbi.a As a result of these optional PLATFORM options, the platform-cflags-y and platform-asflags-y is further simplified for platform config.mk. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-02-12platform: qemu: Set FW_JUMP_ADDR and FW_PAYLOAD_OFFSET as-per XLENAnup Patel2-6/+28
The current 4MB aligned FW_JUMP_ADDR and FW_PAYLOAD_OFFSET breaks U-Boot on QEMU virt and sifive_u machines. Instead of using 4MB aligned for both 32bit and 64bit systems, we use different values based compiler XLEN. Another advantage of this approach will be that our fw_payload.bin will smaller for 64bit systems. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-02-12platform: template: Improve comments for FW_JUMP_ADDR and FW_PAYLOAD_OFFSETAnup Patel1-3/+13
Both FW_JUMP_ADDR and FW_PAYLOAD_OFFSET, should be: 1. 4MB aligned for 32bit system 2. 2MB aligned for 64bit system Explicitly specify the above details in config.mk comments for template platform. Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-02-08docs: improve library usage documentDamien Le Moal1-22/+30
Clarify the libraries descriptions. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2019-02-08docs: platform guide updatesDamien Le Moal1-12/+22
Clarify platform support description. Also fix some Typos, grammar and document style. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2019-02-08top: README.md updatesDamien Le Moal1-33/+47
Clarify OpenSBI components explanation. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2019-02-08Makefile: Ensure lgcc is includedAlistair Francis1-1/+1
This fixes errors like this: undefined reference to `__umoddi3' when buildilng for 32-bit systems Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-08firmware: Use lw instead of lwu for 32-bit architecturesAlistair Francis2-0/+22
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-08platform: clint: Allow running on 32-bit systemsAlistair Francis1-0/+24
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-08sbi_emulate_csr: Shift sbi_timer_value directlyAlistair Francis1-2/+1
csr_val is a tartget length based variable, so on 32-bit devices it's only 32-bits. To avoid clearing the entire register perform both steps in a single line. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-08platform: qemu/virt: Move kernel start address to 4MB allignedAlistair Francis2-4/+6
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 <alistair.francis@wdc.com>
2019-02-08platform: template: Move kernel start address to 4MB allignedAlistair Francis1-2/+4
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 <alistair.francis@wdc.com>
2019-02-08platform/qemu/virt: Dynamically calculate xlenAlistair Francis3-2/+16
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 <alistair.francis@wdc.com>
2019-02-08sbi_ecall: Fix logical OR to be bitwise ORAlistair Francis1-1/+1
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-02-06firwmare: don't expand macros in FW_PAYLOAD_PATHAndreas Schwab2-7/+4
Signed-off-by: Andreas Schwab <schwab@suse.de>
2019-02-06Makefile: don't disable built-in variablesAndreas Schwab1-2/+2
Signed-off-by: Andreas Schwab <schwab@suse.de>
2019-02-05Makefile: Don't rely on "echo -n"Olof Johansson1-2/+2
Turns out it doesn't behave as expected on MacOS, it doesn't honor -n and echoes that to the file instead. Add a slash and just let the newline be there instead. Signed-off-by: Olof Johansson <olof@lixom.net>
2019-02-05riscv_asm.h: Use CSR_<FOO> instead of <foo> for csr_read()Olof Johansson3-9/+11
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 <olof@lixom.net>