Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
10640d24
Commit
10640d24
authored
Jun 09, 2020
by
Madhukar Pappireddy
Committed by
TrustedFirmware Code Review
Jun 09, 2020
Browse files
Merge "GICv3: GIC-600: Detect GIC-600 at runtime" into integration
parents
e5f3812e
b4ad365a
Changes
12
Hide whitespace changes
Inline
Side-by-side
docs/getting_started/build-options.rst
View file @
10640d24
...
@@ -717,8 +717,10 @@ GICv3 driver files are included using directive:
...
@@ -717,8 +717,10 @@ GICv3 driver files are included using directive:
The
driver
can
be
configured
with
the
following
options
set
in
the
platform
The
driver
can
be
configured
with
the
following
options
set
in
the
platform
makefile
:
makefile
:
-
``
GICV3_IMPL
``:
Selects
between
GIC
-
500
and
GIC
-
600
variants
of
GICv3
.
-
``
GICV3_SUPPORT_GIC600
``:
Add
support
for
the
GIC
-
600
variants
of
GICv3
.
This
option
can
take
values
GIC500
and
GIC600
with
default
set
to
GIC500
.
Enabling
this
option
will
add
runtime
detection
support
for
the
GIC
-
600
,
so
is
safe
to
select
even
for
a
GIC500
implementation
.
This
option
defaults
to
0.
-
``
GICV3_IMPL_GIC600_MULTICHIP
``:
Selects
GIC
-
600
variant
with
multichip
-
``
GICV3_IMPL_GIC600_MULTICHIP
``:
Selects
GIC
-
600
variant
with
multichip
functionality
.
This
option
defaults
to
0
functionality
.
This
option
defaults
to
0
...
...
docs/plat/arm/fvp/index.rst
View file @
10640d24
...
@@ -116,7 +116,6 @@ Arm FVP Platform Specific Build Options
...
@@ -116,7 +116,6 @@ Arm FVP Platform Specific Build Options
-
``
FVP_USE_GIC_DRIVER
``
:
Selects
the
GIC
driver
to
be
built
.
Options
:
-
``
FVP_USE_GIC_DRIVER
``
:
Selects
the
GIC
driver
to
be
built
.
Options
:
-
``
FVP_GIC600
``
:
The
GIC600
implementation
of
GICv3
is
selected
-
``
FVP_GICV2
``
:
The
GICv2
only
driver
is
selected
-
``
FVP_GICV2
``
:
The
GICv2
only
driver
is
selected
-
``
FVP_GICV3
``
:
The
GICv3
only
driver
is
selected
(
default
option
)
-
``
FVP_GICV3
``
:
The
GICv3
only
driver
is
selected
(
default
option
)
...
...
drivers/arm/gic/v3/gic
6
00.c
→
drivers/arm/gic/v3/gic
-x
00.c
View file @
10640d24
...
@@ -5,8 +5,9 @@
...
@@ -5,8 +5,9 @@
*/
*/
/*
/*
* Driver for GIC-600 specific features. This driver only overrides
* Driver for GIC-500 and GIC-600 specific features. This driver only
* APIs that are different to those generic ones in GICv3 driver.
* overrides APIs that are different to those generic ones in GICv3
* driver.
*
*
* GIC-600 supports independently power-gating redistributor interface.
* GIC-600 supports independently power-gating redistributor interface.
*/
*/
...
@@ -19,7 +20,8 @@
...
@@ -19,7 +20,8 @@
#include "gicv3_private.h"
#include "gicv3_private.h"
/* GIC-600 specific register offsets */
/* GIC-600 specific register offsets */
#define GICR_PWRR 0x24
#define GICR_PWRR 0x24
#define IIDR_MODEL_ARM_GIC_600 0x0200043b
/* GICR_PWRR fields */
/* GICR_PWRR fields */
#define PWRR_RDPD_SHIFT 0
#define PWRR_RDPD_SHIFT 0
...
@@ -39,6 +41,8 @@
...
@@ -39,6 +41,8 @@
#define PWRR_ON (0 << PWRR_RDPD_SHIFT)
#define PWRR_ON (0 << PWRR_RDPD_SHIFT)
#define PWRR_OFF (1 << PWRR_RDPD_SHIFT)
#define PWRR_OFF (1 << PWRR_RDPD_SHIFT)
#if GICV3_SUPPORT_GIC600
/* GIC-600 specific accessor functions */
/* GIC-600 specific accessor functions */
static
void
gicr_write_pwrr
(
uintptr_t
base
,
unsigned
int
val
)
static
void
gicr_write_pwrr
(
uintptr_t
base
,
unsigned
int
val
)
{
{
...
@@ -93,6 +97,29 @@ static void gic600_pwr_off(uintptr_t base)
...
@@ -93,6 +97,29 @@ static void gic600_pwr_off(uintptr_t base)
}
}
}
}
static
uintptr_t
get_gicr_base
(
unsigned
int
proc_num
)
{
uintptr_t
gicr_base
;
assert
(
gicv3_driver_data
);
assert
(
proc_num
<
gicv3_driver_data
->
rdistif_num
);
assert
(
gicv3_driver_data
->
rdistif_base_addrs
);
gicr_base
=
gicv3_driver_data
->
rdistif_base_addrs
[
proc_num
];
assert
(
gicr_base
);
return
gicr_base
;
}
static
bool
gicv3_is_gic600
(
uintptr_t
gicr_base
)
{
uint32_t
reg
=
mmio_read_32
(
gicr_base
+
GICR_IIDR
);
return
(
reg
&
IIDR_MODEL_MASK
)
==
IIDR_MODEL_ARM_GIC_600
;
}
#endif
void
gicv3_distif_pre_save
(
unsigned
int
proc_num
)
void
gicv3_distif_pre_save
(
unsigned
int
proc_num
)
{
{
arm_gicv3_distif_pre_save
(
proc_num
);
arm_gicv3_distif_pre_save
(
proc_num
);
...
@@ -103,38 +130,33 @@ void gicv3_distif_post_restore(unsigned int proc_num)
...
@@ -103,38 +130,33 @@ void gicv3_distif_post_restore(unsigned int proc_num)
arm_gicv3_distif_post_restore
(
proc_num
);
arm_gicv3_distif_post_restore
(
proc_num
);
}
}
/*
/*
* Power off GIC-600 redistributor
* Power off GIC-600 redistributor
(if configured and detected)
*/
*/
void
gicv3_rdistif_off
(
unsigned
int
proc_num
)
void
gicv3_rdistif_off
(
unsigned
int
proc_num
)
{
{
uintptr_t
gicr_base
;
#if GICV3_SUPPORT_GIC600
uintptr_t
gicr_base
=
get_gicr_base
(
proc_num
);
assert
(
gicv3_driver_data
);
assert
(
proc_num
<
gicv3_driver_data
->
rdistif_num
);
assert
(
gicv3_driver_data
->
rdistif_base_addrs
);
gicr_base
=
gicv3_driver_data
->
rdistif_base_addrs
[
proc_num
];
assert
(
gicr_base
);
/* Attempt to power redistributor off */
/* Attempt to power redistributor off */
gic600_pwr_off
(
gicr_base
);
if
(
gicv3_is_gic600
(
gicr_base
))
{
gic600_pwr_off
(
gicr_base
);
}
#endif
}
}
/*
/*
* Power on GIC-600 redistributor
* Power on GIC-600 redistributor
(if configured and detected)
*/
*/
void
gicv3_rdistif_on
(
unsigned
int
proc_num
)
void
gicv3_rdistif_on
(
unsigned
int
proc_num
)
{
{
uintptr_t
gicr_base
;
#if GICV3_SUPPORT_GIC600
uintptr_t
gicr_base
=
get_gicr_base
(
proc_num
);
assert
(
gicv3_driver_data
);
assert
(
proc_num
<
gicv3_driver_data
->
rdistif_num
);
assert
(
gicv3_driver_data
->
rdistif_base_addrs
);
gicr_base
=
gicv3_driver_data
->
rdistif_base_addrs
[
proc_num
];
assert
(
gicr_base
);
/* Power redistributor on */
/* Power redistributor on */
gic600_pwr_on
(
gicr_base
);
if
(
gicv3_is_gic600
(
gicr_base
))
{
gic600_pwr_on
(
gicr_base
);
}
#endif
}
}
drivers/arm/gic/v3/gic500.c
deleted
100644 → 0
View file @
e5f3812e
/*
* Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/*
* Driver for GIC500-specific features. This driver only overrides APIs that are
* different to those generic ones in GICv3 driver.
*/
#include "gicv3_private.h"
void
gicv3_distif_pre_save
(
unsigned
int
proc_num
)
{
arm_gicv3_distif_pre_save
(
proc_num
);
}
void
gicv3_distif_post_restore
(
unsigned
int
proc_num
)
{
arm_gicv3_distif_post_restore
(
proc_num
);
}
drivers/arm/gic/v3/gicv3.mk
View file @
10640d24
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#
#
# Default configuration values
# Default configuration values
GICV3_
IMPL
?=
GIC50
0
GICV3_
SUPPORT_GIC600
?=
0
GICV3_IMPL_GIC600_MULTICHIP
?=
0
GICV3_IMPL_GIC600_MULTICHIP
?=
0
GICV3_OVERRIDE_DISTIF_PWR_OPS
?=
0
GICV3_OVERRIDE_DISTIF_PWR_OPS
?=
0
GIC_ENABLE_V4_EXTN
?=
0
GIC_ENABLE_V4_EXTN
?=
0
...
@@ -20,19 +20,14 @@ ifeq (${GICV3_OVERRIDE_DISTIF_PWR_OPS}, 0)
...
@@ -20,19 +20,14 @@ ifeq (${GICV3_OVERRIDE_DISTIF_PWR_OPS}, 0)
GICV3_SOURCES
+=
drivers/arm/gic/v3/arm_gicv3_common.c
GICV3_SOURCES
+=
drivers/arm/gic/v3/arm_gicv3_common.c
endif
endif
# Either GIC-600 or GIC-500 can be selected at one time
GICV3_SOURCES
+=
drivers/arm/gic/v3/gic-x00.c
ifeq
(${GICV3_IMPL}, GIC600)
# GIC-600 sources
GICV3_SOURCES
+=
drivers/arm/gic/v3/gic600.c
ifeq
(${GICV3_IMPL_GIC600_MULTICHIP}, 1)
ifeq
(${GICV3_IMPL_GIC600_MULTICHIP}, 1)
GICV3_SOURCES
+=
drivers/arm/gic/v3/gic600_multichip.c
GICV3_SOURCES
+=
drivers/arm/gic/v3/gic600_multichip.c
endif
endif
else
ifeq
(${GICV3_IMPL}, GIC500)
# GIC-500 sources
# Set GIC-600 support
GICV3_SOURCES
+=
drivers/arm/gic/v3/gic500.c
$(eval
$(call
assert_boolean,GICV3_SUPPORT_GIC600))
else
$(eval
$(call
add_define,GICV3_SUPPORT_GIC600))
$(error
"Incorrect GICV3_IMPL value ${GICV3_IMPL}"
)
endif
# Set GICv4 extension
# Set GICv4 extension
$(eval
$(call
assert_boolean,GIC_ENABLE_V4_EXTN))
$(eval
$(call
assert_boolean,GIC_ENABLE_V4_EXTN))
...
...
include/drivers/arm/gicv3.h
View file @
10640d24
...
@@ -222,6 +222,14 @@
...
@@ -222,6 +222,14 @@
#define TYPER_PPI_NUM_SHIFT U(27)
#define TYPER_PPI_NUM_SHIFT U(27)
#define TYPER_PPI_NUM_MASK U(0x1f)
#define TYPER_PPI_NUM_MASK U(0x1f)
/* GICR_IIDR bit definitions */
#define IIDR_PRODUCT_ID_MASK 0xff000000
#define IIDR_VARIANT_MASK 0x000f0000
#define IIDR_REVISION_MASK 0x0000f000
#define IIDR_IMPLEMENTER_MASK 0x00000fff
#define IIDR_MODEL_MASK (IIDR_PRODUCT_ID_MASK | \
IIDR_IMPLEMENTER_MASK)
/*******************************************************************************
/*******************************************************************************
* GICv3 and 3.1 CPU interface registers & constants
* GICv3 and 3.1 CPU interface registers & constants
******************************************************************************/
******************************************************************************/
...
...
plat/arm/board/arm_fpga/platform.mk
View file @
10640d24
...
@@ -70,8 +70,8 @@ else
...
@@ -70,8 +70,8 @@ else
lib/cpus/aarch64/cortex_a75.S
lib/cpus/aarch64/cortex_a75.S
endif
endif
#
GIC-600 configuration
#
Allow detection of GIC-600
GICV3_
IMPL
:=
GIC600
GICV3_
SUPPORT_
GIC600
:=
1
# Include GICv3 driver files
# Include GICv3 driver files
include
drivers/arm/gic/v3/gicv3.mk
include
drivers/arm/gic/v3/gicv3.mk
...
...
plat/arm/board/fvp/platform.mk
View file @
10640d24
...
@@ -49,13 +49,10 @@ endif
...
@@ -49,13 +49,10 @@ endif
$(eval
$(call
add_define,FVP_INTERCONNECT_DRIVER))
$(eval
$(call
add_define,FVP_INTERCONNECT_DRIVER))
# Choose the GIC sources depending upon the how the FVP will be invoked
# Choose the GIC sources depending upon the how the FVP will be invoked
ifeq
(${FVP_USE_GIC_DRIVER},$(filter ${FVP_USE_GIC_DRIVER},FVP_GICV3 FVP_GIC600))
ifeq
(${FVP_USE_GIC_DRIVER}, FVP_GICV3)
# GIC500 is the default option in case GICV3_IMPL is not set
ifeq
(${FVP_USE_GIC_DRIVER}, FVP_GIC600)
GICV3_IMPL
:=
GIC600
endif
# The GIC model (GIC-600 or GIC-500) will be detected at runtime
GICV3_SUPPORT_GIC600
:=
1
GICV3_OVERRIDE_DISTIF_PWR_OPS
:=
1
GICV3_OVERRIDE_DISTIF_PWR_OPS
:=
1
# Include GICv3 driver files
# Include GICv3 driver files
...
...
plat/arm/board/n1sdp/platform.mk
View file @
10640d24
...
@@ -15,7 +15,7 @@ PLAT_INCLUDES := -I${N1SDP_BASE}/include
...
@@ -15,7 +15,7 @@ PLAT_INCLUDES := -I${N1SDP_BASE}/include
N1SDP_CPU_SOURCES
:=
lib/cpus/aarch64/neoverse_n1.S
N1SDP_CPU_SOURCES
:=
lib/cpus/aarch64/neoverse_n1.S
# GIC-600 configuration
# GIC-600 configuration
GICV3_
IMPL
:=
GIC600
GICV3_
SUPPORT_GIC600
:=
1
GICV3_IMPL_GIC600_MULTICHIP
:=
1
GICV3_IMPL_GIC600_MULTICHIP
:=
1
# Include GICv3 driver files
# Include GICv3 driver files
...
...
plat/arm/board/tc0/platform.mk
View file @
10640d24
...
@@ -25,7 +25,8 @@ USE_COHERENT_MEM := 0
...
@@ -25,7 +25,8 @@ USE_COHERENT_MEM := 0
GIC_ENABLE_V4_EXTN
:=
1
GIC_ENABLE_V4_EXTN
:=
1
# GIC-600 configuration
# GIC-600 configuration
GICV3_IMPL
:=
GIC600
GICV3_SUPPORT_GIC600
:=
1
# Include GICv3 driver files
# Include GICv3 driver files
include
drivers/arm/gic/v3/gicv3.mk
include
drivers/arm/gic/v3/gicv3.mk
...
...
plat/arm/css/sgi/sgi-common.mk
View file @
10640d24
...
@@ -23,7 +23,7 @@ INTERCONNECT_SOURCES := ${CSS_ENT_BASE}/sgi_interconnect.c
...
@@ -23,7 +23,7 @@ INTERCONNECT_SOURCES := ${CSS_ENT_BASE}/sgi_interconnect.c
PLAT_INCLUDES
+=
-I
${CSS_ENT_BASE}
/include
PLAT_INCLUDES
+=
-I
${CSS_ENT_BASE}
/include
# GIC-600 configuration
# GIC-600 configuration
GICV3_
IMPL
:=
GIC600
GICV3_
SUPPORT_
GIC600
:=
1
# Include GICv3 driver files
# Include GICv3 driver files
include
drivers/arm/gic/v3/gicv3.mk
include
drivers/arm/gic/v3/gicv3.mk
...
...
plat/arm/css/sgm/sgm-common.mk
View file @
10640d24
...
@@ -23,7 +23,7 @@ SGM_CPU_SOURCES := lib/cpus/aarch64/cortex_a55.S \
...
@@ -23,7 +23,7 @@ SGM_CPU_SOURCES := lib/cpus/aarch64/cortex_a55.S \
INTERCONNECT_SOURCES
:=
${CSS_SGM_BASE}
/sgm_interconnect.c
INTERCONNECT_SOURCES
:=
${CSS_SGM_BASE}
/sgm_interconnect.c
# GIC-600 configuration
# GIC-600 configuration
GICV3_
IMPL
:=
GIC600
GICV3_
SUPPORT_
GIC600
:=
1
# Include GICv3 driver files
# Include GICv3 driver files
include
drivers/arm/gic/v3/gicv3.mk
include
drivers/arm/gic/v3/gicv3.mk
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment