riscv: bootm: Change to use boot_hart from global data
authorBin Meng <[email protected]>
Wed, 12 Dec 2018 14:12:46 +0000 (06:12 -0800)
committerAndes <[email protected]>
Tue, 18 Dec 2018 01:56:27 +0000 (09:56 +0800)
Avoid reading mhartid CSR directly, instead use the one we saved
in the global data structure before.

With this patch, BBL no longer needs to be hacked to provide the
mhartid CSR emulation for S-mode U-Boot.

Signed-off-by: Bin Meng <[email protected]>
Reviewed-by: Lukas Auer <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
arch/riscv/lib/bootm.c

index 124aeefff83cf29acad2f001fab02a0dc222ac1c..60b32cca818acce8fd5624c496028893b62055fc 100644 (file)
@@ -93,7 +93,7 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
 
        if (!fake) {
                if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len)
-                       kernel(csr_read(mhartid), images->ft_addr);
+                       kernel(gd->arch.boot_hart, images->ft_addr);
        }
 }