mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 06:31:31 +00:00
arm: stm32mp: spl: add bsec driver in SPL
Add the bsec driver in SPL, as it is needed by SOC part number detection to found the supported OPP. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
This commit is contained in:
parent
a718a5d0f4
commit
95bd49a5aa
3 changed files with 8 additions and 7 deletions
|
@ -65,7 +65,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
&bsec {
|
&bsec {
|
||||||
u-boot,dm-pre-proper;
|
u-boot,dm-pre-reloc;
|
||||||
};
|
};
|
||||||
|
|
||||||
&clk_csi {
|
&clk_csi {
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
obj-y += cpu.o
|
obj-y += cpu.o
|
||||||
obj-y += dram_init.o
|
obj-y += dram_init.o
|
||||||
obj-y += syscon.o
|
obj-y += syscon.o
|
||||||
|
obj-y += bsec.o
|
||||||
|
|
||||||
ifdef CONFIG_SPL_BUILD
|
ifdef CONFIG_SPL_BUILD
|
||||||
obj-y += spl.o
|
obj-y += spl.o
|
||||||
else
|
else
|
||||||
obj-$(CONFIG_CMD_STM32PROG) += cmd_stm32prog/
|
obj-$(CONFIG_CMD_STM32PROG) += cmd_stm32prog/
|
||||||
obj-y += bsec.o
|
|
||||||
obj-$(CONFIG_CMD_STM32KEY) += cmd_stm32key.o
|
obj-$(CONFIG_CMD_STM32KEY) += cmd_stm32key.o
|
||||||
obj-$(CONFIG_ARMV7_PSCI) += psci.o
|
obj-$(CONFIG_ARMV7_PSCI) += psci.o
|
||||||
obj-$(CONFIG_TFABOOT) += boot_params.o
|
obj-$(CONFIG_TFABOOT) += boot_params.o
|
||||||
|
|
|
@ -474,20 +474,23 @@ static int stm32mp_bsec_ofdata_to_platdata(struct udevice *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_TFABOOT
|
|
||||||
static int stm32mp_bsec_probe(struct udevice *dev)
|
static int stm32mp_bsec_probe(struct udevice *dev)
|
||||||
{
|
{
|
||||||
|
#if !defined(CONFIG_TFABOOT) && !defined(CONFIG_SPL_BUILD)
|
||||||
int otp;
|
int otp;
|
||||||
struct stm32mp_bsec_platdata *plat = dev_get_platdata(dev);
|
struct stm32mp_bsec_platdata *plat = dev_get_platdata(dev);
|
||||||
|
|
||||||
/* update unlocked shadow for OTP cleared by the rom code */
|
/*
|
||||||
|
* update unlocked shadow for OTP cleared by the rom code
|
||||||
|
* only executed in U-Boot proper when TF-A is not used
|
||||||
|
*/
|
||||||
for (otp = 57; otp <= BSEC_OTP_MAX_VALUE; otp++)
|
for (otp = 57; otp <= BSEC_OTP_MAX_VALUE; otp++)
|
||||||
if (!bsec_read_SR_lock(plat->base, otp))
|
if (!bsec_read_SR_lock(plat->base, otp))
|
||||||
bsec_shadow_register(plat->base, otp);
|
bsec_shadow_register(plat->base, otp);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static const struct udevice_id stm32mp_bsec_ids[] = {
|
static const struct udevice_id stm32mp_bsec_ids[] = {
|
||||||
{ .compatible = "st,stm32mp15-bsec" },
|
{ .compatible = "st,stm32mp15-bsec" },
|
||||||
|
@ -501,7 +504,5 @@ U_BOOT_DRIVER(stm32mp_bsec) = {
|
||||||
.ofdata_to_platdata = stm32mp_bsec_ofdata_to_platdata,
|
.ofdata_to_platdata = stm32mp_bsec_ofdata_to_platdata,
|
||||||
.platdata_auto_alloc_size = sizeof(struct stm32mp_bsec_platdata),
|
.platdata_auto_alloc_size = sizeof(struct stm32mp_bsec_platdata),
|
||||||
.ops = &stm32mp_bsec_ops,
|
.ops = &stm32mp_bsec_ops,
|
||||||
#ifndef CONFIG_TFABOOT
|
|
||||||
.probe = stm32mp_bsec_probe,
|
.probe = stm32mp_bsec_probe,
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue