Skip to content

Commit

Permalink
sh: CMT platform data for sh7723/sh7722/sh7366/sh7343
Browse files Browse the repository at this point in the history
CMT platform data for SuperH Mobile sh7723/sh7722/sh7343/sh7366.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Jan 29, 2009
1 parent 3fb1b6a commit 424f59d
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 0 deletions.
34 changes: 34 additions & 0 deletions arch/sh/kernel/cpu/sh4a/setup-sh7343.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/serial.h>
#include <linux/serial_sci.h>
#include <linux/uio_driver.h>
#include <linux/sh_cmt.h>
#include <asm/clock.h>

static struct resource iic0_resources[] = {
Expand Down Expand Up @@ -140,6 +141,38 @@ static struct platform_device jpu_device = {
.num_resources = ARRAY_SIZE(jpu_resources),
};

static struct sh_cmt_config cmt_platform_data = {
.name = "CMT",
.channel_offset = 0x60,
.timer_bit = 5,
.clk = "cmt0",
.clockevent_rating = 125,
.clocksource_rating = 200,
};

static struct resource cmt_resources[] = {
[0] = {
.name = "CMT",
.start = 0x044a0060,
.end = 0x044a006b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 104,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device cmt_device = {
.name = "sh_cmt",
.id = 0,
.dev = {
.platform_data = &cmt_platform_data,
},
.resource = cmt_resources,
.num_resources = ARRAY_SIZE(cmt_resources),
};

static struct plat_sci_port sci_platform_data[] = {
{
.mapbase = 0xffe00000,
Expand Down Expand Up @@ -175,6 +208,7 @@ static struct platform_device sci_device = {
};

static struct platform_device *sh7343_devices[] __initdata = {
&cmt_device,
&iic0_device,
&iic1_device,
&sci_device,
Expand Down
34 changes: 34 additions & 0 deletions arch/sh/kernel/cpu/sh4a/setup-sh7366.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/serial.h>
#include <linux/serial_sci.h>
#include <linux/uio_driver.h>
#include <linux/sh_cmt.h>
#include <asm/clock.h>

static struct resource iic_resources[] = {
Expand Down Expand Up @@ -147,6 +148,38 @@ static struct platform_device veu1_device = {
.num_resources = ARRAY_SIZE(veu1_resources),
};

static struct sh_cmt_config cmt_platform_data = {
.name = "CMT",
.channel_offset = 0x60,
.timer_bit = 5,
.clk = "cmt0",
.clockevent_rating = 125,
.clocksource_rating = 200,
};

static struct resource cmt_resources[] = {
[0] = {
.name = "CMT",
.start = 0x044a0060,
.end = 0x044a006b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 104,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device cmt_device = {
.name = "sh_cmt",
.id = 0,
.dev = {
.platform_data = &cmt_platform_data,
},
.resource = cmt_resources,
.num_resources = ARRAY_SIZE(cmt_resources),
};

static struct plat_sci_port sci_platform_data[] = {
{
.mapbase = 0xffe00000,
Expand All @@ -167,6 +200,7 @@ static struct platform_device sci_device = {
};

static struct platform_device *sh7366_devices[] __initdata = {
&cmt_device,
&iic_device,
&sci_device,
&usb_host_device,
Expand Down
34 changes: 34 additions & 0 deletions arch/sh/kernel/cpu/sh4a/setup-sh7722.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/serial_sci.h>
#include <linux/mm.h>
#include <linux/uio_driver.h>
#include <linux/sh_cmt.h>
#include <asm/clock.h>
#include <asm/mmzone.h>

Expand Down Expand Up @@ -176,6 +177,38 @@ static struct platform_device jpu_device = {
.num_resources = ARRAY_SIZE(jpu_resources),
};

static struct sh_cmt_config cmt_platform_data = {
.name = "CMT",
.channel_offset = 0x60,
.timer_bit = 5,
.clk = "cmt0",
.clockevent_rating = 125,
.clocksource_rating = 200,
};

static struct resource cmt_resources[] = {
[0] = {
.name = "CMT",
.start = 0x044a0060,
.end = 0x044a006b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 104,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device cmt_device = {
.name = "sh_cmt",
.id = 0,
.dev = {
.platform_data = &cmt_platform_data,
},
.resource = cmt_resources,
.num_resources = ARRAY_SIZE(cmt_resources),
};

static struct plat_sci_port sci_platform_data[] = {
{
.mapbase = 0xffe00000,
Expand Down Expand Up @@ -209,6 +242,7 @@ static struct platform_device sci_device = {
};

static struct platform_device *sh7722_devices[] __initdata = {
&cmt_device,
&rtc_device,
&usbf_device,
&iic_device,
Expand Down
34 changes: 34 additions & 0 deletions arch/sh/kernel/cpu/sh4a/setup-sh7723.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/mm.h>
#include <linux/serial_sci.h>
#include <linux/uio_driver.h>
#include <linux/sh_cmt.h>
#include <asm/clock.h>
#include <asm/mmzone.h>

Expand Down Expand Up @@ -100,6 +101,38 @@ static struct platform_device veu1_device = {
.num_resources = ARRAY_SIZE(veu1_resources),
};

static struct sh_cmt_config cmt_platform_data = {
.name = "CMT",
.channel_offset = 0x60,
.timer_bit = 5,
.clk = "cmt0",
.clockevent_rating = 125,
.clocksource_rating = 200,
};

static struct resource cmt_resources[] = {
[0] = {
.name = "CMT",
.start = 0x044a0060,
.end = 0x044a006b,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 104,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device cmt_device = {
.name = "sh_cmt",
.id = 0,
.dev = {
.platform_data = &cmt_platform_data,
},
.resource = cmt_resources,
.num_resources = ARRAY_SIZE(cmt_resources),
};

static struct plat_sci_port sci_platform_data[] = {
{
.mapbase = 0xffe00000,
Expand Down Expand Up @@ -221,6 +254,7 @@ static struct platform_device iic_device = {
};

static struct platform_device *sh7723_devices[] __initdata = {
&cmt_device,
&sci_device,
&rtc_device,
&iic_device,
Expand Down

0 comments on commit 424f59d

Please sign in to comment.