Skip to content
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

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions elfloader-tool/include/arch-arm/64/mode/structures.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

#pragma once

/* ARM VMSAv8-64 (with a fully populated last level) has the same number of PTEs
* in all levels (we don't use concatenated pagetables in ELFloader) and each
* table entry is always eight bytes large.
*/
#define BITS_PER_LEVEL (PAGE_BITS - 3)

#define ARM_1GB_BLOCK_BITS 30
#define ARM_2MB_BLOCK_BITS 21

Expand All @@ -26,9 +32,5 @@
#define GET_PMD_INDEX(x) (((word_t)(x) >> (ARM_2MB_BLOCK_BITS)) & MASK(PMD_BITS))

extern uint64_t _boot_pgd_up[BIT(PGD_BITS)];
extern uint64_t _boot_pud_up[BIT(PUD_BITS)];
extern uint64_t _boot_pmd_up[BIT(PMD_BITS)];

extern uint64_t _boot_pgd_down[BIT(PGD_BITS)];
extern uint64_t _boot_pud_down[BIT(PUD_BITS)];

15 changes: 15 additions & 0 deletions elfloader-tool/include/arch-arm/elfloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,22 @@ typedef void (*init_arm_kernel_t)(word_t ui_p_reg_start,

/* Enable the mmu. */
extern void arm_enable_mmu(void);

/* These functions are very similar however, there are some small differences
* between the ARMv8 and legacy implementation.
*
* New ARMv8 implementation:
* - Does the MMU disabling. This is to keep the time spent with MMU off low.
* - Is only meant if seL4 runs in EL2.
*/
#if defined(CONFIG_ARCH_AARCH64)
/* Switches MMU-related stuff: pagetables, MAIR & TCR etc. Works also if the MMU
* was off initially. EL2 translation regime only.
*/
extern void arm_switch_to_hyp_tables(void);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps call it aarch64_switch_to_hyp_tables if there is no 32-bit version of it.

#else
extern void arm_enable_hyp_mmu(void);
#endif


/* Setup boot VSpace. */
Expand Down
5 changes: 5 additions & 0 deletions elfloader-tool/include/drivers/uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once

#include <autoconf.h>
#include <drivers/common.h>

#define dev_get_uart(dev) ((struct elfloader_uart_ops *)(dev->drv->ops))
Expand All @@ -16,3 +17,7 @@ struct elfloader_uart_ops {

volatile void *uart_get_mmio(void);
void uart_set_out(struct elfloader_device *out);
#if defined(CONFIG_ARCH_AARCH64)
/* Implemented in mmu.c */
void mmu_set_uart_base(volatile void *base);
#endif
Loading