From 77ac7d3e328166feb8e8d67dccd3673c2c3cb29e Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Fri, 17 Aug 2018 11:12:17 -0700 Subject: nvlink: do not power ungate and gate nvl partition Never powergate NVLINK with the intention to restart it later. Power gating should be done for platforms that do not use NVLINK. Bug 2258148 Bug 200433994 Change-Id: Ie4046bd3207a7a079404f503373b1d47b0186aac Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/1802171 Reviewed-by: Tejal Kudav Reviewed-by: Petlozu Pravareshwar GVS: Gerrit_Virtual_Submit Reviewed-by: Sivaram Nair Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/nvlink/t19x-nvlink-endpt.c | 40 ++++++++------------------------------ drivers/nvlink/t19x-nvlink-endpt.h | 3 +-- 2 files changed, 9 insertions(+), 34 deletions(-) (limited to 'drivers/nvlink') diff --git a/drivers/nvlink/t19x-nvlink-endpt.c b/drivers/nvlink/t19x-nvlink-endpt.c index 97bf0ef4a..80b3038d1 100644 --- a/drivers/nvlink/t19x-nvlink-endpt.c +++ b/drivers/nvlink/t19x-nvlink-endpt.c @@ -31,8 +31,6 @@ #include #include #include -#include -#include #include #include "t19x-nvlink-endpt.h" @@ -53,13 +51,6 @@ static struct of_device_id t19x_nvlink_controller_of_match[] = { }, }; -#if IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS) -static struct of_device_id tegra_nvl_pd[] = { - { .compatible = "nvidia,tegra194-nvl-pd", }, - {}, -}; -#endif - MODULE_DEVICE_TABLE(of, t19x_nvlink_controller_of_match); u32 nvlw_tioctrl_readl(struct tnvlink_dev *tdev, u32 reg) @@ -214,13 +205,8 @@ static int tegra_nvlink_car_enable(struct tnvlink_dev *tdev) goto nvlink_sys_set_parent_fail; } -#if IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS) - ret = tegra_unpowergate_partition(tdev->pgid_nvl); - if (ret < 0) { - nvlink_err("Couldn't unpowergate : %d", ret); - goto unpowergate_partition_fail; - } -#endif + reset_control_reset(tdev->rst_nvlink); + /* Take link out of reset */ reg_val = nvlw_tioctrl_readl(tdev, NVLW_RESET) | BIT(NVLW_RESET_LINKRESET); @@ -276,10 +262,6 @@ static int tegra_nvlink_car_enable(struct tnvlink_dev *tdev) return ret; pllnvhs_fail: -#if IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS) - tegra_powergate_partition(tdev->pgid_nvl); -#endif -unpowergate_partition_fail: nvlink_sys_set_parent_fail: clk_disable_unprepare(tdev->clk_nvlink_sys); nvlink_sys_enable_fail: @@ -829,14 +811,6 @@ int t19x_nvlink_dev_car_disable(struct nvlink_device *ndev) goto fail; } -#if IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS) - ret = tegra_powergate_partition(tdev->pgid_nvl); - if (ret < 0) { - nvlink_err("Powergate nvlink partition failed"); - goto fail; - } -#endif - clk_disable_unprepare(tdev->clk_nvlink_sys); ret = reset_control_assert(tdev->rst_nvhs_uphy_pm); @@ -973,10 +947,12 @@ static int tegra_nvlink_clk_rst_init(struct tnvlink_dev *tdev) nvlink_err("missing rst_nvhs_uphy_l7 reset"); return PTR_ERR(tdev->rst_nvhs_uphy_l7); } - -#if IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS) - tdev->pgid_nvl = tegra_pd_get_powergate_id(tegra_nvl_pd); -#endif + tdev->rst_nvlink = devm_reset_control_get(tdev->dev, + "nvlink"); + if (IS_ERR(tdev->rst_nvlink)) { + nvlink_err("missing rst_nvlink reset"); + return PTR_ERR(tdev->rst_nvlink); + } return 0; } diff --git a/drivers/nvlink/t19x-nvlink-endpt.h b/drivers/nvlink/t19x-nvlink-endpt.h index 583b33cd7..fdcd9ef94 100644 --- a/drivers/nvlink/t19x-nvlink-endpt.h +++ b/drivers/nvlink/t19x-nvlink-endpt.h @@ -216,8 +216,7 @@ struct tnvlink_dev { struct reset_control *rst_nvhs_uphy_l5; struct reset_control *rst_nvhs_uphy_l6; struct reset_control *rst_nvhs_uphy_l7; - /* Powergate id */ - int pgid_nvl; + struct reset_control *rst_nvlink; struct tegra_prod *prod_list; bool is_nea; /* Nvlink refclk*/ -- cgit v1.2.2