1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
4 * Copyright 2011 Linaro Ltd.
9 #include <linux/of_address.h>
10 #include <linux/of_irq.h>
11 #include <linux/of_platform.h>
12 #include <asm/mach/arch.h>
13 #include <asm/mach/time.h>
18 static void __init
imx51_init_early(void)
20 mxc_set_cpu_type(MXC_CPU_MX51
);
24 * The MIPI HSC unit has been removed from the i.MX51 Reference Manual by
25 * the Freescale marketing division. However this did not remove the
26 * hardware from the chip which still needs to be configured for proper
29 #define MX51_MIPI_HSC_BASE 0x83fdc000
30 static void __init
imx51_ipu_mipi_setup(void)
32 void __iomem
*hsc_addr
;
34 hsc_addr
= ioremap(MX51_MIPI_HSC_BASE
, SZ_16K
);
37 /* setup MIPI module to legacy mode */
38 imx_writel(0xf00, hsc_addr
);
40 /* CSI mode: reserved; DI control mode: legacy (from Freescale BSP) */
41 imx_writel(imx_readl(hsc_addr
+ 0x800) | 0x30ff, hsc_addr
+ 0x800);
46 static void __init
imx51_m4if_setup(void)
48 void __iomem
*m4if_base
;
49 struct device_node
*np
;
51 np
= of_find_compatible_node(NULL
, NULL
, "fsl,imx51-m4if");
55 m4if_base
= of_iomap(np
, 0);
58 pr_err("Unable to map M4IF registers\n");
63 * Configure VPU and IPU with higher priorities
64 * in order to avoid artifacts during video playback
66 writel_relaxed(0x00000203, m4if_base
+ 0x40);
67 writel_relaxed(0x00000000, m4if_base
+ 0x44);
68 writel_relaxed(0x00120125, m4if_base
+ 0x9c);
69 writel_relaxed(0x001901A3, m4if_base
+ 0x48);
73 static void __init
imx51_dt_init(void)
75 imx51_ipu_mipi_setup();
79 imx_aips_allow_unprivileged_access("fsl,imx51-aipstz");
82 static void __init
imx51_init_late(void)
88 static const char * const imx51_dt_board_compat
[] __initconst
= {
93 DT_MACHINE_START(IMX51_DT
, "Freescale i.MX51 (Device Tree Support)")
94 .init_early
= imx51_init_early
,
95 .init_machine
= imx51_dt_init
,
96 .init_late
= imx51_init_late
,
97 .dt_compat
= imx51_dt_board_compat
,