| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2007-08-01 21:09:31 +09:00
										 |  |  |  *  linux/arch/m32r/platforms/m32700ut/setup.c | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							|  |  |  |  *  Setup routines for Renesas M32700UT Board | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-07-07 17:59:32 -07:00
										 |  |  |  *  Copyright (c) 2002-2005  Hiroyuki Kondo, Hirokazu Takata, | 
					
						
							|  |  |  |  *                           Hitoshi Yamamoto, Takeo Takahashi | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							|  |  |  |  *  This file is subject to the terms and conditions of the GNU General | 
					
						
							|  |  |  |  *  Public License.  See the file "COPYING" in the main directory of this | 
					
						
							|  |  |  |  *  archive for more details. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <linux/irq.h>
 | 
					
						
							|  |  |  | #include <linux/kernel.h>
 | 
					
						
							|  |  |  | #include <linux/init.h>
 | 
					
						
							| 
									
										
										
										
											2005-10-29 19:07:23 +01:00
										 |  |  | #include <linux/platform_device.h>
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <asm/m32r.h>
 | 
					
						
							|  |  |  | #include <asm/io.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * M32700 Interrupt Control Unit (Level 1) | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | #define irq2port(x) (M32R_ICU_CR1_PORTL + ((x - 1) * sizeof(unsigned long)))
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-08-23 22:47:22 +01:00
										 |  |  | icu_data_t icu_data[M32700UT_NUM_CPU_IRQ]; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | static void disable_m32700ut_irq(unsigned int irq) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	unsigned long port, data; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	port = irq2port(irq); | 
					
						
							|  |  |  | 	data = icu_data[irq].icucr|M32R_ICUCR_ILEVEL7; | 
					
						
							|  |  |  | 	outl(data, port); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void enable_m32700ut_irq(unsigned int irq) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	unsigned long port, data; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	port = irq2port(irq); | 
					
						
							|  |  |  | 	data = icu_data[irq].icucr|M32R_ICUCR_IEN|M32R_ICUCR_ILEVEL6; | 
					
						
							|  |  |  | 	outl(data, port); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | static void mask_m32700ut(struct irq_data *data) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 	disable_m32700ut_irq(data->irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | static void unmask_m32700ut(struct irq_data *data) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 	enable_m32700ut_irq(data->irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | static void shutdown_m32700ut(struct irq_data *data) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							|  |  |  | 	unsigned long port; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 	port = irq2port(data->irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	outl(M32R_ICUCR_ILEVEL7, port); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-16 15:33:26 -07:00
										 |  |  | static struct irq_chip m32700ut_irq_type = | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 	.name		= "M32700UT-IRQ", | 
					
						
							|  |  |  | 	.irq_shutdown	= shutdown_m32700ut, | 
					
						
							|  |  |  | 	.irq_mask	= mask_m32700ut, | 
					
						
							|  |  |  | 	.irq_unmask	= unmask_m32700ut | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Interrupt Control Unit of PLD on M32700UT (Level 2) | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | #define irq2pldirq(x)		((x) - M32700UT_PLD_IRQ_BASE)
 | 
					
						
							|  |  |  | #define pldirq2port(x)		(unsigned long)((int)PLD_ICUCR1 + \
 | 
					
						
							|  |  |  | 				 (((x) - 1) * sizeof(unsigned short))) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | typedef struct { | 
					
						
							|  |  |  | 	unsigned short icucr;  /* ICU Control Register */ | 
					
						
							|  |  |  | } pld_icu_data_t; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static pld_icu_data_t pld_icu_data[M32700UT_NUM_PLD_IRQ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void disable_m32700ut_pld_irq(unsigned int irq) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	unsigned long port, data; | 
					
						
							|  |  |  | 	unsigned int pldirq; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	pldirq = irq2pldirq(irq); | 
					
						
							|  |  |  | 	port = pldirq2port(pldirq); | 
					
						
							|  |  |  | 	data = pld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7; | 
					
						
							|  |  |  | 	outw(data, port); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void enable_m32700ut_pld_irq(unsigned int irq) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	unsigned long port, data; | 
					
						
							|  |  |  | 	unsigned int pldirq; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	pldirq = irq2pldirq(irq); | 
					
						
							|  |  |  | 	port = pldirq2port(pldirq); | 
					
						
							|  |  |  | 	data = pld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6; | 
					
						
							|  |  |  | 	outw(data, port); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-19 17:41:51 +01:00
										 |  |  | static void mask_m32700ut_pld(struct irq_data *data) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-19 17:41:51 +01:00
										 |  |  | 	disable_m32700ut_pld_irq(data->irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-19 17:41:51 +01:00
										 |  |  | static void unmask_m32700ut_pld(struct irq_data *data) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-19 17:41:51 +01:00
										 |  |  | 	enable_m32700ut_pld_irq(data->irq); | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 	enable_m32700ut_irq(M32R_IRQ_INT1); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-19 17:41:51 +01:00
										 |  |  | static void shutdown_m32700ut_pld_irq(struct irq_data *data) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							|  |  |  | 	unsigned long port; | 
					
						
							|  |  |  | 	unsigned int pldirq; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-19 17:41:51 +01:00
										 |  |  | 	pldirq = irq2pldirq(data->irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	port = pldirq2port(pldirq); | 
					
						
							|  |  |  | 	outw(PLD_ICUCR_ILEVEL7, port); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-16 15:33:26 -07:00
										 |  |  | static struct irq_chip m32700ut_pld_irq_type = | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-19 17:41:51 +01:00
										 |  |  | 	.name		= "M32700UT-PLD-IRQ", | 
					
						
							|  |  |  | 	.irq_shutdown	= shutdown_m32700ut_pld_irq, | 
					
						
							|  |  |  | 	.irq_mask	= mask_m32700ut_pld, | 
					
						
							|  |  |  | 	.irq_unmask	= unmask_m32700ut_pld, | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Interrupt Control Unit of PLD on M32700UT-LAN (Level 2) | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | #define irq2lanpldirq(x)	((x) - M32700UT_LAN_PLD_IRQ_BASE)
 | 
					
						
							|  |  |  | #define lanpldirq2port(x)	(unsigned long)((int)M32700UT_LAN_ICUCR1 + \
 | 
					
						
							|  |  |  | 				 (((x) - 1) * sizeof(unsigned short))) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static pld_icu_data_t lanpld_icu_data[M32700UT_NUM_LAN_PLD_IRQ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void disable_m32700ut_lanpld_irq(unsigned int irq) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	unsigned long port, data; | 
					
						
							|  |  |  | 	unsigned int pldirq; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	pldirq = irq2lanpldirq(irq); | 
					
						
							|  |  |  | 	port = lanpldirq2port(pldirq); | 
					
						
							|  |  |  | 	data = lanpld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7; | 
					
						
							|  |  |  | 	outw(data, port); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void enable_m32700ut_lanpld_irq(unsigned int irq) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	unsigned long port, data; | 
					
						
							|  |  |  | 	unsigned int pldirq; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	pldirq = irq2lanpldirq(irq); | 
					
						
							|  |  |  | 	port = lanpldirq2port(pldirq); | 
					
						
							|  |  |  | 	data = lanpld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6; | 
					
						
							|  |  |  | 	outw(data, port); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-19 18:14:21 +01:00
										 |  |  | static void mask_m32700ut_lanpld(struct irq_data *data) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-19 18:14:21 +01:00
										 |  |  | 	disable_m32700ut_lanpld_irq(data->irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-19 18:14:21 +01:00
										 |  |  | static void unmask_m32700ut_lanpld(struct irq_data *data) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-19 18:14:21 +01:00
										 |  |  | 	enable_m32700ut_lanpld_irq(data->irq); | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 	enable_m32700ut_irq(M32R_IRQ_INT0); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-19 18:14:21 +01:00
										 |  |  | static void shutdown_m32700ut_lanpld(struct irq_data *data) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							|  |  |  | 	unsigned long port; | 
					
						
							|  |  |  | 	unsigned int pldirq; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-19 18:14:21 +01:00
										 |  |  | 	pldirq = irq2lanpldirq(data->irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	port = lanpldirq2port(pldirq); | 
					
						
							|  |  |  | 	outw(PLD_ICUCR_ILEVEL7, port); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-16 15:33:26 -07:00
										 |  |  | static struct irq_chip m32700ut_lanpld_irq_type = | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-19 18:14:21 +01:00
										 |  |  | 	.name		= "M32700UT-PLD-LAN-IRQ", | 
					
						
							|  |  |  | 	.irq_shutdown	= shutdown_m32700ut_lanpld, | 
					
						
							|  |  |  | 	.irq_mask	= mask_m32700ut_lanpld, | 
					
						
							|  |  |  | 	.irq_unmask	= unmask_m32700ut_lanpld, | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Interrupt Control Unit of PLD on M32700UT-LCD (Level 2) | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | #define irq2lcdpldirq(x)	((x) - M32700UT_LCD_PLD_IRQ_BASE)
 | 
					
						
							|  |  |  | #define lcdpldirq2port(x)	(unsigned long)((int)M32700UT_LCD_ICUCR1 + \
 | 
					
						
							|  |  |  | 				 (((x) - 1) * sizeof(unsigned short))) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static pld_icu_data_t lcdpld_icu_data[M32700UT_NUM_LCD_PLD_IRQ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void disable_m32700ut_lcdpld_irq(unsigned int irq) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	unsigned long port, data; | 
					
						
							|  |  |  | 	unsigned int pldirq; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	pldirq = irq2lcdpldirq(irq); | 
					
						
							|  |  |  | 	port = lcdpldirq2port(pldirq); | 
					
						
							|  |  |  | 	data = lcdpld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7; | 
					
						
							|  |  |  | 	outw(data, port); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void enable_m32700ut_lcdpld_irq(unsigned int irq) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	unsigned long port, data; | 
					
						
							|  |  |  | 	unsigned int pldirq; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	pldirq = irq2lcdpldirq(irq); | 
					
						
							|  |  |  | 	port = lcdpldirq2port(pldirq); | 
					
						
							|  |  |  | 	data = lcdpld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6; | 
					
						
							|  |  |  | 	outw(data, port); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-19 18:19:42 +01:00
										 |  |  | static void mask_m32700ut_lcdpld(struct irq_data *data) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-19 18:19:42 +01:00
										 |  |  | 	disable_m32700ut_lcdpld_irq(data->irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-19 18:19:42 +01:00
										 |  |  | static void unmask_m32700ut_lcdpld(struct irq_data *data) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-19 18:19:42 +01:00
										 |  |  | 	enable_m32700ut_lcdpld_irq(data->irq); | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 	enable_m32700ut_irq(M32R_IRQ_INT2); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-19 18:19:42 +01:00
										 |  |  | static void shutdown_m32700ut_lcdpld(struct irq_data *data) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							|  |  |  | 	unsigned long port; | 
					
						
							|  |  |  | 	unsigned int pldirq; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-19 18:19:42 +01:00
										 |  |  | 	pldirq = irq2lcdpldirq(data->irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	port = lcdpldirq2port(pldirq); | 
					
						
							|  |  |  | 	outw(PLD_ICUCR_ILEVEL7, port); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-16 15:33:26 -07:00
										 |  |  | static struct irq_chip m32700ut_lcdpld_irq_type = | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-01-19 18:19:42 +01:00
										 |  |  | 	.name		= "M32700UT-PLD-LCD-IRQ", | 
					
						
							|  |  |  | 	.irq_shutdown	= shutdown_m32700ut_lcdpld, | 
					
						
							|  |  |  | 	.irq_mask	= mask_m32700ut_lcdpld, | 
					
						
							|  |  |  | 	.irq_unmask	= unmask_m32700ut_lcdpld, | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void __init init_IRQ(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | #if defined(CONFIG_SMC91X)
 | 
					
						
							|  |  |  | 	/* INT#0: LAN controller on M32700UT-LAN (SMC91C111)*/ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(M32700UT_LAN_IRQ_LAN, | 
					
						
							| 
									
										
										
										
											2011-01-19 18:14:21 +01:00
										 |  |  | 				 &m32700ut_lanpld_irq_type, handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	lanpld_icu_data[irq2lanpldirq(M32700UT_LAN_IRQ_LAN)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02;	/* "H" edge sense */ | 
					
						
							|  |  |  | 	disable_m32700ut_lanpld_irq(M32700UT_LAN_IRQ_LAN); | 
					
						
							|  |  |  | #endif  /* CONFIG_SMC91X */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* MFT2 : system timer */ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(M32R_IRQ_MFT2, &m32700ut_irq_type, | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 				 handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; | 
					
						
							|  |  |  | 	disable_m32700ut_irq(M32R_IRQ_MFT2); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* SIO0 : receive */ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(M32R_IRQ_SIO0_R, &m32700ut_irq_type, | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 				 handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	icu_data[M32R_IRQ_SIO0_R].icucr = 0; | 
					
						
							|  |  |  | 	disable_m32700ut_irq(M32R_IRQ_SIO0_R); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* SIO0 : send */ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(M32R_IRQ_SIO0_S, &m32700ut_irq_type, | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 				 handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	icu_data[M32R_IRQ_SIO0_S].icucr = 0; | 
					
						
							|  |  |  | 	disable_m32700ut_irq(M32R_IRQ_SIO0_S); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* SIO1 : receive */ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(M32R_IRQ_SIO1_R, &m32700ut_irq_type, | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 				 handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	icu_data[M32R_IRQ_SIO1_R].icucr = 0; | 
					
						
							|  |  |  | 	disable_m32700ut_irq(M32R_IRQ_SIO1_R); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* SIO1 : send */ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(M32R_IRQ_SIO1_S, &m32700ut_irq_type, | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 				 handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	icu_data[M32R_IRQ_SIO1_S].icucr = 0; | 
					
						
							|  |  |  | 	disable_m32700ut_irq(M32R_IRQ_SIO1_S); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* DMA1 : */ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(M32R_IRQ_DMA1, &m32700ut_irq_type, | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 				 handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	icu_data[M32R_IRQ_DMA1].icucr = 0; | 
					
						
							|  |  |  | 	disable_m32700ut_irq(M32R_IRQ_DMA1); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef CONFIG_SERIAL_M32R_PLDSIO
 | 
					
						
							|  |  |  | 	/* INT#1: SIO0 Receive on PLD */ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(PLD_IRQ_SIO0_RCV, &m32700ut_pld_irq_type, | 
					
						
							| 
									
										
										
										
											2011-01-19 17:41:51 +01:00
										 |  |  | 				 handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_RCV)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; | 
					
						
							|  |  |  | 	disable_m32700ut_pld_irq(PLD_IRQ_SIO0_RCV); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* INT#1: SIO0 Send on PLD */ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(PLD_IRQ_SIO0_SND, &m32700ut_pld_irq_type, | 
					
						
							| 
									
										
										
										
											2011-01-19 17:41:51 +01:00
										 |  |  | 				 handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_SND)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; | 
					
						
							|  |  |  | 	disable_m32700ut_pld_irq(PLD_IRQ_SIO0_SND); | 
					
						
							|  |  |  | #endif  /* CONFIG_SERIAL_M32R_PLDSIO */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* INT#1: CFC IREQ on PLD */ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(PLD_IRQ_CFIREQ, &m32700ut_pld_irq_type, | 
					
						
							| 
									
										
										
										
											2011-01-19 17:41:51 +01:00
										 |  |  | 				 handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	pld_icu_data[irq2pldirq(PLD_IRQ_CFIREQ)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01;	/* 'L' level sense */ | 
					
						
							|  |  |  | 	disable_m32700ut_pld_irq(PLD_IRQ_CFIREQ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* INT#1: CFC Insert on PLD */ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(PLD_IRQ_CFC_INSERT, &m32700ut_pld_irq_type, | 
					
						
							| 
									
										
										
										
											2011-01-19 17:41:51 +01:00
										 |  |  | 				 handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	pld_icu_data[irq2pldirq(PLD_IRQ_CFC_INSERT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD00;	/* 'L' edge sense */ | 
					
						
							|  |  |  | 	disable_m32700ut_pld_irq(PLD_IRQ_CFC_INSERT); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* INT#1: CFC Eject on PLD */ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(PLD_IRQ_CFC_EJECT, &m32700ut_pld_irq_type, | 
					
						
							| 
									
										
										
										
											2011-01-19 17:41:51 +01:00
										 |  |  | 				 handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02;	/* 'H' edge sense */ | 
					
						
							|  |  |  | 	disable_m32700ut_pld_irq(PLD_IRQ_CFC_EJECT); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/*
 | 
					
						
							|  |  |  | 	 * INT0# is used for LAN, DIO | 
					
						
							|  |  |  | 	 * We enable it here. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11; | 
					
						
							|  |  |  | 	enable_m32700ut_irq(M32R_IRQ_INT0); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/*
 | 
					
						
							|  |  |  | 	 * INT1# is used for UART, MMC, CF Controller in FPGA. | 
					
						
							|  |  |  | 	 * We enable it here. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11; | 
					
						
							|  |  |  | 	enable_m32700ut_irq(M32R_IRQ_INT1); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if defined(CONFIG_USB)
 | 
					
						
							|  |  |  | 	outw(USBCR_OTGS, USBCR); 	/* USBCR: non-OTG */ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(M32700UT_LCD_IRQ_USB_INT1, | 
					
						
							| 
									
										
										
										
											2011-01-19 18:19:42 +01:00
										 |  |  | 				 &m32700ut_lcdpld_irq_type, handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-09-22 19:13:16 +02:00
										 |  |  | 	lcdpld_icu_data[irq2lcdpldirq(M32700UT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01;	/* "L" level sense */ | 
					
						
							|  |  |  | 	disable_m32700ut_lcdpld_irq(M32700UT_LCD_IRQ_USB_INT1); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 	/*
 | 
					
						
							|  |  |  | 	 * INT2# is used for BAT, USB, AUDIO | 
					
						
							|  |  |  | 	 * We enable it here. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	icu_data[M32R_IRQ_INT2].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; | 
					
						
							|  |  |  | 	enable_m32700ut_irq(M32R_IRQ_INT2); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-07 17:59:32 -07:00
										 |  |  | #if defined(CONFIG_VIDEO_M32R_AR)
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	/*
 | 
					
						
							|  |  |  | 	 * INT3# is used for AR | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2011-03-24 17:32:45 +01:00
										 |  |  | 	irq_set_chip_and_handler(M32R_IRQ_INT3, &m32700ut_irq_type, | 
					
						
							| 
									
										
										
										
											2011-01-11 10:43:49 +01:00
										 |  |  | 				 handle_level_irq); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; | 
					
						
							|  |  |  | 	disable_m32700ut_irq(M32R_IRQ_INT3); | 
					
						
							| 
									
										
										
										
											2005-07-07 17:59:32 -07:00
										 |  |  | #endif	/* CONFIG_VIDEO_M32R_AR */
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-07 17:59:32 -07:00
										 |  |  | #if defined(CONFIG_SMC91X)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #define LAN_IOSTART     0x300
 | 
					
						
							|  |  |  | #define LAN_IOEND       0x320
 | 
					
						
							|  |  |  | static struct resource smc91x_resources[] = { | 
					
						
							|  |  |  | 	[0] = { | 
					
						
							|  |  |  | 		.start  = (LAN_IOSTART), | 
					
						
							|  |  |  | 		.end    = (LAN_IOEND), | 
					
						
							|  |  |  | 		.flags  = IORESOURCE_MEM, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	[1] = { | 
					
						
							|  |  |  | 		.start  = M32700UT_LAN_IRQ_LAN, | 
					
						
							|  |  |  | 		.end    = M32700UT_LAN_IRQ_LAN, | 
					
						
							|  |  |  | 		.flags  = IORESOURCE_IRQ, | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct platform_device smc91x_device = { | 
					
						
							|  |  |  | 	.name		= "smc91x", | 
					
						
							|  |  |  | 	.id		= 0, | 
					
						
							|  |  |  | 	.num_resources  = ARRAY_SIZE(smc91x_resources), | 
					
						
							|  |  |  | 	.resource       = smc91x_resources, | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2005-07-07 17:59:32 -07:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if defined(CONFIG_FB_S1D13XXX)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <video/s1d13xxxfb.h>
 | 
					
						
							|  |  |  | #include <asm/s1d13806.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct s1d13xxxfb_pdata s1d13xxxfb_data = { | 
					
						
							|  |  |  | 	.initregs		= s1d13xxxfb_initregs, | 
					
						
							|  |  |  | 	.initregssize		= ARRAY_SIZE(s1d13xxxfb_initregs), | 
					
						
							|  |  |  | 	.platform_init_video	= NULL, | 
					
						
							|  |  |  | #ifdef CONFIG_PM
 | 
					
						
							|  |  |  | 	.platform_suspend_video	= NULL, | 
					
						
							|  |  |  | 	.platform_resume_video	= NULL, | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct resource s1d13xxxfb_resources[] = { | 
					
						
							|  |  |  | 	[0] = { | 
					
						
							|  |  |  | 		.start  = 0x10600000UL, | 
					
						
							|  |  |  | 		.end    = 0x1073FFFFUL, | 
					
						
							|  |  |  | 		.flags  = IORESOURCE_MEM, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	[1] = { | 
					
						
							|  |  |  | 		.start  = 0x10400000UL, | 
					
						
							|  |  |  | 		.end    = 0x104001FFUL, | 
					
						
							|  |  |  | 		.flags  = IORESOURCE_MEM, | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static struct platform_device s1d13xxxfb_device = { | 
					
						
							|  |  |  | 	.name		= S1D_DEVICENAME, | 
					
						
							|  |  |  | 	.id		= 0, | 
					
						
							|  |  |  | 	.dev            = { | 
					
						
							|  |  |  | 		.platform_data  = &s1d13xxxfb_data, | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	.num_resources  = ARRAY_SIZE(s1d13xxxfb_resources), | 
					
						
							|  |  |  | 	.resource       = s1d13xxxfb_resources, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | static int __init platform_init(void) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2005-07-07 17:59:32 -07:00
										 |  |  | #if defined(CONFIG_SMC91X)
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	platform_device_register(&smc91x_device); | 
					
						
							| 
									
										
										
										
											2005-07-07 17:59:32 -07:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | #if defined(CONFIG_FB_S1D13XXX)
 | 
					
						
							|  |  |  | 	platform_device_register(&s1d13xxxfb_device); | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	return 0; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | arch_initcall(platform_init); |