linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: shawnguo@kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	Fabio Estevam <festevam@gmail.com>,
	arnd@arndb.de, linux-imx@nxp.com, kernel@pengutronix.de
Subject: [PATCH 08/13] ARM: imx35: Retrieve the IIM base address from devicetree
Date: Wed, 16 Sep 2020 17:55:17 -0300	[thread overview]
Message-ID: <20200916205522.8783-9-festevam@gmail.com> (raw)
In-Reply-To: <20200916205522.8783-1-festevam@gmail.com>

Now that imx35 has been converted to a devicetree-only platform,
retrieve the IIM base address from devicetree.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/mach-imx/cpu-imx35.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/cpu-imx35.c b/arch/arm/mach-imx/cpu-imx35.c
index ebb3cdabd506..80e7d8ab9f1b 100644
--- a/arch/arm/mach-imx/cpu-imx35.c
+++ b/arch/arm/mach-imx/cpu-imx35.c
@@ -5,6 +5,7 @@
  * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
  */
 #include <linux/module.h>
+#include <linux/of_address.h>
 #include <linux/io.h>
 
 #include "hardware.h"
@@ -14,9 +15,15 @@ static int mx35_cpu_rev = -1;
 
 static int mx35_read_cpu_rev(void)
 {
+	void __iomem *iim_base;
+	struct device_node *np;
 	u32 rev;
 
-	rev = imx_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV));
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx35-iim");
+	iim_base = of_iomap(np, 0);
+	BUG_ON(!iim_base);
+
+	rev = imx_readl(iim_base + MXC_IIMSREV);
 	switch (rev) {
 	case 0x00:
 		return IMX_CHIP_REVISION_1_0;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-09-16 20:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16 20:55 [PATCH 00/13] ARM: imx: Further cleanups due to dt-only conversion Fabio Estevam
2020-09-16 20:55 ` [PATCH 01/13] ARM: dts: imx27: Fix the register range for CCM Fabio Estevam
2020-09-16 20:55 ` [PATCH 02/13] ARM: dts: imx27: Add the SYSCTRL description Fabio Estevam
2020-09-16 20:55 ` [PATCH 03/13] ARM: imx27: Retrieve the SYSCTRL base address from devicetree Fabio Estevam
2020-09-16 21:30   ` Arnd Bergmann
2020-09-16 21:36     ` Fabio Estevam
2020-09-16 20:55 ` [PATCH 04/13] ARM: imx27: Retrieve the CCM " Fabio Estevam
2020-09-16 20:55 ` [PATCH 05/13] ARM: imx31: Retrieve the IIM " Fabio Estevam
2020-09-16 20:55 ` [PATCH 06/13] ARM: imx3: Retrieve the CCM " Fabio Estevam
2020-09-16 20:55 ` [PATCH 07/13] ARM: imx3: Retrieve the AVIC " Fabio Estevam
2020-09-16 20:55 ` Fabio Estevam [this message]
2020-09-16 20:55 ` [PATCH 09/13] ARM: imx: Remove unused IO_ADDRESS() macros Fabio Estevam
2020-09-16 21:34   ` Arnd Bergmann
2020-09-16 21:56     ` Fabio Estevam
2020-09-17  7:16       ` Arnd Bergmann
2020-09-17 10:17         ` Fabio Estevam
2020-09-29 13:11         ` Linus Walleij
2020-09-29 13:21           ` Arnd Bergmann
2020-09-30  9:34             ` Linus Walleij
2020-09-16 20:55 ` [PATCH 10/13] clk: imx: imx27: Remove mx27_clocks_init() Fabio Estevam
2020-09-16 20:55 ` [PATCH 11/13] clk: imx: imx31: Remove mx31_clocks_init() Fabio Estevam
2020-09-16 20:55 ` [PATCH 12/13] clk: imx: imx35: Remove mx35_clocks_init() Fabio Estevam
2020-09-16 20:55 ` [PATCH 13/13] clk: imx: imx21: Remove clock driver Fabio Estevam

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=20200916205522.8783-9-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=arnd@arndb.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=shawnguo@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).