diff options
Diffstat (limited to 'drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c')
-rw-r--r-- | drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c index b67404150e10..2e6bc55e88fe 100644 --- a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c +++ b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c @@ -1,5 +1,5 @@ /* Copyright (c) 2008-2010, Advanced Micro Devices. All rights reserved. - * Copyright (C) 2008-2011 Freescale Semiconductor, Inc. + * Copyright (C) 2008-2012 Freescale Semiconductor, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -40,6 +40,7 @@ #include <linux/uaccess.h> #include <mach/mxc_gpu.h> +#include <linux/fsl_devices.h> int gpu_2d_irq, gpu_3d_irq; @@ -51,6 +52,7 @@ int gmem_size; phys_addr_t gpu_reserved_mem; int gpu_reserved_mem_size; int z160_version; +int enable_mmu; static ssize_t gsl_kmod_read(struct file *fd, char __user *buf, size_t len, loff_t *ptr); static ssize_t gsl_kmod_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr); @@ -769,14 +771,15 @@ static int gpu_probe(struct platform_device *pdev) int i; struct resource *res; struct device *dev; - struct mxc_gpu_platform_data *pdata; + struct mxc_gpu_platform_data *gpu_data = NULL; - pdata = pdev->dev.platform_data; - if (pdata) { - z160_version = pdata->z160_revision; - gpu_reserved_mem = pdata->reserved_mem_base; - gpu_reserved_mem_size = pdata->reserved_mem_size; - } + gpu_data = (struct mxc_gpu_platform_data *)pdev->dev.platform_data; + + if (gpu_data == NULL) + return 0; + + z160_version = gpu_data->z160_revision; + enable_mmu = gpu_data->enable_mmu; for(i = 0; i < 2; i++){ res = platform_get_resource(pdev, IORESOURCE_IRQ, i); @@ -795,8 +798,8 @@ static int gpu_probe(struct platform_device *pdev) } } - for (i = 0; i < 3; i++) { - res = platform_get_resource(pdev, IORESOURCE_MEM, i); + for (i = 0; i < 4; i++) { + res = platform_get_resource(pdev, IORESOURCE_MEM, i); if (!res) { gpu_2d_regbase = 0; gpu_2d_regsize = 0; @@ -807,14 +810,17 @@ static int gpu_probe(struct platform_device *pdev) gpu_reserved_mem_size = 0; break; }else{ - if(strcmp(res->name, "gpu_2d_registers") == 0){ - gpu_2d_regbase = res->start; - gpu_2d_regsize = res->end - res->start + 1; - }else if(strcmp(res->name, "gpu_3d_registers") == 0){ - gpu_3d_regbase = res->start; - gpu_3d_regsize = res->end - res->start + 1; - }else if(strcmp(res->name, "gpu_graphics_mem") == 0){ - gmem_size = res->end - res->start + 1; + if (strcmp(res->name, "gpu_2d_registers") == 0) { + gpu_2d_regbase = res->start; + gpu_2d_regsize = res->end - res->start + 1; + } else if (strcmp(res->name, "gpu_3d_registers") == 0) { + gpu_3d_regbase = res->start; + gpu_3d_regsize = res->end - res->start + 1; + } else if (strcmp(res->name, "gpu_graphics_mem") == 0) { + gmem_size = res->end - res->start + 1; + } else if (strcmp(res->name, "gpu_reserved_mem") == 0) { + gpu_reserved_mem = res->start; + gpu_reserved_mem_size = res->end - res->start + 1; } } } |