021a5913aa3b00f5a8eaf9ec4bc1ba7681e6635c
[openwrt/staging/mkresin.git] /
1 From b4dfd8e92956b396d3438212bc9a0be6267b8b34 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Tue, 12 Apr 2016 13:30:45 +0200
4 Subject: [PATCH] bgmac: reset & enable Ethernet core before using it
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 This fixes Ethernet on D-Link DIR-885L with BCM47094 SoC. Felix reported
10 similar fix was needed for his BCM4709 device (Buffalo WXR-1900DHP?).
11 I tested this for regressions on BCM4706, BCM4708A0 and BCM47081A0.
12
13 Cc: Felix Fietkau <nbd@nbd.name>
14 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
15 Signed-off-by: David S. Miller <davem@davemloft.net>
16 ---
17
18 --- a/drivers/net/ethernet/broadcom/bgmac.c
19 +++ b/drivers/net/ethernet/broadcom/bgmac.c
20 @@ -1586,6 +1586,11 @@ static int bgmac_probe(struct bcma_devic
21 dev_warn(&core->dev, "Using random MAC: %pM\n", mac);
22 }
23
24 + /* This (reset &) enable is not preset in specs or reference driver but
25 + * Broadcom does it in arch PCI code when enabling fake PCI device.
26 + */
27 + bcma_core_enable(core, 0);
28 +
29 /* Allocation and references */
30 net_dev = alloc_etherdev(sizeof(*bgmac));
31 if (!net_dev)