linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM: tegra: PCI-e improvements
@ 2011-03-02 12:34 Mike Rapoport
  2011-03-02 12:34 ` [PATCH 1/3] ARM: tegra: PCIE minor code refactoring Mike Rapoport
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Mike Rapoport @ 2011-03-02 12:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,
This patches add PCI-e powergating support and fix for TrimSlice PCI-e initialization in the mutliplatform kernels.

The patches are also available at git repository 
  git://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux-tegra.git trimslice/upstream

The following changes since commit ccac05152e7c6a8103b9e7a801bc995180a800fc:

  ARM: Tegra: DMA: Fail safe if initialization fails (2011-02-23 14:06:03 -0800)

Mike Rapoport (3):
  ARM: tegra: PCIE minor code refactoring
  ARM: tegra: add PCI Express power gating
  ARM: tegra: trimslice: initialize PCI-e only when running on
    TrimSlice

 arch/arm/mach-tegra/board-trimslice.c |    3 ++
 arch/arm/mach-tegra/pcie.c            |   38 ++++++++++++++++++++++++--------
 2 files changed, 31 insertions(+), 10 deletions(-)

-- 
1.7.3.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] ARM: tegra: PCIE minor code refactoring
  2011-03-02 12:34 [PATCH 0/3] ARM: tegra: PCI-e improvements Mike Rapoport
@ 2011-03-02 12:34 ` Mike Rapoport
  2011-03-02 12:34 ` [PATCH 2/3] ARM: tegra: add PCI Express power gating Mike Rapoport
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Mike Rapoport @ 2011-03-02 12:34 UTC (permalink / raw)
  To: linux-arm-kernel

Move tegra_pcie_power_off before tegra_pcie_power_on for clean addition
of PCIE power gating

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
---
 arch/arm/mach-tegra/pcie.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c
index 53f5fa3..6de5ef4 100644
--- a/arch/arm/mach-tegra/pcie.c
+++ b/arch/arm/mach-tegra/pcie.c
@@ -682,6 +682,15 @@ static void tegra_pcie_xclk_clamp(bool clamp)
 	pmc_writel(reg, PMC_SCRATCH42);
 }
 
+static void tegra_pcie_power_off(void)
+{
+	tegra_periph_reset_assert(tegra_pcie.pcie_xclk);
+	tegra_periph_reset_assert(tegra_pcie.afi_clk);
+	tegra_periph_reset_assert(tegra_pcie.pex_clk);
+
+	tegra_pcie_xclk_clamp(true);
+}
+
 static int tegra_pcie_power_on(void)
 {
 	tegra_pcie_xclk_clamp(true);
@@ -693,15 +702,6 @@ static int tegra_pcie_power_on(void)
 	return clk_enable(tegra_pcie.pll_e);
 }
 
-static void tegra_pcie_power_off(void)
-{
-	tegra_periph_reset_assert(tegra_pcie.pcie_xclk);
-	tegra_periph_reset_assert(tegra_pcie.afi_clk);
-	tegra_periph_reset_assert(tegra_pcie.pex_clk);
-
-	tegra_pcie_xclk_clamp(true);
-}
-
 static int tegra_pcie_clocks_get(void)
 {
 	int err;
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ARM: tegra: add PCI Express power gating
  2011-03-02 12:34 [PATCH 0/3] ARM: tegra: PCI-e improvements Mike Rapoport
  2011-03-02 12:34 ` [PATCH 1/3] ARM: tegra: PCIE minor code refactoring Mike Rapoport
@ 2011-03-02 12:34 ` Mike Rapoport
  2011-03-02 12:34 ` [PATCH 3/3] ARM: tegra: trimslice: initialize PCI-e only when running on TrimSlice Mike Rapoport
  2011-03-03 22:17 ` [PATCH 0/3] ARM: tegra: PCI-e improvements Colin Cross
  3 siblings, 0 replies; 5+ messages in thread
From: Mike Rapoport @ 2011-03-02 12:34 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
---
 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 6de5ef4..2941212 100644
--- a/arch/arm/mach-tegra/pcie.c
+++ b/arch/arm/mach-tegra/pcie.c
@@ -39,6 +39,7 @@
 #include <mach/pinmux.h>
 #include <mach/iomap.h>
 #include <mach/clk.h>
+#include <mach/powergate.h>
 
 /* register definitions */
 #define AFI_OFFSET	0x3800
@@ -688,13 +689,30 @@ static void tegra_pcie_power_off(void)
 	tegra_periph_reset_assert(tegra_pcie.afi_clk);
 	tegra_periph_reset_assert(tegra_pcie.pex_clk);
 
+	tegra_powergate_power_off(TEGRA_POWERGATE_PCIE);
 	tegra_pcie_xclk_clamp(true);
 }
 
-static int tegra_pcie_power_on(void)
+static int tegra_pcie_power_regate(void)
 {
+	int err;
+
+	tegra_pcie_power_off();
+
 	tegra_pcie_xclk_clamp(true);
+
 	tegra_periph_reset_assert(tegra_pcie.pcie_xclk);
+	tegra_periph_reset_assert(tegra_pcie.afi_clk);
+
+	err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_PCIE,
+						tegra_pcie.pex_clk);
+	if (err) {
+		pr_err("PCIE: powerup sequence failed: %d\n", err);
+		return err;
+	}
+
+	tegra_periph_reset_deassert(tegra_pcie.afi_clk);
+
 	tegra_pcie_xclk_clamp(false);
 
 	clk_enable(tegra_pcie.afi_clk);
@@ -759,7 +777,7 @@ static int __init tegra_pcie_get_resources(void)
 		return err;
 	}
 
-	err = tegra_pcie_power_on();
+	err = tegra_pcie_power_regate();
 	if (err) {
 		pr_err("PCIE: failed to power up: %d\n", err);
 		goto err_pwr_on;
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] ARM: tegra: trimslice: initialize PCI-e only when running on TrimSlice
  2011-03-02 12:34 [PATCH 0/3] ARM: tegra: PCI-e improvements Mike Rapoport
  2011-03-02 12:34 ` [PATCH 1/3] ARM: tegra: PCIE minor code refactoring Mike Rapoport
  2011-03-02 12:34 ` [PATCH 2/3] ARM: tegra: add PCI Express power gating Mike Rapoport
@ 2011-03-02 12:34 ` Mike Rapoport
  2011-03-03 22:17 ` [PATCH 0/3] ARM: tegra: PCI-e improvements Colin Cross
  3 siblings, 0 replies; 5+ messages in thread
From: Mike Rapoport @ 2011-03-02 12:34 UTC (permalink / raw)
  To: linux-arm-kernel

Currently tegra_pcie_init is effectively called as subsys_initcall. With
multiplatform kernel this may cause hangs on boards that don't intend to
support Tegra2 PCI-e. Ensure that TrimSlice board code initializes PCI-e
only when actually running on the TrimSlice.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
---
 arch/arm/mach-tegra/board-trimslice.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c
index 0f3081a..7be7d4a 100644
--- a/arch/arm/mach-tegra/board-trimslice.c
+++ b/arch/arm/mach-tegra/board-trimslice.c
@@ -79,6 +79,9 @@ static __initdata struct tegra_clk_init_table trimslice_clk_init_table[] = {
 
 static int __init tegra_trimslice_pci_init(void)
 {
+	if (!machine_is_trimslice())
+		return 0;
+
 	return tegra_pcie_init(true, true);
 }
 subsys_initcall(tegra_trimslice_pci_init);
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 0/3] ARM: tegra: PCI-e improvements
  2011-03-02 12:34 [PATCH 0/3] ARM: tegra: PCI-e improvements Mike Rapoport
                   ` (2 preceding siblings ...)
  2011-03-02 12:34 ` [PATCH 3/3] ARM: tegra: trimslice: initialize PCI-e only when running on TrimSlice Mike Rapoport
@ 2011-03-03 22:17 ` Colin Cross
  3 siblings, 0 replies; 5+ messages in thread
From: Colin Cross @ 2011-03-03 22:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 2, 2011 at 4:34 AM, Mike Rapoport <mike@compulab.co.il> wrote:
> Hi all,
> This patches add PCI-e powergating support and fix for TrimSlice PCI-e initialization in the mutliplatform kernels.
>
> The patches are also available at git repository
> ?git://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux-tegra.git trimslice/upstream
>
> The following changes since commit ccac05152e7c6a8103b9e7a801bc995180a800fc:
>
> ?ARM: Tegra: DMA: Fail safe if initialization fails (2011-02-23 14:06:03 -0800)
>
> Mike Rapoport (3):
> ?ARM: tegra: PCIE minor code refactoring
> ?ARM: tegra: add PCI Express power gating
> ?ARM: tegra: trimslice: initialize PCI-e only when running on
> ? ?TrimSlice
>
> ?arch/arm/mach-tegra/board-trimslice.c | ? ?3 ++
> ?arch/arm/mach-tegra/pcie.c ? ? ? ? ? ?| ? 38 ++++++++++++++++++++++++--------
> ?2 files changed, 31 insertions(+), 10 deletions(-)

Ack - I put all 3 in tegra for-next.  With these patches, I can boot
my board with Trimslice and pci compiled in.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-03 22:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-02 12:34 [PATCH 0/3] ARM: tegra: PCI-e improvements Mike Rapoport
2011-03-02 12:34 ` [PATCH 1/3] ARM: tegra: PCIE minor code refactoring Mike Rapoport
2011-03-02 12:34 ` [PATCH 2/3] ARM: tegra: add PCI Express power gating Mike Rapoport
2011-03-02 12:34 ` [PATCH 3/3] ARM: tegra: trimslice: initialize PCI-e only when running on TrimSlice Mike Rapoport
2011-03-03 22:17 ` [PATCH 0/3] ARM: tegra: PCI-e improvements Colin Cross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).