* [U-Boot] LCD Support on mx51 vision2
@ 2012-05-08 17:46 Fabio Estevam
2012-05-08 18:28 ` Anatolij Gustschin
0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2012-05-08 17:46 UTC (permalink / raw)
To: u-boot
Hi,
Could anyone confirm that LCD support is functional on top-of-tree
U-boot for mx51 vision2 board?
I am working on adding LCD support for mx51evk and I am getting the
following error from mxcfb_map_video_memory:
U-Boot 2012.04.01-00075-g6efea73-dirty (May 08 2012 - 14:40:01)
CPU: Freescale i.MX51 rev3.0 at 800 MHz
Reset cause: POR
Board: MX51EVK
DRAM: 512 MiB
WARNING: Caches not enabled
MMC: FSL_SDHC: 0, FSL_SDHC: 1
Unable to allocate framebuffer memory
Regards,
Fabio Estevam
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] LCD Support on mx51 vision2
2012-05-08 17:46 [U-Boot] LCD Support on mx51 vision2 Fabio Estevam
@ 2012-05-08 18:28 ` Anatolij Gustschin
2012-05-08 19:35 ` Fabio Estevam
0 siblings, 1 reply; 9+ messages in thread
From: Anatolij Gustschin @ 2012-05-08 18:28 UTC (permalink / raw)
To: u-boot
Hi,
On Tue, 8 May 2012 14:46:18 -0300
Fabio Estevam <festevam@gmail.com> wrote:
> Hi,
>
> Could anyone confirm that LCD support is functional on top-of-tree
> U-boot for mx51 vision2 board?
I cannot confirm this as I do not have the hardware to test. But ...
> I am working on adding LCD support for mx51evk and I am getting the
> following error from mxcfb_map_video_memory:
>
> U-Boot 2012.04.01-00075-g6efea73-dirty (May 08 2012 - 14:40:01)
>
> CPU: Freescale i.MX51 rev3.0 at 800 MHz
> Reset cause: POR
> Board: MX51EVK
> DRAM: 512 MiB
> WARNING: Caches not enabled
> MMC: FSL_SDHC: 0, FSL_SDHC: 1
> Unable to allocate framebuffer memory
the issue is probably the insufficient malloc area size defined in
the board config file. The mx51evk defines CONFIG_SYS_MALLOC_LEN
to be slightly more than 2 MiB. The vision2 config sets
CONFIG_SYS_MALLOC_LEN to 10 MiB. Please try increasing CONFIG_SYS_MALLOC_LEN.
Thanks,
Anatolij
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] LCD Support on mx51 vision2
2012-05-08 18:28 ` Anatolij Gustschin
@ 2012-05-08 19:35 ` Fabio Estevam
2012-05-08 21:24 ` Fabio Estevam
0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2012-05-08 19:35 UTC (permalink / raw)
To: u-boot
Hi Anatolij,
On 5/8/12, Anatolij Gustschin <agust@denx.de> wrote:
> the issue is probably the insufficient malloc area size defined in
> the board config file. The mx51evk defines CONFIG_SYS_MALLOC_LEN
> to be slightly more than 2 MiB. The vision2 config sets
> CONFIG_SYS_MALLOC_LEN to 10 MiB. Please try increasing
> CONFIG_SYS_MALLOC_LEN.
Thanks for your suggestion. Increasing CONFIG_SYS_MALLOC_LEN does not
fix the issue.
I will debug this problem.
Thanks,
Fabio Estevam
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] LCD Support on mx51 vision2
2012-05-08 19:35 ` Fabio Estevam
@ 2012-05-08 21:24 ` Fabio Estevam
2012-05-08 22:40 ` Anatolij Gustschin
0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2012-05-08 21:24 UTC (permalink / raw)
To: u-boot
Anatolij,
On Tue, May 8, 2012 at 4:35 PM, Fabio Estevam <festevam@gmail.com> wrote:
> Thanks for your suggestion. Increasing ?CONFIG_SYS_MALLOC_LEN does not
> fix the issue.
Below is my patch and some more debug information.
As you can see mode->xres is getting a weird value instead of '800'
that I pass in the fb_videomode struct.
diff --git a/board/freescale/mx51evk/mx51evk.c
b/board/freescale/mx51evk/mx51evk.c
index b505a71..a6cf64a 100644
--- a/board/freescale/mx51evk/mx51evk.c
+++ b/board/freescale/mx51evk/mx51evk.c
@@ -36,6 +36,8 @@
#include <fsl_pmic.h>
#include <mc13892.h>
#include <usb/ehci-fsl.h>
+#include <linux/fb.h>
+#include <ipu_pixfmt.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -453,6 +455,27 @@ int board_mmc_init(bd_t *bis)
}
#endif
+static struct fb_videomode claa_wvga = {
+ .name = "CLAA07LC0ACW",
+ .refresh = 57,
+ .xres = 800,
+ .yres = 480,
+ .pixclock = 37037,
+ .left_margin = 40,
+ .right_margin = 60,
+ .upper_margin = 10,
+ .lower_margin = 10,
+ .hsync_len = 20,
+ .vsync_len = 10,
+ .sync = 0,
+ .vmode = FB_VMODE_NONINTERLACED
+};
+
+void lcd_enable(void)
+{
+ mx51_fb_init(&claa_wvga, 1, IPU_PIX_FMT_RGB565);
+}
+
int board_early_init_f(void)
{
setup_iomux_uart();
diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c
index 1bee54c..c640838 100644
--- a/drivers/video/mxc_ipuv3_fb.c
+++ b/drivers/video/mxc_ipuv3_fb.c
@@ -26,6 +26,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
+#define DEBUG
#include <common.h>
#include <asm/errno.h>
@@ -66,6 +67,8 @@ void fb_videomode_to_var(struct fb_var_screeninfo *var,
var->vsync_len = mode->vsync_len;
var->sync = mode->sync;
var->vmode = mode->vmode & FB_VMODE_MASK;
+
+ printf("%s mode->xres: %d\n", __func__, mode->xres);
}
/*
@@ -542,8 +545,15 @@ static int mxcfb_probe(u32 interface_pix_fmt, uint8_t disp,
fb_videomode_to_var(&fbi->var, mode);
fbi->var.bits_per_pixel = 16;
fbi->fix.line_length = fbi->var.xres * (fbi->var.bits_per_pixel / 8);
+
+ printf("fbi->var.xres: %d\n", fbi->var.xres);
+ printf("fbi->var.bits_per_pixel /8 : %d\n", fbi->var.bits_per_pixel / 8);
+ printf("fbi->fix.line_length: %d\n", fbi->fix.line_length);
+
fbi->fix.smem_len = fbi->var.yres_virtual * fbi->fix.line_length;
+ printf("fbi->fix.smem_len: %d\n", fbi->fix.smem_len);
+
mxcfb_check_var(&fbi->var, fbi);
/* Default Y virtual size is 2x panel size */
diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
index 1477b21..e4240ba 100644
--- a/include/configs/mx51evk.h
+++ b/include/configs/mx51evk.h
@@ -51,7 +51,7 @@
/*
* Size of malloc() pool
*/
-#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
+#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 10 * 1024 * 1024)
#define CONFIG_BOARD_LATE_INIT
@@ -123,6 +123,17 @@
#define CONFIG_MXC_USB_PORTSC PORT_PTS_ULPI
#define CONFIG_MXC_USB_FLAGS MXC_EHCI_POWER_PINS_ENABLED
+/* Framebuffer and LCD */
+#define CONFIG_PREBOOT
+#define CONFIG_VIDEO
+#define CONFIG_VIDEO_MX5
+#define CONFIG_CFB_CONSOLE
+#define CONFIG_VGA_AS_SINGLE_DEVICE
+#define CONFIG_VIDEO_BMP_RLE8
+#define CONFIG_SPLASH_SCREEN
+#define CONFIG_CMD_BMP
+#define CONFIG_BMP_16BPP
+
/* allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE
#define CONFIG_CONS_INDEX 1
--
U-Boot 2012.04.01-00075-g6efea73-dirty (May 08 2012 - 18:18:40)
CPU: Freescale i.MX51 rev3.0 at 800 MHz
Reset cause: POR
Board: MX51EVK
DRAM: 512 MiB
WARNING: Caches not enabled
MMC: FSL_SDHC: 0, FSL_SDHC: 1
mxcfb_init_fbinfo: 4 640 112 524
Framebuffer structures at: fbi=0xaf56e268 mxcfbi=0xaf56e478
fb_videomode_to_var mode->xres: -442503140
fbi->var.xres: -442503140
fbi->var.bits_per_pixel /8 : 2
fbi->fix.line_length: -885006280
fbi->fix.smem_len: 2012808736
Unable to allocate framebuffer memory
Framebuffer at 0x0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [U-Boot] LCD Support on mx51 vision2
2012-05-08 21:24 ` Fabio Estevam
@ 2012-05-08 22:40 ` Anatolij Gustschin
2012-05-08 22:59 ` Fabio Estevam
0 siblings, 1 reply; 9+ messages in thread
From: Anatolij Gustschin @ 2012-05-08 22:40 UTC (permalink / raw)
To: u-boot
Hi Fabio,
On Tue, 8 May 2012 18:24:38 -0300
Fabio Estevam <festevam@gmail.com> wrote:
> Anatolij,
>
> On Tue, May 8, 2012 at 4:35 PM, Fabio Estevam <festevam@gmail.com> wrote:
>
> > Thanks for your suggestion. Increasing ?CONFIG_SYS_MALLOC_LEN does not
> > fix the issue.
>
> Below is my patch and some more debug information.
>
> As you can see mode->xres is getting a weird value instead of '800'
> that I pass in the fb_videomode struct.
Thanks for the info. I think you additionally need to call lcd_enable()
in your board_init(). The mode struct will be initialized then. From
your patch I do not see that you call lcd_enable().
Thanks,
Anatolij
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] LCD Support on mx51 vision2
2012-05-08 22:40 ` Anatolij Gustschin
@ 2012-05-08 22:59 ` Fabio Estevam
2012-05-09 15:59 ` Fabio Estevam
0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2012-05-08 22:59 UTC (permalink / raw)
To: u-boot
Hi Anatolij,
On Tue, May 8, 2012 at 7:40 PM, Anatolij Gustschin <agust@denx.de> wrote:
> Thanks for the info. I think you additionally need to call lcd_enable()
> in your board_init(). The mode struct will be initialized then. From
> your patch I do not see that you call lcd_enable().
You are clearly right! Now I see the console output on my LCD :-)
Will submit the patch soon.
Now I will try to load some splashscreen.
Thanks a lot for your help,
Fabio Estevam
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] LCD Support on mx51 vision2
2012-05-08 22:59 ` Fabio Estevam
@ 2012-05-09 15:59 ` Fabio Estevam
2012-05-09 16:19 ` Stefano Babic
0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2012-05-09 15:59 UTC (permalink / raw)
To: u-boot
Hi Anatolij,
On Tue, May 8, 2012 at 7:59 PM, Fabio Estevam <festevam@gmail.com> wrote:
> You are clearly right! Now I see the console output on my LCD :-)
>
> Will submit the patch soon.
I am using the following LCD configuration on my board file (same as vision2.h):
#define CONFIG_PREBOOT
#define CONFIG_VIDEO
#define CONFIG_VIDEO_MX5
#define CONFIG_CFB_CONSOLE
#define CONFIG_VGA_AS_SINGLE_DEVICE
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_SPLASH_SCREEN
#define CONFIG_CMD_BMP
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
,and this directs the console to the LCD as expected.
I would like to keep only the video logo on screen and keep the
console into the serial port.
Is this possible?
If I remove "#define CONFIG_CFB_CONSOLE" the build fails (This can be
reproduced with vision2 config).
If I keep "#define CONFIG_CFB_CONSOLE" and pass "set console serial"
the console output still goes to the LCD.
Any suggestions?
Thanks,
Fabio Estevam
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] LCD Support on mx51 vision2
2012-05-09 15:59 ` Fabio Estevam
@ 2012-05-09 16:19 ` Stefano Babic
2012-05-09 16:23 ` Fabio Estevam
0 siblings, 1 reply; 9+ messages in thread
From: Stefano Babic @ 2012-05-09 16:19 UTC (permalink / raw)
To: u-boot
On 09/05/2012 17:59, Fabio Estevam wrote:
> Hi Anatolij,
>
> On Tue, May 8, 2012 at 7:59 PM, Fabio Estevam <festevam@gmail.com> wrote:
>
>> You are clearly right! Now I see the console output on my LCD :-)
>>
>> Will submit the patch soon.
>
> I am using the following LCD configuration on my board file (same as vision2.h):
>
> #define CONFIG_PREBOOT
> #define CONFIG_VIDEO
> #define CONFIG_VIDEO_MX5
> #define CONFIG_CFB_CONSOLE
> #define CONFIG_VGA_AS_SINGLE_DEVICE
> #define CONFIG_VIDEO_BMP_RLE8
> #define CONFIG_SPLASH_SCREEN
> #define CONFIG_CMD_BMP
> #define CONFIG_BMP_16BPP
> #define CONFIG_VIDEO_LOGO
>
> ,and this directs the console to the LCD as expected.
>
> I would like to keep only the video logo on screen and keep the
> console into the serial port.
On vision, the display was used for splashscreen and the console is set
to the serial line.
>
> Is this possible?
>
> If I remove "#define CONFIG_CFB_CONSOLE" the build fails (This can be
> reproduced with vision2 config).
>
> If I keep "#define CONFIG_CFB_CONSOLE" and pass "set console serial"
> the console output still goes to the LCD.
>
> Any suggestions?
You have to set stdin / stdout - maybe in late_init() ?
Stefano
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] LCD Support on mx51 vision2
2012-05-09 16:19 ` Stefano Babic
@ 2012-05-09 16:23 ` Fabio Estevam
0 siblings, 0 replies; 9+ messages in thread
From: Fabio Estevam @ 2012-05-09 16:23 UTC (permalink / raw)
To: u-boot
Hi Stefano,
On Wed, May 9, 2012 at 1:19 PM, Stefano Babic <sbabic@denx.de> wrote:
>
> You have to set stdin / stdout - maybe in late_init() ?
That did the trick! Thanks a lot
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-05-09 16:23 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-08 17:46 [U-Boot] LCD Support on mx51 vision2 Fabio Estevam
2012-05-08 18:28 ` Anatolij Gustschin
2012-05-08 19:35 ` Fabio Estevam
2012-05-08 21:24 ` Fabio Estevam
2012-05-08 22:40 ` Anatolij Gustschin
2012-05-08 22:59 ` Fabio Estevam
2012-05-09 15:59 ` Fabio Estevam
2012-05-09 16:19 ` Stefano Babic
2012-05-09 16:23 ` Fabio Estevam
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.