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
936cf5fd
Commit
936cf5fd
authored
Jul 16, 2020
by
Madhukar Pappireddy
Committed by
TrustedFirmware Code Review
Jul 16, 2020
Browse files
Merge "stm32mp1: shared resources: add trace messages" into integration
parents
5ac92813
a2150c33
Changes
1
Hide whitespace changes
Inline
Side-by-side
plat/st/stm32mp1/stm32mp1_shared_resources.c
View file @
936cf5fd
...
@@ -44,6 +44,49 @@ enum shres_state {
...
@@ -44,6 +44,49 @@ enum shres_state {
/* Force uint8_t array for array of enum shres_state for size considerations */
/* Force uint8_t array for array of enum shres_state for size considerations */
static
uint8_t
shres_state
[
STM32MP1_SHRES_COUNT
];
static
uint8_t
shres_state
[
STM32MP1_SHRES_COUNT
];
static
const
char
*
shres2str_id_tbl
[
STM32MP1_SHRES_COUNT
]
__unused
=
{
[
STM32MP1_SHRES_GPIOZ
(
0
)]
=
"GPIOZ0"
,
[
STM32MP1_SHRES_GPIOZ
(
1
)]
=
"GPIOZ1"
,
[
STM32MP1_SHRES_GPIOZ
(
2
)]
=
"GPIOZ2"
,
[
STM32MP1_SHRES_GPIOZ
(
3
)]
=
"GPIOZ3"
,
[
STM32MP1_SHRES_GPIOZ
(
4
)]
=
"GPIOZ4"
,
[
STM32MP1_SHRES_GPIOZ
(
5
)]
=
"GPIOZ5"
,
[
STM32MP1_SHRES_GPIOZ
(
6
)]
=
"GPIOZ6"
,
[
STM32MP1_SHRES_GPIOZ
(
7
)]
=
"GPIOZ7"
,
[
STM32MP1_SHRES_IWDG1
]
=
"IWDG1"
,
[
STM32MP1_SHRES_USART1
]
=
"USART1"
,
[
STM32MP1_SHRES_SPI6
]
=
"SPI6"
,
[
STM32MP1_SHRES_I2C4
]
=
"I2C4"
,
[
STM32MP1_SHRES_RNG1
]
=
"RNG1"
,
[
STM32MP1_SHRES_HASH1
]
=
"HASH1"
,
[
STM32MP1_SHRES_CRYP1
]
=
"CRYP1"
,
[
STM32MP1_SHRES_I2C6
]
=
"I2C6"
,
[
STM32MP1_SHRES_RTC
]
=
"RTC"
,
[
STM32MP1_SHRES_MCU
]
=
"MCU"
,
[
STM32MP1_SHRES_MDMA
]
=
"MDMA"
,
[
STM32MP1_SHRES_PLL3
]
=
"PLL3"
,
};
static
const
char
__unused
*
shres2str_id
(
enum
stm32mp_shres
id
)
{
assert
(
id
<
ARRAY_SIZE
(
shres2str_id_tbl
));
return
shres2str_id_tbl
[
id
];
}
static
const
char
__unused
*
shres2str_state_tbl
[]
=
{
[
SHRES_UNREGISTERED
]
=
"unregistered"
,
[
SHRES_NON_SECURE
]
=
"non-secure"
,
[
SHRES_SECURE
]
=
"secure"
,
};
static
const
char
__unused
*
shres2str_state
(
unsigned
int
state
)
{
assert
(
state
<
ARRAY_SIZE
(
shres2str_state_tbl
));
return
shres2str_state_tbl
[
state
];
}
/* Get resource state: these accesses lock the registering support */
/* Get resource state: these accesses lock the registering support */
static
void
lock_registering
(
void
)
static
void
lock_registering
(
void
)
{
{
...
@@ -170,10 +213,10 @@ static void check_rcc_secure_configuration(void)
...
@@ -170,10 +213,10 @@ static void check_rcc_secure_configuration(void)
}
}
if
(
!
secure
||
(
mckprot_protects_periph
(
n
)
&&
(
!
mckprot
)))
{
if
(
!
secure
||
(
mckprot_protects_periph
(
n
)
&&
(
!
mckprot
)))
{
ERROR
(
"RCC %s MCKPROT %s and %
u
secure
\n
"
,
ERROR
(
"RCC %s MCKPROT %s and %
s
secure
\n
"
,
secure
?
"secure"
:
"non-secure"
,
secure
?
"secure"
:
"non-secure"
,
mckprot
?
"set"
:
"not set"
,
mckprot
?
"set"
:
"not set"
,
n
);
shres2str_id
(
n
)
);
error
++
;
error
++
;
}
}
}
}
...
@@ -201,14 +244,14 @@ static void print_shared_resources_state(void)
...
@@ -201,14 +244,14 @@ static void print_shared_resources_state(void)
for
(
id
=
0U
;
id
<
STM32MP1_SHRES_COUNT
;
id
++
)
{
for
(
id
=
0U
;
id
<
STM32MP1_SHRES_COUNT
;
id
++
)
{
switch
(
shres_state
[
id
])
{
switch
(
shres_state
[
id
])
{
case
SHRES_SECURE
:
case
SHRES_SECURE
:
INFO
(
"stm32mp1 %
u
is secure
\n
"
,
id
);
INFO
(
"stm32mp1 %
s
is secure
\n
"
,
shres2str_id
(
id
)
);
break
;
break
;
case
SHRES_NON_SECURE
:
case
SHRES_NON_SECURE
:
case
SHRES_UNREGISTERED
:
case
SHRES_UNREGISTERED
:
VERBOSE
(
"stm32mp %
u
is non-secure
\n
"
,
id
);
VERBOSE
(
"stm32mp %
s
is non-secure
\n
"
,
shres2str_id
(
id
)
);
break
;
break
;
default:
default:
VERBOSE
(
"stm32mp %
u
is invalid
\n
"
,
id
);
VERBOSE
(
"stm32mp %
s
is invalid
\n
"
,
shres2str_id
(
id
)
);
panic
();
panic
();
}
}
}
}
...
...
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