You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2022/06/09 12:36:43 UTC
[incubator-nuttx] branch master updated: arch/risc-v/src/mpfs/mpfs_start.c: Don't boot if DDR is enabled and training fails
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new b7a1b75a3b arch/risc-v/src/mpfs/mpfs_start.c: Don't boot if DDR is enabled and training fails
b7a1b75a3b is described below
commit b7a1b75a3ba86cea3788667df84f8cfb47317987
Author: Jukka Laitinen <ju...@ssrc.tii.ae>
AuthorDate: Wed Jun 8 14:47:48 2022 +0400
arch/risc-v/src/mpfs/mpfs_start.c: Don't boot if DDR is enabled and training fails
Output "X" with showprogress and make a system reset.
Silently ignoring failed training is dangerous and will cause random behaviour if DDR is used
Signed-off-by: Jukka Laitinen <ju...@ssrc.tii.ae>
---
arch/risc-v/src/mpfs/mpfs_start.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/arch/risc-v/src/mpfs/mpfs_start.c b/arch/risc-v/src/mpfs/mpfs_start.c
index cf73953451..f637e1a4f7 100755
--- a/arch/risc-v/src/mpfs/mpfs_start.c
+++ b/arch/risc-v/src/mpfs/mpfs_start.c
@@ -167,7 +167,19 @@ void __mpfs_start(uint64_t mhartid)
#endif
#ifdef CONFIG_MPFS_DDR_INIT
- mpfs_ddr_init();
+ if (mpfs_ddr_init() != 0)
+ {
+ /* We don't allow booting, ddr training failure will cause random
+ * behaviour
+ */
+
+ showprogress('X');
+
+ /* Reset, but let the progress come out of the uart first */
+
+ up_udelay(1000);
+ up_systemreset();
+ }
#endif
showprogress('B');