From nobody Tue Feb 10 02:00:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=bt.com ARC-Seal: i=1; a=rsa-sha256; t=1566587575; cv=none; d=zoho.com; s=zohoarc; b=jJacDW4hbSHMZkucu6wx00mbzjfLqki1kPEZCoA2/lIvI6EWdBsH+CU9+QAap+CyqKqF7Jp3amshIE2KzQros+t8giNyPNKYL+qVGNYikH8Ej+B6WwyAxA1OGVf0L5+dzhxKHfweCvE6IN/YsTbmqopneC6LxH++lUMAmDTIvhg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566587575; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=XpjRBwpsT7xu199408aRtiG8O4/4bQdME5nxL/BHCQ0=; b=Mq07kECIecn5ndAMRWRAkG8hl5dRIHEx7PC6x+53HyvvUgDtb/B72l5/tegpsgp2OLMtNJHk70YGFwmS8RGa+HySD6z963LUE7AmhRJQDsJatyYFud1Dqt5lAa6b3UT/TdfnbPjLHzk7aCh7PJ7wcGgTEcpvgI1NhRP5mn3JCZw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566587575579105.9182383361491; Fri, 23 Aug 2019 12:12:55 -0700 (PDT) Received: from localhost ([::1]:33134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1EzT-0005bW-Em for importer@patchew.org; Fri, 23 Aug 2019 15:12:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42953) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1Egt-0002u4-CV for qemu-devel@nongnu.org; Fri, 23 Aug 2019 14:53:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i1Egs-00039Z-9R for qemu-devel@nongnu.org; Fri, 23 Aug 2019 14:53:39 -0400 Received: from nsstlmta16p.bpe.bigpond.com ([203.38.21.16]:34129) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i1Egr-00036q-M9; Fri, 23 Aug 2019 14:53:38 -0400 Received: from smtp.telstra.com ([10.10.24.4]) by nsstlfep16p-svc.bpe.nexus.telstra.com.au with ESMTP id <20190823185332.XFTI23659.nsstlfep16p-svc.bpe.nexus.telstra.com.au@smtp.telstra.com>; Sat, 24 Aug 2019 04:53:32 +1000 Received: from dbz.telstra.com.au (58.173.98.68) by smtp.telstra.com (5.8.335) (authenticated as tony.nguyen.git@bigpond.com) id 5D3692920C8C191A; Sat, 24 Aug 2019 04:53:32 +1000 X-RG-Spam: Unknown X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgeduvddrudegkedguddvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfupfevtfgpvffgnffuvffttedpqfgfvfenuceurghilhhouhhtmecugedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvohhnhicupfhguhihvghnuceothhonhihrdhnghhuhigvnhessghtrdgtohhmqeenucfkphepheekrddujeefrdelkedrieeknecurfgrrhgrmhephhgvlhhopegusgiirdhtvghlshhtrhgrrdgtohhmrdgruhdpihhnvghtpeehkedrudejfedrleekrdeikedpmhgrihhlfhhrohhmpeeothhonhihrdhnghhuhigvnhessghtrdgtohhmqedprhgtphhtthhopeeouggrvhhiugesghhisghsohhnrdgurhhophgsvggrrhdrihgurdgruheqpdhrtghpthhtohepoehpvghtvghrrdgthhhusggssehnihgtthgrrdgtohhmrdgruheqpdhrtghpthhtohepoehpvghtvghrrdhmrgihuggvlhhlsehlihhnrghrohdrohhrgheqpdhrtghpthhtohepoehqvghmuhdqrghrmhesnhhonhhgnhhurdhorhhgqedprhgtphhtthhopeeoqhgvmhhuqdguvghvvghlsehnohhnghhnuhdrohhrgheqpdhrtghpthhtohepoehqvghmuhdqphhptgesnhhonhhgnhhurdhorhhgqedprhgtphhtthhopeeothhonhihrdhnghhuhigvnhessghtrdgtohhmqeenucevlhhushhtvghrufhi iigvpedt X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean X-RG-VS-CLASS: clean X-Authentication-Info: Submitted using ID tony.nguyen.git@bigpond.com From: Tony Nguyen To: qemu-devel@nongnu.org Date: Sat, 24 Aug 2019 04:56:28 +1000 Message-Id: <90bd564769dbabaa7cf70b08e77170d54fa4b625.1566467963.git.tony.nguyen@bt.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 203.38.21.16 Subject: [Qemu-devel] [RFC PATCH 07/17] hw/i2c: Declare device little or big endian X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tony Nguyen , Peter Maydell , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Peter Chubb , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result in genuinely native endian devices being incorrectly declared as little or big endian, but should not introduce regressions for current targets. These devices should be re-declared as DEVICE_NATIVE_ENDIAN if 1) it has a new target with an opposite endian or 2) someone informed knows better =3D) Signed-off-by: Tony Nguyen Acked-by: David Gibson --- hw/i2c/imx_i2c.c | 2 +- hw/i2c/mpc_i2c.c | 2 +- hw/i2c/versatile_i2c.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/i2c/imx_i2c.c b/hw/i2c/imx_i2c.c index 30b9aea247..cc2689d967 100644 --- a/hw/i2c/imx_i2c.c +++ b/hw/i2c/imx_i2c.c @@ -278,7 +278,7 @@ static const MemoryRegionOps imx_i2c_ops =3D { .write =3D imx_i2c_write, .valid.min_access_size =3D 1, .valid.max_access_size =3D 2, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 static const VMStateDescription imx_i2c_vmstate =3D { diff --git a/hw/i2c/mpc_i2c.c b/hw/i2c/mpc_i2c.c index 0aa1be3ce7..b71b5ff7d5 100644 --- a/hw/i2c/mpc_i2c.c +++ b/hw/i2c/mpc_i2c.c @@ -306,7 +306,7 @@ static const MemoryRegionOps i2c_ops =3D { .read =3D mpc_i2c_read, .write =3D mpc_i2c_write, .valid.max_access_size =3D 1, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_BIG_ENDIAN, }; =20 static const VMStateDescription mpc_i2c_vmstate =3D { diff --git a/hw/i2c/versatile_i2c.c b/hw/i2c/versatile_i2c.c index 1ac2a6f59a..c92d3b115c 100644 --- a/hw/i2c/versatile_i2c.c +++ b/hw/i2c/versatile_i2c.c @@ -77,7 +77,7 @@ static void versatile_i2c_write(void *opaque, hwaddr offs= et, static const MemoryRegionOps versatile_i2c_ops =3D { .read =3D versatile_i2c_read, .write =3D versatile_i2c_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 static void versatile_i2c_init(Object *obj) --=20 2.23.0