Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756714AbbDOUiE (ORCPT ); Wed, 15 Apr 2015 16:38:04 -0400 Received: from mail-bl2on0071.outbound.protection.outlook.com ([65.55.169.71]:53856 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754720AbbDOUhz (ORCPT ); Wed, 15 Apr 2015 16:37:55 -0400 X-Greylist: delayed 940 seconds by postgrey-1.27 at vger.kernel.org; Wed, 15 Apr 2015 16:37:54 EDT Authentication-Results: spf=fail (sender IP is 66.35.236.236) smtp.mailfrom=opensource.altera.com; st.com; dkim=none (message not signed) header.d=none; From: Vince Bridgers To: , , CC: , Subject: [PATCH net 3/5] stmmac: Read tx-fifo-depth and rx-fifo-depth from the devicetree Date: Wed, 15 Apr 2015 11:17:40 -0500 Message-ID: <1429114662-1528-4-git-send-email-vbridger@opensource.altera.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429114662-1528-1-git-send-email-vbridger@opensource.altera.com> References: <1429114662-1528-1-git-send-email-vbridger@opensource.altera.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [64.129.157.38] X-ClientProxiedBy: SN1PR07CA0030.namprd07.prod.outlook.com (25.162.170.168) To CY1PR0301MB0634.namprd03.prod.outlook.com (25.160.158.140) Authentication-Results: st.com; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0634;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0605; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report-Untrusted: BMV:1;SFV:NSPM;SFS:(10009020)(6009001)(47776003)(48376002)(19580395003)(19580405001)(2201001)(33646002)(50466002)(50226001)(92566002)(66066001)(87976001)(62966003)(77156002)(2950100001)(86362001)(76176999)(50986999)(42186005)(40100003)(230783001)(229853001)(122386002)(53416004)(4001410100001)(46102003)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0301MB0634;H:vince-HP-Z620-Workstation2.altera.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Exchange-Antispam-Report-Test: UriScan:;UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(5002010);SRVR:CY1PR0301MB0634;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0634;BCL:0;PCL:0;RULEID:(601004)(5005006)(5002010);SRVR:DM2PR0301MB0605;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0605; X-Forefront-PRVS: 0547116B72 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0634 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BY2FFO11FD035.protection.gbl X-Forefront-Antispam-Report: CIP:66.35.236.236;CTRY:US;IPV:NLI;EFV:NLI;BMV:1;SFV:NSPM;SFS:(10009020)(6009001)(339900001)(199003)(189002)(40100003)(33646002)(229853001)(122386002)(50466002)(46102003)(4001410100001)(48376002)(66066001)(19580405001)(86362001)(19580395003)(92566002)(85426001)(2201001)(50226001)(6806004)(47776003)(87936001)(106466001)(2950100001)(230783001)(62966003)(50986999)(16796002)(105606002)(53416004)(76176999)(77156002)(7099027)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0301MB0605;H:sj-itexedge04.altera.priv.altera.com;FPR:;SPF:Fail;MLV:ovrnspm;A:0;MX:1;PTR:InfoDomainNonexistent;LANG:en; X-Forefront-PRVS: 0547116B72 X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2015 20:22:12.9722 (UTC) X-MS-Exchange-CrossTenant-Id: fbd72e03-d4a5-4110-adce-614d51f2077a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fbd72e03-d4a5-4110-adce-614d51f2077a;Ip=[66.35.236.236];Helo=[sj-itexedge04.altera.priv.altera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0605 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1827 Lines: 46 Read the tx-fifo-depth and rx-fifo-depth from the devicetree. The Synopsys stmmac controller fifos are configurable per product instance, and the fifo sizes are needed to configure certain features correctly such as flow control. Signed-off-by: Vince Bridgers --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 4 ++++ include/linux/stmmac.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index f9b42f1..705bbdf 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -181,6 +181,10 @@ static int stmmac_probe_config_dt(struct platform_device *pdev, sizeof(struct stmmac_mdio_bus_data), GFP_KERNEL); + of_property_read_u32(np, "tx-fifo-depth", &plat->tx_fifo_size); + + of_property_read_u32(np, "rx-fifo-depth", &plat->rx_fifo_size); + plat->force_sf_dma_mode = of_property_read_bool(np, "snps,force_sf_dma_mode"); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index cd63851..7f484a2 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -114,6 +114,8 @@ struct plat_stmmacenet_data { int maxmtu; int multicast_filter_bins; int unicast_filter_entries; + int tx_fifo_size; + int rx_fifo_size; void (*fix_mac_speed)(void *priv, unsigned int speed); void (*bus_setup)(void __iomem *ioaddr); void *(*setup)(struct platform_device *pdev); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/