2 * SH5-101/SH5-103 CPU Setup
4 * Copyright (C) 2009 Paul Mundt
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
10 #include <linux/platform_device.h>
11 #include <linux/init.h>
12 #include <linux/serial.h>
13 #include <linux/serial_sci.h>
16 #include <linux/sh_timer.h>
17 #include <asm/addrspace.h>
19 static struct plat_sci_port scif0_platform_data = {
25 static struct resource scif0_resources[] = {
26 DEFINE_RES_MEM(PHYS_PERIPHERAL_BLOCK + 0x01030000, 0x100),
32 static struct platform_device scif0_device = {
35 .resource = scif0_resources,
36 .num_resources = ARRAY_SIZE(scif0_resources),
38 .platform_data = &scif0_platform_data,
42 static struct resource rtc_resources[] = {
44 .start = PHYS_PERIPHERAL_BLOCK + 0x01040000,
45 .end = PHYS_PERIPHERAL_BLOCK + 0x01040000 + 0x58 - 1,
46 .flags = IORESOURCE_IO,
51 .flags = IORESOURCE_IRQ,
56 .flags = IORESOURCE_IRQ,
61 .flags = IORESOURCE_IRQ,
65 static struct platform_device rtc_device = {
68 .num_resources = ARRAY_SIZE(rtc_resources),
69 .resource = rtc_resources,
72 #define TMU_BLOCK_OFF 0x01020000
73 #define TMU_BASE PHYS_PERIPHERAL_BLOCK + TMU_BLOCK_OFF
75 static struct sh_timer_config tmu0_platform_data = {
79 static struct resource tmu0_resources[] = {
80 DEFINE_RES_MEM(TMU_BASE, 0x30),
81 DEFINE_RES_IRQ(IRQ_TUNI0),
82 DEFINE_RES_IRQ(IRQ_TUNI1),
83 DEFINE_RES_IRQ(IRQ_TUNI2),
86 static struct platform_device tmu0_device = {
90 .platform_data = &tmu0_platform_data,
92 .resource = tmu0_resources,
93 .num_resources = ARRAY_SIZE(tmu0_resources),
96 static struct platform_device *sh5_early_devices[] __initdata = {
101 static struct platform_device *sh5_devices[] __initdata = {
105 static int __init sh5_devices_setup(void)
109 ret = platform_add_devices(sh5_early_devices,
110 ARRAY_SIZE(sh5_early_devices));
111 if (unlikely(ret != 0))
114 return platform_add_devices(sh5_devices,
115 ARRAY_SIZE(sh5_devices));
117 arch_initcall(sh5_devices_setup);
119 void __init plat_early_device_setup(void)
121 early_platform_add_devices(sh5_early_devices,
122 ARRAY_SIZE(sh5_early_devices));