hw/arm/npcm7xx: Store derivative OTP fuse key in little endian
PATCH 1/1 hw/arm/npcm7xx: Store derivative OTP fuse key in little endian
Use little endian for derivative OTP fuse key.
Fixes c752bb079b ("hw/nvram: NPCM7xx OTP device model")
Suggested-by Avi Fishman <[email protected]>
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
--- hw/arm/npcm7xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/arm/npcm7xx.c +2 -1
@@ -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)); }
Signature · 1 line
2.41.0
Peter Maydell
AppliedQuoted 7 lines · Philippe Mathieu-Daudé
Use little endian for derivative OTP fuse key.
Fixes c752bb079b ("hw/nvram: NPCM7xx OTP device model")Suggested-by Avi Fishman <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Applied to target-arm.next, thanks.
-- PMM