From patchwork Tue Jan 28 12:03:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 240407 List-Id: U-Boot discussion From: frank-w at public-files.de (Frank Wunderlich) Date: Tue, 28 Jan 2020 13:03:31 +0100 Subject: Aw: Re: [U-boot, 4/4] configs: mediatek: enable mt7622 ethernet support In-Reply-To: <20200127184906.GA21028@bill-the-cat> References: <20200121113200.24259-1-Mark-MC.Lee@mediatek.com> <20200121113200.24259-5-Mark-MC.Lee@mediatek.com> <20200127184906.GA21028@bill-the-cat> Message-ID: Hi tom, thanks for testing imho the first 3 can be fixed by this: did not get the last 2 (after fixing the first 3)... i can send full patch if it's ok regards Frank > Gesendet: Montag, 27. Januar 2020 um 19:49 Uhr > Von: "Tom Rini" > An: MarkLee > Cc: "Albert Aribaud" , "Ryder Lee" , "Steven Liu" , "Joe Hershberger" , u-boot at lists.denx.de, GSS_MTK_Uboot_upstream > Betreff: Re: [U-boot,4/4] configs: mediatek: enable mt7622 ethernet support > > On Tue, Jan 21, 2020 at 07:32:00PM +0800, MarkLee wrote: > > > This patch enable mt7622 ethernet support in its defconfig > > > > Signed-off-by: MarkLee > > --- > > configs/mt7622_rfb_defconfig | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/configs/mt7622_rfb_defconfig b/configs/mt7622_rfb_defconfig > > index e1917e70e7..806087a3d6 100644 > > --- a/configs/mt7622_rfb_defconfig > > +++ b/configs/mt7622_rfb_defconfig > > @@ -34,6 +34,10 @@ CONFIG_SPI_FLASH_SPANSION=y > > CONFIG_SPI_FLASH_STMICRO=y > > CONFIG_SPI_FLASH_WINBOND=y > > CONFIG_DM_ETH=y > > +CONFIG_PHY_FIXED=y > > +CONFIG_MEDIATEK_ETH=y > > +CONFIG_NET_RANDOM_ETHADDR=y > > +CONFIG_CMD_PING=y > > CONFIG_PINCTRL=y > > CONFIG_PINCONF=y > > CONFIG_PINCTRL_MT7622=y > > This leads to warnings in the ethernet driver: > drivers/net/mtk_eth.c: In function 'mtk_eth_fifo_init': > drivers/net/mtk_eth.c:856:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] > flush_dcache_range((u32)pkt_base, (u32)(pkt_base + TOTAL_PKT_BUF_SIZE)); > ^ > drivers/net/mtk_eth.c:856:36: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] > ^ > drivers/net/mtk_eth.c: In function 'mtk_eth_send': > drivers/net/mtk_eth.c:968:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] > flush_dcache_range((u32)pkt_base, (u32)pkt_base + > drivers/net/mtk_eth.c:968:36: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] > drivers/net/mtk_eth.c: In function 'mtk_eth_recv': > drivers/net/mtk_eth.c:994:26: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] > invalidate_dcache_range((u32)pkt_base, (u32)pkt_base + > ^ > drivers/net/mtk_eth.c:994:41: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] > ^ > drivers/net/mtk_eth.c: In function 'mtk_eth_probe': > drivers/net/mtk_eth.c:1026:18: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] > priv->fe_base = (void *)iobase; > ^ > drivers/net/mtk_eth.c:1029:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] > priv->gmac_base = (void *)(iobase + GMAC_BASE); > > -- > Tom > diff --git a/drivers/net/mtk_eth.c b/drivers/net/mtk_eth.c index 6cffc3f32a..d13020a624 100644 --- a/drivers/net/mtk_eth.c +++ b/drivers/net/mtk_eth.c @@ -853,7 +853,7 @@ static void mtk_eth_fifo_init(struct mtk_eth_priv *priv) memset(priv->rx_ring_noc, 0, NUM_RX_DESC * sizeof(struct pdma_rxdesc)); memset(priv->pkt_pool, 0, TOTAL_PKT_BUF_SIZE); - flush_dcache_range((u32)pkt_base, (u32)(pkt_base + TOTAL_PKT_BUF_SIZE)); + flush_dcache_range((int)pkt_base, (int)(pkt_base + TOTAL_PKT_BUF_SIZE)); priv->rx_dma_owner_idx0 = 0; priv->tx_cpu_owner_idx0 = 0; @@ -965,7 +965,7 @@ static int mtk_eth_send(struct udevice *dev, void *packet, int length) pkt_base = (void *)phys_to_virt(priv->tx_ring_noc[idx].txd_info1.SDP0); memcpy(pkt_base, packet, length); - flush_dcache_range((u32)pkt_base, (u32)pkt_base + + flush_dcache_range((int)pkt_base, (int)pkt_base + roundup(length, ARCH_DMA_MINALIGN)); priv->tx_ring_noc[idx].txd_info2.SDL0 = length; @@ -991,8 +991,8 @@ static int mtk_eth_recv(struct udevice *dev, int flags, uchar **packetp) length = priv->rx_ring_noc[idx].rxd_info2.PLEN0; pkt_base = (void *)phys_to_virt(priv->rx_ring_noc[idx].rxd_info1.PDP0); - invalidate_dcache_range((u32)pkt_base, (u32)pkt_base + - roundup(length, ARCH_DMA_MINALIGN)); + invalidate_dcache_range((int)pkt_base, (unsigned int)(pkt_base + + roundup(length, ARCH_DMA_MINALIGN))); if (packetp) *packetp = pkt_base;