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

TOMOYO Linux Cross Reference
Linux/arch/sh/boards/mach-sh03/setup.c

Version: ~ [ linux-5.8-rc4 ] ~ [ linux-5.7.7 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.50 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.131 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.187 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.229 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.229 ] ~ [ 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  * linux/arch/sh/boards/sh03/setup.c
  3  *
  4  * Copyright (C) 2004  Interface Co.,Ltd. Saito.K
  5  *
  6  */
  7 
  8 #include <linux/init.h>
  9 #include <linux/irq.h>
 10 #include <linux/pci.h>
 11 #include <linux/platform_device.h>
 12 #include <linux/ata_platform.h>
 13 #include <asm/io.h>
 14 #include <asm/rtc.h>
 15 #include <mach-sh03/mach/io.h>
 16 #include <mach-sh03/mach/sh03.h>
 17 #include <asm/addrspace.h>
 18 
 19 static void __init init_sh03_IRQ(void)
 20 {
 21         plat_irq_setup_pins(IRQ_MODE_IRQ);
 22 }
 23 
 24 /* arch/sh/boards/sh03/rtc.c */
 25 void sh03_time_init(void);
 26 
 27 static void __init sh03_setup(char **cmdline_p)
 28 {
 29         board_time_init = sh03_time_init;
 30 }
 31 
 32 static struct resource cf_ide_resources[] = {
 33         [0] = {
 34                 .start  = 0x1f0,
 35                 .end    = 0x1f0 + 8,
 36                 .flags  = IORESOURCE_IO,
 37         },
 38         [1] = {
 39                 .start  = 0x1f0 + 0x206,
 40                 .end    = 0x1f0 +8 + 0x206 + 8,
 41                 .flags  = IORESOURCE_IO,
 42         },
 43         [2] = {
 44                 .start  = IRL2_IRQ,
 45                 .flags  = IORESOURCE_IRQ,
 46         },
 47 };
 48 
 49 static struct platform_device cf_ide_device = {
 50         .name           = "pata_platform",
 51         .id             = -1,
 52         .num_resources  = ARRAY_SIZE(cf_ide_resources),
 53         .resource       = cf_ide_resources,
 54 };
 55 
 56 static struct resource heartbeat_resources[] = {
 57         [0] = {
 58                 .start  = 0xa0800000,
 59                 .end    = 0xa0800000,
 60                 .flags  = IORESOURCE_MEM,
 61         },
 62 };
 63 
 64 static struct platform_device heartbeat_device = {
 65         .name           = "heartbeat",
 66         .id             = -1,
 67         .num_resources  = ARRAY_SIZE(heartbeat_resources),
 68         .resource       = heartbeat_resources,
 69 };
 70 
 71 static struct platform_device *sh03_devices[] __initdata = {
 72         &heartbeat_device,
 73         &cf_ide_device,
 74 };
 75 
 76 static int __init sh03_devices_setup(void)
 77 {
 78         pgprot_t prot;
 79         unsigned long paddrbase;
 80         void *cf_ide_base;
 81 
 82         /* open I/O area window */
 83         paddrbase = virt_to_phys((void *)PA_AREA5_IO);
 84         prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
 85         cf_ide_base = ioremap_prot(paddrbase, PAGE_SIZE, pgprot_val(prot));
 86         if (!cf_ide_base) {
 87                 printk("allocate_cf_area : can't open CF I/O window!\n");
 88                 return -ENOMEM;
 89         }
 90 
 91         /* IDE cmd address : 0x1f0-0x1f7 and 0x3f6 */
 92         cf_ide_resources[0].start += (unsigned long)cf_ide_base;
 93         cf_ide_resources[0].end   += (unsigned long)cf_ide_base;
 94         cf_ide_resources[1].start += (unsigned long)cf_ide_base;
 95         cf_ide_resources[1].end   += (unsigned long)cf_ide_base;
 96 
 97         return platform_add_devices(sh03_devices, ARRAY_SIZE(sh03_devices));
 98 }
 99 device_initcall(sh03_devices_setup);
100 
101 static struct sh_machine_vector mv_sh03 __initmv = {
102         .mv_name                = "Interface (CTP/PCI-SH03)",
103         .mv_setup               = sh03_setup,
104         .mv_init_irq            = init_sh03_IRQ,
105 };
106 

~ [ 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