diff options
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/setup-sh7785.c')
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 243 | 
1 files changed, 81 insertions, 162 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c index c9a572bc6dc..c72d5a5d099 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c @@ -15,121 +15,155 @@  #include <linux/mm.h>  #include <linux/sh_dma.h>  #include <linux/sh_timer.h> - +#include <linux/sh_intc.h>  #include <asm/mmzone.h> -  #include <cpu/dma-register.h>  static struct plat_sci_port scif0_platform_data = { -	.mapbase	= 0xffea0000,  	.flags		= UPF_BOOT_AUTOCONF, +	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,  	.type		= PORT_SCIF, -	.irqs		= { 40, 40, 40, 40 }, +	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE, +}; + +static struct resource scif0_resources[] = { +	DEFINE_RES_MEM(0xffea0000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x700)),  };  static struct platform_device scif0_device = {  	.name		= "sh-sci",  	.id		= 0, +	.resource	= scif0_resources, +	.num_resources	= ARRAY_SIZE(scif0_resources),  	.dev		= {  		.platform_data	= &scif0_platform_data,  	},  };  static struct plat_sci_port scif1_platform_data = { -	.mapbase	= 0xffeb0000,  	.flags		= UPF_BOOT_AUTOCONF, +	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,  	.type		= PORT_SCIF, -	.irqs		= { 44, 44, 44, 44 }, +	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE, +}; + +static struct resource scif1_resources[] = { +	DEFINE_RES_MEM(0xffeb0000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x780)),  };  static struct platform_device scif1_device = {  	.name		= "sh-sci",  	.id		= 1, +	.resource	= scif1_resources, +	.num_resources	= ARRAY_SIZE(scif1_resources),  	.dev		= {  		.platform_data	= &scif1_platform_data,  	},  };  static struct plat_sci_port scif2_platform_data = { -	.mapbase	= 0xffec0000,  	.flags		= UPF_BOOT_AUTOCONF, +	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,  	.type		= PORT_SCIF, -	.irqs		= { 60, 60, 60, 60 }, +	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE, +}; + +static struct resource scif2_resources[] = { +	DEFINE_RES_MEM(0xffec0000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x980)),  };  static struct platform_device scif2_device = {  	.name		= "sh-sci",  	.id		= 2, +	.resource	= scif2_resources, +	.num_resources	= ARRAY_SIZE(scif2_resources),  	.dev		= {  		.platform_data	= &scif2_platform_data,  	},  };  static struct plat_sci_port scif3_platform_data = { -	.mapbase	= 0xffed0000,  	.flags		= UPF_BOOT_AUTOCONF, +	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,  	.type		= PORT_SCIF, -	.irqs		= { 61, 61, 61, 61 }, +	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE, +}; + +static struct resource scif3_resources[] = { +	DEFINE_RES_MEM(0xffed0000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x9a0)),  };  static struct platform_device scif3_device = {  	.name		= "sh-sci",  	.id		= 3, +	.resource	= scif3_resources, +	.num_resources	= ARRAY_SIZE(scif3_resources),  	.dev		= {  		.platform_data	= &scif3_platform_data,  	},  };  static struct plat_sci_port scif4_platform_data = { -	.mapbase	= 0xffee0000,  	.flags		= UPF_BOOT_AUTOCONF, +	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,  	.type		= PORT_SCIF, -	.irqs		= { 62, 62, 62, 62 }, +	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE, +}; + +static struct resource scif4_resources[] = { +	DEFINE_RES_MEM(0xffee0000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x9c0)),  };  static struct platform_device scif4_device = {  	.name		= "sh-sci",  	.id		= 4, +	.resource	= scif4_resources, +	.num_resources	= ARRAY_SIZE(scif4_resources),  	.dev		= {  		.platform_data	= &scif4_platform_data,  	},  };  static struct plat_sci_port scif5_platform_data = { -	.mapbase	= 0xffef0000,  	.flags		= UPF_BOOT_AUTOCONF, +	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,  	.type		= PORT_SCIF, -	.irqs		= { 63, 63, 63, 63 }, +	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE, +}; + +static struct resource scif5_resources[] = { +	DEFINE_RES_MEM(0xffef0000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x9e0)),  };  static struct platform_device scif5_device = {  	.name		= "sh-sci",  	.id		= 5, +	.resource	= scif5_resources, +	.num_resources	= ARRAY_SIZE(scif5_resources),  	.dev		= {  		.platform_data	= &scif5_platform_data,  	},  };  static struct sh_timer_config tmu0_platform_data = { -	.channel_offset = 0x04, -	.timer_bit = 0, -	.clockevent_rating = 200, +	.channels_mask = 7,  };  static struct resource tmu0_resources[] = { -	[0] = { -		.start	= 0xffd80008, -		.end	= 0xffd80013, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= 28, -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0xffd80000, 0x30), +	DEFINE_RES_IRQ(evt2irq(0x580)), +	DEFINE_RES_IRQ(evt2irq(0x5a0)), +	DEFINE_RES_IRQ(evt2irq(0x5c0)),  };  static struct platform_device tmu0_device = { -	.name		= "sh_tmu", +	.name		= "sh-tmu",  	.id		= 0,  	.dev = {  		.platform_data	= &tmu0_platform_data, @@ -139,25 +173,18 @@ static struct platform_device tmu0_device = {  };  static struct sh_timer_config tmu1_platform_data = { -	.channel_offset = 0x10, -	.timer_bit = 1, -	.clocksource_rating = 200, +	.channels_mask = 7,  };  static struct resource tmu1_resources[] = { -	[0] = { -		.start	= 0xffd80014, -		.end	= 0xffd8001f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= 29, -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0xffdc0000, 0x2c), +	DEFINE_RES_IRQ(evt2irq(0xe00)), +	DEFINE_RES_IRQ(evt2irq(0xe20)), +	DEFINE_RES_IRQ(evt2irq(0xe40)),  };  static struct platform_device tmu1_device = { -	.name		= "sh_tmu", +	.name		= "sh-tmu",  	.id		= 1,  	.dev = {  		.platform_data	= &tmu1_platform_data, @@ -166,114 +193,6 @@ static struct platform_device tmu1_device = {  	.num_resources	= ARRAY_SIZE(tmu1_resources),  }; -static struct sh_timer_config tmu2_platform_data = { -	.channel_offset = 0x1c, -	.timer_bit = 2, -}; - -static struct resource tmu2_resources[] = { -	[0] = { -		.start	= 0xffd80020, -		.end	= 0xffd8002f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= 30, -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu2_device = { -	.name		= "sh_tmu", -	.id		= 2, -	.dev = { -		.platform_data	= &tmu2_platform_data, -	}, -	.resource	= tmu2_resources, -	.num_resources	= ARRAY_SIZE(tmu2_resources), -}; - -static struct sh_timer_config tmu3_platform_data = { -	.channel_offset = 0x04, -	.timer_bit = 0, -}; - -static struct resource tmu3_resources[] = { -	[0] = { -		.start	= 0xffdc0008, -		.end	= 0xffdc0013, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= 96, -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu3_device = { -	.name		= "sh_tmu", -	.id		= 3, -	.dev = { -		.platform_data	= &tmu3_platform_data, -	}, -	.resource	= tmu3_resources, -	.num_resources	= ARRAY_SIZE(tmu3_resources), -}; - -static struct sh_timer_config tmu4_platform_data = { -	.channel_offset = 0x10, -	.timer_bit = 1, -}; - -static struct resource tmu4_resources[] = { -	[0] = { -		.start	= 0xffdc0014, -		.end	= 0xffdc001f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= 97, -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu4_device = { -	.name		= "sh_tmu", -	.id		= 4, -	.dev = { -		.platform_data	= &tmu4_platform_data, -	}, -	.resource	= tmu4_resources, -	.num_resources	= ARRAY_SIZE(tmu4_resources), -}; - -static struct sh_timer_config tmu5_platform_data = { -	.channel_offset = 0x1c, -	.timer_bit = 2, -}; - -static struct resource tmu5_resources[] = { -	[0] = { -		.start	= 0xffdc0020, -		.end	= 0xffdc002b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= 98, -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu5_device = { -	.name		= "sh_tmu", -	.id		= 5, -	.dev = { -		.platform_data	= &tmu5_platform_data, -	}, -	.resource	= tmu5_resources, -	.num_resources	= ARRAY_SIZE(tmu5_resources), -}; -  /* DMA */  static const struct sh_dmae_channel sh7785_dmae0_channels[] = {  	{ @@ -359,9 +278,13 @@ static struct resource sh7785_dmae0_resources[] = {  		.flags	= IORESOURCE_MEM,  	},  	{ -		/* Real DMA error IRQ is 39, and channel IRQs are 33-38 */ -		.start	= 33, -		.end	= 33, +		/* +		 * Real DMA error vector is 0x6e0, and channel +		 * vectors are 0x620-0x6c0 +		 */ +		.name	= "error_irq", +		.start	= evt2irq(0x620), +		.end	= evt2irq(0x620),  		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,  	},  }; @@ -375,9 +298,13 @@ static struct resource sh7785_dmae1_resources[] = {  	},  	/* DMAC1 has no DMARS */  	{ -		/* Real DMA error IRQ is 58, and channel IRQs are 52-57 */ -		.start	= 52, -		.end	= 52, +		/* +		 * Real DMA error vector is 0x940, and channel +		 * vectors are 0x880-0x920 +		 */ +		.name	= "error_irq", +		.start	= evt2irq(0x880), +		.end	= evt2irq(0x880),  		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,  	},  }; @@ -411,10 +338,6 @@ static struct platform_device *sh7785_devices[] __initdata = {  	&scif5_device,  	&tmu0_device,  	&tmu1_device, -	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device,  	&dma0_device,  	&dma1_device,  }; @@ -435,10 +358,6 @@ static struct platform_device *sh7785_early_devices[] __initdata = {  	&scif5_device,  	&tmu0_device,  	&tmu1_device, -	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device,  };  void __init plat_early_device_setup(void)  | 
