]> git.sur5r.net Git - u-boot/commitdiff
net: sun8i_emac: Fix build for non-H3/H5 SoCs
authorChen-Yu Tsai <wens@csie.org>
Fri, 22 Sep 2017 07:26:33 +0000 (15:26 +0800)
committerJagan Teki <jagan@amarulasolutions.com>
Fri, 10 Nov 2017 13:40:33 +0000 (19:10 +0530)
Only the H3/H5 SoCs have an internal PHY and its related clock and
reset controls.

Use an #ifdef to guard the internal PHY control code block so it
can be built for other SoCs, such as the A83T or A64.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
drivers/net/sun8i_emac.c

index 09bbb2cdb5cad47967ffb5ca4f9f9f871349fc54..3ccc6b0bb612de20e6973979c28bb7d981cbc2df 100644 (file)
@@ -604,6 +604,8 @@ static void sun8i_emac_board_setup(struct emac_eth_dev *priv)
 {
        struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
 
+#ifdef CONFIG_MACH_SUNXI_H3_H5
+       /* Only H3/H5 have clock controls for internal EPHY */
        if (priv->use_internal_phy) {
                /* Set clock gating for ephy */
                setbits_le32(&ccm->bus_gate4, BIT(AHB_GATE_OFFSET_EPHY));
@@ -611,6 +613,7 @@ static void sun8i_emac_board_setup(struct emac_eth_dev *priv)
                /* Deassert EPHY */
                setbits_le32(&ccm->ahb_reset2_cfg, BIT(AHB_RESET_OFFSET_EPHY));
        }
+#endif
 
        /* Set clock gating for emac */
        setbits_le32(&ccm->ahb_gate0, BIT(AHB_GATE_OFFSET_GMAC));