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 X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F1A3C432BE for ; Sat, 28 Aug 2021 13:38:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9281D60EAF for ; Sat, 28 Aug 2021 13:38:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9281D60EAF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 12E588317A; Sat, 28 Aug 2021 15:38:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JviYcUIk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AC7C8832CE; Sat, 28 Aug 2021 15:38:15 +0200 (CEST) Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) (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 9F6BA82DE4 for ; Sat, 28 Aug 2021 15:38:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rfried.dev@gmail.com Received: by mail-oi1-x22f.google.com with SMTP id v2so13616826oie.6 for ; Sat, 28 Aug 2021 06:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Jqp75XuTSACMyXKAVEgR8VW5nnDg37HHkJ3ve/ngDpg=; b=JviYcUIktkQ7dAbXvVrLqaf3FnURtnFwPENZVBzPR6z/w90Hl7HCnEAtcVBf0ZMAnj Bc2N1bQ60RC//tbjxQe+pGDyYDoVjpEjBHgYVWz3X1ewkaTlbaM/R3WO6dX2xm5wyvsS GmR21Y+4IBPzD6oL0AId8FF8JLy8pNjABqRAjRaCNIk0shmv4IYygQ/aeXfCn817tWdr b9CYWPECIZZTwTmSJlc9dUhMENu/vZjJ6QavnhsJdez/7LX/Cxw7ROyKFkczqFwxfvqz mY83ZMk9G9sN2xcwxasS4RUdTwQG2yCIPhDycWmCnK7Ma4n2YMdS3frMssLzQZYV8I9H Cf9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Jqp75XuTSACMyXKAVEgR8VW5nnDg37HHkJ3ve/ngDpg=; b=uMiWhqAxc4dUBX1KRvC9gxAeueuwxwNjRUitSKgCvR/8NTtnPnpyPbopWFKglprenp 5QHJVzTr1OAiUcPBn+VqIbe6KP6aBtmEd1tgYqpal9CzGTCGzyy2rU5PKyFKC3Cjvlda acsIGZVGuy0Ed51gTf9AGoQiCWzXKzBWaQTce92+xrWGPGxEwIBdPn+SHkUC2uxZy3tv Wd6N4razlnSXHW4iMWLVq02HPD2AVpMSskbUWMQ5VHhFor6TOL30+NE0dRCpXRqlgetw gBbHq2dD7zCktJwz0tV+xJg+NDIUJTbXN0wcQBXu6eTWjWqQcjYdRwIi5aI20LbF5sij phIw== X-Gm-Message-State: AOAM533J685dSj+ELOdz01Y17g6B+j4nxhnFVYOxciKn0w/sS1T+KzTZ RK9jrHgLBftWZ6zuPCEh3yr3P1ddBAa9el+0dL4= X-Google-Smtp-Source: ABdhPJxatB7fko6mFKm4K0zKasvL/WqjNDTtyoFa75yNqkOA2s1TH+WrkgCrPD5Z+rIdC0Jji/VZnZrGtfvTlecUdJk= X-Received: by 2002:a05:6808:d51:: with SMTP id w17mr18739614oik.179.1630157889233; Sat, 28 Aug 2021 06:38:09 -0700 (PDT) MIME-Version: 1.0 References: <20210825102828.718784-1-eugen.hristev@microchip.com> In-Reply-To: <20210825102828.718784-1-eugen.hristev@microchip.com> From: Ramon Fried Date: Sat, 28 Aug 2021 16:37:58 +0300 Message-ID: Subject: Re: [PATCH] net: remove unused CONFIG_DRIVER_AT91EMAC_* To: Eugen Hristev Cc: Joe Hershberger , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On Wed, Aug 25, 2021 at 1:28 PM Eugen Hristev wrote: > > AT91EMAC driver is unused, thus removing. > > Signed-off-by: Eugen Hristev > --- > README | 11 - > drivers/net/Makefile | 1 - > drivers/net/at91_emac.c | 519 ----------------------------------- > include/netdev.h | 1 - > scripts/config_whitelist.txt | 2 - > 5 files changed, 534 deletions(-) > delete mode 100644 drivers/net/at91_emac.c > > diff --git a/README b/README > index 1c1db98098..18e116c36f 100644 > --- a/README > +++ b/README > @@ -879,17 +879,6 @@ The following options need to be configured: > Support for National dp8382[01] gigabit chips. > > - NETWORK Support (other): > - > - CONFIG_DRIVER_AT91EMAC > - Support for AT91RM9200 EMAC. > - > - CONFIG_RMII > - Define this to use reduced MII inteface > - > - CONFIG_DRIVER_AT91EMAC_QUIET > - If this defined, the driver is quiet. > - The driver doen't show link status messages. > - > CONFIG_CALXEDA_XGMAC > Support for the Calxeda XGMAC device > > diff --git a/drivers/net/Makefile b/drivers/net/Makefile > index b94ccea100..2685da7c13 100644 > --- a/drivers/net/Makefile > +++ b/drivers/net/Makefile > @@ -9,7 +9,6 @@ obj-$(CONFIG_ARMADA100_FEC) += armada100_fec.o > obj-$(CONFIG_BCM6348_ETH) += bcm6348-eth.o > obj-$(CONFIG_BCM6368_ETH) += bcm6368-eth.o > obj-$(CONFIG_BCMGENET) += bcmgenet.o > -obj-$(CONFIG_DRIVER_AT91EMAC) += at91_emac.o > obj-$(CONFIG_DRIVER_AX88180) += ax88180.o > obj-$(CONFIG_BCM_SF2_ETH) += bcm-sf2-eth.o > obj-$(CONFIG_BCM_SF2_ETH_GMAC) += bcm-sf2-eth-gmac.o > diff --git a/drivers/net/at91_emac.c b/drivers/net/at91_emac.c > deleted file mode 100644 > index e40b94ad89..0000000000 > --- a/drivers/net/at91_emac.c > +++ /dev/null > @@ -1,519 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0+ > -/* > - * Copyright (C) 2009 BuS Elektronik GmbH & Co. KG > - * Jens Scharsig (esw@bus-elektronik.de) > - * > - * (C) Copyright 2003 > - * Author : Hamid Ikdoumi (Atmel) > - */ > - > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > -#undef MII_DEBUG > -#undef ET_DEBUG > - > -#if (CONFIG_SYS_RX_ETH_BUFFER > 1024) > -#error AT91 EMAC supports max 1024 RX buffers. \ > - Please decrease the CONFIG_SYS_RX_ETH_BUFFER value > -#endif > - > -#ifndef CONFIG_DRIVER_AT91EMAC_PHYADDR > -#define CONFIG_DRIVER_AT91EMAC_PHYADDR 0 > -#endif > - > -/* MDIO clock must not exceed 2.5 MHz, so enable MCK divider */ > -#if (AT91C_MASTER_CLOCK > 80000000) > - #define HCLK_DIV AT91_EMAC_CFG_MCLK_64 > -#elif (AT91C_MASTER_CLOCK > 40000000) > - #define HCLK_DIV AT91_EMAC_CFG_MCLK_32 > -#elif (AT91C_MASTER_CLOCK > 20000000) > - #define HCLK_DIV AT91_EMAC_CFG_MCLK_16 > -#else > - #define HCLK_DIV AT91_EMAC_CFG_MCLK_8 > -#endif > - > -#ifdef ET_DEBUG > -#define DEBUG_AT91EMAC 1 > -#else > -#define DEBUG_AT91EMAC 0 > -#endif > - > -#ifdef MII_DEBUG > -#define DEBUG_AT91PHY 1 > -#else > -#define DEBUG_AT91PHY 0 > -#endif > - > -#ifndef CONFIG_DRIVER_AT91EMAC_QUIET > -#define VERBOSEP 1 > -#else > -#define VERBOSEP 0 > -#endif > - > -#define RBF_ADDR 0xfffffffc > -#define RBF_OWNER (1<<0) > -#define RBF_WRAP (1<<1) > -#define RBF_BROADCAST (1<<31) > -#define RBF_MULTICAST (1<<30) > -#define RBF_UNICAST (1<<29) > -#define RBF_EXTERNAL (1<<28) > -#define RBF_UNKNOWN (1<<27) > -#define RBF_SIZE 0x07ff > -#define RBF_LOCAL4 (1<<26) > -#define RBF_LOCAL3 (1<<25) > -#define RBF_LOCAL2 (1<<24) > -#define RBF_LOCAL1 (1<<23) > - > -#define RBF_FRAMEMAX CONFIG_SYS_RX_ETH_BUFFER > -#define RBF_FRAMELEN 0x600 > - > -typedef struct { > - unsigned long addr, size; > -} rbf_t; > - > -typedef struct { > - rbf_t rbfdt[RBF_FRAMEMAX]; > - unsigned long rbindex; > -} emac_device; > - > -void at91emac_EnableMDIO(at91_emac_t *at91mac) > -{ > - /* Mac CTRL reg set for MDIO enable */ > - writel(readl(&at91mac->ctl) | AT91_EMAC_CTL_MPE, &at91mac->ctl); > -} > - > -void at91emac_DisableMDIO(at91_emac_t *at91mac) > -{ > - /* Mac CTRL reg set for MDIO disable */ > - writel(readl(&at91mac->ctl) & ~AT91_EMAC_CTL_MPE, &at91mac->ctl); > -} > - > -int at91emac_read(at91_emac_t *at91mac, unsigned char addr, > - unsigned char reg, unsigned short *value) > -{ > - unsigned long netstat; > - at91emac_EnableMDIO(at91mac); > - > - writel(AT91_EMAC_MAN_HIGH | AT91_EMAC_MAN_RW_R | > - AT91_EMAC_MAN_REGA(reg) | AT91_EMAC_MAN_CODE_802_3 | > - AT91_EMAC_MAN_PHYA(addr), > - &at91mac->man); > - > - do { > - netstat = readl(&at91mac->sr); > - debug_cond(DEBUG_AT91PHY, "poll SR %08lx\n", netstat); > - } while (!(netstat & AT91_EMAC_SR_IDLE)); > - > - *value = readl(&at91mac->man) & AT91_EMAC_MAN_DATA_MASK; > - > - at91emac_DisableMDIO(at91mac); > - > - debug_cond(DEBUG_AT91PHY, > - "AT91PHY read %p REG(%d)=%x\n", at91mac, reg, *value); > - > - return 0; > -} > - > -int at91emac_write(at91_emac_t *at91mac, unsigned char addr, > - unsigned char reg, unsigned short value) > -{ > - unsigned long netstat; > - debug_cond(DEBUG_AT91PHY, > - "AT91PHY write %p REG(%d)=%p\n", at91mac, reg, &value); > - > - at91emac_EnableMDIO(at91mac); > - > - writel(AT91_EMAC_MAN_HIGH | AT91_EMAC_MAN_RW_W | > - AT91_EMAC_MAN_REGA(reg) | AT91_EMAC_MAN_CODE_802_3 | > - AT91_EMAC_MAN_PHYA(addr) | (value & AT91_EMAC_MAN_DATA_MASK), > - &at91mac->man); > - > - do { > - netstat = readl(&at91mac->sr); > - debug_cond(DEBUG_AT91PHY, "poll SR %08lx\n", netstat); > - } while (!(netstat & AT91_EMAC_SR_IDLE)); > - > - at91emac_DisableMDIO(at91mac); > - > - return 0; > -} > - > -#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) > - > -at91_emac_t *get_emacbase_by_name(const char *devname) > -{ > - struct eth_device *netdev; > - > - netdev = eth_get_dev_by_name(devname); > - return (at91_emac_t *) netdev->iobase; > -} > - > -int at91emac_mii_read(struct mii_dev *bus, int addr, int devad, int reg) > -{ > - unsigned short value = 0; > - at91_emac_t *emac; > - > - emac = get_emacbase_by_name(bus->name); > - at91emac_read(emac , addr, reg, &value); > - return value; > -} > - > - > -int at91emac_mii_write(struct mii_dev *bus, int addr, int devad, int reg, > - u16 value) > -{ > - at91_emac_t *emac; > - > - emac = get_emacbase_by_name(bus->name); > - at91emac_write(emac, addr, reg, value); > - return 0; > -} > - > -#endif > - > -static int at91emac_phy_reset(struct eth_device *netdev) > -{ > - int i; > - u16 status, adv; > - at91_emac_t *emac; > - > - emac = (at91_emac_t *) netdev->iobase; > - > - adv = ADVERTISE_CSMA | ADVERTISE_ALL; > - at91emac_write(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, > - MII_ADVERTISE, adv); > - debug_cond(VERBOSEP, "%s: Starting autonegotiation...\n", netdev->name); > - at91emac_write(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, MII_BMCR, > - (BMCR_ANENABLE | BMCR_ANRESTART)); > - > - for (i = 0; i < 30000; i++) { > - at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, > - MII_BMSR, &status); > - if (status & BMSR_ANEGCOMPLETE) > - break; > - udelay(100); > - } > - > - if (status & BMSR_ANEGCOMPLETE) { > - debug_cond(VERBOSEP, > - "%s: Autonegotiation complete\n", netdev->name); > - } else { > - printf("%s: Autonegotiation timed out (status=0x%04x)\n", > - netdev->name, status); > - return -1; > - } > - return 0; > -} > - > -static int at91emac_phy_init(struct eth_device *netdev) > -{ > - u16 phy_id, status, adv, lpa; > - int media, speed, duplex; > - int i; > - at91_emac_t *emac; > - > - emac = (at91_emac_t *) netdev->iobase; > - > - /* Check if the PHY is up to snuff... */ > - at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, > - MII_PHYSID1, &phy_id); > - if (phy_id == 0xffff) { > - printf("%s: No PHY present\n", netdev->name); > - return -1; > - } > - > - at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, > - MII_BMSR, &status); > - > - if (!(status & BMSR_LSTATUS)) { > - /* Try to re-negotiate if we don't have link already. */ > - if (at91emac_phy_reset(netdev)) > - return -2; > - > - for (i = 0; i < 100000 / 100; i++) { > - at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, > - MII_BMSR, &status); > - if (status & BMSR_LSTATUS) > - break; > - udelay(100); > - } > - } > - if (!(status & BMSR_LSTATUS)) { > - debug_cond(VERBOSEP, "%s: link down\n", netdev->name); > - return -3; > - } else { > - at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, > - MII_ADVERTISE, &adv); > - at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, > - MII_LPA, &lpa); > - media = mii_nway_result(lpa & adv); > - speed = (media & (ADVERTISE_100FULL | ADVERTISE_100HALF) > - ? 1 : 0); > - duplex = (media & ADVERTISE_FULL) ? 1 : 0; > - debug_cond(VERBOSEP, "%s: link up, %sMbps %s-duplex\n", > - netdev->name, > - speed ? "100" : "10", > - duplex ? "full" : "half"); > - } > - return 0; > -} > - > -int at91emac_UpdateLinkSpeed(at91_emac_t *emac) > -{ > - unsigned short stat1; > - > - at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, MII_BMSR, &stat1); > - > - if (!(stat1 & BMSR_LSTATUS)) /* link status up? */ > - return -1; > - > - if (stat1 & BMSR_100FULL) { > - /*set Emac for 100BaseTX and Full Duplex */ > - writel(readl(&emac->cfg) | > - AT91_EMAC_CFG_SPD | AT91_EMAC_CFG_FD, > - &emac->cfg); > - return 0; > - } > - > - if (stat1 & BMSR_10FULL) { > - /*set MII for 10BaseT and Full Duplex */ > - writel((readl(&emac->cfg) & > - ~(AT91_EMAC_CFG_SPD | AT91_EMAC_CFG_FD) > - ) | AT91_EMAC_CFG_FD, > - &emac->cfg); > - return 0; > - } > - > - if (stat1 & BMSR_100HALF) { > - /*set MII for 100BaseTX and Half Duplex */ > - writel((readl(&emac->cfg) & > - ~(AT91_EMAC_CFG_SPD | AT91_EMAC_CFG_FD) > - ) | AT91_EMAC_CFG_SPD, > - &emac->cfg); > - return 0; > - } > - > - if (stat1 & BMSR_10HALF) { > - /*set MII for 10BaseT and Half Duplex */ > - writel((readl(&emac->cfg) & > - ~(AT91_EMAC_CFG_SPD | AT91_EMAC_CFG_FD)), > - &emac->cfg); > - return 0; > - } > - return 0; > -} > - > -static int at91emac_init(struct eth_device *netdev, struct bd_info *bd) > -{ > - int i; > - u32 value; > - emac_device *dev; > - at91_emac_t *emac; > - at91_pio_t *pio = (at91_pio_t *) ATMEL_BASE_PIO; > - > - emac = (at91_emac_t *) netdev->iobase; > - dev = (emac_device *) netdev->priv; > - > - /* PIO Disable Register */ > - value = ATMEL_PMX_AA_EMDIO | ATMEL_PMX_AA_EMDC | > - ATMEL_PMX_AA_ERXER | ATMEL_PMX_AA_ERX1 | > - ATMEL_PMX_AA_ERX0 | ATMEL_PMX_AA_ECRS | > - ATMEL_PMX_AA_ETX1 | ATMEL_PMX_AA_ETX0 | > - ATMEL_PMX_AA_ETXEN | ATMEL_PMX_AA_EREFCK; > - > - writel(value, &pio->pioa.pdr); > - writel(value, &pio->pioa.mux.pio2.asr); > - > -#ifdef CONFIG_RMII > - value = ATMEL_PMX_BA_ERXCK; > -#else > - value = ATMEL_PMX_BA_ERXCK | ATMEL_PMX_BA_ECOL | > - ATMEL_PMX_BA_ERXDV | ATMEL_PMX_BA_ERX3 | > - ATMEL_PMX_BA_ERX2 | ATMEL_PMX_BA_ETXER | > - ATMEL_PMX_BA_ETX3 | ATMEL_PMX_BA_ETX2; > -#endif > - writel(value, &pio->piob.pdr); > - writel(value, &pio->piob.mux.pio2.bsr); > - > - at91_periph_clk_enable(ATMEL_ID_EMAC); > - > - writel(readl(&emac->ctl) | AT91_EMAC_CTL_CSR, &emac->ctl); > - > - /* Init Ethernet buffers */ > - for (i = 0; i < RBF_FRAMEMAX; i++) { > - dev->rbfdt[i].addr = (unsigned long) net_rx_packets[i]; > - dev->rbfdt[i].size = 0; > - } > - dev->rbfdt[RBF_FRAMEMAX - 1].addr |= RBF_WRAP; > - dev->rbindex = 0; > - writel((u32) &(dev->rbfdt[0]), &emac->rbqp); > - > - writel(readl(&emac->rsr) & > - ~(AT91_EMAC_RSR_OVR | AT91_EMAC_RSR_REC | AT91_EMAC_RSR_BNA), > - &emac->rsr); > - > - value = AT91_EMAC_CFG_CAF | AT91_EMAC_CFG_NBC | > - HCLK_DIV; > -#ifdef CONFIG_RMII > - value |= AT91_EMAC_CFG_RMII; > -#endif > - writel(value, &emac->cfg); > - > - writel(readl(&emac->ctl) | AT91_EMAC_CTL_TE | AT91_EMAC_CTL_RE, > - &emac->ctl); > - > - if (!at91emac_phy_init(netdev)) { > - at91emac_UpdateLinkSpeed(emac); > - return 0; > - } > - return -1; > -} > - > -static void at91emac_halt(struct eth_device *netdev) > -{ > - at91_emac_t *emac; > - > - emac = (at91_emac_t *) netdev->iobase; > - writel(readl(&emac->ctl) & ~(AT91_EMAC_CTL_TE | AT91_EMAC_CTL_RE), > - &emac->ctl); > - debug_cond(DEBUG_AT91EMAC, "halt MAC\n"); > -} > - > -static int at91emac_send(struct eth_device *netdev, void *packet, int length) > -{ > - at91_emac_t *emac; > - > - emac = (at91_emac_t *) netdev->iobase; > - > - while (!(readl(&emac->tsr) & AT91_EMAC_TSR_BNQ)) > - ; > - writel((u32) packet, &emac->tar); > - writel(AT91_EMAC_TCR_LEN(length), &emac->tcr); > - while (AT91_EMAC_TCR_LEN(readl(&emac->tcr))) > - ; > - debug_cond(DEBUG_AT91EMAC, "Send %d\n", length); > - writel(readl(&emac->tsr) | AT91_EMAC_TSR_COMP, &emac->tsr); > - return 0; > -} > - > -static int at91emac_recv(struct eth_device *netdev) > -{ > - emac_device *dev; > - at91_emac_t *emac; > - rbf_t *rbfp; > - int size; > - > - emac = (at91_emac_t *) netdev->iobase; > - dev = (emac_device *) netdev->priv; > - > - rbfp = &dev->rbfdt[dev->rbindex]; > - while (rbfp->addr & RBF_OWNER) { > - size = rbfp->size & RBF_SIZE; > - net_process_received_packet(net_rx_packets[dev->rbindex], size); > - > - debug_cond(DEBUG_AT91EMAC, "Recv[%ld]: %d bytes @ %lx\n", > - dev->rbindex, size, rbfp->addr); > - > - rbfp->addr &= ~RBF_OWNER; > - rbfp->size = 0; > - if (dev->rbindex < (RBF_FRAMEMAX-1)) > - dev->rbindex++; > - else > - dev->rbindex = 0; > - > - rbfp = &(dev->rbfdt[dev->rbindex]); > - if (!(rbfp->addr & RBF_OWNER)) > - writel(readl(&emac->rsr) | AT91_EMAC_RSR_REC, > - &emac->rsr); > - } > - > - if (readl(&emac->isr) & AT91_EMAC_IxR_RBNA) { > - /* EMAC silicon bug 41.3.1 workaround 1 */ > - writel(readl(&emac->ctl) & ~AT91_EMAC_CTL_RE, &emac->ctl); > - writel(readl(&emac->ctl) | AT91_EMAC_CTL_RE, &emac->ctl); > - dev->rbindex = 0; > - printf("%s: reset receiver (EMAC dead lock bug)\n", > - netdev->name); > - } > - return 0; > -} > - > -static int at91emac_write_hwaddr(struct eth_device *netdev) > -{ > - at91_emac_t *emac; > - emac = (at91_emac_t *) netdev->iobase; > - > - at91_periph_clk_enable(ATMEL_ID_EMAC); > - > - debug_cond(DEBUG_AT91EMAC, > - "init MAC-ADDR %02x:%02x:%02x:%02x:%02x:%02x\n", > - netdev->enetaddr[5], netdev->enetaddr[4], netdev->enetaddr[3], > - netdev->enetaddr[2], netdev->enetaddr[1], netdev->enetaddr[0]); > - writel( (netdev->enetaddr[0] | netdev->enetaddr[1] << 8 | > - netdev->enetaddr[2] << 16 | netdev->enetaddr[3] << 24), > - &emac->sa2l); > - writel((netdev->enetaddr[4] | netdev->enetaddr[5] << 8), &emac->sa2h); > - debug_cond(DEBUG_AT91EMAC, "init MAC-ADDR %x%x\n", > - readl(&emac->sa2h), readl(&emac->sa2l)); > - return 0; > -} > - > -int at91emac_register(struct bd_info *bis, unsigned long iobase) > -{ > - emac_device *emac; > - emac_device *emacfix; > - struct eth_device *dev; > - > - if (iobase == 0) > - iobase = ATMEL_BASE_EMAC; > - emac = malloc(sizeof(*emac)+512); > - if (emac == NULL) > - return -1; > - dev = malloc(sizeof(*dev)); > - if (dev == NULL) { > - free(emac); > - return -1; > - } > - /* alignment as per Errata (64 bytes) is insufficient! */ > - emacfix = (emac_device *) (((unsigned long) emac + 0x1ff) & 0xFFFFFE00); > - memset(emacfix, 0, sizeof(emac_device)); > - > - memset(dev, 0, sizeof(*dev)); > - strcpy(dev->name, "emac"); > - dev->iobase = iobase; > - dev->priv = emacfix; > - dev->init = at91emac_init; > - dev->halt = at91emac_halt; > - dev->send = at91emac_send; > - dev->recv = at91emac_recv; > - dev->write_hwaddr = at91emac_write_hwaddr; > - > - eth_register(dev); > - > -#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) > - int retval; > - struct mii_dev *mdiodev = mdio_alloc(); > - if (!mdiodev) > - return -ENOMEM; > - strncpy(mdiodev->name, dev->name, MDIO_NAME_LEN); > - mdiodev->read = at91emac_mii_read; > - mdiodev->write = at91emac_mii_write; > - > - retval = mdio_register(mdiodev); > - if (retval < 0) > - return retval; > -#endif > - return 1; > -} > diff --git a/include/netdev.h b/include/netdev.h > index 00a0993a83..fb18f09893 100644 > --- a/include/netdev.h > +++ b/include/netdev.h > @@ -29,7 +29,6 @@ int board_interface_eth_init(struct udevice *dev, > int cpu_eth_init(struct bd_info *bis); > > /* Driver initialization prototypes */ > -int at91emac_register(struct bd_info *bis, unsigned long iobase); > int ax88180_initialize(struct bd_info *bis); > int bcm_sf2_eth_register(struct bd_info *bis, u8 dev_num); > int bfin_EMAC_initialize(struct bd_info *bis); > diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt > index a1a12813a6..608bda21e6 100644 > --- a/scripts/config_whitelist.txt > +++ b/scripts/config_whitelist.txt > @@ -278,8 +278,6 @@ CONFIG_DP_DDR_CTRL > CONFIG_DP_DDR_DIMM_SLOTS_PER_CTLR > CONFIG_DP_DDR_NUM_CTRLS > CONFIG_DRAM_TIMINGS_ > -CONFIG_DRIVER_AT91EMAC_PHYADDR > -CONFIG_DRIVER_AT91EMAC_QUIET > CONFIG_DRIVER_DM9000 > CONFIG_DSP_CLUSTER_START > CONFIG_DWC2_DFLT_SPEED_FULL > -- > 2.25.1 > Reviewd-by: Ramon Fried