summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/gianfar.h
diff options
context:
space:
mode:
authorClaudiu Manoil <claudiu.manoil@freescale.com>2014-04-24 09:17:22 (GMT)
committerJose Rivera <German.Rivera@freescale.com>2014-05-08 13:49:51 (GMT)
commit44cc9789d535e01339a68b63e633057f55704246 (patch)
tree02ea4fa8f2a4db80311ebb202c0e0f799de793dc /drivers/net/ethernet/freescale/gianfar.h
parent4888b87c99e103a1cf1cb3add39c4c8252249dc3 (diff)
downloadlinux-fsl-qoriq-44cc9789d535e01339a68b63e633057f55704246.tar.xz
gianfar: Add BD rings allocation to L2 SRAM
When this option is enabled the driver will try to allocate the buffer descriptors (BDs) to the L2 SRAM memory, using the powerpc/85xx cache-sram support API for the P1/P2 QorIQ platforms. For this to work, the size and address of the SRAM region must be provided as kernel boot params. Should the attempt to allocate in L2 SRAM fail, the driver falls back to normal allocation of BDs as before (to DDR). The gfar_l2sram_en driver module param is provided to allow to disable the allocation to L2 SRAM at driver level (enabled by default). Change-Id: I087e97baf289111a0841fdf69592c56d3a9a0310 Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/11624 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Jianhua Xie <jianhua.xie@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/gianfar.h')
-rw-r--r--drivers/net/ethernet/freescale/gianfar.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index 1d1b9b1..5f7a98d 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -1323,7 +1323,9 @@ struct gfar_private {
/* Flow control flags */
pause_aneg_en:1,
tx_pause_en:1,
- rx_pause_en:1;
+ rx_pause_en:1,
+ /* L2 SRAM alloc of BDs */
+ bd_l2sram_en:1;
/* The total tx and rx ring size for the enabled queues */
unsigned int total_tx_ring_size;
@@ -1355,6 +1357,9 @@ struct gfar_private {
unsigned int ftp_rqfcr[MAX_FILER_IDX + 1];
};
+#define BD_RING_REG_SZ(priv) ( \
+ sizeof(struct txbd8) * (priv)->total_tx_ring_size + \
+ sizeof(struct rxbd8) * (priv)->total_rx_ring_size)
static inline int gfar_has_errata(struct gfar_private *priv,
enum gfar_errata err)