Skip to content

Commit c1fb834

Browse files
Liu Yu-B13201davem330
authored andcommitted
mpc8569mds: Add bscr setting for rtbi mode
Signed-off-by: Liu Yu <yu.liu@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d03e067 commit c1fb834

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

arch/powerpc/platforms/85xx/mpc85xx_mds.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ static void __init mpc85xx_mds_setup_arch(void)
237237
} else if (machine_is(mpc8569_mds)) {
238238
#define BCSR7_UCC12_GETHnRST (0x1 << 2)
239239
#define BCSR8_UEM_MARVELL_RST (0x1 << 1)
240+
#define BCSR_UCC_RGMII (0x1 << 6)
241+
#define BCSR_UCC_RTBI (0x1 << 5)
240242
/*
241243
* U-Boot mangles interrupt polarity for Marvell PHYs,
242244
* so reset built-in and UEM Marvell PHYs, this puts
@@ -247,6 +249,28 @@ static void __init mpc85xx_mds_setup_arch(void)
247249

248250
setbits8(&bcsr_regs[7], BCSR7_UCC12_GETHnRST);
249251
clrbits8(&bcsr_regs[8], BCSR8_UEM_MARVELL_RST);
252+
253+
for (np = NULL; (np = of_find_compatible_node(np,
254+
"network",
255+
"ucc_geth")) != NULL;) {
256+
const unsigned int *prop;
257+
int ucc_num;
258+
259+
prop = of_get_property(np, "cell-index", NULL);
260+
if (prop == NULL)
261+
continue;
262+
263+
ucc_num = *prop - 1;
264+
265+
prop = of_get_property(np, "phy-connection-type", NULL);
266+
if (prop == NULL)
267+
continue;
268+
269+
if (strcmp("rtbi", (const char *)prop) == 0)
270+
clrsetbits_8(&bcsr_regs[7 + ucc_num],
271+
BCSR_UCC_RGMII, BCSR_UCC_RTBI);
272+
}
273+
250274
}
251275
iounmap(bcsr_regs);
252276
}

0 commit comments

Comments
 (0)