fix: pcie: a38x,a39x: fixed PCIex4 interface count
This patch add required fixes for:
"fix: pcie: a39x, a38x: fixed PCIeX4 interface count print"
Previous patch fix only the print of detected link type (X1/X4)
This Patch:
- Fixes the counting of PCIeX4 interface as 1
- The correct count implies on:
- The bootloader interface count prints (If X4 detected)
- Device Tree update
Change-Id: Iae767116b0864904fe4c5b87ceb48e0331fa8909
Signed-off-by: Shaker Daibes <shaker@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/18305
Reviewed-by: Omri Itach <omrii@marvell.com>
Tested-by: Omri Itach <omrii@marvell.com>
(cherry picked from commit 33c6c7d8f8d558f1cefcdd0d716a0ce8f686af48)
Reviewed-on: http://vgitil04.il.marvell.com:8080/20067
Tested-by: Star_Automation <star@marvell.com>
diff --git a/board/mv_ebu/a38x/armada_38x_family/ctrlEnv/mvCtrlEnvLib.c b/board/mv_ebu/a38x/armada_38x_family/ctrlEnv/mvCtrlEnvLib.c
index b06d079..5e4c9de 100644
--- a/board/mv_ebu/a38x/armada_38x_family/ctrlEnv/mvCtrlEnvLib.c
+++ b/board/mv_ebu/a38x/armada_38x_family/ctrlEnv/mvCtrlEnvLib.c
@@ -491,12 +491,17 @@
ifNo = comPhyCfg & 0x0f;
switch (comPhyCfg & 0xF0) {
case SERDES_UNIT_PEX:
- if ((ifNo == PEX0_IF) && (commPhyCfgReg & PCIE0_X4_EN_MASK))
- boardPexInfo->pexUnitCfg[ifNo] = PEX_BUS_MODE_X4;
- else
+ if ((ifNo == PEX0_IF) && (commPhyCfgReg & PCIE0_X4_EN_MASK)) {
+ if (serdesNum == 0) {
+ boardPexInfo->pexUnitCfg[ifNo] = PEX_BUS_MODE_X4;
+ boardPexInfo->pexMapping[boardPexInfo->boardPexIfNum] = ifNo;
+ boardPexInfo->boardPexIfNum++;
+ }
+ } else {
boardPexInfo->pexUnitCfg[ifNo] = PEX_BUS_MODE_X1;
- boardPexInfo->pexMapping[boardPexInfo->boardPexIfNum] = ifNo;
- boardPexInfo->boardPexIfNum++;
+ boardPexInfo->pexMapping[boardPexInfo->boardPexIfNum] = ifNo;
+ boardPexInfo->boardPexIfNum++;
+ }
DB(printf("PEX, if=%d\n", ifNo));
break;
case SERDES_UNIT_SATA: