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 9B01AC43217 for ; Sun, 27 Nov 2022 15:30:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 854DA84C47; Sun, 27 Nov 2022 16:27:10 +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="XP620Gf/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B59E984D54; Sun, 27 Nov 2022 16:26:12 +0100 (CET) Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) (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 DD75984F03 for ; Sun, 27 Nov 2022 16:26:09 +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-x62c.google.com with SMTP id b2so4048528eja.7 for ; Sun, 27 Nov 2022 07:26:09 -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=oWJ3L5ffTA2yxRf+cnMYCWS12Z9BpbEczOxgjAieLQU=; b=XP620Gf/KucHApBvRTAjsEP6pe6a79rKhQP+ltcjZ9rTIoZUAYoChxLshxgLjbZVpM CRybTNFZzEbgo/wuakhTWakKuemKOt0yMTghG93KkRPtQsHVcYYA1Ln6qKuoDyrDX1OV NjFw031wB3wT8E0e1LqUKpk4VcnGEgp5RYOfQ= 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=oWJ3L5ffTA2yxRf+cnMYCWS12Z9BpbEczOxgjAieLQU=; b=u9aHELhmA09RE9I4tOU6le10dAk9ttwckQTbzSm7LngMtIFSYhPN87He/qcCBZsALI 57piUtal/RG9WmJwyD1ziRppQpeePQcZe9rIpEjrLlDMXNtNmqtONIn/mjDqPLEKrKdv 89enX5nuZG21E/lByOgi98pLd+lC21/EAmHnX6W5GKV14yiRvv/nSQ/UR9diFCVufZeh 5UymrBuiL30rbOOdtBMwkxMxUL0g3MIJetgWIDnBoBprX+dg0AhaPEIKF23iNWEG7hMk JL/NiIg0uMGfLDQgYJe4RH/Br9DTEWTP0kNM0/mPxWr2Sb+BgCzN/yo88ixGC9lIBSHF PEtA== X-Gm-Message-State: ANoB5pmqa11PPFv/SRlBeY3b6qSIJMMmbs126x12yJtJs+GTTMWegCEV mBwaZR/aOXGYtGNaVqjz8+8tq+/RTax0Fg== X-Google-Smtp-Source: AA0mqf7STCoZmBmkj38V31mF1C08uD8ogzxxGx/lfcc61Z66a2OdnU14NCQqFhhY2rzGGV//+SX6Qw== X-Received: by 2002:a17:906:3a5b:b0:78d:f3f4:b1a0 with SMTP id a27-20020a1709063a5b00b0078df3f4b1a0mr40436300ejf.489.1669562769400; Sun, 27 Nov 2022 07:26:09 -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.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Nov 2022 07:26:09 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH 28/41] net: sh_eth: Remove non-DM_ETH code Date: Sun, 27 Nov 2022 10:25:23 -0500 Message-Id: <20221127152536.1556469-28-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/sh_eth.c | 160 ------------------------------------------- 1 file changed, 160 deletions(-) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 1de3ff8add2c..0c584a23b97e 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -23,12 +23,10 @@ #include #include -#ifdef CONFIG_DM_ETH #include #include #include #include -#endif #include "sh_eth.h" @@ -526,163 +524,6 @@ static int sh_eth_start_common(struct sh_eth_dev *eth) return 0; } -#ifndef CONFIG_DM_ETH -static int sh_eth_phy_config_legacy(struct sh_eth_dev *eth) -{ - int ret = 0; - struct sh_eth_info *port_info = ð->port_info[eth->port]; - struct eth_device *dev = port_info->dev; - struct phy_device *phydev; - - phydev = phy_connect( - miiphy_get_dev_by_name(dev->name), - port_info->phy_addr, dev, CONFIG_SH_ETHER_PHY_MODE); - port_info->phydev = phydev; - phy_config(phydev); - - return ret; -} - -static int sh_eth_send_legacy(struct eth_device *dev, void *packet, int len) -{ - struct sh_eth_dev *eth = dev->priv; - - return sh_eth_send_common(eth, packet, len); -} - -static int sh_eth_recv_common(struct sh_eth_dev *eth) -{ - int len = 0; - struct sh_eth_info *port_info = ð->port_info[eth->port]; - uchar *packet = (uchar *)ADDR_TO_P2(port_info->rx_desc_cur->rd2); - - len = sh_eth_recv_start(eth); - if (len > 0) { - invalidate_cache(packet, len); - net_process_received_packet(packet, len); - sh_eth_recv_finish(eth); - } else - len = 0; - - /* Restart the receiver if disabled */ - if (!(sh_eth_read(port_info, EDRRR) & EDRRR_R)) - sh_eth_write(port_info, EDRRR_R, EDRRR); - - return len; -} - -static int sh_eth_recv_legacy(struct eth_device *dev) -{ - struct sh_eth_dev *eth = dev->priv; - - return sh_eth_recv_common(eth); -} - -static int sh_eth_init_legacy(struct eth_device *dev, struct bd_info *bd) -{ - struct sh_eth_dev *eth = dev->priv; - int ret; - - ret = sh_eth_init_common(eth, dev->enetaddr); - if (ret) - return ret; - - ret = sh_eth_phy_config_legacy(eth); - if (ret) { - printf(SHETHER_NAME ": phy config timeout\n"); - goto err_start; - } - - ret = sh_eth_start_common(eth); - if (ret) - goto err_start; - - return 0; - -err_start: - sh_eth_tx_desc_free(eth); - sh_eth_rx_desc_free(eth); - return ret; -} - -void sh_eth_halt_legacy(struct eth_device *dev) -{ - struct sh_eth_dev *eth = dev->priv; - - sh_eth_stop(eth); -} - -int sh_eth_initialize(struct bd_info *bd) -{ - int ret = 0; - struct sh_eth_dev *eth = NULL; - struct eth_device *dev = NULL; - struct mii_dev *mdiodev; - - eth = (struct sh_eth_dev *)malloc(sizeof(struct sh_eth_dev)); - if (!eth) { - printf(SHETHER_NAME ": %s: malloc failed\n", __func__); - ret = -ENOMEM; - goto err; - } - - dev = (struct eth_device *)malloc(sizeof(struct eth_device)); - if (!dev) { - printf(SHETHER_NAME ": %s: malloc failed\n", __func__); - ret = -ENOMEM; - goto err; - } - memset(dev, 0, sizeof(struct eth_device)); - memset(eth, 0, sizeof(struct sh_eth_dev)); - - eth->port = CONFIG_SH_ETHER_USE_PORT; - eth->port_info[eth->port].phy_addr = CONFIG_SH_ETHER_PHY_ADDR; - eth->port_info[eth->port].iobase = - (void __iomem *)(BASE_IO_ADDR + 0x800 * eth->port); - - dev->priv = (void *)eth; - dev->iobase = 0; - dev->init = sh_eth_init_legacy; - dev->halt = sh_eth_halt_legacy; - dev->send = sh_eth_send_legacy; - dev->recv = sh_eth_recv_legacy; - eth->port_info[eth->port].dev = dev; - - strcpy(dev->name, SHETHER_NAME); - - /* Register Device to EtherNet subsystem */ - eth_register(dev); - - bb_miiphy_buses[0].priv = eth; - mdiodev = mdio_alloc(); - if (!mdiodev) - return -ENOMEM; - strlcpy(mdiodev->name, dev->name, MDIO_NAME_LEN); - mdiodev->read = bb_miiphy_read; - mdiodev->write = bb_miiphy_write; - - ret = mdio_register(mdiodev); - if (ret < 0) - return ret; - - if (!eth_env_get_enetaddr("ethaddr", dev->enetaddr)) - puts("Please set MAC address\n"); - - return ret; - -err: - if (dev) - free(dev); - - if (eth) - free(eth); - - printf(SHETHER_NAME ": Failed\n"); - return ret; -} - -#else /* CONFIG_DM_ETH */ - struct sh_ether_priv { struct sh_eth_dev shdev; @@ -955,7 +796,6 @@ U_BOOT_DRIVER(eth_sh_ether) = { .plat_auto = sizeof(struct eth_pdata), .flags = DM_FLAG_ALLOC_PRIV_DMA, }; -#endif /******* for bb_miiphy *******/ static int sh_eth_bb_init(struct bb_miiphy_bus *bus) -- 2.25.1