diff options
author | Mikko Perttunen <mperttunen@nvidia.com> | 2017-02-01 03:39:00 -0500 |
---|---|---|
committer | Preetham Chandru R <pchandru@nvidia.com> | 2017-08-21 05:16:34 -0400 |
commit | 37f23db4bca5bdcbc7b921cfa850f9e1243a38c3 (patch) | |
tree | 33c869de09e60eab79f622015f11eb6defe25415 /drivers/ata | |
parent | 673783089f5a1953bb655e38ee788a9c11f347f3 (diff) |
ata: ahci_tegra: Use per-chip powergate IDs
Powergate identifiers are different on Tegra210 and Tegra186,
so add per-SoC match data to use the correct value on each
SoC.
bug 200257351
Change-Id: I51dc3ee038e4e48c10769cc757d6219a8e241f04
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/1297135
(cherry picked from commit 950a5ded6dfd2c596fb849ef406e3a42cb7c5df1)
Reviewed-on: http://git-master/r/1308063
GVS: Gerrit_Virtual_Submit
Tested-by: Timo Alho <talho@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/tegra/ahci_tegra.c | 12 | ||||
-rw-r--r-- | drivers/ata/tegra/ahci_tegra.h | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/drivers/ata/tegra/ahci_tegra.c b/drivers/ata/tegra/ahci_tegra.c index 5d686e306..c03c934a9 100644 --- a/drivers/ata/tegra/ahci_tegra.c +++ b/drivers/ata/tegra/ahci_tegra.c | |||
@@ -17,6 +17,8 @@ | |||
17 | #include "ahci_tegra.h" | 17 | #include "ahci_tegra.h" |
18 | #include "linux/pinctrl/consumer.h" | 18 | #include "linux/pinctrl/consumer.h" |
19 | 19 | ||
20 | #include <soc/tegra/tegra_powergate.h> | ||
21 | |||
20 | #ifdef CONFIG_DEBUG_FS | 22 | #ifdef CONFIG_DEBUG_FS |
21 | #include <linux/debugfs.h> | 23 | #include <linux/debugfs.h> |
22 | #include <linux/seq_file.h> | 24 | #include <linux/seq_file.h> |
@@ -67,6 +69,7 @@ static const struct tegra_ahci_soc_data tegra186_ahci_data = { | |||
67 | .t_satao_nvoob_comma_cnt_mask = (0XFF << 16), | 69 | .t_satao_nvoob_comma_cnt_mask = (0XFF << 16), |
68 | .t_satao_nvoob_comma_cnt = (0X07 << 16), | 70 | .t_satao_nvoob_comma_cnt = (0X07 << 16), |
69 | }, | 71 | }, |
72 | .powergate_id = TEGRA186_POWER_DOMAIN_SAX, | ||
70 | }; | 73 | }; |
71 | 74 | ||
72 | static const struct tegra_ahci_soc_data tegra210_ahci_data = { | 75 | static const struct tegra_ahci_soc_data tegra210_ahci_data = { |
@@ -83,6 +86,7 @@ static const struct tegra_ahci_soc_data tegra210_ahci_data = { | |||
83 | .t_satao_nvoob_comma_cnt_mask = (0X7 << 28), | 86 | .t_satao_nvoob_comma_cnt_mask = (0X7 << 28), |
84 | .t_satao_nvoob_comma_cnt = (0X7 << 28), | 87 | .t_satao_nvoob_comma_cnt = (0X7 << 28), |
85 | }, | 88 | }, |
89 | .powergate_id = TEGRA210_POWER_DOMAIN_SATA, | ||
86 | }; | 90 | }; |
87 | 91 | ||
88 | static const struct of_device_id tegra_ahci_of_match[] = { | 92 | static const struct of_device_id tegra_ahci_of_match[] = { |
@@ -535,7 +539,7 @@ static int tegra_ahci_elpg_enter(struct ata_host *host) | |||
535 | tegra_ahci_override_devslp(hpriv, true); | 539 | tegra_ahci_override_devslp(hpriv, true); |
536 | 540 | ||
537 | /* 5. Powergate */ | 541 | /* 5. Powergate */ |
538 | ret = tegra_powergate_partition(TEGRA_POWERGATE_SATA); | 542 | ret = tegra_powergate_partition(tegra->soc_data->powergate_id); |
539 | tegra_ahci_disable_clks(hpriv); | 543 | tegra_ahci_disable_clks(hpriv); |
540 | 544 | ||
541 | return ret; | 545 | return ret; |
@@ -554,7 +558,7 @@ static int tegra_ahci_elpg_exit(struct ata_host *host) | |||
554 | ret = tegra_ahci_enable_clks(hpriv); | 558 | ret = tegra_ahci_enable_clks(hpriv); |
555 | if (ret) | 559 | if (ret) |
556 | return ret; | 560 | return ret; |
557 | ret = tegra_unpowergate_partition(TEGRA_POWERGATE_SATA); | 561 | ret = tegra_unpowergate_partition(tegra->soc_data->powergate_id); |
558 | if (ret) | 562 | if (ret) |
559 | return ret; | 563 | return ret; |
560 | 564 | ||
@@ -802,7 +806,7 @@ static int tegra_ahci_power_on(struct ahci_host_priv *hpriv) | |||
802 | if (ret) | 806 | if (ret) |
803 | goto disable_sata_clk; | 807 | goto disable_sata_clk; |
804 | 808 | ||
805 | ret = tegra_unpowergate_partition(TEGRA_POWERGATE_SATA); | 809 | ret = tegra_unpowergate_partition(tegra->soc_data->powergate_id); |
806 | if (ret) | 810 | if (ret) |
807 | goto disable_sata_oob_clk; | 811 | goto disable_sata_oob_clk; |
808 | 812 | ||
@@ -831,7 +835,7 @@ static void tegra_ahci_power_off(struct ahci_host_priv *hpriv) | |||
831 | 835 | ||
832 | clk_disable_unprepare(tegra->sata_clk); | 836 | clk_disable_unprepare(tegra->sata_clk); |
833 | clk_disable_unprepare(tegra->sata_oob_clk); | 837 | clk_disable_unprepare(tegra->sata_oob_clk); |
834 | tegra_powergate_partition(TEGRA_POWERGATE_SATA); | 838 | tegra_powergate_partition(tegra->soc_data->powergate_id); |
835 | 839 | ||
836 | regulator_bulk_disable(tegra->soc_data->num_sata_regulators, | 840 | regulator_bulk_disable(tegra->soc_data->num_sata_regulators, |
837 | tegra->supplies); | 841 | tegra->supplies); |
diff --git a/drivers/ata/tegra/ahci_tegra.h b/drivers/ata/tegra/ahci_tegra.h index eaab8d966..49801a73f 100644 --- a/drivers/ata/tegra/ahci_tegra.h +++ b/drivers/ata/tegra/ahci_tegra.h | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/reset.h> | 27 | #include <linux/reset.h> |
28 | #include <scsi/scsi_device.h> | 28 | #include <scsi/scsi_device.h> |
29 | #include <scsi/scsi_cmnd.h> | 29 | #include <scsi/scsi_cmnd.h> |
30 | #include <linux/tegra-powergate.h> | ||
31 | #include <soc/tegra/pmc.h> | 30 | #include <soc/tegra/pmc.h> |
32 | #include <soc/tegra/chip-id.h> | 31 | #include <soc/tegra/chip-id.h> |
33 | #include <linux/tegra_prod.h> | 32 | #include <linux/tegra_prod.h> |
@@ -231,6 +230,7 @@ struct tegra_ahci_soc_data { | |||
231 | u32 t_satao_nvoob_comma_cnt_mask; | 230 | u32 t_satao_nvoob_comma_cnt_mask; |
232 | u32 t_satao_nvoob_comma_cnt; | 231 | u32 t_satao_nvoob_comma_cnt; |
233 | } reg; | 232 | } reg; |
233 | int powergate_id; | ||
234 | }; | 234 | }; |
235 | 235 | ||
236 | #ifdef CONFIG_DEBUG_FS | 236 | #ifdef CONFIG_DEBUG_FS |