mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-23 22:14:54 +00:00
board: gw_ventana: enable MV88E61XX DSA support
Add MV88E61XX DSA support: - update dt to provide internal MDIO bus and port handles. U-Boot requires a more restrictive subset of the dt bindings required by Linux for the sake of simplifying code - update defconfig to remove old driver and enable new one - replace mv88e61xx_hw_reset weak override with board_phy_config support for register configuration that is outside the scope of the DSA driver Signed-off-by: Tim Harvey <tharvey@gateworks.com> Reviewed-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
This commit is contained in:
parent
01e7dd050f
commit
c3d9736d54
3 changed files with 56 additions and 37 deletions
|
@ -212,6 +212,27 @@
|
||||||
compatible = "marvell,mv88e6085";
|
compatible = "marvell,mv88e6085";
|
||||||
reg = <0>;
|
reg = <0>;
|
||||||
|
|
||||||
|
mdio {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
|
||||||
|
sw_phy0: ethernet-phy@0 {
|
||||||
|
reg = <0x0>;
|
||||||
|
};
|
||||||
|
|
||||||
|
sw_phy1: ethernet-phy@1 {
|
||||||
|
reg = <0x1>;
|
||||||
|
};
|
||||||
|
|
||||||
|
sw_phy2: ethernet-phy@2 {
|
||||||
|
reg = <0x2>;
|
||||||
|
};
|
||||||
|
|
||||||
|
sw_phy3: ethernet-phy@3 {
|
||||||
|
reg = <0x3>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
ports {
|
ports {
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <0>;
|
#size-cells = <0>;
|
||||||
|
@ -219,27 +240,40 @@
|
||||||
port@0 {
|
port@0 {
|
||||||
reg = <0>;
|
reg = <0>;
|
||||||
label = "lan4";
|
label = "lan4";
|
||||||
|
phy-handle = <&sw_phy0>;
|
||||||
|
phy-mode = "internal";
|
||||||
};
|
};
|
||||||
|
|
||||||
port@1 {
|
port@1 {
|
||||||
reg = <1>;
|
reg = <1>;
|
||||||
label = "lan3";
|
label = "lan3";
|
||||||
|
phy-handle = <&sw_phy1>;
|
||||||
|
phy-mode = "internal";
|
||||||
};
|
};
|
||||||
|
|
||||||
port@2 {
|
port@2 {
|
||||||
reg = <2>;
|
reg = <2>;
|
||||||
label = "lan2";
|
label = "lan2";
|
||||||
|
phy-handle = <&sw_phy2>;
|
||||||
|
phy-mode = "internal";
|
||||||
};
|
};
|
||||||
|
|
||||||
port@3 {
|
port@3 {
|
||||||
reg = <3>;
|
reg = <3>;
|
||||||
label = "lan1";
|
label = "lan1";
|
||||||
|
phy-handle = <&sw_phy3>;
|
||||||
|
phy-mode = "internal";
|
||||||
};
|
};
|
||||||
|
|
||||||
port@5 {
|
port@5 {
|
||||||
reg = <5>;
|
reg = <5>;
|
||||||
label = "cpu";
|
|
||||||
ethernet = <&fec>;
|
ethernet = <&fec>;
|
||||||
|
phy-mode = "rgmii-id";
|
||||||
|
|
||||||
|
fixed-link {
|
||||||
|
speed = <1000>;
|
||||||
|
full-duplex;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -83,43 +83,29 @@ int board_phy_config(struct phy_device *phydev)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phydev->drv->config)
|
/* Fixed PHY: for GW5904/GW5909 this is Marvell 88E6176 GbE Switch */
|
||||||
phydev->drv->config(phydev);
|
if (phydev->phy_id == PHY_FIXED_ID &&
|
||||||
|
(board_type == GW5904 || board_type == GW5909)) {
|
||||||
|
struct mii_dev *bus = miiphy_get_dev_by_name("mdio");
|
||||||
|
|
||||||
return 0;
|
puts("MV88E61XX ");
|
||||||
}
|
/* GPIO[0] output CLK125 for RGMII_REFCLK */
|
||||||
|
bus->write(bus, 0x1c, 0, 0x1a, (1 << 15) | (0x62 << 8) | 0xfe);
|
||||||
#ifdef CONFIG_MV88E61XX_SWITCH
|
bus->write(bus, 0x1c, 0, 0x1a, (1 << 15) | (0x68 << 8) | 7);
|
||||||
int mv88e61xx_hw_reset(struct phy_device *phydev)
|
|
||||||
{
|
|
||||||
struct mii_dev *bus = phydev->bus;
|
|
||||||
|
|
||||||
/* GPIO[0] output, CLK125 */
|
|
||||||
debug("enabling RGMII_REFCLK\n");
|
|
||||||
bus->write(bus, 0x1c /*MV_GLOBAL2*/, 0,
|
|
||||||
0x1a /*MV_SCRATCH_MISC*/,
|
|
||||||
(1 << 15) | (0x62 /*MV_GPIO_DIR*/ << 8) | 0xfe);
|
|
||||||
bus->write(bus, 0x1c /*MV_GLOBAL2*/, 0,
|
|
||||||
0x1a /*MV_SCRATCH_MISC*/,
|
|
||||||
(1 << 15) | (0x68 /*MV_GPIO01_CNTL*/ << 8) | 7);
|
|
||||||
|
|
||||||
/* RGMII delay - Physical Control register bit[15:14] */
|
|
||||||
debug("setting port%d RGMII rx/tx delay\n", CONFIG_MV88E61XX_CPU_PORT);
|
|
||||||
/* forced 1000mbps full-duplex link */
|
|
||||||
bus->write(bus, 0x10 + CONFIG_MV88E61XX_CPU_PORT, 0, 1, 0xc0fe);
|
|
||||||
phydev->autoneg = AUTONEG_DISABLE;
|
|
||||||
phydev->speed = SPEED_1000;
|
|
||||||
phydev->duplex = DUPLEX_FULL;
|
|
||||||
|
|
||||||
|
/* Port 0-3 LED configuration: Table 80/82 */
|
||||||
/* LED configuration: 7:4-green (8=Activity) 3:0 amber (8=Link) */
|
/* LED configuration: 7:4-green (8=Activity) 3:0 amber (8=Link) */
|
||||||
bus->write(bus, 0x10, 0, 0x16, 0x8088);
|
bus->write(bus, 0x10, 0, 0x16, 0x8088);
|
||||||
bus->write(bus, 0x11, 0, 0x16, 0x8088);
|
bus->write(bus, 0x11, 0, 0x16, 0x8088);
|
||||||
bus->write(bus, 0x12, 0, 0x16, 0x8088);
|
bus->write(bus, 0x12, 0, 0x16, 0x8088);
|
||||||
bus->write(bus, 0x13, 0, 0x16, 0x8088);
|
bus->write(bus, 0x13, 0, 0x16, 0x8088);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (phydev->drv->config)
|
||||||
|
phydev->drv->config(phydev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif // CONFIG_MV88E61XX_SWITCH
|
|
||||||
|
|
||||||
#if defined(CONFIG_VIDEO_IPUV3)
|
#if defined(CONFIG_VIDEO_IPUV3)
|
||||||
static void enable_hdmi(struct display_info_t const *dev)
|
static void enable_hdmi(struct display_info_t const *dev)
|
||||||
|
|
|
@ -115,13 +115,12 @@ CONFIG_SUPPORT_EMMC_BOOT=y
|
||||||
CONFIG_FSL_USDHC=y
|
CONFIG_FSL_USDHC=y
|
||||||
CONFIG_MTD=y
|
CONFIG_MTD=y
|
||||||
CONFIG_PHYLIB=y
|
CONFIG_PHYLIB=y
|
||||||
CONFIG_MV88E61XX_SWITCH=y
|
CONFIG_PHY_FIXED=y
|
||||||
CONFIG_MV88E61XX_CPU_PORT=5
|
|
||||||
CONFIG_MV88E61XX_PHY_PORTS=0xf
|
|
||||||
CONFIG_MV88E61XX_FIXED_PORTS=0x0
|
|
||||||
CONFIG_DM_MDIO=y
|
CONFIG_DM_MDIO=y
|
||||||
|
CONFIG_DM_DSA=y
|
||||||
CONFIG_E1000=y
|
CONFIG_E1000=y
|
||||||
CONFIG_FEC_MXC=y
|
CONFIG_FEC_MXC=y
|
||||||
|
CONFIG_MV88E6XXX=y
|
||||||
CONFIG_MII=y
|
CONFIG_MII=y
|
||||||
CONFIG_PCI=y
|
CONFIG_PCI=y
|
||||||
CONFIG_PCIE_IMX=y
|
CONFIG_PCIE_IMX=y
|
||||||
|
|
Loading…
Add table
Reference in a new issue