[{"id":1764377,"web_url":"http://patchwork.ozlabs.org/comment/1764377/","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>\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","ozlabs.org;\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 vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xnbg06bTKz9s7C\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 07:04:12 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752660AbdIFVEL (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tWed, 6 Sep 2017 17:04:11 -0400","from mail-oi0-f65.google.com ([209.85.218.65]:34132 \"EHLO\n\tmail-oi0-f65.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752354AbdIFVEK (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Wed, 6 Sep 2017 17:04:10 -0400","by mail-oi0-f65.google.com with SMTP id a197so234024oib.1;\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; 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=COVyxy2Hi10bzhCXfDcawNoCU6W0iV+0rfn5daZBpffq8ykKwS2vWImwKzxCPqXEnf\n\txB4FZqvYWNthfA1thU1tUiSL+2CSA7gHHPAlw5KpCOuwdIebEYZCH8cv6R2Eydqsf7/P\n\tL6TpaLoTw3+IKSXBn/ojChymeeGpE52N6Hv0fjDwPiEJV7ELTiGx/huWjf3q41kAyYNj\n\tAG+TkIneF3tZItlHd8ZptsL1IbjNifHZ3JpdHfasMeD4ZHK0vi5kFpQGdnIdSa4ZqpKP\n\t4aSEkUjXzcYElryPodHkIN9NvpJ+XkLMTWcbW3rP+Uo/QnBI/k81yBQ/qRZTG+L2uR/t\n\tdLyw==","X-Gm-Message-State":"AHPjjUjecHnE8e9dL92uiAnLGP6VuZkgc67p8OdxPhgxQhNCAy60VcGr\n\t2Yu/GqOG0IkvNeu0Ia2Idh4z1lrTpg==","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>","Cc":"robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk,\n\ttmaimon77@gmail.com, raltherr@google.com, f.fainelli@gmail.com,\n\tjoel@jms.id.au, devicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\topenbmc@lists.ozlabs.org","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1764502,"web_url":"http://patchwork.ozlabs.org/comment/1764502/","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>>\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","ozlabs.org;\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 vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xnpQl6f9Cz9sPm\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 15:09:19 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753018AbdIGFJI (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tThu, 7 Sep 2017 01:09:08 -0400","from mail-qk0-f170.google.com ([209.85.220.170]:33484 \"EHLO\n\tmail-qk0-f170.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752854AbdIGFJH (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Thu, 7 Sep 2017 01:09:07 -0400","by mail-qk0-f170.google.com with SMTP id o129so24522448qkd.0\n\tfor <devicetree@vger.kernel.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; 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=Q6xjRTQfMlrXHtq0rZ1wKPh7AZkGsJTxjQjHVc38BII0RA7/wB5SIC+YTszQoaaVLI\n\tgrSZZwGcRgNks4Hec6X6EAkRadyrIiSOD59oRXRS+Il8O1iXsEi3MzIkel9dMH8ZKrw6\n\tGsAHLCfHmBzlXYbWITL+vF185m/0hYyi58YUCafNqsDiWkwqv89w5hwm2JrsOgp7zdP9\n\t51wbb2KBphn8DNazBLADNn/QjRQYbCnLDtjpeZsq/M/lLniryCzlVR68nQk1Pfhxzo18\n\t4OVOgUwhzzDuM0ENhRrEI10T6RStLhjV4T4Q+XpxnW6vGX1HOra4ITriyU+gYqHq7jhV\n\tOSIA==","X-Gm-Message-State":"AHPjjUhWkm0e9uRuNGhaslkJ3rwWumvz2htYj9mKXSytlaVNWvoUZs6s\n\tE/s/U0vu9SRaj1emAoOiIvT+fQQNk8Dt","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>","Cc":"Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>,\n\tRussell King <linux@armlinux.org.uk>, tmaimon77@gmail.com,\n\tRick Altherr <raltherr@google.com>,\n\tFlorian Fainelli <f.fainelli@gmail.com>, Joel Stanley <joel@jms.id.au>,\n\tdevicetree <devicetree@vger.kernel.org>,\n\tLinux Kernel Mailing List <linux-kernel@vger.kernel.org>,\n\tlinux-arm-kernel@lists.infradead.org,\n\tOpenBMC Maillist <openbmc@lists.ozlabs.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1764601,"web_url":"http://patchwork.ozlabs.org/comment/1764601/","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>\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","ozlabs.org;\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 vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xnvyg3xMQz9sRV\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 19:18:51 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754847AbdIGJSu (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tThu, 7 Sep 2017 05:18:50 -0400","from mail-ua0-f196.google.com ([209.85.217.196]:33187 \"EHLO\n\tmail-ua0-f196.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1754349AbdIGJSs (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Thu, 7 Sep 2017 05:18:48 -0400","by mail-ua0-f196.google.com with SMTP id s15so2928314uag.0;\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; 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=HOIBHnxGzRb8yTzyI9UQ9aN9MeN+BTBIew0pStACRHZFBqWHu5CetudDEtmnRe7t9R\n\tKlqzLKudl3qqDbO5nXjHhX9ZckdN9pHIJFxDkh44B9C5f193Zysgs8FB8YXKKCB/ObVb\n\tiUp/wmV83/ricrfW6lavII3grqBu6FKnualzN1nX7zp9OQzOBeEUU3to0bbnnPf3ajfJ\n\tHchv9ygOGdxDCShGKZpyBDimnI6gsEtswrcsttlNsICAtjj1nvgBD7t2QNLCvVi+NrNJ\n\tipbdDSPXwuIE3VlxXo5vgR2aFDktRNdqh7FER7u29zsnWli8v8puoBbnxuhE2aTb+7B5\n\tS2nQ==","X-Gm-Message-State":"AHPjjUjExsRY2QfB3bFxKDgREYlq34CP1p8MBfpgudqtLsKS4Yjzvtf9\n\t9/NwlLMnbGWu6aFKBYnbHqXK4Kmudw==","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>","Cc":"robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk,\n\tavifishman70@gmail.com, Rick Altherr <raltherr@google.com>,\n\tf.fainelli@gmail.com, joel@jms.id.au, devicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\topenbmc@lists.ozlabs.org","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1764776,"web_url":"http://patchwork.ozlabs.org/comment/1764776/","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>>>\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","ozlabs.org;\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 vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xp3kt6C7Bz9s7c\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tFri,  8 Sep 2017 01:09:10 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1755335AbdIGPJJ (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tThu, 7 Sep 2017 11:09:09 -0400","from mail-oi0-f68.google.com ([209.85.218.68]:38565 \"EHLO\n\tmail-oi0-f68.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1755053AbdIGPJI (ORCPT\n\t<rfc822; devicetree@vger.kernel.org>); Thu, 7 Sep 2017 11:09:08 -0400","by mail-oi0-f68.google.com with SMTP id d10so5256163oih.5;\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; 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=LANA8sDJGObaOCKyUzrEOy+NpCi/agonfMUMOBGESS4WO7Wq5ZiZEIblMG8IPgo8P7\n\tSgsSnUVWxyQLAW6kZvoPfRxdj292LCcdy0tYEPqiDewCysRCldj5db6ZPxBqnUCRDBgZ\n\tbb3yKNCru9xfCOnqGzZDdtk4HxNtXXo4TJngSvW/u2hZ/UD5YjpjQ0kfX/2/TOznEbkU\n\t5bUYCE8OlmfoHCvqac3wPAqEO4jcRPo7hM2f2tJrJadF8G0qMZc8enELUk7CS8mhyzPy\n\tT+JEw4R17Zbtbc+yODCjKSk9calgrxq95j2m7yD9h9Yw1He/MlM651L/XT1hVl17U31s\n\tSTjQ==","X-Gm-Message-State":"AHPjjUiIvaI9zfo1uXQRknpEbmamlDmG+Vpb/pA6G5s1eVZYpGaWzkAd\n\tydo+eWbP3hsCYQ+yDGne1NbDYnZ7Xg==","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>","Cc":"Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>,\n\tRussell King <linux@armlinux.org.uk>, tmaimon77@gmail.com,\n\tRick Altherr <raltherr@google.com>,\n\tFlorian Fainelli <f.fainelli@gmail.com>, Joel Stanley <joel@jms.id.au>,\n\tdevicetree <devicetree@vger.kernel.org>,\n\tLinux Kernel Mailing List <linux-kernel@vger.kernel.org>,\n\tlinux-arm-kernel@lists.infradead.org,\n\tOpenBMC Maillist <openbmc@lists.ozlabs.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}}]