[PATCH 2/3] [ARM] tegra: add PCI Express support

Colin Cross ccross at google.com
Thu Sep 16 17:42:03 EDT 2010


On Thu, Sep 16, 2010 at 9:53 AM, Mike Rapoport <mike at compulab.co.il> wrote:
> Signed-off-by: Mike Rapoport <mike at compulab.co.il>
> ---
>  arch/arm/mach-tegra/Kconfig                 |    4 +
>  arch/arm/mach-tegra/Makefile                |    1 +
>  arch/arm/mach-tegra/board.h                 |    1 +
>  arch/arm/mach-tegra/include/mach/hardware.h |    4 +
>  arch/arm/mach-tegra/pcie.c                  |  889 +++++++++++++++++++++++++++
>  5 files changed, 899 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-tegra/pcie.c
>
<snip>

> +/* register definitions */
> +#define AFI_OFSET      0x3800
> +#define PADS_OFSET     0x3000
OFFSET

> +#define RP0_OFFSET     0x0000
> +#define RP1_OFFSET     0x1000

<snip>

> +static void tegra_pcie_xclk_clamp(bool clamp)
> +{
> +       u32 reg;
> +
> +       reg = pmc_readl(PMC_SCRATCH42) & ~PMC_SCRATCH42_PCX_CLAMP;
> +
> +       if (clamp)
> +               reg |= PMC_SCRATCH42_PCX_CLAMP;
> +
> +       pmc_writel(reg, PMC_SCRATCH42);
> +}

Maybe add this to mach-tegra/powergate.c, to avoid having to set PMC
registers directly?

> +static int tegra_pcie_power_on(void)
> +{
> +       int err;
> +
> +       tegra_pcie_xclk_clamp(true);
> +       tegra_periph_reset_assert(tegra_pcie.pcie_xclk);
> +       tegra_pcie_xclk_clamp(false);
> +
> +       clk_enable(tegra_pcie.afi_clk);
> +       clk_enable(tegra_pcie.pex_clk);
> +       return clk_enable(tegra_pcie.pll_e);
> +}
Any reason you can't use the powergate api here too?

> +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);
> +}
Can you power off the pcie partition?



More information about the linux-arm-kernel mailing list