net: fix cache misaligned issue in Broadcom SF2 driver
Subsystems (5)
PATCH 1/2 net: fix cache misaligned issue in Broadcom SF2 driver
From: Suji Velupillai <[email protected]>
Fixed cache misaligned issue in the net driver. The issue shows-up when a call to flush_dcache_range is made with unaligned memory. The memory must be aligned to ARCH_DMA_MINALIGN.
Cover Letter:
This series resolves issues specific to the Broadcom SF2 driver:
- fix cache misaligned issue
- convert to Kconfig
END
---
drivers/net/bcm-sf2-eth-gmac.c | 113 +++++++++++++++++++++-------------------- drivers/net/bcm-sf2-eth.h | 4 +- 2 files changed, 60 insertions(+), 57 deletions(-)
drivers/net/bcm-sf2-eth-gmac.c +59 -54
@@ -1,5 +1,5 @@/* -* Copyright 2014 Broadcom Corporation. +* Copyright 2014-2017 Broadcom. * * SPDX-License-Identifier: GPL-2.0+ */
@@ -28,6 +28,10 @@ } \ } +#define RX_BUF_SIZE_ALIGNED ALIGN(RX_BUF_SIZE, ARCH_DMA_MINALIGN) +#define TX_BUF_SIZE_ALIGNED ALIGN(TX_BUF_SIZE, ARCH_DMA_MINALIGN) +#define DESCP_SIZE_ALIGNED ALIGN(sizeof(dma64dd_t), ARCH_DMA_MINALIGN) +static int gmac_disable_dma (struct eth_dma *dma,int dir);static int gmac_enable_dma (struct eth_dma *dma,int dir);
@@ -114,7 +118,7 @@ static void dma_tx_dump(struct eth_dma *dma)printf ("TX Buffers:\n" );/* Initialize TX DMA descriptor table */ for (i =0 ; i <TX_BUF_NUM ; i++) { - bufp = (uint8_t *)(dma->tx_buf + i *TX_BUF_SIZE ); + bufp = (uint8_t *)(dma->tx_buf + i *TX_BUF_SIZE_ALIGNED );printf ("buf%d:0x%x; " , i, (uint32_t )bufp); }printf ("\n" );
@@ -145,7 +149,7 @@ static void dma_rx_dump(struct eth_dma *dma)printf ("RX Buffers:\n" );for (i =0 ; i <RX_BUF_NUM ; i++) { - bufp = dma->rx_buf + i *RX_BUF_SIZE ; + bufp = dma->rx_buf + i *RX_BUF_SIZE_ALIGNED ;printf ("buf%d:0x%x; " , i, (uint32_t )bufp); }printf ("\n" );
@@ -163,15 +167,15 @@ static int dma_tx_init(struct eth_dma *dma)/* clear descriptor memory */ memset ((void *)(dma->tx_desc_aligned),0 , -TX_BUF_NUM *sizeof (dma64dd_t)); -memset (dma->tx_buf,0 ,TX_BUF_NUM *TX_BUF_SIZE ); +TX_BUF_NUM *DESCP_SIZE_ALIGNED ); +memset (dma->tx_buf,0 ,TX_BUF_NUM *TX_BUF_SIZE_ALIGNED );/* Initialize TX DMA descriptor table */ for (i =0 ; i <TX_BUF_NUM ; i++) { descp = (dma64dd_t *)(dma->tx_desc_aligned) + i; - bufp = dma->tx_buf + i *TX_BUF_SIZE ; + bufp = dma->tx_buf + i *TX_BUF_SIZE_ALIGNED ;/* clear buffer memory */ -memset ((void *)bufp,0 ,TX_BUF_SIZE ); +memset ((void *)bufp,0 ,TX_BUF_SIZE_ALIGNED ); ctrl =0 ;/* if last descr set endOfTable */
@@ -187,10 +191,11 @@ static int dma_tx_init(struct eth_dma *dma) descp = dma->tx_desc_aligned; bufp = dma->tx_buf;flush_dcache_range ((unsigned long )descp, - (unsigned long )(descp + -sizeof (dma64dd_t) *TX_BUF_NUM )); -flush_dcache_range ((unsigned long )(bufp), - (unsigned long )(bufp +TX_BUF_SIZE *TX_BUF_NUM )); + (unsigned long )descp + +DESCP_SIZE_ALIGNED *TX_BUF_NUM ); +flush_dcache_range ((unsigned long )bufp, + (unsigned long )bufp + +TX_BUF_SIZE_ALIGNED *TX_BUF_NUM );/* initialize the DMA channel */ writel ((uint32_t )(dma->tx_desc_aligned),GMAC0_DMA_TX_ADDR_LOW_ADDR );
@@ -215,20 +220,20 @@ static int dma_rx_init(struct eth_dma *dma)/* clear descriptor memory */ memset ((void *)(dma->rx_desc_aligned),0 , -RX_BUF_NUM *sizeof (dma64dd_t)); +RX_BUF_NUM *DESCP_SIZE_ALIGNED );/* clear buffer memory */ -memset (dma->rx_buf,0 ,RX_BUF_NUM *RX_BUF_SIZE ); +memset (dma->rx_buf,0 ,RX_BUF_NUM *RX_BUF_SIZE_ALIGNED );/* Initialize RX DMA descriptor table */ for (i =0 ; i <RX_BUF_NUM ; i++) { descp = (dma64dd_t *)(dma->rx_desc_aligned) + i; - bufp = dma->rx_buf + i *RX_BUF_SIZE ; + bufp = dma->rx_buf + i *RX_BUF_SIZE_ALIGNED ; ctrl =0 ;/* if last descr set endOfTable */ if (i == (RX_BUF_NUM -1 )) ctrl =D64_CTRL1_EOT ; descp->ctrl1 = ctrl; - descp->ctrl2 =RX_BUF_SIZE ; + descp->ctrl2 =RX_BUF_SIZE_ALIGNED ; descp->addrlow = (uint32_t )bufp; descp->addrhigh =0 ;
@@ -240,10 +245,11 @@ static int dma_rx_init(struct eth_dma *dma) bufp = dma->rx_buf;/* flush descriptor and buffer */ flush_dcache_range ((unsigned long )descp, - (unsigned long )(descp + -sizeof (dma64dd_t) *RX_BUF_NUM )); + (unsigned long )descp + +DESCP_SIZE_ALIGNED *RX_BUF_NUM );flush_dcache_range ((unsigned long )(bufp), - (unsigned long )(bufp +RX_BUF_SIZE *RX_BUF_NUM )); + (unsigned long )bufp + +RX_BUF_SIZE_ALIGNED *RX_BUF_NUM );/* initailize the DMA channel */ writel ((uint32_t )descp,GMAC0_DMA_RX_ADDR_LOW_ADDR );
@@ -292,14 +298,12 @@ static int dma_deinit(struct eth_dma *dma)free (dma->tx_buf); dma->tx_buf =NULL ; -free (dma->tx_desc); - dma->tx_desc =NULL ; +free (dma->tx_desc_aligned); dma->tx_desc_aligned =NULL ;free (dma->rx_buf); dma->rx_buf =NULL ; -free (dma->rx_desc); - dma->rx_desc =NULL ; +free (dma->rx_desc_aligned); dma->rx_desc_aligned =NULL ;return 0 ;
@@ -307,7 +311,7 @@ static int dma_deinit(struct eth_dma *dma)int gmac_tx_packet (struct eth_dma *dma,void *packet,int length) { -uint8_t *bufp = dma->tx_buf + dma->cur_tx_index *TX_BUF_SIZE ; +uint8_t *bufp = dma->tx_buf + dma->cur_tx_index *TX_BUF_SIZE_ALIGNED ;/* kick off the dma */ size_t len = length;
@@ -348,10 +352,11 @@ int gmac_tx_packet(struct eth_dma *dma, void *packet, int length) descp->ctrl2 = ctrl;/* flush descriptor and buffer */ -flush_dcache_range ((unsigned long )descp, - (unsigned long )(descp +sizeof (dma64dd_t))); +flush_dcache_range ((unsigned long )dma->tx_desc_aligned, + (unsigned long )dma->tx_desc_aligned + +DESCP_SIZE_ALIGNED *TX_BUF_NUM );flush_dcache_range ((unsigned long )bufp, - (unsigned long )(bufp +TX_BUF_SIZE )); + (unsigned long )bufp +TX_BUF_SIZE_ALIGNED );/* now update the dma last descriptor */ writel (last_desc,GMAC0_DMA_TX_PTR_ADDR );
@@ -426,14 +431,15 @@ int gmac_check_rx_done(struct eth_dma *dma, uint8_t *buf) ;/* get the packet pointer that corresponds to the rx descriptor */ - bufp = dma->rx_buf + index *RX_BUF_SIZE ; + bufp = dma->rx_buf + index *RX_BUF_SIZE_ALIGNED ; descp = (dma64dd_t *)(dma->rx_desc_aligned) + index;/* flush descriptor and buffer */ -flush_dcache_range ((unsigned long )descp, - (unsigned long )(descp +sizeof (dma64dd_t))); +flush_dcache_range ((unsigned long )dma->rx_desc_aligned, + (unsigned long )dma->rx_desc_aligned + +DESCP_SIZE_ALIGNED *RX_BUF_NUM );flush_dcache_range ((unsigned long )bufp, - (unsigned long )(bufp +RX_BUF_SIZE )); + (unsigned long )bufp +RX_BUF_SIZE_ALIGNED ); buflen = (descp->ctrl2 &D64_CTRL2_BC_MASK );
@@ -457,12 +463,13 @@ int gmac_check_rx_done(struct eth_dma *dma, uint8_t *buf)memcpy (buf, datap, rcvlen);/* update descriptor that is being added back on ring */ - descp->ctrl2 =RX_BUF_SIZE ; + descp->ctrl2 =RX_BUF_SIZE_ALIGNED ; descp->addrlow = (uint32_t )bufp; descp->addrhigh =0 ;/* flush descriptor */ -flush_dcache_range ((unsigned long )descp, - (unsigned long )(descp +sizeof (dma64dd_t))); +flush_dcache_range ((unsigned long )dma->rx_desc_aligned, + (unsigned long )dma->rx_desc_aligned + +DESCP_SIZE_ALIGNED *RX_BUF_NUM );/* set the lastdscr for the rx ring */ writel (((uint32_t )descp) &D64_XP_LD_MASK ,GMAC0_DMA_RX_PTR_ADDR );
@@ -573,7 +580,7 @@ static int gmac_enable_dma(struct eth_dma *dma, int dir)* set the lastdscr for the rx ring */ writel (((uint32_t )(dma->rx_desc_aligned) + - (RX_BUF_NUM -1 ) *RX_BUF_SIZE ) & + (RX_BUF_NUM -1 ) *RX_BUF_SIZE_ALIGNED ) &D64_XP_LD_MASK ,GMAC0_DMA_RX_PTR_ADDR ); }
@@ -893,54 +900,52 @@ int gmac_add(struct eth_device *dev)void *tmp;/* -* Desc has to be 16-byte aligned ? -* If it is 8-byte aligned by malloc, fail Tx +* Desc has to be 16-byte aligned. But for dcache flush it must be +* aligned to ARCH_DMA_MINALIGN. */ - tmp =malloc (sizeof (dma64dd_t) *TX_BUF_NUM +8 ); + tmp =memalign (ARCH_DMA_MINALIGN ,DESCP_SIZE_ALIGNED *TX_BUF_NUM );if (tmp ==NULL ) {printf ("%s: Failed to allocate TX desc Buffer\n" , __func__);return -1 ; } - dma->tx_desc = (void *)tmp; - dma->tx_desc_aligned = (void *)(((uint32_t )tmp) & (~0xf )); + dma->tx_desc_aligned = (void *)tmp;debug ("TX Descriptor Buffer: %p; length: 0x%x\n" , - dma->tx_desc_aligned,sizeof (dma64dd_t) *TX_BUF_NUM ); + dma->tx_desc_aligned,DESCP_SIZE_ALIGNED *TX_BUF_NUM ); - tmp =malloc (TX_BUF_SIZE *TX_BUF_NUM ); + tmp =memalign (ARCH_DMA_MINALIGN ,TX_BUF_SIZE_ALIGNED *TX_BUF_NUM );if (tmp ==NULL ) {printf ("%s: Failed to allocate TX Data Buffer\n" , __func__); -free (dma->tx_desc); +free (dma->tx_desc_aligned);return -1 ; } dma->tx_buf = (uint8_t *)tmp;debug ("TX Data Buffer: %p; length: 0x%x\n" , - dma->tx_buf,TX_BUF_SIZE *TX_BUF_NUM ); + dma->tx_buf,TX_BUF_SIZE_ALIGNED *TX_BUF_NUM ); -/* Desc has to be 16-byte aligned ? */ - tmp =malloc (sizeof (dma64dd_t) *RX_BUF_NUM +8 ); +/* Desc has to be 16-byte aligned */ + tmp =memalign (ARCH_DMA_MINALIGN ,DESCP_SIZE_ALIGNED *RX_BUF_NUM );if (tmp ==NULL ) {printf ("%s: Failed to allocate RX Descriptor\n" , __func__); -free (dma->tx_desc); +free (dma->tx_desc_aligned);free (dma->tx_buf);return -1 ; } - dma->rx_desc = tmp; - dma->rx_desc_aligned = (void *)(((uint32_t )tmp) & (~0xf )); + dma->rx_desc_aligned = (void *)tmp;debug ("RX Descriptor Buffer: %p, length: 0x%x\n" , - dma->rx_desc_aligned,sizeof (dma64dd_t) *RX_BUF_NUM ); + dma->rx_desc_aligned,DESCP_SIZE_ALIGNED *RX_BUF_NUM ); - tmp =malloc (RX_BUF_SIZE *RX_BUF_NUM ); + tmp =memalign (ARCH_DMA_MINALIGN ,RX_BUF_SIZE_ALIGNED *RX_BUF_NUM );if (tmp ==NULL ) {printf ("%s: Failed to allocate RX Data Buffer\n" , __func__); -free (dma->tx_desc); +free (dma->tx_desc_aligned);free (dma->tx_buf); -free (dma->rx_desc); +free (dma->rx_desc_aligned);return -1 ; } - dma->rx_buf = tmp; + dma->rx_buf = (uint8_t *)tmp;debug ("RX Data Buffer: %p; length: 0x%x\n" , - dma->rx_buf,RX_BUF_SIZE *RX_BUF_NUM ); + dma->rx_buf,RX_BUF_SIZE_ALIGNED *RX_BUF_NUM ); g_dmactrlflags =0 ;
drivers/net/bcm-sf2-eth.h +1 -3
@@ -1,5 +1,5 @@/* -* Copyright 2014 Broadcom Corporation. +* Copyright 2014-2017 Broadcom. * * SPDX-License-Identifier: GPL-2.0+ */
@@ -30,8 +30,6 @@ enum {struct eth_dma {void *tx_desc_aligned;void *rx_desc_aligned; -void *tx_desc; -void *rx_desc;uint8_t *tx_buf;uint8_t *rx_buf;
Signature · 1 line
2.7.4
PATCH 1/2 net: fix cache misaligned issue in Broadcom SF2 driver
Quoted 13 lines · Steve Rae
From: Suji Velupillai <[email protected]>
Fixed cache misaligned issue in the net driver. The issue shows-up when a call to
flush_dcache_rangeis made with unaligned memory. The memory must be aligned toARCH_DMA_MINALIGN.Signed-off-by Suji Velupillai <[email protected]>Tested-by Suji Velupillai <[email protected]>Reviewed-by Arun Parameswaran <[email protected]>Reviewed-by JD Zheng <[email protected]>Reviewed-by Shamez Kurji <[email protected]>Signed-off-by Steve Rae <[email protected]>
Quoted 7 lines
Cover Letter:
This series resolves issues specific to the Broadcom SF2 driver:
- fix cache misaligned issue
- convert toKconfig
ENDNeeds to be "Cover-letter:"
- I'll update this in V2
Quoted 323 lines
---
drivers/net/bcm-sf2-eth-gmac.c | 113 +++++++++++++++++++++--------- ----------- drivers/net/bcm-sf2-eth.h | 4 +- 2 files changed, 60 insertions(+), 57 deletions(-)drivers/net/bcm-sf2-eth- renamed from drivers/net/bcm-sf2-eth-gmac.c +0
-0
gmac.c
index f2853cf..9ff72fa 100644drivers/net/bcm-sf2-eth-gmac.c +16
-11@@ -1,5 +1,5 @@/* -* Copyright 2014 Broadcom Corporation. +* Copyright 2014-2017 Broadcom. * * SPDX-License-Identifier: GPL-2.0+ */ @@ -28,6 +28,10 @@ } \ } +#define RX_BUF_SIZE_ALIGNED ALIGN(RX_BUF_SIZE, ARCH_DMA_MINALIGN) +#define TX_BUF_SIZE_ALIGNED ALIGN(TX_BUF_SIZE, ARCH_DMA_MINALIGN) +#define DESCP_SIZE_ALIGNED ALIGN(sizeof(dma64dd_t), ARCH_DMA_MINALIGN) +static int gmac_disable_dma (struct eth_dma *dma,int dir);static int gmac_enable_dma (struct eth_dma *dma,int dir);@@ -114,7 +118,7 @@ static void dma_tx_dump(struct eth_dma *dma)printf ("TX Buffers:\n" );/* Initialize TX DMA descriptor table */ for (i =0 ; i <TX_BUF_NUM ; i++) { - bufp = (uint8_t *)(dma->tx_buf + i *TX_BUF_SIZE ); + bufp = (uint8_t *)(dma->tx_buf + i *TX_BUF_SIZE_ALIGNED );printf ("buf%d:0x%x; " , i, (uint32_t )bufp); }printf ("\n" );@@ -145,7 +149,7 @@ static void dma_rx_dump(struct eth_dma *dma)printf ("RX Buffers:\n" );for (i =0 ; i <RX_BUF_NUM ; i++) { - bufp = dma->rx_buf + i *RX_BUF_SIZE ; + bufp = dma->rx_buf + i *RX_BUF_SIZE_ALIGNED ;printf ("buf%d:0x%x; " , i, (uint32_t )bufp); }printf ("\n" );@@ -163,15 +167,15 @@ static int dma_tx_init(struct eth_dma *dma)/* clear descriptor memory */ memset ((void *)(dma->tx_desc_aligned),0 , -TX_BUF_NUM *sizeof (dma64dd_t)); -memset (dma->tx_buf,0 ,TX_BUF_NUM *TX_BUF_SIZE ); +TX_BUF_NUM *DESCP_SIZE_ALIGNED ); +memset (dma->tx_buf,0 ,TX_BUF_NUM *TX_BUF_SIZE_ALIGNED );/* Initialize TX DMA descriptor table */ for (i =0 ; i <TX_BUF_NUM ; i++) { descp = (dma64dd_t *)(dma->tx_desc_aligned) + i; - bufp = dma->tx_buf + i *TX_BUF_SIZE ; + bufp = dma->tx_buf + i *TX_BUF_SIZE_ALIGNED ;/* clear buffer memory */ -memset ((void *)bufp,0 ,TX_BUF_SIZE ); +memset ((void *)bufp,0 ,TX_BUF_SIZE_ALIGNED ); ctrl =0 ;/* if last descr set endOfTable */ @@ -187,10 +191,11 @@ static int dma_tx_init(struct eth_dma *dma) descp = dma->tx_desc_aligned; bufp = dma->tx_buf;flush_dcache_range ((unsigned long )descp, - (unsigned long )(descp + -sizeof (dma64dd_t) * TX_BUF_NUM)); -flush_dcache_range ((unsigned long )(bufp), - (unsigned long )(bufp +TX_BUF_SIZE * TX_BUF_NUM)); + (unsigned long )descp + + DESCP_SIZE_ALIGNED * TX_BUF_NUM); +flush_dcache_range ((unsigned long )bufp, + (unsigned long )bufp + +TX_BUF_SIZE_ALIGNED *TX_BUF_NUM );/* initialize the DMA channel */ writel((uint32_t)(dma->tx_desc_aligned),
GMAC0_DMA_TX_ADDR_LOW_ADDR);drivers/net/bcm-sf2-eth-gmac.c +8
-7@@ -215,20 +220,20 @@ static int dma_rx_init(struct eth_dma *dma)/* clear descriptor memory */ memset ((void *)(dma->rx_desc_aligned),0 , -RX_BUF_NUM *sizeof (dma64dd_t)); +RX_BUF_NUM *DESCP_SIZE_ALIGNED );/* clear buffer memory */ -memset (dma->rx_buf,0 ,RX_BUF_NUM *RX_BUF_SIZE ); +memset (dma->rx_buf,0 ,RX_BUF_NUM *RX_BUF_SIZE_ALIGNED );/* Initialize RX DMA descriptor table */ for (i =0 ; i <RX_BUF_NUM ; i++) { descp = (dma64dd_t *)(dma->rx_desc_aligned) + i; - bufp = dma->rx_buf + i *RX_BUF_SIZE ; + bufp = dma->rx_buf + i *RX_BUF_SIZE_ALIGNED ; ctrl =0 ;/* if last descr set endOfTable */ if (i == (RX_BUF_NUM -1 )) ctrl =D64_CTRL1_EOT ; descp->ctrl1 = ctrl; - descp->ctrl2 =RX_BUF_SIZE ; + descp->ctrl2 =RX_BUF_SIZE_ALIGNED ; descp->addrlow = (uint32_t )bufp; descp->addrhigh =0 ;@@ -240,10 +245,11 @@ static int dma_rx_init(struct eth_dma *dma) bufp = dma->rx_buf;/* flush descriptor and buffer */ flush_dcache_range ((unsigned long )descp, - (unsigned long )(descp + -sizeof (dma64dd_t) * RX_BUF_NUM)); + (unsigned long )descp + + DESCP_SIZE_ALIGNED * RX_BUF_NUM);flush_dcache_range ((unsigned long )(bufp), - (unsigned long )(bufp +RX_BUF_SIZE * RX_BUF_NUM)); + (unsigned long )bufp + + RX_BUF_SIZE_ALIGNED * RX_BUF_NUM);/* initailize the DMA channel */ writel((uint32_t)descp, GMAC0_DMA_RX_ADDR_LOW_ADDR);drivers/net/bcm-sf2-eth-gmac.c +3
-5@@ -292,14 +298,12 @@ static int dma_deinit(struct eth_dma *dma)free (dma->tx_buf); dma->tx_buf =NULL ; -free (dma->tx_desc); - dma->tx_desc =NULL ; +free (dma->tx_desc_aligned); dma->tx_desc_aligned =NULL ;free (dma->rx_buf); dma->rx_buf =NULL ; -free (dma->rx_desc); - dma->rx_desc =NULL ; +free (dma->rx_desc_aligned); dma->rx_desc_aligned =NULL ;return 0 ;@@ -307,7 +311,7 @@ static int dma_deinit(struct eth_dma *dma)int gmac_tx_packet (struct eth_dma *dma,void *packet,int length) { -uint8_t *bufp = dma->tx_buf + dma->cur_tx_index *TX_BUF_SIZE ; +uint8_t *bufp = dma->tx_buf + dma->cur_tx_index *TX_BUF_SIZE_ALIGNED ;/* kick off the dma */ size_t len = length;drivers/net/bcm-sf2-eth-gmac.c +4
-3@@ -348,10 +352,11 @@ int gmac_tx_packet(struct eth_dma *dma, void *packet, int length) descp->ctrl2 = ctrl;/* flush descriptor and buffer */ -flush_dcache_range ((unsigned long )descp, - (unsigned long )(descp +sizeof (dma64dd_t))); +flush_dcache_range ((unsigned long )dma->tx_desc_aligned, + (unsigned long )dma->tx_desc_aligned + +DESCP_SIZE_ALIGNED *TX_BUF_NUM );flush_dcache_range ((unsigned long )bufp, - (unsigned long )(bufp +TX_BUF_SIZE )); + (unsigned long )bufp +TX_BUF_SIZE_ALIGNED );/* now update the dma last descriptor */ writel(last_desc, GMAC0_DMA_TX_PTR_ADDR);drivers/net/bcm-sf2-eth-gmac.c +9
-7@@ -426,14 +431,15 @@ int gmac_check_rx_done(struct eth_dma *dma, uint8_t *buf) ;/* get the packet pointer that corresponds to the rx descriptor */ - bufp = dma->rx_buf + index *RX_BUF_SIZE ; + bufp = dma->rx_buf + index *RX_BUF_SIZE_ALIGNED ; descp = (dma64dd_t *)(dma->rx_desc_aligned) + index;/* flush descriptor and buffer */ -flush_dcache_range ((unsigned long )descp, - (unsigned long )(descp +sizeof (dma64dd_t))); +flush_dcache_range ((unsigned long )dma->rx_desc_aligned, + (unsigned long )dma->rx_desc_aligned + +DESCP_SIZE_ALIGNED *RX_BUF_NUM );flush_dcache_range ((unsigned long )bufp, - (unsigned long )(bufp +RX_BUF_SIZE )); + (unsigned long )bufp +RX_BUF_SIZE_ALIGNED ); buflen = (descp->ctrl2 &D64_CTRL2_BC_MASK );@@ -457,12 +463,13 @@ int gmac_check_rx_done(struct eth_dma *dma, uint8_t *buf)memcpy (buf, datap, rcvlen);/* update descriptor that is being added back on ring */ - descp->ctrl2 =RX_BUF_SIZE ; + descp->ctrl2 =RX_BUF_SIZE_ALIGNED ; descp->addrlow = (uint32_t )bufp; descp->addrhigh =0 ;/* flush descriptor */ -flush_dcache_range ((unsigned long )descp, - (unsigned long )(descp +sizeof (dma64dd_t))); +flush_dcache_range ((unsigned long )dma->rx_desc_aligned, + (unsigned long )dma->rx_desc_aligned + +DESCP_SIZE_ALIGNED *RX_BUF_NUM );/* set the lastdscr for the rx ring */ writel(((uint32_t)descp) & D64_XP_LD_MASK, GMAC0_DMA_RX_PTR_ADDR);drivers/net/bcm-sf2-eth-gmac.c +18
-20@@ -573,7 +580,7 @@ static int gmac_enable_dma(struct eth_dma *dma, intdir) * set the lastdscr for the rx ring */ writel (((uint32_t )(dma->rx_desc_aligned) + - (RX_BUF_NUM -1 ) *RX_BUF_SIZE ) & + (RX_BUF_NUM -1 ) *RX_BUF_SIZE_ALIGNED ) &D64_XP_LD_MASK ,GMAC0_DMA_RX_PTR_ADDR ); }@@ -893,54 +900,52 @@ int gmac_add(struct eth_device *dev)void *tmp;/* -* Desc has to be 16-byte aligned ? -* If it is 8-byte aligned by malloc, fail Tx +* Desc has to be 16-byte aligned. But for dcache flush it must be +* aligned to ARCH_DMA_MINALIGN. */ - tmp =malloc (sizeof (dma64dd_t) *TX_BUF_NUM +8 ); + tmp =memalign (ARCH_DMA_MINALIGN ,DESCP_SIZE_ALIGNED *TX_BUF_NUM );if (tmp ==NULL ) {printf ("%s: Failed to allocate TX desc Buffer\n" , __func__);return -1 ; } - dma->tx_desc = (void *)tmp; - dma->tx_desc_aligned = (void *)(((uint32_t )tmp) & (~0xf )); + dma->tx_desc_aligned = (void *)tmp;debug ("TX Descriptor Buffer: %p; length: 0x%x\n" , - dma->tx_desc_aligned,sizeof (dma64dd_t) *TX_BUF_NUM ); + dma->tx_desc_aligned,DESCP_SIZE_ALIGNED *TX_BUF_NUM ); - tmp =malloc (TX_BUF_SIZE *TX_BUF_NUM ); + tmp =memalign (ARCH_DMA_MINALIGN ,TX_BUF_SIZE_ALIGNED *TX_BUF_NUM );if (tmp ==NULL ) {printf ("%s: Failed to allocate TX Data Buffer\n" , __func__); -free (dma->tx_desc); +free (dma->tx_desc_aligned);return -1 ; } dma->tx_buf = (uint8_t *)tmp;debug ("TX Data Buffer: %p; length: 0x%x\n" , - dma->tx_buf,TX_BUF_SIZE *TX_BUF_NUM ); + dma->tx_buf,TX_BUF_SIZE_ALIGNED *TX_BUF_NUM ); -/* Desc has to be 16-byte aligned ? */ - tmp =malloc (sizeof (dma64dd_t) *RX_BUF_NUM +8 ); +/* Desc has to be 16-byte aligned */ + tmp =memalign (ARCH_DMA_MINALIGN ,DESCP_SIZE_ALIGNED *RX_BUF_NUM );if (tmp ==NULL ) {printf ("%s: Failed to allocate RX Descriptor\n" , __func__); -free (dma->tx_desc); +free (dma->tx_desc_aligned);free (dma->tx_buf);return -1 ; } - dma->rx_desc = tmp; - dma->rx_desc_aligned = (void *)(((uint32_t )tmp) & (~0xf )); + dma->rx_desc_aligned = (void *)tmp;debug ("RX Descriptor Buffer: %p, length: 0x%x\n" , - dma->rx_desc_aligned,sizeof (dma64dd_t) *RX_BUF_NUM ); + dma->rx_desc_aligned,DESCP_SIZE_ALIGNED *RX_BUF_NUM ); - tmp =malloc (RX_BUF_SIZE *RX_BUF_NUM ); + tmp =memalign (ARCH_DMA_MINALIGN ,RX_BUF_SIZE_ALIGNED *RX_BUF_NUM );if (tmp ==NULL ) {printf ("%s: Failed to allocate RX Data Buffer\n" , __func__); -free (dma->tx_desc); +free (dma->tx_desc_aligned);free (dma->tx_buf); -free (dma->rx_desc); +free (dma->rx_desc_aligned);return -1 ; } - dma->rx_buf = tmp; + dma->rx_buf = (uint8_t *)tmp;debug("RX Data Buffer: %p; length: 0x%x\n",drivers/net/bcm-sf2-eth-gmac.c +1
-1- dma->rx_buf, RX_BUF_SIZE * RX_BUF_NUM); + dma->rx_buf, RX_BUF_SIZE_ALIGNED * RX_BUF_NUM); g_dmactrlflags =0 ;drivers/net/bcm-sf2-eth.h +1
-4@@ -1,5 +1,5 @@/* -* Copyright 2014 Broadcom Corporation. +* Copyright 2014-2017 Broadcom. * * SPDX-License-Identifier: GPL-2.0+ */ @@ -30,8 +30,6 @@ enum {struct eth_dma {void *tx_desc_aligned;void *rx_desc_aligned; -void *tx_desc; -void *rx_desc;uint8_t *tx_buf;uint8_t *rx_buf; --2.7.4
PATCH 2/2 net: move Broadcom SF2 driver to Kconfig
In reply to Steve RaeFrom: Suji Velupillai <[email protected]>
move to Kconfig:
CONFIG_BCM_SF2_ETH
CONFIG_BCM_SF2_ETH_GMAC
Also modified defconfigs of all platforms that use these configs.
---
arch/arm/include/asm/arch-bcmcygnus/configs.h | 6 +----- configs/bcm28155_w1d_defconfig | 5 +++-- configs/bcm911360_entphn-ns_defconfig | 3 +++ configs/bcm911360_entphn_defconfig | 3 +++ configs/bcm911360k_defconfig | 3 +++ configs/bcm958300k-ns_defconfig | 3 +++ configs/bcm958300k_defconfig | 3 +++ configs/bcm958305k_defconfig | 3 +++ drivers/net/Kconfig | 15 +++++++++++++++ scripts/config_whitelist.txt | 2 -- 10 files changed, 37 insertions(+), 9 deletions(-)
arch/arm/include/asm/arch-bcmcygnus/configs.h +1 -5
@@ -1,5 +1,5 @@/* -* Copyright 2014 Broadcom Corporation. +* Copyright 2014-2017 Broadcom. * * SPDX-License-Identifier: GPL-2.0+ */
@@ -23,10 +23,6 @@#define CONFIG_SYS_NS16550_COM3 0x18023000/* Ethernet */ -#define CONFIG_BCM_SF2_ETH -#define CONFIG_BCM_SF2_ETH_GMAC - -#define CONFIG_PHYLIB #define CONFIG_PHY_BROADCOM #define CONFIG_PHY_RESET_DELAY 10000/* PHY reset delay in us*/
configs/bcm28155_w1d_defconfig +3 -2
@@ -1,7 +1,6 @@ CONFIG_ARM=y CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK=y CONFIG_TARGET_BCM28155_AP=y -CONFIG_SYS_EXTRA_OPTIONS="BCM_SF2_ETH,BCM_SF2_ETH_GMAC" CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set
@@ -15,7 +14,6 @@ CONFIG_CMD_MMC=y CONFIG_CMD_I2C=y CONFIG_CMD_GPIO=y # CONFIG_CMD_SETEXPR is not set -# CONFIG_CMD_NET is not set # CONFIG_CMD_NFS is not set CONFIG_CMD_CACHE=y CONFIG_CMD_FAT=y
@@ -33,3 +31,6 @@ CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_G_DNL_MANUFACTURER="Broadcom Corporation" CONFIG_G_DNL_VENDOR_NUM=0x18d1 CONFIG_G_DNL_PRODUCT_NUM=0x0d02 +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=y
configs/bcm911360_entphn-ns_defconfig +3 -0
@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=y
configs/bcm911360_entphn_defconfig +3 -0
@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=y
configs/bcm911360k_defconfig +3 -0
@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=y
configs/bcm958300k-ns_defconfig +3 -0
@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=y
configs/bcm958300k_defconfig +3 -0
@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=y
configs/bcm958305k_defconfig +3 -0
@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=y
drivers/net/Kconfig +15 -0
@@ -40,6 +40,21 @@ config ALTERA_TSE Please find details on the "Triple-Speed Ethernet MegaCore Function Resource Center" of Altera. +config BCM_SF2_ETH + bool "Broadcom SF2 (Starfighter2) Ethernet support" + select PHYLIB + help + This driver provides a MAC and DMA abstraction framework to + support multiple Broadcom SoCs. + +config BCM_SF2_ETH_GMAC + bool "Broadcom SF2 (Starfighter2) GMAC Ethernet support" + depends on BCM_SF2_ETH + help + This driver provides support to ethernet for bcmcygnus specific + based platforms only and it is based on the framework provided + by the Starfighter2 driver. + config DWC_ETH_QOS bool "Synopsys DWC Ethernet QOS device support" depends on DM_ETH
scripts/config_whitelist.txt +0 -2
@@ -250,9 +250,7 @@ CONFIG_BCH_CONST_PARAMS CONFIG_BCH_CONST_T CONFIG_BCM2835_GPIO CONFIG_BCM283X_MU_SERIAL -CONFIG_BCM_SF2_ETH CONFIG_BCM_SF2_ETH_DEFAULT_PORT -CONFIG_BCM_SF2_ETH_GMAC CONFIG_BD_NUM_CPUS CONFIG_BF506_UART0_PORTF CONFIG_BF506_UART1_PORTG
Signature · 1 line
2.7.4
PATCH 2/2 net: move Broadcom SF2 driver to Kconfig
Quoted 152 lines · Steve Rae
From: Suji Velupillai <[email protected]>
move to
Kconfig:
CONFIG_BCM_SF2_ETH
CONFIG_BCM_SF2_ETH_GMACAlso modified defconfigs of all platforms that use these configs.
Signed-off-by Suji Velupillai <[email protected]>Tested-by Suji Velupillai <[email protected]>Reviewed-by JD Zheng <[email protected]>Reviewed-by Scott Branden <[email protected]>Signed-off-by Steve Rae <[email protected]>---
arch/arm/include/asm/arch-bcmcygnus/configs.h | 6 +----- configs/bcm28155_w1d_defconfig | 5 +++-- configs/bcm911360_entphn-ns_defconfig | 3 +++ configs/bcm911360_entphn_defconfig | 3 +++ configs/bcm911360k_defconfig | 3 +++ configs/bcm958300k-ns_defconfig | 3 +++ configs/bcm958300k_defconfig | 3 +++ configs/bcm958305k_defconfig | 3 +++ drivers/net/Kconfig | 15 +++++++++++++++ scripts/config_whitelist.txt | 2 -- 10 files changed, 37 insertions(+), 9 deletions(-)arch/arm/include/asm/arch-bcmcygnus/configs.h +1
-5@@ -1,5 +1,5 @@/* -* Copyright 2014 Broadcom Corporation. +* Copyright 2014-2017 Broadcom. * * SPDX-License-Identifier: GPL-2.0+ */ @@ -23,10 +23,6 @@#define CONFIG_SYS_NS16550_COM3 0x18023000/* Ethernet */ -#define CONFIG_BCM_SF2_ETH -#define CONFIG_BCM_SF2_ETH_GMAC - -#define CONFIG_PHYLIB #define CONFIG_PHY_BROADCOM #define CONFIG_PHY_RESET_DELAY 10000/* PHY reset delay in us*/ configs/bcm28155_w1d_defconfig +3
-2@@ -1,7 +1,6 @@ CONFIG_ARM=y CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK=y CONFIG_TARGET_BCM28155_AP=y -CONFIG_SYS_EXTRA_OPTIONS="BCM_SF2_ETH,BCM_SF2_ETH_GMAC" CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set@@ -15,7 +14,6 @@ CONFIG_CMD_MMC=y CONFIG_CMD_I2C=y CONFIG_CMD_GPIO=y # CONFIG_CMD_SETEXPR is not set -# CONFIG_CMD_NET is not set # CONFIG_CMD_NFS is not set CONFIG_CMD_CACHE=y CONFIG_CMD_FAT=y@@ -33,3 +31,6 @@ CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_G_DNL_MANUFACTURER="Broadcom Corporation" CONFIG_G_DNL_VENDOR_NUM=0x18d1 CONFIG_G_DNL_PRODUCT_NUM=0x0d02 +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm911360_entphn-ns_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm911360_entphn_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm911360k_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm958300k-ns_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm958300k_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm958305k_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=ydrivers/net/Kconfig +2
-0@@ -40,6 +40,21 @@ config ALTERA_TSE Please find details on the "Triple-Speed Ethernet MegaCore Function Resource Center" of Altera. +config BCM_SF2_ETH + bool "Broadcom SF2 (Starfighter2) Ethernet support"
drivers/net/Kconfig config ALTERA_TSE · line 54
Quoted 10 lines
drivers/net/Kconfig +10
-0+ select PHYLIB + help + This driver provides a MAC and DMA abstraction framework to + support multiple Broadcom SoCs. + +config BCM_SF2_ETH_GMAC + bool "Broadcom SF2 (Starfighter2) GMAC Ethernet support" + depends on BCM_SF2_ETH + help + This driver provides support to ethernet for bcmcygnus specific
Odd that the config doesn't include "cygnus" in it if that's what it applies to.
Quoted 11 lines
drivers/net/Kconfig +3
-0+ based platforms only and it is based on the framework provided + by the Starfighter2 driver. + config DWC_ETH_QOS bool "Synopsys DWC Ethernet QOS device support" depends on DM_ETHscripts/config_whitelist.txt +0
-0
scripts/config_whitelist.txt CONFIG_BCH_CONST_PARAMS · line 253
Quoted 5 lines
scripts/config_whitelist.txt +0
-1@@ -250,9 +250,7 @@ CONFIG_BCH_CONST_PARAMS CONFIG_BCH_CONST_T CONFIG_BCM2835_GPIO CONFIG_BCM283X_MU_SERIAL -CONFIG_BCM_SF2_ETH CONFIG_BCM_SF2_ETH_DEFAULT_PORT
Any reason not to move this along with the driver enable?
Quoted 11 lines
scripts/config_whitelist.txt +0
-2-CONFIG_BCM_SF2_ETH_GMAC CONFIG_BD_NUM_CPUS CONFIG_BF506_UART0_PORTF CONFIG_BF506_UART1_PORTG --2.7.4
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/listinfo/u-boot
PATCH 2/2 net: move Broadcom SF2 driver to Kconfig
Thank you Joe for your time and feedback,
Please see the answers inline.
Suji
On Tue, Mar 21, 2017 at 11:53 AM, Joe Hershberger <[email protected]
Quoted 159 lines
wrote:
Quoted 27 lines · Steve Rae
From: Suji Velupillai <[email protected]>
move to
Kconfig:
CONFIG_BCM_SF2_ETH
CONFIG_BCM_SF2_ETH_GMACAlso modified defconfigs of all platforms that use these configs.
Signed-off-by Suji Velupillai <[email protected]>Tested-by Suji Velupillai <[email protected]>Reviewed-by JD Zheng <[email protected]>Reviewed-by Scott Branden <[email protected]>Signed-off-by Steve Rae <[email protected]>---
arch/arm/include/asm/arch-bcmcygnus/configs.h | 6 +----- configs/bcm28155_w1d_defconfig | 5 +++-- configs/bcm911360_entphn-ns_defconfig | 3 +++ configs/bcm911360_entphn_defconfig | 3 +++ configs/bcm911360k_defconfig | 3 +++ configs/bcm958300k-ns_defconfig | 3 +++ configs/bcm958300k_defconfig | 3 +++ configs/bcm958305k_defconfig | 3 +++ drivers/net/Kconfig | 15 +++++++++++++++ scripts/config_whitelist.txt | 2 -- 10 files changed, 37 insertions(+), 9 deletions(-)Review
Quoted 1 line
(quoted diff) +0
-0
b/arch/arm/include/asm/arch-bcmcygnus/configs.hconfigs/bcm28155_w1d_
Quoted 22 lines
index af7f3bf..92b1c5e 100644
arch/arm/include/asm/arch-bcmcygnus/configs.h +1
-5@@ -1,5 +1,5 @@/* -* Copyright 2014 Broadcom Corporation. +* Copyright 2014-2017 Broadcom. * * SPDX-License-Identifier: GPL-2.0+ */ @@ -23,10 +23,6 @@#define CONFIG_SYS_NS16550_COM3 0x18023000/* Ethernet */ -#define CONFIG_BCM_SF2_ETH -#define CONFIG_BCM_SF2_ETH_GMAC - -#define CONFIG_PHYLIB #define CONFIG_PHY_BROADCOM #define CONFIG_PHY_RESET_DELAY 10000/* PHY reset delay in us*/ configs/bcm28155_w1d_ renamed from configs/bcm28155_w1d_defconfig +0
-0defconfig
Review
Quoted 27 lines
index aa5216e..4adbce6 100644
configs/bcm28155_w1d_defconfig +3
-2@@ -1,7 +1,6 @@ CONFIG_ARM=y CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK=y CONFIG_TARGET_BCM28155_AP=y -CONFIG_SYS_EXTRA_OPTIONS="BCM_SF2_ETH,BCM_SF2_ETH_GMAC" CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set@@ -15,7 +14,6 @@ CONFIG_CMD_MMC=y CONFIG_CMD_I2C=y CONFIG_CMD_GPIO=y # CONFIG_CMD_SETEXPR is not set -# CONFIG_CMD_NET is not set # CONFIG_CMD_NFS is not set CONFIG_CMD_CACHE=y CONFIG_CMD_FAT=y@@ -33,3 +31,6 @@ CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_G_DNL_MANUFACTURER="Broadcom Corporation" CONFIG_G_DNL_VENDOR_NUM=0x18d1 CONFIG_G_DNL_PRODUCT_NUM=0x0d02 +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=y(quoted diff) +0
-0b/configs/bcm911360_entphn-ns_defconfig
Review
Quoted 11 lines
index adcc152..f1df78a 100644
configs/bcm911360_entphn-ns_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=y(quoted diff) +0
-0b/configs/bcm911360_entphn_defconfig
configs/bcm958300k-ns_
Quoted 22 lines
index e49071d..22da69e 100644
configs/bcm911360_entphn_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm911360k_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm958300k-ns_ renamed from configs/bcm958300k-ns_defconfig +0
-0defconfig
Quoted 37 lines
index 26d0b0b..c837721 100644
configs/bcm958300k-ns_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm958300k_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm958305k_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=ydrivers/net/Kconfig +0
-0drivers/net/Kconfig config ALTERA_TSE · line 40
Quoted 1 line
drivers/net/Kconfig +0
-0@@ -40,6 +40,21 @@ config ALTERA_TSE Please find details on the "Triple-Speed Ethernet MegaCoreFunction
Quoted 2 lines
drivers/net/Kconfig +0
-0Resource Center" of Altera.
Quoted 17 lines
drivers/net/Kconfig config ALTERA_TSE · line 54
Quoted 12 lines
drivers/net/Kconfig +12
-0+config BCM_SF2_ETH + bool "Broadcom SF2 (Starfighter2) Ethernet support" + select PHYLIB + help + This driver provides a MAC and DMA abstraction framework to + support multiple Broadcom SoCs. + +config BCM_SF2_ETH_GMAC + bool "Broadcom SF2 (Starfighter2) GMAC Ethernet support" + depends on BCM_SF2_ETH + help + This driver provides support to ethernet for bcmcygnus specificOdd that the config doesn't include "cygnus" in it if that's what it applies to.
It is because the driver is common to multiple SOC, cygnus is one of them. (cc'ed Jiandong Zheng in this reply, the original committer of the driver)
Quoted 10 lines
Quoted 10 lines
drivers/net/Kconfig +3
-0+ based platforms only and it is based on the framework provided + by the Starfighter2 driver. + config DWC_ETH_QOS bool "Synopsys DWC Ethernet QOS device support" depends on DM_ETHscripts/config_whitelist.txt +0
-0
Quoted 9 lines
scripts/config_whitelist.txt CONFIG_BCH_CONST_PARAMS · line 253
Quoted 6 lines
scripts/config_whitelist.txt +0
-1@@ -250,9 +250,7 @@ CONFIG_BCH_CONST_PARAMS CONFIG_BCH_CONST_T CONFIG_BCM2835_GPIO CONFIG_BCM283X_MU_SERIAL -CONFIG_BCM_SF2_ETH CONFIG_BCM_SF2_ETH_DEFAULT_PORTAny reason not to move this along with the driver enable?
Yes we can move this with the driver enable. Can we make this as separate commit?
Quoted 12 lines
Quoted 11 lines
scripts/config_whitelist.txt +0
-2-CONFIG_BCM_SF2_ETH_GMAC CONFIG_BD_NUM_CPUS CONFIG_BF506_UART0_PORTF CONFIG_BF506_UART1_PORTG --2.7.4
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/listinfo/u-boot
PATCH 2/2 net: move Broadcom SF2 driver to Kconfig
Quoted 183 lines · Suji Velupillai
Thank you Joe for your time and feedback,
Please see the answers inline.
SujiQuoted 158 lines · Joe Hershberger
Quoted 156 lines · Steve Rae
From: Suji Velupillai <[email protected]>
move to
Kconfig:
CONFIG_BCM_SF2_ETH
CONFIG_BCM_SF2_ETH_GMACAlso modified defconfigs of all platforms that use these configs.
Signed-off-by Suji Velupillai <[email protected]>Tested-by Suji Velupillai <[email protected]>Reviewed-by JD Zheng <[email protected]>Reviewed-by Scott Branden <[email protected]>Signed-off-by Steve Rae <[email protected]>---
arch/arm/include/asm/arch-bcmcygnus/configs.h | 6 +----- configs/bcm28155_w1d_defconfig | 5 +++-- configs/bcm911360_entphn-ns_defconfig | 3 +++ configs/bcm911360_entphn_defconfig | 3 +++ configs/bcm911360k_defconfig | 3 +++ configs/bcm958300k-ns_defconfig | 3 +++ configs/bcm958300k_defconfig | 3 +++ configs/bcm958305k_defconfig | 3 +++ drivers/net/Kconfig | 15 +++++++++++++++ scripts/config_whitelist.txt | 2 -- 10 files changed, 37 insertions(+), 9 deletions(-)arch/arm/include/asm/arch-bcmcygnus/configs.h +1
-5@@ -1,5 +1,5 @@/* -* Copyright 2014 Broadcom Corporation. +* Copyright 2014-2017 Broadcom. * * SPDX-License-Identifier: GPL-2.0+ */ @@ -23,10 +23,6 @@#define CONFIG_SYS_NS16550_COM3 0x18023000/* Ethernet */ -#define CONFIG_BCM_SF2_ETH -#define CONFIG_BCM_SF2_ETH_GMAC - -#define CONFIG_PHYLIB #define CONFIG_PHY_BROADCOM #define CONFIG_PHY_RESET_DELAY 10000/* PHY reset delay in us*/ configs/bcm28155_w1d_defconfig +3
-2@@ -1,7 +1,6 @@ CONFIG_ARM=y CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK=y CONFIG_TARGET_BCM28155_AP=y -CONFIG_SYS_EXTRA_OPTIONS="BCM_SF2_ETH,BCM_SF2_ETH_GMAC" CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set@@ -15,7 +14,6 @@ CONFIG_CMD_MMC=y CONFIG_CMD_I2C=y CONFIG_CMD_GPIO=y # CONFIG_CMD_SETEXPR is not set -# CONFIG_CMD_NET is not set # CONFIG_CMD_NFS is not set CONFIG_CMD_CACHE=y CONFIG_CMD_FAT=y@@ -33,3 +31,6 @@ CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_G_DNL_MANUFACTURER="Broadcom Corporation" CONFIG_G_DNL_VENDOR_NUM=0x18d1 CONFIG_G_DNL_PRODUCT_NUM=0x0d02 +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm911360_entphn-ns_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm911360_entphn_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm911360k_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm958300k-ns_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm958300k_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=yconfigs/bcm958305k_defconfig +3
-0@@ -19,3 +19,6 @@ CONFIG_CMD_TIME=y CONFIG_CMD_FAT=y CONFIG_SYS_NS16550=y CONFIG_OF_LIBFDT=y +CONFIG_NETDEVICES=y +CONFIG_BCM_SF2_ETH=y +CONFIG_BCM_SF2_ETH_GMAC=ydrivers/net/Kconfig +0
-0@@ -40,6 +40,21 @@ config ALTERA_TSE Please find details on the "Triple-Speed Ethernet MegaCoreFunction
Resource Center" of Altera.Quoted 17 lines
Quoted 12 lines
drivers/net/Kconfig +12
-0+config BCM_SF2_ETH + bool "Broadcom SF2 (Starfighter2) Ethernet support" + select PHYLIB + help + This driver provides a MAC and DMA abstraction framework to + support multiple Broadcom SoCs. + +config BCM_SF2_ETH_GMAC + bool "Broadcom SF2 (Starfighter2) GMAC Ethernet support" + depends on BCM_SF2_ETH + help + This driver provides support to ethernet for bcmcygnusQuoted 1 line
specific
Odd that the config doesn't include "cygnus" in it if that's what it applies to.
Quoted 2 lines
It is because the driver is common to multiple SOC, cygnus is one of them. (cc'ed Jiandong Zheng in this reply, the original committer of the driver)
My biggest concern here is there is no information that would allow a user to determine what the difference is between this option and the one above (without "_GMAC"). More details are needed above as well. Such as which other SoCs use that framework.
Quoted 20 lines
Quoted 10 lines
Quoted 10 lines
drivers/net/Kconfig +3
-0+ based platforms only and it is based on the framework provided + by the Starfighter2 driver. + config DWC_ETH_QOS bool "Synopsys DWC Ethernet QOS device support" depends on DM_ETHscripts/config_whitelist.txt +0
-0Quoted 8 lines
scripts/config_whitelist.txt CONFIG_BCH_CONST_PARAMS · line 253
Quoted 6 lines
scripts/config_whitelist.txt +0
-1@@ -250,9 +250,7 @@ CONFIG_BCH_CONST_PARAMS CONFIG_BCH_CONST_T CONFIG_BCM2835_GPIO CONFIG_BCM283X_MU_SERIAL -CONFIG_BCM_SF2_ETH CONFIG_BCM_SF2_ETH_DEFAULT_PORTAny reason not to move this along with the driver enable?
Quoted 2 lines
Yes we can move this with the driver enable. Can we make this as separate commit?
That's no problem.
Quoted 13 lines
Quoted 11 lines
Quoted 11 lines
scripts/config_whitelist.txt +0
-2-CONFIG_BCM_SF2_ETH_GMAC CONFIG_BD_NUM_CPUS CONFIG_BF506_UART0_PORTF CONFIG_BF506_UART1_PORTG --2.7.4
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/listinfo/u-boot
PATCH 1/2 net: fix cache misaligned issue in Broadcom SF2 driver
In reply to Steve RaeQuoted 6 lines · Steve Rae
From: Suji Velupillai <[email protected]>
Fixed cache misaligned issue in the net driver. The issue shows-up when a call to
flush_dcache_rangeis made with unaligned memory. The memory must be aligned toARCH_DMA_MINALIGN.
Quoted 6 lines
Signed-off-by Suji Velupillai <[email protected]>Tested-by Suji Velupillai <[email protected]>Reviewed-by Arun Parameswaran <[email protected]>Reviewed-by JD Zheng <[email protected]>Reviewed-by Shamez Kurji <[email protected]>Signed-off-by Steve Rae <[email protected]>