1 /* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 and
5  * only version 2 as published by the Free Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 #include <linux/kernel.h>
19 #include <linux/platform_device.h>
20 
21 #include <linux/dma-mapping.h>
22 #include <mach/irqs-8960.h>
23 #include <mach/board.h>
24 
25 #include "devices.h"
26 
27 #define MSM_GSBI2_PHYS		0x16100000
28 #define MSM_UART2DM_PHYS	(MSM_GSBI2_PHYS + 0x40000)
29 
30 #define MSM_GSBI5_PHYS		0x16400000
31 #define MSM_UART5DM_PHYS	(MSM_GSBI5_PHYS + 0x40000)
32 
33 static struct resource resources_uart_gsbi2[] = {
34 	{
35 		.start	= GSBI2_UARTDM_IRQ,
36 		.end	= GSBI2_UARTDM_IRQ,
37 		.flags	= IORESOURCE_IRQ,
38 	},
39 	{
40 		.start	= MSM_UART2DM_PHYS,
41 		.end	= MSM_UART2DM_PHYS + PAGE_SIZE - 1,
42 		.name	= "uart_resource",
43 		.flags	= IORESOURCE_MEM,
44 	},
45 	{
46 		.start	= MSM_GSBI2_PHYS,
47 		.end	= MSM_GSBI2_PHYS + PAGE_SIZE - 1,
48 		.name	= "gsbi_resource",
49 		.flags	= IORESOURCE_MEM,
50 	},
51 };
52 
53 struct platform_device msm8960_device_uart_gsbi2 = {
54 	.name	= "msm_serial",
55 	.id	= 0,
56 	.num_resources	= ARRAY_SIZE(resources_uart_gsbi2),
57 	.resource	= resources_uart_gsbi2,
58 };
59 
60 static struct resource resources_uart_gsbi5[] = {
61 	{
62 		.start	= GSBI5_UARTDM_IRQ,
63 		.end	= GSBI5_UARTDM_IRQ,
64 		.flags	= IORESOURCE_IRQ,
65 	},
66 	{
67 		.start	= MSM_UART5DM_PHYS,
68 		.end	= MSM_UART5DM_PHYS + PAGE_SIZE - 1,
69 		.name	= "uart_resource",
70 		.flags	= IORESOURCE_MEM,
71 	},
72 	{
73 		.start	= MSM_GSBI5_PHYS,
74 		.end	= MSM_GSBI5_PHYS + PAGE_SIZE - 1,
75 		.name	= "gsbi_resource",
76 		.flags	= IORESOURCE_MEM,
77 	},
78 };
79 
80 struct platform_device msm8960_device_uart_gsbi5 = {
81 	.name	= "msm_serial",
82 	.id	= 0,
83 	.num_resources	= ARRAY_SIZE(resources_uart_gsbi5),
84 	.resource	= resources_uart_gsbi5,
85 };
86