From patchwork Mon Mar 4 11:08:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13580445 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8460B39AED for ; Mon, 4 Mar 2024 11:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709550578; cv=none; b=mqRfmlGN3IGIbO/Nk2zQThGU+dSEpbhoXqHcGNTWrzK7GsDPGQER0fkF0AbtZDss6S+z8CQlr6kznCjKcEVRFX43LEc3qIzZ2/+KfsUXU3TPrp8KAJlFu4lrni5HUZ/cBMqBccb5rQavrECyipHEFk4th4zVu9/n/rmLYBrBgwg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709550578; c=relaxed/simple; bh=ipwwzageipbMz78E+3Wjwp/04JXYtaYBlWLk7plSvHA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=I3E97tAwRKxzS43rXe2m9QaodZTPQPSBahiFc+crp+Ycwv1ivjp+dZPij6fOVMpRTOwoiKq5eawnEm46FuKSzZ3K6yLus8epqOoxs6YH0raSqgLxhxaJjM3EeDxZ9yHSYPqcXx2U/RLRUuoIZnFT6w0+HC+QumqWo6c/ol5iJPI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se; spf=pass smtp.mailfrom=ragnatech.se; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b=fWVt5vaN; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b="fWVt5vaN" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a28a6cef709so703800966b.1 for ; Mon, 04 Mar 2024 03:09:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; s=google; t=1709550575; x=1710155375; darn=vger.kernel.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=TPeilTHQcrs4Zf8fAnx4929uAMtVZNsWRtAs7rDG6AQ=; b=fWVt5vaNOF1CiWELUF2oLP2pWWhD/YfLB548TfcLGDFFKUOj+1u4ltFySV6EF9wVV5 DgfbWxFnR4fRDqJxikJ9wUnDmM5w3zolDmjzqLBXv1QKGgDuWVtS6XS39dmEhQP+PS3+ 3SIp9o9tkeJQikNiTVHawszaX/7YnTfTxGpCjrjcHXAj8aKyTJmd1AWtcFD2cvvFeKk1 gQ/FyIyMy2c1JZVYbj4ErXsiGo5Es0R4P4KqEHiXvHPF5gGPQ0USxYf+/pZwYetp/G6R xP6yUD71xpZeKzyQjC3L/peoEzZ6hZFhG3fNa+DNRiDCG0A6NM/iA8vgjgzKRrNwTBBj KsCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709550575; x=1710155375; 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=TPeilTHQcrs4Zf8fAnx4929uAMtVZNsWRtAs7rDG6AQ=; b=wE1SBa+8lFavsV7BcjkoepZ2XNEwNp0VtgZkMiEP2U8MU/kuiH0J4ne9rtY9xDqkDC t3HA577AH/gPnYWDdnRWC9vawxILS94EInJ9zW6DBu4ZRKPIFOLNgXTMrFKr5KMUm+Vu z/MKiqISlj2q0T8mxgQBITeHuZ6fuzImx+fB5YwwLKpJyYOVlSTwnJ87OW6Ugr/T+XVK ja09zMx0+tn2M+oqWxIEJIdaIlO9K/oRutilVqJRvwVPEgvflOflZocATQx44ha8trah NLRoJIdvVJBz3KgfdpUne84OA+NhUJQC3Y239IkEPXcFznc58eq9483I/9Af8kno6Amn 45RA== X-Forwarded-Encrypted: i=1; AJvYcCXeEfSWUobmiTgsghYH6DELWXrGrqqi1Xhh0GErSUos2DnMJMuxPe5wR4wkZ37W6kFennbCJOKNl+gGv9bPGO8RpFY+SDRF X-Gm-Message-State: AOJu0Yy5MZqkCOyXJQdnn9LtCReT27pNgVQSNJEV+cGSJFlSu7ZYIHTr XxxfjQYNL65YGFRUZROljK6vtiXMRmDHo3vOtankBiBRah2t3h/Xap28WlxeZCQ= X-Google-Smtp-Source: AGHT+IFCv32f7cCPbNZLVdLHrO6GVxeJ8SO4tiuW7IHcb6DkeflLmyP7OgXDgJSPCP3GfX82OJ0vSg== X-Received: by 2002:a17:906:6c8:b0:a45:6422:ea2a with SMTP id v8-20020a17090606c800b00a456422ea2amr988741ejb.41.1709550574799; Mon, 04 Mar 2024 03:09:34 -0800 (PST) Received: from sleipner.berto.se (p4fcc8c6a.dip0.t-ipconnect.de. [79.204.140.106]) by smtp.googlemail.com with ESMTPSA id v23-20020a170906565700b00a455ff77e7bsm688420ejr.88.2024.03.04.03.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 03:09:34 -0800 (PST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Biju Das , Claudiu Beznea , Yoshihiro Shimoda , netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= , Paul Barker Subject: [net-next,v3 4/6] ravb: Use the max frame size from hardware info for RZ/G2L Date: Mon, 4 Mar 2024 12:08:56 +0100 Message-ID: <20240304110858.117100-5-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240304110858.117100-1-niklas.soderlund+renesas@ragnatech.se> References: <20240304110858.117100-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Remove the define describing the RZ/G2L maximum frame size and only use the information in the hardware information struct. This will make it easier to merge the R-Car and RZ/G2L code paths. There is no functional change as both the define and the maximum frame length in the hardware information is set to 8K. Signed-off-by: Niklas Söderlund Reviewed-by: Paul Barker Reviewed-by: Sergey Shtylyov --- drivers/net/ethernet/renesas/ravb.h | 1 - drivers/net/ethernet/renesas/ravb_main.c | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h index 751bb29cd488..7fa60fccb6ea 100644 --- a/drivers/net/ethernet/renesas/ravb.h +++ b/drivers/net/ethernet/renesas/ravb.h @@ -1017,7 +1017,6 @@ enum CSR2_BIT { #define RX_BUF_SZ (2048 - ETH_FCS_LEN + sizeof(__sum16)) -#define GBETH_RX_BUFF_MAX 8192 #define GBETH_RX_DESC_DATA_SIZE 4080 struct ravb_tstamp_skb { diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index e6b025058847..45383635e8e2 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -568,7 +568,7 @@ static void ravb_emac_init_gbeth(struct net_device *ndev) } /* Receive frame limit set register */ - ravb_write(ndev, GBETH_RX_BUFF_MAX + ETH_FCS_LEN, RFLR); + ravb_write(ndev, priv->info->rx_max_frame_size + ETH_FCS_LEN, RFLR); /* EMAC Mode: PAUSE prohibition; Duplex; TX; RX; CRC Pass Through */ ravb_write(ndev, ECMR_ZPF | ((priv->duplex > 0) ? ECMR_DM : 0) | @@ -629,6 +629,7 @@ static void ravb_emac_init(struct net_device *ndev) static int ravb_dmac_init_gbeth(struct net_device *ndev) { + struct ravb_private *priv = netdev_priv(ndev); int error; error = ravb_ring_init(ndev, RAVB_BE); @@ -642,7 +643,7 @@ static int ravb_dmac_init_gbeth(struct net_device *ndev) ravb_write(ndev, 0x60000000, RCR); /* Set Max Frame Length (RTC) */ - ravb_write(ndev, 0x7ffc0000 | GBETH_RX_BUFF_MAX, RTC); + ravb_write(ndev, 0x7ffc0000 | priv->info->rx_max_frame_size, RTC); /* Set FIFO size */ ravb_write(ndev, 0x00222200, TGC);