summaryrefslogtreecommitdiffstats
path: root/board/freescale/p2041rdb/p2041rdb.c
diff options
context:
space:
mode:
authorShaohui Xie <Shaohui.Xie@freescale.com>2012-12-03 21:36:32 +0000
committerAndy Fleming <afleming@freescale.com>2013-01-30 11:25:08 -0600
commit220d506af3dd45b8e5a79267d46171fa8487066b (patch)
tree82eea6152dcd59d2d18c70d8c038fea3edbe95c0 /board/freescale/p2041rdb/p2041rdb.c
parent88ba6d530d5f30cc2cc3c91bbe4d28e60e96aca5 (diff)
downloadtalos-obmc-uboot-220d506af3dd45b8e5a79267d46171fa8487066b.tar.gz
talos-obmc-uboot-220d506af3dd45b8e5a79267d46171fa8487066b.zip
powerpc/p2041: move Lanes mux to board early init
Lanes mux currently is configured in eth.c when initializing FMAN ethernet ports, but SRIO and PCIe also need lanes mux, so we move the lanes mux to p2041rdb.c which implements a board-specific initialization and will be called at early stage. Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'board/freescale/p2041rdb/p2041rdb.c')
-rw-r--r--board/freescale/p2041rdb/p2041rdb.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/board/freescale/p2041rdb/p2041rdb.c b/board/freescale/p2041rdb/p2041rdb.c
index d2732f5505..4e4d18fe35 100644
--- a/board/freescale/p2041rdb/p2041rdb.c
+++ b/board/freescale/p2041rdb/p2041rdb.c
@@ -101,6 +101,49 @@ int board_early_init_f(void)
return 0;
}
+#define CPLD_LANE_A_SEL 0x1
+#define CPLD_LANE_G_SEL 0x2
+#define CPLD_LANE_C_SEL 0x4
+#define CPLD_LANE_D_SEL 0x8
+
+void board_config_lanes_mux(void)
+{
+ ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+ int srds_prtcl = (in_be32(&gur->rcwsr[4]) &
+ FSL_CORENET_RCWSR4_SRDS_PRTCL) >> 26;
+
+ u8 mux = 0;
+ switch (srds_prtcl) {
+ case 0x2:
+ case 0x5:
+ case 0x9:
+ case 0xa:
+ case 0xf:
+ break;
+ case 0x8:
+ mux |= CPLD_LANE_C_SEL | CPLD_LANE_D_SEL;
+ break;
+ case 0x14:
+ mux |= CPLD_LANE_A_SEL;
+ break;
+ case 0x17:
+ mux |= CPLD_LANE_G_SEL;
+ break;
+ case 0x16:
+ case 0x19:
+ case 0x1a:
+ mux |= CPLD_LANE_G_SEL | CPLD_LANE_C_SEL | CPLD_LANE_D_SEL;
+ break;
+ case 0x1c:
+ mux |= CPLD_LANE_G_SEL | CPLD_LANE_A_SEL;
+ break;
+ default:
+ printf("Fman:Unsupported SerDes Protocol 0x%02x\n", srds_prtcl);
+ break;
+ }
+ CPLD_WRITE(serdes_mux, mux);
+}
+
int board_early_init_r(void)
{
const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
@@ -124,6 +167,7 @@ int board_early_init_r(void)
set_liodns();
setup_portals();
+ board_config_lanes_mux();
return 0;
}
OpenPOWER on IntegriCloud