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 958B0C43217 for ; Sun, 27 Nov 2022 15:30:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8B3538523B; Sun, 27 Nov 2022 16:27:14 +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="Tagrjhvv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9179E8510C; Sun, 27 Nov 2022 16:26:15 +0100 (CET) Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) (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 2AC20850C8 for ; Sun, 27 Nov 2022 16:26:13 +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-ej1-x62a.google.com with SMTP id fy37so20291753ejc.11 for ; Sun, 27 Nov 2022 07:26:13 -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=qn6rQb+Ba3pbUXzGWp5/PKnoi5ldW94zCChKfcvFXuk=; b=Tagrjhvv0cEulh85QOZ87mChwNkiABaubRjqyB/UjtKD47/0rz5Q6RIDHJpSqgjq6f ergtSQIk8xp3HZzOrZDeke8TeGhATxF5TivH1qfQaEImIGPsEnXufkoxOnLDKbRIe0FV n/MEhXpxnKybVR0+o6fiPgh7L+rpvo1STkM6s= 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=qn6rQb+Ba3pbUXzGWp5/PKnoi5ldW94zCChKfcvFXuk=; b=tsoq0IziG5ZWFhiLUbFt3CxabbeBZ0WH0XB2EWOKcnqXqLr7ms2ylE8Og4giMeaKm+ DN9y/fjxj92mcM9ClTh+0C/NadrMOAajuZErQygzHNV9Ftw1iw1mlfIcfshl2xoPKWjr um2UJjQIx8+gOoXM9NTIo53hR+cL+8GnF2Um1n0PKzLxpt+Lz+ilTZv4teZV0ESWYXoh +uA2sG8+etz1plYjah/nUEBaC5uhEBDsqEkZbzppDuOuIkZnyPgjou38+cCLSWo1bTfV ENuj5+1Ybgz2zFoJO4PjcJx4vl5AWMPtpLSPcS8o6B/ZwAQM0SsJYk0+zD0KyA1HeEUE vGHQ== X-Gm-Message-State: ANoB5pkPdHOjtEkaPV5VyD5uAMT5Y1NeEW4lXDFHO6xGtusQCP9HiTYN 2GbL/9ekOEBlTRGrVxjEs9nJmSMvpaugeA== X-Google-Smtp-Source: AA0mqf7yGz3nJ8w6IwzewnMPj3Zia84lXcCz/qvscv/odD1QfTEhwqSlaERzBV2d0rsy5/jL225hxQ== X-Received: by 2002:a17:907:c081:b0:78b:5182:7ffa with SMTP id st1-20020a170907c08100b0078b51827ffamr29738237ejc.244.1669562772635; Sun, 27 Nov 2022 07:26:12 -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.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Nov 2022 07:26:12 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH 31/41] net: cpsw: Remove non-DM_ETH code Date: Sun, 27 Nov 2022 10:25:26 -0500 Message-Id: <20221127152536.1556469-31-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/ti/cpsw.c | 96 ------------------------------------------- 1 file changed, 96 deletions(-) diff --git a/drivers/net/ti/cpsw.c b/drivers/net/ti/cpsw.c index 41cba7930d13..a19dc38e5251 100644 --- a/drivers/net/ti/cpsw.c +++ b/drivers/net/ti/cpsw.c @@ -200,11 +200,7 @@ struct cpdma_chan { ((priv)->data)->slaves; slave++) struct cpsw_priv { -#ifdef CONFIG_DM_ETH struct udevice *dev; -#else - struct eth_device *dev; -#endif struct cpsw_platform_data *data; int host_port; @@ -455,15 +451,10 @@ static inline void setbit_and_wait_for_clear32(void *addr) static void cpsw_set_slave_mac(struct cpsw_slave *slave, struct cpsw_priv *priv) { -#ifdef CONFIG_DM_ETH struct eth_pdata *pdata = dev_get_plat(priv->dev); writel(mac_hi(pdata->enetaddr), &slave->regs->sa_hi); writel(mac_lo(pdata->enetaddr), &slave->regs->sa_lo); -#else - __raw_writel(mac_hi(priv->dev->enetaddr), &slave->regs->sa_hi); - __raw_writel(mac_lo(priv->dev->enetaddr), &slave->regs->sa_lo); -#endif } static int cpsw_slave_update_link(struct cpsw_slave *slave, @@ -856,21 +847,13 @@ static int cpsw_phy_init(struct cpsw_priv *priv, struct cpsw_slave *slave) ret = phy_set_supported(phydev, slave->data->max_speed); if (ret) return ret; -#if CONFIG_IS_ENABLED(DM_ETH) dev_dbg(priv->dev, "Port %u speed forced to %uMbit\n", slave->slave_num + 1, slave->data->max_speed); -#else - log_debug("%s: Port %u speed forced to %uMbit\n", - priv->dev->name, slave->slave_num + 1, - slave->data->max_speed); -#endif } phydev->advertising = phydev->supported; -#ifdef CONFIG_DM_ETH if (ofnode_valid(slave->data->phy_of_handle)) phydev->node = slave->data->phy_of_handle; -#endif priv->phydev = phydev; phy_config(phydev); @@ -935,84 +918,6 @@ int _cpsw_register(struct cpsw_priv *priv) return 0; } -#ifndef CONFIG_DM_ETH -static int cpsw_init(struct eth_device *dev, struct bd_info *bis) -{ - struct cpsw_priv *priv = dev->priv; - - return _cpsw_init(priv, dev->enetaddr); -} - -static void cpsw_halt(struct eth_device *dev) -{ - struct cpsw_priv *priv = dev->priv; - - return _cpsw_halt(priv); -} - -static int cpsw_send(struct eth_device *dev, void *packet, int length) -{ - struct cpsw_priv *priv = dev->priv; - - return _cpsw_send(priv, packet, length); -} - -static int cpsw_recv(struct eth_device *dev) -{ - struct cpsw_priv *priv = dev->priv; - uchar *pkt = NULL; - int len; - - len = _cpsw_recv(priv, &pkt); - - if (len > 0) { - net_process_received_packet(pkt, len); - cpdma_submit(priv, &priv->rx_chan, pkt, PKTSIZE); - } - - return len; -} - -int cpsw_register(struct cpsw_platform_data *data) -{ - struct cpsw_priv *priv; - struct eth_device *dev; - int ret; - - dev = calloc(sizeof(*dev), 1); - if (!dev) - return -ENOMEM; - - priv = calloc(sizeof(*priv), 1); - if (!priv) { - free(dev); - return -ENOMEM; - } - - priv->dev = dev; - priv->data = data; - - strcpy(dev->name, "cpsw"); - dev->iobase = 0; - dev->init = cpsw_init; - dev->halt = cpsw_halt; - dev->send = cpsw_send; - dev->recv = cpsw_recv; - dev->priv = priv; - - eth_register(dev); - - ret = _cpsw_register(priv); - if (ret < 0) { - eth_unregister(dev); - free(dev); - free(priv); - return ret; - } - - return 1; -} -#else static int cpsw_eth_start(struct udevice *dev) { struct eth_pdata *pdata = dev_get_plat(dev); @@ -1380,4 +1285,3 @@ U_BOOT_DRIVER(eth_cpsw) = { .priv_auto = sizeof(struct cpsw_priv), .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_PRE_RELOC, }; -#endif /* CONFIG_DM_ETH */ -- 2.25.1