File tree Expand file tree Collapse file tree 4 files changed +19
-11
lines changed
platforms/axplat-aarch64-dyn/src Expand file tree Collapse file tree 4 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,15 @@ pub fn setup() {
36
36
} ) ;
37
37
38
38
RESERVED_LIST . call_once ( || {
39
- let mut ram_list = Vec :: new ( ) ;
39
+ let mut rsv_list = Vec :: new ( ) ;
40
+
41
+ unsafe extern "C" {
42
+ fn _skernel ( ) ;
43
+ }
44
+ let head_start = boot_info ( ) . kimage_start_lma as usize ;
45
+ let head_section = ( head_start, ( _skernel as usize ) - va_offset ( ) - head_start) ;
46
+
47
+ rsv_list. push ( head_section) ;
40
48
41
49
for region in boot_info ( )
42
50
. memory_regions
@@ -49,9 +57,9 @@ pub fn setup() {
49
57
} )
50
58
. map ( |one| ( one. start , one. end . align_up_4k ( ) - one. start ) )
51
59
{
52
- let _ = ram_list . push ( region) ;
60
+ let _ = rsv_list . push ( region) ;
53
61
}
54
- ram_list
62
+ rsv_list
55
63
} ) ;
56
64
57
65
MMIO . call_once ( || {
@@ -110,11 +118,10 @@ impl MemIf for MemIfImpl {
110
118
111
119
fn kimage_range_phys ( ) -> Range < PhysAddr > {
112
120
unsafe extern "C" {
113
- fn _skernel ( ) ;
114
121
fn _ekernel ( ) ;
115
122
}
116
123
117
- let start = PhysAddr :: from_usize ( KIMAGE_VADDR - va_offset ( ) ) ;
124
+ let start = PhysAddr :: from_usize ( boot_info ( ) . kimage_start_lma as usize ) ;
118
125
let end = PhysAddr :: from_usize ( _ekernel as usize - va_offset ( ) ) ;
119
126
start..end
120
127
}
Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ impl PowerIf for PowerImpl {
27
27
let cpu_id = crate :: smp:: cpu_idx_to_id ( cpu_idx) ;
28
28
let entry = crate :: smp:: secondary_entry_phys_addr ( ) ;
29
29
info ! (
30
- "booting CPU {cpu_id} with entry {:#x} and stack top {:#x}" ,
31
- entry, stack_top_paddr
30
+ "booting CPU{cpu_idx} id {cpu_id:#x} with entry {entry:#x} and stack top {stack_top_paddr:#x}" ,
32
31
) ;
33
32
dcache_all ( CacheOp :: CleanAndInvalidate ) ;
34
33
cpu_on ( cpu_id as _ , entry. as_usize ( ) as _ , stack_top_paddr as _ ) . unwrap ( ) ;
Original file line number Diff line number Diff line change
1
+ use aarch64_cpu_ext:: cache:: { CacheOp , dcache_all} ;
1
2
use alloc:: vec:: Vec ;
2
3
use axplat:: mem:: { PhysAddr , va, virt_to_phys} ;
3
4
use fdt_parser:: Status ;
@@ -25,19 +26,19 @@ pub fn init() {
25
26
ls
26
27
} ) ;
27
28
28
- debug ! ( "CPU ID list: {:?}" , CPU_ID_LIST . wait( ) ) ;
29
+ debug ! ( "CPU ID list: {:#x ?}" , CPU_ID_LIST . wait( ) ) ;
29
30
30
31
if CPU_ID_LIST . wait ( ) . len ( ) < CPU_NUM {
31
32
panic ! (
32
- "CPU count {} is less than expected `cpu_num` in `.axconfig.toml`{}" ,
33
+ "CPU count {} is less than expected `cpu_num` in `.axconfig.toml` is {}" ,
33
34
CPU_ID_LIST . wait( ) . len( ) ,
34
35
CPU_NUM
35
36
) ;
36
37
}
37
38
38
39
if CPU_ID_LIST . wait ( ) . len ( ) > CPU_NUM {
39
40
info ! (
40
- "CPU count {} is more than expected `cpu_num` in `.axconfig.toml`{}" ,
41
+ "CPU count {} is more than expected `cpu_num` in `.axconfig.toml` is {}" ,
41
42
CPU_ID_LIST . wait( ) . len( ) ,
42
43
CPU_NUM
43
44
) ;
@@ -128,6 +129,7 @@ unsafe extern "C" fn _start_secondary() -> ! {
128
129
}
129
130
130
131
fn _secondary_main ( cpu_id : usize ) -> ! {
132
+ dcache_all ( CacheOp :: CleanAndInvalidate ) ;
131
133
let cpu_idx = cpu_id_to_idx ( cpu_id) ;
132
134
axplat:: call_secondary_main ( cpu_idx)
133
135
}
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ pub fn enable_irqs() {
71
71
"axconfig.toml `timer-irq` must match the IRQ number used in the driver"
72
72
) ;
73
73
74
- crate :: irq:: set_enable ( irq_raw, Some ( TIMER_IRQ_CONFIG . trigger ) , false ) ;
74
+ crate :: irq:: set_enable ( irq_raw, Some ( TIMER_IRQ_CONFIG . trigger ) , true ) ;
75
75
}
76
76
77
77
module_driver ! (
You can’t perform that action at this time.
0 commit comments