From patchwork Tue Feb 11 23:55:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 3633241 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6FD89BF40C for ; Tue, 11 Feb 2014 22:55:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E193201FA for ; Tue, 11 Feb 2014 22:55:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4AFE4201ED for ; Tue, 11 Feb 2014 22:55:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751435AbaBKWz3 (ORCPT ); Tue, 11 Feb 2014 17:55:29 -0500 Received: from mail-la0-f41.google.com ([209.85.215.41]:46584 "EHLO mail-la0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751347AbaBKWz2 (ORCPT ); Tue, 11 Feb 2014 17:55:28 -0500 Received: by mail-la0-f41.google.com with SMTP id mc6so6580444lab.0 for ; Tue, 11 Feb 2014 14:55:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:subject:cc:from:organization:date :mime-version:content-type:content-transfer-encoding:message-id; bh=HPlSi4py5mJv+xe6EViAe41vMjsZzb5oJLwxyhJZJVU=; b=Dhv2yJZLKI4NvIarPWu1TjfZPCsEWXHNUDVHYd4wBwE+7tKHh3FC5YCr05o6O07SFQ QVIofadQKlDr9ZRnh7VtHv3MNWaX6FsB6Z8/GZNAmJ5XwLaJyBGvB2ZPsuDtlhWw+xsx hRvchxQ5JwNVdwXTdVXCMiSQSYqcZXbDY59ZGY0wfBlHuOVTLn2qlik5Xm4fS419N/tt cT4RXD7358VnDGb2RCsL/HA5aQ+GoQduQ8Mo7Y2qu8TsCKTu1EMR9006rmNpb1BI9wo0 bu5bDZEgFvXrSWKNxE/MYFnmwG2Tm1e8DQ/4J19crGeNDQT+u93Co4gcB+7GtVXszI4f h5ng== X-Gm-Message-State: ALoCoQntHEdUS6B7Hfjw5f+lDb6vDrowriIo8EfC4eQKi3fqQpa3pCTZ0fKP31lotzWjmguUSdX1 X-Received: by 10.152.205.197 with SMTP id li5mr3310347lac.50.1392159326445; Tue, 11 Feb 2014 14:55:26 -0800 (PST) Received: from wasted.cogentembedded.com (ppp85-140-142-255.pppoe.mtu-net.ru. [85.140.142.255]) by mx.google.com with ESMTPSA id g8sm30059788lae.1.2014.02.11.14.55.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 11 Feb 2014 14:55:26 -0800 (PST) To: horms@verge.net.au, linux-sh@vger.kernel.org Subject: [PATCH] ARM: shmobile: set proper DMA masks for Ether devices Cc: magnus.damm@gmail.com, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org From: Sergei Shtylyov Organization: Cogent Embedded Date: Wed, 12 Feb 2014 02:55:24 +0300 MIME-Version: 1.0 Message-Id: <201402120255.25037.sergei.shtylyov@cogentembedded.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 in the future, when support for NETIF_F_HIGHDMA & NETIF_F_SG would be added to the 'sh_eth' driver, the DMA masks should start to matter... Signed-off-by: Sergei Shtylyov --- The patch is against 'renesas-devel-v3.14-rc1-20140207' tag in Simon Horman's 'renesas.git' repo... arch/arm/mach-shmobile/board-armadillo800eva.c | 2 ++ arch/arm/mach-shmobile/board-bockw.c | 21 ++++++++++++++------- arch/arm/mach-shmobile/board-genmai.c | 19 ++++++++++++++----- arch/arm/mach-shmobile/board-koelsch.c | 16 ++++++++++++---- arch/arm/mach-shmobile/board-lager.c | 19 ++++++++++++++----- 5 files changed, 56 insertions(+), 21 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: renesas/arch/arm/mach-shmobile/board-armadillo800eva.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/board-armadillo800eva.c +++ renesas/arch/arm/mach-shmobile/board-armadillo800eva.c @@ -383,6 +383,8 @@ static struct platform_device sh_eth_dev .id = -1, .dev = { .platform_data = &sh_eth_platdata, + .dma_mask = &sh_eth_device.dev.coherent_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), }, .resource = sh_eth_resources, .num_resources = ARRAY_SIZE(sh_eth_resources), Index: renesas/arch/arm/mach-shmobile/board-bockw.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/board-bockw.c +++ renesas/arch/arm/mach-shmobile/board-bockw.c @@ -1,9 +1,9 @@ /* * Bock-W board support * - * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013-2014 Renesas Solutions Corp. * Copyright (C) 2013 Kuninori Morimoto - * Copyright (C) 2013 Cogent Embedded, Inc. + * Copyright (C) 2013-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 @@ -235,6 +235,17 @@ static struct sh_eth_plat_data ether_pla .no_ether_link = 1, }; +static struct platform_device_info ether_info __initdata = { + .parent = &platform_bus, + .name = "r8a777x-ether", + .id = -1, + .res = ether_resources, + .num_res = ARRAY_SIZE(ether_resources), + .data = ðer_platform_data, + .size_data = sizeof(ether_platform_data), + .dma_mask = DMA_BIT_MASK(32), +}; + /* I2C */ static struct i2c_board_info i2c0_devices[] = { { @@ -592,11 +603,7 @@ static void __init bockw_init(void) r8a7778_init_irq_extpin(1); r8a7778_add_standard_devices(); - platform_device_register_resndata(&platform_bus, "r8a777x-ether", -1, - ether_resources, - ARRAY_SIZE(ether_resources), - ðer_platform_data, - sizeof(ether_platform_data)); + platform_device_register_full(ðer_info); platform_device_register_full(&vin0_info); /* VIN1 has a pin conflict with Ether */ Index: renesas/arch/arm/mach-shmobile/board-genmai.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/board-genmai.c +++ renesas/arch/arm/mach-shmobile/board-genmai.c @@ -1,8 +1,9 @@ /* * Genmai 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 @@ -43,6 +44,17 @@ static const struct resource ether_resou DEFINE_RES_IRQ(gic_iid(359)), }; +static const struct platform_device_info ether_info __initconst = { + .parent = &platform_bus, + .name = "r7s72100-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), +}; + /* RSPI */ #define RSPI_RESOURCE(idx, baseaddr, irq) \ static const struct resource rspi##idx##_resources[] __initconst = { \ @@ -82,10 +94,7 @@ static void __init genmai_add_standard_d r7s72100_clock_init(); r7s72100_add_dt_devices(); - platform_device_register_resndata(&platform_bus, "r7s72100-ether", -1, - ether_resources, - ARRAY_SIZE(ether_resources), - ðer_pdata, sizeof(ether_pdata)); + platform_device_register_full(ðer_info); r7s72100_register_rspi(0); r7s72100_register_rspi(1); Index: renesas/arch/arm/mach-shmobile/board-koelsch.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/board-koelsch.c +++ renesas/arch/arm/mach-shmobile/board-koelsch.c @@ -109,6 +109,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 = "r8a7791-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), +}; + /* LEDS */ static struct gpio_led koelsch_leds[] = { { @@ -297,10 +308,7 @@ static void __init koelsch_add_standard_ ARRAY_SIZE(koelsch_pinctrl_map)); r8a7791_pinmux_init(); r8a7791_add_standard_devices(); - platform_device_register_resndata(&platform_bus, "r8a7791-ether", -1, - ether_resources, - ARRAY_SIZE(ether_resources), - ðer_pdata, sizeof(ether_pdata)); + platform_device_register_full(ðer_info); platform_device_register_data(&platform_bus, "leds-gpio", -1, &koelsch_leds_pdata, sizeof(koelsch_leds_pdata)); 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 @@ -260,6 +261,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 */ @@ -681,10 +693,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();