Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
seL4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Panda
seL4
Commits
dd6b8cb6
Commit
dd6b8cb6
authored
5 years ago
by
Kent McLeod
Browse files
Options
Downloads
Patches
Plain Diff
gic_v3: Support for aarch32
parent
3c896239
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/arch/arm/arch/machine/gic_v3.h
+14
-0
14 additions, 0 deletions
include/arch/arm/arch/machine/gic_v3.h
src/arch/arm/machine/gic_v3.c
+16
-9
16 additions, 9 deletions
src/arch/arm/machine/gic_v3.c
with
30 additions
and
9 deletions
include/arch/arm/arch/machine/gic_v3.h
+
14
−
0
View file @
dd6b8cb6
...
...
@@ -73,6 +73,7 @@
#define DEFAULT_PMR_VALUE 0xff
/* System registers for GIC CPU interface */
#ifdef CONFIG_ARCH_AARCH64
#define ICC_IAR1_EL1 "S3_0_C12_C12_0"
#define ICC_EOIR1_EL1 "S3_0_C12_C12_1"
#define ICC_HPPIR1_EL1 "S3_0_C12_C12_2"
...
...
@@ -82,6 +83,19 @@
#define ICC_CTLR_EL1 "S3_0_C12_C12_4"
#define ICC_IGRPEN1_EL1 "S3_0_C12_C12_7"
#define ICC_SRE_EL1 "S3_0_C12_C12_5"
#define MPIDR "mpidr_el1"
#else
#define ICC_IAR1_EL1 " p15, 0, %0, c12, c12, 0"
#define ICC_EOIR1_EL1 " p15, 0, %0, c12, c12, 1"
#define ICC_HPPIR1_EL1 " p15, 0, %0, c12, c12, 2"
#define ICC_BPR1_EL1 " p15, 0, %0, c12, c12, 3"
#define ICC_DIR_EL1 " p15, 0, %0, c12, c11, 1"
#define ICC_PMR_EL1 " p15, 0, %0, c4, c6, 0"
#define ICC_CTLR_EL1 " p15, 0, %0, c12, c12, 4"
#define ICC_IGRPEN1_EL1 " p15, 0, %0, c12, c12, 7"
#define ICC_SRE_EL1 " p15, 0, %0, c12, c12, 5"
#define MPIDR " p15, 0, %0, c0, c0, 5"
#endif
/* Memory map for GIC distributor */
struct
gic_dist_map
{
...
...
This diff is collapsed.
Click to expand it.
src/arch/arm/machine/gic_v3.c
+
16
−
9
View file @
dd6b8cb6
...
...
@@ -32,20 +32,27 @@ uint32_t active_irq[CONFIG_MAX_NUM_NODES] = {IRQ_NONE};
volatile
struct
gic_rdist_map
*
gic_rdist_map
[
CONFIG_MAX_NUM_NODES
]
=
{
0
};
volatile
struct
gic_rdist_sgi_ppi_map
*
gic_rdist_sgi_ppi_map
[
CONFIG_MAX_NUM_NODES
]
=
{
0
};
#ifdef CONFIG_ARCH_AARCH64
#define MPIDR_AFF0(x) (x & 0xff)
#define MPIDR_AFF1(x) ((x >> 8) & 0xff)
#define MPIDR_AFF2(x) ((x >> 16) & 0xff)
#define MPIDR_AFF3(x) ((x >> 32) & 0xff)
#else
#define MPIDR_AFF0(x) (x & 0xff)
#define MPIDR_AFF1(x) ((x >> 8) & 0xff)
#define MPIDR_AFF2(x) ((x >> 16) & 0xff)
#define MPIDR_AFF3(x) (0)
#endif
#define MPIDR_MT(x) (x & BIT(24))
static
uint64
_t
mpidr_map
[
CONFIG_MAX_NUM_NODES
];
static
word
_t
mpidr_map
[
CONFIG_MAX_NUM_NODES
];
static
inline
uint64
_t
get_mpidr
(
word_t
core_id
)
static
inline
word
_t
get_mpidr
(
word_t
core_id
)
{
return
mpidr_map
[
core_id
];
}
static
inline
uint64
_t
get_current_mpidr
(
void
)
static
inline
word
_t
get_current_mpidr
(
void
)
{
word_t
core_id
=
CURRENT_CPU_INDEX
();
return
get_mpidr
(
core_id
);
...
...
@@ -53,9 +60,9 @@ static inline uint64_t get_current_mpidr(void)
static
inline
uint64_t
mpidr_to_gic_affinity
(
void
)
{
uint64
_t
mpidr
=
get_current_mpidr
();
word
_t
mpidr
=
get_current_mpidr
();
uint64_t
affinity
=
0
;
affinity
=
MPIDR_AFF3
(
mpidr
)
<<
32
|
MPIDR_AFF2
(
mpidr
)
<<
16
|
affinity
=
(
uint64_t
)
MPIDR_AFF3
(
mpidr
)
<<
32
|
MPIDR_AFF2
(
mpidr
)
<<
16
|
MPIDR_AFF1
(
mpidr
)
<<
8
|
MPIDR_AFF0
(
mpidr
);
return
affinity
;
}
...
...
@@ -165,9 +172,9 @@ BOOT_CODE static void dist_init(void)
BOOT_CODE
static
void
gicr_locate_interface
(
void
)
{
uint64
_t
offset
;
word
_t
offset
;
int
core_id
=
SMP_TERNARY
(
getCurrentCPUIndex
(),
0
);
uint64
_t
mpidr
=
get_current_mpidr
();
word
_t
mpidr
=
get_current_mpidr
();
uint32_t
val
;
/*
...
...
@@ -316,8 +323,8 @@ BOOT_CODE void initIRQController(void)
BOOT_CODE
void
cpu_initLocalIRQController
(
void
)
{
uint64
_t
mpidr
=
0
;
SYSTEM_READ_WORD
(
"mpidr_el1"
,
mpidr
);
word
_t
mpidr
=
0
;
SYSTEM_READ_WORD
(
MPIDR
,
mpidr
);
mpidr_map
[
CURRENT_CPU_INDEX
()]
=
mpidr
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment