提交 5634cb2b 编写于 作者: A Arun Parameswaran 提交者: David S. Miller

net: phy: Disable external master access in bcm mdio mux driver

Configure the scan control register in the Broadcom iProc
mdio mux driver to disable access to external master.

In some SoC's, the scan control register defaults to an incorrect
value.
Signed-off-by: NArun Parameswaran <arun.parameswaran@broadcom.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 18b872d8
......@@ -22,6 +22,9 @@
#include <linux/mdio-mux.h>
#include <linux/delay.h>
#define MDIO_SCAN_CTRL_OFFSET 0x008
#define MDIO_SCAN_CTRL_OVRIDE_EXT_MSTR 28
#define MDIO_PARAM_OFFSET 0x23c
#define MDIO_PARAM_MIIM_CYCLE 29
#define MDIO_PARAM_INTERNAL_SEL 25
......@@ -53,6 +56,16 @@ struct iproc_mdiomux_desc {
struct mii_bus *mii_bus;
};
static void mdio_mux_iproc_config(struct iproc_mdiomux_desc *md)
{
u32 val;
/* Disable external mdio master access */
val = readl(md->base + MDIO_SCAN_CTRL_OFFSET);
val |= BIT(MDIO_SCAN_CTRL_OVRIDE_EXT_MSTR);
writel(val, md->base + MDIO_SCAN_CTRL_OFFSET);
}
static int iproc_mdio_wait_for_idle(void __iomem *base, bool result)
{
unsigned int timeout = 1000; /* loop for 1s */
......@@ -216,6 +229,8 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev)
goto out_register;
}
mdio_mux_iproc_config(md);
dev_info(md->dev, "iProc mdiomux registered\n");
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册