From: Alexandru Gagniuc <alex.g@adaptrum.com>
To: vgupta@synopsys.com
Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org,
robh+dt@kernel.org, Alexandru Gagniuc <alex.g@adaptrum.com>
Subject: [PATCH v2 1/2] ARC: [plat-anarion] Add early boot workarounds for Anarion SOC
Date: Fri, 4 Aug 2017 13:03:52 -0700 [thread overview]
Message-ID: <20170804200353.15653-1-alex.g@adaptrum.com> (raw)
In-Reply-To: <20170728220707.13960-3-alex.g@adaptrum.com>
An ARC, the interrupts are enabled globally, rather than per-line, as
drivers request it. Thus, we need to make sure that peripherals don't
generate any before the respective drivers are probed.
The GMAC is infamous for spamming interrupts, so it must be kept in
reset until the driver is probed and interrupt mapping established.
Signed-off-by: Alexandru Gagniuc <alex.g@adaptrum.com>
---
Changes since v1:
* None
arch/arc/Kconfig | 1 +
arch/arc/Makefile | 1 +
arch/arc/plat-anarion/Kconfig | 10 ++++++++++
arch/arc/plat-anarion/Makefile | 7 +++++++
arch/arc/plat-anarion/platform.c | 39 +++++++++++++++++++++++++++++++++++++++
5 files changed, 58 insertions(+)
create mode 100644 arch/arc/plat-anarion/Kconfig
create mode 100644 arch/arc/plat-anarion/Makefile
create mode 100644 arch/arc/plat-anarion/platform.c
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index a545969..dff8423 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -100,6 +100,7 @@ source "arch/arc/plat-sim/Kconfig"
source "arch/arc/plat-tb10x/Kconfig"
source "arch/arc/plat-axs10x/Kconfig"
#New platform adds here
+source "arch/arc/plat-anarion/Kconfig"
source "arch/arc/plat-eznps/Kconfig"
endmenu
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index 44ef35d..9bc0048 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -109,6 +109,7 @@ core-y += arch/arc/boot/dts/
core-$(CONFIG_ARC_PLAT_SIM) += arch/arc/plat-sim/
core-$(CONFIG_ARC_PLAT_TB10X) += arch/arc/plat-tb10x/
+core-$(CONFIG_ARC_PLAT_ANARION) += arch/arc/plat-anarion/
core-$(CONFIG_ARC_PLAT_AXS10X) += arch/arc/plat-axs10x/
core-$(CONFIG_ARC_PLAT_EZNPS) += arch/arc/plat-eznps/
diff --git a/arch/arc/plat-anarion/Kconfig b/arch/arc/plat-anarion/Kconfig
new file mode 100644
index 0000000..632c7be
--- /dev/null
+++ b/arch/arc/plat-anarion/Kconfig
@@ -0,0 +1,10 @@
+#
+# (C) Copyright 2017 Adaptrum, Inc.
+# Written by Alexandru Gagniuc <alex.g@adaptrum.com> for Adaptrum, Inc.
+# Licensed under the GPLv2 or (at your option) any later version.
+#
+
+menuconfig ARC_PLAT_ANARION
+ bool "Adaptrum Anarion based platforms"
+ help
+ Support for Adaptrum Anarion based ARC platforms.
diff --git a/arch/arc/plat-anarion/Makefile b/arch/arc/plat-anarion/Makefile
new file mode 100644
index 0000000..9596a41
--- /dev/null
+++ b/arch/arc/plat-anarion/Makefile
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2017 Adaptrum, Inc.
+# Written by Alexandru Gagniuc <alex.g@adaptrum.com> for Adaptrum, Inc.
+# Licensed under the GPLv2 or (at your option) any later version.
+#
+
+obj-y := platform.o
diff --git a/arch/arc/plat-anarion/platform.c b/arch/arc/plat-anarion/platform.c
new file mode 100644
index 0000000..ef0d381
--- /dev/null
+++ b/arch/arc/plat-anarion/platform.c
@@ -0,0 +1,39 @@
+/*
+ * Workarounds for Adaptrum Anarion SOC
+ *
+ * Copyright (C) 2017, Adaptrum, Inc.
+ * (Written by Alexandru Gagniuc <alex.g at adaptrum.com> for Adaptrum, Inc.)
+ * Licensed under the GPLv2 or (at your option) any later version.
+ */
+
+#include <asm/io.h>
+#include <linux/init.h>
+#include <asm/mach_desc.h>
+
+#define GMAC0_RESET 0xf2018000
+#define GMAC1_RESET 0xf2018100
+
+/* This works around an issue where the GMAC will generate interrupts before
+ * the driver is probed, confusing the heck out of the early boot.
+ */
+static void __init anarion_gmac_irq_storm_workaround(void)
+{
+ writel(1, (void *)GMAC0_RESET);
+ writel(1, (void *)GMAC1_RESET);
+}
+
+static void __init anarion_early_init(void)
+{
+ anarion_gmac_irq_storm_workaround();
+ /* Please, no more workarounds!!! */
+}
+
+static const char *anarion_compat[] __initconst = {
+ "adaptrum,anarion",
+ NULL,
+};
+
+MACHINE_START(ANARION, "anarion")
+ .dt_compat = anarion_compat,
+ .init_early = anarion_early_init,
+MACHINE_END
--
2.9.3
next prev parent reply other threads:[~2017-08-04 20:04 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-28 22:07 [PATCH 0/5] Initial support for Adaptrum " Alexandru Gagniuc
2017-07-28 22:07 ` [PATCH 1/5] of: Add vendor prefix for Adaptrum, Inc Alexandru Gagniuc
2017-07-29 14:48 ` Andreas Färber
2017-08-03 23:25 ` Rob Herring
2017-07-28 22:07 ` [PATCH 2/5] ARC: [plat-anarion] Add early boot workarounds for Anarion SOC Alexandru Gagniuc
2017-08-04 20:03 ` Alexandru Gagniuc [this message]
2017-08-04 20:03 ` [PATCH v2 2/2] ARC: DTS: Add device-tree for Anarion-based development board Alexandru Gagniuc
2017-07-28 22:07 ` [PATCH 3/5] net: stmmac: Add Adaptrum Anarion GMAC glue layer Alexandru Gagniuc
2017-07-29 2:01 ` David Miller
2017-07-31 15:11 ` Alex
2017-08-03 23:22 ` Rob Herring
2017-08-03 23:26 ` Rob Herring
2017-07-28 22:07 ` [PATCH 4/5] mtd: spi-nor: Add driver for Adaptrum Anarion QSPI controller Alexandru Gagniuc
2017-07-29 9:34 ` Marek Vasut
2017-07-31 17:17 ` Alexandru Gagniuc
2017-07-31 21:33 ` Marek Vasut
2017-07-31 22:20 ` Alexandru Gagniuc
2017-07-31 22:43 ` Marek Vasut
2017-07-31 22:59 ` Alexandru Gagniuc
2017-08-04 20:14 ` [PATCH v2 6/7] " Alexandru Gagniuc
2017-08-04 20:14 ` [PATCH v2 7/7] dt-bindings: Add documentation for adaptrum,anarion-quadspi Alexandru Gagniuc
2017-07-31 20:54 ` [PATCH 4/5] mtd: spi-nor: Add driver for Adaptrum Anarion QSPI controller Alexandru Gagniuc
2017-07-31 21:35 ` Marek Vasut
2017-07-29 19:03 ` kbuild test robot
2017-07-28 22:07 ` [PATCH 5/5] ARC: DTS: Add device-tree for Anarion-based development board Alexandru Gagniuc
2017-07-31 6:32 ` Vineet Gupta
2017-07-31 15:08 ` Alex
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170804200353.15653-1-alex.g@adaptrum.com \
--to=alex.g@adaptrum.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=robh+dt@kernel.org \
--cc=vgupta@synopsys.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome