summaryrefslogtreecommitdiff
path: root/board/scalys/simc-t10xx/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/scalys/simc-t10xx/pci.c')
-rw-r--r--board/scalys/simc-t10xx/pci.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/board/scalys/simc-t10xx/pci.c b/board/scalys/simc-t10xx/pci.c
index 9a02f90..8adcc4b 100644
--- a/board/scalys/simc-t10xx/pci.c
+++ b/board/scalys/simc-t10xx/pci.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 Scalys B.V.
+ * Copyright 2020 Scalys B.V.
* opensource@scalys.com
*
* Copyright 2013 Freescale Semiconductor, Inc.
@@ -14,9 +14,13 @@
#include <libfdt.h>
#include <fdt_support.h>
#include <asm/fsl_serdes.h>
+#include "dragonfruit.h"
void pci_init_board(void)
{
+ int serdes_config;
+ uint32_t boot_source;
+ ccsr_gur_t __iomem *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
uint32_t *gpio1_gpdir = (uint32_t *) 0xffe130000;
uint32_t *gpio1_gpdat = (uint32_t *) 0xffe130008;
@@ -24,14 +28,16 @@ void pci_init_board(void)
uint32_t *gpio2_gpdat = (uint32_t *) 0xffe131008;
uint32_t regval;
- /*debug("%s\n", __FUNCTION__);*/
-
- /*TODO, when present pins are available on the board, use them to enable only active slots*/
+
+ /* SERDES configuration is determined boot time through the RCW config.
+ * It is located in the fourth RCW word (bit 128-135 of the RCW). */
+ serdes_config = ( in_be32(&gur->rcwsr[4]) >> 24);
+ /* Configure SERDES lane multiplexing on Dragonfruit carrier */
+ scalys_carrier_setup_muxing(serdes_config);
#if 0
/* Dragonfruit Carrier board 1.x */
-
/*
* IRQ[0-3] : PCIe present detect signals
* IRQ[0] : SLOT1_PRSNT2_N : XXX
@@ -57,7 +63,7 @@ void pci_init_board(void)
out_be32(gpio1_gpdir, regval);
#else
- /* Dragonfruit Carrier board 2.x */
+ /* Dragonfruit Carrier board 2.x/3.x */
/*
* PCIe present detect signals:
* IRQ[3] : GPIO1_23 : SLOT1_PRSNT2_N