summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/cpu-imx5.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2014-07-19 18:56:39 (GMT)
committerOlof Johansson <olof@lixom.net>2014-07-19 18:56:39 (GMT)
commitb40abaf07fa19c5aa3e649369ed8e0f9df1d2eda (patch)
tree6a3196ae1613619c0b85fafede012c7b78d0344c /arch/arm/mach-imx/cpu-imx5.c
parent9b03c6041c4e47a5d2c2eca3c2dd2239e7ae6ce6 (diff)
parent4349c4298f676815bf7ad146cf37e76843054783 (diff)
downloadlinux-b40abaf07fa19c5aa3e649369ed8e0f9df1d2eda.tar.xz
Merge tag 'imx-soc-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/soc
Merge "ARM: imx: SoC changes for 3.17" from Shawn Guo: The i.MX SoC changes for 3.17: - Add devicetree support for i.MX1 and i.MX21 clock driver - Use CLOCKSOURCE_OF_DECLARE() to initialize timer for DT targets - Use of_clk_init() to initialize i.MX25 and i.MX27 clock driver in device tree boot - Remove i.MX1 camera support - Remove i.MX27 IP Camera and Lite-Kit board support - Add suspend and cpuidle support for i.mx6sx - Clean up unused clk_register_clkdev() lookups - Update imx-weim bus driver to support populating devices on a simple bus - Switch i.MX27 and i.MX6QDL clock driver to use macro for clock IDs - Make i.MX51 a DT only platform and clean up the non-DT support code - Support disabling supervisor protect via DT - Random defconfig updates * tag 'imx-soc-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (69 commits) ARM: imx: clk-vf610: fix FlexCAN clock gating ARM: i.MX: Use CLOCKSOURCE_OF_DECLARE() for DT targets ARM: i.MX53: globally disable supervisor protect ARM: i.MX: allow disabling supervisor protect via DT ARM: i.MX27 clk: Add 26 MHz oscillator circuit clock gate ARM: i.MX27 clk: Remove unused definitions ARM: i.MX27 clk: Introduce DT include for clock provider ARM: i.MX: Remove Freescale Logic Product Development i.MX27 Lite-Kit board support ARM: i.MX: Remove excess symbols ARCH_MX1, ARCH_MX25 and MACH_MX27 ARM: i.MX: Remove i.MX1 camera support ARM: imx: use PTR_ERR_OR_ZERO bus: imx-weim: populate devices on a simple bus ARM: imx: build cpu_is_imx6sl function conditionally ARM: imx: imx6sx uses imx6q cpuidle code ARM: imx: drop PL310 errata 588369 and 727915 ARM: imx_v6_v7_defconfig: add FSL_EDMA and PRINTK_TIME ARM: imx: clk-imx6sx: register SSI/SSI_IPG as shared gate clocks ARM: imx_v6_v7_defconfig: Enable flexcan driver for can support ARM: imx_v6_v7_defconfig: Enable STMPE gpio support ARM: imx: mark .dt_compat as const ... Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-imx/cpu-imx5.c')
-rw-r--r--arch/arm/mach-imx/cpu-imx5.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/cpu-imx5.c b/arch/arm/mach-imx/cpu-imx5.c
index c1c99a7..3403bac 100644
--- a/arch/arm/mach-imx/cpu-imx5.c
+++ b/arch/arm/mach-imx/cpu-imx5.c
@@ -16,6 +16,8 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
#include "hardware.h"
#include "common.h"
@@ -24,10 +26,26 @@ static int mx5_cpu_rev = -1;
#define IIM_SREV 0x24
+static u32 imx5_read_srev_reg(const char *compat)
+{
+ void __iomem *iim_base;
+ struct device_node *np;
+ u32 srev;
+
+ np = of_find_compatible_node(NULL, NULL, compat);
+ iim_base = of_iomap(np, 0);
+ WARN_ON(!iim_base);
+
+ srev = readl(iim_base + IIM_SREV) & 0xff;
+
+ iounmap(iim_base);
+
+ return srev;
+}
+
static int get_mx51_srev(void)
{
- void __iomem *iim_base = MX51_IO_ADDRESS(MX51_IIM_BASE_ADDR);
- u32 rev = readl(iim_base + IIM_SREV) & 0xff;
+ u32 rev = imx5_read_srev_reg("fsl,imx51-iim");
switch (rev) {
case 0x0:
@@ -77,8 +95,7 @@ int __init mx51_neon_fixup(void)
static int get_mx53_srev(void)
{
- void __iomem *iim_base = MX51_IO_ADDRESS(MX53_IIM_BASE_ADDR);
- u32 rev = readl(iim_base + IIM_SREV) & 0xff;
+ u32 rev = imx5_read_srev_reg("fsl,imx53-iim");
switch (rev) {
case 0x0: