mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	barebox@lists.infradead.org
Subject: [PATCH 10/13] ARM: mvebu: armada-xp: Limit PUP access to Armada XP
Date: Fri, 10 Apr 2015 03:03:47 +0200	[thread overview]
Message-ID: <1428627830-17281-11-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <1428627830-17281-1-git-send-email-sebastian.hesselbarth@gmail.com>

Commit 6638760c225c37f90e822ebf4dd8f0d2cd0b0ef3
 ("ARM: mvebu: Enable PUP register")
correctly enables devices that are disabled after boot-up due to
some Design For Testability registers.

However, although harmless on Armada 370, call the code conditionally
on Armada XP only. While at it, move PUP register defines to SYSCTL
registers where they belong to.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: barebox@lists.infradead.org
Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/arm/mach-mvebu/armada-370-xp.c                   | 18 ++++++++++++++----
 arch/arm/mach-mvebu/include/mach/armada-370-xp-regs.h |  3 +--
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
index 9ba3247805d1..8e1463dd8b11 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/armada-370-xp.c
@@ -112,6 +112,18 @@ static void __noreturn armada_370_xp_reset_cpu(unsigned long addr)
 		;
 }
 
+static int armada_xp_init_soc(struct device_node *root)
+{
+	u32 reg;
+
+	/* Enable GBE0, GBE1, LCD and NFC PUP */
+	reg = readl(ARMADA_XP_PUP_ENABLE);
+	reg |= GE0_PUP_EN | GE1_PUP_EN | LCD_PUP_EN | NAND_PUP_EN | SPI_PUP_EN;
+	writel(reg, ARMADA_XP_PUP_ENABLE);
+
+	return 0;
+}
+
 static int armada_370_xp_init_soc(struct device_node *root, void *context)
 {
 	unsigned long phys_base, phys_size;
@@ -137,10 +149,8 @@ static int armada_370_xp_init_soc(struct device_node *root, void *context)
 
 	armada_370_xp_soc_id_fixup();
 
-	/* Enable peripherals PUP */
-	reg = readl(ARMADA_XP_PUP_ENABLE_BASE);
-	reg |= GE0_PUP_EN | GE1_PUP_EN | LCD_PUP_EN | NAND_PUP_EN | SPI_PUP_EN;
-	writel(reg, ARMADA_XP_PUP_ENABLE_BASE);
+	if (of_machine_is_compatible("marvell,armadaxp"))
+		armada_xp_init_soc(root);
 
 	return 0;
 }
diff --git a/arch/arm/mach-mvebu/include/mach/armada-370-xp-regs.h b/arch/arm/mach-mvebu/include/mach/armada-370-xp-regs.h
index 2a6e6d1aec2c..1dad05317211 100644
--- a/arch/arm/mach-mvebu/include/mach/armada-370-xp-regs.h
+++ b/arch/arm/mach-mvebu/include/mach/armada-370-xp-regs.h
@@ -37,8 +37,7 @@
 #define ARMADA_370_XP_SAR_HIGH		(ARMADA_370_XP_SYSCTL_BASE + 0x034)
 #define ARMADA_370_XP_CPU_SOC_ID	(ARMADA_370_XP_SYSCTL_BASE + 0x03c)
 #define  CPU_SOC_ID_DEVICE_MASK		0xffff
-
-#define ARMADA_XP_PUP_ENABLE_BASE       (ARMADA_370_XP_INT_REGS_BASE + 0x1864c)
+#define ARMADA_XP_PUP_ENABLE		(ARMADA_370_XP_SYSCTL_BASE + 0x44c)
 #define  GE0_PUP_EN			BIT(0)
 #define  GE1_PUP_EN			BIT(1)
 #define  LCD_PUP_EN			BIT(2)
-- 
2.1.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2015-04-10  1:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10  1:03 [PATCH 00/13] Add support for Lenovo ix4-300d NAS Sebastian Hesselbarth
2015-04-10  1:03 ` [PATCH 01/13] net: phy: Support Marvell 88E1318S PHY Sebastian Hesselbarth
2015-05-02 16:53   ` Ezequiel Garcia
2015-05-02 20:28     ` Ezequiel Garcia
2015-05-03  9:50       ` Sebastian Hesselbarth
2015-05-03 22:47         ` Sebastian Hesselbarth
2015-05-05 12:06           ` Ezequiel Garcia
2015-04-10  1:03 ` [PATCH 02/13] gpio: Add driver for 74x164 compatible shift-registers Sebastian Hesselbarth
2015-04-10  1:03 ` [PATCH 03/13] spi: ath79: move spidelay from spi-bitbang-txrx Sebastian Hesselbarth
2015-04-10  1:03 ` [PATCH 04/13] spi: Add SPI GPIO bitbang driver Sebastian Hesselbarth
2015-04-10  1:03 ` [PATCH 05/13] bus: mvebu-mbus: Remove coherency attribute Sebastian Hesselbarth
2015-04-10  1:03 ` [PATCH 06/13] bus: mvebu-mbus: Drop device reference Sebastian Hesselbarth
2015-04-10  1:03 ` [PATCH 07/13] bus: mvebu-mbus: Convert mbus platform driver to direct driver Sebastian Hesselbarth
2015-04-10  1:03 ` [PATCH 08/13] ARM: mvebu: Move PCIe register defines to socid.h Sebastian Hesselbarth
2015-04-10  1:03 ` [PATCH 09/13] ARM: mvebu: armada-xp: Fixup broken MV78230-A0 SoC ID Sebastian Hesselbarth
2015-04-10  1:03 ` Sebastian Hesselbarth [this message]
2015-04-10  1:03 ` [PATCH 11/13] ARM: mvebu: armada-xp: Use MBUS_ERR_PROP_EN define Sebastian Hesselbarth
2015-04-10  1:03 ` [PATCH 12/13] ARM: mvebu: armada-xp: Sort boards and images alphabetically Sebastian Hesselbarth
2015-04-10  1:03 ` [PATCH 13/13] ARM: mvebu: armada-xp: Add Lenovo Iomega ix4-300d Sebastian Hesselbarth
2015-04-14  8:43 ` [PATCH 00/13] Add support for Lenovo ix4-300d NAS Sascha Hauer
2015-04-14  9:42   ` Sebastian Hesselbarth

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=1428627830-17281-11-git-send-email-sebastian.hesselbarth@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=thomas.petazzoni@free-electrons.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