From patchwork Wed Jan 3 20:08:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 855202 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=cogentembedded-com.20150623.gappssmtp.com header.i=@cogentembedded-com.20150623.gappssmtp.com header.b="aqCBihg0"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zBhsV24VXz9s7c for ; Thu, 4 Jan 2018 07:11:42 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751400AbeACULk (ORCPT ); Wed, 3 Jan 2018 15:11:40 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:43503 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751378AbeACULi (ORCPT ); Wed, 3 Jan 2018 15:11:38 -0500 Received: by mail-wr0-f196.google.com with SMTP id w68so2832542wrc.10 for ; Wed, 03 Jan 2018 12:11:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:user-agent:date:to:cc:subject:mime-version :content-disposition; bh=+49UtMFW1ppDISWdxDsRbyKsqvp5P/hcmWXBXmBB65c=; b=aqCBihg056QuIp4FcPjCJ/F3FgbjwvqMh3bpV2Z5SCjRDBZfaoTFjCxP4STR7Rox/h +ZppcR4XsXucdSv5a+57zlos/71nHM7O6h2kTJHVj/IQM5j5sMszB4fFP4zyTr6p/QjQ RrEePovs4ALWIlKe0ZbJmxsoyFz6UebqtYvS8tK7h0iQOyzaccPV6+NxT2zuAEw2KrdW AA2wuhYIFxgNL81a1qm33NyCjiywvR8jpCQHbs5DB1Cq5sw5h54S6O93NUb8+SlSMEYL wRIv3w+WuQGCV4IDPwRZvaXgLX5ibWpdECeWKBHIG0t75FhoZIwMv8TJGZQtqYTdutsJ IHMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:user-agent:date:to:cc:subject :mime-version:content-disposition; bh=+49UtMFW1ppDISWdxDsRbyKsqvp5P/hcmWXBXmBB65c=; b=ETmvyK4BZe3PU/ub0HleU/R7LvPKPuKJ/j5BykeCXqDZUTTEPtTG0zE7e8L73tVOTn 5pehCdD7VBEqJ2GKb5MRbNk2IoYf4mjs0leNnIXWc42zrHDD/DUSs9QEd9hHsukQvhx6 5NcWUJneuPHwMg4fZdA0iO2bMhtKPYRPxB2gWO5wNrdI1Nv6wVHMt0cP9wbuxL4L5Tjr vk01NrX9Tr+baNz1cZC0lfn0g4HhP0HXLOjYM8r1G9QmTAKer/18TjcpcZfbDl4Hbfl5 /ALkZ6bvnFRMoUEc62KWYnafrb/Zqcnavid5pdh1Ti609Pfm7CSBSYxnQ7VEm3GwdcDR 2l5A== X-Gm-Message-State: AKGB3mJPMZ1ZA3DqmxjORUkW/gi8Ix0w1ZHYRw1SIAfPqXBUk6QO1pzA YVpcIWmzsAfXUUDpSSCyHhbArA== X-Google-Smtp-Source: ACJfBovTd1y12aG0aUwnCJMNuk77UcJCua14yoI0SP12NeXhBst3VgDdXstUpas1tm6HD2Q/m4tMiw== X-Received: by 10.46.74.26 with SMTP id x26mr1490101lja.83.1515010297064; Wed, 03 Jan 2018 12:11:37 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.87.30]) by smtp.gmail.com with ESMTPSA id p21sm302068ljb.85.2018.01.03.12.11.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2018 12:11:36 -0800 (PST) From: Sergei Shtylyov X-Google-Original-From: "Sergei Shtylyov" Received: by wasted.cogentembedded.com (sSMTP sendmail emulation); Wed, 03 Jan 2018 23:11:33 +0300 Message-Id: <20180103201133.743597164@cogentembedded.com> User-Agent: quilt/0.64 Date: Wed, 03 Jan 2018 23:08:14 +0300 To: Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Cc: netdev@vger.kernel.org, Sergei Shtylyov Subject: [PATCH 1/2] SolutionEngine771x: fix Ether platform data MIME-Version: 1.0 Content-Disposition: inline; filename=SolutionEngine771x-fix-Ether-platform-data.patch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The 'sh_eth' driver's probe() method would fail on the SolutionEngine7710 board and crash on SolutionEngine7712 board as the platform code is hopelessly behind the driver's platform data -- it passes the PHY address instead of 'struct sh_eth_plat_data *'; pass the latter to the driver in order to fix the bug... Fixes: 71557a37adb5 ("[netdrvr] sh_eth: Add SH7619 support") Signed-off-by: Sergei Shtylyov --- The patch is against Paul Mundt's 'linux-sh.git' repo, 'sh-latest' branch. arch/sh/boards/mach-se/770x/setup.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) Index: linux/arch/sh/boards/mach-se/770x/setup.c =================================================================== --- linux.orig/arch/sh/boards/mach-se/770x/setup.c +++ linux/arch/sh/boards/mach-se/770x/setup.c @@ -115,6 +115,11 @@ static struct platform_device heartbeat_ #if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\ defined(CONFIG_CPU_SUBTYPE_SH7712) /* SH771X Ethernet driver */ +static struct sh_eth_plat_data sh_eth_plat = { + .phy = PHY_ID, + .phy_interface = PHY_INTERFACE_MODE_MII, +}; + static struct resource sh_eth0_resources[] = { [0] = { .start = SH_ETH0_BASE, @@ -132,7 +137,7 @@ static struct platform_device sh_eth0_de .name = "sh771x-ether", .id = 0, .dev = { - .platform_data = PHY_ID, + .platform_data = &sh_eth_plat, }, .num_resources = ARRAY_SIZE(sh_eth0_resources), .resource = sh_eth0_resources, @@ -155,7 +160,7 @@ static struct platform_device sh_eth1_de .name = "sh771x-ether", .id = 1, .dev = { - .platform_data = PHY_ID, + .platform_data = &sh_eth_plat, }, .num_resources = ARRAY_SIZE(sh_eth1_resources), .resource = sh_eth1_resources, From patchwork Wed Jan 3 20:08:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 855207 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=cogentembedded-com.20150623.gappssmtp.com header.i=@cogentembedded-com.20150623.gappssmtp.com header.b="VVslUoTG"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zBjPT232Nz9s1h for ; Thu, 4 Jan 2018 07:35:57 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751668AbeACUfy (ORCPT ); Wed, 3 Jan 2018 15:35:54 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:39822 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751401AbeACULl (ORCPT ); Wed, 3 Jan 2018 15:11:41 -0500 Received: by mail-wr0-f195.google.com with SMTP id o101so2835505wrb.6 for ; Wed, 03 Jan 2018 12:11:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:user-agent:date:to:cc:subject:mime-version :content-disposition; bh=FGRCqLlxZ5FkueMvmGKRM/cXvGkCUasI34bnZ20LB9c=; b=VVslUoTGeQeMvdQJ21inRx0krJ1ZIYgW12fLaYlE6IpyRwT3YBj8ljAz1q9bORky2j wLMBuV5yCa8ls9hd6MOWrh8oU5o5cspfS21Zs1WG9rlinu9oIjNyv4d6bMXi1qHHZru9 46tlqwegie6IC+X1sHsbRuSpbxMp/IOLDuNYpAvSRWz9bG0q2zYdPaEuHN2QtLKM/qEc 7eLb00iUI9IJcKiPYICsOQcW3yZmFgOE4Nb4MrBg0MdZf4X4GgMUlm4VGxPvX97geM12 9ru1S9S8/kll6VVw1qrKod8ou4JYiOOj7/Tf79lcTaDFLYyIsBA+vEmkIm2/5h63E7rM zTvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:user-agent:date:to:cc:subject :mime-version:content-disposition; bh=FGRCqLlxZ5FkueMvmGKRM/cXvGkCUasI34bnZ20LB9c=; b=Jt1Ve/y7eDYIgFlDu1V4Wp13n6NzD2IgZJVm8YfqfMRwFftI5eQx4jLTL5U8cAF+VL D8uoBmDq93n4HqsQYwhkG0kR6nkbQD6fyaHj9uRFMfqM57HAbS517GGA/FGZBzUtr7wr 1qj0nI/BCjWefWT/F+G92urpYnRe+EacXRAsMRm9BQFnT20IbotD/m0YLcwIxhtpgUD3 7+5EP2J6DESSH39558fbTSY0lIRM1Woxkf/CBwoGu/lHJ3wHIre0nwJO0HPb14dr1NC9 k8hsAVbz+Y/y9vvGZhD9ORaKcUAIftDZ2bOnWPDeEPAtj2thJEnQItDLxs4CdfYd8pLI K8PQ== X-Gm-Message-State: AKGB3mIAGNU7uIiy6Nl1h32FHyWmlwLSl6afsGajTzBYObW+ahmAWLfi 2ynqmeZ0ERyGIz+SpzPlK4r0Og== X-Google-Smtp-Source: ACJfBovSOYU4BDqAY6T7uxoBH2ClL753ZJPTh8o87/P/1OKrHVj4qQNlniPp8NL3h1+GaGTg56ewQQ== X-Received: by 10.25.42.9 with SMTP id f9mr1334114lfl.24.1515010300544; Wed, 03 Jan 2018 12:11:40 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.87.30]) by smtp.gmail.com with ESMTPSA id t17sm326746lfi.33.2018.01.03.12.11.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2018 12:11:39 -0800 (PST) From: Sergei Shtylyov X-Google-Original-From: "Sergei Shtylyov" Received: by wasted.cogentembedded.com (sSMTP sendmail emulation); Wed, 03 Jan 2018 23:11:37 +0300 Message-Id: <20180103201137.255228853@cogentembedded.com> User-Agent: quilt/0.64 Date: Wed, 03 Jan 2018 23:08:15 +0300 To: Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Cc: netdev@vger.kernel.org, Sergei Shtylyov Subject: [PATCH 2/2] SolutionEngine771x: add Ether TSU resource MIME-Version: 1.0 Content-Disposition: inline; filename=SolutionEngine771x-add-Ether-TSU-resource.patch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org After the Ether platform data is fixed, the driver probe() method would still fail since the 'struct sh_eth_cpu_data' corresponding to SH771x indicates the presence of TSU but the memory resource for it is absent. Add the missing TSU resource to both Ether devices and fix the harmless off-by-one error in the main memory resources, while at it... Fixes: 4986b996882d ("net: sh_eth: remove the SH_TSU_ADDR") Signed-off-by: Sergei Shtylyov --- arch/sh/boards/mach-se/770x/setup.c | 14 ++++++++++++-- arch/sh/include/mach-se/mach/se.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) Index: linux/arch/sh/boards/mach-se/770x/setup.c =================================================================== --- linux.orig/arch/sh/boards/mach-se/770x/setup.c +++ linux/arch/sh/boards/mach-se/770x/setup.c @@ -123,10 +123,15 @@ static struct sh_eth_plat_data sh_eth_pl static struct resource sh_eth0_resources[] = { [0] = { .start = SH_ETH0_BASE, - .end = SH_ETH0_BASE + 0x1B8, + .end = SH_ETH0_BASE + 0x1B8 - 1, .flags = IORESOURCE_MEM, }, [1] = { + .start = SH_TSU_BASE, + .end = SH_TSU_BASE + 0xA00 - 1, + .flags = IORESOURCE_MEM, + }, + [2] = { .start = SH_ETH0_IRQ, .end = SH_ETH0_IRQ, .flags = IORESOURCE_IRQ, @@ -146,10 +151,15 @@ static struct platform_device sh_eth0_de static struct resource sh_eth1_resources[] = { [0] = { .start = SH_ETH1_BASE, - .end = SH_ETH1_BASE + 0x1B8, + .end = SH_ETH1_BASE + 0x1B8 - 1, .flags = IORESOURCE_MEM, }, [1] = { + .start = SH_TSU_BASE, + .end = SH_TSU_BASE + 0xA00 - 1, + .flags = IORESOURCE_MEM, + }, + [2] = { .start = SH_ETH1_IRQ, .end = SH_ETH1_IRQ, .flags = IORESOURCE_IRQ, Index: linux/arch/sh/include/mach-se/mach/se.h =================================================================== --- linux.orig/arch/sh/include/mach-se/mach/se.h +++ linux/arch/sh/include/mach-se/mach/se.h @@ -100,6 +100,7 @@ /* Base address */ #define SH_ETH0_BASE 0xA7000000 #define SH_ETH1_BASE 0xA7000400 +#define SH_TSU_BASE 0xA7000800 /* PHY ID */ #if defined(CONFIG_CPU_SUBTYPE_SH7710) # define PHY_ID 0x00