]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
arm/imx21: Framebuffer support for i.MX21
authorHolger Schurig <hs4233@mail.mn-solutions.de>
Mon, 26 Jan 2009 15:34:56 +0000 (16:34 +0100)
committerSascha Hauer <s.hauer@pengutronix.de>
Fri, 13 Mar 2009 09:33:55 +0000 (10:33 +0100)
This patch mimicks what Martin wrote on the mailing list:

* move arch/arm/mach-imx/include/mach/imxfb.h into
  arch/arm/mach-mxc/include/mach/imxfb.h
* changes Kconfig so that CONFIG_FB_IMX is selectable
* adds a platform device (copied from some pengutronix
  patches)

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/mach-imx/include/mach/imxfb.h [deleted file]
arch/arm/mach-mx2/devices.c
arch/arm/mach-mx2/devices.h
arch/arm/plat-mxc/include/mach/imxfb.h [new file with mode: 0644]
drivers/video/Kconfig

diff --git a/arch/arm/mach-imx/include/mach/imxfb.h b/arch/arm/mach-imx/include/mach/imxfb.h
deleted file mode 100644 (file)
index 870d0d9..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * This structure describes the machine which we are running on.
- */
-
-#define PCR_TFT                (1 << 31)
-#define PCR_COLOR      (1 << 30)
-#define PCR_PBSIZ_1    (0 << 28)
-#define PCR_PBSIZ_2    (1 << 28)
-#define PCR_PBSIZ_4    (2 << 28)
-#define PCR_PBSIZ_8    (3 << 28)
-#define PCR_BPIX_1     (0 << 25)
-#define PCR_BPIX_2     (1 << 25)
-#define PCR_BPIX_4     (2 << 25)
-#define PCR_BPIX_8     (3 << 25)
-#define PCR_BPIX_12    (4 << 25)
-#define PCR_BPIX_16    (4 << 25)
-#define PCR_PIXPOL     (1 << 24)
-#define PCR_FLMPOL     (1 << 23)
-#define PCR_LPPOL      (1 << 22)
-#define PCR_CLKPOL     (1 << 21)
-#define PCR_OEPOL      (1 << 20)
-#define PCR_SCLKIDLE   (1 << 19)
-#define PCR_END_SEL    (1 << 18)
-#define PCR_END_BYTE_SWAP (1 << 17)
-#define PCR_REV_VS     (1 << 16)
-#define PCR_ACD_SEL    (1 << 15)
-#define PCR_ACD(x)     (((x) & 0x7f) << 8)
-#define PCR_SCLK_SEL   (1 << 7)
-#define PCR_SHARP      (1 << 6)
-#define PCR_PCD(x)     ((x) & 0x3f)
-
-#define PWMR_CLS(x)    (((x) & 0x1ff) << 16)
-#define PWMR_LDMSK     (1 << 15)
-#define PWMR_SCR1      (1 << 10)
-#define PWMR_SCR0      (1 << 9)
-#define PWMR_CC_EN     (1 << 8)
-#define PWMR_PW(x)     ((x) & 0xff)
-
-#define LSCR1_PS_RISE_DELAY(x)    (((x) & 0x7f) << 26)
-#define LSCR1_CLS_RISE_DELAY(x)   (((x) & 0x3f) << 16)
-#define LSCR1_REV_TOGGLE_DELAY(x) (((x) & 0xf) << 8)
-#define LSCR1_GRAY2(x)            (((x) & 0xf) << 4)
-#define LSCR1_GRAY1(x)            (((x) & 0xf))
-
-#define DMACR_BURST    (1 << 31)
-#define DMACR_HM(x)    (((x) & 0xf) << 16)
-#define DMACR_TM(x)    ((x) & 0xf)
-
-struct imx_fb_platform_data {
-       u_long          pixclock;
-
-       u_short         xres;
-       u_short         yres;
-
-       u_int           nonstd;
-       u_char          bpp;
-       u_char          hsync_len;
-       u_char          left_margin;
-       u_char          right_margin;
-
-       u_char          vsync_len;
-       u_char          upper_margin;
-       u_char          lower_margin;
-       u_char          sync;
-
-       u_int           cmap_greyscale:1,
-                       cmap_inverse:1,
-                       cmap_static:1,
-                       unused:29;
-
-       u_int           pcr;
-       u_int           pwmr;
-       u_int           lscr1;
-       u_int           dmacr;
-
-       u_char * fixed_screen_cpu;
-       dma_addr_t fixed_screen_dma;
-
-       void (*lcd_power)(int);
-       void (*backlight_power)(int);
-};
-
-void set_imx_fb_info(struct imx_fb_platform_data *);
index 9ddd6d06105891d617de65f316479c3f73642d4e..07061e644545fa62d7879910acd7cc8996dc2e77 100644 (file)
@@ -228,6 +228,39 @@ struct platform_device mxc_nand_device = {
        .resource = mxc_nand_resources,
 };
 
+#ifdef CONFIG_FB_IMX
+/*
+ * lcdc:
+ * - i.MX1: the basic controller
+ * - i.MX21: to be checked
+ * - i.MX27: like i.MX1, with slightly variations
+ */
+static struct resource mxc_fb[] = {
+       {
+               .start = LCDC_BASE_ADDR,
+               .end   = LCDC_BASE_ADDR + 0xFFF,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = MXC_INT_LCDC,
+               .end   = MXC_INT_LCDC,
+               .flags = IORESOURCE_IRQ,
+       }
+};
+
+/* mxc lcd driver */
+struct platform_device mxc_fb_device = {
+       .name = "imx-fb",
+       .id = 0,
+       .num_resources = ARRAY_SIZE(mxc_fb),
+       .resource = mxc_fb,
+       .dev = {
+               .coherent_dma_mask = 0xFFFFFFFF,
+       },
+};
+
+#endif
+
 /* GPIO port description */
 static struct mxc_gpio_port imx_gpio_ports[] = {
        [0] = {
index 1e8cb577a64262752afca2ea9f6c38b176119ea0..f4cb0ce29f130205388bd10f60abb59f375505f5 100644 (file)
@@ -1,4 +1,3 @@
-
 extern struct platform_device mxc_gpt1;
 extern struct platform_device mxc_gpt2;
 extern struct platform_device mxc_gpt3;
@@ -14,3 +13,4 @@ extern struct platform_device mxc_uart_device4;
 extern struct platform_device mxc_uart_device5;
 extern struct platform_device mxc_w1_master_device;
 extern struct platform_device mxc_nand_device;
+extern struct platform_device mxc_fb_device;
diff --git a/arch/arm/plat-mxc/include/mach/imxfb.h b/arch/arm/plat-mxc/include/mach/imxfb.h
new file mode 100644 (file)
index 0000000..870d0d9
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * This structure describes the machine which we are running on.
+ */
+
+#define PCR_TFT                (1 << 31)
+#define PCR_COLOR      (1 << 30)
+#define PCR_PBSIZ_1    (0 << 28)
+#define PCR_PBSIZ_2    (1 << 28)
+#define PCR_PBSIZ_4    (2 << 28)
+#define PCR_PBSIZ_8    (3 << 28)
+#define PCR_BPIX_1     (0 << 25)
+#define PCR_BPIX_2     (1 << 25)
+#define PCR_BPIX_4     (2 << 25)
+#define PCR_BPIX_8     (3 << 25)
+#define PCR_BPIX_12    (4 << 25)
+#define PCR_BPIX_16    (4 << 25)
+#define PCR_PIXPOL     (1 << 24)
+#define PCR_FLMPOL     (1 << 23)
+#define PCR_LPPOL      (1 << 22)
+#define PCR_CLKPOL     (1 << 21)
+#define PCR_OEPOL      (1 << 20)
+#define PCR_SCLKIDLE   (1 << 19)
+#define PCR_END_SEL    (1 << 18)
+#define PCR_END_BYTE_SWAP (1 << 17)
+#define PCR_REV_VS     (1 << 16)
+#define PCR_ACD_SEL    (1 << 15)
+#define PCR_ACD(x)     (((x) & 0x7f) << 8)
+#define PCR_SCLK_SEL   (1 << 7)
+#define PCR_SHARP      (1 << 6)
+#define PCR_PCD(x)     ((x) & 0x3f)
+
+#define PWMR_CLS(x)    (((x) & 0x1ff) << 16)
+#define PWMR_LDMSK     (1 << 15)
+#define PWMR_SCR1      (1 << 10)
+#define PWMR_SCR0      (1 << 9)
+#define PWMR_CC_EN     (1 << 8)
+#define PWMR_PW(x)     ((x) & 0xff)
+
+#define LSCR1_PS_RISE_DELAY(x)    (((x) & 0x7f) << 26)
+#define LSCR1_CLS_RISE_DELAY(x)   (((x) & 0x3f) << 16)
+#define LSCR1_REV_TOGGLE_DELAY(x) (((x) & 0xf) << 8)
+#define LSCR1_GRAY2(x)            (((x) & 0xf) << 4)
+#define LSCR1_GRAY1(x)            (((x) & 0xf))
+
+#define DMACR_BURST    (1 << 31)
+#define DMACR_HM(x)    (((x) & 0xf) << 16)
+#define DMACR_TM(x)    ((x) & 0xf)
+
+struct imx_fb_platform_data {
+       u_long          pixclock;
+
+       u_short         xres;
+       u_short         yres;
+
+       u_int           nonstd;
+       u_char          bpp;
+       u_char          hsync_len;
+       u_char          left_margin;
+       u_char          right_margin;
+
+       u_char          vsync_len;
+       u_char          upper_margin;
+       u_char          lower_margin;
+       u_char          sync;
+
+       u_int           cmap_greyscale:1,
+                       cmap_inverse:1,
+                       cmap_static:1,
+                       unused:29;
+
+       u_int           pcr;
+       u_int           pwmr;
+       u_int           lscr1;
+       u_int           dmacr;
+
+       u_char * fixed_screen_cpu;
+       dma_addr_t fixed_screen_dma;
+
+       void (*lcd_power)(int);
+       void (*backlight_power)(int);
+};
+
+void set_imx_fb_info(struct imx_fb_platform_data *);
index fb19803060cf6c35727c9f287f5668bf670ed969..967ac3d359a650d264fe499f9c02a2b03bf00a8e 100644 (file)
@@ -397,7 +397,7 @@ config FB_SA1100
 
 config FB_IMX
        tristate "Motorola i.MX LCD support"
-       depends on FB && ARM && ARCH_IMX
+       depends on FB && (ARCH_IMX || ARCH_MX2)
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT