[{"id":1764378,"web_url":"http://patchwork.ozlabs.org/comment/1764378/","msgid":"<CAKKbWA4OXL__VWzwRvN_wujDc70zWqmGPcu2_WRpvsSUYba1Qg@mail.gmail.com>","list_archive_url":null,"date":"2017-09-06T21:04:09","subject":"Re: [PATCH v4 1/3] arm: npcm: add basic support for Nuvoton BMCs","submitter":{"id":72311,"url":"http://patchwork.ozlabs.org/api/people/72311/","name":"Avi Fishman","email":"avifishman70@gmail.com"},"content":"Sorry for sending again some mailing list rejected it due to HTML\ninvolved (althoug I tried Plain Text), Trying again.\n\n2017-09-06 11:07 GMT+03:00 Brendan Higgins <brendanhiggins@google.com>:\n> Adds basic support for the Nuvoton NPCM750 BMC.\n>\n> Signed-off-by: Brendan Higgins <brendanhiggins@google.com>\n> ---\n>  arch/arm/Kconfig             |  2 +\n>  arch/arm/Makefile            |  1 +\n>  arch/arm/mach-npcm/Kconfig   | 50 +++++++++++++++++++++++++\n>  arch/arm/mach-npcm/Makefile  |  3 ++\n>  arch/arm/mach-npcm/headsmp.S | 17 +++++++++\n>  arch/arm/mach-npcm/npcm7xx.c | 34 +++++++++++++++++\n>  arch/arm/mach-npcm/platsmp.c | 89 ++++++++++++++++++++++++++++++++++++++++++++\n>  7 files changed, 196 insertions(+)\n>  create mode 100644 arch/arm/mach-npcm/Kconfig\n>  create mode 100644 arch/arm/mach-npcm/Makefile\n>  create mode 100644 arch/arm/mach-npcm/headsmp.S\n>  create mode 100644 arch/arm/mach-npcm/npcm7xx.c\n>  create mode 100644 arch/arm/mach-npcm/platsmp.c\n>\n> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig\n> index 61a0cb15067e..05543f1cfbde 100644\n> --- a/arch/arm/Kconfig\n> +++ b/arch/arm/Kconfig\n> @@ -782,6 +782,8 @@ source \"arch/arm/mach-netx/Kconfig\"\n>\n>  source \"arch/arm/mach-nomadik/Kconfig\"\n>\n> +source \"arch/arm/mach-npcm/Kconfig\"\n> +\n>  source \"arch/arm/mach-nspire/Kconfig\"\n>\n>  source \"arch/arm/plat-omap/Kconfig\"\n> diff --git a/arch/arm/Makefile b/arch/arm/Makefile\n> index 47d3a1ab08d2..60ca50c7d762 100644\n> --- a/arch/arm/Makefile\n> +++ b/arch/arm/Makefile\n> @@ -191,6 +191,7 @@ machine-$(CONFIG_ARCH_MEDIATEK)             += mediatek\n>  machine-$(CONFIG_ARCH_MXS)             += mxs\n>  machine-$(CONFIG_ARCH_NETX)            += netx\n>  machine-$(CONFIG_ARCH_NOMADIK)         += nomadik\n> +machine-$(CONFIG_ARCH_NPCM)            += npcm\n>  machine-$(CONFIG_ARCH_NSPIRE)          += nspire\n>  machine-$(CONFIG_ARCH_OXNAS)           += oxnas\n>  machine-$(CONFIG_ARCH_OMAP1)           += omap1\n> diff --git a/arch/arm/mach-npcm/Kconfig b/arch/arm/mach-npcm/Kconfig\n> new file mode 100644\n> index 000000000000..d47061855439\n> --- /dev/null\n> +++ b/arch/arm/mach-npcm/Kconfig\n> @@ -0,0 +1,50 @@\n> +menuconfig ARCH_NPCM\n> +       bool \"Nuvoton NPCM Architecture\"\n> +       select ARCH_REQUIRE_GPIOLIB\n> +       select USE_OF\n> +       select PINCTRL\n> +       select PINCTRL_NPCM7XX\n> +\n> +if ARCH_NPCM\n> +\n> +comment \"NPCMX50 CPU type\"\n> +\n> +config CPU_NPCM750\n> +       depends on ARCH_NPCM && ARCH_MULTI_V7\n> +       bool \"Support for NPCM750 BMC CPU (Poleg)\"\n> +       select CACHE_L2X0\n> +       select CPU_V7\n> +       select ARM_GIC\n> +       select HAVE_SMP\n> +       select SMP\n> +       select SMP_ON_UP\n> +       select HAVE_ARM_SCU\n> +       select HAVE_ARM_TWD if SMP\n> +       select ARM_ERRATA_458693\n> +       select ARM_ERRATA_720789\n> +       select ARM_ERRATA_742231\n> +       select ARM_ERRATA_754322\n> +       select ARM_ERRATA_764369\n> +       select ARM_ERRATA_794072\n> +       select PL310_ERRATA_588369\n> +       select PL310_ERRATA_727915\n> +       select USB_EHCI_ROOT_HUB_TT\n> +       select USB_ARCH_HAS_HCD\n> +       select USB_ARCH_HAS_EHCI\n> +       select USB_EHCI_HCD\n> +       select USB_ARCH_HAS_OHCI\n> +       select USB_OHCI_HCD\n> +       select USB\n> +       select FIQ\n> +       select CPU_USE_DOMAINS\n> +       select GENERIC_CLOCKEVENTS\n> +       select CLKDEV_LOOKUP\n> +       select COMMON_CLK if OF\n> +       select NPCM750_TIMER\n> +       select MFD_SYSCON\n> +       help\n> +         Support for NPCM750 BMC CPU (Poleg).\n> +\n> +         Nuvoton NPCM750 BMC based on the Cortex A9.\n> +\n> +endif\n> diff --git a/arch/arm/mach-npcm/Makefile b/arch/arm/mach-npcm/Makefile\n> new file mode 100644\n> index 000000000000..78416055b854\n> --- /dev/null\n> +++ b/arch/arm/mach-npcm/Makefile\n> @@ -0,0 +1,3 @@\n> +AFLAGS_headsmp.o               += -march=armv7-a\n> +\n> +obj-$(CONFIG_CPU_NPCM750)      += npcm7xx.o platsmp.o headsmp.o\n> diff --git a/arch/arm/mach-npcm/headsmp.S b/arch/arm/mach-npcm/headsmp.S\n> new file mode 100644\n> index 000000000000..9fccbbd49ed4\n> --- /dev/null\n> +++ b/arch/arm/mach-npcm/headsmp.S\n> @@ -0,0 +1,17 @@\n> +/*\n> + * Copyright 2017 Google, Inc.\n> + *\n> + * This program is free software; you can redistribute it and/or modify\n> + * it under the terms of the GNU General Public License version 2 as\n> + * published by the Free Software Foundation.\n> + */\n> +\n> +#include <linux/linkage.h>\n> +#include <linux/init.h>\n> +#include <asm/assembler.h>\n> +\n> +ENTRY(npcm7xx_secondary_startup)\n> +       safe_svcmode_maskall r0\n\nI saw you  answered to Florian Fainelli that the BootRom is not\nstarting the secondary CPU in SVC mode. Are you sure? In our\nengineering npcm7xx revision, Z1, the BootRom indeed started to run it\nin IRQ mode but we fixed it in the production version, A1, (quite long\ntime ago), I hope you didn't get an EB with Z1 you can check that in\nBootBlock console print:\n> ADC CLK is set to 25000000\n>Last reset was CORST\n>vgaioen=1 and mux gspi.\n>A1 <<====== this is what you should see, if you see Z1 we need to replace your EB\n\n> +\n> +       b       secondary_startup\n> +ENDPROC(npcm7xx_secondary_startup)\n> diff --git a/arch/arm/mach-npcm/npcm7xx.c b/arch/arm/mach-npcm/npcm7xx.c\n> new file mode 100644\n> index 000000000000..132e9d587857\n> --- /dev/null\n> +++ b/arch/arm/mach-npcm/npcm7xx.c\n> @@ -0,0 +1,34 @@\n> +/*\n> + * Copyright (c) 2017 Nuvoton Technology corporation.\n> + * Copyright 2017 Google, Inc.\n> + *\n> + * This program is free software; you can redistribute it and/or modify\n> + * it under the terms of the GNU General Public License version 2 as\n> + * published by the Free Software Foundation.\n> + */\n> +\n> +#include <linux/kernel.h>\n> +#include <linux/types.h>\n> +#include <asm/mach/arch.h>\n> +#include <asm/mach-types.h>\n> +#include <asm/mach/map.h>\n> +#include <asm/hardware/cache-l2x0.h>\n> +\n> +#define NPCM7XX_AUX_VAL (L310_AUX_CTRL_INSTR_PREFETCH |                               \\\n> +                        L310_AUX_CTRL_DATA_PREFETCH |                         \\\n> +                        L310_AUX_CTRL_NS_LOCKDOWN |                           \\\n> +                        L310_AUX_CTRL_CACHE_REPLACE_RR |                      \\\n> +                        L2C_AUX_CTRL_SHARED_OVERRIDE |                        \\\n> +                        L310_AUX_CTRL_FULL_LINE_ZERO)\n> +\n> +static const char *const npcm7xx_dt_match[] = {\n> +       \"nuvoton,npcm750\",\n> +       NULL\n> +};\n> +\n> +DT_MACHINE_START(NPCM7XX_DT, \"NPCMX50 Chip family\")\n> +       .atag_offset    = 0x100,\n> +       .dt_compat      = npcm7xx_dt_match,\n> +       .l2c_aux_val    = NPCM7XX_AUX_VAL,\n> +       .l2c_aux_mask   = ~NPCM7XX_AUX_VAL,\n> +MACHINE_END\n> diff --git a/arch/arm/mach-npcm/platsmp.c b/arch/arm/mach-npcm/platsmp.c\n> new file mode 100644\n> index 000000000000..144e3e7ec7e6\n> --- /dev/null\n> +++ b/arch/arm/mach-npcm/platsmp.c\n> @@ -0,0 +1,89 @@\n> +/*\n> + * Copyright 2017 Google, Inc.\n> + *\n> + * This program is free software; you can redistribute it and/or modify\n> + * it under the terms of the GNU General Public License version 2 as\n> + * published by the Free Software Foundation.\n> + */\n> +\n> +#define pr_fmt(fmt) \"PLATSMP: \" fmt\n> +\n> +#include <linux/delay.h>\n> +#include <linux/device.h>\n> +#include <linux/smp.h>\n> +#include <linux/io.h>\n> +#include <linux/of.h>\n> +#include <linux/of_device.h>\n> +#include <linux/of_platform.h>\n> +#include <linux/of_address.h>\n> +#include <asm/cacheflush.h>\n> +#include <asm/smp.h>\n> +#include <asm/smp_plat.h>\n> +#include <asm/smp_scu.h>\n> +\n> +#define NPCM7XX_SCRPAD_REG 0x13c\n> +\n> +extern void npcm7xx_secondary_startup(void);\n> +\n> +static int npcm7xx_smp_boot_secondary(unsigned int cpu,\n> +                                     struct task_struct *idle)\n> +{\n> +       struct device_node *gcr_np;\n> +       void __iomem *gcr_base;\n> +       int ret = 0;\n> +\n> +       gcr_np = of_find_compatible_node(NULL, NULL, \"nuvoton,npcm750-gcr\");\n> +       if (!gcr_np) {\n> +               pr_err(\"no gcr device node\\n\");\n> +               ret = -EFAULT;\n> +               goto out;\n> +       }\n> +       gcr_base = of_iomap(gcr_np, 0);\n> +       if (!gcr_base) {\n> +               pr_err(\"could not iomap gcr at: 0x%llx\\n\", gcr_base);\n> +               ret = -EFAULT;\n> +               goto out;\n> +       }\n> +\n> +       /* give boot ROM kernel start address. */\n> +       iowrite32(__pa_symbol(npcm7xx_secondary_startup), gcr_base +\n> +                 NPCM7XX_SCRPAD_REG);\n> +       /* make sure npcm7xx_secondary_startup is seen by all observers. */\n> +       smp_wmb();\n> +       dsb_sev();\n> +       /* make sure write buffer is drained */\n> +       mb();\n> +\n> +out:\n> +       iounmap(gcr_base);\n> +       return ret;\n> +}\n> +\n> +static void __init npcm7xx_smp_prepare_cpus(unsigned int max_cpus)\n> +{\n> +       struct device_node *scu_np;\n> +       void __iomem *scu_base;\n> +\n> +       scu_np = of_find_compatible_node(NULL, NULL, \"arm,cortex-a9-scu\");\n> +       if (!scu_np) {\n> +               pr_err(\"no scu device node\\n\");\n> +               return;\n> +       }\n> +       scu_base = of_iomap(scu_np, 0);\n> +       if (!scu_base) {\n> +               pr_err(\"could not iomap scu at: 0x%llx\\n\", scu_base);\n> +               return;\n> +       }\n> +\n> +       scu_enable(scu_base);\n> +\n> +out:\n> +       iounmap(scu_base);\n> +}\n> +\n> +static struct smp_operations npcm7xx_smp_ops __initdata = {\n> +       .smp_prepare_cpus = npcm7xx_smp_prepare_cpus,\n> +       .smp_boot_secondary = npcm7xx_smp_boot_secondary,\n> +};\n> +\n> +CPU_METHOD_OF_DECLARE(npcm7xx_smp, \"nuvoton,npcm7xx-smp\", &npcm7xx_smp_ops);\n> --\n> 2.14.1.581.gf28d330327-goog\n>","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"LRK+hBSl\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"p9g27qip\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnbgW4Qx4z9s7C\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 07:04:39 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dphUy-0001Gi-2W; Wed, 06 Sep 2017 21:04:36 +0000","from mail-oi0-x242.google.com ([2607:f8b0:4003:c06::242])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dphUt-0001EV-UL for linux-arm-kernel@lists.infradead.org;\n\tWed, 06 Sep 2017 21:04:33 +0000","by mail-oi0-x242.google.com with SMTP id h70so5233480oic.4\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tWed, 06 Sep 2017 14:04:10 -0700 (PDT)","by 10.157.62.18 with HTTP; Wed, 6 Sep 2017 14:04:09 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:\n\tReferences:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=6WCxOIbSMheZtC6Lo/m7xIeUJpehEMSBBR0aOLJl52k=;\n\tb=LRK+hBSlbyCXYA\n\t5kJYnBmPqM+WRmyiLlYOTNfKq19DhBmosaKnx7bSjPdO2tcgEiLh/hL8jbXXSzP1JUCxbhmYWjn6i\n\tc4YCITmr6kkHpy/zaLoBc3SycSJ7fYSdtJDzefzUk2zVGwQk+LeHcq5sB27RYqCZwez1noNH7dZKx\n\th83j7wtH1IRNJCecc0YaxjDy9tU4sUfueKOVD2DUEoYDY1wqJt5mnlbDpD5lUTMCw48nI4WfV80fF\n\tO29+yX3DRIOSeYE9SeI7xldQrpxZLx8T8w85A2JJAM7Y65ODn0ArLYdfintgw/DnY+uKffS2XWtWM\n\teVUSL6Cr5WsKYnkyDUow==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=dInMDNE3NM+HnV0elj7UO2GCxV4WCgb+us80KFvjpAY=;\n\tb=p9g27qip5iMCH0iuCyqGKgF1uZh91M1Y7IA6ZGRO50NqPwpvQElTC7e5hDvSUTTIRN\n\tr8QTFaXPW5sRh9Mg48bKU0qcs7HxXiuiiIIvdSxuFuNmVho98QaoeWYvXOfc3wFnfKSl\n\tPLNqg++07OGPkfa2DKrgOZ82zYWm/3tIOmJrw6ShPPFGGAtkTI/QD5az5i4RonsXXwL+\n\tydm/vve8RK3pNVcRnrmUyi2cPEVV8QHDhaySNw67uq4Z+GX8cPEADK7xrty1e12ONgae\n\tD9/cVtq+tw/ZkIfxS7BXvtC3W5kMy0+q5XSNMavE9qWCFaHatdyPp6pCa/Em+Ulzcb1z\n\tTt/A=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=dInMDNE3NM+HnV0elj7UO2GCxV4WCgb+us80KFvjpAY=;\n\tb=BrzOTG8yBoPln5t4CUF2ccyYAgANTx/30hY5x+lUY4b+r64E6Ds+tCnv84LD2SuU53\n\t0qFqIhvrRKbGiJzjv94qoCBky5IPrjzqxbs+YhT4nQjVlJERwoPSPR917x+rm1SmagCi\n\tJq7DkoVF+5yPqYiPxCPrAjkeMA3iGHFUJ2cHSJvM2LQ6+N6AjFrs8Y2PZ6tLvFLchDRJ\n\teC3H6k6iXpeJ57YJ/XHr4lKpHMrIQHorbD8ZM+rakXtq8okYA42Hyk/7Dl051doZihaS\n\tfEQy8ogKS4UL0rv2I1buPX+x+EifdH1lVoINqOjGzoL1IirTajcktUjTeSoIL/VEtX0j\n\tbP6A==","X-Gm-Message-State":"AHPjjUi5/SJeq9POwW0E5TPfqnkloehHcYq09SAAby4bf+uR2aDUIH3R\n\twGqLcTj7rYTrchhKIOAZcHxZTBAwow==","X-Google-Smtp-Source":"ADKCNb5/QI2r7HLN7W6tpk43ZldHY3MUcbO+UdDm9DTAAlF3RFycLbt/DzkFh21a9Gv2fg1CN1Zo8wo7recVpwsicMs=","X-Received":"by 10.202.107.80 with SMTP id g77mr572515oic.269.1504731849833; \n\tWed, 06 Sep 2017 14:04:09 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170906080751.6773-2-brendanhiggins@google.com>","References":"<20170906080751.6773-1-brendanhiggins@google.com>\n\t<20170906080751.6773-2-brendanhiggins@google.com>","From":"Avi Fishman <avifishman70@gmail.com>","Date":"Thu, 7 Sep 2017 00:04:09 +0300","Message-ID":"<CAKKbWA4OXL__VWzwRvN_wujDc70zWqmGPcu2_WRpvsSUYba1Qg@mail.gmail.com>","Subject":"Re: [PATCH v4 1/3] arm: npcm: add basic support for Nuvoton BMCs","To":"Brendan Higgins <brendanhiggins@google.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170906_140432_113390_CA25F83E ","X-CRM114-Status":"GOOD (  19.87  )","X-Spam-Score":"-1.8 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.8 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends\n\tin digit (avifishman70[at]gmail.com)\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (avifishman70[at]gmail.com)\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"mark.rutland@arm.com, devicetree@vger.kernel.org, f.fainelli@gmail.com, \n\ttmaimon77@gmail.com, openbmc@lists.ozlabs.org, linux@armlinux.org.uk,\n\tlinux-kernel@vger.kernel.org, robh+dt@kernel.org, joel@jms.id.au,\n\traltherr@google.com, linux-arm-kernel@lists.infradead.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1764503,"web_url":"http://patchwork.ozlabs.org/comment/1764503/","msgid":"<CAFd5g46fh3unYC8J3CyUg25=3XAbz+U-XC6ON7V9p5Nt0mLKgA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-07T05:09:05","subject":"Re: [PATCH v4 1/3] arm: npcm: add basic support for Nuvoton BMCs","submitter":{"id":69647,"url":"http://patchwork.ozlabs.org/api/people/69647/","name":"Brendan Higgins","email":"brendanhiggins@google.com"},"content":"On Wed, Sep 6, 2017 at 2:04 PM, Avi Fishman <avifishman70@gmail.com> wrote:\n> Sorry for sending again some mailing list rejected it due to HTML\n> involved (althoug I tried Plain Text), Trying again.\n>\n> 2017-09-06 11:07 GMT+03:00 Brendan Higgins <brendanhiggins@google.com>:\n>> Adds basic support for the Nuvoton NPCM750 BMC.\n>>\n>> Signed-off-by: Brendan Higgins <brendanhiggins@google.com>\n>> ---\n>>  arch/arm/Kconfig             |  2 +\n>>  arch/arm/Makefile            |  1 +\n>>  arch/arm/mach-npcm/Kconfig   | 50 +++++++++++++++++++++++++\n>>  arch/arm/mach-npcm/Makefile  |  3 ++\n>>  arch/arm/mach-npcm/headsmp.S | 17 +++++++++\n>>  arch/arm/mach-npcm/npcm7xx.c | 34 +++++++++++++++++\n>>  arch/arm/mach-npcm/platsmp.c | 89 ++++++++++++++++++++++++++++++++++++++++++++\n>>  7 files changed, 196 insertions(+)\n>>  create mode 100644 arch/arm/mach-npcm/Kconfig\n>>  create mode 100644 arch/arm/mach-npcm/Makefile\n>>  create mode 100644 arch/arm/mach-npcm/headsmp.S\n>>  create mode 100644 arch/arm/mach-npcm/npcm7xx.c\n>>  create mode 100644 arch/arm/mach-npcm/platsmp.c\n>>\n>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig\n>> index 61a0cb15067e..05543f1cfbde 100644\n>> --- a/arch/arm/Kconfig\n>> +++ b/arch/arm/Kconfig\n>> @@ -782,6 +782,8 @@ source \"arch/arm/mach-netx/Kconfig\"\n>>\n>>  source \"arch/arm/mach-nomadik/Kconfig\"\n>>\n>> +source \"arch/arm/mach-npcm/Kconfig\"\n>> +\n>>  source \"arch/arm/mach-nspire/Kconfig\"\n>>\n>>  source \"arch/arm/plat-omap/Kconfig\"\n>> diff --git a/arch/arm/Makefile b/arch/arm/Makefile\n>> index 47d3a1ab08d2..60ca50c7d762 100644\n>> --- a/arch/arm/Makefile\n>> +++ b/arch/arm/Makefile\n>> @@ -191,6 +191,7 @@ machine-$(CONFIG_ARCH_MEDIATEK)             += mediatek\n>>  machine-$(CONFIG_ARCH_MXS)             += mxs\n>>  machine-$(CONFIG_ARCH_NETX)            += netx\n>>  machine-$(CONFIG_ARCH_NOMADIK)         += nomadik\n>> +machine-$(CONFIG_ARCH_NPCM)            += npcm\n>>  machine-$(CONFIG_ARCH_NSPIRE)          += nspire\n>>  machine-$(CONFIG_ARCH_OXNAS)           += oxnas\n>>  machine-$(CONFIG_ARCH_OMAP1)           += omap1\n>> diff --git a/arch/arm/mach-npcm/Kconfig b/arch/arm/mach-npcm/Kconfig\n>> new file mode 100644\n>> index 000000000000..d47061855439\n>> --- /dev/null\n>> +++ b/arch/arm/mach-npcm/Kconfig\n>> @@ -0,0 +1,50 @@\n>> +menuconfig ARCH_NPCM\n>> +       bool \"Nuvoton NPCM Architecture\"\n>> +       select ARCH_REQUIRE_GPIOLIB\n>> +       select USE_OF\n>> +       select PINCTRL\n>> +       select PINCTRL_NPCM7XX\n>> +\n>> +if ARCH_NPCM\n>> +\n>> +comment \"NPCMX50 CPU type\"\n>> +\n>> +config CPU_NPCM750\n>> +       depends on ARCH_NPCM && ARCH_MULTI_V7\n>> +       bool \"Support for NPCM750 BMC CPU (Poleg)\"\n>> +       select CACHE_L2X0\n>> +       select CPU_V7\n>> +       select ARM_GIC\n>> +       select HAVE_SMP\n>> +       select SMP\n>> +       select SMP_ON_UP\n>> +       select HAVE_ARM_SCU\n>> +       select HAVE_ARM_TWD if SMP\n>> +       select ARM_ERRATA_458693\n>> +       select ARM_ERRATA_720789\n>> +       select ARM_ERRATA_742231\n>> +       select ARM_ERRATA_754322\n>> +       select ARM_ERRATA_764369\n>> +       select ARM_ERRATA_794072\n>> +       select PL310_ERRATA_588369\n>> +       select PL310_ERRATA_727915\n>> +       select USB_EHCI_ROOT_HUB_TT\n>> +       select USB_ARCH_HAS_HCD\n>> +       select USB_ARCH_HAS_EHCI\n>> +       select USB_EHCI_HCD\n>> +       select USB_ARCH_HAS_OHCI\n>> +       select USB_OHCI_HCD\n>> +       select USB\n>> +       select FIQ\n>> +       select CPU_USE_DOMAINS\n>> +       select GENERIC_CLOCKEVENTS\n>> +       select CLKDEV_LOOKUP\n>> +       select COMMON_CLK if OF\n>> +       select NPCM750_TIMER\n>> +       select MFD_SYSCON\n>> +       help\n>> +         Support for NPCM750 BMC CPU (Poleg).\n>> +\n>> +         Nuvoton NPCM750 BMC based on the Cortex A9.\n>> +\n>> +endif\n>> diff --git a/arch/arm/mach-npcm/Makefile b/arch/arm/mach-npcm/Makefile\n>> new file mode 100644\n>> index 000000000000..78416055b854\n>> --- /dev/null\n>> +++ b/arch/arm/mach-npcm/Makefile\n>> @@ -0,0 +1,3 @@\n>> +AFLAGS_headsmp.o               += -march=armv7-a\n>> +\n>> +obj-$(CONFIG_CPU_NPCM750)      += npcm7xx.o platsmp.o headsmp.o\n>> diff --git a/arch/arm/mach-npcm/headsmp.S b/arch/arm/mach-npcm/headsmp.S\n>> new file mode 100644\n>> index 000000000000..9fccbbd49ed4\n>> --- /dev/null\n>> +++ b/arch/arm/mach-npcm/headsmp.S\n>> @@ -0,0 +1,17 @@\n>> +/*\n>> + * Copyright 2017 Google, Inc.\n>> + *\n>> + * This program is free software; you can redistribute it and/or modify\n>> + * it under the terms of the GNU General Public License version 2 as\n>> + * published by the Free Software Foundation.\n>> + */\n>> +\n>> +#include <linux/linkage.h>\n>> +#include <linux/init.h>\n>> +#include <asm/assembler.h>\n>> +\n>> +ENTRY(npcm7xx_secondary_startup)\n>> +       safe_svcmode_maskall r0\n>\n> I saw you  answered to Florian Fainelli that the BootRom is not\n> starting the secondary CPU in SVC mode. Are you sure? In our\n> engineering npcm7xx revision, Z1, the BootRom indeed started to run it\n> in IRQ mode but we fixed it in the production version, A1, (quite long\n> time ago), I hope you didn't get an EB with Z1 you can check that in\n> BootBlock console print:\n>> ADC CLK is set to 25000000\n>>Last reset was CORST\n>>vgaioen=1 and mux gspi.\n>>A1 <<====== this is what you should see, if you see Z1 we need to replace your EB\n>\n\nNope, on boot it prints:\n\n>EB\n>Board manufacturer: Nuvoton\n\n> CPU CLK is 800000000\n> MC  CLK is 800000000\n\n> ADC CLK is set to 25000000\n>Last reset was PORST\n>vgaioen=1 and mux gspi.\n>A1\n>Skip PCI config.\n\nTo reproduce, all you have to do is delete\n\n>> +       safe_svcmode_maskall r0\n\nand the kernel will warn that the core is not starting in SVC mode\n\n>> +\n>> +       b       secondary_startup\n>> +ENDPROC(npcm7xx_secondary_startup)\n>> diff --git a/arch/arm/mach-npcm/npcm7xx.c b/arch/arm/mach-npcm/npcm7xx.c\n>> new file mode 100644\n>> index 000000000000..132e9d587857\n>> --- /dev/null\n>> +++ b/arch/arm/mach-npcm/npcm7xx.c\n>> @@ -0,0 +1,34 @@\n>> +/*\n>> + * Copyright (c) 2017 Nuvoton Technology corporation.\n>> + * Copyright 2017 Google, Inc.\n>> + *\n>> + * This program is free software; you can redistribute it and/or modify\n>> + * it under the terms of the GNU General Public License version 2 as\n>> + * published by the Free Software Foundation.\n>> + */\n>> +\n>> +#include <linux/kernel.h>\n>> +#include <linux/types.h>\n>> +#include <asm/mach/arch.h>\n>> +#include <asm/mach-types.h>\n>> +#include <asm/mach/map.h>\n>> +#include <asm/hardware/cache-l2x0.h>\n>> +\n>> +#define NPCM7XX_AUX_VAL (L310_AUX_CTRL_INSTR_PREFETCH |                               \\\n>> +                        L310_AUX_CTRL_DATA_PREFETCH |                         \\\n>> +                        L310_AUX_CTRL_NS_LOCKDOWN |                           \\\n>> +                        L310_AUX_CTRL_CACHE_REPLACE_RR |                      \\\n>> +                        L2C_AUX_CTRL_SHARED_OVERRIDE |                        \\\n>> +                        L310_AUX_CTRL_FULL_LINE_ZERO)\n>> +\n>> +static const char *const npcm7xx_dt_match[] = {\n>> +       \"nuvoton,npcm750\",\n>> +       NULL\n>> +};\n>> +\n>> +DT_MACHINE_START(NPCM7XX_DT, \"NPCMX50 Chip family\")\n>> +       .atag_offset    = 0x100,\n>> +       .dt_compat      = npcm7xx_dt_match,\n>> +       .l2c_aux_val    = NPCM7XX_AUX_VAL,\n>> +       .l2c_aux_mask   = ~NPCM7XX_AUX_VAL,\n>> +MACHINE_END\n>> diff --git a/arch/arm/mach-npcm/platsmp.c b/arch/arm/mach-npcm/platsmp.c\n>> new file mode 100644\n>> index 000000000000..144e3e7ec7e6\n>> --- /dev/null\n>> +++ b/arch/arm/mach-npcm/platsmp.c\n>> @@ -0,0 +1,89 @@\n>> +/*\n>> + * Copyright 2017 Google, Inc.\n>> + *\n>> + * This program is free software; you can redistribute it and/or modify\n>> + * it under the terms of the GNU General Public License version 2 as\n>> + * published by the Free Software Foundation.\n>> + */\n>> +\n>> +#define pr_fmt(fmt) \"PLATSMP: \" fmt\n>> +\n>> +#include <linux/delay.h>\n>> +#include <linux/device.h>\n>> +#include <linux/smp.h>\n>> +#include <linux/io.h>\n>> +#include <linux/of.h>\n>> +#include <linux/of_device.h>\n>> +#include <linux/of_platform.h>\n>> +#include <linux/of_address.h>\n>> +#include <asm/cacheflush.h>\n>> +#include <asm/smp.h>\n>> +#include <asm/smp_plat.h>\n>> +#include <asm/smp_scu.h>\n>> +\n>> +#define NPCM7XX_SCRPAD_REG 0x13c\n>> +\n>> +extern void npcm7xx_secondary_startup(void);\n>> +\n>> +static int npcm7xx_smp_boot_secondary(unsigned int cpu,\n>> +                                     struct task_struct *idle)\n>> +{\n>> +       struct device_node *gcr_np;\n>> +       void __iomem *gcr_base;\n>> +       int ret = 0;\n>> +\n>> +       gcr_np = of_find_compatible_node(NULL, NULL, \"nuvoton,npcm750-gcr\");\n>> +       if (!gcr_np) {\n>> +               pr_err(\"no gcr device node\\n\");\n>> +               ret = -EFAULT;\n>> +               goto out;\n>> +       }\n>> +       gcr_base = of_iomap(gcr_np, 0);\n>> +       if (!gcr_base) {\n>> +               pr_err(\"could not iomap gcr at: 0x%llx\\n\", gcr_base);\n>> +               ret = -EFAULT;\n>> +               goto out;\n>> +       }\n>> +\n>> +       /* give boot ROM kernel start address. */\n>> +       iowrite32(__pa_symbol(npcm7xx_secondary_startup), gcr_base +\n>> +                 NPCM7XX_SCRPAD_REG);\n>> +       /* make sure npcm7xx_secondary_startup is seen by all observers. */\n>> +       smp_wmb();\n>> +       dsb_sev();\n>> +       /* make sure write buffer is drained */\n>> +       mb();\n>> +\n>> +out:\n>> +       iounmap(gcr_base);\n>> +       return ret;\n>> +}\n>> +\n>> +static void __init npcm7xx_smp_prepare_cpus(unsigned int max_cpus)\n>> +{\n>> +       struct device_node *scu_np;\n>> +       void __iomem *scu_base;\n>> +\n>> +       scu_np = of_find_compatible_node(NULL, NULL, \"arm,cortex-a9-scu\");\n>> +       if (!scu_np) {\n>> +               pr_err(\"no scu device node\\n\");\n>> +               return;\n>> +       }\n>> +       scu_base = of_iomap(scu_np, 0);\n>> +       if (!scu_base) {\n>> +               pr_err(\"could not iomap scu at: 0x%llx\\n\", scu_base);\n>> +               return;\n>> +       }\n>> +\n>> +       scu_enable(scu_base);\n>> +\n>> +out:\n>> +       iounmap(scu_base);\n>> +}\n>> +\n>> +static struct smp_operations npcm7xx_smp_ops __initdata = {\n>> +       .smp_prepare_cpus = npcm7xx_smp_prepare_cpus,\n>> +       .smp_boot_secondary = npcm7xx_smp_boot_secondary,\n>> +};\n>> +\n>> +CPU_METHOD_OF_DECLARE(npcm7xx_smp, \"nuvoton,npcm7xx-smp\", &npcm7xx_smp_ops);\n>> --\n>> 2.14.1.581.gf28d330327-goog\n>>","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"cHVWPfQ4\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"Es++FaGg\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnpR83D0Hz9s82\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 15:09:40 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dpp4K-0008RG-8N; Thu, 07 Sep 2017 05:09:36 +0000","from mail-qk0-x231.google.com ([2607:f8b0:400d:c09::231])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dpp4D-0008I9-AA for linux-arm-kernel@lists.infradead.org;\n\tThu, 07 Sep 2017 05:09:33 +0000","by mail-qk0-x231.google.com with SMTP id b23so24552846qkg.1\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tWed, 06 Sep 2017 22:09:07 -0700 (PDT)","by 10.140.33.230 with HTTP; Wed, 6 Sep 2017 22:09:05 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:\n\tReferences:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=ZFQc64j3UAw3qFmFgPAmnjpnPmxgFsMp+sdPUpMcVgo=;\n\tb=cHVWPfQ4w39HLd\n\tSHMr5FJfFZhIXdlJSV4XqlezWNjdyns2KMiRn+CHHfQtPWNfELNNSH8ZtTt8iMGG3JCRPJtnUmB41\n\tR4Lt0zd6qnn5/H3L2TofBW2+++1A6xwJKom855Wq+YLAhWZHzd9JTp9cjGfHF3RDNqpqxDBnhDNy9\n\tesSSOcKFebYZSqo4PTrMUntsfIGw5YMpGdh05j9LoYCai7PW8zXsRKZMzKpVr5ha9B4r//S6QH5Hn\n\txESfnfmXHxIiezO4joESM0aVnYWO60fDEQ11PY7LDNz6GmuaFU4w0Nm8kIpZt/RDcKAFG0XM90/yw\n\tntvYRRMy8SpHV4Zrdkiw==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=20161025; \n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=21mflyth2fp3oGWI92lIVOVvQ13TXfrI/COiikaX6UI=;\n\tb=Es++FaGgrh3QWPU1dPlbBUyMoGwZ9wrmngkbE0R3C94Oiq9nCzoBYVH08g6YUDPvf5\n\tGFtrfErjQMI84LqQMnEzlYhzS84Hshn9W5qkyWV4OfwmRiHw8Xdhw0tJpYbYH0ok3NRd\n\tJSBIVkFAnyOphmGwc2hOrh5t7HTPhv20JzoGr0+RqUZap/Ae1g8uBBlu3yWQQ0S3R+D9\n\t0Oz4RO8Y5jQjZOMIR9Ny6rZyZkC9bswuSaTq5AqpOK8P2nYL3GNCQwkOtoyOIQ7Ewd9h\n\trKavGvtk6Kqrfdc/FhNigz2FfA09G5L1KotWSDQMDLSqvHfby9GxXiP7CV7QiC50Fp29\n\tvXLA=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=21mflyth2fp3oGWI92lIVOVvQ13TXfrI/COiikaX6UI=;\n\tb=C1f00YZHpwP1YGyjCis7RyqBFx7gItWqjZ8ZluSMsGOu3+D3ygfJvSUTzIIyKKP21g\n\tI4iS9nAekE0B+SvykHM9SffPvlMI6TDluXSGDR0tIvUBpuwY+lJQXHtHwYj0wnZUbA6b\n\t5gZbMT3VBbqjxm40MPqDhJfVFtUcqnoOUSsBH6R1EujWrN2D43GbIwlfGvjkSTt0qbXW\n\toK+Ad+Kmls0iXuUT/DbGdj1Vft7j7r1KtjXgDSAoe2hRUkIEMLOHmLR16B3kOzgliDvO\n\t5OoxyIfSrNiFnft49XsG3VuTMG+NwddUd3hqmbYk1GppTMesOU2DCURuSdE+O3kUbFVK\n\ts+ug==","X-Gm-Message-State":"AHPjjUiz7zG3ncajM43IvFS/7ojkCGZOO6n3eYaKdfnCsjzJuq0tfZwH\n\tqsPXN8f0sXqHPWxY7gPGyDCcYhoD/Xeb","X-Google-Smtp-Source":"ADKCNb65m+w77/z6ajzz7+JZNwT252yWnon88SVQk5teK84lnY++vzqQRbOjkFsBN6Y9b3FX0Q5T3G7+T0Fxd40lpn8=","X-Received":"by 10.233.235.17 with SMTP id b17mr1870111qkg.254.1504760946271; \n\tWed, 06 Sep 2017 22:09:06 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<CAKKbWA4OXL__VWzwRvN_wujDc70zWqmGPcu2_WRpvsSUYba1Qg@mail.gmail.com>","References":"<20170906080751.6773-1-brendanhiggins@google.com>\n\t<20170906080751.6773-2-brendanhiggins@google.com>\n\t<CAKKbWA4OXL__VWzwRvN_wujDc70zWqmGPcu2_WRpvsSUYba1Qg@mail.gmail.com>","From":"Brendan Higgins <brendanhiggins@google.com>","Date":"Wed, 6 Sep 2017 22:09:05 -0700","Message-ID":"<CAFd5g46fh3unYC8J3CyUg25=3XAbz+U-XC6ON7V9p5Nt0mLKgA@mail.gmail.com>","Subject":"Re: [PATCH v4 1/3] arm: npcm: add basic support for Nuvoton BMCs","To":"Avi Fishman <avifishman70@gmail.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170906_220929_620334_7E2EB0A8 ","X-CRM114-Status":"GOOD (  21.55  )","X-Spam-Score":"-2.7 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.7 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow\n\ttrust [2607:f8b0:400d:c09:0:0:0:231 listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"Mark Rutland <mark.rutland@arm.com>,\n\tdevicetree <devicetree@vger.kernel.org>,\n\tFlorian Fainelli <f.fainelli@gmail.com>, tmaimon77@gmail.com,\n\tOpenBMC Maillist <openbmc@lists.ozlabs.org>,\n\tRussell King <linux@armlinux.org.uk>,\n\tLinux Kernel Mailing List <linux-kernel@vger.kernel.org>,\n\tRob Herring <robh+dt@kernel.org>, Joel Stanley <joel@jms.id.au>,\n\tRick Altherr <raltherr@google.com>, linux-arm-kernel@lists.infradead.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1764527,"web_url":"http://patchwork.ozlabs.org/comment/1764527/","msgid":"<1504764598.24443.18.camel@jms.id.au>","list_archive_url":null,"date":"2017-09-07T06:09:58","subject":"Re: [PATCH v4 2/3] arm: dts: add Nuvoton NPCM750 device tree","submitter":{"id":48628,"url":"http://patchwork.ozlabs.org/api/people/48628/","name":"Joel Stanley","email":"joel@jms.id.au"},"content":"On Wed, 2017-09-06 at 01:07 -0700, Brendan Higgins wrote:\n> Add a common device tree for all Nuvoton NPCM750 BMCs and a board\n> specific device tree for the NPCM750 (Poleg) evaluation board.\n> \n> Signed-off-by: Brendan Higgins <brendanhiggins@google.com>\n> Reviewed-by: Tomer Maimon <tmaimon77@gmail.com>\n> Reviewed-by: Avi Fishman <avifishman70@gmail.com>\n> Tested-by: Tomer Maimon <tmaimon77@gmail.com>\n> Tested-by: Avi Fishman <avifishman70@gmail.com>\n\nReviewed-by: Joel Stanley <joel@jms.id.au>","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"RjdtkeXZ\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"aKULhm+Z\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnqnZ237bz9t2M\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 16:10:39 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dpq1I-00052i-Qf; Thu, 07 Sep 2017 06:10:32 +0000","from mail-io0-x244.google.com ([2607:f8b0:4001:c06::244])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dpq1F-000427-GJ for linux-arm-kernel@lists.infradead.org;\n\tThu, 07 Sep 2017 06:10:31 +0000","by mail-io0-x244.google.com with SMTP id y123so435496iod.0\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tWed, 06 Sep 2017 23:10:07 -0700 (PDT)","from aurora ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id\n\tk199sm827164ioe.51.2017.09.06.23.10.01\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 06 Sep 2017 23:10:05 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To:\n\tDate:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=O4UO2JyQBMmGpHj1RDGDgobTwP8d7zcrdmdNBS9/Wao=;\n\tb=RjdtkeXZLWYHUV\n\tJhZra+ADiR1uDEUwXzzQX7mJZI+1vL0XDnq7ApohKqdY6AA66IFH1Ko8cMWISNiYyD8GXOf/Ysg7M\n\t0fVJxUbyZ4roRYIkVxRzVGwPBgAKaY/nN6uTEf+PdA0ifRymPrI4X9HNQsHW7U6ElRsfFQ8uyf7bB\n\tCOknBdl6AKjpTMZJMTyjh7CESWMmDVkGzvgtZDGZwvaKemFNGCIGVCcqvb10zRDZDIsd52MS9TZR4\n\tUc9oLrvnfR+0YA1/DohNtBJ2zKggP2dLPZ3hxHPoEztmipOYi9qKRFcwQj6SVAcxxz6pvfqgoW7+m\n\t0I0GS0A4LrW5kn4gwQiw==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:message-id:subject:from:to:cc:date:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=votPbZ/1fTKrMVdo5rG0i0OUpwi47/MVxcK3rxjniXo=;\n\tb=aKULhm+ZD7DqQylpTXfHTSqkQPnAcoN/XCLENIJR76w6NVeZ+4W4EqYoRLzb8LFFUj\n\tepobBDMp7dG6L+VyYbqND0jlFtUjlYj9jGjRIC+jzmA+WeyzB+gmWnNrDEXNH52w9lDk\n\tbHkN/+AaBmQuZxUg+gJSKlV9Gau/jivmFufw2Smk5IYH74gUHbPs8jRcqRcWlbkXlrH2\n\tWQAOdQcy/RnGqSE/orI0q0WKZQXSFDguc+MOVb05sAvk8AqW+g1Y0MTNxHdP4msDWRDN\n\tPHBE7UJhy/tPfCuj3wapVjQgiBC94pCyfeJ84PgcZNbawP+x4vsthXarjnhgWeC5LObP\n\t7mXA=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:message-id:subject:from:to:cc:date\n\t:in-reply-to:references:mime-version:content-transfer-encoding;\n\tbh=votPbZ/1fTKrMVdo5rG0i0OUpwi47/MVxcK3rxjniXo=;\n\tb=BGThTE2sf0NIpFhilH4o+8OWW2DWtl9PWTKoojaQn8jUqyJKHA8CeKdnWEmQVKPJcV\n\tBaV5DZX9BlqLqcmXuhCY54nh+mISkZ8woj2RPVimAwYKw4nJqdogbei/0xijy0snSKWo\n\tH9g97RTLDEFELyl0nvE2iCFNK2nsoFAr2qltMjQyUOr6hYdod36ftdaw70u9tpyBusgU\n\tS4nI6IXqo6VHk5NQuEPuhjhd5J8QOxTS1d2IR0nyZrlKsf860aykCWDQRWl26NqYsmrL\n\tWtZpvdI5I/bbyVj6iuppC8w+xgu9Ixb+9P3eX7+jOhVlCCRuUl9VmsOEzT+BkUcWJ7GE\n\tqH2g==","X-Gm-Message-State":"AHPjjUg/nuWKAaCfR1HH2XBzSk/yj3uGtLS1RXbVChcEcZM3t2u/qQb1\n\t4cqWK8azPh5Avg==","X-Google-Smtp-Source":"AOwi7QBMdf5JX2bGpRGqjzrTtOMkZhQtuBQncgAe9E+ltGrKX4lj2Y09nCl/J01FE+7QXDCAtZSnPg==","X-Received":"by 10.107.53.158 with SMTP id k30mr1738797ioo.338.1504764606970; \n\tWed, 06 Sep 2017 23:10:06 -0700 (PDT)","Message-ID":"<1504764598.24443.18.camel@jms.id.au>","Subject":"Re: [PATCH v4 2/3] arm: dts: add Nuvoton NPCM750 device tree","From":"Joel Stanley <joel@jms.id.au>","To":"Brendan Higgins <brendanhiggins@google.com>, robh+dt@kernel.org, \n\tmark.rutland@arm.com, linux@armlinux.org.uk, avifishman70@gmail.com, \n\ttmaimon77@gmail.com, raltherr@google.com, f.fainelli@gmail.com","Date":"Thu, 07 Sep 2017 16:09:58 +1000","In-Reply-To":"<20170906080751.6773-3-brendanhiggins@google.com>","References":"<20170906080751.6773-1-brendanhiggins@google.com>\n\t<20170906080751.6773-3-brendanhiggins@google.com>","X-Mailer":"Evolution 3.25.92.2-1 ","Mime-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170906_231029_595352_E1915F11 ","X-CRM114-Status":"UNSURE (   7.17  )","X-CRM114-Notice":"Please train this message.","X-Spam-Score":"-1.7 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.7 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (joel.stan[at]gmail.com)\n\t0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level\n\tmail domains are different\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and\n\tEnvelopeFrom freemail headers are different","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"devicetree@vger.kernel.org, openbmc@lists.ozlabs.org,\n\tlinux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1764604,"web_url":"http://patchwork.ozlabs.org/comment/1764604/","msgid":"<CAP6Zq1jf81tvG_F1aDN+1QdWg=c2v2spkb9gi-Z8-e5=9pMd0g@mail.gmail.com>","list_archive_url":null,"date":"2017-09-07T09:18:47","subject":"Re: [PATCH v4 1/3] arm: npcm: add basic support for Nuvoton BMCs","submitter":{"id":72291,"url":"http://patchwork.ozlabs.org/api/people/72291/","name":"Tomer Maimon","email":"tmaimon77@gmail.com"},"content":"On 6 September 2017 at 11:07, Brendan Higgins <brendanhiggins@google.com> wrote:\n> Adds basic support for the Nuvoton NPCM750 BMC.\n>\n> Signed-off-by: Brendan Higgins <brendanhiggins@google.com>\n> ---\n>  arch/arm/Kconfig             |  2 +\n>  arch/arm/Makefile            |  1 +\n>  arch/arm/mach-npcm/Kconfig   | 50 +++++++++++++++++++++++++\n>  arch/arm/mach-npcm/Makefile  |  3 ++\n>  arch/arm/mach-npcm/headsmp.S | 17 +++++++++\n>  arch/arm/mach-npcm/npcm7xx.c | 34 +++++++++++++++++\n>  arch/arm/mach-npcm/platsmp.c | 89 ++++++++++++++++++++++++++++++++++++++++++++\n>  7 files changed, 196 insertions(+)\n>  create mode 100644 arch/arm/mach-npcm/Kconfig\n>  create mode 100644 arch/arm/mach-npcm/Makefile\n>  create mode 100644 arch/arm/mach-npcm/headsmp.S\n>  create mode 100644 arch/arm/mach-npcm/npcm7xx.c\n>  create mode 100644 arch/arm/mach-npcm/platsmp.c\n>\n> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig\n> index 61a0cb15067e..05543f1cfbde 100644\n> --- a/arch/arm/Kconfig\n> +++ b/arch/arm/Kconfig\n> @@ -782,6 +782,8 @@ source \"arch/arm/mach-netx/Kconfig\"\n>\n>  source \"arch/arm/mach-nomadik/Kconfig\"\n>\n> +source \"arch/arm/mach-npcm/Kconfig\"\n> +\n>  source \"arch/arm/mach-nspire/Kconfig\"\n>\n>  source \"arch/arm/plat-omap/Kconfig\"\n> diff --git a/arch/arm/Makefile b/arch/arm/Makefile\n> index 47d3a1ab08d2..60ca50c7d762 100644\n> --- a/arch/arm/Makefile\n> +++ b/arch/arm/Makefile\n> @@ -191,6 +191,7 @@ machine-$(CONFIG_ARCH_MEDIATEK)             += mediatek\n>  machine-$(CONFIG_ARCH_MXS)             += mxs\n>  machine-$(CONFIG_ARCH_NETX)            += netx\n>  machine-$(CONFIG_ARCH_NOMADIK)         += nomadik\n> +machine-$(CONFIG_ARCH_NPCM)            += npcm\n>  machine-$(CONFIG_ARCH_NSPIRE)          += nspire\n>  machine-$(CONFIG_ARCH_OXNAS)           += oxnas\n>  machine-$(CONFIG_ARCH_OMAP1)           += omap1\n> diff --git a/arch/arm/mach-npcm/Kconfig b/arch/arm/mach-npcm/Kconfig\n> new file mode 100644\n> index 000000000000..d47061855439\n> --- /dev/null\n> +++ b/arch/arm/mach-npcm/Kconfig\n> @@ -0,0 +1,50 @@\n> +menuconfig ARCH_NPCM\n> +       bool \"Nuvoton NPCM Architecture\"\n> +       select ARCH_REQUIRE_GPIOLIB\n> +       select USE_OF\n> +       select PINCTRL\n> +       select PINCTRL_NPCM7XX\n> +\n> +if ARCH_NPCM\n> +\n> +comment \"NPCMX50 CPU type\"\n> +\n> +config CPU_NPCM750\n> +       depends on ARCH_NPCM && ARCH_MULTI_V7\n> +       bool \"Support for NPCM750 BMC CPU (Poleg)\"\n> +       select CACHE_L2X0\n> +       select CPU_V7\n> +       select ARM_GIC\n> +       select HAVE_SMP\n> +       select SMP\n> +       select SMP_ON_UP\n> +       select HAVE_ARM_SCU\n> +       select HAVE_ARM_TWD if SMP\n> +       select ARM_ERRATA_458693\n> +       select ARM_ERRATA_720789\n> +       select ARM_ERRATA_742231\n> +       select ARM_ERRATA_754322\n> +       select ARM_ERRATA_764369\n> +       select ARM_ERRATA_794072\n> +       select PL310_ERRATA_588369\n> +       select PL310_ERRATA_727915\n> +       select USB_EHCI_ROOT_HUB_TT\n> +       select USB_ARCH_HAS_HCD\n> +       select USB_ARCH_HAS_EHCI\n> +       select USB_EHCI_HCD\n> +       select USB_ARCH_HAS_OHCI\n> +       select USB_OHCI_HCD\n> +       select USB\n> +       select FIQ\n> +       select CPU_USE_DOMAINS\n> +       select GENERIC_CLOCKEVENTS\n> +       select CLKDEV_LOOKUP\n> +       select COMMON_CLK if OF\n> +       select NPCM750_TIMER\n> +       select MFD_SYSCON\n> +       help\n> +         Support for NPCM750 BMC CPU (Poleg).\n> +\n> +         Nuvoton NPCM750 BMC based on the Cortex A9.\n> +\n> +endif\n> diff --git a/arch/arm/mach-npcm/Makefile b/arch/arm/mach-npcm/Makefile\n> new file mode 100644\n> index 000000000000..78416055b854\n> --- /dev/null\n> +++ b/arch/arm/mach-npcm/Makefile\n> @@ -0,0 +1,3 @@\n> +AFLAGS_headsmp.o               += -march=armv7-a\n> +\n> +obj-$(CONFIG_CPU_NPCM750)      += npcm7xx.o platsmp.o headsmp.o\n> diff --git a/arch/arm/mach-npcm/headsmp.S b/arch/arm/mach-npcm/headsmp.S\n> new file mode 100644\n> index 000000000000..9fccbbd49ed4\n> --- /dev/null\n> +++ b/arch/arm/mach-npcm/headsmp.S\n> @@ -0,0 +1,17 @@\n> +/*\n> + * Copyright 2017 Google, Inc.\n> + *\n> + * This program is free software; you can redistribute it and/or modify\n> + * it under the terms of the GNU General Public License version 2 as\n> + * published by the Free Software Foundation.\n> + */\n> +\n> +#include <linux/linkage.h>\n> +#include <linux/init.h>\n> +#include <asm/assembler.h>\n> +\n> +ENTRY(npcm7xx_secondary_startup)\n> +       safe_svcmode_maskall r0\n> +\n> +       b       secondary_startup\n> +ENDPROC(npcm7xx_secondary_startup)\n> diff --git a/arch/arm/mach-npcm/npcm7xx.c b/arch/arm/mach-npcm/npcm7xx.c\n> new file mode 100644\n> index 000000000000..132e9d587857\n> --- /dev/null\n> +++ b/arch/arm/mach-npcm/npcm7xx.c\n> @@ -0,0 +1,34 @@\n> +/*\n> + * Copyright (c) 2017 Nuvoton Technology corporation.\n> + * Copyright 2017 Google, Inc.\n> + *\n> + * This program is free software; you can redistribute it and/or modify\n> + * it under the terms of the GNU General Public License version 2 as\n> + * published by the Free Software Foundation.\n> + */\n> +\n> +#include <linux/kernel.h>\n> +#include <linux/types.h>\n> +#include <asm/mach/arch.h>\n> +#include <asm/mach-types.h>\n> +#include <asm/mach/map.h>\n> +#include <asm/hardware/cache-l2x0.h>\n> +\n> +#define NPCM7XX_AUX_VAL (L310_AUX_CTRL_INSTR_PREFETCH |                               \\\n> +                        L310_AUX_CTRL_DATA_PREFETCH |                         \\\n> +                        L310_AUX_CTRL_NS_LOCKDOWN |                           \\\n> +                        L310_AUX_CTRL_CACHE_REPLACE_RR |                      \\\n> +                        L2C_AUX_CTRL_SHARED_OVERRIDE |                        \\\n> +                        L310_AUX_CTRL_FULL_LINE_ZERO)\n> +\n> +static const char *const npcm7xx_dt_match[] = {\n> +       \"nuvoton,npcm750\",\n> +       NULL\n> +};\n> +\n> +DT_MACHINE_START(NPCM7XX_DT, \"NPCMX50 Chip family\")\n> +       .atag_offset    = 0x100,\n> +       .dt_compat      = npcm7xx_dt_match,\n> +       .l2c_aux_val    = NPCM7XX_AUX_VAL,\n> +       .l2c_aux_mask   = ~NPCM7XX_AUX_VAL,\n> +MACHINE_END\n> diff --git a/arch/arm/mach-npcm/platsmp.c b/arch/arm/mach-npcm/platsmp.c\n> new file mode 100644\n> index 000000000000..144e3e7ec7e6\n> --- /dev/null\n> +++ b/arch/arm/mach-npcm/platsmp.c\n> @@ -0,0 +1,89 @@\n> +/*\n> + * Copyright 2017 Google, Inc.\n> + *\n> + * This program is free software; you can redistribute it and/or modify\n> + * it under the terms of the GNU General Public License version 2 as\n> + * published by the Free Software Foundation.\n> + */\n> +\n> +#define pr_fmt(fmt) \"PLATSMP: \" fmt\n> +\n> +#include <linux/delay.h>\n> +#include <linux/device.h>\n> +#include <linux/smp.h>\n> +#include <linux/io.h>\n> +#include <linux/of.h>\n> +#include <linux/of_device.h>\n> +#include <linux/of_platform.h>\n> +#include <linux/of_address.h>\n> +#include <asm/cacheflush.h>\n> +#include <asm/smp.h>\n> +#include <asm/smp_plat.h>\n> +#include <asm/smp_scu.h>\n> +\n> +#define NPCM7XX_SCRPAD_REG 0x13c\n> +\n> +extern void npcm7xx_secondary_startup(void);\n> +\n> +static int npcm7xx_smp_boot_secondary(unsigned int cpu,\n> +                                     struct task_struct *idle)\n> +{\n> +       struct device_node *gcr_np;\n> +       void __iomem *gcr_base;\n> +       int ret = 0;\n> +\n> +       gcr_np = of_find_compatible_node(NULL, NULL, \"nuvoton,npcm750-gcr\");\n> +       if (!gcr_np) {\n> +               pr_err(\"no gcr device node\\n\");\n> +               ret = -EFAULT;\n> +               goto out;\n> +       }\n> +       gcr_base = of_iomap(gcr_np, 0);\n> +       if (!gcr_base) {\n> +               pr_err(\"could not iomap gcr at: 0x%llx\\n\", gcr_base);\n> +               ret = -EFAULT;\n> +               goto out;\n> +       }\n> +\n> +       /* give boot ROM kernel start address. */\n> +       iowrite32(__pa_symbol(npcm7xx_secondary_startup), gcr_base +\n> +                 NPCM7XX_SCRPAD_REG);\n> +       /* make sure npcm7xx_secondary_startup is seen by all observers. */\n> +       smp_wmb();\n> +       dsb_sev();\n> +       /* make sure write buffer is drained */\n> +       mb();\n> +\n> +out:\n> +       iounmap(gcr_base);\n> +       return ret;\n> +}\n> +\n> +static void __init npcm7xx_smp_prepare_cpus(unsigned int max_cpus)\n> +{\n> +       struct device_node *scu_np;\n> +       void __iomem *scu_base;\n> +\n> +       scu_np = of_find_compatible_node(NULL, NULL, \"arm,cortex-a9-scu\");\n> +       if (!scu_np) {\n> +               pr_err(\"no scu device node\\n\");\n> +               return;\n> +       }\n> +       scu_base = of_iomap(scu_np, 0);\n> +       if (!scu_base) {\n> +               pr_err(\"could not iomap scu at: 0x%llx\\n\", scu_base);\n> +               return;\n> +       }\n> +\n> +       scu_enable(scu_base);\n> +\n> +out:\n> +       iounmap(scu_base);\n> +}\n> +\n> +static struct smp_operations npcm7xx_smp_ops __initdata = {\n> +       .smp_prepare_cpus = npcm7xx_smp_prepare_cpus,\n> +       .smp_boot_secondary = npcm7xx_smp_boot_secondary,\n> +};\n> +\n> +CPU_METHOD_OF_DECLARE(npcm7xx_smp, \"nuvoton,npcm7xx-smp\", &npcm7xx_smp_ops);\n> --\n> 2.14.1.581.gf28d330327-goog\n>\n\nReviewed-by: Tomer Maimon <tmaimon77@gmail.com>\nReviewed-by: Avi Fishman <avifishman70@gmail.com>\nTested-by: Tomer Maimon <tmaimon77@gmail.com>\nTested-by: Avi Fishman <avifishman70@gmail.com>","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"MqnU/MQ0\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"dKaKuui7\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnvzG1JJkz9sNV\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 19:19:21 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dpsxx-0005oR-Vm; Thu, 07 Sep 2017 09:19:18 +0000","from mail-ua0-x243.google.com ([2607:f8b0:400c:c08::243])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dpsxt-0005lO-2G for linux-arm-kernel@lists.infradead.org;\n\tThu, 07 Sep 2017 09:19:15 +0000","by mail-ua0-x243.google.com with SMTP id c27so2942546uah.1\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tThu, 07 Sep 2017 02:18:48 -0700 (PDT)","by 10.176.90.193 with HTTP; Thu, 7 Sep 2017 02:18:47 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:\n\tReferences:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=TX+VvsA338FVwe4RYRMcwScoSly5k+atRTnrntTCYI4=;\n\tb=MqnU/MQ0tt2T8U\n\t+f9mnyJQ+74FP3Krt+O3Nr6hAW6Nzff7lHwS78RBJnhllCYYQS6ASKiID6+LRr7BLbvW1aNTk2DKZ\n\tOWMUMc8x5MAphtKX2QAfOpqjGyReZg4lQ6pvBdbjynNeEGJpJ8AqKZMF2vwJwxiDrraCPSUs5nCzf\n\tYwRM2krjhQp8VlBzWtkloyOy1LGNj4Mg85fCLwC+DtLKVIUFiia5AqrUIyS3nXbLp306hCIoqu+ei\n\trDiB4aY4TkQYz0gskLUPQBRD8m7QfTVhaqcKpLJ50WBWEAUI6DYmm9Lvl5PgZYOtA/aGhhfndahVk\n\tXFJNANTFIxq8cZP5tGTQ==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=B3eAaLs3tXuloC2xDp8UkQs6DPZay1j/6+GwpMEpnkM=;\n\tb=dKaKuui7GnH01EB/bLmdDpvxektrfPfB617pAfQ3V7KlmdCbcuwgRk6F7+rxpvKqXl\n\t0VKbVPWm71cm9apR+v/UPt0fiTqIFqGJ8SUwfUuilDRXH7qcVq7q459kNYipyjMHjFmt\n\trbUd6ZEjYVLSDVMThB+eiFTffLA5wJC1IUTFdk7+d5OFPoJcKArpQhbHiqmZwLq+lCn8\n\tiyB+R5hAPiVsiWctxjN6Yvwrv8yUR5BQbKbe5HopVbwfntZbSCarAbUPdGLNgRyvC21z\n\tgo4Arv9QzH3niZV5UtA4EF1GgJ76UY5VcmHAxiAG0e+0Vo+/SLHzzy8VG+3nKDu5bKxI\n\tFc5A=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=B3eAaLs3tXuloC2xDp8UkQs6DPZay1j/6+GwpMEpnkM=;\n\tb=ARDgZI9+91W17nJ66IF6w+MEXqEHUUISUfC5bmQD3l9TP8XHYOPNvPLYfasKeWMnjJ\n\txU+8eglgGwLDCSzZKF3lg3mXf6Do7wQa4CrZ7InMjTkWsIKFQqi1AbfydxKuiPJBmpsf\n\tTLIifaQKVyfvM417drQhJIcwbAr1YSNnLCEk2M8Jlrn1PXP0sYa0PlAVil/wD3eM+j0a\n\tibKNqY6477f5K8rTLdStOj8nHKoH7ID/k72tuiKQjLQyO2KVx7AVnGClsufrTtaHgi1C\n\tDXy+jpwjBaJYnk7KmR2rbC0TELNmUSPA9MakAzrVAUvKuf6X/eCKpR0Lry5CjkvM6LwZ\n\tUQyg==","X-Gm-Message-State":"AHPjjUgfLXwfSjMaeFf1//D+hPlCtPBKVKaa0zHj5iuBLmKSeSLTQ6ww\n\t5DBQZHsNv0wA0W/x0nACo2SW+6s7LQ==","X-Google-Smtp-Source":"ADKCNb4jvlrxgEJ/AiK9lAAboCC2ASaINJ3azMib3KZh1KoRsrV7QlaEQLwUiyPwVvDW22YsvzLcb3ZFs+l4fS43bFg=","X-Received":"by 10.176.71.202 with SMTP id w10mr1367876uac.79.1504775927762; \n\tThu, 07 Sep 2017 02:18:47 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170906080751.6773-2-brendanhiggins@google.com>","References":"<20170906080751.6773-1-brendanhiggins@google.com>\n\t<20170906080751.6773-2-brendanhiggins@google.com>","From":"Tomer Maimon <tmaimon77@gmail.com>","Date":"Thu, 7 Sep 2017 12:18:47 +0300","Message-ID":"<CAP6Zq1jf81tvG_F1aDN+1QdWg=c2v2spkb9gi-Z8-e5=9pMd0g@mail.gmail.com>","Subject":"Re: [PATCH v4 1/3] arm: npcm: add basic support for Nuvoton BMCs","To":"Brendan Higgins <brendanhiggins@google.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170907_021913_363586_ADE0913F ","X-CRM114-Status":"GOOD (  17.35  )","X-Spam-Score":"-1.8 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.8 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2607:f8b0:400c:c08:0:0:0:243 listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends\n\tin digit (tmaimon77[at]gmail.com)\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (tmaimon77[at]gmail.com)\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"mark.rutland@arm.com, devicetree@vger.kernel.org, f.fainelli@gmail.com, \n\tavifishman70@gmail.com, openbmc@lists.ozlabs.org, linux@armlinux.org.uk, \n\tlinux-kernel@vger.kernel.org, robh+dt@kernel.org, joel@jms.id.au,\n\tRick Altherr <raltherr@google.com>, linux-arm-kernel@lists.infradead.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1764778,"web_url":"http://patchwork.ozlabs.org/comment/1764778/","msgid":"<CAKKbWA4HSw3xXEhF5tf51UMM5Ch3OxnryjzGjw8tWb23o5cNYQ@mail.gmail.com>","list_archive_url":null,"date":"2017-09-07T15:09:06","subject":"Re: [PATCH v4 1/3] arm: npcm: add basic support for Nuvoton BMCs","submitter":{"id":72311,"url":"http://patchwork.ozlabs.org/api/people/72311/","name":"Avi Fishman","email":"avifishman70@gmail.com"},"content":"On Thu, Sep 7, 2017 at 8:09 AM, Brendan Higgins\n<brendanhiggins@google.com> wrote:\n> On Wed, Sep 6, 2017 at 2:04 PM, Avi Fishman <avifishman70@gmail.com> wrote:\n>> Sorry for sending again some mailing list rejected it due to HTML\n>> involved (althoug I tried Plain Text), Trying again.\n>>\n>> 2017-09-06 11:07 GMT+03:00 Brendan Higgins <brendanhiggins@google.com>:\n>>> Adds basic support for the Nuvoton NPCM750 BMC.\n>>>\n>>> Signed-off-by: Brendan Higgins <brendanhiggins@google.com>\n>>> ---\n>>>  arch/arm/Kconfig             |  2 +\n>>>  arch/arm/Makefile            |  1 +\n>>>  arch/arm/mach-npcm/Kconfig   | 50 +++++++++++++++++++++++++\n>>>  arch/arm/mach-npcm/Makefile  |  3 ++\n>>>  arch/arm/mach-npcm/headsmp.S | 17 +++++++++\n>>>  arch/arm/mach-npcm/npcm7xx.c | 34 +++++++++++++++++\n>>>  arch/arm/mach-npcm/platsmp.c | 89 ++++++++++++++++++++++++++++++++++++++++++++\n>>>  7 files changed, 196 insertions(+)\n>>>  create mode 100644 arch/arm/mach-npcm/Kconfig\n>>>  create mode 100644 arch/arm/mach-npcm/Makefile\n>>>  create mode 100644 arch/arm/mach-npcm/headsmp.S\n>>>  create mode 100644 arch/arm/mach-npcm/npcm7xx.c\n>>>  create mode 100644 arch/arm/mach-npcm/platsmp.c\n>>>\n>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig\n>>> index 61a0cb15067e..05543f1cfbde 100644\n>>> --- a/arch/arm/Kconfig\n>>> +++ b/arch/arm/Kconfig\n>>> @@ -782,6 +782,8 @@ source \"arch/arm/mach-netx/Kconfig\"\n>>>\n>>>  source \"arch/arm/mach-nomadik/Kconfig\"\n>>>\n>>> +source \"arch/arm/mach-npcm/Kconfig\"\n>>> +\n>>>  source \"arch/arm/mach-nspire/Kconfig\"\n>>>\n>>>  source \"arch/arm/plat-omap/Kconfig\"\n>>> diff --git a/arch/arm/Makefile b/arch/arm/Makefile\n>>> index 47d3a1ab08d2..60ca50c7d762 100644\n>>> --- a/arch/arm/Makefile\n>>> +++ b/arch/arm/Makefile\n>>> @@ -191,6 +191,7 @@ machine-$(CONFIG_ARCH_MEDIATEK)             += mediatek\n>>>  machine-$(CONFIG_ARCH_MXS)             += mxs\n>>>  machine-$(CONFIG_ARCH_NETX)            += netx\n>>>  machine-$(CONFIG_ARCH_NOMADIK)         += nomadik\n>>> +machine-$(CONFIG_ARCH_NPCM)            += npcm\n>>>  machine-$(CONFIG_ARCH_NSPIRE)          += nspire\n>>>  machine-$(CONFIG_ARCH_OXNAS)           += oxnas\n>>>  machine-$(CONFIG_ARCH_OMAP1)           += omap1\n>>> diff --git a/arch/arm/mach-npcm/Kconfig b/arch/arm/mach-npcm/Kconfig\n>>> new file mode 100644\n>>> index 000000000000..d47061855439\n>>> --- /dev/null\n>>> +++ b/arch/arm/mach-npcm/Kconfig\n>>> @@ -0,0 +1,50 @@\n>>> +menuconfig ARCH_NPCM\n>>> +       bool \"Nuvoton NPCM Architecture\"\n>>> +       select ARCH_REQUIRE_GPIOLIB\n>>> +       select USE_OF\n>>> +       select PINCTRL\n>>> +       select PINCTRL_NPCM7XX\n>>> +\n>>> +if ARCH_NPCM\n>>> +\n>>> +comment \"NPCMX50 CPU type\"\n>>> +\n>>> +config CPU_NPCM750\n>>> +       depends on ARCH_NPCM && ARCH_MULTI_V7\n>>> +       bool \"Support for NPCM750 BMC CPU (Poleg)\"\n>>> +       select CACHE_L2X0\n>>> +       select CPU_V7\n>>> +       select ARM_GIC\n>>> +       select HAVE_SMP\n>>> +       select SMP\n>>> +       select SMP_ON_UP\n>>> +       select HAVE_ARM_SCU\n>>> +       select HAVE_ARM_TWD if SMP\n>>> +       select ARM_ERRATA_458693\n>>> +       select ARM_ERRATA_720789\n>>> +       select ARM_ERRATA_742231\n>>> +       select ARM_ERRATA_754322\n>>> +       select ARM_ERRATA_764369\n>>> +       select ARM_ERRATA_794072\n>>> +       select PL310_ERRATA_588369\n>>> +       select PL310_ERRATA_727915\n>>> +       select USB_EHCI_ROOT_HUB_TT\n>>> +       select USB_ARCH_HAS_HCD\n>>> +       select USB_ARCH_HAS_EHCI\n>>> +       select USB_EHCI_HCD\n>>> +       select USB_ARCH_HAS_OHCI\n>>> +       select USB_OHCI_HCD\n>>> +       select USB\n>>> +       select FIQ\n>>> +       select CPU_USE_DOMAINS\n>>> +       select GENERIC_CLOCKEVENTS\n>>> +       select CLKDEV_LOOKUP\n>>> +       select COMMON_CLK if OF\n>>> +       select NPCM750_TIMER\n>>> +       select MFD_SYSCON\n>>> +       help\n>>> +         Support for NPCM750 BMC CPU (Poleg).\n>>> +\n>>> +         Nuvoton NPCM750 BMC based on the Cortex A9.\n>>> +\n>>> +endif\n>>> diff --git a/arch/arm/mach-npcm/Makefile b/arch/arm/mach-npcm/Makefile\n>>> new file mode 100644\n>>> index 000000000000..78416055b854\n>>> --- /dev/null\n>>> +++ b/arch/arm/mach-npcm/Makefile\n>>> @@ -0,0 +1,3 @@\n>>> +AFLAGS_headsmp.o               += -march=armv7-a\n>>> +\n>>> +obj-$(CONFIG_CPU_NPCM750)      += npcm7xx.o platsmp.o headsmp.o\n>>> diff --git a/arch/arm/mach-npcm/headsmp.S b/arch/arm/mach-npcm/headsmp.S\n>>> new file mode 100644\n>>> index 000000000000..9fccbbd49ed4\n>>> --- /dev/null\n>>> +++ b/arch/arm/mach-npcm/headsmp.S\n>>> @@ -0,0 +1,17 @@\n>>> +/*\n>>> + * Copyright 2017 Google, Inc.\n>>> + *\n>>> + * This program is free software; you can redistribute it and/or modify\n>>> + * it under the terms of the GNU General Public License version 2 as\n>>> + * published by the Free Software Foundation.\n>>> + */\n>>> +\n>>> +#include <linux/linkage.h>\n>>> +#include <linux/init.h>\n>>> +#include <asm/assembler.h>\n>>> +\n>>> +ENTRY(npcm7xx_secondary_startup)\n>>> +       safe_svcmode_maskall r0\n>>\n>> I saw you  answered to Florian Fainelli that the BootRom is not\n>> starting the secondary CPU in SVC mode. Are you sure? In our\n>> engineering npcm7xx revision, Z1, the BootRom indeed started to run it\n>> in IRQ mode but we fixed it in the production version, A1, (quite long\n>> time ago), I hope you didn't get an EB with Z1 you can check that in\n>> BootBlock console print:\n>>> ADC CLK is set to 25000000\n>>>Last reset was CORST\n>>>vgaioen=1 and mux gspi.\n>>>A1 <<====== this is what you should see, if you see Z1 we need to replace your EB\n>>\n>\n> Nope, on boot it prints:\n>\n>>EB\n>>Board manufacturer: Nuvoton\n>\n>> CPU CLK is 800000000\n>> MC  CLK is 800000000\n>\n>> ADC CLK is set to 25000000\n>>Last reset was PORST\n>>vgaioen=1 and mux gspi.\n>>A1\n>>Skip PCI config.\n>\n> To reproduce, all you have to do is delete\n>\n>>> +       safe_svcmode_maskall r0\n>\n> and the kernel will warn that the core is not starting in SVC mode\n>\n\nOK, Tomer also confirmed it, his kernel printed this:\n    CPU: WARNING: CPU(s) started in wrong/inconsistent modes (primary\nCPU mode 0x13)\n    CPU: This may indicate a broken bootloader or firmware.\nIt appears that in kernel CPU0 starts at SVC mode (0x13) and CPU1\nstarts at SYS mode (0x1F) and the kernel doesn't like that, so leave\nit as is.\n\n>>> +\n>>> +       b       secondary_startup\n>>> +ENDPROC(npcm7xx_secondary_startup)\n>>> diff --git a/arch/arm/mach-npcm/npcm7xx.c b/arch/arm/mach-npcm/npcm7xx.c\n>>> new file mode 100644\n>>> index 000000000000..132e9d587857\n>>> --- /dev/null\n>>> +++ b/arch/arm/mach-npcm/npcm7xx.c\n>>> @@ -0,0 +1,34 @@\n>>> +/*\n>>> + * Copyright (c) 2017 Nuvoton Technology corporation.\n>>> + * Copyright 2017 Google, Inc.\n>>> + *\n>>> + * This program is free software; you can redistribute it and/or modify\n>>> + * it under the terms of the GNU General Public License version 2 as\n>>> + * published by the Free Software Foundation.\n>>> + */\n>>> +\n>>> +#include <linux/kernel.h>\n>>> +#include <linux/types.h>\n>>> +#include <asm/mach/arch.h>\n>>> +#include <asm/mach-types.h>\n>>> +#include <asm/mach/map.h>\n>>> +#include <asm/hardware/cache-l2x0.h>\n>>> +\n>>> +#define NPCM7XX_AUX_VAL (L310_AUX_CTRL_INSTR_PREFETCH |                               \\\n>>> +                        L310_AUX_CTRL_DATA_PREFETCH |                         \\\n>>> +                        L310_AUX_CTRL_NS_LOCKDOWN |                           \\\n>>> +                        L310_AUX_CTRL_CACHE_REPLACE_RR |                      \\\n>>> +                        L2C_AUX_CTRL_SHARED_OVERRIDE |                        \\\n>>> +                        L310_AUX_CTRL_FULL_LINE_ZERO)\n>>> +\n>>> +static const char *const npcm7xx_dt_match[] = {\n>>> +       \"nuvoton,npcm750\",\n>>> +       NULL\n>>> +};\n>>> +\n>>> +DT_MACHINE_START(NPCM7XX_DT, \"NPCMX50 Chip family\")\n>>> +       .atag_offset    = 0x100,\n>>> +       .dt_compat      = npcm7xx_dt_match,\n>>> +       .l2c_aux_val    = NPCM7XX_AUX_VAL,\n>>> +       .l2c_aux_mask   = ~NPCM7XX_AUX_VAL,\n>>> +MACHINE_END\n>>> diff --git a/arch/arm/mach-npcm/platsmp.c b/arch/arm/mach-npcm/platsmp.c\n>>> new file mode 100644\n>>> index 000000000000..144e3e7ec7e6\n>>> --- /dev/null\n>>> +++ b/arch/arm/mach-npcm/platsmp.c\n>>> @@ -0,0 +1,89 @@\n>>> +/*\n>>> + * Copyright 2017 Google, Inc.\n>>> + *\n>>> + * This program is free software; you can redistribute it and/or modify\n>>> + * it under the terms of the GNU General Public License version 2 as\n>>> + * published by the Free Software Foundation.\n>>> + */\n>>> +\n>>> +#define pr_fmt(fmt) \"PLATSMP: \" fmt\n>>> +\n>>> +#include <linux/delay.h>\n>>> +#include <linux/device.h>\n>>> +#include <linux/smp.h>\n>>> +#include <linux/io.h>\n>>> +#include <linux/of.h>\n>>> +#include <linux/of_device.h>\n>>> +#include <linux/of_platform.h>\n>>> +#include <linux/of_address.h>\n>>> +#include <asm/cacheflush.h>\n>>> +#include <asm/smp.h>\n>>> +#include <asm/smp_plat.h>\n>>> +#include <asm/smp_scu.h>\n>>> +\n>>> +#define NPCM7XX_SCRPAD_REG 0x13c\n>>> +\n>>> +extern void npcm7xx_secondary_startup(void);\n>>> +\n>>> +static int npcm7xx_smp_boot_secondary(unsigned int cpu,\n>>> +                                     struct task_struct *idle)\n>>> +{\n>>> +       struct device_node *gcr_np;\n>>> +       void __iomem *gcr_base;\n>>> +       int ret = 0;\n>>> +\n>>> +       gcr_np = of_find_compatible_node(NULL, NULL, \"nuvoton,npcm750-gcr\");\n>>> +       if (!gcr_np) {\n>>> +               pr_err(\"no gcr device node\\n\");\n>>> +               ret = -EFAULT;\n>>> +               goto out;\n>>> +       }\n>>> +       gcr_base = of_iomap(gcr_np, 0);\n>>> +       if (!gcr_base) {\n>>> +               pr_err(\"could not iomap gcr at: 0x%llx\\n\", gcr_base);\n>>> +               ret = -EFAULT;\n>>> +               goto out;\n>>> +       }\n>>> +\n>>> +       /* give boot ROM kernel start address. */\n>>> +       iowrite32(__pa_symbol(npcm7xx_secondary_startup), gcr_base +\n>>> +                 NPCM7XX_SCRPAD_REG);\n>>> +       /* make sure npcm7xx_secondary_startup is seen by all observers. */\n>>> +       smp_wmb();\n>>> +       dsb_sev();\n>>> +       /* make sure write buffer is drained */\n>>> +       mb();\n>>> +\n>>> +out:\n>>> +       iounmap(gcr_base);\n>>> +       return ret;\n>>> +}\n>>> +\n>>> +static void __init npcm7xx_smp_prepare_cpus(unsigned int max_cpus)\n>>> +{\n>>> +       struct device_node *scu_np;\n>>> +       void __iomem *scu_base;\n>>> +\n>>> +       scu_np = of_find_compatible_node(NULL, NULL, \"arm,cortex-a9-scu\");\n>>> +       if (!scu_np) {\n>>> +               pr_err(\"no scu device node\\n\");\n>>> +               return;\n>>> +       }\n>>> +       scu_base = of_iomap(scu_np, 0);\n>>> +       if (!scu_base) {\n>>> +               pr_err(\"could not iomap scu at: 0x%llx\\n\", scu_base);\n>>> +               return;\n>>> +       }\n>>> +\n>>> +       scu_enable(scu_base);\n>>> +\n>>> +out:\n>>> +       iounmap(scu_base);\n>>> +}\n>>> +\n>>> +static struct smp_operations npcm7xx_smp_ops __initdata = {\n>>> +       .smp_prepare_cpus = npcm7xx_smp_prepare_cpus,\n>>> +       .smp_boot_secondary = npcm7xx_smp_boot_secondary,\n>>> +};\n>>> +\n>>> +CPU_METHOD_OF_DECLARE(npcm7xx_smp, \"nuvoton,npcm7xx-smp\", &npcm7xx_smp_ops);\n>>> --\n>>> 2.14.1.581.gf28d330327-goog\n>>>","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"tEvwT9bq\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"S9H6oDdj\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xp3lm0K0Bz9s2G\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tFri,  8 Sep 2017 01:09:56 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dpyRF-0001Nn-2a; Thu, 07 Sep 2017 15:09:53 +0000","from mail-oi0-x242.google.com ([2607:f8b0:4003:c06::242])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dpyQq-0001LB-Bf for linux-arm-kernel@lists.infradead.org;\n\tThu, 07 Sep 2017 15:09:30 +0000","by mail-oi0-x242.google.com with SMTP id g15so6914581oib.3\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tThu, 07 Sep 2017 08:09:07 -0700 (PDT)","by 10.157.62.18 with HTTP; Thu, 7 Sep 2017 08:09:06 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:\n\tReferences:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=rXrjbJKgT+3VG6EWFxpbnR+oBgqIocfVVKzl+JiqecI=;\n\tb=tEvwT9bq8FAMZW\n\tGxtfamDLpJb9FJMYMYrxZPqAUUhC6Gf9YWSbF5ZEgDutwmeSO9QdgVQQrKTZF6Fz0SpJ1H6rApJtV\n\tpKGHYNc55eqhBxuE9Is5Hi8pLDHBMNyiYJ8J3htO5FBSi3uIjqJVKHWwtTeZXe7ik+s2rQIVL8SpZ\n\tjHoAACUjyLPTrzpa9Hes8KJfFLJqoNcid6Vxw84R53NIUzqOszJ0Fu2c0jT4B/gwOOz8n5GQxtjQs\n\tP+QxfiBiDsaQU34hGCEZICe0MWb94voW72YIudpPb49rPSXcxsNLVNEmfKqvPXYTNd6hiFMIU9SLf\n\trDAI1g4uso4hHRKW2Arw==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=MW9CdysafRqqg5OG8FLz6JI3liHbJI0bYNfLXF6p59A=;\n\tb=S9H6oDdj8XoJbmJTDzfwsy2HNrHTzbQVqLpoA1/gGcgW54f9XbEf/AXQxxteyCeBhy\n\t57pGJpsRcZRnRTfd3flX+AflVl2n7McMiDOtA3fpp+YbCs+MKKw9O20cJpLlMFKFzPfA\n\tZGEjIaPBlxIBG5qdxFI2vY+30ysRyosRwiwPqKYLFFEltNHO8LQmdjs7VpcVOf9AXmjV\n\t0YmE93wI8Esv18+s4KUUzPb07qmZJLMFwrr00x47LOFMMVOZlOxbkVMql/Upr5QB+Ey4\n\tQqH1mWK7MEzTtCsiCOk+TdchlRd8IOUIc1Cyzr7llUzma0S1N7wlVK7rDfGaQG6K3JOz\n\t0Fyg=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=MW9CdysafRqqg5OG8FLz6JI3liHbJI0bYNfLXF6p59A=;\n\tb=CsmMkvrdDe7oYfUHEzBEDtbN19JtbHYs8viOXfI7RViWHj0O/Ub84Lt/zojEA1Fu71\n\t+0I+PiszvG1Ci8B9z0DDesJBEvTfWugaLRwvgRWvOh9EDSBaBKHGGw9kqpEOYajOVlcg\n\tMjuFA5vERuJYPoP5zJdNuurBK+RcU6g+kkpVV44JnL7IWu0XlmBQhpgky0XX6z9w1h5O\n\tCBevlF+eLGHHDJkoTegbWSlXnrAjzDW9o4QZalHB967Vv86bR+yI6R6f6D3YsXBzBIQk\n\tdznvK5QzK4TOBn7PfTD8wgoZ+Ukak/LqS8ni6quVk/5t/6ZI8zDlDJZxQZ1o3jKTktJM\n\toy9g==","X-Gm-Message-State":"AHPjjUhG/KMIu50cIIPXfCH4yDjR6i2Ci8gasioIQ+3FHsRyeWWsgH77\n\tJA9qcxygle4Dy8TytCxsROgdhb2MoiFeD3U=","X-Google-Smtp-Source":"ADKCNb48fFpSDS7FXu/lUiYZL5yzRyOwE6g2f8ROOWW2t52ug3/an0URxTyMO3WxVSTzaF08i4Vpb+ImRvblPdaudRI=","X-Received":"by 10.202.245.211 with SMTP id\n\tt202mr3115884oih.158.1504796947064; \n\tThu, 07 Sep 2017 08:09:07 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<CAFd5g46fh3unYC8J3CyUg25=3XAbz+U-XC6ON7V9p5Nt0mLKgA@mail.gmail.com>","References":"<20170906080751.6773-1-brendanhiggins@google.com>\n\t<20170906080751.6773-2-brendanhiggins@google.com>\n\t<CAKKbWA4OXL__VWzwRvN_wujDc70zWqmGPcu2_WRpvsSUYba1Qg@mail.gmail.com>\n\t<CAFd5g46fh3unYC8J3CyUg25=3XAbz+U-XC6ON7V9p5Nt0mLKgA@mail.gmail.com>","From":"Avi Fishman <avifishman70@gmail.com>","Date":"Thu, 7 Sep 2017 18:09:06 +0300","Message-ID":"<CAKKbWA4HSw3xXEhF5tf51UMM5Ch3OxnryjzGjw8tWb23o5cNYQ@mail.gmail.com>","Subject":"Re: [PATCH v4 1/3] arm: npcm: add basic support for Nuvoton BMCs","To":"Brendan Higgins <brendanhiggins@google.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170907_080928_507977_6F903969 ","X-CRM114-Status":"GOOD (  22.97  )","X-Spam-Score":"-1.8 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.8 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends\n\tin digit (avifishman70[at]gmail.com)\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (avifishman70[at]gmail.com)\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"Mark Rutland <mark.rutland@arm.com>,\n\tdevicetree <devicetree@vger.kernel.org>,\n\tFlorian Fainelli <f.fainelli@gmail.com>, tmaimon77@gmail.com,\n\tOpenBMC Maillist <openbmc@lists.ozlabs.org>,\n\tRussell King <linux@armlinux.org.uk>,\n\tLinux Kernel Mailing List <linux-kernel@vger.kernel.org>,\n\tRob Herring <robh+dt@kernel.org>, Joel Stanley <joel@jms.id.au>,\n\tRick Altherr <raltherr@google.com>, linux-arm-kernel@lists.infradead.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}}]