1 From b7d1d1f345bb3b25c360c1df812d98866e2ee7fb Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Sat, 30 Sep 2017 13:50:03 +0200
4 Subject: [PATCH 2/4] bcm63xx_enet: use platform data for dma channel numbers
6 To reduce the reliance on device ids, pass the dma channel numbers to
7 the enet devices as platform data.
9 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
11 arch/mips/bcm63xx/dev-enet.c | 8 ++++++++
12 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h | 4 ++++
13 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 11 ++---------
14 3 files changed, 14 insertions(+), 9 deletions(-)
16 --- a/arch/mips/bcm63xx/dev-enet.c
17 +++ b/arch/mips/bcm63xx/dev-enet.c
18 @@ -265,6 +265,14 @@ int __init bcm63xx_enet_register(int uni
19 dpd->dma_chan_width = ENETDMA_CHAN_WIDTH;
30 ret = platform_device_register(pdev);
33 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
34 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
35 @@ -55,6 +55,10 @@ struct bcm63xx_enet_platform_data {
37 /* DMA descriptor shift */
38 unsigned int dma_desc_shift;
40 + /* dma channel ids */
46 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
47 +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
48 @@ -1755,15 +1755,6 @@ static int bcm_enet_probe(struct platfor
49 priv->irq_tx = res_irq_tx->start;
50 priv->mac_id = pdev->id;
52 - /* get rx & tx dma channel id for this mac */
53 - if (priv->mac_id == 0) {
61 priv->mac_clk = devm_clk_get(&pdev->dev, "enet");
62 if (IS_ERR(priv->mac_clk)) {
63 ret = PTR_ERR(priv->mac_clk);
64 @@ -1795,6 +1786,8 @@ static int bcm_enet_probe(struct platfor
65 priv->dma_chan_width = pd->dma_chan_width;
66 priv->dma_has_sram = pd->dma_has_sram;
67 priv->dma_desc_shift = pd->dma_desc_shift;
68 + priv->rx_chan = pd->rx_chan;
69 + priv->tx_chan = pd->tx_chan;
72 if (priv->mac_id == 0 && priv->has_phy && !priv->use_external_mii) {