riscv: read the hart ID from mhartid on boot
authorDamien Le Moal <damien.lemoal@wdc.com>
Mon, 28 Oct 2019 12:10:39 +0000 (13:10 +0100)
committerPaul Walmsley <paul.walmsley@sifive.com>
Sun, 17 Nov 2019 23:17:39 +0000 (15:17 -0800)
commitaccb9dbc4affdb7ebf30db7e9ba71eee47280081
tree343100142069604e557a7d1cc9ffb1397928d3f3
parentfcdc65375186a5cd69cc2eedfb498b86f4f5a21e
riscv: read the hart ID from mhartid on boot

When in M-Mode, we can use the mhartid CSR to get the ID of the running
HART. Doing so, direct M-Mode boot without firmware is possible.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
arch/riscv/include/asm/csr.h
arch/riscv/kernel/head.S