From patchwork Sun Aug 19 20:21:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Stevens X-Patchwork-Id: 959453 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41tqgG1KH2z9ryn for ; Mon, 20 Aug 2018 07:23:38 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=stevens-zone.net Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41tqgF6wZHzF2F4 for ; Mon, 20 Aug 2018 07:23:37 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=stevens-zone.net X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=stevens-zone.net (client-ip=212.227.126.130; helo=mout.kundenserver.de; envelope-from=darren@stevens-zone.net; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=stevens-zone.net Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41tqdL5d30zF1S4 for ; Mon, 20 Aug 2018 07:21:56 +1000 (AEST) Received: from mintppc.home ([86.171.142.179]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.163]) with ESMTPA (Nemesis) id 0MYXfl-1fMNKD09sv-00VBj7; Sun, 19 Aug 2018 23:21:52 +0200 From: Darren Stevens To: linuxppc-dev@lists.ozlabs.org Date: Sun, 19 Aug 2018 21:21:47 +0100 (BST) Message-ID: <4c6da03c92f.ac1d78@auth.smtp.1and1.co.uk> User-Agent: YAM/2.9p1 (AmigaOS4; PPC; rv:20140418r7798) Subject: [PATCH NEXT v2 2/4] powerpc/pasemi: Add Nemo board IRQ initroutine MIME-Version: 1.0 Content-type: multipart/mixed; boundary="--=_BOUNDARY.6c124c6049b4ee29.54" X-Provags-ID: V03:K1:YBY/9m/f17ipVpw1c23gTjgnETfZMU5FrjuRRW8VgSWQRUAoAlj rWRRQ2q5m/VN/0np8pQFs2uExvrxB4WtXE1ep0kiIofNp/GVDKDDiJMoRLrMnhlEvefEDoB YCTYN8ZfK6n+kfo655XAJ2PO5D8qguXDJaSLeBm3B5OGH6RbpQIdGpHPpYneowht8pLnBPO nNpL59Q3TQ+ZHoSjGKHuQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:jTVYFJeAcrE=:798A7s7ENXPLx/iTZB7Ogi jq5y9pE2SgULDqKxDmF1VD4f4hdf4SXx6AaX393zi6he4/kAr/t6vSsCuJkG5GvyteV6et6oA /I6sGUE45rPd9oQAz3pDfhfkxp4KODeKIOo5+bjjBrtFTOTwInc65Dw1+M4A+yKGphtTQENC8 qNZrhbyIqSy7/dQaBPi7sXEnRqG9b6DTw7JBiv1ZdNDjAq1zWdAVV6jlhWUvaH7Xnh5LB/4+V L4gueTUonhBMS6Yv6YnzwzI8rPRCWI745PoN9vaAWMvpIMOdQgU0wIRC8Sbi069Vfbf98vowN o69hDDUBwni8bMlDbX17DXDltBHLvtCFPwffutpH0l+3EoFdfA0a7QJGEQRwoCBTwJb43zSF8 X8U+Bhun5FJXWixp1DxYknFDhZguvOXaM4D85k/RHG/9PLglJ+OgbuuGA9dTaE7+xFzE/5JVL mUwKZSfTdeW6L0tVxcyop59zrqwvlll6PaayXwRgKdcYR06tU+o/Ep1JwkVe50ukA8zJZZrtY VMtWdjl1297rat1p2pI8mRGHWEEExb2W/zihF30fsgSM1rIURGfBihOFqYOPziQ73jQUh7+3T 0x3GRdHCJEmxbe+/eBldiYG3Gwp2RqSLVjpnnwfuRQnVnlK+Adk+iFAQK6M0+9fiqYgE0hfn1 NSIc/UOVOeh0rhkXaXZm2ITXGp0VwkCEOpaY3I7vigF9DYF50Rgl5b200vgAp6dvM13w= X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Zigotzky Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Add a IRQ init routine for the Nemo board which inits and attatches the i8259 found in the SB600, and a cascade routine to dispatch the interrupts. Signed-off-by: Darren Stevens diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index 9a6eb04..fad5280 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -183,6 +184,42 @@ static int __init pas_setup_mce_regs(void) } machine_device_initcall(pasemi, pas_setup_mce_regs); +#ifdef CONFIG_PPC_PASEMI_NEMO +static void sb600_8259_cascade(struct irq_desc *desc) +{ + struct irq_chip *chip = irq_desc_get_chip(desc); + unsigned int cascade_irq = i8259_irq(); + + if (cascade_irq) + generic_handle_irq(cascade_irq); + + chip->irq_eoi(&desc->irq_data); +} + +static void nemo_init_IRQ(struct mpic *mpic) +{ + struct device_node *np; + int gpio_virq; + /* Connect the SB600's legacy i8259 controller */ + np = of_find_node_by_path("/pxp@0,e0000000"); + i8259_init(np, 0); + of_node_put(np); + + gpio_virq = irq_create_mapping(NULL, 3); + irq_set_irq_type(gpio_virq, IRQ_TYPE_LEVEL_HIGH); + irq_set_chained_handler(gpio_virq, sb600_8259_cascade); + mpic_unmask_irq(irq_get_irq_data(gpio_virq)); + + irq_set_default_host(mpic->irqhost); +} + +#else + +static inline void nemo_init_IRQ(struct mpic *mpic) +{ +} +#endif + static __init void pas_init_IRQ(void) { struct device_node *np;