From patchwork Tue May 7 08:42:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 795200 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:34e:ceec:bfcd with SMTP id k28csp186201wrc; Tue, 7 May 2024 01:43:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUenYgo+t8+DK6yECS45JkAJoateOfTm0LmBoTXKGUhuVm5DgEVGX1m5+xuYYDE9EmNd5ciw89vRzbpEtRQNSV6 X-Google-Smtp-Source: AGHT+IEpZcJsc6wHn+K/ucClFRBUjtxVbeRbNMAquSRpwIckYgNSFGzLLyTwYTKWe6fN7TGkyeST X-Received: by 2002:a05:6102:310f:b0:47e:5c30:d794 with SMTP id e15-20020a056102310f00b0047e5c30d794mr9459407vsh.21.1715071437247; Tue, 07 May 2024 01:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715071437; cv=none; d=google.com; s=arc-20160816; b=AucEVQ9coQOOZ8Bxp33D2vz2h7Jz47ACBhuOK8Pz5O+AVFKAEGJ2Jk7OU2kO1xJ9HE 6TBEGW4QCRLBybPL7yNppWztyphuFZkvn6QJl+n9OpDvaRdlRuhmdCI2eTq3lQ6ZLeL7 dM7ZBRXzDJgdoa8AbUmsnV4bmwLOZ5VbkMZl1QHeppYKbT+9bEMyUffwaOhnGsBImgKn 1LP8A/r99xvs1eeHVGLrpxUCP7d9sHpm2XcvRiPSIiy1zfWyK6MvSScOyu+JIYRlMPdJ 8Dc3LVUk0NF5bDVwXtYdsY+Jd0toCjtC6VsR92c/V8MEpUNL02eyuf5vWAwNe8HrE0yd 39Tw== 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=pJtsv+8WFCg5AF22H8fNkSU8xabNK2gSlnCFnOrt9tI=; fh=lOWSN9Ni0psEIzC0ByUFR6YuWdr94TcsP69K5+Ed8Vs=; b=KUbAA4P4pUO5sY/bGYpYtFqJhQgLT0hi6IwYviHeWC8yPD8Ja3/rOctDSJsXUbgbFa bIPXaogrlbBn5a8DuQ6XpVq91CImOqur2CBkrUgHieP9zKSIIFrHaMN4t2iyFSQgOhx/ 3LFOXHL7sRJUto2u3Zpm5AC2wRh+95it2ha5zvp4k+hr25LL7mTcNaGO6moBFRjchZPm yqtEzHW6w1rM8BbJzDvw4SsXjlXd9piEKt0XnNR+6PQcvLifV+wsp2QY7h97sIJ/Bm0/ +5uOBJSyBmC0R5yypS9z3IU+Utlln8anMSpc8nXbmuL/VkVP77AF8qMOm4CNozcXyHFR tI5g==; 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 im15-20020a056214246f00b006a0d6fbdcdfsi11072352qvb.403.2024.05.07.01.43.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 May 2024 01:43:57 -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 1s4GQQ-0004ix-Gk; Tue, 07 May 2024 04:43:50 -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 1s4GQA-0004SO-02; Tue, 07 May 2024 04:43:38 -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 1s4GQ8-0003HC-36; Tue, 07 May 2024 04:43:33 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 6940F64BD2; Tue, 7 May 2024 11:42:49 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 58039C85BB; Tue, 7 May 2024 11:42:30 +0300 (MSK) Received: (nullmailer pid 1026555 invoked by uid 1000); Tue, 07 May 2024 08:42:29 -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-8.2.4 14/16] hw/arm/npcm7xx: Store derivative OTP fuse key in little endian Date: Tue, 7 May 2024 11:42:13 +0300 Message-Id: <20240507084226.1026455-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 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 15ff21d047..8753812c37 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" @@ -377,7 +378,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)); }