Commit Graph

26 Commits

Author SHA1 Message Date
Atish Patra f003787455 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>
2018-12-21 11:09:47 +05:30
Anup Patel 089f70a179 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>
2018-12-21 10:35:04 +05:30
Anup Patel 6f02b6938f 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>
2018-12-21 10:09:33 +05:30
Anup Patel b023176c17 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>
2018-12-21 09:52:27 +05:30
Anup Patel ab5b228ff5 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>
2018-12-21 07:51:59 +05:30
Anup Patel 33ec85c9ab 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>
2018-12-21 07:28:33 +05:30
Anup Patel ef1f669cb7 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>
2018-12-21 07:28:33 +05:30
Anup Patel f02926c896
Merge pull request #1 from riscv/atish_fix_1
Various fixes for unleashed board
2018-12-21 07:23:26 +05:30
Atish Patra 1d4e36edf8 Support unsigned long in sbi_printf
Signed-off-by: Atish Patra <atish.patra@wdc.com>
2018-12-20 15:55:32 -08:00
Atish Patra 84971c0bc0 Use wfi for coldboot finish call.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
2018-12-20 15:55:27 -08:00
Atish Patra e0a660ec5b Fix baud rate divisor computation for U540.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
2018-12-20 15:38:43 -08:00
Atish Patra 3250fe7299 Support /r/n as newline character.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
2018-12-20 15:38:43 -08:00
Atish Patra 5adf2fdc9e HiFive Unleashed has 5 harts. Fix the config to reflect that.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
2018-12-20 15:38:43 -08:00
Anup Patel a8043647a4 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>
2018-12-20 11:51:22 +05:30
Damien Le Moal 316e05f248 plat: Add Kendryte k210 initial support
Only compiles for now, completely untested.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2018-12-20 14:43:04 +09:00
Damien Le Moal b88b9ee2d1 blob: Fix comments
Add comments to assembler (not trivial to follow).

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2018-12-20 14:43:04 +09:00
Damien Le Moal fcfbb30fc3 Added .gitignore
Ignore build and install directories

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2018-12-20 14:41:36 +09:00
Anup Patel bc4d6108f4 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>
2018-12-19 18:32:49 +05:30
Anup Patel bc99e707cd 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>
2018-12-19 15:47:52 +05:30
Anup Patel d9c5bea9a2 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>
2018-12-19 15:38:51 +05:30
Anup Patel fbb4a52330 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>
2018-12-19 15:38:48 +05:30
Damien Le Moal 91fc25f59b blob: Fix comment typos
Various typos fix.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2018-12-19 17:07:25 +09:00
Anup Patel 8a4088c3af 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>
2018-12-16 13:51:16 +05:30
Anup Patel 385b5afe7d 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>
2018-12-16 10:15:58 +05:30
Anup Patel 292e6344fa 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>
2018-12-16 10:15:55 +05:30
Anup Patel 9e8ff05cb6 Initial commit.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
2018-12-11 19:24:06 +05:30