From patchwork Tue Apr 9 13:37:54 2024 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: 787205 Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp221908wrs; Tue, 9 Apr 2024 06:39:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUiJOS9gQKHq5ByYw/6QVAI5hPqlPb6czM8i8vpn6eN+910WBTzJC82a1LNRRjfO8fXnNbYJm4N1mRG4KA0V0Co X-Google-Smtp-Source: AGHT+IFaN7bCO2DjDPGtCgFplj4JeldsIofC3YVEu8t9nJLCHoF8gUNwZwuf+ptdhh1cgC+BhZHK X-Received: by 2002:a05:6214:aa8:b0:69b:f01:6fbb with SMTP id ew8-20020a0562140aa800b0069b0f016fbbmr4035691qvb.22.1712669994565; Tue, 09 Apr 2024 06:39:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712669994; cv=none; d=google.com; s=arc-20160816; b=fEEYI/xa6NBYzP61PnzqxwZBqrZIIjR/o/vBlxG7SFJubhek1l63ITXxFqKI8o/weS vxMESq/8Y7KUNgDDbtGbK8zNV9ao78ST1Z0CJsuGM/cBrS4oAvaExusZZX339PNaviDy 1lAUJW0kgkAfxCRodWbIocvE2puKZw6OXg/EkQNs5Xo5JNFuRmj8rY1W1jJm0epcv3Y2 3k1HLQ1sP2/yaFADdpL6ZC6qCGfaiKXtvmGE5K04qhpyFvOfQNx7QSOzf/E3XX+JngoN gFb8+L2IFmBDM43l493Q3GC2MD2RFpQMgltF268fpIE16ILMRWLd3LfwChIEKxNIwy/q B18A== 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=lbfyIBf/SQJfbeKOCdEpbKAjf0YIAs4J/ih0RuWwHfw=; fh=QOl9Xi9nQ721K4qxGgLCqy+fNk/yfBHdpOYFmb4mu2g=; b=I8IEabYK98rtpcNN4IWG0ecI+rTtKJSJl46/KGzvDJF7HuJ1i6wejqQA/2YgeQnDcw MO+pwlZDAabiUGjV/lOCYlZewjtzTd2uXmAlBEhaLqUtriuIKOLNVLMpbFFWjnA22ZOa ZacrDL/YiJAzCBSzXIUHBxMtVy+reGuHfIvHG3/4jTEneWnTkhTsVAlDPJ3x2gHnhgzY iyDLbOT/lEf8rhdjPIRQC/5GLxP/t8RcyutsaUteC2yNt3gO0H7KM7LvhrkxvkyHqyFi vn5SJgRc+X2P5/16sMVz3bfrVwMLJFJMX358Y7ZbTJmNz1WPag7TDGsgB/rwur4j3sSa gO2Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A5olmGq+; 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 a20-20020a0ce354000000b00699331b15f2si10227917qvm.3.2024.04.09.06.39.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2024 06:39:54 -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=A5olmGq+; 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 1ruBgo-0006Bv-Nn; Tue, 09 Apr 2024 09:39:09 -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 1ruBgJ-00061e-L8 for qemu-devel@nongnu.org; Tue, 09 Apr 2024 09:38:35 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruBgG-0008EZ-JB for qemu-devel@nongnu.org; Tue, 09 Apr 2024 09:38:34 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-343f62d8124so2801384f8f.2 for ; Tue, 09 Apr 2024 06:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712669910; x=1713274710; darn=nongnu.org; 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=lbfyIBf/SQJfbeKOCdEpbKAjf0YIAs4J/ih0RuWwHfw=; b=A5olmGq+DqVVVxLXaoPRzZOpkl3+bcx6X/tP30ChgWYesXDu5TFuooy0CuRwrNc9jm I3Wed44qyzFmJK+uJlCYRIE14nxvFfK9dOec23W/u5HXaBIYGaeoyZT3zdGqRbfdW1Im wAxIi9Wx6c7qVFP50YAfsUDKRlWXkPYzUvHMb77hFHRspm4e2p+WZbNHEm5SWNK3/u49 LK+Az1IT5t5lBH7Fvnio5HK4pR0n+qduf3Ew0rMRsoKh084WDevMpMarfeiphl4h34FB ZzbwoPfjLhoDAIlS8CaYqcZrtzzdmkS4BJ5faWewFpoD/JVnHRr+kS/P8jgbrrIOOr0G +wXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712669910; x=1713274710; 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=lbfyIBf/SQJfbeKOCdEpbKAjf0YIAs4J/ih0RuWwHfw=; b=gxbqfP5dwwtKcQit8hcoP6mkKfsyVLN2OUmQ0w03cwuUGFITcE5PiawR5t+GNfyhD3 Sjh1dM31HIm50pGxjfEKvxHJoKPSDf5gf7Uo+bdiB+7e+cYhGemlMZOGdgHTAf9+CtJt rgPeFCPp3rP3lpx7A2WFucB+y+s8OFLhnm3nUlzqtlWSHnYz45CIqygE769Jk12tjWC6 GGgZdzNB1ctjyOCOC7iM58uze5KGTL5VNpHKno4Vt/8kusDKhA5IWEfVqlgbF0H3m3bw J1D12uK9KweqN40+D4YNk+jH5mdBk5sLHrN3GQybVCR625OnfrIyvX29OcCYVZ6uK40y xiMA== X-Gm-Message-State: AOJu0Ywt0xsnqG6qLQXctQ8zO63GJDHMac87P1u7y9oEIQKRS2r24w8j 6835bzNqRVC9HyK8LmGBnFVBUSmnemScPmKlEE81a7KaXXVdyStzCmPfFJcELneIAqGlAcwW9Kp n X-Received: by 2002:a5d:5233:0:b0:341:bfe2:4509 with SMTP id i19-20020a5d5233000000b00341bfe24509mr8216775wra.42.1712669910719; Tue, 09 Apr 2024 06:38:30 -0700 (PDT) Received: from m1x-phil.lan ([176.176.160.134]) by smtp.gmail.com with ESMTPSA id k2-20020a5d5242000000b00343c0c24a65sm11460005wrc.89.2024.04.09.06.38.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 09 Apr 2024 06:38:30 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Chuhong Yuan , Jason Wang , Alexander Bulekov , qemu-arm@nongnu.org, =?utf-8?q?Philippe_?= =?utf-8?q?Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.1 v2 05/11] hw/net/lan9118: Add definitions for FIFO allocated sizes Date: Tue, 9 Apr 2024 15:37:54 +0200 Message-ID: <20240409133801.23503-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240409133801.23503-1-philmd@linaro.org> References: <20240409133801.23503-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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 Add definitions for the TX_FIF_SZ=5 case, per TABLE 5-3 "VALID TX/RX FIFO ALLOCATIONS". Signed-off-by: Philippe Mathieu-Daudé --- hw/net/lan9118.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c index a6a869de32..00409927fe 100644 --- a/hw/net/lan9118.c +++ b/hw/net/lan9118.c @@ -158,6 +158,17 @@ do { printf("lan9118: " fmt , ## __VA_ARGS__); } while (0) */ #define MIL_TXFIFO_SIZE 2048 +/* + * TX and RX FIFO space is configurable through the TX FIFO Size (TX_FIF_SZ) + * field in the hardware configuration (CSR HW_CFG) register. These are the + * default configuration settings for TX_FIF_SZ = 5 + * (see TABLE 5-3: VALID TX/RX FIFO ALLOCATIONS). + */ +#define TX_DATA_FIFO_BYTES 4608 /* 1152 words */ +#define TX_STATUS_FIFO_BYTES 512 /* 128 words */ +#define RX_DATA_FIFO_BYTES 10560 /* 2640 words */ +#define RX_STATUS_FIFO_BYTES 704 /* 176 words */ + enum tx_state { TX_IDLE, TX_B,