mirror of
https://github.com/apache/nuttx.git
synced 2026-08-18 12:08:16 +00:00
risc-v/mpfs: mpfs_opensbi: fix fw_size calculation
fw_start and fw_size were miscalculated. What was needed was the pointed values of the offsets __mpfs_nuttx_start and __mpfs_nuttx_end, not the values they had in place. Also add the next_arg1 initialization. Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
This commit is contained in:
parent
c67a1a4de1
commit
09bf8a5f89
1 changed files with 6 additions and 2 deletions
|
|
@ -453,8 +453,11 @@ static void mpfs_opensbi_scratch_setup(uint32_t hartid)
|
|||
* them so that OpenSBI has no chance override then.
|
||||
*/
|
||||
|
||||
g_scratches[hartid].scratch.fw_start = __mpfs_nuttx_start;
|
||||
g_scratches[hartid].scratch.fw_size = __mpfs_nuttx_end;
|
||||
g_scratches[hartid].scratch.fw_start = (unsigned long)&__mpfs_nuttx_start;
|
||||
g_scratches[hartid].scratch.fw_size = (unsigned long)&__mpfs_nuttx_end -
|
||||
(unsigned long)&__mpfs_nuttx_start;
|
||||
|
||||
DEBUGASSERT(g_scratches[hartid].scratch.fw_size > 0);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -516,6 +519,7 @@ void __attribute__((noreturn)) mpfs_opensbi_setup(void)
|
|||
csr_write(mscratch, &g_scratches[hartid].scratch);
|
||||
g_scratches[hartid].scratch.next_mode = PRV_S;
|
||||
g_scratches[hartid].scratch.next_addr = UBOOT_LOAD_ADDR;
|
||||
g_scratches[hartid].scratch.next_arg1 = 0;
|
||||
|
||||
sbi_init(&g_scratches[hartid].scratch);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue