public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] PATCH add rgb555 for at91
@ 2009-06-18 10:52 Giulio Benetti
  2009-06-18 14:07 ` Detlev Zundel
  0 siblings, 1 reply; 6+ messages in thread
From: Giulio Benetti @ 2009-06-18 10:52 UTC (permalink / raw)
  To: u-boot

Signed-off-by: giulio.benetti at micronovasrl.com

diff -urpN b/common/lcd.c a/common/lcd.c
--- b/common/lcd.c      2009-06-14 21:30:39.000000000 +0200
+++ a/common/lcd.c      2009-06-18 12:45:15.000000000 +0200
@@ -1,4 +1,4 @@
-/*
+/*OC
  * Common LCD routines for supported CPUs
  *
  * (C) Copyright 2001-2002
@@ -575,6 +575,10 @@ void bitmap_plot (int x, int y)
                        lut_entry = ((colreg & 0x000F) << 11) |
                                    ((colreg & 0x00F0) <<  2) |
                                    ((colreg & 0x0F00) >>  7);
+#elif defined (CONFIG_ATMEL_LCD_RGB555)
+                       lut_entry = ((colreg & 0x000F) << 1) |
+                                   ((colreg & 0x00F0) <<  2) |
+                                   ((colreg & 0x0F00) <<  3);
 #else /* CONFIG_ATMEL_LCD_RGB565 */
                        lut_entry = ((colreg & 0x000F) << 1) |
                                    ((colreg & 0x00F0) << 3) |
diff -urpN b/drivers/video/atmel_lcdfb.c a/drivers/video/atmel_lcdfb.c
--- b/drivers/video/atmel_lcdfb.c       2009-06-14 21:30:39.000000000 +0200
+++ a/drivers/video/atmel_lcdfb.c       2009-06-18 12:45:15.000000000 +0200
@@ -57,6 +57,9 @@ void lcd_setcolreg(ushort regno, ushort
 #if defined(CONFIG_ATMEL_LCD_BGR555)
        lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno),
                    (red >> 3) | ((green & 0xf8) << 2) | ((blue & 0xf8) << 7));
+#elif defined(CONFIG_ATMEL_LCD_RGB555)
+       lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno),
+                   (blue >> 3) | ((green & 0xf8) << 2) | ((red & 0xf8) << 7));
 #else
        lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno),
                    (blue >> 3) | ((green & 0xfc) << 3) | ((red & 0xf8) << 8));


-- 
Giulio Benetti
R&D
Micronova srl

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] PATCH add rgb555 for at91
  2009-06-18 10:52 [U-Boot] PATCH add rgb555 for at91 Giulio Benetti
@ 2009-06-18 14:07 ` Detlev Zundel
  2009-06-18 14:23   ` Giulio Benetti
  0 siblings, 1 reply; 6+ messages in thread
From: Detlev Zundel @ 2009-06-18 14:07 UTC (permalink / raw)
  To: u-boot

Hi Giulio,

> Signed-off-by: giulio.benetti at micronovasrl.com

Can you please provide a somewhat more descriptive description?  It may
be obvious for you what this does (or what new features can now be
used), but it isn't for me.

>
> diff -urpN b/common/lcd.c a/common/lcd.c
> --- b/common/lcd.c      2009-06-14 21:30:39.000000000 +0200
> +++ a/common/lcd.c      2009-06-18 12:45:15.000000000 +0200
> @@ -1,4 +1,4 @@
> -/*
> +/*OC
>   * Common LCD routines for supported CPUs
>   *
>   * (C) Copyright 2001-2002
> @@ -575,6 +575,10 @@ void bitmap_plot (int x, int y)
>                         lut_entry = ((colreg & 0x000F) << 11) |
>                                     ((colreg & 0x00F0) <<  2) |
>                                     ((colreg & 0x0F00) >>  7);
> +#elif defined (CONFIG_ATMEL_LCD_RGB555)
> +                       lut_entry = ((colreg & 0x000F) << 1) |
> +                                   ((colreg & 0x00F0) <<  2) |
> +                                   ((colreg & 0x0F00) <<  3);
>  #else /* CONFIG_ATMEL_LCD_RGB565 */
>                         lut_entry = ((colreg & 0x000F) << 1) |
>                                     ((colreg & 0x00F0) << 3) |
> diff -urpN b/drivers/video/atmel_lcdfb.c a/drivers/video/atmel_lcdfb.c
> --- b/drivers/video/atmel_lcdfb.c       2009-06-14 21:30:39.000000000 +0200
> +++ a/drivers/video/atmel_lcdfb.c       2009-06-18 12:45:15.000000000 +0200
> @@ -57,6 +57,9 @@ void lcd_setcolreg(ushort regno, ushort
>  #if defined(CONFIG_ATMEL_LCD_BGR555)
                                ^^^
I know this line is not touched by you, but is BGR correct?

>         lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno),
>                     (red >> 3) | ((green & 0xf8) << 2) | ((blue & 0xf8) << 7));
> +#elif defined(CONFIG_ATMEL_LCD_RGB555)
> +       lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno),
> +                   (blue >> 3) | ((green & 0xf8) << 2) | ((red & 0xf8) << 7));
>  #else
>         lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno),
>                     (blue >> 3) | ((green & 0xfc) << 3) | ((red & 0xf8) << 8));

Cheers
  Detlev

-- 
To you I'm an atheist; to God, I'm the Loyal Opposition.
                                        -- Woody Allen
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu@denx.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] PATCH add rgb555 for at91
  2009-06-18 14:07 ` Detlev Zundel
@ 2009-06-18 14:23   ` Giulio Benetti
  2009-06-19  8:26     ` Detlev Zundel
  0 siblings, 1 reply; 6+ messages in thread
From: Giulio Benetti @ 2009-06-18 14:23 UTC (permalink / raw)
  To: u-boot

Detlev Zundel wrote:

> Hi Giulio,
> 
>> Signed-off-by: giulio.benetti at micronovasrl.com
> 
> Can you please provide a somewhat more descriptive description?  It may
> be obvious for you what this does (or what new features can now be
> used), but it isn't for me.
> 
>>
>> diff -urpN b/common/lcd.c a/common/lcd.c
>> --- b/common/lcd.c      2009-06-14 21:30:39.000000000 +0200
>> +++ a/common/lcd.c      2009-06-18 12:45:15.000000000 +0200
>> @@ -1,4 +1,4 @@
>> -/*
>> +/*OC
>>   * Common LCD routines for supported CPUs
>>   *
>>   * (C) Copyright 2001-2002
>> @@ -575,6 +575,10 @@ void bitmap_plot (int x, int y)
>>                         lut_entry = ((colreg & 0x000F) << 11) |
>>                                     ((colreg & 0x00F0) <<  2) |
>>                                     ((colreg & 0x0F00) >>  7);
>> +#elif defined (CONFIG_ATMEL_LCD_RGB555)
>> +                       lut_entry = ((colreg & 0x000F) << 1) |
>> +                                   ((colreg & 0x00F0) <<  2) |
>> +                                   ((colreg & 0x0F00) <<  3);
>>  #else /* CONFIG_ATMEL_LCD_RGB565 */
>>                         lut_entry = ((colreg & 0x000F) << 1) |
>>                                     ((colreg & 0x00F0) << 3) |
>> diff -urpN b/drivers/video/atmel_lcdfb.c a/drivers/video/atmel_lcdfb.c
>> --- b/drivers/video/atmel_lcdfb.c       2009-06-14 21:30:39.000000000
>> +0200
>> +++ a/drivers/video/atmel_lcdfb.c       2009-06-18 12:45:15.000000000
>> +0200 @@ -57,6 +57,9 @@ void lcd_setcolreg(ushort regno, ushort
>>  #if defined(CONFIG_ATMEL_LCD_BGR555)
>                                 ^^^
> I know this line is not touched by you, but is BGR correct?
> 
>>         lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno),
>>                     (red >> 3) | ((green & 0xf8) << 2) | ((blue & 0xf8)
>>                     << 7));
>> +#elif defined(CONFIG_ATMEL_LCD_RGB555)
>> +       lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno),
>> +                   (blue >> 3) | ((green & 0xf8) << 2) | ((red & 0xf8)
>> << 7));
>>  #else
>>         lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno),
>>                     (blue >> 3) | ((green & 0xfc) << 3) | ((red & 0xf8)
>>                     << 8));
> 
> Cheers
>   Detlev
> 

You're right, sorry.
This patch add support for Rgb 555 bits following a precise hardware wiring
that should be more correct respect the at91sam9263ek.
I mean 
LCD2 - LCD7 are RED0 - RED4, 
LCD10 - LCD15 are GREEN0 - GREEN4, 
LCD18 - LCD23 are BLUE0 - BLUE4

Regarding "LCD_BGR555", it is correct only because at91sam9263ek was wired
swapped between red and blue. It should be in that way but I'm not sure.
Anyway I think the wiring should be done better before, instead of create a
new "standard". Fortunately with software you can change more than
something, but not everything.

-- 
Giulio Benetti
R&D
Micronova srl

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] PATCH add rgb555 for at91
  2009-06-18 14:23   ` Giulio Benetti
@ 2009-06-19  8:26     ` Detlev Zundel
  2009-06-19 10:17       ` Giulio Benetti
  0 siblings, 1 reply; 6+ messages in thread
From: Detlev Zundel @ 2009-06-19  8:26 UTC (permalink / raw)
  To: u-boot

Hi Giulio,

> Detlev Zundel wrote:
>
>> Hi Giulio,
>> 
>>> Signed-off-by: giulio.benetti at micronovasrl.com
>> 
>> Can you please provide a somewhat more descriptive description?  It may
>> be obvious for you what this does (or what new features can now be
>> used), but it isn't for me.

[...]

> You're right, sorry.
> This patch add support for Rgb 555 bits following a precise hardware wiring
> that should be more correct respect the at91sam9263ek.
> I mean 
> LCD2 - LCD7 are RED0 - RED4, 
> LCD10 - LCD15 are GREEN0 - GREEN4, 
> LCD18 - LCD23 are BLUE0 - BLUE4

Hm, I still don't get what your patch does.  Is this the wiring which is
actually used on the at91sam9263ek?  If so, then why does your patch not
add this symbol in include/configs/at91sam9263ek.h?  In there I see the
said CONFIG_ATMEL_LCD_BGR555.  That symbol is also defined for the
at91cap9adk, at91sam9261ek and pm9263.h.  So what I would really like to
know - is the interpretation of CONFIG_ATMEL_LCD_BGR555 correct in
U-Boot and only the at91sam9263ek is wired up differently?  Or should
rather the interpretation of CONFIG_ATMEL_LCD_BGR555 be fixed?

> Regarding "LCD_BGR555", it is correct only because at91sam9263ek was wired
> swapped between red and blue. It should be in that way but I'm not sure.
> Anyway I think the wiring should be done better before, instead of create a
> new "standard". Fortunately with software you can change more than
> something, but not everything.

Ah, so this means that the at91sam9263ek is special compared to the
other boards listed above and should be treated differently, right?
Well in this case, your patch certainly needs to change
include/configs/at91sam9263ek.h.

Cheers
  Detlev

-- 
Peace of mind isn't at all superficial to technical work.  It's the
whole thing.   That which  produces it is good work  and that which
destroys it is bad work.
                                        -- Robert M. Pirsig
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] PATCH add rgb555 for at91
  2009-06-19  8:26     ` Detlev Zundel
@ 2009-06-19 10:17       ` Giulio Benetti
  2009-06-23  9:32         ` Detlev Zundel
  0 siblings, 1 reply; 6+ messages in thread
From: Giulio Benetti @ 2009-06-19 10:17 UTC (permalink / raw)
  To: u-boot

Hi Detlev,

RGB555 is a wiring with blue and red swapped, nothing more.
Maybe I've made too much confusion before.
And in the at91 eks there's nothing to change, because they're wired as
BGR555.

Best regards

-- 
Giulio Benetti
R&D
Micronova srl

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] PATCH add rgb555 for at91
  2009-06-19 10:17       ` Giulio Benetti
@ 2009-06-23  9:32         ` Detlev Zundel
  0 siblings, 0 replies; 6+ messages in thread
From: Detlev Zundel @ 2009-06-23  9:32 UTC (permalink / raw)
  To: u-boot

Hi Giulio,

> RGB555 is a wiring with blue and red swapped, nothing more.
> Maybe I've made too much confusion before.
> And in the at91 eks there's nothing to change, because they're wired as
> BGR555.

Ok, in this case, postpone your patch until a board is in mainline which
needs this support ;)

Cheers
  Detlev

-- 
Man sei weder unzufrieden mit sich selbst - denn das waere Kleinmut - noch
selbstzufrieden - denn das waere Dummheit.
                                    --- Baltasar Gracian
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-06-23  9:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-18 10:52 [U-Boot] PATCH add rgb555 for at91 Giulio Benetti
2009-06-18 14:07 ` Detlev Zundel
2009-06-18 14:23   ` Giulio Benetti
2009-06-19  8:26     ` Detlev Zundel
2009-06-19 10:17       ` Giulio Benetti
2009-06-23  9:32         ` Detlev Zundel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox