From patchwork Thu Jun 18 13:32:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Noralf_Tr=C3=B8nnes?= X-Patchwork-Id: 6637381 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 79BDCC0020 for ; Thu, 18 Jun 2015 13:35:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F0B4203F3 for ; Thu, 18 Jun 2015 13:35:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7E85203DC for ; Thu, 18 Jun 2015 13:35:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z5Zwf-00020T-UL; Thu, 18 Jun 2015 13:33:29 +0000 Received: from smtp.domeneshop.no ([2a01:5b40:0:252::55]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z5ZwZ-0001NI-2P; Thu, 18 Jun 2015 13:33:25 +0000 Received: from 48.81-166-104.customer.lyse.net ([81.166.104.48]:54271 helo=[192.168.10.173]) by smtp.domeneshop.no with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Z5Zw4-00033O-SA; Thu, 18 Jun 2015 15:32:52 +0200 Message-ID: <5582C87C.20008@tronnes.org> Date: Thu, 18 Jun 2015 15:32:44 +0200 From: =?UTF-8?B?Tm9yYWxmIFRyw7hubmVz?= User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Stephen Warren Subject: Re: [PATCH] irqchip: bcm2835: Add FIQ support References: <1434130016-26574-1-git-send-email-noralf@tronnes.org> <55822C71.2040409@wwwdotorg.org> In-Reply-To: <55822C71.2040409@wwwdotorg.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150618_063323_331330_B4EC24F0 X-CRM114-Status: GOOD ( 11.38 ) X-Spam-Score: -0.7 (/) Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, jason@lakedaemon.net, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Den 18.06.2015 04:26, skrev Stephen Warren: > On 06/12/2015 11:26 AM, Noralf Trønnes wrote: >> Add a duplicate irq range with an offset on the hwirq's so the >> driver can detect that enable_fiq() is used. >> Tested with downstream dwc_otg USB controller driver. > This basically looks OK, but a few comments/thoughts: > > a) Should the Kconfig change be a separate patch since it's a separate > subsystem? I can separate it out. > b) Doesn't the driver need to refuse some operation (handler > registration, IRQ setup, IRQ enable, ...?) for more than 1 IRQ in the > FIQ range, since the FIQ control register only allows routing 1 IRQ to FIQ. claim_fiq() protects the FIQ. See d) answer below. > c) The DT binding needs updating to describe the extra IRQs: > >> Documentation/devicetree/bindings/interrupt-controller/brcm,bcm28armctrl-ic.txt Ok. > d) I wonder how the FIQ handler actually gets routed to this controller > and hooked to its handler etc. I assume there's a separate patch for > that coming? set_fiq_handler() sets the handler and enable_fiq() enables it: if (claim_fiq(&fh)) ERROR; set_fiq_handler(...) set_fiq_regs(®s); enable_fiq(irq); local_fiq_enable(); Downstream dwc_otg ------------------ FIQ handler: https://github.com/raspberrypi/linux/blob/rpi-4.0.y/drivers/usb/host/dwc_otg/dwc_otg_fiq_stub.S FIQ is set up in hcd_init_fiq(): https://github.com/raspberrypi/linux/blob/rpi-4.0.y/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c This patch is also necessary: DT node: usb: usb@7e980000 { compatible = "brcm,bcm2708-usb"; reg = <0x7e980000 0x10000>, <0x7e006000 0x1000>; interrupts = <2 0>, <1 9>; }; diff --git a/drivers/usb/host/dwc_otg/dwc_otg_driver.c b/drivers/usb/host/dwc_otg/dwc_otg_driver.c index 53307f0..95edadf 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_driver.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_driver.c @@ -723,6 +723,7 @@ static int dwc_otg_driver_probe( memset(dwc_otg_device, 0, sizeof(*dwc_otg_device)); dwc_otg_device->os_dep.reg_offset = 0xFFFFFFFF; + dwc_otg_device->os_dep.platformdev = _dev; /* * Map the DWC_otg Core memory into virtual address space. diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c index 8a31562..2961985 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c @@ -36,10 +36,8 @@ #include "dwc_otg_regs.h" #include -#include #include - extern bool microframe_schedule; /** @file diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c index 6aad9c4..0440c66 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c @@ -445,7 +445,11 @@ static void hcd_init_fiq(void *cookie) DWC_WARN("MPHI periph has NOT been enabled"); #endif // Enable FIQ interrupt from USB peripheral +#ifdef CONFIG_ARCH_BCM2835 + enable_fiq(platform_get_irq(otg_dev->os_dep.platformdev, 1)); +#else enable_fiq(INTERRUPT_VC_USB); +#endif local_fiq_enable(); }