| 
									
										
										
										
											2009-12-04 09:41:28 -05:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  *  linux/arch/arm/mach-mmp/flint.c | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Support for the Marvell Flint Development Platform. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Copyright (C) 2009 Marvell International Ltd. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  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/init.h>
 | 
					
						
							|  |  |  | #include <linux/kernel.h>
 | 
					
						
							|  |  |  | #include <linux/platform_device.h>
 | 
					
						
							|  |  |  | #include <linux/smc91x.h>
 | 
					
						
							|  |  |  | #include <linux/io.h>
 | 
					
						
							|  |  |  | #include <linux/gpio.h>
 | 
					
						
							| 
									
										
										
										
											2013-04-09 18:12:04 +08:00
										 |  |  | #include <linux/gpio-pxa.h>
 | 
					
						
							| 
									
										
										
										
											2010-09-08 09:42:42 -04:00
										 |  |  | #include <linux/interrupt.h>
 | 
					
						
							| 
									
										
										
										
											2009-12-04 09:41:28 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <asm/mach-types.h>
 | 
					
						
							|  |  |  | #include <asm/mach/arch.h>
 | 
					
						
							|  |  |  | #include <mach/addr-map.h>
 | 
					
						
							|  |  |  | #include <mach/mfp-mmp2.h>
 | 
					
						
							|  |  |  | #include <mach/mmp2.h>
 | 
					
						
							| 
									
										
										
										
											2012-01-03 16:50:40 -06:00
										 |  |  | #include <mach/irqs.h>
 | 
					
						
							| 
									
										
										
										
											2009-12-04 09:41:28 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "common.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-03 16:50:40 -06:00
										 |  |  | #define FLINT_NR_IRQS	(MMP_NR_IRQS + 48)
 | 
					
						
							| 
									
										
										
										
											2010-09-08 09:42:42 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-04 09:41:28 -05:00
										 |  |  | static unsigned long flint_pin_config[] __initdata = { | 
					
						
							|  |  |  | 	/* UART1 */ | 
					
						
							|  |  |  | 	GPIO45_UART1_RXD, | 
					
						
							|  |  |  | 	GPIO46_UART1_TXD, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* UART2 */ | 
					
						
							|  |  |  | 	GPIO47_UART2_RXD, | 
					
						
							|  |  |  | 	GPIO48_UART2_TXD, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* SMC */ | 
					
						
							|  |  |  | 	GPIO151_SMC_SCLK, | 
					
						
							|  |  |  | 	GPIO145_SMC_nCS0, | 
					
						
							|  |  |  | 	GPIO146_SMC_nCS1, | 
					
						
							|  |  |  | 	GPIO152_SMC_BE0, | 
					
						
							|  |  |  | 	GPIO153_SMC_BE1, | 
					
						
							|  |  |  | 	GPIO154_SMC_IRQ, | 
					
						
							|  |  |  | 	GPIO113_SMC_RDY, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/*Ethernet*/ | 
					
						
							| 
									
										
										
										
											2010-12-18 21:57:07 +08:00
										 |  |  | 	GPIO155_GPIO, | 
					
						
							| 
									
										
										
										
											2009-12-04 09:41:28 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* DFI */ | 
					
						
							|  |  |  | 	GPIO168_DFI_D0, | 
					
						
							|  |  |  | 	GPIO167_DFI_D1, | 
					
						
							|  |  |  | 	GPIO166_DFI_D2, | 
					
						
							|  |  |  | 	GPIO165_DFI_D3, | 
					
						
							|  |  |  | 	GPIO107_DFI_D4, | 
					
						
							|  |  |  | 	GPIO106_DFI_D5, | 
					
						
							|  |  |  | 	GPIO105_DFI_D6, | 
					
						
							|  |  |  | 	GPIO104_DFI_D7, | 
					
						
							|  |  |  | 	GPIO111_DFI_D8, | 
					
						
							|  |  |  | 	GPIO164_DFI_D9, | 
					
						
							|  |  |  | 	GPIO163_DFI_D10, | 
					
						
							|  |  |  | 	GPIO162_DFI_D11, | 
					
						
							|  |  |  | 	GPIO161_DFI_D12, | 
					
						
							|  |  |  | 	GPIO110_DFI_D13, | 
					
						
							|  |  |  | 	GPIO109_DFI_D14, | 
					
						
							|  |  |  | 	GPIO108_DFI_D15, | 
					
						
							|  |  |  | 	GPIO143_ND_nCS0, | 
					
						
							|  |  |  | 	GPIO144_ND_nCS1, | 
					
						
							|  |  |  | 	GPIO147_ND_nWE, | 
					
						
							|  |  |  | 	GPIO148_ND_nRE, | 
					
						
							|  |  |  | 	GPIO150_ND_ALE, | 
					
						
							|  |  |  | 	GPIO149_ND_CLE, | 
					
						
							|  |  |  | 	GPIO112_ND_RDY0, | 
					
						
							|  |  |  | 	GPIO160_ND_RDY1, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-09 18:12:04 +08:00
										 |  |  | static struct pxa_gpio_platform_data mmp2_gpio_pdata = { | 
					
						
							|  |  |  | 	.irq_base	= MMP_GPIO_TO_IRQ(0), | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-04 09:41:28 -05:00
										 |  |  | static struct smc91x_platdata flint_smc91x_info = { | 
					
						
							|  |  |  | 	.flags  = SMC91X_USE_16BIT | SMC91X_NOWAIT, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource smc91x_resources[] = { | 
					
						
							|  |  |  | 	[0] = { | 
					
						
							|  |  |  | 		.start  = SMC_CS1_PHYS_BASE + 0x300, | 
					
						
							|  |  |  | 		.end    = SMC_CS1_PHYS_BASE + 0xfffff, | 
					
						
							|  |  |  | 		.flags  = IORESOURCE_MEM, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	[1] = { | 
					
						
							| 
									
										
										
										
											2011-10-10 16:03:51 +08:00
										 |  |  | 		.start  = MMP_GPIO_TO_IRQ(155), | 
					
						
							|  |  |  | 		.end    = MMP_GPIO_TO_IRQ(155), | 
					
						
							| 
									
										
										
										
											2009-12-04 09:41:28 -05:00
										 |  |  | 		.flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct platform_device smc91x_device = { | 
					
						
							|  |  |  | 	.name           = "smc91x", | 
					
						
							|  |  |  | 	.id             = 0, | 
					
						
							|  |  |  | 	.dev            = { | 
					
						
							|  |  |  | 		.platform_data = &flint_smc91x_info, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	.num_resources  = ARRAY_SIZE(smc91x_resources), | 
					
						
							|  |  |  | 	.resource       = smc91x_resources, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void __init flint_init(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	mfp_config(ARRAY_AND_SIZE(flint_pin_config)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* on-chip devices */ | 
					
						
							|  |  |  | 	mmp2_add_uart(1); | 
					
						
							|  |  |  | 	mmp2_add_uart(2); | 
					
						
							| 
									
										
										
										
											2013-04-09 18:12:04 +08:00
										 |  |  | 	platform_device_add_data(&mmp2_device_gpio, &mmp2_gpio_pdata, | 
					
						
							|  |  |  | 				 sizeof(struct pxa_gpio_platform_data)); | 
					
						
							| 
									
										
										
										
											2011-10-17 20:37:52 +08:00
										 |  |  | 	platform_device_register(&mmp2_device_gpio); | 
					
						
							| 
									
										
										
										
											2009-12-04 09:41:28 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* off-chip devices */ | 
					
						
							|  |  |  | 	platform_device_register(&smc91x_device); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | MACHINE_START(FLINT, "Flint Development Platform") | 
					
						
							| 
									
										
										
										
											2010-07-15 17:50:13 +08:00
										 |  |  | 	.map_io		= mmp_map_io, | 
					
						
							| 
									
										
										
										
											2010-09-08 09:42:42 -04:00
										 |  |  | 	.nr_irqs	= FLINT_NR_IRQS, | 
					
						
							| 
									
										
										
										
											2009-12-04 09:41:28 -05:00
										 |  |  | 	.init_irq       = mmp2_init_irq, | 
					
						
							| 
									
										
										
										
											2012-11-08 12:40:59 -07:00
										 |  |  | 	.init_time	= mmp2_timer_init, | 
					
						
							| 
									
										
										
										
											2009-12-04 09:41:28 -05:00
										 |  |  | 	.init_machine   = flint_init, | 
					
						
							| 
									
										
										
										
											2011-11-05 15:40:09 +00:00
										 |  |  | 	.restart	= mmp_restart, | 
					
						
							| 
									
										
										
										
											2009-12-04 09:41:28 -05:00
										 |  |  | MACHINE_END |