Commit 9b17e48c authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Simon Horman

sh: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarSimon Horman <horms+renesas@verge.net.au>
parent 1c41ecb6
...@@ -58,7 +58,8 @@ int __init __deprecated cpg_clk_init(void) ...@@ -58,7 +58,8 @@ int __init __deprecated cpg_clk_init(void)
clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL); clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL);
clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL); clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL);
clk_add_alias("cmt_fck", NULL, "peripheral_clk", NULL); clk_add_alias("fck", "sh-cmt-16.0", "peripheral_clk", NULL);
clk_add_alias("fck", "sh-cmt-32.0", "peripheral_clk", NULL);
clk_add_alias("sci_ick", NULL, "peripheral_clk", NULL); clk_add_alias("sci_ick", NULL, "peripheral_clk", NULL);
return ret; return ret;
......
...@@ -152,62 +152,24 @@ static struct platform_device eth_device = { ...@@ -152,62 +152,24 @@ static struct platform_device eth_device = {
.resource = eth_resources, .resource = eth_resources,
}; };
static struct sh_timer_config cmt0_platform_data = { static struct sh_timer_config cmt_platform_data = {
.channel_offset = 0x02, .channels_mask = 3,
.timer_bit = 0,
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
}; };
static struct resource cmt0_resources[] = { static struct resource cmt_resources[] = {
[0] = { DEFINE_RES_MEM(0xf84a0070, 0x10),
.start = 0xf84a0072, DEFINE_RES_IRQ(86),
.end = 0xf84a0077, DEFINE_RES_IRQ(87),
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 86,
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device cmt0_device = { static struct platform_device cmt_device = {
.name = "sh_cmt", .name = "sh-cmt-16",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &cmt0_platform_data, .platform_data = &cmt_platform_data,
},
.resource = cmt0_resources,
.num_resources = ARRAY_SIZE(cmt0_resources),
};
static struct sh_timer_config cmt1_platform_data = {
.channel_offset = 0x08,
.timer_bit = 1,
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
};
static struct resource cmt1_resources[] = {
[0] = {
.start = 0xf84a0078,
.end = 0xf84a007d,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 87,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device cmt1_device = {
.name = "sh_cmt",
.id = 1,
.dev = {
.platform_data = &cmt1_platform_data,
}, },
.resource = cmt1_resources, .resource = cmt_resources,
.num_resources = ARRAY_SIZE(cmt1_resources), .num_resources = ARRAY_SIZE(cmt_resources),
}; };
static struct platform_device *sh7619_devices[] __initdata = { static struct platform_device *sh7619_devices[] __initdata = {
...@@ -215,8 +177,7 @@ static struct platform_device *sh7619_devices[] __initdata = { ...@@ -215,8 +177,7 @@ static struct platform_device *sh7619_devices[] __initdata = {
&scif1_device, &scif1_device,
&scif2_device, &scif2_device,
&eth_device, &eth_device,
&cmt0_device, &cmt_device,
&cmt1_device,
}; };
static int __init sh7619_devices_setup(void) static int __init sh7619_devices_setup(void)
...@@ -235,8 +196,7 @@ static struct platform_device *sh7619_early_devices[] __initdata = { ...@@ -235,8 +196,7 @@ static struct platform_device *sh7619_early_devices[] __initdata = {
&scif0_device, &scif0_device,
&scif1_device, &scif1_device,
&scif2_device, &scif2_device,
&cmt0_device, &cmt_device,
&cmt1_device,
}; };
#define STBCR3 0xf80a0000 #define STBCR3 0xf80a0000
......
...@@ -117,7 +117,7 @@ static struct clk_lookup lookups[] = { ...@@ -117,7 +117,7 @@ static struct clk_lookup lookups[] = {
/* MSTP clocks */ /* MSTP clocks */
CLKDEV_CON_ID("sci_ick", &mstp_clks[MSTP77]), CLKDEV_CON_ID("sci_ick", &mstp_clks[MSTP77]),
CLKDEV_CON_ID("vdc3", &mstp_clks[MSTP74]), CLKDEV_CON_ID("vdc3", &mstp_clks[MSTP74]),
CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP72]), CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]),
CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]), CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]),
CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]), CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]),
CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP34]), CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP34]),
......
...@@ -158,7 +158,7 @@ static struct clk_lookup lookups[] = { ...@@ -158,7 +158,7 @@ static struct clk_lookup lookups[] = {
CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]), CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]),
CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]), CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]),
CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]), CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]),
CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP72]), CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]),
CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]), CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]),
CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]), CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]),
CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]), CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]),
......
...@@ -265,62 +265,24 @@ static struct platform_device scif3_device = { ...@@ -265,62 +265,24 @@ static struct platform_device scif3_device = {
}, },
}; };
static struct sh_timer_config cmt0_platform_data = { static struct sh_timer_config cmt_platform_data = {
.channel_offset = 0x02, .channels_mask = 3,
.timer_bit = 0,
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
}; };
static struct resource cmt0_resources[] = { static struct resource cmt_resources[] = {
[0] = { DEFINE_RES_MEM(0xfffec000, 0x10),
.start = 0xfffec002, DEFINE_RES_IRQ(142),
.end = 0xfffec007, DEFINE_RES_IRQ(143),
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 142,
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device cmt0_device = { static struct platform_device cmt_device = {
.name = "sh_cmt", .name = "sh-cmt-16",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &cmt0_platform_data, .platform_data = &cmt_platform_data,
},
.resource = cmt0_resources,
.num_resources = ARRAY_SIZE(cmt0_resources),
};
static struct sh_timer_config cmt1_platform_data = {
.channel_offset = 0x08,
.timer_bit = 1,
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
};
static struct resource cmt1_resources[] = {
[0] = {
.start = 0xfffec008,
.end = 0xfffec00d,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 143,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device cmt1_device = {
.name = "sh_cmt",
.id = 1,
.dev = {
.platform_data = &cmt1_platform_data,
}, },
.resource = cmt1_resources, .resource = cmt_resources,
.num_resources = ARRAY_SIZE(cmt1_resources), .num_resources = ARRAY_SIZE(cmt_resources),
}; };
static struct sh_timer_config mtu2_0_platform_data = { static struct sh_timer_config mtu2_0_platform_data = {
...@@ -404,8 +366,7 @@ static struct platform_device *sh7203_devices[] __initdata = { ...@@ -404,8 +366,7 @@ static struct platform_device *sh7203_devices[] __initdata = {
&scif1_device, &scif1_device,
&scif2_device, &scif2_device,
&scif3_device, &scif3_device,
&cmt0_device, &cmt_device,
&cmt1_device,
&mtu2_0_device, &mtu2_0_device,
&mtu2_1_device, &mtu2_1_device,
&rtc_device, &rtc_device,
...@@ -428,8 +389,7 @@ static struct platform_device *sh7203_early_devices[] __initdata = { ...@@ -428,8 +389,7 @@ static struct platform_device *sh7203_early_devices[] __initdata = {
&scif1_device, &scif1_device,
&scif2_device, &scif2_device,
&scif3_device, &scif3_device,
&cmt0_device, &cmt_device,
&cmt1_device,
&mtu2_0_device, &mtu2_0_device,
&mtu2_1_device, &mtu2_1_device,
}; };
......
...@@ -217,62 +217,24 @@ static struct platform_device scif3_device = { ...@@ -217,62 +217,24 @@ static struct platform_device scif3_device = {
}, },
}; };
static struct sh_timer_config cmt0_platform_data = { static struct sh_timer_config cmt_platform_data = {
.channel_offset = 0x02, .channels_mask = 3,
.timer_bit = 0,
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
}; };
static struct resource cmt0_resources[] = { static struct resource cmt_resources[] = {
[0] = { DEFINE_RES_MEM(0xfffec000, 0x10),
.start = 0xfffec002, DEFINE_RES_IRQ(140),
.end = 0xfffec007, DEFINE_RES_IRQ(144),
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 140,
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device cmt0_device = { static struct platform_device cmt_device = {
.name = "sh_cmt", .name = "sh-cmt-16",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &cmt0_platform_data, .platform_data = &cmt_platform_data,
},
.resource = cmt0_resources,
.num_resources = ARRAY_SIZE(cmt0_resources),
};
static struct sh_timer_config cmt1_platform_data = {
.channel_offset = 0x08,
.timer_bit = 1,
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
};
static struct resource cmt1_resources[] = {
[0] = {
.start = 0xfffec008,
.end = 0xfffec00d,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 144,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device cmt1_device = {
.name = "sh_cmt",
.id = 1,
.dev = {
.platform_data = &cmt1_platform_data,
}, },
.resource = cmt1_resources, .resource = cmt_resources,
.num_resources = ARRAY_SIZE(cmt1_resources), .num_resources = ARRAY_SIZE(cmt_resources),
}; };
static struct sh_timer_config mtu2_0_platform_data = { static struct sh_timer_config mtu2_0_platform_data = {
...@@ -364,8 +326,7 @@ static struct platform_device *sh7206_devices[] __initdata = { ...@@ -364,8 +326,7 @@ static struct platform_device *sh7206_devices[] __initdata = {
&scif1_device, &scif1_device,
&scif2_device, &scif2_device,
&scif3_device, &scif3_device,
&cmt0_device, &cmt_device,
&cmt1_device,
&mtu2_0_device, &mtu2_0_device,
&mtu2_1_device, &mtu2_1_device,
&mtu2_2_device, &mtu2_2_device,
...@@ -388,8 +349,7 @@ static struct platform_device *sh7206_early_devices[] __initdata = { ...@@ -388,8 +349,7 @@ static struct platform_device *sh7206_early_devices[] __initdata = {
&scif1_device, &scif1_device,
&scif2_device, &scif2_device,
&scif3_device, &scif3_device,
&cmt0_device, &cmt_device,
&cmt1_device,
&mtu2_0_device, &mtu2_0_device,
&mtu2_1_device, &mtu2_1_device,
&mtu2_2_device, &mtu2_2_device,
......
...@@ -433,65 +433,24 @@ static struct platform_device scif7_device = { ...@@ -433,65 +433,24 @@ static struct platform_device scif7_device = {
}, },
}; };
static struct sh_timer_config cmt0_platform_data = { static struct sh_timer_config cmt_platform_data = {
.channel_offset = 0x02, .channels_mask = 3,
.timer_bit = 0,
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
}; };
static struct resource cmt0_resources[] = { static struct resource cmt_resources[] = {
[0] = { DEFINE_RES_MEM(0xfffec000, 0x10),
.name = "CMT0", DEFINE_RES_IRQ(175),
.start = 0xfffec002, DEFINE_RES_IRQ(176),
.end = 0xfffec007,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 175,
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device cmt0_device = { static struct platform_device cmt_device = {
.name = "sh_cmt", .name = "sh-cmt-16",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &cmt0_platform_data, .platform_data = &cmt_platform_data,
},
.resource = cmt0_resources,
.num_resources = ARRAY_SIZE(cmt0_resources),
};
static struct sh_timer_config cmt1_platform_data = {
.name = "CMT1",
.channel_offset = 0x08,
.timer_bit = 1,
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
};
static struct resource cmt1_resources[] = {
[0] = {
.name = "CMT1",
.start = 0xfffec008,
.end = 0xfffec00d,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 176,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device cmt1_device = {
.name = "sh_cmt",
.id = 1,
.dev = {
.platform_data = &cmt1_platform_data,
}, },
.resource = cmt1_resources, .resource = cmt_resources,
.num_resources = ARRAY_SIZE(cmt1_resources), .num_resources = ARRAY_SIZE(cmt_resources),
}; };
static struct sh_timer_config mtu2_0_platform_data = { static struct sh_timer_config mtu2_0_platform_data = {
...@@ -620,8 +579,7 @@ static struct platform_device *sh7264_devices[] __initdata = { ...@@ -620,8 +579,7 @@ static struct platform_device *sh7264_devices[] __initdata = {
&scif5_device, &scif5_device,
&scif6_device, &scif6_device,
&scif7_device, &scif7_device,
&cmt0_device, &cmt_device,
&cmt1_device,
&mtu2_0_device, &mtu2_0_device,
&mtu2_1_device, &mtu2_1_device,
&rtc_device, &rtc_device,
...@@ -649,8 +607,7 @@ static struct platform_device *sh7264_early_devices[] __initdata = { ...@@ -649,8 +607,7 @@ static struct platform_device *sh7264_early_devices[] __initdata = {
&scif5_device, &scif5_device,
&scif6_device, &scif6_device,
&scif7_device, &scif7_device,
&cmt0_device, &cmt_device,
&cmt1_device,
&mtu2_0_device, &mtu2_0_device,
&mtu2_1_device, &mtu2_1_device,
}; };
......
...@@ -455,62 +455,24 @@ static struct platform_device scif7_device = { ...@@ -455,62 +455,24 @@ static struct platform_device scif7_device = {
}, },
}; };
static struct sh_timer_config cmt0_platform_data = { static struct sh_timer_config cmt_platform_data = {
.channel_offset = 0x02, .channels_mask = 3,
.timer_bit = 0,
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
}; };
static struct resource cmt0_resources[] = { static struct resource cmt_resources[] = {
[0] = { DEFINE_RES_MEM(0xfffec000, 0x10),
.start = 0xfffec002, DEFINE_RES_IRQ(188),
.end = 0xfffec007, DEFINE_RES_IRQ(189),
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 188,
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device cmt0_device = { static struct platform_device cmt_device = {
.name = "sh_cmt", .name = "sh-cmt-16",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &cmt0_platform_data, .platform_data = &cmt_platform_data,
},
.resource = cmt0_resources,
.num_resources = ARRAY_SIZE(cmt0_resources),
};
static struct sh_timer_config cmt1_platform_data = {
.channel_offset = 0x08,
.timer_bit = 1,
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
};
static struct resource cmt1_resources[] = {
[0] = {
.start = 0xfffec008,
.end = 0xfffec00d,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 189,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device cmt1_device = {
.name = "sh_cmt",
.id = 1,
.dev = {
.platform_data = &cmt1_platform_data,
}, },
.resource = cmt1_resources, .resource = cmt_resources,
.num_resources = ARRAY_SIZE(cmt1_resources), .num_resources = ARRAY_SIZE(cmt_resources),
}; };
static struct sh_timer_config mtu2_0_platform_data = { static struct sh_timer_config mtu2_0_platform_data = {
...@@ -629,8 +591,7 @@ static struct platform_device *sh7269_devices[] __initdata = { ...@@ -629,8 +591,7 @@ static struct platform_device *sh7269_devices[] __initdata = {
&scif5_device, &scif5_device,
&scif6_device, &scif6_device,
&scif7_device, &scif7_device,
&cmt0_device, &cmt_device,
&cmt1_device,
&mtu2_0_device, &mtu2_0_device,
&mtu2_1_device, &mtu2_1_device,
&rtc_device, &rtc_device,
...@@ -658,8 +619,7 @@ static struct platform_device *sh7269_early_devices[] __initdata = { ...@@ -658,8 +619,7 @@ static struct platform_device *sh7269_early_devices[] __initdata = {
&scif5_device, &scif5_device,
&scif6_device, &scif6_device,
&scif7_device, &scif7_device,
&cmt0_device, &cmt_device,
&cmt1_device,
&mtu2_0_device, &mtu2_0_device,
&mtu2_1_device, &mtu2_1_device,
}; };
......
...@@ -152,141 +152,23 @@ static struct platform_device usbf_device = { ...@@ -152,141 +152,23 @@ static struct platform_device usbf_device = {
.resource = usbf_resources, .resource = usbf_resources,
}; };
static struct sh_timer_config cmt0_platform_data = { static struct sh_timer_config cmt_platform_data = {
.channel_offset = 0x10, .channels_mask = 0x1f,
.timer_bit = 0,
.clockevent_rating = 125,
.clocksource_rating = 125,
}; };
static struct resource cmt0_resources[] = { static struct resource cmt_resources[] = {
[0] = { DEFINE_RES_MEM(0x044a0000, 0x60),
.start = 0x044a0010, DEFINE_RES_IRQ(evt2irq(0xf00)),
.end = 0x044a001b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = evt2irq(0xf00),
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device cmt0_device = { static struct platform_device cmt_device = {
.name = "sh_cmt", .name = "sh-cmt-32",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &cmt0_platform_data, .platform_data = &cmt_platform_data,
},
.resource = cmt0_resources,
.num_resources = ARRAY_SIZE(cmt0_resources),
};
static struct sh_timer_config cmt1_platform_data = {
.channel_offset = 0x20,
.timer_bit = 1,
};
static struct resource cmt1_resources[] = {
[0] = {
.start = 0x044a0020,
.end = 0x044a002b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = evt2irq(0xf00),
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device cmt1_device = {
.name = "sh_cmt",
.id = 1,
.dev = {
.platform_data = &cmt1_platform_data,
},
.resource = cmt1_resources,
.num_resources = ARRAY_SIZE(cmt1_resources),
};
static struct sh_timer_config cmt2_platform_data = {
.channel_offset = 0x30,
.timer_bit = 2,
};
static struct resource cmt2_resources[] = {
[0] = {
.start = 0x044a0030,
.end = 0x044a003b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = evt2irq(0xf00),
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device cmt2_device = {
.name = "sh_cmt",
.id = 2,
.dev = {
.platform_data = &cmt2_platform_data,
},
.resource = cmt2_resources,
.num_resources = ARRAY_SIZE(cmt2_resources),
};
static struct sh_timer_config cmt3_platform_data = {
.channel_offset = 0x40,
.timer_bit = 3,
};
static struct resource cmt3_resources[] = {
[0] = {
.start = 0x044a0040,
.end = 0x044a004b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = evt2irq(0xf00),
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device cmt3_device = {
.name = "sh_cmt",
.id = 3,
.dev = {
.platform_data = &cmt3_platform_data,
},
.resource = cmt3_resources,
.num_resources = ARRAY_SIZE(cmt3_resources),
};
static struct sh_timer_config cmt4_platform_data = {
.channel_offset = 0x50,
.timer_bit = 4,
};
static struct resource cmt4_resources[] = {
[0] = {
.start = 0x044a0050,
.end = 0x044a005b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = evt2irq(0xf00),
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device cmt4_device = {
.name = "sh_cmt",
.id = 4,
.dev = {
.platform_data = &cmt4_platform_data,
}, },
.resource = cmt4_resources, .resource = cmt_resources,
.num_resources = ARRAY_SIZE(cmt4_resources), .num_resources = ARRAY_SIZE(cmt_resources),
}; };
static struct sh_timer_config tmu0_platform_data = { static struct sh_timer_config tmu0_platform_data = {
...@@ -375,11 +257,7 @@ static struct platform_device tmu2_device = { ...@@ -375,11 +257,7 @@ static struct platform_device tmu2_device = {
static struct platform_device *sh7720_devices[] __initdata = { static struct platform_device *sh7720_devices[] __initdata = {
&scif0_device, &scif0_device,
&scif1_device, &scif1_device,
&cmt0_device, &cmt_device,
&cmt1_device,
&cmt2_device,
&cmt3_device,
&cmt4_device,
&tmu0_device, &tmu0_device,
&tmu1_device, &tmu1_device,
&tmu2_device, &tmu2_device,
...@@ -398,11 +276,7 @@ arch_initcall(sh7720_devices_setup); ...@@ -398,11 +276,7 @@ arch_initcall(sh7720_devices_setup);
static struct platform_device *sh7720_early_devices[] __initdata = { static struct platform_device *sh7720_early_devices[] __initdata = {
&scif0_device, &scif0_device,
&scif1_device, &scif1_device,
&cmt0_device, &cmt_device,
&cmt1_device,
&cmt2_device,
&cmt3_device,
&cmt4_device,
&tmu0_device, &tmu0_device,
&tmu1_device, &tmu1_device,
&tmu2_device, &tmu2_device,
......
...@@ -227,7 +227,7 @@ static struct clk_lookup lookups[] = { ...@@ -227,7 +227,7 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("hudi0", &mstp_clks[MSTP019]), CLKDEV_CON_ID("hudi0", &mstp_clks[MSTP019]),
CLKDEV_CON_ID("ubc0", &mstp_clks[MSTP017]), CLKDEV_CON_ID("ubc0", &mstp_clks[MSTP017]),
CLKDEV_CON_ID("tmu_fck", &mstp_clks[MSTP015]), 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("rwdt0", &mstp_clks[MSTP013]),
CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]), CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]),
CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]), CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]),
......
...@@ -225,7 +225,7 @@ static struct clk_lookup lookups[] = { ...@@ -225,7 +225,7 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("hudi0", &mstp_clks[MSTP019]), CLKDEV_CON_ID("hudi0", &mstp_clks[MSTP019]),
CLKDEV_CON_ID("ubc0", &mstp_clks[MSTP017]), CLKDEV_CON_ID("ubc0", &mstp_clks[MSTP017]),
CLKDEV_CON_ID("tmu_fck", &mstp_clks[MSTP015]), 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("rwdt0", &mstp_clks[MSTP013]),
CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]), CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]),
CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]), CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]),
......
...@@ -207,7 +207,7 @@ static struct clk_lookup lookups[] = { ...@@ -207,7 +207,7 @@ static struct clk_lookup lookups[] = {
CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &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("tmu_fck", "sh_tmu.2", &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_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]), CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]),
......
...@@ -236,7 +236,7 @@ static struct clk_lookup lookups[] = { ...@@ -236,7 +236,7 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]), CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]),
CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]), CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),
CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]), 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-wdt.0", &mstp_clks[HWBLK_RWDT]),
CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]), CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]),
CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]), CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]),
......
...@@ -309,7 +309,7 @@ static struct clk_lookup lookups[] = { ...@@ -309,7 +309,7 @@ static struct clk_lookup lookups[] = {
CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &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.3", &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-wdt.0", &mstp_clks[HWBLK_RWDT]),
CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]), CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]),
......
...@@ -228,26 +228,16 @@ static struct platform_device jpu_device = { ...@@ -228,26 +228,16 @@ static struct platform_device jpu_device = {
}; };
static struct sh_timer_config cmt_platform_data = { static struct sh_timer_config cmt_platform_data = {
.channel_offset = 0x60, .channels_mask = 0x20,
.timer_bit = 5,
.clockevent_rating = 125,
.clocksource_rating = 200,
}; };
static struct resource cmt_resources[] = { static struct resource cmt_resources[] = {
[0] = { DEFINE_RES_MEM(0x044a0000, 0x70),
.start = 0x044a0060, DEFINE_RES_IRQ(evt2irq(0xf00)),
.end = 0x044a006b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = evt2irq(0xf00),
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device cmt_device = { static struct platform_device cmt_device = {
.name = "sh_cmt", .name = "sh-cmt-32",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &cmt_platform_data, .platform_data = &cmt_platform_data,
......
...@@ -176,26 +176,16 @@ static struct platform_device veu1_device = { ...@@ -176,26 +176,16 @@ static struct platform_device veu1_device = {
}; };
static struct sh_timer_config cmt_platform_data = { static struct sh_timer_config cmt_platform_data = {
.channel_offset = 0x60, .channels_mask = 0x20,
.timer_bit = 5,
.clockevent_rating = 125,
.clocksource_rating = 200,
}; };
static struct resource cmt_resources[] = { static struct resource cmt_resources[] = {
[0] = { DEFINE_RES_MEM(0x044a0000, 0x70),
.start = 0x044a0060, DEFINE_RES_IRQ(evt2irq(0xf00)),
.end = 0x044a006b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = evt2irq(0xf00),
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device cmt_device = { static struct platform_device cmt_device = {
.name = "sh_cmt", .name = "sh-cmt-32",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &cmt_platform_data, .platform_data = &cmt_platform_data,
......
...@@ -413,26 +413,16 @@ static struct platform_device jpu_device = { ...@@ -413,26 +413,16 @@ static struct platform_device jpu_device = {
}; };
static struct sh_timer_config cmt_platform_data = { static struct sh_timer_config cmt_platform_data = {
.channel_offset = 0x60, .channels_mask = 0x20,
.timer_bit = 5,
.clockevent_rating = 125,
.clocksource_rating = 125,
}; };
static struct resource cmt_resources[] = { static struct resource cmt_resources[] = {
[0] = { DEFINE_RES_MEM(0x044a0000, 0x70),
.start = 0x044a0060, DEFINE_RES_IRQ(evt2irq(0xf00)),
.end = 0x044a006b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = evt2irq(0xf00),
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device cmt_device = { static struct platform_device cmt_device = {
.name = "sh_cmt", .name = "sh-cmt-32",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &cmt_platform_data, .platform_data = &cmt_platform_data,
......
...@@ -245,26 +245,16 @@ static struct platform_device veu1_device = { ...@@ -245,26 +245,16 @@ static struct platform_device veu1_device = {
}; };
static struct sh_timer_config cmt_platform_data = { static struct sh_timer_config cmt_platform_data = {
.channel_offset = 0x60, .channels_mask = 0x20,
.timer_bit = 5,
.clockevent_rating = 125,
.clocksource_rating = 125,
}; };
static struct resource cmt_resources[] = { static struct resource cmt_resources[] = {
[0] = { DEFINE_RES_MEM(0x044a0000, 0x70),
.start = 0x044a0060, DEFINE_RES_IRQ(evt2irq(0xf00)),
.end = 0x044a006b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = evt2irq(0xf00),
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device cmt_device = { static struct platform_device cmt_device = {
.name = "sh_cmt", .name = "sh-cmt-32",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &cmt_platform_data, .platform_data = &cmt_platform_data,
......
...@@ -648,26 +648,16 @@ static struct platform_device beu1_device = { ...@@ -648,26 +648,16 @@ static struct platform_device beu1_device = {
}; };
static struct sh_timer_config cmt_platform_data = { static struct sh_timer_config cmt_platform_data = {
.channel_offset = 0x60, .channels_mask = 0x20,
.timer_bit = 5,
.clockevent_rating = 125,
.clocksource_rating = 200,
}; };
static struct resource cmt_resources[] = { static struct resource cmt_resources[] = {
[0] = { DEFINE_RES_MEM(0x044a0000, 0x70),
.start = 0x044a0060, DEFINE_RES_IRQ(evt2irq(0xf00)),
.end = 0x044a006b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = evt2irq(0xf00),
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device cmt_device = { static struct platform_device cmt_device = {
.name = "sh_cmt", .name = "sh-cmt-32",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &cmt_platform_data, .platform_data = &cmt_platform_data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment