From 1ba38f6100243b263fc0d147cd59e76c1ad87a61 Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Sat, 13 Jan 2018 18:43:32 +0100 Subject: brcm63xx: add kernel 4.14 support Add support for kernel 4.14. Increases compressed kernel size by ~64k compared to 4.9. Signed-off-by: Jonas Gorski --- ...t-use-platform-data-for-dma-channel-numbe.patch | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 target/linux/brcm63xx/patches-4.14/001-4.16-02-bcm63xx_enet-use-platform-data-for-dma-channel-numbe.patch (limited to 'target/linux/brcm63xx/patches-4.14/001-4.16-02-bcm63xx_enet-use-platform-data-for-dma-channel-numbe.patch') diff --git a/target/linux/brcm63xx/patches-4.14/001-4.16-02-bcm63xx_enet-use-platform-data-for-dma-channel-numbe.patch b/target/linux/brcm63xx/patches-4.14/001-4.16-02-bcm63xx_enet-use-platform-data-for-dma-channel-numbe.patch new file mode 100644 index 0000000000..3a998e9309 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.14/001-4.16-02-bcm63xx_enet-use-platform-data-for-dma-channel-numbe.patch @@ -0,0 +1,72 @@ +From b7d1d1f345bb3b25c360c1df812d98866e2ee7fb Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sat, 30 Sep 2017 13:50:03 +0200 +Subject: [PATCH 2/4] bcm63xx_enet: use platform data for dma channel numbers + +To reduce the reliance on device ids, pass the dma channel numbers to +the enet devices as platform data. + +Signed-off-by: Jonas Gorski +--- + arch/mips/bcm63xx/dev-enet.c | 8 ++++++++ + arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h | 4 ++++ + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 11 ++--------- + 3 files changed, 14 insertions(+), 9 deletions(-) + +--- a/arch/mips/bcm63xx/dev-enet.c ++++ b/arch/mips/bcm63xx/dev-enet.c +@@ -265,6 +265,14 @@ int __init bcm63xx_enet_register(int uni + dpd->dma_chan_width = ENETDMA_CHAN_WIDTH; + } + ++ if (unit == 0) { ++ dpd->rx_chan = 0; ++ dpd->tx_chan = 1; ++ } else { ++ dpd->rx_chan = 2; ++ dpd->tx_chan = 3; ++ } ++ + ret = platform_device_register(pdev); + if (ret) + return ret; +--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h ++++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h +@@ -55,6 +55,10 @@ struct bcm63xx_enet_platform_data { + + /* DMA descriptor shift */ + unsigned int dma_desc_shift; ++ ++ /* dma channel ids */ ++ int rx_chan; ++ int tx_chan; + }; + + /* +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -1755,15 +1755,6 @@ static int bcm_enet_probe(struct platfor + priv->irq_tx = res_irq_tx->start; + priv->mac_id = pdev->id; + +- /* get rx & tx dma channel id for this mac */ +- if (priv->mac_id == 0) { +- priv->rx_chan = 0; +- priv->tx_chan = 1; +- } else { +- priv->rx_chan = 2; +- priv->tx_chan = 3; +- } +- + priv->mac_clk = devm_clk_get(&pdev->dev, "enet"); + if (IS_ERR(priv->mac_clk)) { + ret = PTR_ERR(priv->mac_clk); +@@ -1795,6 +1786,8 @@ static int bcm_enet_probe(struct platfor + priv->dma_chan_width = pd->dma_chan_width; + priv->dma_has_sram = pd->dma_has_sram; + priv->dma_desc_shift = pd->dma_desc_shift; ++ priv->rx_chan = pd->rx_chan; ++ priv->tx_chan = pd->tx_chan; + } + + if (priv->mac_id == 0 && priv->has_phy && !priv->use_external_mii) { -- cgit v1.2.3