RISC-V fix for CPU init

-----BEGIN PGP SIGNATURE-----
 
 iQFFBAABCgAvFiEEslwAIq+Gp8wWVbYnfxc6PpAIreYFAmTkyHERHHNqZ0BjaHJv
 bWl1bS5vcmcACgkQfxc6PpAIreaB7Qf/YCEmW0k8uJ2uyE76OAurz6Q675kwO2z7
 o/xpo7NZPKhBby6HCf6RpIVVfPzH8/TyMqI55o1QV4877mRMsDIqGBGkhILmUJ7Q
 FYgikaGew9epU5zkgUW2bXIHqhQusHzvsGzDeyUIyuvwgkIkmq1u0+2GzGFB/CJC
 Hxd9BdLr1b675Frlc71fAVWYI56rE47tR+BY0uBVltvSm8/SBPITO4fEWLxX+TnN
 SUTflo60AjiE1CTEY9MCKEo4oa7nFuYq67l0zJRLjdEyaFqYdy5FpzxkYM/B2K8t
 b4aqv8sR3RVKectdauj1wo9bJY8JwWz+ne6sYnzdve7xa5ECoECG2Q==
 =D2ur
 -----END PGP SIGNATURE-----

Merge tag 'dm-pull-22aug23' of https://source.denx.de/u-boot/custodians/u-boot-dm

RISC-V fix for CPU init
This commit is contained in:
Tom Rini 2023-08-22 15:52:58 -04:00
commit 58144e2839
4 changed files with 9 additions and 10 deletions

View file

@ -66,7 +66,7 @@ static inline bool supports_extension(char ext)
#endif /* CONFIG_CPU */
}
static int riscv_cpu_probe(void)
static int riscv_cpu_probe(void *ctx, struct event *event)
{
#ifdef CONFIG_CPU
int ret;
@ -79,6 +79,7 @@ static int riscv_cpu_probe(void)
return 0;
}
EVENT_SPY(EVT_DM_POST_INIT_R, riscv_cpu_probe);
/*
* This is called on secondary harts just after the IPI is init'd. Currently
@ -95,7 +96,7 @@ int riscv_cpu_setup(void *ctx, struct event *event)
{
int ret;
ret = riscv_cpu_probe();
ret = riscv_cpu_probe(ctx, event);
if (ret)
return ret;
@ -149,12 +150,6 @@ EVENT_SPY(EVT_DM_POST_INIT_F, riscv_cpu_setup);
int arch_early_init_r(void)
{
int ret;
ret = riscv_cpu_probe();
if (ret)
return ret;
if (IS_ENABLED(CONFIG_SYSRESET_SBI))
device_bind_driver(gd->dm_root, "sbi-sysreset",
"sbi-sysreset", NULL);

View file

@ -28,6 +28,7 @@ const char *const type_name[] = {
/* Events related to driver model */
"dm_post_init_f",
"dm_post_init_r",
"dm_pre_probe",
"dm_post_probe",
"dm_pre_remove",

View file

@ -436,8 +436,10 @@ int dm_init_and_scan(bool pre_reloc_only)
return ret;
}
}
if (CONFIG_IS_ENABLED(DM_EVENT) && !(gd->flags & GD_FLG_RELOC)) {
ret = event_notify_null(EVT_DM_POST_INIT_F);
if (CONFIG_IS_ENABLED(DM_EVENT)) {
ret = event_notify_null(gd->flags & GD_FLG_RELOC ?
EVT_DM_POST_INIT_R :
EVT_DM_POST_INIT_F);
if (ret)
return log_msg_ret("ev", ret);
}

View file

@ -24,6 +24,7 @@ enum event_t {
/* Events related to driver model */
EVT_DM_POST_INIT_F,
EVT_DM_POST_INIT_R,
EVT_DM_PRE_PROBE,
EVT_DM_POST_PROBE,
EVT_DM_PRE_REMOVE,