From 2bc9700c0d43b8fb0e4e3a6738e2ff8340ce78a1 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 4 Jan 2014 18:27:09 +0000 Subject: bcm53xx: update the ethernet core hacks The PHY always says there is no link Instead of doing this dma sync a mdelay does the same trick and it is as unreliable. Signed-off-by: Hauke Mehrtens SVN-Revision: 39202 --- ...-make-bgmac-work-on-systems-without-nvram.patch | 37 +++++++++++++---- .../patches-3.10/776-bgmac-add-dma-sync.patch | 46 ---------------------- 2 files changed, 30 insertions(+), 53 deletions(-) delete mode 100644 target/linux/generic/patches-3.10/776-bgmac-add-dma-sync.patch (limited to 'target') diff --git a/target/linux/bcm53xx/patches-3.10/202-bgmac-make-bgmac-work-on-systems-without-nvram.patch b/target/linux/bcm53xx/patches-3.10/202-bgmac-make-bgmac-work-on-systems-without-nvram.patch index 98fd788f5b..e11a31f1f2 100644 --- a/target/linux/bcm53xx/patches-3.10/202-bgmac-make-bgmac-work-on-systems-without-nvram.patch +++ b/target/linux/bcm53xx/patches-3.10/202-bgmac-make-bgmac-work-on-systems-without-nvram.patch @@ -1,9 +1,10 @@ -bgmac: make bgmac work on systems without nvram +These are some hackish patches to make the Ethernet driver work somehow +on this arm core. +The flash driver is not working, so we removed the nvram reading, this +should be changed after we have a flash driver. +The mdelay(1) is a ugly workaround for this arm chip, this seams to be a dma problem. -Signed-off-by: Hauke Mehrtens ---- - drivers/net/ethernet/broadcom/bgmac.c | 4 ++++ - 1 file changed, 4 insertions(+) +The PHY says it is not connected by default, just ignore it. --- a/drivers/net/ethernet/broadcom/Kconfig +++ b/drivers/net/ethernet/broadcom/Kconfig @@ -30,7 +31,18 @@ Signed-off-by: Hauke Mehrtens static const struct bcma_device_id bgmac_bcma_tbl[] = { BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_4706_MAC_GBIT, BCMA_ANY_REV, BCMA_ANY_CLASS), -@@ -1445,7 +1449,7 @@ static int bgmac_probe(struct bcma_devic +@@ -165,6 +169,10 @@ static netdev_tx_t bgmac_dma_tx_add(stru + + netdev_sent_queue(net_dev, skb->len); + ++ if (bgmac->core->bus->chipinfo.id == BCMA_CHIP_ID_BCM4707 || ++ bgmac->core->bus->chipinfo.id == BCMA_CHIP_ID_BCM53018) ++ mdelay(1); ++ + wmb(); + + /* Increase ring->end to point empty slot. We tell hardware the first +@@ -1438,7 +1446,7 @@ static int bgmac_probe(struct bcma_devic int err; /* We don't support 2nd, 3rd, ... units, SPROM has to be adjusted */ @@ -39,7 +51,7 @@ Signed-off-by: Hauke Mehrtens pr_err("Unsupported core_unit %d\n", core->core_unit); return -ENOTSUPP; } -@@ -1541,8 +1545,7 @@ static int bgmac_probe(struct bcma_devic +@@ -1534,8 +1542,7 @@ static int bgmac_probe(struct bcma_devic /* TODO: reset the external phy. Specs are needed */ bgmac_phy_reset(bgmac); @@ -49,3 +61,14 @@ Signed-off-by: Hauke Mehrtens if (bgmac->has_robosw) bgmac_warn(bgmac, "Support for Roboswitch not implemented\n"); +--- a/drivers/net/phy/phy_device.c ++++ b/drivers/net/phy/phy_device.c +@@ -814,7 +814,7 @@ int genphy_update_link(struct phy_device + return status; + + if ((status & BMSR_LSTATUS) == 0) +- phydev->link = 0; ++ phydev->link = 1; + else + phydev->link = 1; + diff --git a/target/linux/generic/patches-3.10/776-bgmac-add-dma-sync.patch b/target/linux/generic/patches-3.10/776-bgmac-add-dma-sync.patch deleted file mode 100644 index 15ad5155ad..0000000000 --- a/target/linux/generic/patches-3.10/776-bgmac-add-dma-sync.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 88d0993dbe84a9b88212a4845fca28bf4c919ffb Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Tue, 26 Nov 2013 23:59:32 +0100 -Subject: [PATCH 14/16] bgmac: stuff - ---- - drivers/net/ethernet/broadcom/bgmac.c | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/drivers/net/ethernet/broadcom/bgmac.c -+++ b/drivers/net/ethernet/broadcom/bgmac.c -@@ -123,6 +123,7 @@ static netdev_tx_t bgmac_dma_tx_add(stru - struct net_device *net_dev = bgmac->net_dev; - struct bgmac_dma_desc *dma_desc; - struct bgmac_slot_info *slot; -+ int size = ring->num_slots * sizeof(struct bgmac_dma_desc); - u32 ctl0, ctl1; - int free_slots; - -@@ -163,6 +164,8 @@ static netdev_tx_t bgmac_dma_tx_add(stru - dma_desc->ctl0 = cpu_to_le32(ctl0); - dma_desc->ctl1 = cpu_to_le32(ctl1); - -+ dma_sync_single_for_device(dma_dev, ring->dma_base, size, DMA_TO_DEVICE); -+ - netdev_sent_queue(net_dev, skb->len); - - wmb(); -@@ -313,6 +316,8 @@ static void bgmac_dma_rx_setup_desc(stru - struct bgmac_dma_ring *ring, int desc_idx) - { - struct bgmac_dma_desc *dma_desc = ring->cpu_base + desc_idx; -+ struct device *dma_dev = bgmac->core->dma_dev; -+ int size = ring->num_slots * sizeof(struct bgmac_dma_desc); - u32 ctl0 = 0, ctl1 = 0; - - if (desc_idx == ring->num_slots - 1) -@@ -327,6 +332,8 @@ static void bgmac_dma_rx_setup_desc(stru - dma_desc->addr_high = cpu_to_le32(upper_32_bits(ring->slots[desc_idx].dma_addr)); - dma_desc->ctl0 = cpu_to_le32(ctl0); - dma_desc->ctl1 = cpu_to_le32(ctl1); -+ -+ dma_sync_single_for_device(dma_dev, ring->dma_base, size, DMA_TO_DEVICE); - } - - static int bgmac_dma_rx_read(struct bgmac *bgmac, struct bgmac_dma_ring *ring, -- cgit v1.2.3