| 
									
										
										
										
											2012-03-01 13:25:09 +08:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  *  linux/arch/arm/mach-mmp/mmp-dt.c | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Copyright (C) 2012 Marvell Technology Group Ltd. | 
					
						
							|  |  |  |  *  Author: Haojian Zhuang <haojian.zhuang@marvell.com> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  This program is free software; you can redistribute it and/or modify | 
					
						
							|  |  |  |  *  it under the terms of the GNU General Public License version 2 as | 
					
						
							|  |  |  |  *  publishhed by the Free Software Foundation. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <linux/irq.h>
 | 
					
						
							|  |  |  | #include <linux/irqdomain.h>
 | 
					
						
							|  |  |  | #include <linux/of_irq.h>
 | 
					
						
							|  |  |  | #include <linux/of_platform.h>
 | 
					
						
							|  |  |  | #include <asm/mach/arch.h>
 | 
					
						
							| 
									
										
										
										
											2012-04-19 18:36:31 +08:00
										 |  |  | #include <asm/mach/time.h>
 | 
					
						
							| 
									
										
										
										
											2012-03-01 13:25:09 +08:00
										 |  |  | #include <mach/irqs.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "common.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-04-19 18:36:31 +08:00
										 |  |  | extern void __init mmp_dt_irq_init(void); | 
					
						
							|  |  |  | extern void __init mmp_dt_init_timer(void); | 
					
						
							| 
									
										
										
										
											2012-03-01 13:25:09 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-04-19 18:36:31 +08:00
										 |  |  | static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = { | 
					
						
							| 
									
										
										
										
											2012-03-01 13:25:09 +08:00
										 |  |  | 	OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL), | 
					
						
							|  |  |  | 	OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL), | 
					
						
							|  |  |  | 	OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4026000, "pxa2xx-uart.2", NULL), | 
					
						
							|  |  |  | 	OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL), | 
					
						
							|  |  |  | 	OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL), | 
					
						
							| 
									
										
										
										
											2013-04-09 22:27:50 +08:00
										 |  |  | 	OF_DEV_AUXDATA("marvell,mmp-gpio", 0xd4019000, "mmp-gpio", NULL), | 
					
						
							| 
									
										
										
										
											2012-03-01 13:25:09 +08:00
										 |  |  | 	OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL), | 
					
						
							|  |  |  | 	{} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-04-19 18:36:31 +08:00
										 |  |  | static const struct of_dev_auxdata pxa910_auxdata_lookup[] __initconst = { | 
					
						
							|  |  |  | 	OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL), | 
					
						
							|  |  |  | 	OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL), | 
					
						
							|  |  |  | 	OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4036000, "pxa2xx-uart.2", NULL), | 
					
						
							|  |  |  | 	OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL), | 
					
						
							|  |  |  | 	OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4037000, "pxa2xx-i2c.1", NULL), | 
					
						
							| 
									
										
										
										
											2013-04-09 22:27:50 +08:00
										 |  |  | 	OF_DEV_AUXDATA("marvell,mmp-gpio", 0xd4019000, "mmp-gpio", NULL), | 
					
						
							| 
									
										
										
										
											2012-04-19 18:36:31 +08:00
										 |  |  | 	OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL), | 
					
						
							|  |  |  | 	{} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void __init pxa168_dt_init(void) | 
					
						
							| 
									
										
										
										
											2012-03-01 13:25:09 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-04-19 18:36:31 +08:00
										 |  |  | 	of_platform_populate(NULL, of_default_bus_match_table, | 
					
						
							|  |  |  | 			     pxa168_auxdata_lookup, NULL); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2012-03-01 13:25:09 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-04-19 18:36:31 +08:00
										 |  |  | static void __init pxa910_dt_init(void) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-03-01 13:25:09 +08:00
										 |  |  | 	of_platform_populate(NULL, of_default_bus_match_table, | 
					
						
							| 
									
										
										
										
											2012-04-19 18:36:31 +08:00
										 |  |  | 			     pxa910_auxdata_lookup, NULL); | 
					
						
							| 
									
										
										
										
											2012-03-01 13:25:09 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-04-19 18:36:31 +08:00
										 |  |  | static const char *mmp_dt_board_compat[] __initdata = { | 
					
						
							| 
									
										
										
										
											2012-03-01 13:25:09 +08:00
										 |  |  | 	"mrvl,pxa168-aspenite", | 
					
						
							| 
									
										
										
										
											2012-04-19 18:36:31 +08:00
										 |  |  | 	"mrvl,pxa910-dkb", | 
					
						
							| 
									
										
										
										
											2012-03-01 13:25:09 +08:00
										 |  |  | 	NULL, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)") | 
					
						
							|  |  |  | 	.map_io		= mmp_map_io, | 
					
						
							| 
									
										
										
										
											2012-04-19 18:36:31 +08:00
										 |  |  | 	.init_irq	= mmp_dt_irq_init, | 
					
						
							| 
									
										
										
										
											2012-11-08 12:40:59 -07:00
										 |  |  | 	.init_time	= mmp_dt_init_timer, | 
					
						
							| 
									
										
										
										
											2012-04-19 18:36:31 +08:00
										 |  |  | 	.init_machine	= pxa168_dt_init, | 
					
						
							|  |  |  | 	.dt_compat	= mmp_dt_board_compat, | 
					
						
							|  |  |  | MACHINE_END | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)") | 
					
						
							|  |  |  | 	.map_io		= mmp_map_io, | 
					
						
							|  |  |  | 	.init_irq	= mmp_dt_irq_init, | 
					
						
							| 
									
										
										
										
											2012-11-08 12:40:59 -07:00
										 |  |  | 	.init_time	= mmp_dt_init_timer, | 
					
						
							| 
									
										
										
										
											2012-04-19 18:36:31 +08:00
										 |  |  | 	.init_machine	= pxa910_dt_init, | 
					
						
							|  |  |  | 	.dt_compat	= mmp_dt_board_compat, | 
					
						
							| 
									
										
										
										
											2012-03-01 13:25:09 +08:00
										 |  |  | MACHINE_END |