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

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

Version: ~ [ linux-5.10-rc6 ] ~ [ linux-5.9.12 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.81 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.161 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.210 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.247 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.247 ] ~ [ 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 #include <linux/init.h>
  2 #include <linux/platform_device.h>
  3 #include <linux/mtd/physmap.h>
  4 #include <linux/serial_8250.h>
  5 #include <linux/serial_reg.h>
  6 #include <linux/usb/isp116x.h>
  7 #include <linux/delay.h>
  8 #include <linux/irqdomain.h>
  9 #include <asm/machvec.h>
 10 #include <mach-se/mach/se7343.h>
 11 #include <asm/heartbeat.h>
 12 #include <asm/irq.h>
 13 #include <asm/io.h>
 14 
 15 static struct resource heartbeat_resource = {
 16         .start  = PA_LED,
 17         .end    = PA_LED,
 18         .flags  = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
 19 };
 20 
 21 static struct platform_device heartbeat_device = {
 22         .name           = "heartbeat",
 23         .id             = -1,
 24         .num_resources  = 1,
 25         .resource       = &heartbeat_resource,
 26 };
 27 
 28 static struct mtd_partition nor_flash_partitions[] = {
 29         {
 30                 .name           = "loader",
 31                 .offset         = 0x00000000,
 32                 .size           = 128 * 1024,
 33         },
 34         {
 35                 .name           = "rootfs",
 36                 .offset         = MTDPART_OFS_APPEND,
 37                 .size           = 31 * 1024 * 1024,
 38         },
 39         {
 40                 .name           = "data",
 41                 .offset         = MTDPART_OFS_APPEND,
 42                 .size           = MTDPART_SIZ_FULL,
 43         },
 44 };
 45 
 46 static struct physmap_flash_data nor_flash_data = {
 47         .width          = 2,
 48         .parts          = nor_flash_partitions,
 49         .nr_parts       = ARRAY_SIZE(nor_flash_partitions),
 50 };
 51 
 52 static struct resource nor_flash_resources[] = {
 53         [0]     = {
 54                 .start  = 0x00000000,
 55                 .end    = 0x01ffffff,
 56                 .flags  = IORESOURCE_MEM,
 57         }
 58 };
 59 
 60 static struct platform_device nor_flash_device = {
 61         .name           = "physmap-flash",
 62         .dev            = {
 63                 .platform_data  = &nor_flash_data,
 64         },
 65         .num_resources  = ARRAY_SIZE(nor_flash_resources),
 66         .resource       = nor_flash_resources,
 67 };
 68 
 69 #define ST16C2550C_FLAGS (UPF_BOOT_AUTOCONF | UPF_IOREMAP)
 70 
 71 static struct plat_serial8250_port serial_platform_data[] = {
 72         [0] = {
 73                 .iotype         = UPIO_MEM,
 74                 .mapbase        = 0x16000000,
 75                 .regshift       = 1,
 76                 .flags          = ST16C2550C_FLAGS,
 77                 .uartclk        = 7372800,
 78         },
 79         [1] = {
 80                 .iotype         = UPIO_MEM,
 81                 .mapbase        = 0x17000000,
 82                 .regshift       = 1,
 83                 .flags          = ST16C2550C_FLAGS,
 84                 .uartclk        = 7372800,
 85         },
 86         { },
 87 };
 88 
 89 static struct platform_device uart_device = {
 90         .name                   = "serial8250",
 91         .id                     = PLAT8250_DEV_PLATFORM,
 92         .dev                    = {
 93                 .platform_data  = serial_platform_data,
 94         },
 95 };
 96 
 97 static void isp116x_delay(struct device *dev, int delay)
 98 {
 99         ndelay(delay);
100 }
101 
102 static struct resource usb_resources[] = {
103         [0] = {
104                 .start  = 0x11800000,
105                 .end    = 0x11800001,
106                 .flags  = IORESOURCE_MEM,
107         },
108         [1] = {
109                 .start  = 0x11800002,
110                 .end    = 0x11800003,
111                 .flags  = IORESOURCE_MEM,
112         },
113         [2] = {
114                 /* Filled in later */
115                 .flags  = IORESOURCE_IRQ,
116         },
117 };
118 
119 static struct isp116x_platform_data usb_platform_data = {
120         .sel15Kres              = 1,
121         .oc_enable              = 1,
122         .int_act_high           = 0,
123         .int_edge_triggered     = 0,
124         .remote_wakeup_enable   = 0,
125         .delay                  = isp116x_delay,
126 };
127 
128 static struct platform_device usb_device = {
129         .name                   = "isp116x-hcd",
130         .id                     = -1,
131         .num_resources          = ARRAY_SIZE(usb_resources),
132         .resource               = usb_resources,
133         .dev                    = {
134                 .platform_data  = &usb_platform_data,
135         },
136 
137 };
138 
139 static struct platform_device *sh7343se_platform_devices[] __initdata = {
140         &heartbeat_device,
141         &nor_flash_device,
142         &uart_device,
143         &usb_device,
144 };
145 
146 static int __init sh7343se_devices_setup(void)
147 {
148         /* Wire-up dynamic vectors */
149         serial_platform_data[0].irq = irq_find_mapping(se7343_irq_domain,
150                                                        SE7343_FPGA_IRQ_UARTA);
151         serial_platform_data[1].irq = irq_find_mapping(se7343_irq_domain,
152                                                        SE7343_FPGA_IRQ_UARTB);
153         usb_resources[2].start = usb_resources[2].end =
154                 irq_find_mapping(se7343_irq_domain, SE7343_FPGA_IRQ_USB);
155 
156         return platform_add_devices(sh7343se_platform_devices,
157                                     ARRAY_SIZE(sh7343se_platform_devices));
158 }
159 device_initcall(sh7343se_devices_setup);
160 
161 /*
162  * Initialize the board
163  */
164 static void __init sh7343se_setup(char **cmdline_p)
165 {
166         __raw_writew(0xf900, FPGA_OUT); /* FPGA */
167 
168         __raw_writew(0x0002, PORT_PECR);        /* PORT E 1 = IRQ5 */
169         __raw_writew(0x0020, PORT_PSELD);
170 
171         printk(KERN_INFO "MS7343CP01 Setup...done\n");
172 }
173 
174 /*
175  * The Machine Vector
176  */
177 static struct sh_machine_vector mv_7343se __initmv = {
178         .mv_name = "SolutionEngine 7343",
179         .mv_setup = sh7343se_setup,
180         .mv_init_irq = init_7343se_IRQ,
181 };
182 

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