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
f4d5b6a7
Commit
f4d5b6a7
authored
Jul 16, 2020
by
Madhukar Pappireddy
Committed by
TrustedFirmware Code Review
Jul 16, 2020
Browse files
Merge "drivers/stm32mp_pmic: register PMIC resources as secure or not" into integration
parents
88b88228
f564d439
Changes
1
Hide whitespace changes
Inline
Side-by-side
drivers/st/pmic/stm32mp_pmic.c
View file @
f4d5b6a7
...
...
@@ -54,6 +54,15 @@ int dt_pmic_status(void)
return
fdt_get_status
(
node
);
}
static
bool
dt_pmic_is_secure
(
void
)
{
int
status
=
dt_pmic_status
();
return
(
status
>=
0
)
&&
(
status
==
DT_SECURE
)
&&
(
i2c_handle
.
dt_status
==
DT_SECURE
);
}
/*
* Get PMIC and its I2C bus configuration from the device tree.
* Return 0 on success, negative on error, 1 if no PMIC node is found.
...
...
@@ -223,6 +232,19 @@ bool initialize_pmic_i2c(void)
return
true
;
}
static
void
register_pmic_shared_peripherals
(
void
)
{
uintptr_t
i2c_base
=
i2c_handle
.
i2c_base_addr
;
if
(
dt_pmic_is_secure
())
{
stm32mp_register_secure_periph_iomem
(
i2c_base
);
}
else
{
if
(
i2c_base
!=
0U
)
{
stm32mp_register_non_secure_periph_iomem
(
i2c_base
);
}
}
}
void
initialize_pmic
(
void
)
{
unsigned
long
pmic_version
;
...
...
@@ -232,6 +254,8 @@ void initialize_pmic(void)
return
;
}
register_pmic_shared_peripherals
();
if
(
stpmic1_get_version
(
&
pmic_version
)
!=
0
)
{
ERROR
(
"Failed to access PMIC
\n
"
);
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