diff mbox series

[PATCH-for-8.0,3/7] hw/mips/bootloader: Implement nanoMIPS NOP opcode

Message ID 20221210155502.74609-4-philmd@linaro.org (mailing list archive)
State New, archived
Headers show
Series hw/mips/malta: Generate nanoMIPS bootloader with bootloader generator API | expand

Commit Message

Philippe Mathieu-Daudé Dec. 10, 2022, 3:54 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/mips/bootloader.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Richard Henderson Dec. 11, 2022, 4:19 p.m. UTC | #1
On 12/10/22 09:54, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/mips/bootloader.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

> 
> diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c
> index 3a4573118c..7f7d938f2e 100644
> --- a/hw/mips/bootloader.c
> +++ b/hw/mips/bootloader.c
> @@ -59,7 +59,11 @@ static void bl_gen_nop(void **ptr)
>   {
>       uint32_t *p = (uint32_t *)*ptr;
>   
> -    stl_p(p, 0);
> +    if (bootcpu_supports_isa(ISA_NANOMIPS32)) {
> +        stl_p(p, 0x8000c000);
> +    } else {
> +        stl_p(p, 0);
> +    }
>       p++;
>       *ptr = p;
>   }
diff mbox series

Patch

diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c
index 3a4573118c..7f7d938f2e 100644
--- a/hw/mips/bootloader.c
+++ b/hw/mips/bootloader.c
@@ -59,7 +59,11 @@  static void bl_gen_nop(void **ptr)
 {
     uint32_t *p = (uint32_t *)*ptr;
 
-    stl_p(p, 0);
+    if (bootcpu_supports_isa(ISA_NANOMIPS32)) {
+        stl_p(p, 0x8000c000);
+    } else {
+        stl_p(p, 0);
+    }
     p++;
     *ptr = p;
 }