diff mbox series

hw/arm/npcm7xx: Store derivative OTP fuse key in little endian

Message ID 20240422125813.1403-1-philmd@linaro.org
State Superseded
Headers show
Series hw/arm/npcm7xx: Store derivative OTP fuse key in little endian | expand

Commit Message

Philippe Mathieu-Daudé April 22, 2024, 12:58 p.m. UTC
Use little endian for derivative OTP fuse key.

Cc: qemu-stable@nongnu.org
Fixes: c752bb079b ("hw/nvram: NPCM7xx OTP device model")
Suggested-by: Avi Fishman <Avi.Fishman@nuvoton.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/arm/npcm7xx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Peter Maydell April 30, 2024, 2:47 p.m. UTC | #1
On Mon, 22 Apr 2024 at 13:58, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Use little endian for derivative OTP fuse key.
>
> Cc: qemu-stable@nongnu.org
> Fixes: c752bb079b ("hw/nvram: NPCM7xx OTP device model")
> Suggested-by: Avi Fishman <Avi.Fishman@nuvoton.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>



Applied to target-arm.next, thanks.

-- PMM
diff mbox series

Patch

diff --git a/hw/arm/npcm7xx.c b/hw/arm/npcm7xx.c
index cc68b5d8f1..9f2d96c733 100644
--- a/hw/arm/npcm7xx.c
+++ b/hw/arm/npcm7xx.c
@@ -24,6 +24,7 @@ 
 #include "hw/qdev-clock.h"
 #include "hw/qdev-properties.h"
 #include "qapi/error.h"
+#include "qemu/bswap.h"
 #include "qemu/units.h"
 #include "sysemu/sysemu.h"
 #include "target/arm/cpu-qom.h"
@@ -386,7 +387,7 @@  static void npcm7xx_init_fuses(NPCM7xxState *s)
      * The initial mask of disabled modules indicates the chip derivative (e.g.
      * NPCM750 or NPCM730).
      */
-    value = tswap32(nc->disabled_modules);
+    value = cpu_to_le32(nc->disabled_modules);
     npcm7xx_otp_array_write(&s->fuse_array, &value, NPCM7XX_FUSE_DERIVATIVE,
                             sizeof(value));
 }