[U-Boot] [PATCH 4/6] arm/km: support the 2 PCIe fpga resets

Holger Brunck holger.brunck at keymile.com
Fri May 4 15:17:48 CEST 2012


From: Valentin Longchamp <valentin.longchamp at keymile.com>

The PCIe FPGAs now have to support 2 resets: one for the non traffic
affecting part (PCIe) and one for the traffic affecting part.

When the FPGA is not reconfigured, we only reset the PCIe part.

Signed-off-by: Valentin Longchamp <valentin.longchamp at keymile.com>
---
 board/keymile/km_arm/fpga_config.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/board/keymile/km_arm/fpga_config.c b/board/keymile/km_arm/fpga_config.c
index fdc8727..fcc5fe6 100644
--- a/board/keymile/km_arm/fpga_config.c
+++ b/board/keymile/km_arm/fpga_config.c
@@ -206,25 +206,30 @@ int wait_for_fpga_config(void)
 }
 
 #define PRST1		0x4
-#define BRIDGE_RST	0x4
+#define PCIE_RST	0x10
+#define TRAFFIC_RST	0x04
 
 int fpga_reset(void)
 {
 	int ret = 0;
+	u8 resets;
 
 	if (!check_boco2()) {
 		/* we do not have BOCO2, this is not really used */
 		return 0;
 	}
 
-	ret = boco_clear_bits(PRST1, BRIDGE_RST);
+	/* if we have skipped, we only want to reset the PCIe part */
+	resets = skip ? PCIE_RST : PCIE_RST | TRAFFIC_RST;
+
+	ret = boco_clear_bits(PRST1, resets);
 	if (ret)
 		return ret;
 
 	/* small delay for the pulse */
 	udelay(10);
 
-	ret = boco_set_bits(PRST1, BRIDGE_RST);
+	ret = boco_set_bits(PRST1, resets);
 	if (ret)
 		return ret;
 
-- 
1.7.1



More information about the U-Boot mailing list