From patchwork Mon May 27 08:21:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 799218 Delivered-To: patch@linaro.org Received: by 2002:a5d:6a47:0:b0:354:fb4b:99cd with SMTP id t7csp1760590wrw; Mon, 27 May 2024 01:23:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVRmm2+FHDzYfCnQNGl+KQhlzURJfZPrezxpfLNoz1mb+EUBEXrKKk33jBKFYoNYnGFW/BhJXpGbg9TjGQr+2UN X-Google-Smtp-Source: AGHT+IE9SAuaQMlXRkHf6wJ9MCHWrTN5T5Zs7AYIuJYmkV+5WyScQ5IMlEA2VNmH/fmYaQkwcqmI X-Received: by 2002:a81:9293:0:b0:627:7e65:979 with SMTP id 00721157ae682-62a08da8e35mr85981647b3.24.1716798228613; Mon, 27 May 2024 01:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716798228; cv=none; d=google.com; s=arc-20160816; b=S/eqdkyylxBxejisSWaUuU2BN7DxtgP3GHYRqrbjipbJjKLIiCVw8qixDzedhPCy8e +j7GD9ZntM8sIh3npGcCH18cQ+UhkAdLP8uAqLvRcN+54jZialO/v6yuJRCHXG3bCv+J JQbVFyKiimvNmo3Pa65CeTpx2Zhr8HBdBExbMm1mSpWhlvjxSCWAoKbXLQNer/BjB4mx /NU5lRj5gfvyTO0r0lpbmY7h3zTNY+QW728aI6zREtg4TlebS3g3u/drUDLlojt6rpgj 5E9yc0jFV6bpSBvTxcn7Cht3MzlFS7/o5tcAe4agPXkljHDWXwxIo2lZgSIdYWPFd7BK Qs4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=aP0KA9YgCSLCOer0Oj30iG5/IVawZbebVZUkyFAHSL0=; fh=lOWSN9Ni0psEIzC0ByUFR6YuWdr94TcsP69K5+Ed8Vs=; b=QmqNdsz9J6yn9qRtu7BBWapIClePLlt0EZCfMzwUh1DKSTlKx8pgMev1/jSCXHRNtK riZHF4sNGdTQGHRoTTS+bl7T2ICLpPEUua2P56vK2rtYKDT8b9MvZEfyw8P9jdJLZzu9 AH6BymYXIsNKc71904RGhhla+B9LYDVo1FfbHqpN7WUR+imFPFriAlU4qTlhjC/R2iT4 aJvT2qOT9jhuQOYeQnwXwWcyELWmotbzETrVeTG+8kiWOgggciQiAqM3FIlNPE8SRWrI 9ZPq02/24GsmkV6hJ147TrvWtE9w/9SrvrxIEcRF4vdQ1du0zcVtZq9i7i7y/NvQcnxF 8g5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6ad759d396dsi40172756d6.143.2024.05.27.01.23.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 May 2024 01:23:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBVdk-0001dL-HK; Mon, 27 May 2024 04:23:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBVcl-00018j-CF; Mon, 27 May 2024 04:22:33 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBVcj-0000pm-HY; Mon, 27 May 2024 04:22:30 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 8320A6A56B; Mon, 27 May 2024 11:22:13 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id AEE11D8508; Mon, 27 May 2024 11:21:39 +0300 (MSK) Received: (nullmailer pid 66393 invoked by uid 1000); Mon, 27 May 2024 08:21:38 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Avi Fishman , Peter Maydell , Michael Tokarev Subject: [Stable-9.0.1 14/44] hw/arm/npcm7xx: Store derivative OTP fuse key in little endian Date: Mon, 27 May 2024 11:21:05 +0300 Message-Id: <20240527082138.66217-14-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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 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)); }