All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: linux-can@vger.kernel.org
Cc: kernel@pengutronix.de,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	Thomas Kopp <thomas.kopp@microchip.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [can-next-rfc 12/12] can: mcp251xfd: ring: increase number of RX-FIFOs to 3 and increase max TX-FIFO depth to 16
Date: Sun, 13 Mar 2022 09:36:40 +0100	[thread overview]
Message-ID: <20220313083640.501791-13-mkl@pengutronix.de> (raw)
In-Reply-To: <20220313083640.501791-1-mkl@pengutronix.de>

This patch increases the number of RX-FIFOs to 3 and the max TX-FIFO
depth to 16. This leads to the following default ring configuration.

CAN-2.0 mode:

| FIFO setup: TEF:         0x400:  8*12 bytes =   96 bytes
| FIFO setup: RX-0: FIFO 1/0x460: 32*20 bytes =  640 bytes
| FIFO setup: RX-1: FIFO 2/0x6e0: 32*20 bytes =  640 bytes
| FIFO setup: RX-2: FIFO 3/0x960: 16*20 bytes =  320 bytes
| FIFO setup: TX:   FIFO 4/0xaa0:  8*16 bytes =  128 bytes
| FIFO setup: free:                              224 bytes

CAN-FD mode:

| FIFO setup: TEF:         0x400:  4*12 bytes =   48 bytes
| FIFO setup: RX-0: FIFO 1/0x430: 16*76 bytes = 1216 bytes
| FIFO setup: RX-1: FIFO 2/0x8f0:  4*76 bytes =  304 bytes
| FIFO setup: TX:   FIFO 3/0xa20:  4*72 bytes =  288 bytes
| FIFO setup: free:                              192 bytes

With the previously added ethtool ring configuration support the RAM
on the chip can now be runtime configured between RX and TX buffers.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd.h b/drivers/net/can/spi/mcp251xfd/mcp251xfd.h
index c6cb8c3391b3..9cb6b5ad8dda 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd.h
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd.h
@@ -398,7 +398,7 @@ static_assert(MCP251XFD_TIMESTAMP_WORK_DELAY_SEC <
 
 /* FIFO and Ring */
 #define MCP251XFD_FIFO_TEF_NUM 1U
-#define MCP251XFD_FIFO_RX_NUM 1U
+#define MCP251XFD_FIFO_RX_NUM 3U
 #define MCP251XFD_FIFO_TX_NUM 1U
 
 #define MCP251XFD_FIFO_DEPTH 32U
@@ -409,7 +409,7 @@ static_assert(MCP251XFD_TIMESTAMP_WORK_DELAY_SEC <
 #define MCP251XFD_RX_FIFO_DEPTH_COALESCE_MIN 8U
 
 #define MCP251XFD_TX_OBJ_NUM_MIN 2U
-#define MCP251XFD_TX_OBJ_NUM_MAX 8U
+#define MCP251XFD_TX_OBJ_NUM_MAX 16U
 #define MCP251XFD_TX_OBJ_NUM_CAN_DEFAULT 8U
 #define MCP251XFD_TX_OBJ_NUM_CANFD_DEFAULT 4U
 #define MCP251XFD_TX_FIFO_DEPTH_MIN 2U
-- 
2.35.1



  parent reply	other threads:[~2022-03-13  8:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-13  8:36 can-next 2022-03-13: mcp251xfd: add Marc Kleine-Budde
2022-03-13  8:36 ` [can-next-rfc 01/12] can: mcp251xfd: mcp251xfd_ring_init(): use %d to print free RAM Marc Kleine-Budde
2022-03-13  8:36 ` [can-next-rfc 02/12] can: mcp251xfd: ram: add helper function for runtime ring size calculation Marc Kleine-Budde
2022-03-13  8:36 ` [can-next-rfc 03/12] can: mcp251xfd: ram: coalescing support Marc Kleine-Budde
2022-03-13  8:36 ` [can-next-rfc 04/12] can: mcp251xfd: ethtool: add support Marc Kleine-Budde
2022-03-13  8:36 ` [can-next-rfc 05/12] can: mcp251xfd: ring: prepare support for runtime configurable RX/TX ring parameters Marc Kleine-Budde
2022-03-13  8:36 ` [can-next-rfc 06/12] can: mcp251xfd: update macros describing ring, FIFO and RAM layout Marc Kleine-Budde
2022-03-13  8:36 ` [can-next-rfc 07/12] can: mcp251xfd: ring: add support for runtime configurable RX/TX ring parameters Marc Kleine-Budde
2022-03-13  8:36 ` [can-next-rfc 08/12] can: mcp251xfd: add RX IRQ coalescing support Marc Kleine-Budde
2022-03-13  8:36 ` [can-next-rfc 09/12] can: mcp251xfd: add RX IRQ coalescing ethtool support Marc Kleine-Budde
2022-03-13  8:36 ` [can-next-rfc 10/12] can: mcp251xfd: add TX IRQ coalesce support Marc Kleine-Budde
2022-03-13  8:36 ` [can-next-rfc 11/12] can: mcp251xfd: add TX IRQ coalesce ethtool support Marc Kleine-Budde
2022-03-13  8:36 ` Marc Kleine-Budde [this message]
2022-03-23 13:28 ` can-next 2022-03-13: mcp251xfd: add Thomas.Kopp
2022-03-23 14:03   ` Marc Kleine-Budde
2022-03-23 15:00     ` Thomas.Kopp
2022-03-23 19:28       ` Marc Kleine-Budde
2022-03-24 12:28         ` Thomas.Kopp
2022-03-24 13:45           ` can-next 2022-03-13: mcp251xfd: add coalescing support Marc Kleine-Budde
2022-03-29  9:08 ` can-next 2022-03-13: mcp251xfd: add Thomas.Kopp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220313083640.501791-13-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=thomas.kopp@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.