| 
									
										
										
										
											2011-10-17 08:42:17 +08:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * Copyright 2011 Linaro Ltd. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The code contained herein is licensed under the GNU General Public | 
					
						
							|  |  |  |  * License. You may obtain a copy of the GNU General Public License | 
					
						
							|  |  |  |  * Version 2 or later at the following locations: | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * http://www.opensource.org/licenses/gpl-license.html
 | 
					
						
							|  |  |  |  * http://www.gnu.org/copyleft/gpl.html
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-20 15:34:06 +08:00
										 |  |  | #include <linux/io.h>
 | 
					
						
							| 
									
										
										
										
											2011-10-17 08:42:17 +08:00
										 |  |  | #include <linux/irq.h>
 | 
					
						
							|  |  |  | #include <linux/of_irq.h>
 | 
					
						
							|  |  |  | #include <linux/of_platform.h>
 | 
					
						
							|  |  |  | #include <asm/mach/arch.h>
 | 
					
						
							|  |  |  | #include <asm/mach/time.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-09-13 21:01:00 +08:00
										 |  |  | #include "common.h"
 | 
					
						
							| 
									
										
										
										
											2014-05-20 15:34:06 +08:00
										 |  |  | #include "hardware.h"
 | 
					
						
							| 
									
										
										
										
											2012-09-13 21:01:00 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-20 15:34:06 +08:00
										 |  |  | 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); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-17 08:42:17 +08:00
										 |  |  | static void __init imx51_dt_init(void) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2013-03-27 14:01:33 +01:00
										 |  |  | 	struct platform_device_info devinfo = { .name = "cpufreq-cpu0", }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-10 10:19:01 +08:00
										 |  |  | 	mxc_arch_reset_init_dt(); | 
					
						
							| 
									
										
										
										
											2014-05-20 15:34:06 +08:00
										 |  |  | 	imx51_ipu_mipi_setup(); | 
					
						
							|  |  |  | 	imx_src_init(); | 
					
						
							| 
									
										
										
										
											2013-05-10 09:13:44 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-21 13:43:05 -02:00
										 |  |  | 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 
					
						
							| 
									
										
										
										
											2013-03-27 14:01:33 +01:00
										 |  |  | 	platform_device_register_full(&devinfo); | 
					
						
							| 
									
										
										
										
											2011-10-17 08:42:17 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-20 15:34:06 +08:00
										 |  |  | static void __init imx51_init_late(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	mx51_neon_fixup(); | 
					
						
							|  |  |  | 	imx51_pm_init(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-01 16:03:00 +08:00
										 |  |  | static const char * const imx51_dt_board_compat[] __initconst = { | 
					
						
							| 
									
										
										
										
											2012-02-17 12:07:00 +01:00
										 |  |  | 	"fsl,imx51", | 
					
						
							| 
									
										
										
										
											2011-10-17 08:42:17 +08:00
										 |  |  | 	NULL | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)") | 
					
						
							|  |  |  | 	.init_early	= imx51_init_early, | 
					
						
							| 
									
										
										
										
											2014-05-19 20:19:06 +08:00
										 |  |  | 	.init_irq	= tzic_init_irq, | 
					
						
							| 
									
										
										
										
											2011-10-17 08:42:17 +08:00
										 |  |  | 	.init_machine	= imx51_dt_init, | 
					
						
							| 
									
										
										
										
											2012-04-26 11:42:34 +08:00
										 |  |  | 	.init_late	= imx51_init_late, | 
					
						
							| 
									
										
										
										
											2011-10-17 08:42:17 +08:00
										 |  |  | 	.dt_compat	= imx51_dt_board_compat, | 
					
						
							| 
									
										
										
										
											2011-11-06 17:12:08 +00:00
										 |  |  | 	.restart	= mxc_restart, | 
					
						
							| 
									
										
										
										
											2011-10-17 08:42:17 +08:00
										 |  |  | MACHINE_END |