diff options
author | Yatharth Kochar <yatharth.kochar@arm.com> | 2015-11-26 14:33:10 +0000 |
---|---|---|
committer | Yatharth Kochar <yatharth.kochar@arm.com> | 2015-12-09 14:53:01 +0000 |
commit | 145ecbcac924dad707abb705b40f92565aa90301 (patch) | |
tree | 8404026dbc448d0494e707e6f984b1ec3203d014 /lib | |
parent | 767ee6e466f1a7ef3138499cd90b221d1c87b1f2 (diff) |
Add volatile qualifier to read the mpidr in mp_printf()
As part of testing Firmware Update feature on A57 CPU, an issue
was discovered while printing in NS_BL1U stage. The issue appears
when the second call to `NOTICE()` is made in the `ns_bl1u_main()`.
As a result of this issue the CPU hangs and the debugger is also
not able to connect anymore.
After further debugging and experiments it was found that if
`read_mpidr_el1()`, called in mp_printf(), is avoided or volatile
qualifier is used for reading the mpidr, this issue gets resolved.
This patch adds the volatile qualifier to read the mpidr in the
`mp_printf` function.
NOTE: THE ACTUAL REASON WHY THIS HAPPENS IS UN-KNOWN.
THIS ISSUE IS NOT ENCOUNTERED ON A53 CPU.
Change-Id: If0ffa43dda3df3f7a428a2a9f9fb4ec199583378
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/mp_printf.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/utils/mp_printf.c b/lib/utils/mp_printf.c index a838fc6..d66ecb9 100644 --- a/lib/utils/mp_printf.c +++ b/lib/utils/mp_printf.c @@ -61,7 +61,20 @@ void mp_printf(const char *fmt, ...) { va_list ap; char str[256]; - unsigned int mpid = read_mpidr_el1() & 0xFFFF; + /* + * As part of testing Firmware Update feature on A57 CPU, an issue + * was discovered while printing in NS_BL1U stage. The issue appears + * when the second call to `NOTICE()` is made in the `ns_bl1u_main()`. + * As a result of this issue the CPU hangs and the debugger is also + * not able to connect anymore. + * After further debugging and experiments it was found that if + * `read_mpidr_el1()` is avoided or volatile qualifier is used for + * reading the mpidr, this issue gets resolved(GENFW-1254). + * + * NOTE: The actual/real reason why this happens is still not known. + * Moreover this problem is not encountered on A53 CPU. + */ + volatile unsigned int mpid = read_mpidr_el1() & 0xFFFF; /* * TODO: It would be simpler to use vprintf() instead of |