From patchwork Sat Feb 15 01:30:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 3655171 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E69A49F334 for ; Sat, 15 Feb 2014 00:31:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 131332020F for ; Sat, 15 Feb 2014 00:31:21 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 27D902020E for ; Sat, 15 Feb 2014 00:31:20 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WET9Y-0004kr-M2; Sat, 15 Feb 2014 00:30:44 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WET9W-0000St-7E; Sat, 15 Feb 2014 00:30:42 +0000 Received: from mail-la0-f48.google.com ([209.85.215.48]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WET9S-0000S2-Ta for linux-arm-kernel@lists.infradead.org; Sat, 15 Feb 2014 00:30:39 +0000 Received: by mail-la0-f48.google.com with SMTP id mc6so9690196lab.21 for ; Fri, 14 Feb 2014 16:30:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:organization:to:subject:date:user-agent:cc :references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=qvW5mMQ5IoIwf9xD+qjWaUPMPdGv0qysKTwNAQGTiHI=; b=EkIOb9ZN98vJG1dVFJ7oZTja/GzNQmgHjP11ui0UEbnDiKOKRiNA33ZeVb5csw53dQ ooSNqTkzuQIwsZUw2MVyswwS2p9Q71Zy0SwQGvteX8NqmZodoi7H8HVDhmP3GuvgFZXX mAazlS6/ALjVCp612aQ7+8ec2ayWyTRrPyPt1JGQ90XBHkPuPuLyBCFBp2VoDN3M7rzs fRiCPtQ3RPMOIOwIqz+0DXpjjUfCf7K4RsLb3fslQ+PuIRvyjAGhMhwpJm0IgkzEeg7j AlFSaDJ2qx49lkEsTlNK9LgK0LUe7wO9TYBkzRsx+lqecYL4/d0MSkZhqVHtkIDS+rg5 lV2A== X-Gm-Message-State: ALoCoQkc/WRuD8ejv9r7b6TfLVsTQOu+8UKU8fLas13qd+wkJE57njttD8MgbF5Qqud92QHJ63MT X-Received: by 10.153.0.33 with SMTP id av1mr7576889lad.14.1392424216940; Fri, 14 Feb 2014 16:30:16 -0800 (PST) Received: from wasted.cogentembedded.com (ppp83-237-57-97.pppoe.mtu-net.ru. [83.237.57.97]) by mx.google.com with ESMTPSA id bl8sm7664632lbb.3.2014.02.14.16.30.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 14 Feb 2014 16:30:16 -0800 (PST) From: Sergei Shtylyov Organization: Cogent Embedded To: horms@verge.net.au, linux-sh@vger.kernel.org Subject: [PATCH 3/5] ARM: shmobile: Lager: set proper DMA masks for Ether device Date: Sat, 15 Feb 2014 04:30:20 +0300 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.i686.PAE; KDE/4.4.5; i686; ; ) References: <201402150424.30954.sergei.shtylyov@cogentembedded.com> In-Reply-To: <201402150424.30954.sergei.shtylyov@cogentembedded.com> MIME-Version: 1.0 Message-Id: <201402150430.20874.sergei.shtylyov@cogentembedded.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140214_193039_107061_7E5D6699 X-CRM114-Status: GOOD ( 15.77 ) X-Spam-Score: -2.6 (--) Cc: linux@arm.linux.org.uk, magnus.damm@gmail.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ether MAC is a DMA-capable device and so should have 'dev.dma_mask' and 'dev.coherent_dma_mask' fields set properly, to reflect 32-bit DMA addressing ability. Currently, the code works without DMA masks but as we would have to enable CONFIG_HIGHMEM to access the full board memory in the future, when support for NETIF_F_SG would be added to the 'sh_eth' driver as well, the correct DMA masks should start to matter... Signed-off-by: Sergei Shtylyov --- arch/arm/mach-shmobile/board-lager.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) Index: renesas/arch/arm/mach-shmobile/board-lager.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/board-lager.c +++ renesas/arch/arm/mach-shmobile/board-lager.c @@ -1,8 +1,9 @@ /* * Lager board support * - * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013-2014 Renesas Solutions Corp. * Copyright (C) 2013 Magnus Damm + * Copyright (C) 2014 Cogent Embedded, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -275,6 +276,17 @@ static const struct resource ether_resou DEFINE_RES_IRQ(gic_spi(162)), }; +static const struct platform_device_info ether_info __initconst = { + .parent = &platform_bus, + .name = "r8a7790-ether", + .id = -1, + .res = ether_resources, + .num_res = ARRAY_SIZE(ether_resources), + .data = ðer_pdata, + .size_data = sizeof(ether_pdata), + .dma_mask = DMA_BIT_MASK(32), +}; + /* SPI Flash memory (Spansion S25FL512SAGMFIG11 64Mb) */ static struct mtd_partition spi_flash_part[] = { /* Reserved for user loader program, read-only */ @@ -743,10 +755,7 @@ static void __init lager_add_standard_de mmcif1_resources, ARRAY_SIZE(mmcif1_resources), &mmcif1_pdata, sizeof(mmcif1_pdata)); - platform_device_register_resndata(&platform_bus, "r8a7790-ether", -1, - ether_resources, - ARRAY_SIZE(ether_resources), - ðer_pdata, sizeof(ether_pdata)); + platform_device_register_full(ðer_info); lager_add_du_device();