1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
/*
* Copyright (C) 2011-2013 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <mach/hardware.h>
#include <mach/devices-common.h>
#ifdef CONFIG_ARCH_MX6
#ifdef CONFIG_SOC_IMX6SL
const struct imx_viv_gpu_data imx6_gpu_data __initconst = {
.phys_baseaddr = MX6SL_MMDC0_ARB_BASE_ADDR,
.iobase_3d = 0,
.irq_3d = -1,
.iobase_2d = MX6SL_GPU_2D_ARB_BASE_ADDR,
.irq_2d = MXC_INT_GPU2D_IRQ,
.iobase_vg = OPENVG_ARB_BASE_ADDR,
.irq_vg = MXC_INT_OPENVG_XAQ2,
};
#else
const struct imx_viv_gpu_data imx6_gpu_data __initconst = {
.phys_baseaddr = MMDC0_ARB_BASE_ADDR,
.iobase_3d = GPU_3D_ARB_BASE_ADDR,
.irq_3d = MXC_INT_GPU3D_IRQ,
.iobase_2d = GPU_2D_ARB_BASE_ADDR,
.irq_2d = MXC_INT_GPU2D_IRQ,
.iobase_vg = OPENVG_ARB_BASE_ADDR,
.irq_vg = MXC_INT_OPENVG_XAQ2,
};
#endif
#endif
struct platform_device *__init imx_add_viv_gpu(
const struct imx_viv_gpu_data *data,
const struct viv_gpu_platform_data *pdata)
{
u32 res_count = 0;
struct resource res[] = {
{
.name = "phys_baseaddr",
.start = data->phys_baseaddr,
.end = data->phys_baseaddr,
.flags = IORESOURCE_MEM,
}, {
.name = "iobase_3d",
.start = data->iobase_3d,
.end = data->iobase_3d + SZ_16K - 1,
.flags = IORESOURCE_MEM,
}, {
.name = "irq_3d",
.start = data->irq_3d,
.end = data->irq_3d,
.flags = IORESOURCE_IRQ,
}, {
.name = "iobase_2d",
.start = data->iobase_2d,
.end = data->iobase_2d + SZ_16K - 1,
.flags = IORESOURCE_MEM,
}, {
.name = "irq_2d",
.start = data->irq_2d,
.end = data->irq_2d,
.flags = IORESOURCE_IRQ,
}, {
.name = "iobase_vg",
.start = data->iobase_vg,
.end = data->iobase_vg + SZ_16K - 1,
.flags = IORESOURCE_MEM,
}, {
.name = "irq_vg",
.start = data->irq_vg,
.end = data->irq_vg,
.flags = IORESOURCE_IRQ,
},
};
res_count = ARRAY_SIZE(res);
BUG_ON(!res_count);
if (!fuse_dev_is_available(MXC_DEV_3D)) {
res[1].start = 0;
res[1].end = 0;
res[2].start = -1;
res[2].end = -1;
}
if (!fuse_dev_is_available(MXC_DEV_2D)) {
res[3].start = 0;
res[3].end = 0;
res[4].start = -1;
res[4].end = -1;
}
if (!fuse_dev_is_available(MXC_DEV_OVG)) {
res[5].start = 0;
res[5].end = 0;
res[6].start = -1;
res[6].end = -1;
}
/* None GPU core exists */
if ((res[2].start == -1) &&
(res[4].start == -1) &&
(res[6].start == -1))
return ERR_PTR(-ENODEV);
return imx_add_platform_device_dmamask("galcore", 0,
res, res_count,
pdata, sizeof(*pdata),
DMA_BIT_MASK(32));
}
|