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>
15 #include <asm/platform_early.h>
17 static struct plat_sci_port scif0_platform_data
= {
23 static struct resource scif0_resources
[] = {
24 DEFINE_RES_MEM(PHYS_PERIPHERAL_BLOCK
+ 0x01030000, 0x100),
30 static struct platform_device scif0_device
= {
33 .resource
= scif0_resources
,
34 .num_resources
= ARRAY_SIZE(scif0_resources
),
36 .platform_data
= &scif0_platform_data
,
40 static struct resource rtc_resources
[] = {
42 .start
= PHYS_PERIPHERAL_BLOCK
+ 0x01040000,
43 .end
= PHYS_PERIPHERAL_BLOCK
+ 0x01040000 + 0x58 - 1,
44 .flags
= IORESOURCE_IO
,
49 .flags
= IORESOURCE_IRQ
,
54 .flags
= IORESOURCE_IRQ
,
59 .flags
= IORESOURCE_IRQ
,
63 static struct platform_device rtc_device
= {
66 .num_resources
= ARRAY_SIZE(rtc_resources
),
67 .resource
= rtc_resources
,
70 #define TMU_BLOCK_OFF 0x01020000
71 #define TMU_BASE PHYS_PERIPHERAL_BLOCK + TMU_BLOCK_OFF
73 static struct sh_timer_config tmu0_platform_data
= {
77 static struct resource tmu0_resources
[] = {
78 DEFINE_RES_MEM(TMU_BASE
, 0x30),
79 DEFINE_RES_IRQ(IRQ_TUNI0
),
80 DEFINE_RES_IRQ(IRQ_TUNI1
),
81 DEFINE_RES_IRQ(IRQ_TUNI2
),
84 static struct platform_device tmu0_device
= {
88 .platform_data
= &tmu0_platform_data
,
90 .resource
= tmu0_resources
,
91 .num_resources
= ARRAY_SIZE(tmu0_resources
),
94 static struct platform_device
*sh5_early_devices
[] __initdata
= {
99 static struct platform_device
*sh5_devices
[] __initdata
= {
103 static int __init
sh5_devices_setup(void)
107 ret
= platform_add_devices(sh5_early_devices
,
108 ARRAY_SIZE(sh5_early_devices
));
109 if (unlikely(ret
!= 0))
112 return platform_add_devices(sh5_devices
,
113 ARRAY_SIZE(sh5_devices
));
115 arch_initcall(sh5_devices_setup
);
117 void __init
plat_early_device_setup(void)
119 sh_early_platform_add_devices(sh5_early_devices
,
120 ARRAY_SIZE(sh5_early_devices
));