aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/xilinxfb.c
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-10-07 03:39:03 -0400
committerMichal Simek <monstr@monstr.eu>2010-10-21 02:04:51 -0400
commita1dfe9c7c9b780865f7a847d3a12fe9214005a58 (patch)
tree0f51f4340bc611c686fbbda3584e3080e857fc3b /drivers/video/xilinxfb.c
parent1180b28ca82c529972bfd438467d5cd71cca5372 (diff)
fbdev/xilinxfb: Microblaze driver support
DCR bus is natively used for PowerPC. Microblaze has no infrastructure for compile DCR that's why is necessary to exclude it. Signed-off-by: Michal Simek <monstr@monstr.eu> Acked-by: Grant Likely <grant.likely@secretlab.ca> CC: Andrei Konovalov <akonovalov@ru.mvista.com> CC: "David S. Miller" <davem@davemloft.net> CC: linux-kernel@vger.kernel.org
Diffstat (limited to 'drivers/video/xilinxfb.c')
-rw-r--r--drivers/video/xilinxfb.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 0c9ce88e95e8..68bd23476c64 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -32,10 +32,14 @@
32#include <linux/dma-mapping.h> 32#include <linux/dma-mapping.h>
33#include <linux/of_device.h> 33#include <linux/of_device.h>
34#include <linux/of_platform.h> 34#include <linux/of_platform.h>
35#include <linux/of_address.h>
35#include <linux/io.h> 36#include <linux/io.h>
36#include <linux/xilinxfb.h> 37#include <linux/xilinxfb.h>
37#include <linux/slab.h> 38#include <linux/slab.h>
39
40#ifdef CONFIG_PPC_DCR
38#include <asm/dcr.h> 41#include <asm/dcr.h>
42#endif
39 43
40#define DRIVER_NAME "xilinxfb" 44#define DRIVER_NAME "xilinxfb"
41 45
@@ -123,10 +127,10 @@ struct xilinxfb_drvdata {
123 registers */ 127 registers */
124 void __iomem *regs; /* virt. address of the control 128 void __iomem *regs; /* virt. address of the control
125 registers */ 129 registers */
126 130#ifdef CONFIG_PPC_DCR
127 dcr_host_t dcr_host; 131 dcr_host_t dcr_host;
128 unsigned int dcr_len; 132 unsigned int dcr_len;
129 133#endif
130 void *fb_virt; /* virt. address of the frame buffer */ 134 void *fb_virt; /* virt. address of the frame buffer */
131 dma_addr_t fb_phys; /* phys. address of the frame buffer */ 135 dma_addr_t fb_phys; /* phys. address of the frame buffer */
132 int fb_alloced; /* Flag, was the fb memory alloced? */ 136 int fb_alloced; /* Flag, was the fb memory alloced? */
@@ -152,9 +156,10 @@ static void xilinx_fb_out_be32(struct xilinxfb_drvdata *drvdata, u32 offset,
152{ 156{
153 if (drvdata->flags & PLB_ACCESS_FLAG) 157 if (drvdata->flags & PLB_ACCESS_FLAG)
154 out_be32(drvdata->regs + (offset << 2), val); 158 out_be32(drvdata->regs + (offset << 2), val);
159#ifdef CONFIG_PPC_DCR
155 else 160 else
156 dcr_write(drvdata->dcr_host, offset, val); 161 dcr_write(drvdata->dcr_host, offset, val);
157 162#endif
158} 163}
159 164
160static int 165static int
@@ -383,8 +388,11 @@ static int xilinxfb_release(struct device *dev)
383 if (drvdata->flags & PLB_ACCESS_FLAG) { 388 if (drvdata->flags & PLB_ACCESS_FLAG) {
384 iounmap(drvdata->regs); 389 iounmap(drvdata->regs);
385 release_mem_region(drvdata->regs_phys, 8); 390 release_mem_region(drvdata->regs_phys, 8);
386 } else 391 }
392#ifdef CONFIG_PPC_DCR
393 else
387 dcr_unmap(drvdata->dcr_host, drvdata->dcr_len); 394 dcr_unmap(drvdata->dcr_host, drvdata->dcr_len);
395#endif
388 396
389 kfree(drvdata); 397 kfree(drvdata);
390 dev_set_drvdata(dev, NULL); 398 dev_set_drvdata(dev, NULL);
@@ -404,7 +412,7 @@ xilinxfb_of_probe(struct platform_device *op, const struct of_device_id *match)
404 u32 tft_access; 412 u32 tft_access;
405 struct xilinxfb_platform_data pdata; 413 struct xilinxfb_platform_data pdata;
406 struct resource res; 414 struct resource res;
407 int size, rc, start; 415 int size, rc;
408 struct xilinxfb_drvdata *drvdata; 416 struct xilinxfb_drvdata *drvdata;
409 417
410 /* Copy with the default pdata (not a ptr reference!) */ 418 /* Copy with the default pdata (not a ptr reference!) */
@@ -437,7 +445,10 @@ xilinxfb_of_probe(struct platform_device *op, const struct of_device_id *match)
437 dev_err(&op->dev, "invalid address\n"); 445 dev_err(&op->dev, "invalid address\n");
438 goto err; 446 goto err;
439 } 447 }
440 } else { 448 }
449#ifdef CONFIG_PPC_DCR
450 else {
451 int start;
441 res.start = 0; 452 res.start = 0;
442 start = dcr_resource_start(op->dev.of_node, 0); 453 start = dcr_resource_start(op->dev.of_node, 0);
443 drvdata->dcr_len = dcr_resource_len(op->dev.of_node, 0); 454 drvdata->dcr_len = dcr_resource_len(op->dev.of_node, 0);
@@ -447,6 +458,7 @@ xilinxfb_of_probe(struct platform_device *op, const struct of_device_id *match)
447 goto err; 458 goto err;
448 } 459 }
449 } 460 }
461#endif
450 462
451 prop = of_get_property(op->dev.of_node, "phys-size", &size); 463 prop = of_get_property(op->dev.of_node, "phys-size", &size);
452 if ((prop) && (size >= sizeof(u32)*2)) { 464 if ((prop) && (size >= sizeof(u32)*2)) {