-
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.
refactor gaisler cpu support to be more generic JIRA: RTOS-616
- Loading branch information
Showing
31 changed files
with
1,154 additions
and
417 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
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
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
# | ||
# Makefile for Phoenix-RTOS loader (SPARCV8 LEON3 HAL) | ||
# | ||
# Copyright 2023 Phoenix Systems | ||
# | ||
# %LICENSE% | ||
# | ||
|
||
CFLAGS += -Ihal/sparcv8leon3/gaisler/ -Ihal/sparcv8leon3/gaisler/$(TARGET_SUBFAMILY) | ||
|
||
include hal/sparcv8leon3/gaisler/$(TARGET_SUBFAMILY)/Makefile | ||
|
||
OBJS += $(addprefix $(PREFIX_O)hal/$(TARGET_SUFF)/gaisler/, console.o timer.o) | ||
|
||
ifeq ($(TARGET_SUBFAMILY), gr712rc) | ||
OBJS += $(addprefix $(PREFIX_O)hal/$(TARGET_SUFF)/gaisler/, irqmp.o) | ||
else ifeq ($(TARGET_SUBFAMILY), gr716) | ||
OBJS += $(addprefix $(PREFIX_O)hal/$(TARGET_SUFF)/gaisler/, irqamp.o) | ||
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
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 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* Operating system loader | ||
* | ||
* Gaisler CPU specific functions | ||
* | ||
* Copyright 2023 Phoenix Systems | ||
* Author: Lukasz Leczkowski | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#ifndef _GAISLER_H_ | ||
#define _GAISLER_H_ | ||
|
||
|
||
#include "types.h" | ||
|
||
|
||
typedef struct { | ||
u8 pin; | ||
u8 opt; | ||
u8 pullup; | ||
u8 pulldn; | ||
} iomux_cfg_t; | ||
|
||
|
||
int gaisler_iomuxCfg(iomux_cfg_t *ioCfg); | ||
|
||
|
||
#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,16 @@ | ||
# | ||
# Makefile for Phoenix-RTOS loader (SPARCV8 LEON3 GR712RC HAL) | ||
# | ||
# Copyright 2023 Phoenix Systems | ||
# | ||
# %LICENSE% | ||
# | ||
|
||
CFLAGS += -DVADDR_KERNEL_INIT=$(VADDR_KERNEL_INIT) | ||
|
||
PLO_COMMANDS := alias app call console copy dump echo go help kernel map mem phfs reboot script wait | ||
|
||
include devices/uart-grlib/Makefile | ||
include devices/ram-storage/Makefile | ||
|
||
OBJS += $(addprefix $(PREFIX_O)hal/$(TARGET_SUFF)/gaisler/$(TARGET_SUBFAMILY)/, _init.o hal.o gr712rc.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,62 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* Operating system loader | ||
* | ||
* Low level initialization | ||
* | ||
* Copyright 2022-2023 Phoenix Systems | ||
* Author: Lukasz Leczkowski | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#define __ASSEMBLY__ | ||
|
||
#include "config.h" | ||
#include "../../cpu.h" | ||
|
||
|
||
.section ".init", "ax" | ||
.align 4 | ||
.global _init | ||
.type _init, #function | ||
_init: | ||
wr %g0, %wim | ||
nop | ||
nop | ||
nop | ||
|
||
wr %g0, PSR_S, %psr | ||
|
||
/* Set up trap table */ | ||
sethi %hi(_trap_table), %g1 | ||
wr %g1, %tbr | ||
|
||
wr %g0, 0x2, %wim | ||
|
||
/* Flush and enable cache - section 4.5.7 GR712RC UM */ | ||
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 | ||
.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,44 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* Operating system loader | ||
* | ||
* Platform configuration | ||
* | ||
* Copyright 2022-2023 Phoenix Systems | ||
* Author: Lukasz Leczkowski | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#ifndef _CONFIG_H_ | ||
#define _CONFIG_H_ | ||
|
||
|
||
#ifndef __ASSEMBLY__ | ||
|
||
#include "gr712rc.h" | ||
#include "peripherals.h" | ||
#include "../gaisler.h" | ||
#include "../types.h" | ||
#include "../../cpu.h" | ||
|
||
#include <phoenix/arch/syspage-sparcv8leon3.h> | ||
#include <phoenix/syspage.h> | ||
|
||
#define PATH_KERNEL "phoenix-sparcv8leon3-gr712rc.elf" | ||
|
||
#endif /* __ASSEMBLY__ */ | ||
|
||
|
||
#define NWINDOWS 8 | ||
|
||
#define ASI_CCTRL 0x02 | ||
|
||
/* Import platform specific definitions */ | ||
#include "ld/sparcv8leon3-gr712rc.ldt" | ||
|
||
|
||
#endif |
Oops, something went wrong.