diff options
author | Mike Rapoport <mike@compulab.co.il> | 2011-03-02 07:34:05 -0500 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-03-03 16:57:07 -0500 |
commit | b96cc7fe190b9356633c70afae61ee0637b000ee (patch) | |
tree | 096c2873246959cda73578485fba22297c2d9daf /arch | |
parent | 1e40a97e6cb69d8b7edba801d75d1024078ce9aa (diff) |
ARM: tegra: add PCI Express power gating
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/pcie.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c index 6de5ef47c027..2941212b853c 100644 --- a/arch/arm/mach-tegra/pcie.c +++ b/arch/arm/mach-tegra/pcie.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <mach/pinmux.h> | 39 | #include <mach/pinmux.h> |
40 | #include <mach/iomap.h> | 40 | #include <mach/iomap.h> |
41 | #include <mach/clk.h> | 41 | #include <mach/clk.h> |
42 | #include <mach/powergate.h> | ||
42 | 43 | ||
43 | /* register definitions */ | 44 | /* register definitions */ |
44 | #define AFI_OFFSET 0x3800 | 45 | #define AFI_OFFSET 0x3800 |
@@ -688,13 +689,30 @@ static void tegra_pcie_power_off(void) | |||
688 | tegra_periph_reset_assert(tegra_pcie.afi_clk); | 689 | tegra_periph_reset_assert(tegra_pcie.afi_clk); |
689 | tegra_periph_reset_assert(tegra_pcie.pex_clk); | 690 | tegra_periph_reset_assert(tegra_pcie.pex_clk); |
690 | 691 | ||
692 | tegra_powergate_power_off(TEGRA_POWERGATE_PCIE); | ||
691 | tegra_pcie_xclk_clamp(true); | 693 | tegra_pcie_xclk_clamp(true); |
692 | } | 694 | } |
693 | 695 | ||
694 | static int tegra_pcie_power_on(void) | 696 | static int tegra_pcie_power_regate(void) |
695 | { | 697 | { |
698 | int err; | ||
699 | |||
700 | tegra_pcie_power_off(); | ||
701 | |||
696 | tegra_pcie_xclk_clamp(true); | 702 | tegra_pcie_xclk_clamp(true); |
703 | |||
697 | tegra_periph_reset_assert(tegra_pcie.pcie_xclk); | 704 | tegra_periph_reset_assert(tegra_pcie.pcie_xclk); |
705 | tegra_periph_reset_assert(tegra_pcie.afi_clk); | ||
706 | |||
707 | err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_PCIE, | ||
708 | tegra_pcie.pex_clk); | ||
709 | if (err) { | ||
710 | pr_err("PCIE: powerup sequence failed: %d\n", err); | ||
711 | return err; | ||
712 | } | ||
713 | |||
714 | tegra_periph_reset_deassert(tegra_pcie.afi_clk); | ||
715 | |||
698 | tegra_pcie_xclk_clamp(false); | 716 | tegra_pcie_xclk_clamp(false); |
699 | 717 | ||
700 | clk_enable(tegra_pcie.afi_clk); | 718 | clk_enable(tegra_pcie.afi_clk); |
@@ -759,7 +777,7 @@ static int __init tegra_pcie_get_resources(void) | |||
759 | return err; | 777 | return err; |
760 | } | 778 | } |
761 | 779 | ||
762 | err = tegra_pcie_power_on(); | 780 | err = tegra_pcie_power_regate(); |
763 | if (err) { | 781 | if (err) { |
764 | pr_err("PCIE: failed to power up: %d\n", err); | 782 | pr_err("PCIE: failed to power up: %d\n", err); |
765 | goto err_pwr_on; | 783 | goto err_pwr_on; |