From patchwork Mon May 27 06:40:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 799212 Delivered-To: patch@linaro.org Received: by 2002:a5d:6a47:0:b0:354:fb4b:99cd with SMTP id t7csp1732665wrw; Sun, 26 May 2024 23:45:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVBDt2O2serl1J3GN+iAEsajxUcDPm2yTURmRw0hBEW2pnNi11/X3EpSyZEA18fXjpYE24T0/Btd568osrOfQsq X-Google-Smtp-Source: AGHT+IGBOnURpSGemjLJT8pwaUHEcRC9Mr2WnwZJK3mKI0Tg08VEUjET4sIuZQJlLSGaOUTenDx3 X-Received: by 2002:a05:622a:1a90:b0:43d:e035:669b with SMTP id d75a77b69052e-43fb0e709afmr106842331cf.43.1716792336495; Sun, 26 May 2024 23:45:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716792336; cv=none; d=google.com; s=arc-20160816; b=iUX9CwHFQz95EkpVwqZb+7g4JJI5WGTNOIbksuqLTMCbiKVHPCcICoNdcYI2cDIXER LhZqAAbGgHBBI3AT4sjzdzQtb8Nu5h/1DnYY0Lh4fhV/0FMyqbFBCCvmwGC2edHodE+5 Vadrvqep17Q13jyI0wHa1aXvkJV/6Ouk62q2d2QDq6gv6vSEjTcXZ6Jey2inXJYdAVk5 yxXNQ/Pjp0lGkp196MOjhjvmSaCsuIooNPfXbybrwMN/X6sziO2YFtkiYSQcWYLSNa2k II5AP3AS0y0Tfx+WiPuZ3+jVdDZ9qx4AC8Np8MSniD9OQ+CjOKNzyQec1WhXx59rmdSJ XqaQ== 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=kIZOTuHG/kN0kVjWArkAlrz0dD0lFqeQLYeC+Er9Pto=; fh=lOWSN9Ni0psEIzC0ByUFR6YuWdr94TcsP69K5+Ed8Vs=; b=bzNXCu1JPMeFPAe5orJyhRYdx2m/u9aqMHeOVaBcq5zLnzuevV8PY7NkWQLfsD1cEz ik7SBl5VOJQB5/8XN5A9w0Nc5vIbcO0LomVjHaeEgqDRpTAcdP2ecOVa7DDWsQ7STnyA TNjKPgLGwUaHT7/ydx+TTKFRn2nNte/bExJa5Zr8WZh02e8AAwviiugIa2OJ73C+HhLt Q38ai4eC/LTg/vRzgket/wMBf87e9b50M1l2i0PPr3kUEIcHa4UaZ105mR2Gf6rvjXAK 0zm5nJzybCSwnKndT5QI/+aIThkXrCNL/nB8fKz0EKr9+R8VlfCS/OnpZ+Db1mJthss1 zRog==; 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 d75a77b69052e-43fb18c9f5esi72703621cf.635.2024.05.26.23.45.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 May 2024 23:45:36 -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 1sBU3N-0003Nk-0O; Mon, 27 May 2024 02:41:53 -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 1sBU36-0003E0-O0; Mon, 27 May 2024 02:41:36 -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 1sBU35-0007O5-42; Mon, 27 May 2024 02:41:36 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 0A7126A3F8; Mon, 27 May 2024 09:41:31 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 55609D83F0; Mon, 27 May 2024 09:40:57 +0300 (MSK) Received: (nullmailer pid 50288 invoked by uid 1000); Mon, 27 May 2024 06:40:56 -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-7.2.12 10/19] hw/arm/npcm7xx: Store derivative OTP fuse key in little endian Date: Mon, 27 May 2024 09:40:41 +0300 Message-Id: <20240527064056.50205-10-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 d85cc02765..13d0b8bbb2 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)); }