~ubuntu-branches/ubuntu/precise/linux-linaro-u8500/precise

« back to all changes in this revision

Viewing changes to arch/arm/mach-tegra/pcie.c

  • Committer: Bazaar Package Importer
  • Author(s): John Rigby, Upstream Fixes, Andy Green, John Rigby
  • Date: 2011-04-14 12:16:06 UTC
  • Revision ID: james.westby@ubuntu.com-20110414121606-b77podkyqgr2oix7
Tags: 2.6.38-1002.3
[ Upstream Fixes ]

* MUSB: shutdown: Make sure block is awake before doing shutdown
  - LP: #745737
* Fixed gpio polarity of gpio USB-phy reset.
  - LP: #747639

[ Andy Green ]

* LINARO: SAUCE: disable CONFIG_OMAP_RESET_CLOCKS
  - LP: #752900

[ John Rigby ]

* Rebase to new upstreams:
  Linux v2.6.38.1
  linaro-linux-2.6.38-upstream-29Mar2011
  Ubuntu-2.6.38-7.35
* SAUCE: OMAP4: clock: wait for module to become accessible on
  a clk enable
  - LP: #745737
* Rebase to new upstreams:
  Linux v2.6.38.2
  linaro-linux-2.6.38-upstream-5Apr2011
  Ubuntu-2.6.38-8.41
  - LP: #732842
* Update configs for device tree, dvfs and lttng
* LINARO: add building of dtb's
* LINARO: SAUCE: Disable lowest operating freqs on omap34xx
  - LP: #732912

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include <mach/pinmux.h>
40
40
#include <mach/iomap.h>
41
41
#include <mach/clk.h>
 
42
#include <mach/powergate.h>
42
43
 
43
44
/* register definitions */
44
45
#define AFI_OFFSET      0x3800
682
683
        pmc_writel(reg, PMC_SCRATCH42);
683
684
}
684
685
 
685
 
static int tegra_pcie_power_on(void)
686
 
{
687
 
        tegra_pcie_xclk_clamp(true);
688
 
        tegra_periph_reset_assert(tegra_pcie.pcie_xclk);
 
686
static void tegra_pcie_power_off(void)
 
687
{
 
688
        tegra_periph_reset_assert(tegra_pcie.pcie_xclk);
 
689
        tegra_periph_reset_assert(tegra_pcie.afi_clk);
 
690
        tegra_periph_reset_assert(tegra_pcie.pex_clk);
 
691
 
 
692
        tegra_powergate_power_off(TEGRA_POWERGATE_PCIE);
 
693
        tegra_pcie_xclk_clamp(true);
 
694
}
 
695
 
 
696
static int tegra_pcie_power_regate(void)
 
697
{
 
698
        int err;
 
699
 
 
700
        tegra_pcie_power_off();
 
701
 
 
702
        tegra_pcie_xclk_clamp(true);
 
703
 
 
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
 
689
716
        tegra_pcie_xclk_clamp(false);
690
717
 
691
718
        clk_enable(tegra_pcie.afi_clk);
693
720
        return clk_enable(tegra_pcie.pll_e);
694
721
}
695
722
 
696
 
static void tegra_pcie_power_off(void)
697
 
{
698
 
        tegra_periph_reset_assert(tegra_pcie.pcie_xclk);
699
 
        tegra_periph_reset_assert(tegra_pcie.afi_clk);
700
 
        tegra_periph_reset_assert(tegra_pcie.pex_clk);
701
 
 
702
 
        tegra_pcie_xclk_clamp(true);
703
 
}
704
 
 
705
723
static int tegra_pcie_clocks_get(void)
706
724
{
707
725
        int err;
759
777
                return err;
760
778
        }
761
779
 
762
 
        err = tegra_pcie_power_on();
 
780
        err = tegra_pcie_power_regate();
763
781
        if (err) {
764
782
                pr_err("PCIE: failed to power up: %d\n", err);
765
783
                goto err_pwr_on;