From patchwork Tue Dec 13 12:52:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 633509 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3056869pvb; Tue, 13 Dec 2022 04:53:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf4rTfp3Qv81O3DxjUe+L5U6BW6ugMEC0SWNpxoJ779s3wAF6i8Sv19R45uCA60HuNHftZ97 X-Received: by 2002:ac8:7587:0:b0:3a7:f552:fd60 with SMTP id s7-20020ac87587000000b003a7f552fd60mr4034333qtq.41.1670936002738; Tue, 13 Dec 2022 04:53:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670936002; cv=none; d=google.com; s=arc-20160816; b=n//IuxMpMVXHUDsHcOmlSzdovYyYbV3tJb6UG81CGpvr8k3IqjvlMyCgRqM1OeBBuR QS4sOwXbSQY70bF8EyYKesBR3sF90Yplbk2k1ex8q+A4uUWaXPONhafH20kjYBtJZMqA h1sEDb6nbIXV7nh9cv2dHtoMvc4k60Wc2e1ulx3lE80quKVK5xgOMrshQz9WQzJJgLkm clDbxOjxd8YxhBxK44lu2ToRrKcnAqZWr0qN6HAcUZZcdSo4IxohTBWz5eQKA+1l6Mdc BsFqT6kPo7Ho7SxtMV/HCxmgdt8CtZpMkdqmDSIvntLNrzWSNP17scI3ScBAfCwNm12K QkeA== 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:dkim-signature; bh=El4Mo4XJqlmSIoO5ETLFqRzBXVBkfAvXj3HufFMLDB0=; b=LTSnnMj5jDqc2OW9xD1Li66Gi54oHOgNvx2KRVIGFBUNzdgaFYH9IuMcyW/cjP+wUw LPJzuoN8vm13NQykkoIUDY/i5OIrwiH8yuhzEeznJidWC+9uv0fD7xtorg35S0EAClxi m2waQ3tTs5lSsJc+FUN+/Di8OD67T336PcFYlaKJyIsLkvLiDtsmvO3pwVdlrzxiphCw P/RWCi0shlRI0xKS3gIor93+2LZw1Xxmm+kj5dOLf4/FbgQwYWY6o2RGiReVyh4O71Ca 2rprH8BddWZoz6qMQ8TlIfA0/iBf1/sAdpGEwmd6jR1wrqc3DuK9oapof3SQ8t5SwJCW VvZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qpt4z6KO; 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 b20-20020ac85414000000b003a7e2aea22dsi6900242qtq.162.2022.12.13.04.53.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Dec 2022 04:53:22 -0800 (PST) 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=Qpt4z6KO; 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 1p54m9-00009T-SX; Tue, 13 Dec 2022 07:52:49 -0500 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 1p54lz-00007y-UA for qemu-devel@nongnu.org; Tue, 13 Dec 2022 07:52:39 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p54ly-00030t-5V for qemu-devel@nongnu.org; Tue, 13 Dec 2022 07:52:39 -0500 Received: by mail-wm1-x335.google.com with SMTP id c65-20020a1c3544000000b003cfffd00fc0so7817662wma.1 for ; Tue, 13 Dec 2022 04:52:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=El4Mo4XJqlmSIoO5ETLFqRzBXVBkfAvXj3HufFMLDB0=; b=Qpt4z6KOyGfmVHof3B8vjj9lmGlhjItvat/UYcHjdmfNQMhgrsdL+VrzB0l/zmH//7 /6pcLu9hXSap6cUwQ4XaCougl+9jf3inXcaFwle4eP3ITO+LRPr7ZwwyUcClbOaZe8sb egtAnWT9nigfBN1gVL768oAzebQpbIlf3L5nRI6ihZGrO7wWCaxboEBbFGllo9vKFWXA Nhvm78YqDpdDSwpc1hRyMmcB71E9QAPs9rKCLDHtdI/qfAWdnMPGHsjmwwPx1bRW55yg 5DXA4WLqAP+geC1u4WbdH1YB2gQpZtUKu4yGi9QmSNAyCqFOAapU/86gfIGcf9OWKOKV kmWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=El4Mo4XJqlmSIoO5ETLFqRzBXVBkfAvXj3HufFMLDB0=; b=r207RWyRrdyntB8WIaFG5ClTRCOsBZdrCP/fJga+hYsVslP1fBXJqxQpXWh3ORWylh CmbGnivigX7mzcK16f6yQumvW/zqS0XQTtNH6gU+U8NXpZz0aoLSI8ofdh7H2UXmNRYO T+TpyNuLxlQEvr6A+18OQkdN8Zr+d/Ob6/Du16UUafeu0Uh8Exd5jg5PnZcu8theghnN +GoEPRo2N+mXcviY2ZQE2K6r2hlC+3dThfy6ew9Xv45qFX3dXxnIcrETg4UIlY7KKVhT 8mCp4lvQoHgyvAp0zWDinPvjM8rcVfbCpjDrKW8ziadvFqgebTfEqnxLrO4TA0kDD1HY b+gg== X-Gm-Message-State: ANoB5pkj0JwmRzuokGYadRsWGg8zV0OFvX0aQfifOr2TfeDDNFbbb7yI V+HQcMvZmeeGHieKpADMqwOx9lmDCiZMpRE4zHk= X-Received: by 2002:a05:600c:538f:b0:3d1:d396:1ade with SMTP id hg15-20020a05600c538f00b003d1d3961ademr15602334wmb.9.1670935956487; Tue, 13 Dec 2022 04:52:36 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id g23-20020a05600c4c9700b003cf4ec90938sm12081630wmp.21.2022.12.13.04.52.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Dec 2022 04:52:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell Cc: Daniel Henrique Barboza , BALATON Zoltan , =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , David Gibson , Jason Wang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Greg Kurz , qemu-arm@nongnu.org, "Edgar E. Iglesias" , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu() Date: Tue, 13 Dec 2022 13:52:18 +0100 Message-Id: <20221213125218.39868-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221213125218.39868-1-philmd@linaro.org> References: <20221213125218.39868-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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=unavailable 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 This partly revert commit d48751ed4f ("xilinx-ethlite: Simplify byteswapping to/from brams") which states the packet data is stored in big-endian. Signed-off-by: Philippe Mathieu-Daudé --- hw/net/xilinx_ethlite.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 6e09f7e422..efe627d734 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -24,8 +24,8 @@ #include "qemu/osdep.h" #include "qemu/module.h" +#include "qemu/bswap.h" #include "qom/object.h" -#include "cpu.h" /* FIXME should not use tswap* */ #include "hw/sysbus.h" #include "hw/irq.h" #include "hw/qdev-properties.h" @@ -102,8 +102,8 @@ eth_read(void *opaque, hwaddr addr, unsigned int size) D(qemu_log("%s " TARGET_FMT_plx "=%x\n", __func__, addr * 4, r)); break; - default: - r = tswap32(s->regs[addr]); + default: /* Packet data */ + r = be32_to_cpu(s->regs[addr]); break; } return r; @@ -160,8 +160,8 @@ eth_write(void *opaque, hwaddr addr, s->regs[addr] = value; break; - default: - s->regs[addr] = tswap32(value); + default: /* Packet data */ + s->regs[addr] = cpu_to_be32(value); break; } }