From patchwork Mon Mar 13 19:56:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 738383 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vhpXN5Kh6z9s0m for ; Tue, 14 Mar 2017 06:56:20 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="eBqgJKHK"; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id D0BDBB90EAA; Mon, 13 Mar 2017 20:56:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Mon, 13 Mar 2017 20:56:10 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id AA9E8B90E5A for ; Mon, 13 Mar 2017 20:56:08 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .linaro. - helo: .mail-it0-f45.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -7 Received: from mail-it0-f45.google.com (mail-it0-f45.google.com [209.85.214.45]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 13 Mar 2017 20:56:07 +0100 (CET) Received: by mail-it0-f45.google.com with SMTP id m27so38741660iti.1 for ; Mon, 13 Mar 2017 12:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GXIfsQyXxynZbrZWC4GTHOrB5rYuNgze+AyOgayizSc=; b=eBqgJKHKUQA4HPPx7Af8y6YRCtjvggr1lyuy5hdwD4sHtYVJu07RrHCKOcScK7W0H1 EO/ETw1tz7wHZmCJ6N9ZCm+80VerhLHADgMUN896PKuGF4lAGn3TdExR9iVf7NPhT1p0 ngg3aN+R095QawFNOJtYMqA3F2piBkS3ct7nM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GXIfsQyXxynZbrZWC4GTHOrB5rYuNgze+AyOgayizSc=; b=qa/pMSzlr28I3ZljzyxcGpdl6KWAkWM9lsEzOvSwJ3tRV42b8MSYGz08a/jqgTTwvP SFeX8FpDRJuCg9HFHXfo/lmVlOWe5XMoe69wEHkZ7H5QjPSgslHwMnvBmGgHDmEQpvGV iG7br3fkfxVLcmjVqCyRE2XY9sQOb6UbB8S37VyTPQ9GgOTnOVzqRPCBj+ptUbdBazea pC8rXH/he0s1BeauQfDfk4ghxWPH1kWp/MlEW9dAxA8AtbiaRb+OIsWX3w6Au8tLNh58 HpSbKxKSF4AC6+XM58hQuZ/HInCOEv+2qF/oTnmfKRyZ/c0W3Y8n63CFkjaSHDDFCNcQ 3yJg== X-Gm-Message-State: AFeK/H0JYCwrInFUyjALqmTDtEM0HIfoSoILlFlDdvs/AUPjHVJV1ZZho9NvJoqAH4xO5srYKzGogYQB3gvO4pNi X-Received: by 10.36.26.9 with SMTP id 9mr12077155iti.25.1489434965910; Mon, 13 Mar 2017 12:56:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.134.193 with HTTP; Mon, 13 Mar 2017 12:56:04 -0700 (PDT) In-Reply-To: References: <20170311231505.16056-1-linus.walleij@linaro.org> From: Linus Walleij Date: Mon, 13 Mar 2017 20:56:04 +0100 Message-ID: To: Jonas Jensen Subject: Re: [OpenWrt-Devel] [PATCH 4/4] RFT: irqchip: replace moxa with ftintc010 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@openwrt.org, Jason Cooper , Paulius Zaleckas , Marc Zyngier , "arm@kernel.org" , Thomas Gleixner , Janos Laube , "linux-arm-kernel@lists.infradead.org" Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" On Mon, Mar 13, 2017 at 5:05 PM, Jonas Jensen wrote: > Log [1] is with MMC unavailable (another issue that needs a fix in DT) > and [2] when MMC is there. > > I suspect some of the IRQ flags in arch/arm/boot/dts/moxart.dtsi may > not be set right / they don't match up against the "interrupt-mask" > property we probably want to get rid of. Any tips on what those flags > really should be? Probably the irq trigger setting is wrong indeed. The old moxa driver does this: ret = of_property_read_u32(node, "interrupt-mask", &intc.interrupt_mask); writel(intc.interrupt_mask, intc.base + IRQ_MODE_REG); writel(intc.interrupt_mask, intc.base + IRQ_LEVEL_REG); Then it doesn't implement .set_type() so the flags on the individual lines get ignored. In the moxart.dtsi it looks like so: interrupt-mask = <0x00080000>; Which means all IRQs get IRQ_TYPE_LEVEL_HIGH except irq 19 which gets IRQ_TYPE_EDGE_FALLING which is the same that Gemini is doing. Can you try the following patch? If it works I will queue this too. Flag 8 = LEVEL_LOW seems very weird for the serial so I adjusted it to LEVEL_HIGH, but if serial stops working try setting it to IRQ_TYPE_LEVEL_LOW. From 3ca61eca2a2fbcdc213443648100908db54913be Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 13 Mar 2017 20:50:15 +0100 Subject: [PATCH] ARM: dts: Adjust moxart IRQ controller and flags The moxart interrupt line flags were not respected in previous driver: instead of assigning them per-consumer, a fixes mask was set in the controller. With the migration to a standard Faraday driver we need to set up and handle the consumer flags correctly. Also remove the Moxart-specific flags when switching to using real consumer flags. Extend the register window to 0x100 bytes as we may have a few more registers in there and it doesn't hurt. Signed-off-by: Linus Walleij --- arch/arm/boot/dts/moxart.dtsi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm/boot/dts/moxart.dtsi b/arch/arm/boot/dts/moxart.dtsi index 10a8184e0ce9..7d10d06ee265 100644 --- a/arch/arm/boot/dts/moxart.dtsi +++ b/arch/arm/boot/dts/moxart.dtsi @@ -6,6 +6,7 @@ */ /include/ "skeleton.dtsi" +#include / { compatible = "moxa,moxart"; @@ -36,11 +37,10 @@ ranges; intc: interrupt-controller@98800000 { - compatible = "moxa,moxart-ic"; - reg = <0x98800000 0x38>; + compatible = "moxa,moxart-ic", "faraday,ftintc010"; + reg = <0x98800000 0x100>; interrupt-controller; #interrupt-cells = <2>; - interrupt-mask = <0x00080000>; }; clk_pll: clk_pll@98100000 { @@ -59,7 +59,7 @@ timer: timer@98400000 { compatible = "moxa,moxart-timer"; reg = <0x98400000 0x42>; - interrupts = <19 1>; + interrupts = <19 IRQ_TYPE_EDGE_FALLING>; clocks = <&clk_apb>; }; @@ -80,7 +80,7 @@ dma: dma@90500000 { compatible = "moxa,moxart-dma"; reg = <0x90500080 0x40>; - interrupts = <24 0>; + interrupts = <24 IRQ_TYPE_LEVEL_HIGH>; #dma-cells = <1>; }; @@ -93,7 +93,7 @@ sdhci: sdhci@98e00000 { compatible = "moxa,moxart-sdhci"; reg = <0x98e00000 0x5C>; - interrupts = <5 0>; + interrupts = <5 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clk_apb>; dmas = <&dma 5>, <&dma 5>; @@ -120,7 +120,7 @@ mac0: mac@90900000 { compatible = "moxa,moxart-mac"; reg = <0x90900000 0x90>; - interrupts = <25 0>; + interrupts = <25 IRQ_TYPE_LEVEL_HIGH>; phy-handle = <ðphy0>; phy-mode = "mii"; status = "disabled"; @@ -129,7 +129,7 @@ mac1: mac@92000000 { compatible = "moxa,moxart-mac"; reg = <0x92000000 0x90>; - interrupts = <27 0>; + interrupts = <27 IRQ_TYPE_LEVEL_HIGH>; phy-handle = <ðphy1>; phy-mode = "mii"; status = "disabled"; @@ -138,7 +138,7 @@ uart0: uart@98200000 { compatible = "ns16550a"; reg = <0x98200000 0x20>; - interrupts = <31 8>; + interrupts = <31 IRQ_TYPE_LEVEL_HIGH>; reg-shift = <2>; reg-io-width = <4>; clock-frequency = <14745600>;