~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sh/kernel/cpu/sh5/setup-sh5.c

Version: ~ [ linux-5.10-rc5 ] ~ [ linux-5.9.10 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.79 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.159 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.208 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.245 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.245 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * SH5-101/SH5-103 CPU Setup
  3  *
  4  *  Copyright (C) 2009  Paul Mundt
  5  *
  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
  8  * for more details.
  9  */
 10 #include <linux/platform_device.h>
 11 #include <linux/init.h>
 12 #include <linux/serial.h>
 13 #include <linux/serial_sci.h>
 14 #include <linux/io.h>
 15 #include <linux/mm.h>
 16 #include <linux/sh_timer.h>
 17 #include <asm/addrspace.h>
 18 
 19 static struct plat_sci_port scif0_platform_data = {
 20         .flags          = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
 21         .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
 22         .type           = PORT_SCIF,
 23 };
 24 
 25 static struct resource scif0_resources[] = {
 26         DEFINE_RES_MEM(PHYS_PERIPHERAL_BLOCK + 0x01030000, 0x100),
 27         DEFINE_RES_IRQ(39),
 28         DEFINE_RES_IRQ(40),
 29         DEFINE_RES_IRQ(42),
 30 };
 31 
 32 static struct platform_device scif0_device = {
 33         .name           = "sh-sci",
 34         .id             = 0,
 35         .resource       = scif0_resources,
 36         .num_resources  = ARRAY_SIZE(scif0_resources),
 37         .dev            = {
 38                 .platform_data  = &scif0_platform_data,
 39         },
 40 };
 41 
 42 static struct resource rtc_resources[] = {
 43         [0] = {
 44                 .start  = PHYS_PERIPHERAL_BLOCK + 0x01040000,
 45                 .end    = PHYS_PERIPHERAL_BLOCK + 0x01040000 + 0x58 - 1,
 46                 .flags  = IORESOURCE_IO,
 47         },
 48         [1] = {
 49                 /* Period IRQ */
 50                 .start  = IRQ_PRI,
 51                 .flags  = IORESOURCE_IRQ,
 52         },
 53         [2] = {
 54                 /* Carry IRQ */
 55                 .start  = IRQ_CUI,
 56                 .flags  = IORESOURCE_IRQ,
 57         },
 58         [3] = {
 59                 /* Alarm IRQ */
 60                 .start  = IRQ_ATI,
 61                 .flags  = IORESOURCE_IRQ,
 62         },
 63 };
 64 
 65 static struct platform_device rtc_device = {
 66         .name           = "sh-rtc",
 67         .id             = -1,
 68         .num_resources  = ARRAY_SIZE(rtc_resources),
 69         .resource       = rtc_resources,
 70 };
 71 
 72 #define TMU_BLOCK_OFF   0x01020000
 73 #define TMU_BASE        PHYS_PERIPHERAL_BLOCK + TMU_BLOCK_OFF
 74 
 75 static struct sh_timer_config tmu0_platform_data = {
 76         .channels_mask = 7,
 77 };
 78 
 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),
 84 };
 85 
 86 static struct platform_device tmu0_device = {
 87         .name           = "sh-tmu",
 88         .id             = 0,
 89         .dev = {
 90                 .platform_data  = &tmu0_platform_data,
 91         },
 92         .resource       = tmu0_resources,
 93         .num_resources  = ARRAY_SIZE(tmu0_resources),
 94 };
 95 
 96 static struct platform_device *sh5_early_devices[] __initdata = {
 97         &scif0_device,
 98         &tmu0_device,
 99 };
100 
101 static struct platform_device *sh5_devices[] __initdata = {
102         &rtc_device,
103 };
104 
105 static int __init sh5_devices_setup(void)
106 {
107         int ret;
108 
109         ret = platform_add_devices(sh5_early_devices,
110                                    ARRAY_SIZE(sh5_early_devices));
111         if (unlikely(ret != 0))
112                 return ret;
113 
114         return platform_add_devices(sh5_devices,
115                                     ARRAY_SIZE(sh5_devices));
116 }
117 arch_initcall(sh5_devices_setup);
118 
119 void __init plat_early_device_setup(void)
120 {
121         early_platform_add_devices(sh5_early_devices,
122                                    ARRAY_SIZE(sh5_early_devices));
123 }
124 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp