-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JIRA: RTOS-887
- Loading branch information
Showing
10 changed files
with
502 additions
and
7 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 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,15 @@ | ||
# | ||
# Makefile for Phoenix-RTOS loader (SPARCV8 LEON3 Generic HAL) | ||
# | ||
# Copyright 2024 Phoenix Systems | ||
# | ||
# %LICENSE% | ||
# | ||
|
||
CFLAGS += -DVADDR_KERNEL_INIT=$(VADDR_KERNEL_INIT) | ||
|
||
PLO_COMMANDS ?= alias app blob call console copy dump echo go help jffs2 kernel map mem phfs reboot script stop wait test-dev | ||
|
||
PLO_ALLDEVICES := uart-grlib ram-storage | ||
|
||
OBJS += $(addprefix $(PREFIX_O)hal/$(TARGET_SUFF)/gaisler/$(TARGET_SUBFAMILY)/, _init.o hal.o generic.o) |
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,80 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* Operating system loader | ||
* | ||
* Low level initialization | ||
* | ||
* Copyright 2024 Phoenix Systems | ||
* Author: Lukasz Leczkowski | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#define __ASSEMBLY__ | ||
|
||
#include "config.h" | ||
#include "../../cpu.h" | ||
|
||
|
||
.extern syspage_common | ||
|
||
|
||
.section ".init", "ax" | ||
.align 4 | ||
.global _init | ||
.type _init, #function | ||
_init: | ||
wr %g0, %wim | ||
nop | ||
nop | ||
nop | ||
|
||
wr %g0, PSR_S, %psr | ||
|
||
/* Get CPU ID */ | ||
rd %asr17, %g1 | ||
srl %g1, 28, %g1 | ||
cmp %g1, %g0 | ||
bnz jmp_core | ||
nop | ||
|
||
/* Set up trap table */ | ||
sethi %hi(_trap_table), %g1 | ||
wr %g1, %tbr | ||
|
||
wr %g0, 0x2, %wim | ||
|
||
flush | ||
set 0x81000f, %g1 | ||
sta %g1, [%g0] ASI_CCTRL | ||
|
||
clr %fp | ||
|
||
/* Stack pointer */ | ||
set _stack, %sp | ||
sub %sp, 0x60, %sp | ||
|
||
/* Set PSR to supervisor, enable traps, disable irq */ | ||
wr %g0, (PSR_ET | PSR_S | PSR_PIL), %psr | ||
nop | ||
nop | ||
nop | ||
|
||
wr %g0, 0x2, %wim | ||
|
||
sethi %hi(_startc), %g1 | ||
jmpl %g1 + %lo(_startc), %g0 | ||
clr %g1 | ||
|
||
jmp_core: | ||
set syspage_common, %g1 | ||
ld [%g1], %g1 /* syspage_common->syspage */ | ||
ld [%g1 + 8], %g1 /* syspage->pkernel */ | ||
|
||
/* Jump to kernel */ | ||
jmp %g1 | ||
nop | ||
.size _init, . - _init |
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,42 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* Operating system loader | ||
* | ||
* Platform configuration | ||
* | ||
* Copyright 2024 Phoenix Systems | ||
* Author: Lukasz Leczkowski | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#ifndef _CONFIG_H_ | ||
#define _CONFIG_H_ | ||
|
||
|
||
#ifndef __ASSEMBLY__ | ||
|
||
#include "generic.h" | ||
#include "peripherals.h" | ||
#include "hal/sparcv8leon3/gaisler/gaisler.h" | ||
#include "hal/sparcv8leon3/gaisler/types.h" | ||
#include "hal/sparcv8leon3/cpu.h" | ||
|
||
#include <phoenix/arch/sparcv8leon3/syspage.h> | ||
#include <phoenix/syspage.h> | ||
|
||
#define PATH_KERNEL "phoenix-sparcv8leon3-generic.elf" | ||
|
||
#endif /* __ASSEMBLY__ */ | ||
|
||
|
||
#define NWINDOWS 8 | ||
|
||
/* Import platform specific definitions */ | ||
#include "ld/sparcv8leon3-generic.ldt" | ||
|
||
|
||
#endif |
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,25 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* Operating system loader | ||
* | ||
* LEON3 Generic specific functions | ||
* | ||
* Copyright 2024 Phoenix Systems | ||
* Author: Lukasz Leczkowski | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#include "generic.h" | ||
#include "hal/sparcv8leon3/gaisler/gaisler.h" | ||
|
||
|
||
int gaisler_iomuxCfg(iomux_cfg_t *ioCfg) | ||
{ | ||
(void)ioCfg; | ||
|
||
return 0; | ||
} |
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,30 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* Operating system loader | ||
* | ||
* LEON3 Generic specific functions | ||
* | ||
* Copyright 2024 Phoenix Systems | ||
* Author: Lukasz Leczkowski | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#ifndef _GENERIC_H_ | ||
#define _GENERIC_H_ | ||
|
||
#include "../types.h" | ||
|
||
|
||
static inline void hal_cpuHalt(void) | ||
{ | ||
/* clang-format off */ | ||
__asm__ volatile ("wr %g0, %asr19"); | ||
/* clang-format on */ | ||
} | ||
|
||
|
||
#endif |
Oops, something went wrong.