Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146691
b: refs/heads/master
c: 698aa99
h: refs/heads/master
i:
  146689: f41039f
  146687: d910d3f
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Apr 30, 2009
1 parent e2442f2 commit 2613459
Show file tree
Hide file tree
Showing 4 changed files with 253 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3014f47460ecfb13d4169daae51f26a20bacfa17
refs/heads/master: 698aa99da5f5e2b4c666fd21ab77306f0225b8f5
84 changes: 84 additions & 0 deletions trunk/arch/sh/kernel/cpu/sh2/setup-sh7619.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include <linux/init.h>
#include <linux/serial.h>
#include <linux/serial_sci.h>
#include <linux/sh_cmt.h>
#include <linux/io.h>

enum {
UNUSED = 0,
Expand Down Expand Up @@ -109,9 +111,75 @@ static struct platform_device eth_device = {
.resource = eth_resources,
};

static struct sh_cmt_config cmt0_platform_data = {
.name = "CMT0",
.channel_offset = 0x02,
.timer_bit = 0,
.clk = "module_clk",
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
};

static struct resource cmt0_resources[] = {
[0] = {
.name = "CMT0",
.start = 0xf84a0072,
.end = 0xf84a0077,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 86,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device cmt0_device = {
.name = "sh_cmt",
.id = 0,
.dev = {
.platform_data = &cmt0_platform_data,
},
.resource = cmt0_resources,
.num_resources = ARRAY_SIZE(cmt0_resources),
};

static struct sh_cmt_config cmt1_platform_data = {
.name = "CMT1",
.channel_offset = 0x08,
.timer_bit = 1,
.clk = "module_clk",
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
};

static struct resource cmt1_resources[] = {
[0] = {
.name = "CMT1",
.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,
.num_resources = ARRAY_SIZE(cmt1_resources),
};

static struct platform_device *sh7619_devices[] __initdata = {
&sci_device,
&eth_device,
&cmt0_device,
&cmt1_device,
};

static int __init sh7619_devices_setup(void)
Expand All @@ -125,3 +193,19 @@ void __init plat_irq_setup(void)
{
register_intc_controller(&intc_desc);
}

static struct platform_device *sh7619_early_devices[] __initdata = {
&cmt0_device,
&cmt1_device,
};

#define STBCR3 0xf80a0000

void __init plat_early_device_setup(void)
{
/* enable CMT clock */
__raw_writeb(__raw_readb(STBCR3) & ~0x10, STBCR3);

early_platform_add_devices(sh7619_early_devices,
ARRAY_SIZE(sh7619_early_devices));
}
84 changes: 84 additions & 0 deletions trunk/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <linux/init.h>
#include <linux/serial.h>
#include <linux/serial_sci.h>
#include <linux/sh_cmt.h>
#include <linux/io.h>

enum {
UNUSED = 0,
Expand Down Expand Up @@ -205,6 +207,70 @@ static struct platform_device sci_device = {
},
};

static struct sh_cmt_config cmt0_platform_data = {
.name = "CMT0",
.channel_offset = 0x02,
.timer_bit = 0,
.clk = "module_clk",
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
};

static struct resource cmt0_resources[] = {
[0] = {
.name = "CMT0",
.start = 0xfffec002,
.end = 0xfffec007,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 142,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device cmt0_device = {
.name = "sh_cmt",
.id = 0,
.dev = {
.platform_data = &cmt0_platform_data,
},
.resource = cmt0_resources,
.num_resources = ARRAY_SIZE(cmt0_resources),
};

static struct sh_cmt_config cmt1_platform_data = {
.name = "CMT1",
.channel_offset = 0x08,
.timer_bit = 1,
.clk = "module_clk",
.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 = 143,
.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 resource rtc_resources[] = {
[0] = {
.start = 0xffff2000,
Expand All @@ -227,6 +293,8 @@ static struct platform_device rtc_device = {

static struct platform_device *sh7203_devices[] __initdata = {
&sci_device,
&cmt0_device,
&cmt1_device,
&rtc_device,
};

Expand All @@ -241,3 +309,19 @@ void __init plat_irq_setup(void)
{
register_intc_controller(&intc_desc);
}

static struct platform_device *sh7203_early_devices[] __initdata = {
&cmt0_device,
&cmt1_device,
};

#define STBCR4 0xfffe040c

void __init plat_early_device_setup(void)
{
/* enable CMT clock */
__raw_writeb(__raw_readb(STBCR4) & ~0x04, STBCR4);

early_platform_add_devices(sh7203_early_devices,
ARRAY_SIZE(sh7203_early_devices));
}
84 changes: 84 additions & 0 deletions trunk/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include <linux/init.h>
#include <linux/serial.h>
#include <linux/serial_sci.h>
#include <linux/sh_cmt.h>
#include <linux/io.h>

enum {
UNUSED = 0,
Expand Down Expand Up @@ -165,8 +167,74 @@ static struct platform_device sci_device = {
},
};

static struct sh_cmt_config cmt0_platform_data = {
.name = "CMT0",
.channel_offset = 0x02,
.timer_bit = 0,
.clk = "module_clk",
.clockevent_rating = 125,
.clocksource_rating = 0, /* disabled due to code generation issues */
};

static struct resource cmt0_resources[] = {
[0] = {
.name = "CMT0",
.start = 0xfffec002,
.end = 0xfffec007,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 140,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device cmt0_device = {
.name = "sh_cmt",
.id = 0,
.dev = {
.platform_data = &cmt0_platform_data,
},
.resource = cmt0_resources,
.num_resources = ARRAY_SIZE(cmt0_resources),
};

static struct sh_cmt_config cmt1_platform_data = {
.name = "CMT1",
.channel_offset = 0x08,
.timer_bit = 1,
.clk = "module_clk",
.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 = 144,
.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 platform_device *sh7206_devices[] __initdata = {
&sci_device,
&cmt0_device,
&cmt1_device,
};

static int __init sh7206_devices_setup(void)
Expand All @@ -180,3 +248,19 @@ void __init plat_irq_setup(void)
{
register_intc_controller(&intc_desc);
}

static struct platform_device *sh7206_early_devices[] __initdata = {
&cmt0_device,
&cmt1_device,
};

#define STBCR4 0xfffe040c

void __init plat_early_device_setup(void)
{
/* enable CMT clock */
__raw_writeb(__raw_readb(STBCR4) & ~0x04, STBCR4);

early_platform_add_devices(sh7206_early_devices,
ARRAY_SIZE(sh7206_early_devices));
}

0 comments on commit 2613459

Please sign in to comment.