diff options
author | Mike Rapoport <mike@compulab.co.il> | 2010-09-27 05:26:34 -0400 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2010-10-21 21:13:10 -0400 |
commit | f2a443931e6c7616aa023f55ddfdbca8943ab0e9 (patch) | |
tree | 9593fb1a242cbe879a7743e92cd4727d795c63ef /arch | |
parent | 77ffc1465cec32489889d6bc9c288b7b0d2ce9fb (diff) |
tegra: harmony: enable PCI Express
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
CC: Olof Johansson <olof@lixom.net>
CC: Gary King <GKing@nvidia.com>
Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-harmony-pcie.c | 57 |
2 files changed, 58 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile index b4c07e67a1fb..cdbc68e4c0ca 100644 --- a/arch/arm/mach-tegra/Makefile +++ b/arch/arm/mach-tegra/Makefile | |||
@@ -18,3 +18,4 @@ obj-$(CONFIG_TEGRA_PCI) += pcie.o | |||
18 | 18 | ||
19 | obj-${CONFIG_MACH_HARMONY} += board-harmony.o | 19 | obj-${CONFIG_MACH_HARMONY} += board-harmony.o |
20 | obj-${CONFIG_MACH_HARMONY} += board-harmony-pinmux.o | 20 | obj-${CONFIG_MACH_HARMONY} += board-harmony-pinmux.o |
21 | obj-${CONFIG_MACH_HARMONY} += board-harmony-pcie.o | ||
diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c new file mode 100644 index 000000000000..f7e7d4514b6a --- /dev/null +++ b/arch/arm/mach-tegra/board-harmony-pcie.c | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/board-harmony-pcie.c | ||
3 | * | ||
4 | * Copyright (C) 2010 CompuLab, Ltd. | ||
5 | * Mike Rapoport <mike@compulab.co.il> | ||
6 | * | ||
7 | * This software is licensed under the terms of the GNU General Public | ||
8 | * License version 2, as published by the Free Software Foundation, and | ||
9 | * may be copied, distributed, and modified under those terms. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/gpio.h> | ||
20 | #include <linux/err.h> | ||
21 | #include <linux/regulator/consumer.h> | ||
22 | |||
23 | #include <asm/mach-types.h> | ||
24 | |||
25 | #include <mach/pinmux.h> | ||
26 | #include "board.h" | ||
27 | |||
28 | #ifdef CONFIG_TEGRA_PCI | ||
29 | |||
30 | static int __init harmony_pcie_init(void) | ||
31 | { | ||
32 | int err; | ||
33 | |||
34 | if (!machine_is_harmony()) | ||
35 | return 0; | ||
36 | |||
37 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPV, TEGRA_TRI_NORMAL); | ||
38 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_NORMAL); | ||
39 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_NORMAL); | ||
40 | |||
41 | err = tegra_pcie_init(true, true); | ||
42 | if (err) | ||
43 | goto err_pcie; | ||
44 | |||
45 | return 0; | ||
46 | |||
47 | err_pcie: | ||
48 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPV, TEGRA_TRI_TRISTATE); | ||
49 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_TRISTATE); | ||
50 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_TRISTATE); | ||
51 | |||
52 | return err; | ||
53 | } | ||
54 | |||
55 | subsys_initcall(harmony_pcie_init); | ||
56 | |||
57 | #endif | ||