Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
dea59794
Commit
dea59794
authored
4 years ago
by
Madhukar Pappireddy
Committed by
TrustedFirmware Code Review
4 years ago
Browse files
Options
Download
Plain Diff
Merge "PSCI: fix limit of 256 CPUs caused by cast to unsigned char" into integration
parents
8fdebc94
a86865ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/psci/psci_private.h
+7
-2
lib/psci/psci_private.h
lib/psci/psci_setup.c
+12
-2
lib/psci/psci_setup.c
with
19 additions
and
4 deletions
+19
-4
lib/psci/psci_private.h
View file @
dea59794
...
...
@@ -42,6 +42,11 @@
define_psci_cap(PSCI_SYSTEM_RESET2_AARCH64) | \
define_psci_cap(PSCI_MEM_CHK_RANGE_AARCH64))
/* Internally PSCI uses a uint16_t for various cpu indexes so
* define a limit to number of CPUs that can be initialised.
*/
#define PSCI_MAX_CPUS_INDEX 0xFFFFU
/*
* Helper functions to get/set the fields of PSCI per-cpu data.
*/
...
...
@@ -134,7 +139,7 @@ typedef struct non_cpu_pwr_domain_node {
unsigned
char
level
;
/* For indexing the psci_lock array*/
u
nsigned
char
lock_index
;
u
int16_t
lock_index
;
}
non_cpu_pd_node_t
;
typedef
struct
cpu_pwr_domain_node
{
...
...
@@ -239,7 +244,7 @@ static inline void psci_lock_release(non_cpu_pd_node_t *non_cpu_pd_node)
#endif
/* HW_ASSISTED_COHERENCY */
static
inline
void
psci_lock_init
(
non_cpu_pd_node_t
*
non_cpu_pd_node
,
u
nsigned
char
idx
)
u
int16_t
idx
)
{
non_cpu_pd_node
[
idx
].
lock_index
=
idx
;
}
...
...
This diff is collapsed.
Click to expand it.
lib/psci/psci_setup.c
View file @
dea59794
...
...
@@ -17,6 +17,12 @@
#include "psci_private.h"
/*
* Check that PLATFORM_CORE_COUNT fits into the number of cores
* that can be represented by PSCI_MAX_CPUS_INDEX.
*/
CASSERT
(
PLATFORM_CORE_COUNT
<=
(
PSCI_MAX_CPUS_INDEX
+
1U
),
assert_psci_cores_overflow
);
/*******************************************************************************
* Per cpu non-secure contexts used to program the architectural state prior
* return to the normal world.
...
...
@@ -34,11 +40,13 @@ unsigned int psci_caps;
* Function which initializes the 'psci_non_cpu_pd_nodes' or the
* 'psci_cpu_pd_nodes' corresponding to the power level.
******************************************************************************/
static
void
__init
psci_init_pwr_domain_node
(
u
nsigned
char
node_idx
,
static
void
__init
psci_init_pwr_domain_node
(
u
int16_t
node_idx
,
unsigned
int
parent_idx
,
unsigned
char
level
)
{
if
(
level
>
PSCI_CPU_PWR_LVL
)
{
assert
(
node_idx
<
PSCI_NUM_NON_CPU_PWR_DOMAINS
);
psci_non_cpu_pd_nodes
[
node_idx
].
level
=
level
;
psci_lock_init
(
psci_non_cpu_pd_nodes
,
node_idx
);
psci_non_cpu_pd_nodes
[
node_idx
].
parent_node
=
parent_idx
;
...
...
@@ -47,6 +55,8 @@ static void __init psci_init_pwr_domain_node(unsigned char node_idx,
}
else
{
psci_cpu_data_t
*
svc_cpu_data
;
assert
(
node_idx
<
PLATFORM_CORE_COUNT
);
psci_cpu_pd_nodes
[
node_idx
].
parent_node
=
parent_idx
;
/* Initialize with an invalid mpidr */
...
...
@@ -144,7 +154,7 @@ static unsigned int __init populate_power_domain_tree(const unsigned char
for
(
j
=
node_index
;
j
<
(
node_index
+
num_children
);
j
++
)
psci_init_pwr_domain_node
((
u
nsigned
char
)
j
,
psci_init_pwr_domain_node
((
u
int16_t
)
j
,
parent_node_index
-
1U
,
(
unsigned
char
)
level
);
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help