ARM: dma-api: fix max_pfn off-by-one error in __dma_supported()
[linux/fpc-iii.git] / arch / sh / kernel / cpu / sh5 / setup-sh5.c
blobdc8476d67244069e8b6088b4bdf95a41ff96a2c8
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * SH5-101/SH5-103 CPU Setup
5 * Copyright (C) 2009 Paul Mundt
6 */
7 #include <linux/platform_device.h>
8 #include <linux/init.h>
9 #include <linux/serial.h>
10 #include <linux/serial_sci.h>
11 #include <linux/io.h>
12 #include <linux/mm.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 = {
18 .flags = UPF_IOREMAP,
19 .scscr = SCSCR_REIE,
20 .type = PORT_SCIF,
23 static struct resource scif0_resources[] = {
24 DEFINE_RES_MEM(PHYS_PERIPHERAL_BLOCK + 0x01030000, 0x100),
25 DEFINE_RES_IRQ(39),
26 DEFINE_RES_IRQ(40),
27 DEFINE_RES_IRQ(42),
30 static struct platform_device scif0_device = {
31 .name = "sh-sci",
32 .id = 0,
33 .resource = scif0_resources,
34 .num_resources = ARRAY_SIZE(scif0_resources),
35 .dev = {
36 .platform_data = &scif0_platform_data,
40 static struct resource rtc_resources[] = {
41 [0] = {
42 .start = PHYS_PERIPHERAL_BLOCK + 0x01040000,
43 .end = PHYS_PERIPHERAL_BLOCK + 0x01040000 + 0x58 - 1,
44 .flags = IORESOURCE_IO,
46 [1] = {
47 /* Period IRQ */
48 .start = IRQ_PRI,
49 .flags = IORESOURCE_IRQ,
51 [2] = {
52 /* Carry IRQ */
53 .start = IRQ_CUI,
54 .flags = IORESOURCE_IRQ,
56 [3] = {
57 /* Alarm IRQ */
58 .start = IRQ_ATI,
59 .flags = IORESOURCE_IRQ,
63 static struct platform_device rtc_device = {
64 .name = "sh-rtc",
65 .id = -1,
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 = {
74 .channels_mask = 7,
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 = {
85 .name = "sh-tmu",
86 .id = 0,
87 .dev = {
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 = {
95 &scif0_device,
96 &tmu0_device,
99 static struct platform_device *sh5_devices[] __initdata = {
100 &rtc_device,
103 static int __init sh5_devices_setup(void)
105 int ret;
107 ret = platform_add_devices(sh5_early_devices,
108 ARRAY_SIZE(sh5_early_devices));
109 if (unlikely(ret != 0))
110 return ret;
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));