From: Philippe Mathieu-Daudé Date: Mon, 22 Apr 2024 12:58:12 +0000 (+0200) Subject: hw/arm/npcm7xx: Store derivative OTP fuse key in little endian X-Git-Tag: v7.2.12~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e3e5138d60e8d43a8554e9b1728163f87569e1a;p=thirdparty%2Fqemu.git hw/arm/npcm7xx: Store derivative OTP fuse key in little endian 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 Signed-off-by: Philippe Mathieu-Daudé Message-id: 20240422125813.1403-1-philmd@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit eb656a60fd93262b1e519b3162888bf261df7f68) Signed-off-by: Michael Tokarev --- diff --git a/hw/arm/npcm7xx.c b/hw/arm/npcm7xx.c index d85cc027651..13d0b8bbb21 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" @@ -369,7 +370,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)); }