From patchwork Sun Aug 19 20:21:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Stevens X-Patchwork-Id: 959454 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41tqjZ6d0bz9ryn for ; Mon, 20 Aug 2018 07:25: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 41tqjZ59SrzF1qF for ; Mon, 20 Aug 2018 07:25:38 +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.187; 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.187]) (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 41tqdR1wmLzF1S4 for ; Mon, 20 Aug 2018 07:22:02 +1000 (AEST) Received: from mintppc.home ([86.171.142.179]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.163]) with ESMTPA (Nemesis) id 0Lvdma-1fubDW0y4K-017XJ2; Sun, 19 Aug 2018 23:21:58 +0200 From: Darren Stevens To: linuxppc-dev@lists.ozlabs.org Date: Sun, 19 Aug 2018 21:21:55 +0100 (BST) Message-ID: <4c6da03cac4.3957dfc0@auth.smtp.1and1.co.uk> User-Agent: YAM/2.9p1 (AmigaOS4; PPC; rv:20140418r7798) Subject: [PATCH NEXT v2 1/4] powerpc/pasemi: Add PCI initialisation for Nemo board. MIME-Version: 1.0 Content-type: multipart/mixed; boundary="--=_BOUNDARY.6c124c6035e4feb9.65" X-Provags-ID: V03:K1:rtHIeE7yvKjtTmU8zBVK59FtKlQuQwoPIl6q82NM0bRURnVTaVJ /3Pa+UoAq+HAall5hRQyBlZ9ojNrdWYlV2PfGxNvUghdwXudqkb/iarSDZpV6AWzNeugHwU Ka3RzY1q/ErITSgPra8abyPYbNIfPSwcQr2pQsBWdradVWBwP6TOhW2Kp3bg2OBYj1TkZgn AYlctrx3BP8YV6ArDzJ5g== X-UI-Out-Filterresults: notjunk:1; V01:K0:KRRGh4MewVQ=:eIoCCIfjI66rHB4X2fJ9OC UFNj2OJ/a/nVprXYV8KD6Y0FibcSGwi0emfEVv6lXD/aNrpZF+9/NXfudrJWhvD7ICDjW1Gjs TdUfp5xRYUzGg5Vy5P8cbKbmAc9FEPoa06jGd9XVfn4C1eoUW6jnblqA1GH1MUpWvoz7PQ6xg SrLEd66zlgU5FpGCpibQnv/avF7/iPTFqT8OQISKKPUxr9O0Qx9b9SG8c2Fj0IV9j8eXgTcB4 RDU+Sxp0fPHmbj7OdLlcUE72Ny9a0XU8Mar5hYZNEzuZfXQmfu6VOCJ6uPgwBaXgKQIUCSuzr nGasXXtObtPr0qCJCi8TnVZM2D9JkGAx+PY3rUqjNQ9nCbN+GPEeFQCJhEF53TICfQnN/DcVX ZwytkDEvv4J8pvmhfEkCvDLG4JV9dXmGh2GLfOMee1K4Xgk4wJ1vbzJPGjAblhqgZhA6FToLo A6IKcVfCeksyXnKmvMMIjvpp/dmAk9kFG0EYR8giR05B2DHqoOr6xIl5MuILoSA+nZFdFd2zs HkVVWMjK5oAlUEA4MOrp1aw3h9chzurI1eC8vURRp+4Yogt4AmBWy/2b0S7jIWoYJtLyDcEQz J6lmwqmAlyLBB/cDyF4yHZz69OfKqU4A/mGVvFn1ML0rdh/r4Sh4EqZpetqM0hG50tT8Ecimw ijsBVW9aqyocOdQlnICoMIFm876Z1ykisbYCx3IhSznga2K8wEK/KPzrhv/84l9AKpn0= 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: chzigotzky@xenosoft.de Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The A-Eon Amigaone X1000's Nemo motherboard has an AMD SB600 connected to one of the PCI-e root ports on its PaSemi Pwrficient 1628M SoC. Normally the SB600 southbridge would be connected to a hidden PCI-e port on the system's northbridge, and as a result doesn't fully comply with the PCI-e spec. Add code to relax the PCI-e detection in both the root port and the Linux kernel allowing on board devices to be detected. Signed-off-by: Darren Stevens --- Changes made: v2: Replaced sb600_bus with a define, moved iob_mapbase into sb600_set_flag() Created some register/Flag names (as I don't have the docs for the PA6T-1682M) diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c index c3c6417..116c0fe 100644 --- a/arch/powerpc/platforms/pasemi/pci.c +++ b/arch/powerpc/platforms/pasemi/pci.c @@ -108,6 +108,61 @@ static int workaround_5945(struct pci_bus *bus, unsigned int devfn, return 1; } +#ifdef CONFIG_PPC_PASEMI_NEMO +#define PXP_ERR_CFG_REG 0x4 +#define PXP_IGNORE_PCIE_ERRORS 0x800 +#define SB600_BUS 5 + +static void sb600_set_flag(int bus) +{ + static void __iomem *iob_mapbase = NULL; + struct resource res; + struct device_node *dn; + int err; + + if (iob_mapbase == NULL) { + dn = of_find_compatible_node(NULL, "isa", "pasemi,1682m-iob"); + if (!dn) { + pr_crit("NEMO SB600 missing iob node\n"); + return; + } + + err = of_address_to_resource(dn, 0, &res); + of_node_put(dn); + + if (err) { + pr_crit("NEMO SB600 missing resource\n"); + return; + } + + pr_info("NEMO SB600 IOB base %08llx\n",res.start); + + iob_mapbase = ioremap(res.start + 0x100, 0x94); + } + + if (iob_mapbase != NULL) { + if (bus == SB600_BUS) { + /* + * This is the SB600's bus, tell the PCI-e root port + * to allow non-zero devices to enumerate. + */ + out_le32(iob_mapbase + PXP_ERR_CFG_REG, in_le32(iob_mapbase + PXP_ERR_CFG_REG) | PXP_IGNORE_PCIE_ERRORS); + } else { + /* + * Only scan device 0 on other busses + */ + out_le32(iob_mapbase + PXP_ERR_CFG_REG, in_le32(iob_mapbase + PXP_ERR_CFG_REG) & ~PXP_IGNORE_PCIE_ERRORS); + } + } +} + +#else + +static void sb600_set_flag(int bus) +{ +} +#endif + static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 *val) { 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; From patchwork Sun Aug 19 20:23:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Stevens X-Patchwork-Id: 959455 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41tqlf4J1Qz9s4v for ; Mon, 20 Aug 2018 07:27:26 +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 41tqlf32ZxzF2FT for ; Mon, 20 Aug 2018 07:27:26 +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.131; 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.131]) (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 41tqgl6SlzzF2FQ for ; Mon, 20 Aug 2018 07:24:03 +1000 (AEST) Received: from mintppc.home ([86.171.142.179]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.163]) with ESMTPA (Nemesis) id 0Ldqqt-1gI4Hr1YXb-00j5r8; Sun, 19 Aug 2018 23:24:00 +0200 From: Darren Stevens To: linuxppc-dev@lists.ozlabs.org Date: Sun, 19 Aug 2018 21:23:57 +0100 (BST) Message-ID: <4c6da0b4b44.4b608222@auth.smtp.1and1.co.uk> User-Agent: YAM/2.9p1 (AmigaOS4; PPC; rv:20140418r7798) Subject: [PATCH NEXT v2 3/4] powerpc/pasemi: Add Nemo board device init code. MIME-Version: 1.0 Content-type: multipart/mixed; boundary="--=_BOUNDARY.6c124c60de690c6.9f" X-Provags-ID: V03:K1:CALz7ZordvfZvKXsyMmTUCYoun1cG7osjc/F2ru+S9uZH6qdJu7 z2yEaUFrS/ugYokWOdOFv25IraJ451UIKxGp6PQSO6yvH2i+tQQEu5zmVwwMae1SSzC6jSS N5efcuxS3ztjX/L7iUMdK3TsdJQh1IA3r5iy1fX8n8QHUv4KSjNWwbSRcmHk34ybu64qxF1 6/ZixFxgX+tkFPBfsgS8A== X-UI-Out-Filterresults: notjunk:1; V01:K0:/d0RLNWuVQw=:NmG2dHc928YnimRcuT5nhc 39mhsejIEfa5F3iSeFlwaHjRyGKh2xpphSUUBtPOrP+jn606/FPecEg5TNu4cAbC8ZklndlmZ WPuEjjfkoxiOPjilvEaSPAC2XyPQB5wTHxh9XhGtnKDiENS5Eeeuwq9QOGdThzTIAzCLn9dYd hFipIFtbrJPcuV+2Zw6D+mKokjOWBKpnLJrxH/w5VYlWWEFNMzubTkRoG1ca2KMx46UIJDJOd Odd+ItFGU1jAoCmTTWQ3sgjZZFs80LYTkbgQub5aztrQWYeRxHM5I8u8N3UC8STnaYk1iUlZ2 Wo6+V8bWCjCOjkzpRd34c1pzo12S21l4d6V3qIFL80Ea8uPsA8kkb/lNn2csKmo7FlDZIkY1x UeEqQY4me7KuYxnaAuWpwyCpHmfiMA7IvGLMRhcsAkEwCU1z8i9hUKqwM/bruQnZIurhD4wnH XrRoiqHWnCmqWdFs3ufew0enSlli7xZEHhVv91f07E8FMyeloBOFQHNRH6pAmpLEfPObLMIx9 ATr+iccaZ5W/fhbfL2wC1H7LXde/Twn91yfotZXdiKBPgxyp1lKq1QazuxGRi0c5Cd6FXED5G ysy+PFR8ZyHGcKwyy+0tnwbNKtyHXc5fiQyFhRXD3yhTSsWH+2Zqkp2zAlkAPBZidakE5u+ww IYw+9+xuiQFxQXsBp8LWScbCRVz3I5gCUA2aLMlV9xgbo+lDrzp04m7lf3BsqTuRSiz8= 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 routines for Nemo specific devices to init at boot time, these being board level power-off and SB600's rtc. Also add a run time variable to prevent these being activated if we boot on a reference board. Signed-off-by: Darren Stevens --- Changes made: v2: Merged some #ifdef blocks diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index fad5280..98bf2f7 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c @@ -73,6 +73,40 @@ static void __noreturn pas_restart(char *cmd) out_le32(reset_reg, 0x6000000); } +#ifdef CONFIG_PPC_PASEMI_NEMO +void pas_shutdown(void) +{ + /* Set the PLD bit that makes the SB600 think the power button is being pressed */ + void __iomem *pld_map = ioremap(0xf5000000,4096); + while (1) + out_8(pld_map+7,0x01); +} + +/* RTC platform device structure as is not in device tree */ +static struct resource rtc_resource[] = {{ + .name = "rtc", + .start = 0x70, + .end = 0x71, + .flags = IORESOURCE_IO, +}, { + .name = "rtc", + .start = 8, + .end = 8, + .flags = IORESOURCE_IRQ, +}}; + +static inline void nemo_init_rtc(void) +{ + platform_device_register_simple("rtc_cmos", -1, rtc_resource, 2); +} + +#else + +static inline void nemo_init_rtc(void) +{ +} +#endif + #ifdef CONFIG_SMP static arch_spinlock_t timebase_lock; static unsigned long timebase; From patchwork Sun Aug 19 20:26:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Stevens X-Patchwork-Id: 959456 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41tqnc6L5cz9ryn for ; Mon, 20 Aug 2018 07:29:08 +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 41tqnc4yYbzF1S4 for ; Mon, 20 Aug 2018 07:29:08 +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.133; 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.133]) (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 41tqkg2YgqzF2Dc for ; Mon, 20 Aug 2018 07:26:34 +1000 (AEST) Received: from mintppc.home ([86.171.142.179]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.163]) with ESMTPA (Nemesis) id 0MAo9v-1fgkv612wV-00BscD; Sun, 19 Aug 2018 23:26:31 +0200 From: Darren Stevens To: linuxppc-dev Date: Sun, 19 Aug 2018 21:26:28 +0100 (BST) Message-ID: <4c6da168591.7567d73b@auth.smtp.1and1.co.uk> User-Agent: YAM/2.9p1 (AmigaOS4; PPC; rv:20140418r7798) Subject: [PATCH NEXT v2 4/4] powerpc/pasemi: Connect Nemo boot code. MIME-Version: 1.0 Content-type: multipart/mixed; boundary="--=_BOUNDARY.6c124c601c8edb48.f1" X-Provags-ID: V03:K1:OPDIaWu+nxMcG11P+ILCehpZemdgx+ABRdrCqXW8zafCdZryNc0 wSsxmzoG3Oy+KBQLzJj4m+TbrCj1M/LDIMM+mrzvVRCr0wMBzAAzImXB0F7DoN876Yns9Gv lFddFYbrH9rKZYY0vsvuVxLjfCSQJWvBBhKjR5bWKyGLPwxBHetMS0hpKyiLxTsdvX2U3ub Wdj2pC9SqK3bbSyac/eZg== X-UI-Out-Filterresults: notjunk:1; V01:K0:rtNzhwi/Aj8=:X0qA5r6v6iAiSc6SUP41b0 8Hcbd9OzCL3lK6/j4WKb4rg/vmstGpzi6K1+KxTmUVi5pkqCncOA8RVkSkjOxfg1asibSKCh5 idzZScDyQIa/mTlY7st5lbDXiI0r9qKV2s9sQMjZyqGwG7BTMEGNd/ZiuI/lVikKYkeuPqvQJ L+Kfe4PvlOu63tLPz8rFVGWJrg2doWrS2T0Vca++0h2+7XtVm34RHEbV4w86p3YkR7HIjmV2T CRaYKqr36K5uUMaSKjhvYfSIMApKNm6OMkEVG3JwZ5iJmkhKusjUlKQDZ99eZrtMz16VIAT5F N4Wv1WTtMs4qBKdqEq7IvAqmrmCp+5JfQ/zeBQk2aGtTjQqYH2XdiOKceK7zgNJFna4bLmW97 CRnFz8qRDu2Da3HfN1MsrGDQ3kr913RGNauYD2jsxUJYTcoctGbWm+9tNxVJ4O4atsupuSvNe ajoKIEmoYTRRkRKRpW1UjQnztbLmS17PfV9IFUxrUhPo79r0aiUidO4/YGaian1zq3bkWFQM5 lHJmbi95lytqUFbFB3sSJFD4FD3ctPy5JaUBR2z5nxCkSr6qTtFHJOel57XKlM0iiBbX8s+Em veD1FKd8Etttzc9HwQZ8UTCh8urPaRmZoHlk4ys2GSlleFT+q1irRPksBEiZWClkYMjNZN3VS XqT/GlF47mgKk4kEz97OahTOytqbaVC+y993KY772LgK/uwrCI6WNOsF5uRXoYbz2sHM= 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" The previous 3 commits added support code for the Nemo motherbard as used in the Amigaone X1000, now wire them up so the board can be detected and initalised at boot time. Signed-off-by: Darren Stevens --- Changes made: v2: Changed init code to be empty when NEMO=n rather than using #ifdefs diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c index c230acc..3ed0ff6 100644 --- a/arch/powerpc/platforms/pasemi/pci.c +++ b/arch/powerpc/platforms/pasemi/pci.c @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -182,6 +183,8 @@ static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn, addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset); + sb600_set_flag(bus->number); + /* * Note: the caller has already checked that offset is * suitably aligned and that len is 1, 2 or 4. @@ -216,6 +219,8 @@ static int pa_pxp_write_config(struct pci_bus *bus, unsigned int devfn, addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset); + sb600_set_flag(bus->number); + /* * Note: the caller has already checked that offset is * suitably aligned and that len is 1, 2 or 4. @@ -266,6 +271,11 @@ static int __init pas_add_bridge(struct device_node *dev) /* Interpret the "ranges" property */ pci_process_bridge_OF_ranges(hose, dev, 1); + /* Scan for an isa bridge. This is needed to find the SB600 + on the nemo and does nothing on machines without one + */ + isa_bridge_find_early(hose); + return 0; } diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index 98bf2f7..49e67cf 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c @@ -314,6 +314,8 @@ static __init void pas_init_IRQ(void) mpic_unmask_irq(irq_get_irq_data(nmi_virq)); } + nemo_init_IRQ(mpic); + of_node_put(mpic_node); of_node_put(root); } @@ -475,6 +477,8 @@ static int __init pasemi_publish_devices(void) /* Publish OF platform devices for SDC and other non-PCI devices */ of_platform_bus_probe(NULL, pasemi_bus_ids, NULL); + nemo_init_rtc(); + return 0; } machine_device_initcall(pasemi, pasemi_publish_devices); @@ -489,6 +493,17 @@ static int __init pas_probe(void) !of_machine_is_compatible("pasemi,pwrficient")) return 0; +#ifdef CONFIG_PPC_PASEMI_NEMO + /* + * Check for the Nemo motherboard here, if we are running on one + * change the machine definition to fit + */ + if (of_machine_is_compatible("pasemi,nemo")) { + pm_power_off = pas_shutdown; + ppc_md.name = "A-EON Amigaone X1000"; + } +#endif + iommu_init_early_pasemi(); return 1;