[U-Boot] mx53loco: Add support for SEIKO 4.3'' WVGA panel

Submitted by Fabio Estevam on Oct. 23, 2012, 5:36 p.m.

Details

Message ID CAOMZO5DSzFJLi_-QGFCF01dK-zngNWWmFeN9kTWiDfvH4mXP=Q@mail.gmail.com
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Fabio Estevam Oct. 23, 2012, 5:36 p.m.
Hi Stefano,

On Sat, Oct 20, 2012 at 12:03 PM, Stefano Babic <sbabic@denx.de> wrote:

> What about to use a u-boot environment to select the display ? Could be
> a better solution for you ? You can then have a single u-boot image
> managing both displays. I did in this way for the mt_ventoux board
> (board/mt_ventoux/mt_ventoux.c), maybe can this help ?

Sounds good. I tried this approach.

However, when I try to manipulate the env var I am not able to boot:

U-Boot 2012.10-09480-g6b08fc3-dirty (Oct 23 2012 - 15:24:03)

Board: MX53 LOCO
I2C:   ready
DRAM:  1 GiB
...

These are my simple changes (just to show the issue I am facing):



Any ideas?

Thanks,

Fabio Estevam

Comments

Stefano Babic Oct. 25, 2012, 10:28 a.m.
Am 23/10/2012 19:36, schrieb Fabio Estevam:
> Hi Stefano,
> 
> On Sat, Oct 20, 2012 at 12:03 PM, Stefano Babic <sbabic@denx.de> wrote:
> 
>> What about to use a u-boot environment to select the display ? Could be
>> a better solution for you ? You can then have a single u-boot image
>> managing both displays. I did in this way for the mt_ventoux board
>> (board/mt_ventoux/mt_ventoux.c), maybe can this help ?
> 
> Sounds good. I tried this approach.
> 
> However, when I try to manipulate the env var I am not able to boot:
> 
> U-Boot 2012.10-09480-g6b08fc3-dirty (Oct 23 2012 - 15:24:03)
> 
> Board: MX53 LOCO
> I2C:   ready
> DRAM:  1 GiB
> ...
> 
> These are my simple changes (just to show the issue I am facing):
> 
> --- a/board/freescale/mx53loco/mx53loco.c
> +++ b/board/freescale/mx53loco/mx53loco.c
> @@ -471,6 +471,18 @@ void lcd_iomux(void)
>  void lcd_enable(void)
>  {
>         int ret = ipuv3_fb_init(&claa_wvga, 0, IPU_PIX_FMT_RGB565);
> +       char *e;
> +
> +       e = getenv("panel");
> +
> +       if (e != NULL) {
> +               if (strcmp(e, "claa") == 0)
> +                       printf("Panel is claa\n");
> +
> +               if (strcmp(e, "seiko") == 0)
> +                       printf("Panel is seiko\n");
> +       }
> +
>         if (ret)
>                 printf("LCD cannot be configured: %d\n", ret);
>  }
> 
> 
> Any ideas?

Yes, I thins is due to the fact that size for the framebuffer is
allocated before relocation. This was also a reason for me to migrate to
CONFIG_VIDEO instead of CONFIG_LCD.

From board_init_f in arch/arm/lib/board.c:

#ifdef CONFIG_LCD
        /* reserve memory for LCD display (always full pages) */
        addr = lcd_setmem (addr);
        gd->fb_base = addr;
#endif /* CONFIG_LCD */

This makes difficult to reserve the correct amount of memory because at
this point we cannot evaluate the environment. With CONFIG_VIDEO, memory
is allocated with malloc(), and in any case after relocation.

Best regards,
Stefano

> 
> Thanks,
> 
> Fabio Estevam
>
Fabio Estevam Oct. 25, 2012, 11:02 a.m.
Hi Stefano,

On Thu, Oct 25, 2012 at 8:28 AM, Stefano Babic <sbabic@denx.de> wrote:

> Yes, I thins is due to the fact that size for the framebuffer is
> allocated before relocation. This was also a reason for me to migrate to
> CONFIG_VIDEO instead of CONFIG_LCD.

mx53loco.h defines CONFIG_VIDEO, not CONFIG_LCD.

I am suspecting alignment/gcc issues: with a gcc4.4 I can boot into a
prompt, but after typing any command and then "enter" the board
crashes and reboot.

With gcc4.7, then board hangs after the total RAM is displayed.

Regards,

Fabio Estevam
Marek Vasut Oct. 25, 2012, 11:14 a.m.
Dear Fabio Estevam,

CCing Albert.

> Hi Stefano,
> 
> On Thu, Oct 25, 2012 at 8:28 AM, Stefano Babic <sbabic@denx.de> wrote:
> > Yes, I thins is due to the fact that size for the framebuffer is
> > allocated before relocation. This was also a reason for me to migrate to
> > CONFIG_VIDEO instead of CONFIG_LCD.
> 
> mx53loco.h defines CONFIG_VIDEO, not CONFIG_LCD.
> 
> I am suspecting alignment/gcc issues: with a gcc4.4 I can boot into a
> prompt, but after typing any command and then "enter" the board
> crashes and reboot.
> 
> With gcc4.7, then board hangs after the total RAM is displayed.
> 
> Regards,
> 
> Fabio Estevam

Best regards,
Marek Vasut
Albert ARIBAUD Nov. 4, 2012, 2:33 p.m.
Hi Marek,

On Thu, 25 Oct 2012 13:14:38 +0200, Marek Vasut <marex@denx.de> wrote:

> Dear Fabio Estevam,
> 
> CCing Albert.
> 
> > Hi Stefano,
> > 
> > On Thu, Oct 25, 2012 at 8:28 AM, Stefano Babic <sbabic@denx.de> wrote:
> > > Yes, I thins is due to the fact that size for the framebuffer is
> > > allocated before relocation. This was also a reason for me to migrate to
> > > CONFIG_VIDEO instead of CONFIG_LCD.
> > 
> > mx53loco.h defines CONFIG_VIDEO, not CONFIG_LCD.
> > 
> > I am suspecting alignment/gcc issues: with a gcc4.4 I can boot into a
> > prompt, but after typing any command and then "enter" the board
> > crashes and reboot.
> > 
> > With gcc4.7, then board hangs after the total RAM is displayed.
> > 
> > Regards,
> > 
> > Fabio Estevam

The board should normally not hang but throw a data abort. In any case,
try to run the board under a HW debugger to find out which exception
occurs.

> Best regards,
> Marek Vasut

Amicalement,

Patch hide | download patch | download mbox

--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -471,6 +471,18 @@  void lcd_iomux(void)
 void lcd_enable(void)
 {
        int ret = ipuv3_fb_init(&claa_wvga, 0, IPU_PIX_FMT_RGB565);
+       char *e;
+
+       e = getenv("panel");
+
+       if (e != NULL) {
+               if (strcmp(e, "claa") == 0)
+                       printf("Panel is claa\n");
+
+               if (strcmp(e, "seiko") == 0)
+                       printf("Panel is seiko\n");
+       }
+
        if (ret)
                printf("LCD cannot be configured: %d\n", ret);
 }