1 // SPDX-License-Identifier: GPL-2.0
3 * SH5-101/SH5-103 CPU Setup
5 * Copyright (C) 2009 Paul Mundt
7 #include <linux/platform_device.h>
8 #include <linux/init.h>
9 #include <linux/serial.h>
10 #include <linux/serial_sci.h>
13 #include <linux/sh_timer.h>
14 #include <asm/addrspace.h>
16 static struct plat_sci_port scif0_platform_data = {
22 static struct resource scif0_resources[] = {
23 DEFINE_RES_MEM(PHYS_PERIPHERAL_BLOCK + 0x01030000, 0x100),
29 static struct platform_device scif0_device = {
32 .resource = scif0_resources,
33 .num_resources = ARRAY_SIZE(scif0_resources),
35 .platform_data = &scif0_platform_data,
39 static struct resource rtc_resources[] = {
41 .start = PHYS_PERIPHERAL_BLOCK + 0x01040000,
42 .end = PHYS_PERIPHERAL_BLOCK + 0x01040000 + 0x58 - 1,
43 .flags = IORESOURCE_IO,
48 .flags = IORESOURCE_IRQ,
53 .flags = IORESOURCE_IRQ,
58 .flags = IORESOURCE_IRQ,
62 static struct platform_device rtc_device = {
65 .num_resources = ARRAY_SIZE(rtc_resources),
66 .resource = rtc_resources,
69 #define TMU_BLOCK_OFF 0x01020000
70 #define TMU_BASE PHYS_PERIPHERAL_BLOCK + TMU_BLOCK_OFF
72 static struct sh_timer_config tmu0_platform_data = {
76 static struct resource tmu0_resources[] = {
77 DEFINE_RES_MEM(TMU_BASE, 0x30),
78 DEFINE_RES_IRQ(IRQ_TUNI0),
79 DEFINE_RES_IRQ(IRQ_TUNI1),
80 DEFINE_RES_IRQ(IRQ_TUNI2),
83 static struct platform_device tmu0_device = {
87 .platform_data = &tmu0_platform_data,
89 .resource = tmu0_resources,
90 .num_resources = ARRAY_SIZE(tmu0_resources),
93 static struct platform_device *sh5_early_devices[] __initdata = {
98 static struct platform_device *sh5_devices[] __initdata = {
102 static int __init sh5_devices_setup(void)
106 ret = platform_add_devices(sh5_early_devices,
107 ARRAY_SIZE(sh5_early_devices));
108 if (unlikely(ret != 0))
111 return platform_add_devices(sh5_devices,
112 ARRAY_SIZE(sh5_devices));
114 arch_initcall(sh5_devices_setup);
116 void __init plat_early_device_setup(void)
118 early_platform_add_devices(sh5_early_devices,
119 ARRAY_SIZE(sh5_early_devices));