summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2016-09-22 14:19:55 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2016-09-29 18:58:10 +0200
commit8a496ecceccca66a15b3b6f57260a2b752543f81 (patch)
tree2ba374dc4c9fdca937fcb33ccb3992ef82170c60
parent8a3b92a16eeffab5a17ba4e84ae556d9252397af (diff)
apalis-tk1: add optional pcie evalboard initialisation
Implement optional PCIe EvalBoard initialisation which properly reset the PLX (now Avago) PEX 8605 PCIe switch plus PCIe devices on the Apalis Evaluation carrier board. Please note that you will have to enable the second PCIe port in the dts as well e.g.: diff --git a/arch/arm/dts/tegra124-apalis.dts b/arch/arm/dts/tegra124-apalis.dts index 595aae8..841c676 100644 --- a/arch/arm/dts/tegra124-apalis.dts +++ b/arch/arm/dts/tegra124-apalis.dts @@ -42,6 +42,10 @@ vddio-pex-ctl-supply = <&reg_3v3>; avdd-pll-erefe-supply = <&avdd_1v05>; + pci@1,0 { + status = "okay"; + }; + /* I210 Gigabit Ethernet Controller (on-module) */ pci@2,0 { status = "okay"; While at it also get rid of the DECLARE_GLOBAL_DATA_PTR which is probably a remnant of the Apalis T30 board file where we use it to get the memory size. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r--board/toradex/apalis-tk1/apalis-tk1.c21
-rw-r--r--include/configs/apalis-tk1.h1
2 files changed, 20 insertions, 2 deletions
diff --git a/board/toradex/apalis-tk1/apalis-tk1.c b/board/toradex/apalis-tk1/apalis-tk1.c
index 2f097056f3..510bdf5240 100644
--- a/board/toradex/apalis-tk1/apalis-tk1.c
+++ b/board/toradex/apalis-tk1/apalis-tk1.c
@@ -18,8 +18,6 @@
#define LAN_RESET_N GPIO_PS2
-DECLARE_GLOBAL_DATA_PTR;
-
int arch_misc_init(void)
{
if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) ==
@@ -149,6 +147,25 @@ int tegra_pcie_board_init(void)
mdelay(100);
gpio_set_value(LAN_RESET_N, 1);
+#ifdef APALIS_TK1_PCIE_EVALBOARD_INIT
+#define PEX_PERST_N GPIO_PDD1 /* Apalis GPIO7 */
+#define RESET_MOCI_CTRL GPIO_PU4
+
+ /* Reset PLX PEX 8605 PCIe Switch plus PCIe devices on Apalis Evaluation
+ Board */
+ gpio_request(PEX_PERST_N, "PEX_PERST_N");
+ gpio_request(RESET_MOCI_CTRL, "RESET_MOCI_CTRL");
+ gpio_direction_output(PEX_PERST_N, 0);
+ gpio_direction_output(RESET_MOCI_CTRL, 0);
+ /* Must be asserted for 100 ms after power and clocks are stable */
+ mdelay(100);
+ gpio_set_value(PEX_PERST_N, 1);
+ /* Err_5: PEX_REFCLK_OUTpx/nx Clock Outputs is not Guaranteed Until
+ 900 us After PEX_PERST# De-assertion */
+ mdelay(1);
+ gpio_set_value(RESET_MOCI_CTRL, 1);
+#endif /* APALIS_T30_PCIE_EVALBOARD_INIT */
+
return 0;
}
diff --git a/include/configs/apalis-tk1.h b/include/configs/apalis-tk1.h
index 3aaf4ceb8d..d258387cc3 100644
--- a/include/configs/apalis-tk1.h
+++ b/include/configs/apalis-tk1.h
@@ -69,6 +69,7 @@
#define CONFIG_PCI_PNP
#define CONFIG_CMD_PCI
#define CONFIG_CMD_PCI_ENUM
+#undef APALIS_TK1_PCIE_EVALBOARD_INIT
/* PCI networking support */
#define CONFIG_E1000