From patchwork Tue Jun 11 15:19:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramon Fried X-Patchwork-Id: 1114025 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ucoFF5ke"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45NZ7f4XhPz9s3l for ; Wed, 12 Jun 2019 01:44:46 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 46DF6C2222B; Tue, 11 Jun 2019 15:36:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 75FB0C21DD7; Tue, 11 Jun 2019 15:36:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EC7D0C221E5; Tue, 11 Jun 2019 15:19:54 +0000 (UTC) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by lists.denx.de (Postfix) with ESMTPS id 5C038C22136 for ; Tue, 11 Jun 2019 15:19:51 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id b17so13487900wrq.11 for ; Tue, 11 Jun 2019 08:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Hlq42A45E4aNO6zoi5W0yVUlYXqM1hQxIY2mTJxxs1I=; b=ucoFF5keMBCjyxrXa/Iq+MFWOj0p3rKtRSVA4vocqRPRCqsIV/0XDdSsv42PV24Lts Ta35ejO6c4d5sYLsAfB5rTtyzDNiD1JBFOFYHivMKHQkQjLtsDddnlX0fC8m27W8M6lP j14gTeXcfHHun3FXp4Xp0t3kQtrg/Sbc3ME0keDZK1e3cuj6xE2O22FDRLrDXniWjFcy RPDgVylRjbXwIcZF4agVtzz6SlsGjYRMBrUr0nzbTmrUiGfjSC3/zo0G68JVFVwpFD/h T80unIiC5qkR25/eP4LiUFxjl2ug/Cod4oqUPLbAkUjkfhYYEB9gRtd+/mBLjHSs8A6l 58PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hlq42A45E4aNO6zoi5W0yVUlYXqM1hQxIY2mTJxxs1I=; b=T1p9ZTM2Mzts9UX8TU+hgk7AgRfWILjeE/ArFpA6Eb4BO4Z7nq8SpKtVPADle9bYSG xotiM0rVF3jgFJD09i314GsbvGBUKmCgaymd9/YjK1fMjlBiAj3C8Kx22qBGSbGBuDZN 3AbEr3svSS6Gg2WuQZEIgvr61J2O0iQSnMrNMzoYnWUQK5PwM8Y2W+lgAxBPmaE8WrNJ UlwD3Iv0UoAC4V+kPiLo0EGwd1D/CvypjVVYHT44VGS+Duz+Pd0Y48jWDn/l2z2AOA+X Z+r3BScfAlW4x7QC6lxlqaBEW1jH7VIv2rCv2x8ny84h7tdBS/zCRvdoxCpAJwf8no25 EElA== X-Gm-Message-State: APjAAAWQ0EQ4C9FQnrlAg5pybRcqm1zlH+AWoYaYeZkoXDXHABs3V3FS bhVsk6MSCd/XNDjGRF4OGVBeafuz1r4= X-Google-Smtp-Source: APXvYqz2Dbhz6xjFxfXkUYz8GCjXM2YdsBsBzEbOyPyUkc+Le/fn4mdmMvTzTs4pJsemAfTbZirq/w== X-Received: by 2002:a5d:51cb:: with SMTP id n11mr11037232wrv.143.1560266390914; Tue, 11 Jun 2019 08:19:50 -0700 (PDT) Received: from localhost.localdomain ([141.226.31.91]) by smtp.gmail.com with ESMTPSA id q20sm38564360wra.36.2019.06.11.08.19.50 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 11 Jun 2019 08:19:50 -0700 (PDT) From: Ramon Fried To: u-boot@lists.denx.de Date: Tue, 11 Jun 2019 18:19:29 +0300 Message-Id: <20190611151930.15852-5-rfried.dev@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190611151930.15852-1-rfried.dev@gmail.com> References: <20190611151930.15852-1-rfried.dev@gmail.com> MIME-Version: 1.0 Cc: Joe Hershberger Subject: [U-Boot] [PATCH 5/6] net: macb: add dma_burst_length config X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" GEM support higher DMA burst writes/reads than the default (4). add configuration structure with dma burst length so it could be applied later to DMA configuration. Signed-off-by: Ramon Fried Reviewed-by: Anup Patel Tested-by: Anup Patel Acked-by: Joe Hershberger --- drivers/net/macb.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index ae8937bbb1..fb42172520 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -82,6 +82,7 @@ struct macb_dma_desc { struct macb_device { void *regs; + unsigned int dma_burst_length; unsigned int rx_tail; unsigned int tx_head; @@ -118,6 +119,11 @@ struct macb_device { phy_interface_t phy_interface; #endif }; + +struct macb_config { + unsigned int dma_burst_length; +}; + #ifndef CONFIG_DM_ETH #define to_macb(_nd) container_of(_nd, struct macb_device, netdev) #endif @@ -1133,8 +1139,13 @@ static int macb_enable_clk(struct udevice *dev) } #endif +static const struct macb_config default_gem_config = { + .dma_burst_length = 16, +}; + static int macb_eth_probe(struct udevice *dev) { + const struct macb_config *macb_config; struct eth_pdata *pdata = dev_get_platdata(dev); struct macb_device *macb = dev_get_priv(dev); const char *phy_mode; @@ -1151,6 +1162,11 @@ static int macb_eth_probe(struct udevice *dev) macb->regs = (void *)pdata->iobase; + macb_config = (struct macb_config *)dev_get_driver_data(dev); + if (!macb_config) + macb_config = &default_gem_config; + + macb->dma_burst_length = macb_config->dma_burst_length; #ifdef CONFIG_CLK ret = macb_enable_clk(dev); if (ret) @@ -1211,12 +1227,16 @@ static int macb_eth_ofdata_to_platdata(struct udevice *dev) return macb_late_eth_ofdata_to_platdata(dev); } +static const struct macb_config sama5d4_config = { + .dma_burst_length = 4, +}; + static const struct udevice_id macb_eth_ids[] = { { .compatible = "cdns,macb" }, { .compatible = "cdns,at91sam9260-macb" }, { .compatible = "atmel,sama5d2-gem" }, { .compatible = "atmel,sama5d3-gem" }, - { .compatible = "atmel,sama5d4-gem" }, + { .compatible = "atmel,sama5d4-gem", .data = (ulong)&sama5d4_config }, { .compatible = "cdns,zynq-gem" }, { } };