From patchwork Tue Apr 30 16:48:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 793342 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:54f:b0:34d:5089:5a9e with SMTP id b15csp366009wrf; Tue, 30 Apr 2024 09:50:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVlMOcEDTdoSMQNnXmo1VCs42x/T/jPxhtf4/nmY4dz3WRpLJ+Nj8r0dWCccNonO34aByaaM8sbvx4qK7P9neNC X-Google-Smtp-Source: AGHT+IF6OWTa9SV7jZh3/WcWqlVC7KGonQqoNAyHWrgC6Op3pbuTtguPwgSkEH9Z0z+EjZc7Ft7U X-Received: by 2002:ad4:4eee:0:b0:6a0:cb66:4596 with SMTP id dv14-20020ad44eee000000b006a0cb664596mr9248400qvb.38.1714495819543; Tue, 30 Apr 2024 09:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714495819; cv=none; d=google.com; s=arc-20160816; b=tWTILK979QZJDK4vJrpXOdKPvWtlAC+E9UdZ9VZ+w3ZaR00p7V9K3CbL8NJM/vvpqe 0jnWVZwEXp6oRz+h8Z5L4pTmviiAeVN1ZDY5fydOxfJWm1630kG4A5HoiJW3ncl7cier ZqPq4rUr9GSdD6ctjiDwtKCL6KIfVbU+02MDmgFJLOQMKWBrApKCBtAO/Lv0GDcwEDvB Lc6yzO0tPxnmZuUvCFeem4AzZAMklFUytTSQhTHBxTOY1LrT5QdB4TDT6xNjWGDp/PmV eeG/IcG5S0jkPbNIgP3koW/eLWmfrxS9pEv5ussugn1H0ch2BKrshpItgXo0a5sMb9tS tnzg== 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:to:from :dkim-signature; bh=VFare7ZkADygwn6ondDR3tguZCHt/fs/mvSL2SvbhYg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=y2Gr6jRwSBmHi4/VktqW7G9Czuuq0wwgCR7Oc5YmMZL6w733c4ycDwC68NdxMFkyQj xIJYZVssmv6zjiMw5HNTnGISQXQAykTGZILfFXaDi8Qv/6jjJBRsr7henH30AFX/EwPS cltKgzvrFkwn2o5FJe+/xXkk4DqsA7diJw8PqikgYqcHztlJb18DqioLa90wOsO2guEl jh4AoP71VN3nIe60ukAlkw0bEi1deMRMDwMRzp1N0SfAg3wAWa8ApvX2JaszUZRv7AYX imbu8SaRLYXts0rZ0leGcldVUKvdUPd6ewE2/npJib/6ZTnB9aJH+z3PMIuPP+dxZaHA 236Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hIIZsEgU; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d5-20020a05621421c500b006a0d5ac9e73si3470348qvh.123.2024.04.30.09.50.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Apr 2024 09:50:19 -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; dkim=pass header.i=@linaro.org header.s=google header.b=hIIZsEgU; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1qfR-00031a-O7; Tue, 30 Apr 2024 12:49:21 -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 1s1qf5-0002Qd-8G for qemu-devel@nongnu.org; Tue, 30 Apr 2024 12:48:59 -0400 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1qf1-0005dZ-KX for qemu-devel@nongnu.org; Tue, 30 Apr 2024 12:48:58 -0400 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2df83058d48so47134681fa.1 for ; Tue, 30 Apr 2024 09:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714495734; x=1715100534; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=VFare7ZkADygwn6ondDR3tguZCHt/fs/mvSL2SvbhYg=; b=hIIZsEgU28+fVLj/0LHsLmEKIAxvyYKrIgyKkkv+dpsD509bU0sXvHiYz6t89MeFtC jUsPMqA+wRRRv9M1Fzru/ixU9CSSsLhw/xNJxRfX2n3PZ0RdE/+b+e4zBBVUPQZmx57z yKW4pVuZABIpd2Mnji7zdfPenUWbgUCbMvuMG1/lBTdaZjbQXFvoAuFyixbrchcwq99d x5my6UkLCN64FKZZVvbRV5JA1Fsl+Hh6myAU5kWcqHvncPRybnQ+EM3wcYM1ggWZ+vlp MINYO6j1rCG2RfCI824eFyg3qqcz0KIIloKEEv8Md1ZK9DqPPQQbGZ5YFP5OenjWXIYr 90eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714495734; x=1715100534; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VFare7ZkADygwn6ondDR3tguZCHt/fs/mvSL2SvbhYg=; b=sPHr9CcCs/pt42lK+eRI58Y32S9pJSzOZT06gKe0aPy8MghtcCVGR1XB19IhVMqpgq jCxuaQ5w8BQomxENlXhMGsk9ksy6kJ8jVHVzOnlkkXQWrBeUCvhaM6HFwRRBcYzb+3Px LAxwS4TMGOVpQznnoNq+DySUz/Eju2JLq2gMuyzBNkIwrXxxhMCwF8IksLatFyEtaQNj GnodHg07/3UV2lSUiQQGp6E+RxAuiwLDCTuQk9/kKd6BKwu1yXneQvGjLWtMTlVb5F+n 9EEWybMMqxZoLZmLKyhrzsvtmQ4kvXayibNo3jomNvxTZIKYHU5wtLCQOSDV9dk6uOiE gDYQ== X-Gm-Message-State: AOJu0YziQWLjkHrul8270VRzgNtZqMCcq9kOmQpEBS5rC7KvyUNpF9i9 ibUBT9aZBXdOOVdZtDFxAJ2AN70i+kSRxzJsAFc73Z9Yw33M4KEerYDcRX9peC48gS6fDHXFlIy G X-Received: by 2002:a05:651c:555:b0:2da:49cc:ef39 with SMTP id q21-20020a05651c055500b002da49ccef39mr271468ljp.0.1714495733950; Tue, 30 Apr 2024 09:48:53 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id b6-20020a05600c4e0600b0041be3383a2fsm12920384wmq.19.2024.04.30.09.48.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 09:48:53 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 16/21] hw/arm/npcm7xx: Store derivative OTP fuse key in little endian Date: Tue, 30 Apr 2024 17:48:37 +0100 Message-Id: <20240430164842.4074734-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240430164842.4074734-1-peter.maydell@linaro.org> References: <20240430164842.4074734-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=peter.maydell@linaro.org; helo=mail-lj1-x231.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 --- hw/arm/npcm7xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/arm/npcm7xx.c b/hw/arm/npcm7xx.c index cc68b5d8f12..9f2d96c733a 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)); }