From patchwork Tue Mar 20 08:20:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 10296635 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 68001602B3 for ; Tue, 20 Mar 2018 08:20:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 593C628B36 for ; Tue, 20 Mar 2018 08:20:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DF3629561; Tue, 20 Mar 2018 08:20:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 810EE28B36 for ; Tue, 20 Mar 2018 08:20:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751524AbeCTIUS (ORCPT ); Tue, 20 Mar 2018 04:20:18 -0400 Received: from mail-pl0-f48.google.com ([209.85.160.48]:39534 "EHLO mail-pl0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751328AbeCTIUR (ORCPT ); Tue, 20 Mar 2018 04:20:17 -0400 Received: by mail-pl0-f48.google.com with SMTP id k22-v6so532673pls.6 for ; Tue, 20 Mar 2018 01:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=EI1i17Byuxh5jHkCH9FNiTTtvg2S/dPkGUhIOa7qp4Q=; b=JQ2FOrJ6AUE8c7/CyBUq92YnsE4RuCIFLl+RcMSWIIncDNyhwGlXLhjhIGrIaYhb0b fHHE9FGPGbFXisQ3316nytOSQmVnuU6kDXCijXKpLkWvJCchOHyLlCLv8Zc1mxOMP0MR NRfPd9p9k+oa9FEost1WyBOC6HODTeSff6YsWtt8iDBnVwdt4GnrySHOyw0TixzO4R5Y teub6WxkUEzd1PlDjYXZKApVz1HIpcHXS7l7ZJt/xrUa871WsU4WhM/6s/2UKI7Eaiw9 eGoWiv30ZZ6GV9x8hwzwdEJPLVunCp1Dpn2LpuoPRQpox22U1SCMxMhQswSi/YD8EHC5 jXgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:date:message-id:in-reply-to :references:subject; bh=EI1i17Byuxh5jHkCH9FNiTTtvg2S/dPkGUhIOa7qp4Q=; b=OYKmVQs95iKgiOWvV4nZKRYBhxt2/keJIrxh4F4fpcDoBEIlJiINjS/t/NDpGFgjlQ sZ+1lWjiW4KLxmX2xSfAF7PN4MUWZKOSEwfB2m75BCaUjI4Wn5NIN9hgaP5cIHdQLb3Q MpDxhvWmy+41aFC2YpS93aV4B7+bRZsUc7x8eSoycVz6Tuk73+VSbh+8DaVYqqoleOeJ 1Ur5xBmW9dOoNooC1W1qnrPBDGZ2++p0BO1amvISX+VJdepZe16Yua1eG8UJQtkDGnUW 8YiZuaBpjYoY0q8cOQzM54oVP7zeUZflUvwizehHrsmYoX2hgeG85WuFpVC1F/2kTek1 6O7g== X-Gm-Message-State: AElRT7EsTkKtOyHdJJVmxzQK0Rjc5fro7f1W+oTQFS1f+FxFSQ9bKN/n cJe9CzaVCk4BtlhEnpP/C69dklvK X-Google-Smtp-Source: AG47ELsgj8zPddbZW9VszvQpIY2Pr/2A4NFNK1Dp/DE899D55Yl6+AsHZOQ32nQY8u3FgMiJL46PVg== X-Received: by 2002:a17:902:30f:: with SMTP id 15-v6mr15123664pld.365.1521534016169; Tue, 20 Mar 2018 01:20:16 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id f126sm1517521pfg.25.2018.03.20.01.20.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 01:20:14 -0700 (PDT) From: Magnus Damm To: linux-renesas-soc@vger.kernel.org Cc: Magnus Damm Date: Tue, 20 Mar 2018 17:20:31 +0900 Message-Id: <152153403134.8610.16591493940845260718.sendpatchset@little-apple> In-Reply-To: <152153402203.8610.10666108438721508284.sendpatchset@little-apple> References: <152153402203.8610.10666108438721508284.sendpatchset@little-apple> Subject: [PATCH 1/2] arm: dts: r8a7778 Bock-W Ethernet has busted IRQs Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm The on-board ethernet on r8a7778 Bock-W does not work out of the box. Booting with initramfs and trying to do ifconfig up/down will show that something is busted. Judging by the board schematics the IRQ signal from the LAN89218 chip gets routed to some magic board-specific FPGA and if the stars happen to be aligned this signal may also reach the r8a7778 SoC. This temporary hack tries to use the on-chip GPIO device in r8a7778 for interrupts however on r8a7778 all the GPIO devices share the same interrupt line in the GIC but I wonder if this really has been tested. I recall writing the GPIO driver on r8a7779 and r8a73a4 and then extending to R-Car Gen2 and Gen3. Not sure if it will work on r8a7778 or not. Most likely the PFC needs to be configured to configure the IRQ0 signal to use the irqpin driver, or the GPIO device may be used in a similar fashion as this patch. Unfortunately more effort is needed to track this down. A perhaps related issue on Bock-W is that it sometimes hangs on boot without output on the serial console. Yum. Not for upstream merge. Not-Yet-Signed-off-by: Magnus Damm --- Built on top of renesas-drivers-2018-03-13-v4.16-rc5 arch/arm/boot/dts/r8a7778-bockw.dts | 12 ++++++++---- arch/arm/boot/dts/r8a7778.dtsi | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) --- 0001/arch/arm/boot/dts/r8a7778-bockw.dts +++ work/arch/arm/boot/dts/r8a7778-bockw.dts 2018-03-20 13:56:14.270607110 +0900 @@ -66,13 +66,15 @@ &bsc { ethernet@18300000 { - compatible = "smsc,lan9220", "smsc,lan9115"; + compatible = "smsc,lan89218", "smsc,lan9115"; reg = <0x18300000 0x1000>; - phy-mode = "mii"; - interrupt-parent = <&irqpin>; - interrupts = <0 IRQ_TYPE_EDGE_FALLING>; + interrupt-parent = <&gpio1>; + interrupts = <12 IRQ_TYPE_LEVEL_HIGH>; reg-io-width = <4>; + smsc,force-internal-phy; + smsc,irq-active-high; + smsc,irq-push-pull; vddvario-supply = <&fixedregulator3v3>; vdd33a-supply = <&fixedregulator3v3>; }; @@ -185,6 +187,7 @@ #sound-dai-cells = <0>; }; +#if 0 &sdhi0 { pinctrl-0 = <&sdhi0_pins>, <&sdhi0_pup_pins>; pinctrl-names = "default"; @@ -194,6 +197,7 @@ status = "okay"; wp-gpios = <&gpio3 18 GPIO_ACTIVE_HIGH>; }; +#endif &hspi0 { pinctrl-0 = <&hspi0_pins>; --- 0001/arch/arm/boot/dts/r8a7778.dtsi +++ work/arch/arm/boot/dts/r8a7778.dtsi 2018-03-20 14:01:03.260607110 +0900 @@ -88,7 +88,7 @@ GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>; sense-bitfield-width = <2>; }; - +#if 0 gpio0: gpio@ffc40000 { compatible = "renesas,gpio-r8a7778", "renesas,rcar-gen1-gpio"; reg = <0xffc40000 0x2c>; @@ -99,7 +99,7 @@ #interrupt-cells = <2>; interrupt-controller; }; - +#endif gpio1: gpio@ffc41000 { compatible = "renesas,gpio-r8a7778", "renesas,rcar-gen1-gpio"; reg = <0xffc41000 0x2c>; @@ -110,7 +110,7 @@ #interrupt-cells = <2>; interrupt-controller; }; - +#if 0 gpio2: gpio@ffc42000 { compatible = "renesas,gpio-r8a7778", "renesas,rcar-gen1-gpio"; reg = <0xffc42000 0x2c>; @@ -143,7 +143,7 @@ #interrupt-cells = <2>; interrupt-controller; }; - +#endif pfc: pin-controller@fffc0000 { compatible = "renesas,pfc-r8a7778"; reg = <0xfffc0000 0x118>;