aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Zhao <richard.zhao@freescale.com>2011-12-19 17:10:11 +0800
committerEric Miao <eric.miao@linaro.org>2012-01-09 21:28:36 +0800
commitf98bfd6f1220639ab61a372c5c9ac2e8a727b3cf (patch)
tree2e3213f5c12e89a59ec584f632095b47ccc1eae7
parentdff74412060c72fe7679a420f2144e7a263cadc3 (diff)
downloadlinux-linaro-topic/lt-3.2-imx6-gpu.tar.gz
gpu-viv: convert to device tree and fix build errorstopic/lt-3.2-imx6-gpu
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
-rw-r--r--arch/arm/boot/dts/imx6q.dtsi10
-rw-r--r--drivers/mxc/gpu-viv/Kconfig2
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debug.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c35
4 files changed, 31 insertions, 18 deletions
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index 263e8f3664b..5649dd1dcb9 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -571,5 +571,15 @@
status = "disabled";
};
};
+
+ galcore@virtual {
+ compatible = "viv,galcore";
+ reg = <0x00130000 0x4000>, /* gc2000 */
+ <0x00134000 0x4000>, /* gc320 */
+ <0x02204000 0x4000>; /* gc355 */
+ interrupts = <0 9 0x04 /* gc2000 */
+ 0 10 0x04 /* gc320 */
+ 0 11 0x04>; /* gc355 */
+ };
};
};
diff --git a/drivers/mxc/gpu-viv/Kconfig b/drivers/mxc/gpu-viv/Kconfig
index 682d8eda0ab..e9cc4b27614 100644
--- a/drivers/mxc/gpu-viv/Kconfig
+++ b/drivers/mxc/gpu-viv/Kconfig
@@ -1,5 +1,5 @@
menu "MXC Vivante GPU support"
- depends on ARCH_MX6
+ depends on SOC_IMX6Q
config MXC_GPU_VIV
tristate "MXC Vivante GPU support"
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debug.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debug.h
index a9b633e5d85..af2785f67e9 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debug.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debug.h
@@ -46,7 +46,7 @@ typedef va_list gctARGUMENTS;
va_end(Arguments)
#define gcmkDECLARE_LOCK(__spinLock__) \
- static spinlock_t __spinLock__ = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(__spinLock__)
#define gcmkLOCKSECTION(__spinLock__) \
spin_lock(&__spinLock__)
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
index e7cc92f74e7..4262e328787 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
@@ -24,7 +24,6 @@
#include <linux/device.h>
#include <linux/slab.h>
-#include <mach/viv_gpu.h>
#include "gc_hal_kernel_linux.h"
#include "gc_hal_driver.h"
@@ -944,49 +943,48 @@ static int __devinit gpu_probe(struct platform_device *pdev)
{
int ret = -ENODEV;
struct resource* res;
- struct viv_gpu_platform_data *pdata;
gcmkHEADER();
- res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "irq_3d");
- if (res)
- irqLine = res->start;
+ ret = platform_get_irq(pdev, 0);
+ if (ret >= 0)
+ irqLine = ret;
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "iobase_3d");
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res)
{
registerMemBase = res->start;
registerMemSize = res->end - res->start + 1;
}
- res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "irq_2d");
- if (res)
- irqLine2D = res->start;
+ ret = platform_get_irq(pdev, 1);
+ if (ret >= 0)
+ irqLine2D = ret;
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "iobase_2d");
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (res)
{
registerMemBase2D = res->start;
registerMemSize2D = res->end - res->start + 1;
}
- res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "irq_vg");
- if (res)
- irqLineVG = res->start;
+ ret = platform_get_irq(pdev, 2);
+ if (ret >= 0)
+ irqLineVG = ret;
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "iobase_vg");
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
if (res)
{
registerMemBaseVG = res->start;
registerMemSizeVG = res->end - res->start + 1;
}
-
+#if 0
pdata = pdev->dev.platform_data;
if (pdata) {
contiguousBase = pdata->reserved_mem_base;
contiguousSize = pdata->reserved_mem_size;
}
-
+#endif
ret = drv_init();
if (!ret)
@@ -1076,6 +1074,10 @@ static int __devinit gpu_resume(struct platform_device *dev)
return 0;
}
+static const struct of_device_id gpu_viv_dt_ids[] = {
+ { .compatible = "viv,galcore", },
+ { /* sentinel */ }
+};
static struct platform_driver gpu_driver = {
.probe = gpu_probe,
.remove = gpu_remove,
@@ -1084,6 +1086,7 @@ static struct platform_driver gpu_driver = {
.resume = gpu_resume,
.driver = {
+ .of_match_table = gpu_viv_dt_ids,
.name = DEVICE_NAME,
}
};