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

TOMOYO Linux Cross Reference
Linux/arch/sh/boards/board-sh2007.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 /*
  3  * SH-2007 board support.
  4  *
  5  * Copyright (C) 2003, 2004  SUGIOKA Toshinobu
  6  * Copyright (C) 2010  Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
  7  */
  8 #include <linux/init.h>
  9 #include <linux/irq.h>
 10 #include <linux/regulator/fixed.h>
 11 #include <linux/regulator/machine.h>
 12 #include <linux/smsc911x.h>
 13 #include <linux/platform_device.h>
 14 #include <linux/ata_platform.h>
 15 #include <linux/io.h>
 16 #include <asm/machvec.h>
 17 #include <mach/sh2007.h>
 18 
 19 /* Dummy supplies, where voltage doesn't matter */
 20 static struct regulator_consumer_supply dummy_supplies[] = {
 21         REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
 22         REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
 23         REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
 24         REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
 25 };
 26 
 27 struct smsc911x_platform_config smc911x_info = {
 28         .flags          = SMSC911X_USE_32BIT,
 29         .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
 30         .irq_type       = SMSC911X_IRQ_TYPE_PUSH_PULL,
 31 };
 32 
 33 static struct resource smsc9118_0_resources[] = {
 34         [0] = {
 35                 .start  = SMC0_BASE,
 36                 .end    = SMC0_BASE + 0xff,
 37                 .flags  = IORESOURCE_MEM,
 38         },
 39         [1] = {
 40                 .start  = evt2irq(0x240),
 41                 .end    = evt2irq(0x240),
 42                 .flags  = IORESOURCE_IRQ,
 43         }
 44 };
 45 
 46 static struct resource smsc9118_1_resources[] = {
 47         [0] = {
 48                 .start  = SMC1_BASE,
 49                 .end    = SMC1_BASE + 0xff,
 50                 .flags  = IORESOURCE_MEM,
 51         },
 52         [1] = {
 53                 .start  = evt2irq(0x280),
 54                 .end    = evt2irq(0x280),
 55                 .flags  = IORESOURCE_IRQ,
 56         }
 57 };
 58 
 59 static struct platform_device smsc9118_0_device = {
 60         .name           = "smsc911x",
 61         .id             = 0,
 62         .num_resources  = ARRAY_SIZE(smsc9118_0_resources),
 63         .resource       = smsc9118_0_resources,
 64         .dev = {
 65                 .platform_data = &smc911x_info,
 66         },
 67 };
 68 
 69 static struct platform_device smsc9118_1_device = {
 70         .name           = "smsc911x",
 71         .id             = 1,
 72         .num_resources  = ARRAY_SIZE(smsc9118_1_resources),
 73         .resource       = smsc9118_1_resources,
 74         .dev = {
 75                 .platform_data = &smc911x_info,
 76         },
 77 };
 78 
 79 static struct resource cf_resources[] = {
 80         [0] = {
 81                 .start  = CF_BASE + CF_OFFSET,
 82                 .end    = CF_BASE + CF_OFFSET + 0x0f,
 83                 .flags  = IORESOURCE_MEM,
 84         },
 85         [1] = {
 86                 .start  = CF_BASE + CF_OFFSET + 0x206,
 87                 .end    = CF_BASE + CF_OFFSET + 0x20f,
 88                 .flags  = IORESOURCE_MEM,
 89         },
 90         [2] = {
 91                 .start  = evt2irq(0x2c0),
 92                 .end    = evt2irq(0x2c0),
 93                 .flags  = IORESOURCE_IRQ,
 94         },
 95 };
 96 
 97 static struct platform_device cf_device  = {
 98         .name           = "pata_platform",
 99         .id             = 0,
100         .num_resources  = ARRAY_SIZE(cf_resources),
101         .resource       = cf_resources,
102 };
103 
104 static struct platform_device *sh2007_devices[] __initdata = {
105         &smsc9118_0_device,
106         &smsc9118_1_device,
107         &cf_device,
108 };
109 
110 static int __init sh2007_io_init(void)
111 {
112         regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
113 
114         platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices));
115         return 0;
116 }
117 subsys_initcall(sh2007_io_init);
118 
119 static void __init sh2007_init_irq(void)
120 {
121         plat_irq_setup_pins(IRQ_MODE_IRQ);
122 }
123 
124 /*
125  * Initialize the board
126  */
127 static void __init sh2007_setup(char **cmdline_p)
128 {
129         pr_info("SH-2007 Setup...");
130 
131         /* setup wait control registers for area 5 */
132         __raw_writel(CS5BCR_D, CS5BCR);
133         __raw_writel(CS5WCR_D, CS5WCR);
134         __raw_writel(CS5PCR_D, CS5PCR);
135 
136         pr_cont(" done.\n");
137 }
138 
139 /*
140  * The Machine Vector
141  */
142 struct sh_machine_vector mv_sh2007 __initmv = {
143         .mv_setup               = sh2007_setup,
144         .mv_name                = "sh2007",
145         .mv_init_irq            = sh2007_init_irq,
146 };
147 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php