-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ae6b71
commit 9b62a73
Showing
29 changed files
with
222 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 */ | ||
|
||
#ifndef __ARM32_LINKAGE_H__ | ||
#define __ARM32_LINKAGE_H__ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define ALIGN .align 0 | ||
#define ALIGN_STR ".align 0" | ||
|
||
#define ENTRY(name) \ | ||
.globl name; \ | ||
ALIGN; \ | ||
name: | ||
|
||
#define WEAK(name) \ | ||
.weak name; \ | ||
name: | ||
|
||
#define END(name) .size name, .- name | ||
|
||
#define ENDPROC(name) \ | ||
.type name, % function; \ | ||
END(name) | ||
|
||
/* | ||
* CR1 bits (CP#15 CR1) | ||
*/ | ||
#define CR_M (1 << 0) /* MMU enable */ | ||
#define CR_A (1 << 1) /* Alignment abort enable */ | ||
#define CR_C (1 << 2) /* Dcache enable */ | ||
#define CR_W (1 << 3) /* Write buffer enable */ | ||
#define CR_P (1 << 4) /* 32-bit exception handler */ | ||
#define CR_D (1 << 5) /* 32-bit data address range */ | ||
#define CR_L (1 << 6) /* Implementation defined */ | ||
#define CR_B (1 << 7) /* Big endian */ | ||
#define CR_S (1 << 8) /* System MMU protection */ | ||
#define CR_R (1 << 9) /* ROM MMU protection */ | ||
#define CR_F (1 << 10) /* Implementation defined */ | ||
#define CR_Z (1 << 11) /* Implementation defined */ | ||
#define CR_I (1 << 12) /* Icache enable */ | ||
#define CR_V (1 << 13) /* Vectors relocated to 0xffff0000 */ | ||
#define CR_RR (1 << 14) /* Round Robin cache replacement */ | ||
#define CR_L4 (1 << 15) /* LDR pc can set T bit */ | ||
#define CR_DT (1 << 16) | ||
#define CR_IT (1 << 18) | ||
#define CR_ST (1 << 19) | ||
#define CR_FI (1 << 21) /* Fast interrupt (lower latency mode) */ | ||
#define CR_U (1 << 22) /* Unaligned access operation */ | ||
#define CR_XP (1 << 23) /* Extended page tables */ | ||
#define CR_VE (1 << 24) /* Vectored interrupts */ | ||
#define CR_EE (1 << 25) /* Exception (Big) Endian */ | ||
#define CR_TRE (1 << 28) /* TEX remap enable */ | ||
#define CR_AFE (1 << 29) /* Access flag enable */ | ||
#define CR_TE (1 << 30) /* Thumb exception enable */ | ||
|
||
/* ARM relocs */ | ||
#define R_ARM_NONE 0 /* No reloc */ | ||
#define R_ARM_RELATIVE 23 /* Adjust by program base */ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* __ARM32_LINKAGE_H__ */ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") | ||
OUTPUT_ARCH(arm) | ||
ENTRY(_start) | ||
SECTIONS | ||
{ | ||
. = 0x4a000000; | ||
. = ALIGN(4); | ||
.text : | ||
{ | ||
.obj/source/start.o (*.text) | ||
*(.text*) | ||
} | ||
|
||
. = ALIGN(4); | ||
.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } | ||
|
||
. = ALIGN(4); | ||
.data : { | ||
*(.data*) | ||
} | ||
|
||
.interp : { *(.interp*) } | ||
.gnu.hash : { *(.gnu.hash) } | ||
.gnu : { *(.gnu*) } | ||
.ARM.exidx : { *(.ARM.exidx*) } | ||
.gnu.linkonce.armexidx : { *(.gnu.linkonce.armexidx.*) } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include <byteorder.h> | ||
#include <endian.h> | ||
#include <io.h> | ||
#include <stdarg.h> | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <types.h> | ||
|
||
#define CONFIG_DTB_LOAD_ADDR (0x4a200000) | ||
#define CONFIG_KERNEL_LOAD_ADDR (0x40080000) | ||
|
||
extern uint32_t __sunxi_smc_call(uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3); | ||
|
||
static inline uint32_t sunxi_smc_call_atf(uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3) { | ||
return __sunxi_smc_call(arg0, arg1, arg2, arg3); | ||
} | ||
|
||
void print_banner(void) { | ||
printf(" _____ _ _____ __ ___ ___ \n"); | ||
printf("| __|_ _| |_ ___ ___| __ | | |_ |_ |\n"); | ||
printf("|__ | | | _| -_| _| __ -| |__|_ |_ |\n"); | ||
printf("|_____|_ |_| |___|_| |_____|_____|___|___|\n"); | ||
printf(" |___| \n"); | ||
printf("\n"); | ||
printf("Hello Syter BL33!\n"); | ||
printf("load kernel 0x%08x to aarch64 mode...\n", CONFIG_KERNEL_LOAD_ADDR); | ||
printf("load dtb 0x%08x...\n\n", CONFIG_DTB_LOAD_ADDR); | ||
|
||
printf("Start Kernel...\n\n"); | ||
|
||
mdelay(10); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 3 additions & 5 deletions
8
utils/bl32/source/smccc-call.S → utils/bl33/source/smccc-call.S
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
.align 0 | ||
.globl __sunxi_smc_call ; | ||
#include <linkage.h> | ||
|
||
__sunxi_smc_call: | ||
ENTRY(__sunxi_smc_call) | ||
stmfd sp!, {r4-r12, lr} @ save reg state | ||
.arch_extension sec | ||
smc #0 | ||
ldmfd sp!, {r4-r12, pc} @ restore saved regs and return | ||
ENDPROC(__sunxi_smc_call) | ||
|
||
.type __sunxi_smc_call 2 ; | ||
.size __sunxi_smc_call, .-__sunxi_smc_call |
Oops, something went wrong.