diff options
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a')
23 files changed, 655 insertions, 2138 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c index 53638e231cd..9edc06c02dc 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c @@ -227,7 +227,7 @@ static struct clk_lookup lookups[] = {  	CLKDEV_CON_ID("hudi0", &mstp_clks[MSTP019]),  	CLKDEV_CON_ID("ubc0", &mstp_clks[MSTP017]),  	CLKDEV_CON_ID("tmu_fck", &mstp_clks[MSTP015]), -	CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP014]), +	CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[MSTP014]),  	CLKDEV_CON_ID("rwdt0", &mstp_clks[MSTP013]),  	CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]),  	CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]), diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c index 22e485d1990..955b9add781 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c @@ -225,7 +225,7 @@ static struct clk_lookup lookups[] = {  	CLKDEV_CON_ID("hudi0", &mstp_clks[MSTP019]),  	CLKDEV_CON_ID("ubc0", &mstp_clks[MSTP017]),  	CLKDEV_CON_ID("tmu_fck", &mstp_clks[MSTP015]), -	CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP014]), +	CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[MSTP014]),  	CLKDEV_CON_ID("rwdt0", &mstp_clks[MSTP013]),  	CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]),  	CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]), diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c index c4cb740e4d1..8f07a1a3869 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c @@ -203,11 +203,9 @@ static struct clk_lookup lookups[] = {  	CLKDEV_CON_ID("uram0", &mstp_clks[HWBLK_URAM]),  	CLKDEV_CON_ID("xymem0", &mstp_clks[HWBLK_XYMEM]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU]), +	CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[HWBLK_TMU]), -	CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]), +	CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[HWBLK_CMT]),  	CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),  	CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]), diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c index 37c41c7747a..ccbcab550df 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c @@ -236,7 +236,7 @@ static struct clk_lookup lookups[] = {  	CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]),  	CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),  	CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]), -	CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]), +	CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[HWBLK_CMT]),  	CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),  	CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]),  	CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]), @@ -264,12 +264,8 @@ static struct clk_lookup lookups[] = {  	CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU2H0]),  	CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU0]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU0]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU0]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[HWBLK_TMU1]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[HWBLK_TMU1]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[HWBLK_TMU1]), +	CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[HWBLK_TMU0]), +	CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[HWBLK_TMU1]),  	CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[HWBLK_SCIF0]),  	CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[HWBLK_SCIF1]), diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c index 0128af3399b..f579dd52819 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c @@ -304,17 +304,13 @@ static struct clk_lookup lookups[] = {  	CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),  	CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU0]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU0]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU0]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[HWBLK_TMU1]), +	CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[HWBLK_TMU0]), +	CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[HWBLK_TMU1]), -	CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]), +	CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[HWBLK_CMT]),  	CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),  	CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[HWBLK_TMU1]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[HWBLK_TMU1]),  	CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[HWBLK_SCIF0]),  	CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[HWBLK_SCIF1]),  	CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[HWBLK_SCIF2]), diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c b/arch/sh/kernel/cpu/sh4a/clock-sh7734.c index ed9501519ab..1fdf1ee672d 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7734.c @@ -201,15 +201,9 @@ static struct clk_lookup lookups[] = {  	CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[MSTP022]),  	CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP021]),  	CLKDEV_CON_ID("hscif", &mstp_clks[MSTP019]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP016]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP016]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP016]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP015]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP015]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP015]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.6", &mstp_clks[MSTP014]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.7", &mstp_clks[MSTP014]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.8", &mstp_clks[MSTP014]), +	CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]), +	CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP015]), +	CLKDEV_ICK_ID("fck", "sh-tmu.2", &mstp_clks[MSTP014]),  	CLKDEV_CON_ID("ssi0", &mstp_clks[MSTP012]),  	CLKDEV_CON_ID("ssi1", &mstp_clks[MSTP011]),  	CLKDEV_CON_ID("ssi2", &mstp_clks[MSTP010]), diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c index e84a43229b9..9a28fdb3638 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c @@ -123,8 +123,8 @@ static struct clk_lookup lookups[] = {  	CLKDEV_CON_ID("riic6", &mstp_clks[MSTP000]),  	CLKDEV_CON_ID("riic7", &mstp_clks[MSTP000]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP113]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP114]), +	CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP113]), +	CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP114]),  	CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP112]),  	CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP111]),  	CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]), @@ -132,7 +132,7 @@ static struct clk_lookup lookups[] = {  	CLKDEV_CON_ID("usb_fck", &mstp_clks[MSTP103]),  	CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP102]),  	CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]), -	CLKDEV_CON_ID("rspi2", &mstp_clks[MSTP127]), +	CLKDEV_DEV_ID("rspi.2", &mstp_clks[MSTP127]),  };  int __init arch_clk_init(void) diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c index 1c83788db76..17d0ea55a5a 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c @@ -146,12 +146,8 @@ static struct clk_lookup lookups[] = {  	CLKDEV_CON_ID("mmcif_fck", &mstp_clks[MSTP013]),  	CLKDEV_CON_ID("flctl_fck", &mstp_clks[MSTP012]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]), +	CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP008]), +	CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP009]),  	CLKDEV_CON_ID("siof_fck", &mstp_clks[MSTP003]),  	CLKDEV_CON_ID("hspi_fck", &mstp_clks[MSTP002]), diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c index 8bba6f15902..bec2a83f1ba 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c @@ -155,18 +155,10 @@ static struct clk_lookup lookups[] = {  	CLKDEV_CON_ID("i2c1_fck", &mstp_clks[MSTP015]),  	CLKDEV_CON_ID("i2c0_fck", &mstp_clks[MSTP014]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.6", &mstp_clks[MSTP010]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.7", &mstp_clks[MSTP010]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.8", &mstp_clks[MSTP010]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.9", &mstp_clks[MSTP011]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.10", &mstp_clks[MSTP011]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.11", &mstp_clks[MSTP011]), +	CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP008]), +	CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP009]), +	CLKDEV_ICK_ID("fck", "sh-tmu.2", &mstp_clks[MSTP010]), +	CLKDEV_ICK_ID("fck", "sh-tmu.3", &mstp_clks[MSTP011]),  	CLKDEV_CON_ID("sdif1_fck", &mstp_clks[MSTP005]),  	CLKDEV_CON_ID("sdif0_fck", &mstp_clks[MSTP004]), diff --git a/arch/sh/kernel/cpu/sh4a/clock-shx3.c b/arch/sh/kernel/cpu/sh4a/clock-shx3.c index a9422dab0ce..9a49a44f6f9 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/clock-shx3.c @@ -124,12 +124,8 @@ static struct clk_lookup lookups[] = {  	CLKDEV_CON_ID("fe1_fck", &mstp_clks[MSTP001]),  	CLKDEV_CON_ID("fe0_fck", &mstp_clks[MSTP000]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]), -	CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]), +	CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP008]), +	CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP009]),  	CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]),  	CLKDEV_CON_ID("dmac_11_6_fck", &mstp_clks[MSTP105]), diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c index b91ea8300a3..ceb3dedad98 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c @@ -18,68 +18,84 @@  /* Serial */  static struct plat_sci_port scif0_platform_data = { -	.mapbase        = 0xffe00000,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_CKE1, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xc00)), +}; + +static struct resource scif0_resources[] = { +	DEFINE_RES_MEM(0xffe00000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc00)),  };  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        = 0xffe10000,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_CKE1, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xc20)), +}; + +static struct resource scif1_resources[] = { +	DEFINE_RES_MEM(0xffe10000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc20)),  };  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        = 0xffe20000,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_CKE1, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xc40)), +}; + +static struct resource scif2_resources[] = { +	DEFINE_RES_MEM(0xffe20000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc40)),  };  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        = 0xffe30000,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_CKE1, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xc60)), +}; + +static struct resource scif3_resources[] = { +	DEFINE_RES_MEM(0xffe30000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc60)),  };  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,  	}, @@ -212,26 +228,16 @@ static struct platform_device jpu_device = {  };  static struct sh_timer_config cmt_platform_data = { -	.channel_offset = 0x60, -	.timer_bit = 5, -	.clockevent_rating = 125, -	.clocksource_rating = 200, +	.channels_mask = 0x20,  };  static struct resource cmt_resources[] = { -	[0] = { -		.start	= 0x044a0060, -		.end	= 0x044a006b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0xf00), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0x044a0000, 0x70), +	DEFINE_RES_IRQ(evt2irq(0xf00)),  };  static struct platform_device cmt_device = { -	.name		= "sh_cmt", +	.name		= "sh-cmt-32",  	.id		= 0,  	.dev = {  		.platform_data	= &cmt_platform_data, @@ -241,25 +247,18 @@ static struct platform_device cmt_device = {  };  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, 0x2c), +	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, @@ -268,61 +267,6 @@ static struct platform_device tmu0_device = {  	.num_resources	= ARRAY_SIZE(tmu0_resources),  }; -static struct sh_timer_config tmu1_platform_data = { -	.channel_offset = 0x10, -	.timer_bit = 1, -	.clocksource_rating = 200, -}; - -static struct resource tmu1_resources[] = { -	[0] = { -		.start	= 0xffd80014, -		.end	= 0xffd8001f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x420), -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu1_device = { -	.name		= "sh_tmu", -	.id		= 1, -	.dev = { -		.platform_data	= &tmu1_platform_data, -	}, -	.resource	= tmu1_resources, -	.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	= 0xffd8002b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x440), -		.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 platform_device *sh7343_devices[] __initdata = {  	&scif0_device,  	&scif1_device, @@ -330,8 +274,6 @@ static struct platform_device *sh7343_devices[] __initdata = {  	&scif3_device,  	&cmt_device,  	&tmu0_device, -	&tmu1_device, -	&tmu2_device,  	&iic0_device,  	&iic1_device,  	&vpu_device, @@ -357,8 +299,6 @@ static struct platform_device *sh7343_early_devices[] __initdata = {  	&scif3_device,  	&cmt_device,  	&tmu0_device, -	&tmu1_device, -	&tmu2_device,  };  void __init plat_early_device_setup(void) diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c index 0bd09d51419..f75f6734313 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c @@ -20,18 +20,22 @@  #include <asm/clock.h>  static struct plat_sci_port scif0_platform_data = { -	.mapbase	= 0xffe00000,  	.port_reg	= 0xa405013e,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0xc00)), +}; + +static struct resource scif0_resources[] = { +	DEFINE_RES_MEM(0xffe00000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc00)),  };  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,  	}, @@ -172,26 +176,16 @@ static struct platform_device veu1_device = {  };  static struct sh_timer_config cmt_platform_data = { -	.channel_offset = 0x60, -	.timer_bit = 5, -	.clockevent_rating = 125, -	.clocksource_rating = 200, +	.channels_mask = 0x20,  };  static struct resource cmt_resources[] = { -	[0] = { -		.start	= 0x044a0060, -		.end	= 0x044a006b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0xf00), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0x044a0000, 0x70), +	DEFINE_RES_IRQ(evt2irq(0xf00)),  };  static struct platform_device cmt_device = { -	.name		= "sh_cmt", +	.name		= "sh-cmt-32",  	.id		= 0,  	.dev = {  		.platform_data	= &cmt_platform_data, @@ -201,25 +195,18 @@ static struct platform_device cmt_device = {  };  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	= 16, -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0xffd80000, 0x2c), +	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, @@ -228,67 +215,10 @@ static struct platform_device tmu0_device = {  	.num_resources	= ARRAY_SIZE(tmu0_resources),  }; -static struct sh_timer_config tmu1_platform_data = { -	.channel_offset = 0x10, -	.timer_bit = 1, -	.clocksource_rating = 200, -}; - -static struct resource tmu1_resources[] = { -	[0] = { -		.start	= 0xffd80014, -		.end	= 0xffd8001f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x420), -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu1_device = { -	.name		= "sh_tmu", -	.id		= 1, -	.dev = { -		.platform_data	= &tmu1_platform_data, -	}, -	.resource	= tmu1_resources, -	.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	= 0xffd8002b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x440), -		.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 platform_device *sh7366_devices[] __initdata = {  	&scif0_device,  	&cmt_device,  	&tmu0_device, -	&tmu1_device, -	&tmu2_device,  	&iic_device,  	&usb_host_device,  	&vpu_device, @@ -311,8 +241,6 @@ static struct platform_device *sh7366_early_devices[] __initdata = {  	&scif0_device,  	&cmt_device,  	&tmu0_device, -	&tmu1_device, -	&tmu2_device,  };  void __init plat_early_device_setup(void) diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c index 6a868b091c2..57f83a92a50 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c @@ -179,57 +179,69 @@ struct platform_device dma_device = {  /* Serial */  static struct plat_sci_port scif0_platform_data = { -	.mapbase        = 0xffe00000,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xc00)),  	.ops		= &sh7722_sci_port_ops,  	.regtype	= SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,  }; +static struct resource scif0_resources[] = { +	DEFINE_RES_MEM(0xffe00000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc00)), +}; +  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        = 0xffe10000,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xc20)),  	.ops		= &sh7722_sci_port_ops,  	.regtype	= SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,  }; +static struct resource scif1_resources[] = { +	DEFINE_RES_MEM(0xffe10000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc20)), +}; +  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        = 0xffe20000,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xc40)),  	.ops		= &sh7722_sci_port_ops,  	.regtype	= SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,  }; +static struct resource scif2_resources[] = { +	DEFINE_RES_MEM(0xffe20000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc40)), +}; +  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,  	}, @@ -401,26 +413,16 @@ static struct platform_device jpu_device = {  };  static struct sh_timer_config cmt_platform_data = { -	.channel_offset = 0x60, -	.timer_bit = 5, -	.clockevent_rating = 125, -	.clocksource_rating = 125, +	.channels_mask = 0x20,  };  static struct resource cmt_resources[] = { -	[0] = { -		.start	= 0x044a0060, -		.end	= 0x044a006b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0xf00), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0x044a0000, 0x70), +	DEFINE_RES_IRQ(evt2irq(0xf00)),  };  static struct platform_device cmt_device = { -	.name		= "sh_cmt", +	.name		= "sh-cmt-32",  	.id		= 0,  	.dev = {  		.platform_data	= &cmt_platform_data, @@ -430,25 +432,18 @@ static struct platform_device cmt_device = {  };  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, 0x2c), +	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, @@ -457,61 +452,6 @@ static struct platform_device tmu0_device = {  	.num_resources	= ARRAY_SIZE(tmu0_resources),  }; -static struct sh_timer_config tmu1_platform_data = { -	.channel_offset = 0x10, -	.timer_bit = 1, -	.clocksource_rating = 200, -}; - -static struct resource tmu1_resources[] = { -	[0] = { -		.start	= 0xffd80014, -		.end	= 0xffd8001f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x420), -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu1_device = { -	.name		= "sh_tmu", -	.id		= 1, -	.dev = { -		.platform_data	= &tmu1_platform_data, -	}, -	.resource	= tmu1_resources, -	.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	= 0xffd8002b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= 18, -		.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 siu_platform siu_platform_data = {  	.dma_slave_tx_a	= SHDMA_SLAVE_SIUA_TX,  	.dma_slave_rx_a	= SHDMA_SLAVE_SIUA_RX, @@ -547,8 +487,6 @@ static struct platform_device *sh7722_devices[] __initdata = {  	&scif2_device,  	&cmt_device,  	&tmu0_device, -	&tmu1_device, -	&tmu2_device,  	&rtc_device,  	&usbf_device,  	&iic_device, @@ -576,8 +514,6 @@ static struct platform_device *sh7722_early_devices[] __initdata = {  	&scif2_device,  	&cmt_device,  	&tmu0_device, -	&tmu1_device, -	&tmu2_device,  };  void __init plat_early_device_setup(void) diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c index 28d6fd835fe..3533b56dd46 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c @@ -23,111 +23,138 @@  /* Serial */  static struct plat_sci_port scif0_platform_data = { -	.mapbase        = 0xffe00000,  	.port_reg	= 0xa4050160,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xc00)),  	.regtype	= SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,  }; +static struct resource scif0_resources[] = { +	DEFINE_RES_MEM(0xffe00000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc00)), +}; +  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        = 0xffe10000,  	.port_reg	= SCIx_NOT_SUPPORTED,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xc20)),  	.regtype	= SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,  }; +static struct resource scif1_resources[] = { +	DEFINE_RES_MEM(0xffe10000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc20)), +}; +  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        = 0xffe20000,  	.port_reg	= SCIx_NOT_SUPPORTED,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xc40)),  	.regtype	= SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,  }; +static struct resource scif2_resources[] = { +	DEFINE_RES_MEM(0xffe20000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc40)), +}; +  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        = 0xa4e30000,  	.flags          = UPF_BOOT_AUTOCONF,  	.port_reg	= SCIx_NOT_SUPPORTED,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_3, +	.sampling_rate	= 8,  	.type           = PORT_SCIFA, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0x900)), +}; + +static struct resource scif3_resources[] = { +	DEFINE_RES_MEM(0xa4e30000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x900)),  };  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        = 0xa4e40000,  	.port_reg	= SCIx_NOT_SUPPORTED,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_3, +	.sampling_rate	= 8,  	.type           = PORT_SCIFA, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xd00)), +}; + +static struct resource scif4_resources[] = { +	DEFINE_RES_MEM(0xa4e40000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xd00)),  };  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        = 0xa4e50000,  	.port_reg	= SCIx_NOT_SUPPORTED,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_3, +	.sampling_rate	= 8,  	.type           = PORT_SCIFA, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xfa0)), +}; + +static struct resource scif5_resources[] = { +	DEFINE_RES_MEM(0xa4e50000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xfa0)),  };  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,  	}, @@ -218,26 +245,16 @@ static struct platform_device veu1_device = {  };  static struct sh_timer_config cmt_platform_data = { -	.channel_offset = 0x60, -	.timer_bit = 5, -	.clockevent_rating = 125, -	.clocksource_rating = 125, +	.channels_mask = 0x20,  };  static struct resource cmt_resources[] = { -	[0] = { -		.start	= 0x044a0060, -		.end	= 0x044a006b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0xf00), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0x044a0000, 0x70), +	DEFINE_RES_IRQ(evt2irq(0xf00)),  };  static struct platform_device cmt_device = { -	.name		= "sh_cmt", +	.name		= "sh-cmt-32",  	.id		= 0,  	.dev = {  		.platform_data	= &cmt_platform_data, @@ -247,25 +264,18 @@ static struct platform_device cmt_device = {  };  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, 0x2c), +	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, @@ -275,25 +285,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(0xffd90000, 0x2c), +	DEFINE_RES_IRQ(evt2irq(0x920)), +	DEFINE_RES_IRQ(evt2irq(0x940)), +	DEFINE_RES_IRQ(evt2irq(0x960)),  };  static struct platform_device tmu1_device = { -	.name		= "sh_tmu", +	.name		= "sh-tmu",  	.id		= 1,  	.dev = {  		.platform_data	= &tmu1_platform_data, @@ -302,114 +305,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	= 0xffd8002b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x440), -		.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	= 0xffd90008, -		.end	= 0xffd90013, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x920), -		.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	= 0xffd90014, -		.end	= 0xffd9001f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x940), -		.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	= 0xffd90020, -		.end	= 0xffd9002b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x920), -		.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 resource rtc_resources[] = {  	[0] = {  		.start	= 0xa465fec0, @@ -500,10 +395,6 @@ static struct platform_device *sh7723_devices[] __initdata = {  	&cmt_device,  	&tmu0_device,  	&tmu1_device, -	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device,  	&rtc_device,  	&iic_device,  	&sh7723_usb_host_device, @@ -533,10 +424,6 @@ static struct platform_device *sh7723_early_devices[] __initdata = {  	&cmt_device,  	&tmu0_device,  	&tmu1_device, -	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device,  };  void __init plat_early_device_setup(void) diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c index 26b74c2f949..b9e84b1d3aa 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c @@ -290,111 +290,138 @@ static struct platform_device dma1_device = {  /* Serial */  static struct plat_sci_port scif0_platform_data = { -	.mapbase        = 0xffe00000,  	.port_reg	= SCIx_NOT_SUPPORTED,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xc00)),  	.regtype	= SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,  }; +static struct resource scif0_resources[] = { +	DEFINE_RES_MEM(0xffe00000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc00)), +}; +  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        = 0xffe10000,  	.port_reg	= SCIx_NOT_SUPPORTED,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xc20)),  	.regtype	= SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,  }; +static struct resource scif1_resources[] = { +	DEFINE_RES_MEM(0xffe10000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc20)), +}; +  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        = 0xffe20000,  	.port_reg	= SCIx_NOT_SUPPORTED,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xc40)),  	.regtype	= SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,  }; +static struct resource scif2_resources[] = { +	DEFINE_RES_MEM(0xffe20000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xc40)), +}; +  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        = 0xa4e30000,  	.port_reg	= SCIx_NOT_SUPPORTED,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE, -	.scbrr_algo_id	= SCBRR_ALGO_3, +	.sampling_rate	= 8,  	.type           = PORT_SCIFA, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0x900)), +}; + +static struct resource scif3_resources[] = { +	DEFINE_RES_MEM(0xa4e30000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x900)),  };  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        = 0xa4e40000,  	.port_reg	= SCIx_NOT_SUPPORTED,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE, -	.scbrr_algo_id	= SCBRR_ALGO_3, +	.sampling_rate	= 8,  	.type           = PORT_SCIFA, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xd00)), +}; + +static struct resource scif4_resources[] = { +	DEFINE_RES_MEM(0xa4e40000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xd00)),  };  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        = 0xa4e50000,  	.port_reg	= SCIx_NOT_SUPPORTED,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE, -	.scbrr_algo_id	= SCBRR_ALGO_3, +	.sampling_rate	= 8,  	.type           = PORT_SCIFA, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0xfa0)), +}; + +static struct resource scif5_resources[] = { +	DEFINE_RES_MEM(0xa4e50000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xfa0)),  };  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,  	}, @@ -621,26 +648,16 @@ static struct platform_device beu1_device = {  };  static struct sh_timer_config cmt_platform_data = { -	.channel_offset = 0x60, -	.timer_bit = 5, -	.clockevent_rating = 125, -	.clocksource_rating = 200, +	.channels_mask = 0x20,  };  static struct resource cmt_resources[] = { -	[0] = { -		.start	= 0x044a0060, -		.end	= 0x044a006b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0xf00), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0x044a0000, 0x70), +	DEFINE_RES_IRQ(evt2irq(0xf00)),  };  static struct platform_device cmt_device = { -	.name		= "sh_cmt", +	.name		= "sh-cmt-32",  	.id		= 0,  	.dev = {  		.platform_data	= &cmt_platform_data, @@ -650,25 +667,18 @@ static struct platform_device cmt_device = {  };  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, 0x2c), +	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, @@ -678,25 +688,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(0xffd90000, 0x2c), +	DEFINE_RES_IRQ(evt2irq(0x920)), +	DEFINE_RES_IRQ(evt2irq(0x940)), +	DEFINE_RES_IRQ(evt2irq(0x960)),  };  static struct platform_device tmu1_device = { -	.name		= "sh_tmu", +	.name		= "sh-tmu",  	.id		= 1,  	.dev = {  		.platform_data	= &tmu1_platform_data, @@ -705,115 +708,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	= 0xffd8002b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x440), -		.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	= 0xffd90008, -		.end	= 0xffd90013, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x920), -		.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	= 0xffd90014, -		.end	= 0xffd9001f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x940), -		.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	= 0xffd90020, -		.end	= 0xffd9002b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x920), -		.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), -}; -  /* JPU */  static struct uio_info jpu_platform_data = {  	.name = "JPU", @@ -911,10 +805,6 @@ static struct platform_device *sh7724_devices[] __initdata = {  	&cmt_device,  	&tmu0_device,  	&tmu1_device, -	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device,  	&dma0_device,  	&dma1_device,  	&rtc_device, @@ -954,10 +844,6 @@ static struct platform_device *sh7724_early_devices[] __initdata = {  	&cmt_device,  	&tmu0_device,  	&tmu1_device, -	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device,  };  void __init plat_early_device_setup(void) diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7734.c b/arch/sh/kernel/cpu/sh4a/setup-sh7734.c index f799971d453..f617bcb734d 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7734.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7734.c @@ -25,108 +25,132 @@  /* SCIF */  static struct plat_sci_port scif0_platform_data = { -	.mapbase        = 0xFFE40000,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr          = SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id  = SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0x8C0)),  	.regtype        = SCIx_SH4_SCIF_REGTYPE,  }; +static struct resource scif0_resources[] = { +	DEFINE_RES_MEM(0xffe40000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x8c0)), +}; +  static struct platform_device scif0_device = {  	.name		= "sh-sci", -	.id			= 0, +	.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        = 0xFFE41000,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr          = SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0x8E0)),  	.regtype        = SCIx_SH4_SCIF_REGTYPE,  }; +static struct resource scif1_resources[] = { +	DEFINE_RES_MEM(0xffe41000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x8e0)), +}; +  static struct platform_device scif1_device = {  	.name		= "sh-sci", -	.id         = 1, +	.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        = 0xFFE42000,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr          = SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id  = SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0x900)),  	.regtype        = SCIx_SH4_SCIF_REGTYPE,  }; +static struct resource scif2_resources[] = { +	DEFINE_RES_MEM(0xffe42000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x900)), +}; +  static struct platform_device scif2_device = {  	.name		= "sh-sci", -	.id         = 2, +	.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        = 0xFFE43000,  	.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(0x920)),  	.regtype        = SCIx_SH4_SCIF_REGTYPE,  }; +static struct resource scif3_resources[] = { +	DEFINE_RES_MEM(0xffe43000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x920)), +}; +  static struct platform_device scif3_device = {  	.name		= "sh-sci", -	.id	        = 3, +	.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        = 0xFFE44000,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr          = SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0x940)),  	.regtype        = SCIx_SH4_SCIF_REGTYPE,  }; +static struct resource scif4_resources[] = { +	DEFINE_RES_MEM(0xffe44000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x940)), +}; +  static struct platform_device scif4_device = {  	.name		= "sh-sci", -	.id	        = 4, +	.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        = 0xFFE43000,  	.flags          = UPF_BOOT_AUTOCONF,  	.scscr          = SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type           = PORT_SCIF, -	.irqs           = SCIx_IRQ_MUXED(evt2irq(0x960)),  	.regtype		= SCIx_SH4_SCIF_REGTYPE,  }; +static struct resource scif5_resources[] = { +	DEFINE_RES_MEM(0xffe43000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x960)), +}; +  static struct platform_device scif5_device = {  	.name		= "sh-sci", -	.id	        = 5, +	.id		= 5, +	.resource	= scif5_resources, +	.num_resources	= ARRAY_SIZE(scif5_resources),  	.dev		= {  		.platform_data	= &scif5_platform_data,  	}, @@ -176,25 +200,18 @@ static struct platform_device i2c0_device = {  /* TMU */  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	= 0xFFD80014 - 1, -		.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, @@ -204,26 +221,19 @@ 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	= 0xFFD80020 - 1, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x420), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0xffd81000, 0x30), +	DEFINE_RES_IRQ(evt2irq(0x480)), +	DEFINE_RES_IRQ(evt2irq(0x4a0)), +	DEFINE_RES_IRQ(evt2irq(0x4c0)),  };  static struct platform_device tmu1_device = { -	.name		= "sh_tmu", -	.id			= 1, +	.name		= "sh-tmu", +	.id		= 1,  	.dev = {  		.platform_data	= &tmu1_platform_data,  	}, @@ -232,25 +242,19 @@ 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	= 0xFFD80030 - 1, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x440), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0xffd82000, 0x30), +	DEFINE_RES_IRQ(evt2irq(0x500)), +	DEFINE_RES_IRQ(evt2irq(0x520)), +	DEFINE_RES_IRQ(evt2irq(0x540)),  };  static struct platform_device tmu2_device = { -	.name		= "sh_tmu", -	.id			= 2, +	.name		= "sh-tmu", +	.id		= 2,  	.dev = {  		.platform_data	= &tmu2_platform_data,  	}, @@ -258,169 +262,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	= 0xFFD81014 - 1, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x480), -		.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	= 0xFFD81020 - 1, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x4A0), -		.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	= 0xFFD81030 - 1, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x4C0), -		.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 = 0x4, -	.timer_bit = 0, -}; - -static struct resource tmu6_resources[] = { -	[0] = { -		.start	= 0xFFD82008, -		.end	= 0xFFD82014 - 1, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x500), -		.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	= 0xFFD82020 - 1, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x520), -		.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	= 0xFFD82030 - 1, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x540), -		.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 *sh7734_devices[] __initdata = {  	&scif0_device,  	&scif1_device, @@ -431,12 +272,6 @@ static struct platform_device *sh7734_devices[] __initdata = {  	&tmu0_device,  	&tmu1_device,  	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device, -	&tmu6_device, -	&tmu7_device, -	&tmu8_device,  	&rtc_device,  }; @@ -450,12 +285,6 @@ static struct platform_device *sh7734_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) diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c index 9079a0f9ea9..7b24ec4b409 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c @@ -24,76 +24,80 @@  #include <cpu/sh7757.h>  static struct plat_sci_port scif2_platform_data = { -	.mapbase	= 0xfe4b0000,		/* SCIF2 */  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x700)), +}; + +static struct resource scif2_resources[] = { +	DEFINE_RES_MEM(0xfe4b0000, 0x100),		/* SCIF2 */ +	DEFINE_RES_IRQ(evt2irq(0x700)),  };  static struct platform_device scif2_device = {  	.name		= "sh-sci",  	.id		= 0, +	.resource	= scif2_resources, +	.num_resources	= ARRAY_SIZE(scif2_resources),  	.dev		= {  		.platform_data	= &scif2_platform_data,  	},  };  static struct plat_sci_port scif3_platform_data = { -	.mapbase	= 0xfe4c0000,		/* SCIF3 */  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0xb80)), +}; + +static struct resource scif3_resources[] = { +	DEFINE_RES_MEM(0xfe4c0000, 0x100),		/* SCIF3 */ +	DEFINE_RES_IRQ(evt2irq(0xb80)),  };  static struct platform_device scif3_device = {  	.name		= "sh-sci",  	.id		= 1, +	.resource	= scif3_resources, +	.num_resources	= ARRAY_SIZE(scif3_resources),  	.dev		= {  		.platform_data	= &scif3_platform_data,  	},  };  static struct plat_sci_port scif4_platform_data = { -	.mapbase	= 0xfe4d0000,		/* SCIF4 */  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0xF00)), +}; + +static struct resource scif4_resources[] = { +	DEFINE_RES_MEM(0xfe4d0000, 0x100),		/* SCIF4 */ +	DEFINE_RES_IRQ(evt2irq(0xf00)),  };  static struct platform_device scif4_device = {  	.name		= "sh-sci",  	.id		= 2, +	.resource	= scif4_resources, +	.num_resources	= ARRAY_SIZE(scif4_resources),  	.dev		= {  		.platform_data	= &scif4_platform_data,  	},  };  static struct sh_timer_config tmu0_platform_data = { -	.channel_offset = 0x04, -	.timer_bit = 0, -	.clockevent_rating = 200, +	.channels_mask = 3,  };  static struct resource tmu0_resources[] = { -	[0] = { -		.start	= 0xfe430008, -		.end	= 0xfe430013, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x580), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0xfe430000, 0x20), +	DEFINE_RES_IRQ(evt2irq(0x580)), +	DEFINE_RES_IRQ(evt2irq(0x5a0)),  };  static struct platform_device tmu0_device = { -	.name		= "sh_tmu", +	.name		= "sh-tmu",  	.id		= 0,  	.dev = {  		.platform_data	= &tmu0_platform_data, @@ -102,34 +106,6 @@ static struct platform_device tmu0_device = {  	.num_resources	= ARRAY_SIZE(tmu0_resources),  }; -static struct sh_timer_config tmu1_platform_data = { -	.channel_offset = 0x10, -	.timer_bit = 1, -	.clocksource_rating = 200, -}; - -static struct resource tmu1_resources[] = { -	[0] = { -		.start	= 0xfe430014, -		.end	= 0xfe43001f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x5a0), -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu1_device = { -	.name		= "sh_tmu", -	.id		= 1, -	.dev = { -		.platform_data	= &tmu1_platform_data, -	}, -	.resource	= tmu1_resources, -	.num_resources	= ARRAY_SIZE(tmu1_resources), -}; -  static struct resource spi0_resources[] = {  	[0] = {  		.start	= 0xfe002000, @@ -770,7 +746,6 @@ static struct platform_device *sh7757_devices[] __initdata = {  	&scif3_device,  	&scif4_device,  	&tmu0_device, -	&tmu1_device,  	&dma0_device,  	&dma1_device,  	&dma2_device, @@ -794,7 +769,6 @@ static struct platform_device *sh7757_early_devices[] __initdata = {  	&scif3_device,  	&scif4_device,  	&tmu0_device, -	&tmu1_device,  };  void __init plat_early_device_setup(void) diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c index 1686acaaf45..5a47d670dde 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c @@ -19,54 +19,66 @@  #include <linux/usb/ohci_pdriver.h>  static struct plat_sci_port scif0_platform_data = { -	.mapbase	= 0xffe00000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x700)),  	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE,  }; +static struct resource scif0_resources[] = { +	DEFINE_RES_MEM(0xffe00000, 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	= 0xffe08000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0xb80)),  	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE,  }; +static struct resource scif1_resources[] = { +	DEFINE_RES_MEM(0xffe08000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xb80)), +}; +  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	= 0xffe10000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0xf00)),  	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE,  }; +static struct resource scif2_resources[] = { +	DEFINE_RES_MEM(0xffe10000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xf00)), +}; +  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,  	}, @@ -146,25 +158,18 @@ static struct platform_device usbf_device = {  };  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(0x580), -		.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, @@ -174,25 +179,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(0x5a0), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0xffd88000, 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, @@ -201,124 +199,12 @@ 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	= evt2irq(0x5c0), -		.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	= 0xffd88008, -		.end	= 0xffd88013, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0xe00), -		.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	= 0xffd88014, -		.end	= 0xffd8801f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0xe20), -		.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	= 0xffd88020, -		.end	= 0xffd8802b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0xe40), -		.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 platform_device *sh7763_devices[] __initdata = {  	&scif0_device,  	&scif1_device,  	&scif2_device,  	&tmu0_device,  	&tmu1_device, -	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device,  	&rtc_device,  	&usb_ohci_device,  	&usbf_device, @@ -337,10 +223,6 @@ static struct platform_device *sh7763_early_devices[] __initdata = {  	&scif2_device,  	&tmu0_device,  	&tmu1_device, -	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device,  };  void __init plat_early_device_setup(void) 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) diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c index de45b704687..3ee7dd9b3a6 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c @@ -18,61 +18,62 @@  #include <cpu/dma-register.h>  static struct plat_sci_port scif0_platform_data = { -	.mapbase	= 0xffe00000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x700)),  	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE,  }; +static struct resource scif0_resources[] = { +	DEFINE_RES_MEM(0xffe00000, 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	= 0xffe10000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0xb80)),  	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE,  }; +static struct resource scif1_resources[] = { +	DEFINE_RES_MEM(0xffe10000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0xb80)), +}; +  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 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(0x580), -		.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, @@ -82,25 +83,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(0x5a0), -		.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, @@ -109,114 +103,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	= evt2irq(0x5c0), -		.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	= evt2irq(0xe00), -		.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	= evt2irq(0xe20), -		.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	= evt2irq(0xe40), -		.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 resource rtc_resources[] = {  	[0] = {  		.start	= 0xffe80000, @@ -378,10 +264,6 @@ static struct platform_device *sh7780_devices[] __initdata = {  	&scif1_device,  	&tmu0_device,  	&tmu1_device, -	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device,  	&rtc_device,  	&dma0_device,  	&dma1_device, @@ -399,19 +281,13 @@ static struct platform_device *sh7780_early_devices[] __initdata = {  	&scif1_device,  	&tmu0_device,  	&tmu1_device, -	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device,  };  void __init plat_early_device_setup(void)  {  	if (mach_is_sh2007()) {  		scif0_platform_data.scscr &= ~SCSCR_CKE1; -		scif0_platform_data.scbrr_algo_id = SCBRR_ALGO_2;  		scif1_platform_data.scscr &= ~SCSCR_CKE1; -		scif1_platform_data.scbrr_algo_id = SCBRR_ALGO_2;  	}  	early_platform_add_devices(sh7780_early_devices, diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c index 0968ecb962e..c72d5a5d099 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c @@ -20,133 +20,150 @@  #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, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x700)),  	.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, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x780)),  	.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, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x980)),  	.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, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x9a0)),  	.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, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x9c0)),  	.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, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x9e0)),  	.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	= evt2irq(0x580), -		.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, @@ -156,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	= evt2irq(0x5a0), -		.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, @@ -183,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	= evt2irq(0x5c0), -		.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	= evt2irq(0xe00), -		.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	= evt2irq(0xe20), -		.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	= evt2irq(0xe40), -		.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[] = {  	{ @@ -436,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,  }; @@ -460,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) diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c index ab52d4d4484..479e79bdd3d 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c @@ -28,21 +28,25 @@  #include <asm/mmzone.h>  static struct plat_sci_port scif0_platform_data = { -	.mapbase	= 0xffea0000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= { evt2irq(0x700), -			    evt2irq(0x720), -			    evt2irq(0x760), -			    evt2irq(0x740) },  	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE,  }; +static struct resource scif0_resources[] = { +	DEFINE_RES_MEM(0xffea0000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x700)), +	DEFINE_RES_IRQ(evt2irq(0x720)), +	DEFINE_RES_IRQ(evt2irq(0x760)), +	DEFINE_RES_IRQ(evt2irq(0x740)), +}; +  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,  	}, @@ -52,115 +56,137 @@ static struct platform_device scif0_device = {   * The rest of these all have multiplexed IRQs   */  static struct plat_sci_port scif1_platform_data = { -	.mapbase	= 0xffeb0000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x780)),  	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE,  }; +static struct resource scif1_resources[] = { +	DEFINE_RES_MEM(0xffeb0000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x780)), +}; + +static struct resource scif1_demux_resources[] = { +	DEFINE_RES_MEM(0xffeb0000, 0x100), +	/* Placeholders, see sh7786_devices_setup() */ +	DEFINE_RES_IRQ(0), +	DEFINE_RES_IRQ(0), +	DEFINE_RES_IRQ(0), +	DEFINE_RES_IRQ(0), +}; +  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, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x840)),  	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE,  }; +static struct resource scif2_resources[] = { +	DEFINE_RES_MEM(0xffec0000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x840)), +}; +  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, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x860)),  	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE,  }; +static struct resource scif3_resources[] = { +	DEFINE_RES_MEM(0xffed0000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x860)), +}; +  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, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x880)),  	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE,  }; +static struct resource scif4_resources[] = { +	DEFINE_RES_MEM(0xffee0000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x880)), +}; +  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, -	.scbrr_algo_id	= SCBRR_ALGO_1,  	.type		= PORT_SCIF, -	.irqs		= SCIx_IRQ_MUXED(evt2irq(0x8a0)),  	.regtype	= SCIx_SH4_SCIF_FIFODATA_REGTYPE,  }; +static struct resource scif5_resources[] = { +	DEFINE_RES_MEM(0xffef0000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x8a0)), +}; +  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	= 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, @@ -170,25 +196,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(0xffda0000, 0x2c), +	DEFINE_RES_IRQ(evt2irq(0x480)), +	DEFINE_RES_IRQ(evt2irq(0x4a0)), +	DEFINE_RES_IRQ(evt2irq(0x4c0)),  };  static struct platform_device tmu1_device = { -	.name		= "sh_tmu", +	.name		= "sh-tmu",  	.id		= 1,  	.dev = {  		.platform_data	= &tmu1_platform_data, @@ -198,24 +217,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(0xffdc0000, 0x2c), +	DEFINE_RES_IRQ(evt2irq(0x7a0)), +	DEFINE_RES_IRQ(evt2irq(0x7a0)), +	DEFINE_RES_IRQ(evt2irq(0x7a0)),  };  static struct platform_device tmu2_device = { -	.name		= "sh_tmu", +	.name		= "sh-tmu",  	.id		= 2,  	.dev = {  		.platform_data	= &tmu2_platform_data, @@ -225,24 +238,18 @@ static struct platform_device tmu2_device = {  };  static struct sh_timer_config tmu3_platform_data = { -	.channel_offset = 0x04, -	.timer_bit = 0, +	.channels_mask = 7,  };  static struct resource tmu3_resources[] = { -	[0] = { -		.start	= 0xffda0008, -		.end	= 0xffda0013, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x480), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0xffde0000, 0x2c), +	DEFINE_RES_IRQ(evt2irq(0x7c0)), +	DEFINE_RES_IRQ(evt2irq(0x7c0)), +	DEFINE_RES_IRQ(evt2irq(0x7c0)),  };  static struct platform_device tmu3_device = { -	.name		= "sh_tmu", +	.name		= "sh-tmu",  	.id		= 3,  	.dev = {  		.platform_data	= &tmu3_platform_data, @@ -251,222 +258,6 @@ static struct platform_device tmu3_device = {  	.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	= 0xffda0014, -		.end	= 0xffda001f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x4a0), -		.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	= 0xffda0020, -		.end	= 0xffda002b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x4c0), -		.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	= 0xffdc0008, -		.end	= 0xffdc0013, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x7a0), -		.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	= 0xffdc0014, -		.end	= 0xffdc001f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x7a0), -		.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	= 0xffdc0020, -		.end	= 0xffdc002b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x7a0), -		.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 sh_timer_config tmu9_platform_data = { -	.channel_offset = 0x04, -	.timer_bit = 0, -}; - -static struct resource tmu9_resources[] = { -	[0] = { -		.start	= 0xffde0008, -		.end	= 0xffde0013, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x7c0), -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu9_device = { -	.name		= "sh_tmu", -	.id		= 9, -	.dev = { -		.platform_data	= &tmu9_platform_data, -	}, -	.resource	= tmu9_resources, -	.num_resources	= ARRAY_SIZE(tmu9_resources), -}; - -static struct sh_timer_config tmu10_platform_data = { -	.channel_offset = 0x10, -	.timer_bit = 1, -}; - -static struct resource tmu10_resources[] = { -	[0] = { -		.start	= 0xffde0014, -		.end	= 0xffde001f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x7c0), -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu10_device = { -	.name		= "sh_tmu", -	.id		= 10, -	.dev = { -		.platform_data	= &tmu10_platform_data, -	}, -	.resource	= tmu10_resources, -	.num_resources	= ARRAY_SIZE(tmu10_resources), -}; - -static struct sh_timer_config tmu11_platform_data = { -	.channel_offset = 0x1c, -	.timer_bit = 2, -}; - -static struct resource tmu11_resources[] = { -	[0] = { -		.start	= 0xffde0020, -		.end	= 0xffde002b, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x7c0), -		.flags	= IORESOURCE_IRQ, -	}, -}; - -static struct platform_device tmu11_device = { -	.name		= "sh_tmu", -	.id		= 11, -	.dev = { -		.platform_data	= &tmu11_platform_data, -	}, -	.resource	= tmu11_resources, -	.num_resources	= ARRAY_SIZE(tmu11_resources), -}; -  static const struct sh_dmae_channel dmac0_channels[] = {  	{  		.offset = 0, @@ -608,15 +399,6 @@ static struct platform_device *sh7786_early_devices[] __initdata = {  	&tmu0_device,  	&tmu1_device,  	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device, -	&tmu6_device, -	&tmu7_device, -	&tmu8_device, -	&tmu9_device, -	&tmu10_device, -	&tmu11_device,  };  static struct platform_device *sh7786_devices[] __initdata = { @@ -1037,13 +819,16 @@ static int __init sh7786_devices_setup(void)  	 */  	irq = intc_irq_lookup(sh7786_intc_desc.name, TXI1);  	if (irq > 0) { -		scif1_platform_data.irqs[SCIx_TXI_IRQ] = irq; -		scif1_platform_data.irqs[SCIx_ERI_IRQ] = +		scif1_demux_resources[1].start =  			intc_irq_lookup(sh7786_intc_desc.name, ERI1); -		scif1_platform_data.irqs[SCIx_BRI_IRQ] = -			intc_irq_lookup(sh7786_intc_desc.name, BRI1); -		scif1_platform_data.irqs[SCIx_RXI_IRQ] = +		scif1_demux_resources[2].start =  			intc_irq_lookup(sh7786_intc_desc.name, RXI1); +		scif1_demux_resources[3].start = irq; +		scif1_demux_resources[4].start = +			intc_irq_lookup(sh7786_intc_desc.name, BRI1); + +		scif1_device.resource = scif1_demux_resources; +		scif1_device.num_resources = ARRAY_SIZE(scif1_demux_resources);  	}  	ret = platform_add_devices(sh7786_early_devices, diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c index 688f7ed1bab..a78c5feb4e3 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c @@ -28,85 +28,90 @@   * all rather than adding infrastructure to hack around it.   */  static struct plat_sci_port scif0_platform_data = { -	.mapbase	= 0xffc30000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= { evt2irq(0x700), -			    evt2irq(0x720), -			    evt2irq(0x760), -			    evt2irq(0x740) }, +}; + +static struct resource scif0_resources[] = { +	DEFINE_RES_MEM(0xffc30000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x700)), +	DEFINE_RES_IRQ(evt2irq(0x720)), +	DEFINE_RES_IRQ(evt2irq(0x760)), +	DEFINE_RES_IRQ(evt2irq(0x740)),  };  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	= 0xffc40000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= { evt2irq(0x780), -			    evt2irq(0x7a0), -			    evt2irq(0x7e0), -			    evt2irq(0x7c0) }, +}; + +static struct resource scif1_resources[] = { +	DEFINE_RES_MEM(0xffc40000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x780)), +	DEFINE_RES_IRQ(evt2irq(0x7a0)), +	DEFINE_RES_IRQ(evt2irq(0x7e0)), +	DEFINE_RES_IRQ(evt2irq(0x7c0)),  };  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	= 0xffc60000,  	.flags		= UPF_BOOT_AUTOCONF,  	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_REIE, -	.scbrr_algo_id	= SCBRR_ALGO_2,  	.type		= PORT_SCIF, -	.irqs		= { evt2irq(0x880), -			    evt2irq(0x8a0), -			    evt2irq(0x8e0), -			    evt2irq(0x8c0) }, +}; + +static struct resource scif2_resources[] = { +	DEFINE_RES_MEM(0xffc60000, 0x100), +	DEFINE_RES_IRQ(evt2irq(0x880)), +	DEFINE_RES_IRQ(evt2irq(0x8a0)), +	DEFINE_RES_IRQ(evt2irq(0x8e0)), +	DEFINE_RES_IRQ(evt2irq(0x8c0)),  };  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 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	= 0xffc10008, -		.end	= 0xffc10013, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x400), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0xffc10000, 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, @@ -116,25 +121,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	= 0xffc10014, -		.end	= 0xffc1001f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x420), -		.flags	= IORESOURCE_IRQ, -	}, +	DEFINE_RES_MEM(0xffc20000, 0x2c), +	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, @@ -143,124 +141,12 @@ 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	= 0xffc10020, -		.end	= 0xffc1002f, -		.flags	= IORESOURCE_MEM, -	}, -	[1] = { -		.start	= evt2irq(0x440), -		.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	= 0xffc20008, -		.end	= 0xffc20013, -		.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	= 0xffc20014, -		.end	= 0xffc2001f, -		.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	= 0xffc20020, -		.end	= 0xffc2002b, -		.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 platform_device *shx3_early_devices[] __initdata = {  	&scif0_device,  	&scif1_device,  	&scif2_device,  	&tmu0_device,  	&tmu1_device, -	&tmu2_device, -	&tmu3_device, -	&tmu4_device, -	&tmu5_device,  };  static int __init shx3_devices_setup(void)  | 
