-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elfloader: NVIDIA Jetson Orin support #190
base: master
Are you sure you want to change the base?
Changes from 3 commits
9f2a8d0
276519b
b9c6f44
0cdf9c2
0108b77
7b3c2f3
1aa2fb0
c329bef
e8a15ec
dea6924
65b49ae
fa81fff
33f00c8
4996de7
5ebb1fc
80b8902
0e0a99d
16ea8ef
84a55cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,11 @@ void non_boot_main(void) | |
#endif | ||
/* Spin until the first CPU has finished initialisation. */ | ||
while (!non_boot_lock) { | ||
#ifndef CONFIG_ARCH_AARCH64 | ||
#ifdef CONFIG_ARCH_AARCH64 | ||
/* The compiler may optimize this loop away, add a dsb() | ||
* to force a reload. */ | ||
dsb(); | ||
Comment on lines
+38
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also applies to non-aarch64, so this doesn't look like the right solution. Using standard atomics may be better and more portable here. Edit: The problem may be masked by |
||
#else | ||
cpu_idle(); | ||
#endif | ||
} | ||
|
@@ -45,12 +49,19 @@ void non_boot_main(void) | |
abort(); | ||
} | ||
|
||
#ifndef CONFIG_ARM_HYPERVISOR_SUPPORT | ||
if (is_hyp_mode()) { | ||
extern void leave_hyp(void); | ||
extern void disable_mmu_caches_hyp(void); | ||
#ifdef CONFIG_ARCH_AARCH64 | ||
/* Disable the MMU and cacheability unconditionally on ARM64. | ||
* The 32 bit ARM platforms do not expect the MMU to be turned | ||
* off, so we leave them alone. */ | ||
disable_mmu_caches_hyp(); | ||
#endif | ||
#ifndef CONFIG_ARM_HYPERVISOR_SUPPORT | ||
leave_hyp(); | ||
} | ||
#endif | ||
} | ||
/* Enable the MMU, and enter the kernel. */ | ||
if (is_hyp_mode()) { | ||
arm_enable_hyp_mmu(); | ||
|
@@ -117,7 +128,13 @@ WEAK void init_cpus(void) | |
abort(); | ||
} | ||
|
||
while (!is_core_up(num_cpus)); | ||
while (!is_core_up(num_cpus)) { | ||
#if defined(CONFIG_ARCH_AARCH64) | ||
/* The compiler may optimize this loop away, add a dsb() | ||
* to force a reload. */ | ||
dsb(); | ||
#endif | ||
} | ||
printf("Core %d is up with logic id %d\n", elfloader_cpus[i].cpu_id, num_cpus); | ||
num_cpus++; | ||
} | ||
|
@@ -134,6 +151,13 @@ void smp_boot(void) | |
arm_disable_dcaches(); | ||
#endif | ||
init_cpus(); | ||
#if defined(CONFIG_ARCH_AARCH64) | ||
dsb(); | ||
non_boot_lock = 1; | ||
/* Secondary CPUs may still run with MMU & caches off. Force the update to be visible. */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same is true for 32-bit, right? |
||
asm volatile("dc civac, %0\n\t" :: "r"(&non_boot_lock) : "memory");; | ||
#else | ||
non_boot_lock = 1; | ||
#endif | ||
} | ||
#endif /* CONFIG_MAX_NUM_NODES */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ SECTIONS | |
.dynstr : { *(.dynstr) } | ||
. = ALIGN(4096); | ||
.note.gnu.build-id : { *(.note.gnu.build-id) } | ||
_end = .; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be part of commit dea6924 I think. |
||
/DISCARD/ : | ||
{ | ||
*(.rel.reloc) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "sedcondary".