From patchwork Sat Jan 6 18:53:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 856442 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="ILfQqrgP"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zDW2423phz9sCZ for ; Sun, 7 Jan 2018 05:55:24 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753271AbeAFSzW (ORCPT ); Sat, 6 Jan 2018 13:55:22 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:38967 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753202AbeAFSzU (ORCPT ); Sat, 6 Jan 2018 13:55:20 -0500 Received: by mail-lf0-f66.google.com with SMTP id m8so2215474lfc.6 for ; Sat, 06 Jan 2018 10:55:19 -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=/W8J507VysWPrOrWSPZWYsEDq7xocRaQertqh3XAiTA=; b=ILfQqrgPjLs2l+btyf9PLmPwznaA+D+jd2HMqpakBll0LRHhzApN7q6fDU4CnsiD6/ FWx6pIvGsKfv00olNgdRPf2wTs3njUL3WI224mjfaC1wuLTs6PxvT9hFwH0x4tL7tdQE jIdu/i0/f9gfHc/57brXdP36Hw97GnIMMdMbsILq/lNuMqmmPxhmYwBdna192SelnSZR Ikb4hCGg4cgPCDOaBz+ru/jI4Wl62pJOoSdzIyYS6Q/z3J/FYceIvmf0kAwOxL+Hl+d6 nnS7g6iaEGmSTAIaCVaf6mXjqtrjxt8pczPJGoKGzeCfHHoAY2sCDI34GjWavH6HeP3w W2yg== 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=/W8J507VysWPrOrWSPZWYsEDq7xocRaQertqh3XAiTA=; b=D3UYIFTV5nZGX/0z1ho0ZreUqyC6wHG3M2TTqNKreguHUwF66LCF4rjTGyFDXKqOUD VvQtYuVc6OrHYxfkuaBVEHbST4D+Y61Uo0V0l1yx5AlMXOC09xMEe4Y0gBpuqCyGS6jx +s+jqUBh8dME5XuE9sbnW1GVGC9KsaC/Arri/l7dUmr8LNewhLjRkl5mZYdeEytmAAfD wspeRkmOIQbmCXgCLiNOuHeMDUb38EXsiO7Fo5/SGDmq3HQoIxgDpTNQaW612uZJvGmq zvk2Woy6YHBPkZVHguv/Et0SltFbdwdCdJdzOVuQIodHGAVh1vYOjbEC9wI0ucTcfCV+ PQjg== X-Gm-Message-State: AKGB3mKhUjhRGh2wz9gCHr0gNeiPsgseeGlPEj+TOU06nXLnGdhRkf9A lPQiM3kidL0h2ZIbSCWCtYGIPg== X-Google-Smtp-Source: ACJfBoteyqPpwoCjuNFU1iDNDnFfWs2gOFoolexFbu47qUs0wtMSrNRg2nRHFNQ6alixKTLYnWkFOA== X-Received: by 10.46.17.11 with SMTP id f11mr4028947lje.8.1515264918936; Sat, 06 Jan 2018 10:55:18 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.85.97]) by smtp.gmail.com with ESMTPSA id l77sm304072lfl.72.2018.01.06.10.55.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Jan 2018 10:55:18 -0800 (PST) From: Sergei Shtylyov X-Google-Original-From: "Sergei Shtylyov" Received: by wasted.cogentembedded.com (sSMTP sendmail emulation); Sat, 06 Jan 2018 21:55:15 +0300 Message-Id: <20180106185515.780906193@cogentembedded.com> User-Agent: quilt/0.64 Date: Sat, 06 Jan 2018 21:53:26 +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-v2.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 --- Changes in version 2: - added the necessary #include. arch/sh/boards/mach-se/770x/setup.c | 10 ++++++++-- 1 file changed, 8 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 @@ -9,6 +9,7 @@ */ #include #include +#include #include #include #include @@ -115,6 +116,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 +138,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 +161,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 Sat Jan 6 18:53:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 856443 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="G70+qqfN"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zDW270zbtz9s7F for ; Sun, 7 Jan 2018 05:55:27 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753309AbeAFSzZ (ORCPT ); Sat, 6 Jan 2018 13:55:25 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:45435 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753209AbeAFSzX (ORCPT ); Sat, 6 Jan 2018 13:55:23 -0500 Received: by mail-lf0-f67.google.com with SMTP id y71so8268923lfd.12 for ; Sat, 06 Jan 2018 10:55:22 -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=jfws87VHyOPa1djOHRv1/nypKVmn4HkWseNt1bKVZaw=; b=G70+qqfNHVwguNwEiBsrGBeoVTzTRp07A5WqkLtBBO256/cYk/oAfLuUgLsQ1RNZH6 K8YfTRZGOUKaIVLSa0owGWHWkmeyJJ2gzLPAlpAOBqeO3E6M8jfDiEb6fuRcqKdSNAr/ /hd242qbNbWlRaZciiFbV7bkljq3e4wlvrAGVbpfkzX8hRtPxqKK9rSFYdxbDPlDS5sT 4KACPZX5+GN6vLPyWBFg5xz+aBhQIg5HRBp7vM85zMF042Dkrk3rRdbaZ6PqF5hq7Ny8 bn6ZKibfceKgqr3ukr0rl5G77IR3x6CjBI5S4rubObrN6jMvcRhvJ4kdj0bIZlvKCQw3 iqXA== 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=jfws87VHyOPa1djOHRv1/nypKVmn4HkWseNt1bKVZaw=; b=cQOXbL1rwCMpellQohnbpydwv/OSSEP7ihJOcnf45t39TYWJhBcbKDtmKXZIPzwe4L xSuU67QZwncn5IdbmVnhbZdhxFX1lQJXMIZIPy4rzEELOu+3aT5KxLuN7ZN+YTGtY7kl bUQj7+GDtYsx/OhiLgKNiSf8R0If+aPVRBSIXZh0WWMsjfGQp4BAlArM5asThQvYmyPZ gMqiNH3CRl5TygRP6bQT/p2sP9moKDRS6DkmsA/TfTZ/lK6IwAbOzMdBMx2/AzXBQkBP 4srEprbCVdPC/u6YFQT8qLdUjFg6sCmAWqmDz9JM7g+ugfseePXOsAs6EYt4P3vbeeut M6yA== X-Gm-Message-State: AKwxyteLNNXGgvVRd8IxBSVik22zlq8C3zN9tQoKmBHW+nswOjGC3nhR tsMmH70AECdzh4t4n+nNYw8jvw== X-Google-Smtp-Source: ACJfBou5cghSLDllRCWEAjMnJPp6mKvrRBTxq1W3E+4UeumY9ERZDV7Q9KiyuQbS5CFhKcECeb9Qpw== X-Received: by 10.25.113.4 with SMTP id m4mr3943839lfc.70.1515264921890; Sat, 06 Jan 2018 10:55:21 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.85.97]) by smtp.gmail.com with ESMTPSA id g74sm1540520lje.52.2018.01.06.10.55.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Jan 2018 10:55:21 -0800 (PST) From: Sergei Shtylyov X-Google-Original-From: "Sergei Shtylyov" Received: by wasted.cogentembedded.com (sSMTP sendmail emulation); Sat, 06 Jan 2018 21:55:19 +0300 Message-Id: <20180106185519.041220394@cogentembedded.com> User-Agent: quilt/0.64 Date: Sat, 06 Jan 2018 21:53:27 +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-v2.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 --- Changes in version 2: - corrected the TSU resource size. 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 @@ -124,10 +124,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 + 0x200 - 1, + .flags = IORESOURCE_MEM, + }, + [2] = { .start = SH_ETH0_IRQ, .end = SH_ETH0_IRQ, .flags = IORESOURCE_IRQ, @@ -147,10 +152,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 + 0x200 - 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