From patchwork Tue Oct 13 06:53:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1381343 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C9RH72TtYz9sSs for ; Tue, 13 Oct 2020 17:59:13 +1100 (AEDT) Received: from localhost ([::1]:51196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSEH7-0003dF-9y for incoming@patchwork.ozlabs.org; Tue, 13 Oct 2020 02:59:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSEBj-0005MW-4u; Tue, 13 Oct 2020 02:53:35 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:34615) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSEBh-0000HG-9q; Tue, 13 Oct 2020 02:53:34 -0400 Received: from localhost.localdomain ([82.252.141.186]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N7Qp3-1kOlDv2bAD-017lZu; Tue, 13 Oct 2020 08:53:26 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 12/15] goldfish_rtc: change MemoryRegionOps endianness to DEVICE_NATIVE_ENDIAN Date: Tue, 13 Oct 2020 08:53:10 +0200 Message-Id: <20201013065313.7349-13-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201013065313.7349-1-laurent@vivier.eu> References: <20201013065313.7349-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:+QPS27oS1/dsBBHKFOL+t/CKzz6mpZv45f6hLo1RQRLpHx63+q6 7+KrbH9ahjbjZE0FonsA/k28zNuVQBaxwEizyz7ftTa/0PSer/QjDWZT5HxSzQA2+X+KX+k yaZB3InfAQ7CaCm+wz9ML4x4NxHc522W2r3wICwehCJGTQHuVusYVijwP9E606zj5TwAIbm jfp57Gi+A7/0Of5/u9MUA== X-UI-Out-Filterresults: notjunk:1;V03:K0:91riXVbfGek=:DrIlnm/mDmYuFm2RMc782F Z6qRETPAzsh3AGjDbhlq+ngsSHhAA7OTgO62/HA/Ij0A40m/UWVZNOUIKuwNAa6guQfZWuhVI QPpj158N6CZ7/YYvCRC1bvklkTq0nGkJ8uOq3seZunCwQs0t+7rqC0U+U1OJKQh6LbI52K5jN Jm/IZEYUF9Zx9xLta5rQRRpmETJR8uaAR7blNg34XtFTxpBRb++haePpKNw6nwXm0embTu91m gl19RjjBQBjxAEUEgJoUtiTPxqMeWjUn36ytO/UNOjt637emIhPaMhqdbfnvv7FxZ8o3X3J+N Q3c0nE+haWi8GnXfIYfEFiCNOXfw2MULW8ecRdH6vJ/Nh1GWVZO5Pr9DvPVOa3AkQmDPjQdJ6 CHhd3yLGO5gVotSricaLEB5y1+TkwUqyjW7F37NbHKD44tVFCeyvPySNMBO/FZ6ioOzLq/1Hh ym1WE1iKS9g9d3n01x1y/s+lWMBJcG/YHsKt+wYpftydJsBN5D7SBq7XPc3SA3rfQuPw+l/I8 caGcjiDEfJIjRlXXdh687kQOhsCmg40lz+mGAN2OC77FeGQLiAeLRhB5T61cKOkUmpKBDCmFq 1cyozDLwW++ryJLNLdX/p3pe7UJ9K81CHkIEhKIqEnDCL3SlS32ZSvbLHchHHutbOgecjds2/ hFk+cTWQ4eq3CM79ofDcqXz47N1UycJBMoHXDWTqzOAJ4zeB0y0WG7sIxEBCFZDqjNItQ3uIP V9vBSg2+tTyTerHy8cCoqQtZSP8oYqaHueBzxO9+Wg24aoCH0micmUfVE9Bl0mPsUy/V5P23L dObU6o1H3ict0YfJ+dq+Q7ZJxc4cY/072GFq7sSXlPGug0RFA01dUjACEI+ChJwCA2+fUF/ Received-SPF: none client-ip=212.227.126.133; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/13 02:53:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Laurent Vivier , qemu-trivial@nongnu.org, Anup.Patel@wdc.com, Michael Tokarev , Laurent Vivier , Alistair Francis Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier The doc [1] doesn't define the endianness, but the kernel driver uses readl() to access the registers, so we can guess it depends on the architecture endianness. As riscv architecture endianness is little it might not change anything for it. Moreover, android implementation uses DEVICE_NATIVE_ENDIAN [2] [1] https://android.googlesource.com/platform/external/qemu/+/master/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT [2] https://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/hw/timer/goldfish_timer.c#177 Fixes: 9a5b40b84279 ("hw: rtc: Add Goldfish RTC device") Cc: Anup.Patel@wdc.com Signed-off-by: Laurent Vivier Reviewed-by: Alistair Francis Message-Id: <20201009113843.60995-2-lvivier@redhat.com> Signed-off-by: Laurent Vivier --- hw/rtc/goldfish_rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/rtc/goldfish_rtc.c b/hw/rtc/goldfish_rtc.c index 6ddd45cce039..0f4e8185a796 100644 --- a/hw/rtc/goldfish_rtc.c +++ b/hw/rtc/goldfish_rtc.c @@ -217,7 +217,7 @@ static int goldfish_rtc_post_load(void *opaque, int version_id) static const MemoryRegionOps goldfish_rtc_ops = { .read = goldfish_rtc_read, .write = goldfish_rtc_write, - .endianness = DEVICE_LITTLE_ENDIAN, + .endianness = DEVICE_NATIVE_ENDIAN, .valid = { .min_access_size = 4, .max_access_size = 4