From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A27A2C43217 for ; Sun, 27 Nov 2022 15:32:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CA5318526F; Sun, 27 Nov 2022 16:27:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="UCrazDr6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E9B0D85073; Sun, 27 Nov 2022 16:26:09 +0100 (CET) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A82BD850C8 for ; Sun, 27 Nov 2022 16:26:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-ed1-x52d.google.com with SMTP id b8so12369499edf.11 for ; Sun, 27 Nov 2022 07:26:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=absfsNL5HilIwDgjgqLrx+bbmo3wR9mjzToktO94SfY=; b=UCrazDr6wMr/Ia87Ds8igw7z2z4yAfq5mskcuLtqj2gfgbnbLXdBGYI+wqLsFJRB4f z/4DcxxRoz/OEIsrHWqp1gpldLdw0jrjU8zMoQiutWu/F7Bs34qshvGxlOtuHYF3QlFy rPkOwiJZ3KI/teHFlDz3JgkHpP/NnlbOrxm4Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=absfsNL5HilIwDgjgqLrx+bbmo3wR9mjzToktO94SfY=; b=gqQUqhW9CPDT8QBgKhzd25fyJktEf/zXITU3ZxuqFcCxsyNDqF1yecQHU3hKZMY3Lw jdCy3xvjhjfEMdSyH2gmgp8Rb5UjK/oRn9mgrdZ94pbLH+ArZXW1KncfTV+tgciu1d38 ciClLqLpCoia+1xHZxa9LwwXAfjOrFqxggetQgkh/Oak5vaCXL1ffzauJpm/YybUL9tt 0TpozG1a+2ioZCTnnrQXLhbXn/BsQrMIonePC/jTRD8LXaVX889DhjWSMm59tppdHk9W /F9d50x1tclKrRoPbyHU49zgWJZbwYQBLGh45F20XwYetObFwv1r6XDp7iOrRL9XAXAZ M2HA== X-Gm-Message-State: ANoB5pl3ABY+eXo83ROskE5dS6LnB37EsRK50OsNH7KkxlkkUovvjZH0 XFTtm8o+MvEurNgycYyqUCcW2fI41HANtA== X-Google-Smtp-Source: AA0mqf7ZTOIJyq//a0/A+4G1t4aQFdTqhSa8IaqWW96ftC0WMn/zNUxUVBJq7sOUvXV4wRH7kSHw/A== X-Received: by 2002:aa7:d518:0:b0:46a:727f:b659 with SMTP id y24-20020aa7d518000000b0046a727fb659mr18475120edq.420.1669562766131; Sun, 27 Nov 2022 07:26:06 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b00-6400-dc2c-1c0a-ea3e-04dc.res6.spectrum.com. [2603:6081:7b00:6400:dc2c:1c0a:ea3e:4dc]) by smtp.gmail.com with ESMTPSA id tb6-20020a1709078b8600b007b47749838asm3853036ejc.45.2022.11.27.07.26.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Nov 2022 07:26:05 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH 25/41] net: phy: Remove non-DM_ETH code Date: Sun, 27 Nov 2022 10:25:20 -0500 Message-Id: <20221127152536.1556469-25-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221127152536.1556469-1-trini@konsulko.com> References: <20221119234545.404563-38-trini@konsulko.com> <20221127152536.1556469-1-trini@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean As DM_ETH is required for all network drivers, it's now safe to remove the non-DM_ETH support code. Signed-off-by: Tom Rini --- drivers/net/phy/aquantia.c | 2 -- drivers/net/phy/atheros.c | 2 -- drivers/net/phy/dp83867.c | 14 ----------- drivers/net/phy/dp83869.c | 14 ----------- drivers/net/phy/marvell.c | 7 ------ drivers/net/phy/micrel_ksz90x1.c | 18 -------------- drivers/net/phy/phy.c | 13 ---------- include/phy.h | 41 -------------------------------- 8 files changed, 111 deletions(-) diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c index 7e950fe0c2fe..db6becf929c6 100644 --- a/drivers/net/phy/aquantia.c +++ b/drivers/net/phy/aquantia.c @@ -338,7 +338,6 @@ static int aquantia_set_proto(struct phy_device *phydev, static int aquantia_dts_config(struct phy_device *phydev) { -#ifdef CONFIG_DM_ETH ofnode node = phydev->node; u32 prop; u16 reg; @@ -374,7 +373,6 @@ static int aquantia_dts_config(struct phy_device *phydev) (u16)(prop << 1)); } -#endif return 0; } diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c index fa1fe08518f4..c6f9f916459b 100644 --- a/drivers/net/phy/atheros.c +++ b/drivers/net/phy/atheros.c @@ -191,7 +191,6 @@ static int ar803x_regs_config(struct phy_device *phydev) static int ar803x_of_init(struct phy_device *phydev) { -#if defined(CONFIG_DM_ETH) struct ar803x_priv *priv; ofnode node, vddio_reg_node; u32 strength, freq, min_uV, max_uV; @@ -306,7 +305,6 @@ static int ar803x_of_init(struct phy_device *phydev) debug("%s: flags=%x clk_25m_reg=%04x clk_25m_mask=%04x\n", __func__, priv->flags, priv->clk_25m_reg, priv->clk_25m_mask); -#endif return 0; } diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 3d862636b6b2..a45152bddc97 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -144,7 +144,6 @@ static int dp83867_config_port_mirroring(struct phy_device *phydev) return 0; } -#if defined(CONFIG_DM_ETH) /** * dp83867_data_init - Convenience function for setting PHY specific data * @@ -249,19 +248,6 @@ static int dp83867_of_init(struct phy_device *phydev) return 0; } -#else -static int dp83867_of_init(struct phy_device *phydev) -{ - struct dp83867_private *dp83867 = phydev->priv; - - dp83867->rx_id_delay = DP83867_RGMIIDCTL_2_25_NS; - dp83867->tx_id_delay = DP83867_RGMIIDCTL_2_75_NS; - dp83867->fifo_depth = DEFAULT_FIFO_DEPTH; - dp83867->io_impedance = -EINVAL; - - return 0; -} -#endif static int dp83867_config(struct phy_device *phydev) { diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c index c9461185cfe8..23dbf42b68c6 100644 --- a/drivers/net/phy/dp83869.c +++ b/drivers/net/phy/dp83869.c @@ -157,7 +157,6 @@ static int dp83869_config_port_mirroring(struct phy_device *phydev) return 0; } -#ifdef CONFIG_DM_ETH static const int dp83869_internal_delay[] = {250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000, 3250, 3500, 3750, 4000}; @@ -269,19 +268,6 @@ static int dp83869_of_init(struct phy_device *phydev) return 0; } -#else -static int dp83869_of_init(struct phy_device *phydev) -{ - struct dp83869_private *dp83869 = phydev->priv; - - dp83869->rx_int_delay = DP83869_RGMIIDCTL_2_25_NS; - dp83869->tx_int_delay = DP83869_RGMIIDCTL_2_75_NS; - dp83869->fifo_depth = DEFAULT_FIFO_DEPTH; - dp83869->io_impedance = -EINVAL; - - return 0; -} -#endif /* CONFIG_OF_MDIO */ static int dp83869_configure_rgmii(struct phy_device *phydev, struct dp83869_private *dp83869) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 212a861596f6..1a25775eee62 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -104,7 +104,6 @@ #define MIIM_88E151x_MODE_SGMII 1 #define MIIM_88E151x_RESET_OFFS 15 -#if IS_ENABLED(CONFIG_DM_ETH) static int marvell_read_page(struct phy_device *phydev) { return phy_read(phydev, MDIO_DEVAD_NONE, MII_MARVELL_PHY_PAGE); @@ -179,12 +178,6 @@ static int marvell_of_reg_init(struct phy_device *phydev) err: return marvell_write_page(phydev, saved_page); } -#else -static int marvell_of_reg_init(struct phy_device *phydev) -{ - return 0; -} -#endif /* CONFIG_DM_ETH */ static int m88e1xxx_phy_extread(struct phy_device *phydev, int addr, int devaddr, int regnum) diff --git a/drivers/net/phy/micrel_ksz90x1.c b/drivers/net/phy/micrel_ksz90x1.c index e5f578201f35..79ebdb5e82a0 100644 --- a/drivers/net/phy/micrel_ksz90x1.c +++ b/drivers/net/phy/micrel_ksz90x1.c @@ -68,7 +68,6 @@ static int ksz90xx_startup(struct phy_device *phydev) } /* Common OF config bits for KSZ9021 and KSZ9031 */ -#ifdef CONFIG_DM_ETH struct ksz90x1_reg_field { const char *name; const u8 size; /* Size of the bitfield, in bits */ @@ -211,23 +210,6 @@ static int ksz9031_center_flp_timing(struct phy_device *phydev) return ret; } -#else /* !CONFIG_DM_ETH */ -static int ksz9021_of_config(struct phy_device *phydev) -{ - return 0; -} - -static int ksz9031_of_config(struct phy_device *phydev) -{ - return 0; -} - -static int ksz9031_center_flp_timing(struct phy_device *phydev) -{ - return 0; -} -#endif - /* * KSZ9021 */ diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 90876630533e..f971dc97de61 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -686,9 +686,7 @@ struct phy_device *phy_device_create(struct mii_dev *bus, int addr, dev->link = 0; dev->interface = PHY_INTERFACE_MODE_NA; -#ifdef CONFIG_DM_ETH dev->node = ofnode_null(); -#endif dev->autoneg = AUTONEG_ENABLE; @@ -919,13 +917,8 @@ struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask) return get_phy_device_by_mask(bus, phy_mask); } -#ifdef CONFIG_DM_ETH void phy_connect_dev(struct phy_device *phydev, struct udevice *dev, phy_interface_t interface) -#else -void phy_connect_dev(struct phy_device *phydev, struct eth_device *dev, - phy_interface_t interface) -#endif { /* Soft Reset the PHY */ phy_reset(phydev); @@ -1008,15 +1001,9 @@ static struct phy_device *phy_connect_fixed(struct mii_dev *bus, } #endif -#ifdef CONFIG_DM_ETH struct phy_device *phy_connect(struct mii_dev *bus, int addr, struct udevice *dev, phy_interface_t interface) -#else -struct phy_device *phy_connect(struct mii_dev *bus, int addr, - struct eth_device *dev, - phy_interface_t interface) -#endif { struct phy_device *phydev = NULL; uint mask = (addr >= 0) ? (1 << addr) : 0xffffffff; diff --git a/include/phy.h b/include/phy.h index 0737c4e8f9ae..af74fe58a7fc 100644 --- a/include/phy.h +++ b/include/phy.h @@ -138,12 +138,8 @@ struct phy_device { struct phy_driver *drv; void *priv; -#ifdef CONFIG_DM_ETH struct udevice *dev; ofnode node; -#else - struct eth_device *dev; -#endif /* forced speed & duplex (no autoneg) * partner speed & duplex & pause (autoneg) @@ -233,8 +229,6 @@ static inline struct phy_device *fixed_phy_create(ofnode node) #endif -#ifdef CONFIG_DM_ETH - /** * phy_connect_dev() - Associates the given pair of PHY and Ethernet devices * @phydev: PHY device @@ -293,41 +287,6 @@ static inline ofnode phy_get_ofnode(struct phy_device *phydev) else return dev_ofnode(phydev->dev); } -#else - -/** - * phy_connect_dev() - Associates the given pair of PHY and Ethernet devices - * @phydev: PHY device - * @dev: Ethernet device - * @interface: type of MAC-PHY interface - */ -void phy_connect_dev(struct phy_device *phydev, struct eth_device *dev, - phy_interface_t interface); - -/** - * phy_connect() - Creates a PHY device for the Ethernet interface - * Creates a PHY device for the PHY at the given address, if one doesn't exist - * already, and associates it with the Ethernet device. - * The function may be called with addr <= 0, in this case addr value is ignored - * and the bus is scanned to detect a PHY. Scanning should only be used if only - * one PHY is expected to be present on the MDIO bus, otherwise it is undefined - * which PHY is returned. - * - * @bus: MII/MDIO bus that hosts the PHY - * @addr: PHY address on MDIO bus - * @dev: Ethernet device to associate to the PHY - * @interface: type of MAC-PHY interface - * @return: pointer to phy_device if a PHY is found, or NULL otherwise - */ -struct phy_device *phy_connect(struct mii_dev *bus, int addr, - struct eth_device *dev, - phy_interface_t interface); - -static inline ofnode phy_get_ofnode(struct phy_device *phydev) -{ - return ofnode_null(); -} -#endif int phy_read(struct phy_device *phydev, int devad, int regnum); int phy_write(struct phy_device *phydev, int devad, int regnum, u16 val); -- 2.25.1