[{"id":1764457,"web_url":"http://patchwork.ozlabs.org/comment/1764457/","msgid":"<CAKKbWA7GUxbMaHsk4-42zE-ony6TSzv-960QWroK8yFrCB1atA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-06T20:27:56","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":"2017-09-06 11:07 GMT+03:00 Brendan Higgins <brendanhiggins@google.com>:\n\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> ++++++++++++++\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)             +=\n> 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\nI saw you  answered to Florian Fainelli that the BootRom is not starting\nthe secondary CPU in SVC mode. Are you sure? In our engineering npcm7xx\nrevision, Z1, the BootRom indeed started to run it in IRQ mode but we fixed\nit in the production version, A1, (quite long time ago), I hope you didn't\nget an EB with Z1 you can check that in 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\nyour 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>              \\\n> +                        L310_AUX_CTRL_DATA_PREFETCH |\n>      \\\n> +                        L310_AUX_CTRL_NS_LOCKDOWN |\n>      \\\n> +                        L310_AUX_CTRL_CACHE_REPLACE_RR |\n>     \\\n> +                        L2C_AUX_CTRL_SHARED_OVERRIDE |\n>     \\\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,\n> \"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\",\n> &npcm7xx_smp_ops);\n> --\n> 2.14.1.581.gf28d330327-goog\n>\n>\n<div dir=\"rtl\"><div style=\"text-align:left\" dir=\"ltr\"><br></div><div class=\"gmail_extra\" dir=\"ltr\"><div style=\"text-align:left\"><br></div><div class=\"gmail_quote\"><div>2017-09-06 11:07 GMT+03:00 Brendan Higgins <span dir=\"ltr\">&lt;<a href=\"mailto:brendanhiggins@google.com\" target=\"_blank\">brendanhiggins@google.com</a>&gt;</span>:</div><blockquote class=\"gmail_quote\" style=\"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex\"><div style=\"text-align:left\">Adds basic support for the Nuvoton NPCM750 BMC.</div><span class=\"gmail-\"><div style=\"text-align:left\"><br></div>\n<div style=\"text-align:left\">Signed-off-by: Brendan Higgins &lt;<a href=\"mailto:brendanhiggins@google.com\">brendanhiggins@google.com</a>&gt;</div><div style=\"text-align:left\">---</div><div style=\"text-align:left\"> arch/arm/Kconfig             |  2 +</div><div style=\"text-align:left\"> arch/arm/Makefile            |  1 +</div>\n</span><div style=\"text-align:left\"> arch/arm/mach-npcm/Kconfig   | 50 +++++++++++++++++++++++++</div><div style=\"text-align:left\"> arch/arm/mach-npcm/Makefile  |  3 ++</div><div style=\"text-align:left\"> arch/arm/mach-npcm/headsmp.S | 17 +++++++++</div><div style=\"text-align:left\"> arch/arm/mach-npcm/npcm7xx.c | 34 +++++++++++++++++</div><div style=\"text-align:left\"> arch/arm/mach-npcm/platsmp.c | 89 ++++++++++++++++++++++++++++++<wbr>++++++++++++++</div><div style=\"text-align:left\"> 7 files changed, 196 insertions(+)</div>\n<div><div class=\"gmail-h5\"><div style=\"text-align:left\"> create mode 100644 arch/arm/mach-npcm/Kconfig</div><div style=\"text-align:left\"> create mode 100644 arch/arm/mach-npcm/Makefile</div><div style=\"text-align:left\"> create mode 100644 arch/arm/mach-npcm/headsmp.S</div><div style=\"text-align:left\"> create mode 100644 arch/arm/mach-npcm/npcm7xx.c</div><div style=\"text-align:left\"> create mode 100644 arch/arm/mach-npcm/platsmp.c</div>\n<div style=\"text-align:left\"><br></div><div style=\"text-align:left\">diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig</div><div style=\"text-align:left\">index 61a0cb15067e..05543f1cfbde 100644</div><div style=\"text-align:left\">--- a/arch/arm/Kconfig</div><div style=\"text-align:left\">+++ b/arch/arm/Kconfig</div><div style=\"text-align:left\">@@ -782,6 +782,8 @@ source &quot;arch/arm/mach-netx/Kconfig&quot;</div>\n<div style=\"text-align:left\"><br></div><div style=\"text-align:left\"> source &quot;arch/arm/mach-nomadik/<wbr>Kconfig&quot;</div>\n<div style=\"text-align:left\"><br></div><div style=\"text-align:left\">+source &quot;arch/arm/mach-npcm/Kconfig&quot;</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\"> source &quot;arch/arm/mach-nspire/Kconfig&quot;</div>\n<div style=\"text-align:left\"><br></div><div style=\"text-align:left\"> source &quot;arch/arm/plat-omap/Kconfig&quot;</div><div style=\"text-align:left\">diff --git a/arch/arm/Makefile b/arch/arm/Makefile</div><div style=\"text-align:left\">index 47d3a1ab08d2..60ca50c7d762 100644</div><div style=\"text-align:left\">--- a/arch/arm/Makefile</div><div style=\"text-align:left\">+++ b/arch/arm/Makefile</div><div style=\"text-align:left\">@@ -191,6 +191,7 @@ machine-$(CONFIG_ARCH_<wbr>MEDIATEK)             += mediatek</div><div style=\"text-align:left\"> machine-$(CONFIG_ARCH_MXS)             += mxs</div><div style=\"text-align:left\"> machine-$(CONFIG_ARCH_NETX)            += netx</div><div style=\"text-align:left\"> machine-$(CONFIG_ARCH_NOMADIK)         += nomadik</div><div style=\"text-align:left\">+machine-$(CONFIG_ARCH_NPCM)            += npcm</div><div style=\"text-align:left\"> machine-$(CONFIG_ARCH_NSPIRE)          += nspire</div><div style=\"text-align:left\"> machine-$(CONFIG_ARCH_OXNAS)           += oxnas</div><div style=\"text-align:left\"> machine-$(CONFIG_ARCH_OMAP1)           += omap1</div><div style=\"text-align:left\">diff --git a/arch/arm/mach-npcm/Kconfig b/arch/arm/mach-npcm/Kconfig</div><div style=\"text-align:left\">new file mode 100644</div>\n</div></div><div style=\"text-align:left\">index 000000000000..d47061855439</div><div style=\"text-align:left\">--- /dev/null</div><div style=\"text-align:left\">+++ b/arch/arm/mach-npcm/Kconfig</div><div style=\"text-align:left\">@@ -0,0 +1,50 @@</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+menuconfig ARCH_NPCM</div><div style=\"text-align:left\">+       bool &quot;Nuvoton NPCM Architecture&quot;</div><div style=\"text-align:left\">+       select ARCH_REQUIRE_GPIOLIB</div><div style=\"text-align:left\">+       select USE_OF</div><div style=\"text-align:left\">+       select PINCTRL</div><div style=\"text-align:left\">+       select PINCTRL_NPCM7XX</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+if ARCH_NPCM</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+comment &quot;NPCMX50 CPU type&quot;</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+config CPU_NPCM750</div><div style=\"text-align:left\">+       depends on ARCH_NPCM &amp;&amp; ARCH_MULTI_V7</div>\n</span><span class=\"gmail-\"><div style=\"text-align:left\">+       bool &quot;Support for NPCM750 BMC CPU (Poleg)&quot;</div><div style=\"text-align:left\">+       select CACHE_L2X0</div><div style=\"text-align:left\">+       select CPU_V7</div><div style=\"text-align:left\">+       select ARM_GIC</div>\n</span><div style=\"text-align:left\">+       select HAVE_SMP</div><div style=\"text-align:left\">+       select SMP</div><div style=\"text-align:left\">+       select SMP_ON_UP</div><div style=\"text-align:left\">+       select HAVE_ARM_SCU</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+       select HAVE_ARM_TWD if SMP</div>\n</span><div style=\"text-align:left\">+       select ARM_ERRATA_458693</div><div style=\"text-align:left\">+       select ARM_ERRATA_720789</div><div style=\"text-align:left\">+       select ARM_ERRATA_742231</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+       select ARM_ERRATA_754322</div><div style=\"text-align:left\">+       select ARM_ERRATA_764369</div>\n</span><span class=\"gmail-\"><div style=\"text-align:left\">+       select ARM_ERRATA_794072</div><div style=\"text-align:left\">+       select PL310_ERRATA_588369</div><div style=\"text-align:left\">+       select PL310_ERRATA_727915</div>\n</span><span class=\"gmail-\"><div style=\"text-align:left\">+       select USB_EHCI_ROOT_HUB_TT</div><div style=\"text-align:left\">+       select USB_ARCH_HAS_HCD</div><div style=\"text-align:left\">+       select USB_ARCH_HAS_EHCI</div><div style=\"text-align:left\">+       select USB_EHCI_HCD</div><div style=\"text-align:left\">+       select USB_ARCH_HAS_OHCI</div><div style=\"text-align:left\">+       select USB_OHCI_HCD</div><div style=\"text-align:left\">+       select USB</div><div style=\"text-align:left\">+       select FIQ</div><div style=\"text-align:left\">+       select CPU_USE_DOMAINS</div>\n</span><div style=\"text-align:left\">+       select GENERIC_CLOCKEVENTS</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+       select CLKDEV_LOOKUP</div><div style=\"text-align:left\">+       select COMMON_CLK if OF</div>\n</span><span class=\"gmail-\"><div style=\"text-align:left\">+       select NPCM750_TIMER</div><div style=\"text-align:left\">+       select MFD_SYSCON</div><div style=\"text-align:left\">+       help</div>\n</span><div style=\"text-align:left\">+         Support for NPCM750 BMC CPU (Poleg).</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+         Nuvoton NPCM750 BMC based on the Cortex A9.</div><div style=\"text-align:left\">+</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+endif</div><div style=\"text-align:left\">diff --git a/arch/arm/mach-npcm/Makefile b/arch/arm/mach-npcm/Makefile</div>\n</span><div style=\"text-align:left\">new file mode 100644</div><div style=\"text-align:left\">index 000000000000..78416055b854</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">--- /dev/null</div><div style=\"text-align:left\">+++ b/arch/arm/mach-npcm/Makefile</div><div style=\"text-align:left\">@@ -0,0 +1,3 @@</div>\n</span><div style=\"text-align:left\">+AFLAGS_headsmp.o               += -march=armv7-a</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+obj-$(CONFIG_CPU_NPCM750)      += npcm7xx.o platsmp.o headsmp.o</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">diff --git a/arch/arm/mach-npcm/headsmp.S b/arch/arm/mach-npcm/headsmp.S</div><div style=\"text-align:left\">new file mode 100644</div>\n</span><div style=\"text-align:left\">index 000000000000..9fccbbd49ed4</div><div style=\"text-align:left\">--- /dev/null</div><div style=\"text-align:left\">+++ b/arch/arm/mach-npcm/headsmp.S</div><div style=\"text-align:left\">@@ -0,0 +1,17 @@</div><div style=\"text-align:left\">+/*</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+ * Copyright 2017 Google, Inc.</div><div style=\"text-align:left\">+ *</div><div style=\"text-align:left\">+ * This program is free software; you can redistribute it and/or modify</div>\n</span><span class=\"gmail-\"><div style=\"text-align:left\">+ * it under the terms of the GNU General Public License version 2 as</div><div style=\"text-align:left\">+ * published by the Free Software Foundation.</div><div style=\"text-align:left\">+ */</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+#include &lt;linux/linkage.h&gt;</div><div style=\"text-align:left\">+#include &lt;linux/init.h&gt;</div>\n</span><div style=\"text-align:left\">+#include &lt;asm/assembler.h&gt;</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+ENTRY(npcm7xx_secondary_<wbr>startup)</div><div style=\"text-align:left\">+       safe_svcmode_maskall r0</div></blockquote><div><br></div><div>I saw you  answered to Florian Fainelli that the BootRom is not starting the secondary CPU in SVC mode. Are you sure? In our engineering npcm7xx revision, Z1, the BootRom indeed started to run it in IRQ mode but we fixed it in the production version, A1, (quite long time ago), I hope you didn&#39;t get an EB with Z1 you can check that in BootBlock console print:</div><div><div>&gt; ADC CLK is set to 25000000</div><div>&gt;Last reset was CORST</div><div>&gt;vgaioen=1 and mux gspi.</div><div>&gt;A1 &lt;&lt;====== this is what you should see, if you see Z1 we need to replace your EB</div></div><div><br></div><blockquote class=\"gmail_quote\" style=\"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex\"><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+       b       secondary_startup</div><div style=\"text-align:left\">+ENDPROC(npcm7xx_secondary_<wbr>startup)</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">diff --git a/arch/arm/mach-npcm/npcm7xx.c b/arch/arm/mach-npcm/npcm7xx.c</div><div style=\"text-align:left\">new file mode 100644</div>\n</span><div style=\"text-align:left\">index 000000000000..132e9d587857</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">--- /dev/null</div><div style=\"text-align:left\">+++ b/arch/arm/mach-npcm/npcm7xx.c</div><div style=\"text-align:left\">@@ -0,0 +1,34 @@</div><div style=\"text-align:left\">+/*</div>\n</span><div style=\"text-align:left\">+ * Copyright (c) 2017 Nuvoton Technology corporation.</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+ * Copyright 2017 Google, Inc.</div><div style=\"text-align:left\">+ *</div><div style=\"text-align:left\">+ * This program is free software; you can redistribute it and/or modify</div>\n</span><span class=\"gmail-\"><div style=\"text-align:left\">+ * it under the terms of the GNU General Public License version 2 as</div><div style=\"text-align:left\">+ * published by the Free Software Foundation.</div><div style=\"text-align:left\">+ */</div><div style=\"text-align:left\">+</div>\n</span><div><div class=\"gmail-h5\"><div style=\"text-align:left\">+#include &lt;linux/kernel.h&gt;</div><div style=\"text-align:left\">+#include &lt;linux/types.h&gt;</div><div style=\"text-align:left\">+#include &lt;asm/mach/arch.h&gt;</div><div style=\"text-align:left\">+#include &lt;asm/mach-types.h&gt;</div><div style=\"text-align:left\">+#include &lt;asm/mach/map.h&gt;</div><div style=\"text-align:left\">+#include &lt;asm/hardware/cache-l2x0.h&gt;</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+#define NPCM7XX_AUX_VAL (L310_AUX_CTRL_INSTR_PREFETCH |                               \\</div><div style=\"text-align:left\">+                        L310_AUX_CTRL_DATA_PREFETCH |                         \\</div><div style=\"text-align:left\">+                        L310_AUX_CTRL_NS_LOCKDOWN |                           \\</div><div style=\"text-align:left\">+                        L310_AUX_CTRL_CACHE_REPLACE_RR |                      \\</div><div style=\"text-align:left\">+                        L2C_AUX_CTRL_SHARED_OVERRIDE |                        \\</div><div style=\"text-align:left\">+                        L310_AUX_CTRL_FULL_LINE_ZERO)</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+static const char *const npcm7xx_dt_match[] = {</div><div style=\"text-align:left\">+       &quot;nuvoton,npcm750&quot;,</div><div style=\"text-align:left\">+       NULL</div><div style=\"text-align:left\">+};</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+DT_MACHINE_START(NPCM7XX_DT, &quot;NPCMX50 Chip family&quot;)</div><div style=\"text-align:left\">+       .atag_offset    = 0x100,</div><div style=\"text-align:left\">+       .dt_compat      = npcm7xx_dt_match,</div><div style=\"text-align:left\">+       .l2c_aux_val    = NPCM7XX_AUX_VAL,</div><div style=\"text-align:left\">+       .l2c_aux_mask   = ~NPCM7XX_AUX_VAL,</div><div style=\"text-align:left\">+MACHINE_END</div><div style=\"text-align:left\">diff --git a/arch/arm/mach-npcm/platsmp.c b/arch/arm/mach-npcm/platsmp.c</div><div style=\"text-align:left\">new file mode 100644</div>\n</div></div><div style=\"text-align:left\">index 000000000000..144e3e7ec7e6</div><div style=\"text-align:left\">--- /dev/null</div><div style=\"text-align:left\">+++ b/arch/arm/mach-npcm/platsmp.c</div><div style=\"text-align:left\">@@ -0,0 +1,89 @@</div><div style=\"text-align:left\">+/*</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+ * Copyright 2017 Google, Inc.</div><div style=\"text-align:left\">+ *</div><div style=\"text-align:left\">+ * This program is free software; you can redistribute it and/or modify</div>\n</span><span class=\"gmail-\"><div style=\"text-align:left\">+ * it under the terms of the GNU General Public License version 2 as</div><div style=\"text-align:left\">+ * published by the Free Software Foundation.</div><div style=\"text-align:left\">+ */</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+#define pr_fmt(fmt) &quot;PLATSMP: &quot; fmt</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+#include &lt;linux/delay.h&gt;</div><div style=\"text-align:left\">+#include &lt;linux/device.h&gt;</div><div style=\"text-align:left\">+#include &lt;linux/smp.h&gt;</div><div style=\"text-align:left\">+#include &lt;linux/io.h&gt;</div><div style=\"text-align:left\">+#include &lt;linux/of.h&gt;</div><div style=\"text-align:left\">+#include &lt;linux/of_device.h&gt;</div><div style=\"text-align:left\">+#include &lt;linux/of_platform.h&gt;</div><div style=\"text-align:left\">+#include &lt;linux/of_address.h&gt;</div><div style=\"text-align:left\">+#include &lt;asm/cacheflush.h&gt;</div><div style=\"text-align:left\">+#include &lt;asm/smp.h&gt;</div><div style=\"text-align:left\">+#include &lt;asm/smp_plat.h&gt;</div><div style=\"text-align:left\">+#include &lt;asm/smp_scu.h&gt;</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+#define NPCM7XX_SCRPAD_REG 0x13c</div><div style=\"text-align:left\">+</div>\n</span><div style=\"text-align:left\">+extern void npcm7xx_secondary_startup(<wbr>void);</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+static int npcm7xx_smp_boot_secondary(<wbr>unsigned int cpu,</div>\n</span><div style=\"text-align:left\">+                                     struct task_struct *idle)</div><div style=\"text-align:left\">+{</div><div style=\"text-align:left\">+       struct device_node *gcr_np;</div><div style=\"text-align:left\">+       void __iomem *gcr_base;</div><div style=\"text-align:left\">+       int ret = 0;</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+       gcr_np = of_find_compatible_node(NULL, NULL, &quot;nuvoton,npcm750-gcr&quot;);</div><div style=\"text-align:left\">+       if (!gcr_np) {</div><div style=\"text-align:left\">+               pr_err(&quot;no gcr device node\\n&quot;);</div>\n</span><div style=\"text-align:left\">+               ret = -EFAULT;</div><div style=\"text-align:left\">+               goto out;</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+       }</div><div style=\"text-align:left\">+       gcr_base = of_iomap(gcr_np, 0);</div><div style=\"text-align:left\">+       if (!gcr_base) {</div><div style=\"text-align:left\">+               pr_err(&quot;could not iomap gcr at: 0x%llx\\n&quot;, gcr_base);</div>\n</span><div style=\"text-align:left\">+               ret = -EFAULT;</div><div style=\"text-align:left\">+               goto out;</div><div style=\"text-align:left\">+       }</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+       /* give boot ROM kernel start address. */</div><div style=\"text-align:left\">+       iowrite32(__pa_symbol(npcm7xx_<wbr>secondary_startup), gcr_base +</div><div style=\"text-align:left\">+                 NPCM7XX_SCRPAD_REG);</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+       /* make sure npcm7xx_secondary_startup is seen by all observers. */</div><div style=\"text-align:left\">+       smp_wmb();</div><div style=\"text-align:left\">+       dsb_sev();</div><div style=\"text-align:left\">+       /* make sure write buffer is drained */</div><div style=\"text-align:left\">+       mb();</div><div style=\"text-align:left\">+</div>\n</span><div style=\"text-align:left\">+out:</div><div style=\"text-align:left\">+       iounmap(gcr_base);</div><div style=\"text-align:left\">+       return ret;</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+}</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+static void __init npcm7xx_smp_prepare_cpus(<wbr>unsigned int max_cpus)</div><div style=\"text-align:left\">+{</div>\n</span><div style=\"text-align:left\">+       struct device_node *scu_np;</div><div style=\"text-align:left\">+       void __iomem *scu_base;</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+       scu_np = of_find_compatible_node(NULL, NULL, &quot;arm,cortex-a9-scu&quot;);</div><div style=\"text-align:left\">+       if (!scu_np) {</div><div style=\"text-align:left\">+               pr_err(&quot;no scu device node\\n&quot;);</div><div style=\"text-align:left\">+               return;</div><div style=\"text-align:left\">+       }</div><div style=\"text-align:left\">+       scu_base = of_iomap(scu_np, 0);</div><div style=\"text-align:left\">+       if (!scu_base) {</div>\n</span><div style=\"text-align:left\">+               pr_err(&quot;could not iomap scu at: 0x%llx\\n&quot;, scu_base);</div>\n<span class=\"gmail-\"><div style=\"text-align:left\">+               return;</div><div style=\"text-align:left\">+       }</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+       scu_enable(scu_base);</div><div style=\"text-align:left\">+</div>\n</span><div style=\"text-align:left\">+out:</div><div style=\"text-align:left\">+       iounmap(scu_base);</div>\n<span class=\"gmail-im gmail-HOEnZb\"><div style=\"text-align:left\">+}</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+static struct smp_operations npcm7xx_smp_ops __initdata = {</div><div style=\"text-align:left\">+       .smp_prepare_cpus = npcm7xx_smp_prepare_cpus,</div><div style=\"text-align:left\">+       .smp_boot_secondary = npcm7xx_smp_boot_secondary,</div>\n</span><div class=\"gmail-HOEnZb\"><div class=\"gmail-h5\"><div style=\"text-align:left\">+};</div><div style=\"text-align:left\">+</div><div style=\"text-align:left\">+CPU_METHOD_OF_DECLARE(<wbr>npcm7xx_smp, &quot;nuvoton,npcm7xx-smp&quot;, &amp;npcm7xx_smp_ops);</div><div style=\"text-align:left\">--</div><div style=\"text-align:left\">2.14.1.581.gf28d330327-goog</div>\n<div style=\"text-align:left\"><br></div>\n</div></div></blockquote></div><div style=\"text-align:left\"><br></div></div></div>","headers":{"Return-Path":"<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","openbmc@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","openbmc@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnjbP5hNXz9sCZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 11:31:29 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xnjbP4PyTzDrWC\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 11:31:29 +1000 (AEST)","from mail-oi0-x242.google.com (mail-oi0-x242.google.com\n\t[IPv6:2607:f8b0:4003:c06::242])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xnZsD4BxRzDqgy\n\tfor <openbmc@lists.ozlabs.org>; Thu,  7 Sep 2017 06:28:00 +1000 (AEST)","by mail-oi0-x242.google.com with SMTP id a197so176641oib.1\n\tfor <openbmc@lists.ozlabs.org>; Wed, 06 Sep 2017 13:28:00 -0700 (PDT)","by 10.157.62.18 with HTTP; Wed, 6 Sep 2017 13:27:56 -0700 (PDT)"],"Authentication-Results":["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=\"rH8KyA0B\"; dkim-atps=neutral","lists.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=\"rH8KyA0B\"; dkim-atps=neutral","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:4003:c06::242; helo=mail-oi0-x242.google.com;\n\tenvelope-from=avifishman70@gmail.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"rH8KyA0B\"; dkim-atps=neutral"],"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=GCpttR5/3y6YW+I/RlAo7eoiOHkRtuerKhKPKmFKM74=;\n\tb=rH8KyA0B6kmumKSoPdaySMnWU9t5Y4ELyzl6dU0NLEVYrcahYFoo6MUZHf52jHl9+C\n\ta/c1X1HDBgOcBeCysws1O48TlZRjYDU5Xj+lkeMALMSZUcDW+d3xWLTHYUt5LaK5Lqj/\n\tciRmrw63uljVN5DES2qFL0Fp47k2M35MhnMgOkgFKHKYLVGHp8v2khR6mSMTbBUrzAJT\n\t4WGl5TQQEF6StWInn+E/9LHac2YJA68lgPoHFEmrKXe/RThccUA8J7dsO7JQwuCRl4sx\n\tOCrKchIM8HDo2NckJCldypij6ajUdHCEq2rQn9/2Xmw4i2XLtehI1kxTxYGLh9SK4n+6\n\tMwAw==","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=GCpttR5/3y6YW+I/RlAo7eoiOHkRtuerKhKPKmFKM74=;\n\tb=iizUPu3x9BAt4DjM+YdwyY3EOpqyPoZJ7Yaj1E3ItYN21n/bqZQizYfSnrLLa4J6IJ\n\tCrBCb+KkP6tFpDb9hTNNYOWsE2PC9YvTdecYAy7TXxo9DsKPpypzKRedtlhaNcdNmVYt\n\tYjNFWfA9HvrcFmuM36dp0lVAQ36wgPPneCJDAu0A5VuVcTyZuOF9mipt6p7+HDE7dnBC\n\t9dW3TZ6Lfy7bIbpDNL2uxzSd10i9xYNOpnC0trLq9EZByHg9p5vJe3ec//0YV0tKH+2L\n\tVBKaLsZKbIHtgTuB1R/0NaWydDEKgFdb7rvVXW0rFiiPX/OGZxbCOfxWdbziDirwnaK0\n\tDjgQ==","X-Gm-Message-State":"AHPjjUgvn4u9LPC2hPorrRLVw3tnMjwgWoVtJIjAkLEfsuPeTQzNniRp\n\t2alL+EcScM8wXyRRorwwdoQu+/T0jA==","X-Google-Smtp-Source":"ADKCNb58qltDF1Ci844DjmuzutVa/bGvU/9qQEdIEEchwxxWb3wXJejeaJ1azsNhB2/PU67AVbe21+A+9J+3GAeews4=","X-Received":"by 10.202.193.65 with SMTP id r62mr438397oif.313.1504729677111; \n\tWed, 06 Sep 2017 13:27:57 -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":"Wed, 6 Sep 2017 23:27:56 +0300","Message-ID":"<CAKKbWA7GUxbMaHsk4-42zE-ony6TSzv-960QWroK8yFrCB1atA@mail.gmail.com>","Subject":"Re: [PATCH v4 1/3] arm: npcm: add basic support for Nuvoton BMCs","To":"Brendan Higgins <brendanhiggins@google.com>","Content-Type":"multipart/alternative; boundary=\"001a113f5b90e3503605588b2de1\"","X-Mailman-Approved-At":"Thu, 07 Sep 2017 11:31:25 +1000","X-BeenThere":"openbmc@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Development list for OpenBMC <openbmc.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/openbmc/>","List-Post":"<mailto:openbmc@lists.ozlabs.org>","List-Help":"<mailto:openbmc-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.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,\n\tlinux-arm-kernel@lists.infradead.org","Errors-To":"openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"openbmc\"\n\t<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"}},{"id":1764458,"web_url":"http://patchwork.ozlabs.org/comment/1764458/","msgid":"<CAKKbWA6M13+Od24aVEdJM8VA4b+=Wk7LM46vyj=3ziwpkKLesA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-06T20:31:43","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":"2017-09-06 11:07 GMT+03:00 Brendan Higgins <brendanhiggins@google.com>:\n>\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++++++++++++++++++++++++++++++++++++++++++++\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)             +=\nmediatek\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 starting\nthe secondary CPU in SVC mode. Are you sure? In our engineering npcm7xx\nrevision, Z1, the BootRom indeed started to run it in IRQ mode but we fixed\nit in the production version, A1, (quite long time ago), I hope you didn't\nget an EB with Z1 you can check that in 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\nyour 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              \\\n> +                        L310_AUX_CTRL_DATA_PREFETCH |\n      \\\n> +                        L310_AUX_CTRL_NS_LOCKDOWN |\n      \\\n> +                        L310_AUX_CTRL_CACHE_REPLACE_RR |\n     \\\n> +                        L2C_AUX_CTRL_SHARED_OVERRIDE |\n     \\\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,\n\"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*/\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\",\n&npcm7xx_smp_ops);\n> --\n> 2.14.1.581.gf28d330327-goog\n>\n<div dir=\"rtl\"><div style=\"text-align:left\" dir=\"ltr\"><br></div><div style=\"text-align:left\" dir=\"ltr\"><br></div><div style=\"text-align:left\" dir=\"ltr\">2017-09-06 11:07 GMT+03:00 Brendan Higgins &lt;<a href=\"mailto:brendanhiggins@google.com\">brendanhiggins@google.com</a>&gt;:</div><div style=\"text-align:left\" dir=\"ltr\">&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; Adds basic support for the Nuvoton NPCM750 BMC.</div><div style=\"text-align:left\" dir=\"ltr\">&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; Signed-off-by: Brendan Higgins &lt;<a href=\"mailto:brendanhiggins@google.com\">brendanhiggins@google.com</a>&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; ---</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  arch/arm/Kconfig             |  2 +</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  arch/arm/Makefile            |  1 +</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  arch/arm/mach-npcm/Kconfig   | 50 +++++++++++++++++++++++++</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  arch/arm/mach-npcm/Makefile  |  3 ++</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  arch/arm/mach-npcm/headsmp.S | 17 +++++++++</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  arch/arm/mach-npcm/npcm7xx.c | 34 +++++++++++++++++</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  arch/arm/mach-npcm/platsmp.c | 89 ++++++++++++++++++++++++++++++++++++++++++++</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  7 files changed, 196 insertions(+)</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  create mode 100644 arch/arm/mach-npcm/Kconfig</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  create mode 100644 arch/arm/mach-npcm/Makefile</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  create mode 100644 arch/arm/mach-npcm/headsmp.S</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  create mode 100644 arch/arm/mach-npcm/npcm7xx.c</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  create mode 100644 arch/arm/mach-npcm/platsmp.c</div><div style=\"text-align:left\" dir=\"ltr\">&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig</div><div style=\"text-align:left\" dir=\"ltr\">&gt; index 61a0cb15067e..05543f1cfbde 100644</div><div style=\"text-align:left\" dir=\"ltr\">&gt; --- a/arch/arm/Kconfig</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +++ b/arch/arm/Kconfig</div><div style=\"text-align:left\" dir=\"ltr\">&gt; @@ -782,6 +782,8 @@ source &quot;arch/arm/mach-netx/Kconfig&quot;</div><div style=\"text-align:left\" dir=\"ltr\">&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  source &quot;arch/arm/mach-nomadik/Kconfig&quot;</div><div style=\"text-align:left\" dir=\"ltr\">&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +source &quot;arch/arm/mach-npcm/Kconfig&quot;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  source &quot;arch/arm/mach-nspire/Kconfig&quot;</div><div style=\"text-align:left\" dir=\"ltr\">&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  source &quot;arch/arm/plat-omap/Kconfig&quot;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; diff --git a/arch/arm/Makefile b/arch/arm/Makefile</div><div style=\"text-align:left\" dir=\"ltr\">&gt; index 47d3a1ab08d2..60ca50c7d762 100644</div><div style=\"text-align:left\" dir=\"ltr\">&gt; --- a/arch/arm/Makefile</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +++ b/arch/arm/Makefile</div><div style=\"text-align:left\" dir=\"ltr\">&gt; @@ -191,6 +191,7 @@ machine-$(CONFIG_ARCH_MEDIATEK)             += mediatek</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  machine-$(CONFIG_ARCH_MXS)             += mxs</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  machine-$(CONFIG_ARCH_NETX)            += netx</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  machine-$(CONFIG_ARCH_NOMADIK)         += nomadik</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +machine-$(CONFIG_ARCH_NPCM)            += npcm</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  machine-$(CONFIG_ARCH_NSPIRE)          += nspire</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  machine-$(CONFIG_ARCH_OXNAS)           += oxnas</div><div style=\"text-align:left\" dir=\"ltr\">&gt;  machine-$(CONFIG_ARCH_OMAP1)           += omap1</div><div style=\"text-align:left\" dir=\"ltr\">&gt; diff --git a/arch/arm/mach-npcm/Kconfig b/arch/arm/mach-npcm/Kconfig</div><div style=\"text-align:left\" dir=\"ltr\">&gt; new file mode 100644</div><div style=\"text-align:left\" dir=\"ltr\">&gt; index 000000000000..d47061855439</div><div style=\"text-align:left\" dir=\"ltr\">&gt; --- /dev/null</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +++ b/arch/arm/mach-npcm/Kconfig</div><div style=\"text-align:left\" dir=\"ltr\">&gt; @@ -0,0 +1,50 @@</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +menuconfig ARCH_NPCM</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       bool &quot;Nuvoton NPCM Architecture&quot;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select ARCH_REQUIRE_GPIOLIB</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select USE_OF</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select PINCTRL</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select PINCTRL_NPCM7XX</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +if ARCH_NPCM</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +comment &quot;NPCMX50 CPU type&quot;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +config CPU_NPCM750</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       depends on ARCH_NPCM &amp;&amp; ARCH_MULTI_V7</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       bool &quot;Support for NPCM750 BMC CPU (Poleg)&quot;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select CACHE_L2X0</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select CPU_V7</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select ARM_GIC</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select HAVE_SMP</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select SMP</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select SMP_ON_UP</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select HAVE_ARM_SCU</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select HAVE_ARM_TWD if SMP</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select ARM_ERRATA_458693</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select ARM_ERRATA_720789</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select ARM_ERRATA_742231</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select ARM_ERRATA_754322</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select ARM_ERRATA_764369</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select ARM_ERRATA_794072</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select PL310_ERRATA_588369</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select PL310_ERRATA_727915</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select USB_EHCI_ROOT_HUB_TT</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select USB_ARCH_HAS_HCD</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select USB_ARCH_HAS_EHCI</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select USB_EHCI_HCD</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select USB_ARCH_HAS_OHCI</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select USB_OHCI_HCD</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select USB</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select FIQ</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select CPU_USE_DOMAINS</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select GENERIC_CLOCKEVENTS</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select CLKDEV_LOOKUP</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select COMMON_CLK if OF</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select NPCM750_TIMER</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       select MFD_SYSCON</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       help</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +         Support for NPCM750 BMC CPU (Poleg).</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +         Nuvoton NPCM750 BMC based on the Cortex A9.</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +endif</div><div style=\"text-align:left\" dir=\"ltr\">&gt; diff --git a/arch/arm/mach-npcm/Makefile b/arch/arm/mach-npcm/Makefile</div><div style=\"text-align:left\" dir=\"ltr\">&gt; new file mode 100644</div><div style=\"text-align:left\" dir=\"ltr\">&gt; index 000000000000..78416055b854</div><div style=\"text-align:left\" dir=\"ltr\">&gt; --- /dev/null</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +++ b/arch/arm/mach-npcm/Makefile</div><div style=\"text-align:left\" dir=\"ltr\">&gt; @@ -0,0 +1,3 @@</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +AFLAGS_headsmp.o               += -march=armv7-a</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +obj-$(CONFIG_CPU_NPCM750)      += npcm7xx.o platsmp.o headsmp.o</div><div style=\"text-align:left\" dir=\"ltr\">&gt; diff --git a/arch/arm/mach-npcm/headsmp.S b/arch/arm/mach-npcm/headsmp.S</div><div style=\"text-align:left\" dir=\"ltr\">&gt; new file mode 100644</div><div style=\"text-align:left\" dir=\"ltr\">&gt; index 000000000000..9fccbbd49ed4</div><div style=\"text-align:left\" dir=\"ltr\">&gt; --- /dev/null</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +++ b/arch/arm/mach-npcm/headsmp.S</div><div style=\"text-align:left\" dir=\"ltr\">&gt; @@ -0,0 +1,17 @@</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +/*</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + * Copyright 2017 Google, Inc.</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + *</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + * This program is free software; you can redistribute it and/or modify</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + * it under the terms of the GNU General Public License version 2 as</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + * published by the Free Software Foundation.</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + */</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;linux/linkage.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;linux/init.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;asm/assembler.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +ENTRY(npcm7xx_secondary_startup)</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       safe_svcmode_maskall r0</div><div style=\"text-align:left\" dir=\"ltr\"><br></div><div style=\"text-align:left\" dir=\"ltr\"><div style=\"font-size:12.8px\">I saw you  answered to Florian Fainelli that the BootRom is not starting the secondary CPU in SVC mode. Are you sure? In our engineering npcm7xx revision, Z1, the BootRom indeed started to run it in IRQ mode but we fixed it in the production version, A1, (quite long time ago), I hope you didn&#39;t get an EB with Z1 you can check that in BootBlock console print:</div><div style=\"font-size:12.8px\"><div>&gt; ADC CLK is set to 25000000</div><div>&gt;Last reset was CORST</div><div>&gt;vgaioen=1 and mux gspi.</div><div>&gt;A1 &lt;&lt;====== this is what you should see, if you see Z1 we need to replace your EB</div><div><br></div></div></div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       b       secondary_startup</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +ENDPROC(npcm7xx_secondary_startup)</div><div style=\"text-align:left\" dir=\"ltr\">&gt; diff --git a/arch/arm/mach-npcm/npcm7xx.c b/arch/arm/mach-npcm/npcm7xx.c</div><div style=\"text-align:left\" dir=\"ltr\">&gt; new file mode 100644</div><div style=\"text-align:left\" dir=\"ltr\">&gt; index 000000000000..132e9d587857</div><div style=\"text-align:left\" dir=\"ltr\">&gt; --- /dev/null</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +++ b/arch/arm/mach-npcm/npcm7xx.c</div><div style=\"text-align:left\" dir=\"ltr\">&gt; @@ -0,0 +1,34 @@</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +/*</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + * Copyright (c) 2017 Nuvoton Technology corporation.</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + * Copyright 2017 Google, Inc.</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + *</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + * This program is free software; you can redistribute it and/or modify</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + * it under the terms of the GNU General Public License version 2 as</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + * published by the Free Software Foundation.</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + */</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;linux/kernel.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;linux/types.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;asm/mach/arch.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;asm/mach-types.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;asm/mach/map.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;asm/hardware/cache-l2x0.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#define NPCM7XX_AUX_VAL (L310_AUX_CTRL_INSTR_PREFETCH |                               \\</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +                        L310_AUX_CTRL_DATA_PREFETCH |                         \\</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +                        L310_AUX_CTRL_NS_LOCKDOWN |                           \\</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +                        L310_AUX_CTRL_CACHE_REPLACE_RR |                      \\</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +                        L2C_AUX_CTRL_SHARED_OVERRIDE |                        \\</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +                        L310_AUX_CTRL_FULL_LINE_ZERO)</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +static const char *const npcm7xx_dt_match[] = {</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       &quot;nuvoton,npcm750&quot;,</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       NULL</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +};</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +DT_MACHINE_START(NPCM7XX_DT, &quot;NPCMX50 Chip family&quot;)</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       .atag_offset    = 0x100,</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       .dt_compat      = npcm7xx_dt_match,</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       .l2c_aux_val    = NPCM7XX_AUX_VAL,</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       .l2c_aux_mask   = ~NPCM7XX_AUX_VAL,</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +MACHINE_END</div><div style=\"text-align:left\" dir=\"ltr\">&gt; diff --git a/arch/arm/mach-npcm/platsmp.c b/arch/arm/mach-npcm/platsmp.c</div><div style=\"text-align:left\" dir=\"ltr\">&gt; new file mode 100644</div><div style=\"text-align:left\" dir=\"ltr\">&gt; index 000000000000..144e3e7ec7e6</div><div style=\"text-align:left\" dir=\"ltr\">&gt; --- /dev/null</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +++ b/arch/arm/mach-npcm/platsmp.c</div><div style=\"text-align:left\" dir=\"ltr\">&gt; @@ -0,0 +1,89 @@</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +/*</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + * Copyright 2017 Google, Inc.</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + *</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + * This program is free software; you can redistribute it and/or modify</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + * it under the terms of the GNU General Public License version 2 as</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + * published by the Free Software Foundation.</div><div style=\"text-align:left\" dir=\"ltr\">&gt; + */</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#define pr_fmt(fmt) &quot;PLATSMP: &quot; fmt</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;linux/delay.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;linux/device.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;linux/smp.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;linux/io.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;linux/of.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;linux/of_device.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;linux/of_platform.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;linux/of_address.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;asm/cacheflush.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;asm/smp.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;asm/smp_plat.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#include &lt;asm/smp_scu.h&gt;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +#define NPCM7XX_SCRPAD_REG 0x13c</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +extern void npcm7xx_secondary_startup(void);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +static int npcm7xx_smp_boot_secondary(unsigned int cpu,</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +                                     struct task_struct *idle)</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +{</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       struct device_node *gcr_np;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       void __iomem *gcr_base;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       int ret = 0;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       gcr_np = of_find_compatible_node(NULL, NULL, &quot;nuvoton,npcm750-gcr&quot;);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       if (!gcr_np) {</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +               pr_err(&quot;no gcr device node\\n&quot;);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +               ret = -EFAULT;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +               goto out;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       }</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       gcr_base = of_iomap(gcr_np, 0);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       if (!gcr_base) {</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +               pr_err(&quot;could not iomap gcr at: 0x%llx\\n&quot;, gcr_base);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +               ret = -EFAULT;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +               goto out;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       }</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       /* give boot ROM kernel start address. */</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       iowrite32(__pa_symbol(npcm7xx_secondary_startup), gcr_base +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +                 NPCM7XX_SCRPAD_REG);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       /* make sure npcm7xx_secondary_startup is seen by all observers. */</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       smp_wmb();</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       dsb_sev();</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       /* make sure write buffer is drained */</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       mb();</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +out:</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       iounmap(gcr_base);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       return ret;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +}</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +static void __init npcm7xx_smp_prepare_cpus(unsigned int max_cpus)</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +{</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       struct device_node *scu_np;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       void __iomem *scu_base;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       scu_np = of_find_compatible_node(NULL, NULL, &quot;arm,cortex-a9-scu&quot;);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       if (!scu_np) {</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +               pr_err(&quot;no scu device node\\n&quot;);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +               return;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       }</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       scu_base = of_iomap(scu_np, 0);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       if (!scu_base) {</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +               pr_err(&quot;could not iomap scu at: 0x%llx\\n&quot;, scu_base);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +               return;</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       }</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       scu_enable(scu_base);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +out:</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       iounmap(scu_base);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +}</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +static struct smp_operations npcm7xx_smp_ops __initdata = {</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       .smp_prepare_cpus = npcm7xx_smp_prepare_cpus,</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +       .smp_boot_secondary = npcm7xx_smp_boot_secondary,</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +};</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +</div><div style=\"text-align:left\" dir=\"ltr\">&gt; +CPU_METHOD_OF_DECLARE(npcm7xx_smp, &quot;nuvoton,npcm7xx-smp&quot;, &amp;npcm7xx_smp_ops);</div><div style=\"text-align:left\" dir=\"ltr\">&gt; --</div><div style=\"text-align:left\" dir=\"ltr\">&gt; 2.14.1.581.gf28d330327-goog</div><div style=\"text-align:left\" dir=\"ltr\">&gt;</div></div>","headers":{"Return-Path":"<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","openbmc@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","openbmc@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnjbn5W3Vz9t2r\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 11:31:49 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xnjbn3fpzzDrWC\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 11:31:49 +1000 (AEST)","from mail-oi0-x243.google.com (mail-oi0-x243.google.com\n\t[IPv6:2607:f8b0:4003:c06::243])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xnZxZ3ZZFzDqgy\n\tfor <openbmc@lists.ozlabs.org>; Thu,  7 Sep 2017 06:31:46 +1000 (AEST)","by mail-oi0-x243.google.com with SMTP id h70so5182355oic.4\n\tfor <openbmc@lists.ozlabs.org>; Wed, 06 Sep 2017 13:31:46 -0700 (PDT)","by 10.157.62.18 with HTTP; Wed, 6 Sep 2017 13:31:43 -0700 (PDT)"],"Authentication-Results":["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=\"jJG/Auy2\"; dkim-atps=neutral","lists.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=\"jJG/Auy2\"; dkim-atps=neutral","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:4003:c06::243; helo=mail-oi0-x243.google.com;\n\tenvelope-from=avifishman70@gmail.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"jJG/Auy2\"; dkim-atps=neutral"],"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=pzSciHX/QgmbXkQB/My/bDn53nemF323usXNcTCs3n8=;\n\tb=jJG/Auy2cAh786X4Ji9TPuv5nXQQqXi/3pFr4VC1G6fqaRRK01jSDZeMU+R5B/pG6L\n\tAgke7B3E+S2HGVVJLMSA9ADHNWzP/D5sXz+hlwjG7hnaVy4B6rGTNIy8bLiw+CdIThj7\n\trb6Y9vRXpwhotqrtZVVyG+yXy4tvfr7OefKZIMNqdZs70rW3XpDfczPq0NZRWjl3SIIj\n\t5zrXJc4hrKyjWiHZGRzhrl5AcQVz/UTfim4BGRX9mUAanMBh+vWrKcLFdcQGZW0icrQr\n\thJIdjTJ6+cJb5Vcda98cdqDj/ib2+ZaOtb+H9xsPJi0FVzwQlkp4/oGZFoyjc09M5S2h\n\tzcwQ==","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=pzSciHX/QgmbXkQB/My/bDn53nemF323usXNcTCs3n8=;\n\tb=imR6w5+j4SJgCEX3KXyRe2U+zo1YBgLfMP6JcTB2s8g4EwW1690CH4YLt+TnCt1C5B\n\tGmlZ9Nk3vkx9ctgwMdN2EJNBze79IZk8GW2jFRND18bwBz33BB5nklQKFAwj08MDCkTh\n\tevz3ZhqPPnQrD46jhVDkQGxgF9/0GKq+O3bK6fWfTuPlPbluOH339aPIH9yrB6rq9mBx\n\tkJW2YsDYs4shjlGojJJJ3Es57+qvnvfdbgxSKKBaj6oEGSz9YVt0rfkErEGstLg4HaC6\n\tglFTwl6DGLIgzjUoq8O6fqaCNL2pQKJs9GVX8bqPXuAJBSChNGEtl1YFOz0bVxFpOZbp\n\turzA==","X-Gm-Message-State":"AHPjjUi71OXSV+gUnuhUmckDULXvMFXC+dMrBuCnEfmZzH4SMBf3T0tp\n\tubnx65pVT99QGTmql4JNvNfR/hoeYw==","X-Google-Smtp-Source":"ADKCNb5MFbnLqXJGW9QwLt/T7jBFhtgs6xAy8D+xbeM8GG5Xchulfv3q7SxyakbLh8DmFj7GceSJmqQfQ7HDOkqUm14=","X-Received":"by 10.202.196.142 with SMTP id u136mr518084oif.148.1504729904252;\n\tWed, 06 Sep 2017 13:31:44 -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":"Wed, 6 Sep 2017 23:31:43 +0300","Message-ID":"<CAKKbWA6M13+Od24aVEdJM8VA4b+=Wk7LM46vyj=3ziwpkKLesA@mail.gmail.com>","Subject":"Re: [PATCH v4 1/3] arm: npcm: add basic support for Nuvoton BMCs","To":"Brendan Higgins <brendanhiggins@google.com>","Content-Type":"multipart/alternative; boundary=\"001a113e39486d0c9905588b3b33\"","X-Mailman-Approved-At":"Thu, 07 Sep 2017 11:31:25 +1000","X-BeenThere":"openbmc@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Development list for OpenBMC <openbmc.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/openbmc/>","List-Post":"<mailto:openbmc@lists.ozlabs.org>","List-Help":"<mailto:openbmc-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.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,\n\tlinux-arm-kernel@lists.infradead.org","Errors-To":"openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"openbmc\"\n\t<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"}},{"id":1764459,"web_url":"http://patchwork.ozlabs.org/comment/1764459/","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":"<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","openbmc@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","openbmc@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnjc92pQlz9sCZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 11:32:09 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xnjc91dRfzDrW9\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 11:32:09 +1000 (AEST)","from mail-oi0-x242.google.com (mail-oi0-x242.google.com\n\t[IPv6:2607:f8b0:4003:c06::242])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xnbg03VWvzDqZv\n\tfor <openbmc@lists.ozlabs.org>; Thu,  7 Sep 2017 07:04:12 +1000 (AEST)","by mail-oi0-x242.google.com with SMTP id h70so5233482oic.4\n\tfor <openbmc@lists.ozlabs.org>; Wed, 06 Sep 2017 14:04:11 -0700 (PDT)","by 10.157.62.18 with HTTP; Wed, 6 Sep 2017 14:04:09 -0700 (PDT)"],"Authentication-Results":["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","lists.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","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:4003:c06::242; helo=mail-oi0-x242.google.com;\n\tenvelope-from=avifishman70@gmail.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"p9g27qip\"; dkim-atps=neutral"],"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=ro1SMCvqA/3vDGOWWyX8V6h8hZsdqNHdHrJ4Q7X4nEPi5Sc5baB9R2bAM2PO30Af9n\n\tuwnsdJVpLrT5O+4HwtPZ4lCnO+IdzZf6ovbiwNo3MYYWkNTXJayi8PDhMDe42UvpE6Es\n\txv9BFXn49+I8qgaY1SqJfzHkteNk/Ijayst41PLaKe1WRjHwicWcSnKz0Yf1IZoVvEFm\n\tEliGjmcP+daoLURX63i4CuxvJ4b5ErTkaqlZ/msrNP7fIVrvdknUq3GBEBj7U+EIVGjU\n\tedAwX5lsrr3lmfOUFL5SXB9JUzFcyK4EPPMDBbbDpwIot4+z6PVx2nshrAQqQvOrj3rc\n\tmukg==","X-Gm-Message-State":"AHPjjUi9SFPQ17OJWYEWN8Ff0kbCE4kR9RUK7o5OZDI4eL/wX8TR/ZSa\n\tlFXJ0gdeA5PdjyUSGXGUZmJlnN/AiQ==","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>","Content-Type":"text/plain; charset=\"UTF-8\"","X-Mailman-Approved-At":"Thu, 07 Sep 2017 11:31:25 +1000","X-BeenThere":"openbmc@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Development list for OpenBMC <openbmc.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/openbmc/>","List-Post":"<mailto:openbmc@lists.ozlabs.org>","List-Help":"<mailto:openbmc-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.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,\n\tlinux-arm-kernel@lists.infradead.org","Errors-To":"openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"openbmc\"\n\t<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"}},{"id":1764501,"web_url":"http://patchwork.ozlabs.org/comment/1764501/","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":"<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","openbmc@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","openbmc@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnpQm06kZz9sRY\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 15:09:20 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xnpQl5nCxzDrWJ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 15:09:19 +1000 (AEST)","from mail-qk0-x229.google.com (mail-qk0-x229.google.com\n\t[IPv6:2607:f8b0:400d:c09::229])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xnpQY4wFLzDrVv\n\tfor <openbmc@lists.ozlabs.org>; Thu,  7 Sep 2017 15:09:09 +1000 (AEST)","by mail-qk0-x229.google.com with SMTP id a128so24416200qkc.5\n\tfor <openbmc@lists.ozlabs.org>; Wed, 06 Sep 2017 22:09:09 -0700 (PDT)","by 10.140.33.230 with HTTP; Wed, 6 Sep 2017 22:09:05 -0700 (PDT)"],"Authentication-Results":["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","lists.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","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=google.com\n\t(client-ip=2607:f8b0:400d:c09::229; helo=mail-qk0-x229.google.com;\n\tenvelope-from=brendanhiggins@google.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"Es++FaGg\"; dkim-atps=neutral"],"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=GDFa98TDOheyOQEykUoAh7Y4fOuyMyoO6eEwXo+bMY0ns4dmU3Vcwod5H7AMSMfRYt\n\tq0QhVIx0jpQL8Dhg+uF+Zr0aMCl5F0RAiQ/2hSgeqWr+J/TaJZ3SzXvUNVB/Y1Bf5wOH\n\te1WVkXIOND8Oy3A2MitHhqWJTmAPCV89Gkg9teea9+/ntTV/zFIj7xFlSor1ZpQ+zBln\n\t10nqXTOFUGvBehPgSseJN7thjtmroDYXJRy9vO3ZiHOKakUJuPqSNbgSJ2wM6X3VmzxU\n\t62oBnAzttyZ6wIJ1VvJuyyyXzK0LjN8sd4eouRNwcPWcQ8hHfgtM9JpN5j4lxEwqQ9oJ\n\t9QEA==","X-Gm-Message-State":"AHPjjUhhb+3RSGmitVi1LLiGxw5fWIvevYWf+S7XWlAgVVmRgaQJRxBw\n\tJkttrgu3cE6dbcvCGWRoheQzVS23wY/7","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>","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"openbmc@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Development list for OpenBMC <openbmc.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/openbmc/>","List-Post":"<mailto:openbmc@lists.ozlabs.org>","List-Help":"<mailto:openbmc-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.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>, linux-arm-kernel@lists.infradead.org","Errors-To":"openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"openbmc\"\n\t<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"}},{"id":1764602,"web_url":"http://patchwork.ozlabs.org/comment/1764602/","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":"<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","openbmc@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","openbmc@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnvyn4xcnz9sRV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 19:18:57 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xnvyn2tZ0zDrWb\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 19:18:57 +1000 (AEST)","from mail-ua0-x244.google.com (mail-ua0-x244.google.com\n\t[IPv6:2607:f8b0:400c:c08::244])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xnvyf3cqwzDrTT\n\tfor <openbmc@lists.ozlabs.org>; Thu,  7 Sep 2017 19:18:50 +1000 (AEST)","by mail-ua0-x244.google.com with SMTP id k23so2932099uaf.3\n\tfor <openbmc@lists.ozlabs.org>; Thu, 07 Sep 2017 02:18:50 -0700 (PDT)","by 10.176.90.193 with HTTP; Thu, 7 Sep 2017 02:18:47 -0700 (PDT)"],"Authentication-Results":["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","lists.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","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400c:c08::244; helo=mail-ua0-x244.google.com;\n\tenvelope-from=tmaimon77@gmail.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"dKaKuui7\"; dkim-atps=neutral"],"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=h+Qo/8TT7InFeLtXsA76YM00r7jKU0dhpA/48vKlaDRM+xYXRdqWP8NuCeaJvX5fwa\n\tqs9IDWWFFqC79dMVlr3PsMYQhj4pO1G+EuzBfBgZYY4AWt4Z84Uj4Wp0u00qWH1UnYwa\n\ti9s8bWgwslM/19FzuMNGybmYxtagPxW53DmjcM6PDO7Fo0rgb2OzvK1zzFYnPDIZgkKV\n\tCSUnAXWUrVPNmrF4cJO+BCqky6Z70xXPVp1229KoQkHKaxsYn8ZWdDwq/DjDsMw+9pIv\n\tqp6FQIOkVEdXFnlQrxnjOZLGCDl9SH8FyifRj42KHCcoR09yO55IJKEAYsxmmuMUcrkz\n\t0I4Q==","X-Gm-Message-State":"AHPjjUgoDNAmtuSSzl9uZTgl8zitVCHPkNTZtC0nKfF8sprqK+fASMnl\n\tc85q0rH23+v+wz0sf3i/jj34mjon7A==","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>","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"openbmc@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Development list for OpenBMC <openbmc.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/openbmc/>","List-Post":"<mailto:openbmc@lists.ozlabs.org>","List-Help":"<mailto:openbmc-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.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,\n\tlinux-arm-kernel@lists.infradead.org","Errors-To":"openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"openbmc\"\n\t<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"}},{"id":1764777,"web_url":"http://patchwork.ozlabs.org/comment/1764777/","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":"<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","openbmc@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","openbmc@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xp3lM2GVRz9t2v\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  8 Sep 2017 01:09:35 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xp3lM10ryzDqXy\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  8 Sep 2017 01:09:35 +1000 (AEST)","from mail-oi0-x242.google.com (mail-oi0-x242.google.com\n\t[IPv6:2607:f8b0:4003:c06::242])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xp3ks6xkyzDrXT\n\tfor <openbmc@lists.ozlabs.org>; Fri,  8 Sep 2017 01:09:09 +1000 (AEST)","by mail-oi0-x242.google.com with SMTP id g15so6914582oib.3\n\tfor <openbmc@lists.ozlabs.org>; Thu, 07 Sep 2017 08:09:09 -0700 (PDT)","by 10.157.62.18 with HTTP; Thu, 7 Sep 2017 08:09:06 -0700 (PDT)"],"Authentication-Results":["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","lists.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","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:4003:c06::242; helo=mail-oi0-x242.google.com;\n\tenvelope-from=avifishman70@gmail.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"S9H6oDdj\"; dkim-atps=neutral"],"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=CulsQl6/9vcKbycdxYLcxsS/6fSNwj4pBRxDsNu1X/4NZq3y0qrmvbMVt+uWcLHvdj\n\twmC5hMZbL/UlG0JmVzk4gzp2MffPKPUkWIXb8ReDjK3Y6VT05dqP/+oq2WNpVdGDTEcE\n\t56N4KWzp0s3GJ2XHeVm5vDn4Di7/QhoNxtPsZ2Pjz7Oa0O/NJgf+rWic/O138JVu9Gd8\n\tKI24ddhRqCtKXvQSljZzrp2zSUULGBBTgHrpc4l4BbaYqQESETMU6z1Lc/ssAIDIoxYY\n\tdDUHOrOVjY/T0aavhDvMnUBm+vttCPqa/hUyZP7paVLCbynmIl6dGQWVwZaZ4yIEVNZC\n\tT12Q==","X-Gm-Message-State":"AHPjjUjiuWoRXEaXcjHclws7qfzO1qVOcGWDMEIZB9r/pvLzBXjiIcku\n\tQnyemaWm8K2r6kD7ApJJs/M+ekYY+w==","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>","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"openbmc@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Development list for OpenBMC <openbmc.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/openbmc/>","List-Post":"<mailto:openbmc@lists.ozlabs.org>","List-Help":"<mailto:openbmc-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.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>, linux-arm-kernel@lists.infradead.org","Errors-To":"openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"openbmc\"\n\t<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"}}]