diff options
author | Claudiu Beznea <claudiu.beznea@microchip.com> | 2022-02-04 15:57:50 +0200 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2022-02-24 19:05:28 +0100 |
commit | e58cd453d58b20c6a6f34d3591640aa19aa14d25 (patch) | |
tree | a4fef5f5d79575a7a60b516482ee114c1dbc932e /target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch | |
parent | 3ed992a99630457f660761ce199e3d2a00f06168 (diff) | |
download | upstream-e58cd453d58b20c6a6f34d3591640aa19aa14d25.tar.gz upstream-e58cd453d58b20c6a6f34d3591640aa19aa14d25.tar.bz2 upstream-e58cd453d58b20c6a6f34d3591640aa19aa14d25.zip |
at91: add kernel support for sama7g5 soc
Add kernel support for SAMA7G5 by back-porting mainline kernel patches.
Among SAMA7G5 features could be remembered:
- ARM Cortex-A7
- double data rate multi-port dynamic RAM controller supporting DDR2,
DDR3, DDR3L, LPDDR2, LPDDR3 up to 533MHz
- peripherals for audio, video processing
- 1 gigabit + 1 megabit Ethernet controllers
- 6 CAN controllers
- trust zone support
- DVFS for CPU
- criptography IPs
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Diffstat (limited to 'target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch')
-rw-r--r-- | target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch b/target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch new file mode 100644 index 0000000000..9340c864b9 --- /dev/null +++ b/target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch @@ -0,0 +1,87 @@ +From 935d9aae15ee245a1bc6e322cbef02566a8996cc Mon Sep 17 00:00:00 2001 +From: Claudiu Beznea <claudiu.beznea@microchip.com> +Date: Wed, 9 Dec 2020 15:03:34 +0200 +Subject: [PATCH 117/247] net: macb: add function to disable all macb clocks + +Add function to disable all macb clocks. + +Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> +Suggested-by: Andrew Lunn <andrew@lunn.ch> +Signed-off-by: David S. Miller <davem@davemloft.net> +--- + drivers/net/ethernet/cadence/macb_main.c | 38 +++++++++++++----------- + 1 file changed, 21 insertions(+), 17 deletions(-) + +diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c +index 5d0d11eb6711..eacf907a365d 100644 +--- a/drivers/net/ethernet/cadence/macb_main.c ++++ b/drivers/net/ethernet/cadence/macb_main.c +@@ -3575,6 +3575,20 @@ static void macb_probe_queues(void __iomem *mem, + *num_queues = hweight32(*queue_mask); + } + ++static void macb_clks_disable(struct clk *pclk, struct clk *hclk, struct clk *tx_clk, ++ struct clk *rx_clk, struct clk *tsu_clk) ++{ ++ struct clk_bulk_data clks[] = { ++ { .clk = tsu_clk, }, ++ { .clk = rx_clk, }, ++ { .clk = pclk, }, ++ { .clk = hclk, }, ++ { .clk = tx_clk }, ++ }; ++ ++ clk_bulk_disable_unprepare(ARRAY_SIZE(clks), clks); ++} ++ + static int macb_clk_init(struct platform_device *pdev, struct clk **pclk, + struct clk **hclk, struct clk **tx_clk, + struct clk **rx_clk, struct clk **tsu_clk) +@@ -4642,11 +4656,7 @@ static int macb_probe(struct platform_device *pdev) + free_netdev(dev); + + err_disable_clocks: +- clk_disable_unprepare(tx_clk); +- clk_disable_unprepare(hclk); +- clk_disable_unprepare(pclk); +- clk_disable_unprepare(rx_clk); +- clk_disable_unprepare(tsu_clk); ++ macb_clks_disable(pclk, hclk, tx_clk, rx_clk, tsu_clk); + pm_runtime_disable(&pdev->dev); + pm_runtime_set_suspended(&pdev->dev); + pm_runtime_dont_use_autosuspend(&pdev->dev); +@@ -4671,11 +4681,8 @@ static int macb_remove(struct platform_device *pdev) + pm_runtime_disable(&pdev->dev); + pm_runtime_dont_use_autosuspend(&pdev->dev); + if (!pm_runtime_suspended(&pdev->dev)) { +- clk_disable_unprepare(bp->tx_clk); +- clk_disable_unprepare(bp->hclk); +- clk_disable_unprepare(bp->pclk); +- clk_disable_unprepare(bp->rx_clk); +- clk_disable_unprepare(bp->tsu_clk); ++ macb_clks_disable(bp->pclk, bp->hclk, bp->tx_clk, ++ bp->rx_clk, bp->tsu_clk); + pm_runtime_set_suspended(&pdev->dev); + } + phylink_destroy(bp->phylink); +@@ -4854,13 +4861,10 @@ static int __maybe_unused macb_runtime_suspend(struct device *dev) + struct net_device *netdev = dev_get_drvdata(dev); + struct macb *bp = netdev_priv(netdev); + +- if (!(device_may_wakeup(dev))) { +- clk_disable_unprepare(bp->tx_clk); +- clk_disable_unprepare(bp->hclk); +- clk_disable_unprepare(bp->pclk); +- clk_disable_unprepare(bp->rx_clk); +- } +- clk_disable_unprepare(bp->tsu_clk); ++ if (!(device_may_wakeup(dev))) ++ macb_clks_disable(bp->pclk, bp->hclk, bp->tx_clk, bp->rx_clk, bp->tsu_clk); ++ else ++ macb_clks_disable(NULL, NULL, NULL, NULL, bp->tsu_clk); + + return 0; + } +-- +2.32.0 + |