diff options
author | Mike Rapoport <mike@compulab.co.il> | 2011-03-09 09:31:17 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2011-03-15 17:28:32 -0400 |
commit | ce005cf450b2c1c93e48c45a4cc717e9d104c054 (patch) | |
tree | 8d126ded2fe89176c0421cf1bb9ea289bec313ee /arch/arm/mach-tegra | |
parent | c4d9e4a0b9960fbf4d945bdad47ba005abe8813c (diff) |
ARM: tegra: harmony: update PCI-e initialization sequence
On Harmony board PCI-e subsystem can be enabled only after certain
voltage regulators are on. One of the regulators is an internal
regulator on the PMIC and another one is controlled by a PMIC GPIO.
Addition of the voltage control to the Harmony PCI-e initialization
allows booting of kernel with CONFIG_TEGRA_PCI even if the PMIC driver
is not loaded. In this case the PCI-e initialization will fail
gracefully intead of hanging the system.
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r-- | arch/arm/mach-tegra/board-harmony-pcie.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c index f7e7d4514b6a..9c27b95b8d86 100644 --- a/arch/arm/mach-tegra/board-harmony-pcie.c +++ b/arch/arm/mach-tegra/board-harmony-pcie.c | |||
@@ -27,13 +27,29 @@ | |||
27 | 27 | ||
28 | #ifdef CONFIG_TEGRA_PCI | 28 | #ifdef CONFIG_TEGRA_PCI |
29 | 29 | ||
30 | /* GPIO 3 of the PMIC */ | ||
31 | #define EN_VDD_1V05_GPIO (TEGRA_NR_GPIOS + 2) | ||
32 | |||
30 | static int __init harmony_pcie_init(void) | 33 | static int __init harmony_pcie_init(void) |
31 | { | 34 | { |
35 | struct regulator *regulator = NULL; | ||
32 | int err; | 36 | int err; |
33 | 37 | ||
34 | if (!machine_is_harmony()) | 38 | if (!machine_is_harmony()) |
35 | return 0; | 39 | return 0; |
36 | 40 | ||
41 | err = gpio_request(EN_VDD_1V05_GPIO, "EN_VDD_1V05"); | ||
42 | if (err) | ||
43 | return err; | ||
44 | |||
45 | gpio_direction_output(EN_VDD_1V05_GPIO, 1); | ||
46 | |||
47 | regulator = regulator_get(NULL, "pex_clk"); | ||
48 | if (IS_ERR_OR_NULL(regulator)) | ||
49 | goto err_reg; | ||
50 | |||
51 | regulator_enable(regulator); | ||
52 | |||
37 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPV, TEGRA_TRI_NORMAL); | 53 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPV, TEGRA_TRI_NORMAL); |
38 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_NORMAL); | 54 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_NORMAL); |
39 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_NORMAL); | 55 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_NORMAL); |
@@ -49,9 +65,15 @@ err_pcie: | |||
49 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_TRISTATE); | 65 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_TRISTATE); |
50 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_TRISTATE); | 66 | tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_TRISTATE); |
51 | 67 | ||
68 | regulator_disable(regulator); | ||
69 | regulator_put(regulator); | ||
70 | err_reg: | ||
71 | gpio_free(EN_VDD_1V05_GPIO); | ||
72 | |||
52 | return err; | 73 | return err; |
53 | } | 74 | } |
54 | 75 | ||
55 | subsys_initcall(harmony_pcie_init); | 76 | /* PCI should be initialized after I2C, mfd and regulators */ |
77 | subsys_initcall_sync(harmony_pcie_init); | ||
56 | 78 | ||
57 | #endif | 79 | #endif |