diff options
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/setup-sh7770.c')
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7770.c | 330 | 
1 files changed, 88 insertions, 242 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c index 256ea7a4516..e9b532a76c3 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c @@ -16,195 +16,228 @@  #include <linux/io.h>  static struct plat_sci_port scif0_platform_data = { -	.mapbase	= 0xff923000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x9a0)), +}; + +static struct resource scif0_resources[] = { +	DEFINE_RES_MEM(0xff923000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x9a0)),  };  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	= 0xff924000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x9c0)), +}; + +static struct resource scif1_resources[] = { +	DEFINE_RES_MEM(0xff924000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x9c0)),  };  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	= 0xff925000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x9e0)), +}; + +static struct resource scif2_resources[] = { +	DEFINE_RES_MEM(0xff925000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x9e0)),  };  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	= 0xff926000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0xa00)), +}; + +static struct resource scif3_resources[] = { +	DEFINE_RES_MEM(0xff926000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xa00)),  };  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	= 0xff927000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0xa20)), +}; + +static struct resource scif4_resources[] = { +	DEFINE_RES_MEM(0xff927000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xa20)),  };  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	= 0xff928000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0xa40)), +}; + +static struct resource scif5_resources[] = { +	DEFINE_RES_MEM(0xff928000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xa40)),  };  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 plat_sci_port scif6_platform_data = { -	.mapbase	= 0xff929000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0xa60)), +}; + +static struct resource scif6_resources[] = { +	DEFINE_RES_MEM(0xff929000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xa60)),  };  static struct platform_device scif6_device = {  	.name		= "sh-sci",  	.id		= 6, +	.resource	= scif6_resources, +	.num_resources	= ARRAY_SIZE(scif6_resources),  	.dev		= {  		.platform_data	= &scif6_platform_data,  	},  };  static struct plat_sci_port scif7_platform_data = { -	.mapbase	= 0xff92a000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0xa80)), +}; + +static struct resource scif7_resources[] = { +	DEFINE_RES_MEM(0xff92a000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xa80)),  };  static struct platform_device scif7_device = {  	.name		= "sh-sci",  	.id		= 7, +	.resource	= scif7_resources, +	.num_resources	= ARRAY_SIZE(scif7_resources),  	.dev		= {  		.platform_data	= &scif7_platform_data,  	},  };  static struct plat_sci_port scif8_platform_data = { -	.mapbase	= 0xff92b000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0xaa0)), +}; + +static struct resource scif8_resources[] = { +	DEFINE_RES_MEM(0xff92b000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xaa0)),  };  static struct platform_device scif8_device = {  	.name		= "sh-sci",  	.id		= 8, +	.resource	= scif8_resources, +	.num_resources	= ARRAY_SIZE(scif8_resources),  	.dev		= {  		.platform_data	= &scif8_platform_data,  	},  };  static struct plat_sci_port scif9_platform_data = { -	.mapbase	= 0xff92c000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0xac0)), +}; + +static struct resource scif9_resources[] = { +	DEFINE_RES_MEM(0xff92c000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xac0)),  };  static struct platform_device scif9_device = {  	.name		= "sh-sci",  	.id		= 9, +	.resource	= scif9_resources, +	.num_resources	= ARRAY_SIZE(scif9_resources),  	.dev		= {  		.platform_data	= &scif9_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	= evt2irq(0x400), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0xffd80000, 0x30), +	DEFINE_RES_IRQ(evt2irq(0x400)), +	DEFINE_RES_IRQ(evt2irq(0x420)), +	DEFINE_RES_IRQ(evt2irq(0x440)),  };  static struct platform_device tmu0_device = { -	.name		= "sh_tmu", +	.name		= "sh-tmu",  	.id		= 0,  	.dev = {  		.platform_data	= &tmu0_platform_data, @@ -214,25 +247,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	= evt2irq(0x420), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0xffd81000, 0x30), +	DEFINE_RES_IRQ(evt2irq(0x460)), +	DEFINE_RES_IRQ(evt2irq(0x480)), +	DEFINE_RES_IRQ(evt2irq(0x4a0)),  };  static struct platform_device tmu1_device = { -	.name		= "sh_tmu", +	.name		= "sh-tmu",  	.id		= 1,  	.dev = {  		.platform_data	= &tmu1_platform_data, @@ -242,24 +268,18 @@ static struct platform_device tmu1_device = {  };  static struct sh_timer_config tmu2_platform_data = { -	.channel_offset = 0x1c, -	.timer_bit = 2, +	.channels_mask = 7,  };  static struct resource tmu2_resources[] = { -	[0] = { -		.start	= 0xffd80020, -		.end	= 0xffd8002f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x440), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0xffd82000, 0x2c), +	DEFINE_RES_IRQ(evt2irq(0x4c0)), +	DEFINE_RES_IRQ(evt2irq(0x4e0)), +	DEFINE_RES_IRQ(evt2irq(0x500)),  };  static struct platform_device tmu2_device = { -	.name		= "sh_tmu", +	.name		= "sh-tmu",  	.id		= 2,  	.dev = {  		.platform_data	= &tmu2_platform_data, @@ -268,168 +288,6 @@ static struct platform_device tmu2_device = {  	.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	= 0xffd81008, -		.end	= 0xffd81013, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x460), -		.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	= 0xffd81014, -		.end	= 0xffd8101f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x480), -		.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	= 0xffd81020, -		.end	= 0xffd8102f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x4a0), -		.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), -}; - -static struct sh_timer_config tmu6_platform_data = { -	.channel_offset = 0x04, -	.timer_bit = 0, -}; - -static struct resource tmu6_resources[] = { -	[0] = { -		.start	= 0xffd82008, -		.end	= 0xffd82013, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x4c0), -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu6_device = { -	.name		= "sh_tmu", -	.id		= 6, -	.dev = { -		.platform_data	= &tmu6_platform_data, -	}, -	.resource	= tmu6_resources, -	.num_resources	= ARRAY_SIZE(tmu6_resources), -}; - -static struct sh_timer_config tmu7_platform_data = { -	.channel_offset = 0x10, -	.timer_bit = 1, -}; - -static struct resource tmu7_resources[] = { -	[0] = { -		.start	= 0xffd82014, -		.end	= 0xffd8201f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x4e0), -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu7_device = { -	.name		= "sh_tmu", -	.id		= 7, -	.dev = { -		.platform_data	= &tmu7_platform_data, -	}, -	.resource	= tmu7_resources, -	.num_resources	= ARRAY_SIZE(tmu7_resources), -}; - -static struct sh_timer_config tmu8_platform_data = { -	.channel_offset = 0x1c, -	.timer_bit = 2, -}; - -static struct resource tmu8_resources[] = { -	[0] = { -		.start	= 0xffd82020, -		.end	= 0xffd8202b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x500), -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu8_device = { -	.name		= "sh_tmu", -	.id		= 8, -	.dev = { -		.platform_data	= &tmu8_platform_data, -	}, -	.resource	= tmu8_resources, -	.num_resources	= ARRAY_SIZE(tmu8_resources), -}; -  static struct platform_device *sh7770_devices[] __initdata = {  	&scif0_device,  	&scif1_device, @@ -444,12 +302,6 @@ static struct platform_device *sh7770_devices[] __initdata = {  	&tmu0_device,  	&tmu1_device,  	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device, -	&tmu6_device, -	&tmu7_device, -	&tmu8_device,  };  static int __init sh7770_devices_setup(void) @@ -473,12 +325,6 @@ static struct platform_device *sh7770_early_devices[] __initdata = {  	&tmu0_device,  	&tmu1_device,  	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device, -	&tmu6_device, -	&tmu7_device, -	&tmu8_device,  };  void __init plat_early_device_setup(void)  | 
