From: shawn.guo@freescale.com (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 17/20] ARM: imx5: move init hooks into mach-imx5x.c
Date: Tue, 20 May 2014 16:45:35 +0800 [thread overview]
Message-ID: <1400575538-21136-18-git-send-email-shawn.guo@freescale.com> (raw)
In-Reply-To: <1400575538-21136-1-git-send-email-shawn.guo@freescale.com>
These imx5 init_early[late] hooks are called only from mach-imx5x.c.
Let's move them into mach-imx5x.c.
While at it, replace the static mapping in imx51_ipu_mipi_setup() with
dynamic mapping. Also this function and imx_src_init() do not
necessarily to be called at .init_early hook, so move them into
.init_machine.
The mxc_iomux_v3_init() is dropped from imx51_init_early() in the
moving, since it's only needed by non-DT boot.
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/mach-imx/common.h | 4 ----
arch/arm/mach-imx/mach-imx51.c | 39 +++++++++++++++++++++++++++++++++++++
arch/arm/mach-imx/mach-imx53.c | 11 +++++++++++
arch/arm/mach-imx/mm-imx5.c | 44 ------------------------------------------
4 files changed, 50 insertions(+), 48 deletions(-)
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index 1156bf6..b480f0b 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -34,8 +34,6 @@ void imx25_init_early(void);
void imx27_init_early(void);
void imx31_init_early(void);
void imx35_init_early(void);
-void imx51_init_early(void);
-void imx53_init_early(void);
void mxc_init_irq(void __iomem *);
void tzic_init_irq(void);
void mx1_init_irq(void);
@@ -50,8 +48,6 @@ void imx25_soc_init(void);
void imx27_soc_init(void);
void imx31_soc_init(void);
void imx35_soc_init(void);
-void imx51_init_late(void);
-void imx53_init_late(void);
void epit_timer_init(void __iomem *base, int irq);
void mxc_timer_init(void __iomem *, int);
void mxc_timer_init_dt(struct device_node *);
diff --git a/arch/arm/mach-imx/mach-imx51.c b/arch/arm/mach-imx/mach-imx51.c
index a849d43..a2027d2 100644
--- a/arch/arm/mach-imx/mach-imx51.c
+++ b/arch/arm/mach-imx/mach-imx51.c
@@ -10,6 +10,7 @@
* http://www.gnu.org/copyleft/gpl.html
*/
+#include <linux/io.h>
#include <linux/irq.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
@@ -17,18 +18,56 @@
#include <asm/mach/time.h>
#include "common.h"
+#include "hardware.h"
#include "mx51.h"
+static void __init imx51_init_early(void)
+{
+ mxc_set_cpu_type(MXC_CPU_MX51);
+}
+
+/*
+ * The MIPI HSC unit has been removed from the i.MX51 Reference Manual by
+ * the Freescale marketing division. However this did not remove the
+ * hardware from the chip which still needs to be configured for proper
+ * IPU support.
+ */
+#define MX51_MIPI_HSC_BASE 0x83fdc000
+static void __init imx51_ipu_mipi_setup(void)
+{
+ void __iomem *hsc_addr;
+
+ hsc_addr = ioremap(MX51_MIPI_HSC_BASE, SZ_16K);
+ WARN_ON(!hsc_addr);
+
+ /* setup MIPI module to legacy mode */
+ __raw_writel(0xf00, hsc_addr);
+
+ /* CSI mode: reserved; DI control mode: legacy (from Freescale BSP) */
+ __raw_writel(__raw_readl(hsc_addr + 0x800) | 0x30ff,
+ hsc_addr + 0x800);
+
+ iounmap(hsc_addr);
+}
+
static void __init imx51_dt_init(void)
{
struct platform_device_info devinfo = { .name = "cpufreq-cpu0", };
mxc_arch_reset_init_dt();
+ imx51_ipu_mipi_setup();
+ imx_src_init();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
platform_device_register_full(&devinfo);
}
+static void __init imx51_init_late(void)
+{
+ mx51_neon_fixup();
+ imx51_pm_init();
+}
+
static const char *imx51_dt_board_compat[] __initconst = {
"fsl,imx51",
NULL
diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
index 9a066af..40005b8 100644
--- a/arch/arm/mach-imx/mach-imx53.c
+++ b/arch/arm/mach-imx/mach-imx53.c
@@ -24,6 +24,12 @@
#include "hardware.h"
#include "mx53.h"
+static void __init imx53_init_early(void)
+{
+ mxc_set_cpu_type(MXC_CPU_MX53);
+ imx_src_init();
+}
+
static void __init imx53_dt_init(void)
{
mxc_arch_reset_init_dt();
@@ -31,6 +37,11 @@ static void __init imx53_dt_init(void)
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
+static void __init imx53_init_late(void)
+{
+ imx53_pm_init();
+}
+
static const char *imx53_dt_board_compat[] __initconst = {
"fsl,imx53",
NULL
diff --git a/arch/arm/mach-imx/mm-imx5.c b/arch/arm/mach-imx/mm-imx5.c
index 9e43e87..768fede 100644
--- a/arch/arm/mach-imx/mm-imx5.c
+++ b/arch/arm/mach-imx/mm-imx5.c
@@ -59,47 +59,3 @@ void __init mx53_map_io(void)
{
iotable_init(mx53_io_desc, ARRAY_SIZE(mx53_io_desc));
}
-
-/*
- * The MIPI HSC unit has been removed from the i.MX51 Reference Manual by
- * the Freescale marketing division. However this did not remove the
- * hardware from the chip which still needs to be configured for proper
- * IPU support.
- */
-static void __init imx51_ipu_mipi_setup(void)
-{
- void __iomem *hsc_addr;
- hsc_addr = MX51_IO_ADDRESS(MX51_MIPI_HSC_BASE_ADDR);
-
- /* setup MIPI module to legacy mode */
- __raw_writel(0xf00, hsc_addr);
-
- /* CSI mode: reserved; DI control mode: legacy (from Freescale BSP) */
- __raw_writel(__raw_readl(hsc_addr + 0x800) | 0x30ff,
- hsc_addr + 0x800);
-}
-
-void __init imx51_init_early(void)
-{
- imx51_ipu_mipi_setup();
- mxc_set_cpu_type(MXC_CPU_MX51);
- mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR));
- imx_src_init();
-}
-
-void __init imx53_init_early(void)
-{
- mxc_set_cpu_type(MXC_CPU_MX53);
- imx_src_init();
-}
-
-void __init imx51_init_late(void)
-{
- mx51_neon_fixup();
- imx51_pm_init();
-}
-
-void __init imx53_init_late(void)
-{
- imx53_pm_init();
-}
--
1.8.3.2
next prev parent reply other threads:[~2014-05-20 8:45 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 8:45 [PATCH v2 00/20] ARM: imx: clean up i.MX5 support Shawn Guo
2014-05-20 8:45 ` [PATCH 01/20] ARM: imx: move EHCI platform defines out of platform_data header Shawn Guo
2014-05-20 8:45 ` [PATCH 02/20] ARM: imx5: move SOC_IMX5 and SOC_IMX51 into 'Device tree only' Shawn Guo
2014-05-20 8:45 ` [PATCH 03/20] ARM: imx5: drop option MACH_IMX51_DT Shawn Guo
2014-05-20 8:45 ` [PATCH 04/20] ARM: imx5: remove imx51 non-DT support files Shawn Guo
2014-05-20 8:45 ` [PATCH 05/20] ARM: imx5: remove i.MX5 non-DT device registration helpers Shawn Guo
2014-05-20 9:02 ` Alexander Shiyan
2014-05-20 11:47 ` Shawn Guo
2014-05-20 8:45 ` [PATCH 06/20] ARM: imx5: make mx51_clocks_init() a DT call Shawn Guo
2014-05-20 8:45 ` [PATCH 07/20] ARM: imx5: drop arguments from mx5_clocks_common_init() Shawn Guo
2014-05-20 8:45 ` [PATCH 08/20] ARM: imx5: tzic_init_irq() can directly be .init_irq hook Shawn Guo
2014-05-20 8:45 ` [PATCH 09/20] ARM: imx5: remove function imx51_soc_init() Shawn Guo
2014-05-20 8:45 ` [PATCH 10/20] ARM: imx5: call mxc_timer_init_dt() on imx51 Shawn Guo
2014-05-20 8:45 ` [PATCH 11/20] ARM: imx5: retrieve iim base from device tree Shawn Guo
2014-05-20 8:45 ` [PATCH 12/20] ARM: imx5: remove header crm-regs-imx5.h Shawn Guo
2014-05-20 8:45 ` [PATCH 13/20] ARM: imx5: use dynamic mapping for CCM block Shawn Guo
2014-05-20 8:45 ` [PATCH 14/20] ARM: imx5: use dynamic mapping for DPLL block Shawn Guo
2014-05-20 8:45 ` [PATCH 15/20] ARM: imx5: reuse clock CCM mapping in pm code Shawn Guo
2014-05-20 8:45 ` [PATCH 16/20] ARM: imx5: use dynamic mapping for Cortex and GPC block Shawn Guo
2014-05-20 8:45 ` Shawn Guo [this message]
2014-05-20 11:53 ` [PATCH 17/20] ARM: imx5: move init hooks into mach-imx5x.c Shawn Guo
2014-05-20 8:45 ` [PATCH 18/20] ARM: imx5: remove file mm-imx5.c Shawn Guo
2014-05-20 9:42 ` Alexander Shiyan
2014-05-20 11:50 ` Shawn Guo
2014-05-20 8:45 ` [PATCH 19/20] ARM: imx5: clean function declarations in mx51.h Shawn Guo
2014-05-20 8:45 ` [PATCH 20/20] ARM: imx5: remove mx51.h and mx53.h Shawn Guo
2014-05-21 6:21 ` [PATCH v2 00/20] ARM: imx: clean up i.MX5 support Sascha Hauer
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=1400575538-21136-18-git-send-email-shawn.guo@freescale.com \
--to=shawn.guo@freescale.com \
--cc=linux-arm-kernel@lists.infradead.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).