diff options
author | Wesley W. Terpstra <wesley@sifive.com> | 2017-03-22 14:35:13 -0700 |
---|---|---|
committer | Wesley W. Terpstra <wesley@sifive.com> | 2017-03-22 14:35:13 -0700 |
commit | 23ab37ad78673166a8300584d177ace77fca5101 (patch) | |
tree | 1e6b9b16a5cc5768d1c91f6661a2ebfff61b2891 /machine/minit.c | |
parent | 316f85e9ae2f5d9dd0b33d3649a8256db0dfd29b (diff) | |
download | pk-23ab37ad78673166a8300584d177ace77fca5101.zip pk-23ab37ad78673166a8300584d177ace77fca5101.tar.gz pk-23ab37ad78673166a8300584d177ace77fca5101.tar.bz2 |
SBI: a0+a1 hold hartid+dtb pointer between boot loader stagesfdt
Diffstat (limited to 'machine/minit.c')
-rw-r--r-- | machine/minit.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/machine/minit.c b/machine/minit.c index 2616f19..f02f205 100644 --- a/machine/minit.c +++ b/machine/minit.c @@ -72,8 +72,6 @@ hls_t* hls_init(uintptr_t id) return hls; } -#define DTB 0x1014 - static void memory_init() { mem_size = mem_size / MEGAPAGE_SIZE * MEGAPAGE_SIZE; @@ -122,27 +120,27 @@ static void hart_plic_init() *HLS()->plic_s_thresh = 0; } -void init_first_hart() +void init_first_hart(uintptr_t hartid, uintptr_t dtb) { hart_init(); hls_init(0); // this might get called again from parse_config_string - query_mem(DTB); - query_harts(DTB); - query_clint(DTB); + query_mem(dtb); + query_harts(dtb); + query_clint(dtb); plic_init(); hart_plic_init(); //prci_test(); memory_init(); - boot_loader(); + boot_loader(dtb); } -void init_other_hart() +void init_other_hart(uintptr_t hartid, uintptr_t dtb) { hart_init(); hart_plic_init(); - boot_other_hart(); + boot_other_hart(dtb); } void enter_supervisor_mode(void (*fn)(uintptr_t), uintptr_t arg0, uintptr_t arg1) |