Splash Screen and I2C multibus support for REV C

Hi all,

I am hereby attaching the splash screen and I2C multibus support in u-boot for REV C.

The u-boot source is base lined from http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=shortlog;h=for-khasim-rebase

Kindly review and update me your findings for the same.

I2C multi bus can be used to read the EDID by executing the following commands

OMAP3 beagleboard.org # ide 2

OMAP3 beagleboard.org # imd 0x50 0 100

0000: 00 ff ff ff ff ff ff 00 10 ac 13 40 52 31 43 43 …@R1CC

0010: 19 10 01 03 80 22 1b 81 ee e0 e5 a4 56 45 9a 23 …"…VE.#

0020: 15 50 54 a5 4b 00 71 4f 81 80 01 01 01 01 01 01 .PT.K.qO…

0030: 01 01 01 01 01 01 30 2a 00 98 51 00 2a 40 30 70 …0*…Q.*@0p

0040: 13 00 52 0e 11 00 00 1e 00 00 00 ff 00 46 43 32 …R…FC2

0050: 33 37 36 36 4d 43 43 31 52 0a 00 00 00 fc 00 44 3766MCC1R…D

0060: 45 4c 4c 20 31 37 30 37 46 50 0a 20 00 00 00 fd ELL 1707FP. …

0070: 00 38 4c 1e 51 0e 00 0a 20 20 20 20 20 20 00 eb .8L.Q… …

Regards,

Khasim

splash-screen.patch (732 KB)

i2c-multibus-support.patch (12.9 KB)

Khasim, I had some challenge in applying the patch, but I believe it is my process of copy-and-paste. I will try again later today.

Steve, will you rebase your omap3-dev or some other branch upon the mainline? Currently there are merge conflicts and some of the mainline code is better/newer than what you have on omap3-dev. Dirk would like to see patches against omap3-dev, rather than the mainline, so that they have all of the OMAP3-specific latest stuff. That is fine, but I’d need your tree to include the mainline versions of the OMAP3 patches, not the old versions of the patches.

Jason,

Jason Kridner wrote:

Hi all,

I am hereby attaching the splash screen and I2C multibus support in
u-boot for REV C.

The u-boot source is base lined from
http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=shortlog;h=for-khasim-rebase

Khasim, I had some challenge in applying the patch, but I believe it is
my process of copy-and-paste. I will try again later today.

Steve, will you rebase your omap3-dev or some other branch upon the
mainline? Currently there are merge conflicts and some of the mainline
code is better/newer than what you have on omap3-dev.

Sorry, but my understanding is that this isn't correct?
omap3-dev/omap3-dev-usb is the best/newest we have. What do you think
is better/newer in mainline than in omap3-dev/omap3-dev-usb? Maybe I
miss something.

Taking mainline and applying the 7 patches from [1] should result in
omap3-dev and mainline identical.

Dirk would like
to see patches against omap3-dev, rather than the mainline, so that they
have all of the OMAP3-specific latest stuff. That is fine, but I'd need
your tree to include the mainline versions of the OMAP3 patches, not the
old versions of the patches.

As already discussed yesterday I don't understand what you need from
mainline what isn't in omap3-dev? And I don't understand why you want
to work against mainline?

Sounds like it would help if you could give some pointers what is
better/newer in mainline than in omap3-dev. Then we could fix this in
omap3-dev.

Many thanks

Dirk

[1] http://lists.denx.de/pipermail/u-boot/2009-February/046641.html

Syed Mohammed, Khasim wrote:

Hi all,

I am hereby attaching the splash screen and I2C multibus support in u-boot for REV C.

Seems that patches in attachment are independent. But it might help if you give numbering to make clear in which order to apply patches next time.

The u-boot source is base lined from http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=shortlog;h=for-khasim-rebase

Kindly review and update me your findings for the same.

* splash-screen.patch (doesn't apply against omap3-dev):

- Are you sure that the various

*((unsigned short *)

don't need a volatile? Why don't you use writew() for this?

- Why do you remove copyright?

@@ -1,9 +1,5 @@
  /*
- * (C) Copyright 2009
- * Texas Instruments, <www.ti.com>
- *
- * Author :
- * Jason Kridner <jkridner@beagleboard.org>
+ * BeagleBoard splash screen

Syed Mohammed, Khasim wrote:
> Hi all,

> I am hereby attaching the splash screen and I2C multibus support in u-boot for REV C.

Seems that patches in attachment are independent. But it might help if
you give numbering to make clear in which order to apply patches next
time.

> The u-boot source is base lined from http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=shortlog;h=for-

Now that [1] is now based off of the patches accepted at [2], I'm now
comfortable generating patches off of [1]. I applied your I2C patch
to [3], but I left my logo. I applied a counter bug fix, which causes
it to work with my LG L1933-TR DVI-D monitor. I'll try with my HDTV
and Pico Projector when I get home.

I'll also generate patches to send to the list, but I had some problem
with the I2C:

OMAP3 beagleboard.org # ide 2
Setting bus to 2
OMAP3 beagleboard.org # imd 0x50 0 100
I2C read: I/O error
Error reading the chip.
.
.
.
Error reading the chip.
I2C read: I/O error

I'm not sure if this is due to my monitor or what. Perhaps this
misses some I2C fix?

[1] http://www.sakoman.net/cgi-bin/gitweb.cgi?p=u-boot-omap3.git;a=shortlog;h=refs/heads/omap3-dev
[2] http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git
[3] http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=shortlog;h=revc-validation-20090203d

> Kindly review and update me your findings for the same.

* splash-screen.patch (doesn't apply against omap3-dev):

- Are you sure that the various

*((unsigned short *)

don't need a volatile? Why don't you use writew() for this?

- Why do you remove copyright?

@@ -1,9 +1,5 @@
/*
- * (C) Copyright 2009
- * Texas Instruments, <www.ti.com>
- *
- * Author :
- * Jason Kridner <jkrid...@beagleboard.org>
+ * BeagleBoard splash screen
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -25,12481 +21,8824 @@

I've addressed these in the patch I will provide.

* i2c-multibus-support.patch (applies against omap3-dev):

- Changes are not clean:

Warning: trailing whitespace in line 1376 of common/cmd_i2c.c

Warning: trailing whitespace in lines 366,377,378 of
drivers/i2c/omap24xx_i2c.c

I fixed this in the patch before applying.

- This is unrelated to I2C changes:

+ "loadbootscript=fatload mmc 0 ${loadaddr} reset.scr\0" \

I fixed this in the patch before applying.

- Instead of adding these ugly wrapper macros

+#define i2c_readb(a) readb(i2c_base + (a))
+#define i2c_writeb(v,a) writeb((v), (i2c_base + (a)))
+#define i2c_readw(a) readw(i2c_base +(a))
+#define i2c_writew(v,a) writew((v), (i2c_base + (a)))

I'd like to propose to convert register access to struct style

typedef struct i2c {
unsigned int rev; /* 0x00 */
unsigned int ie; /* 0x04 */
....

} i2c_t;

In code you can do then

static i2c_t *i2c_base = (i2c_t *)I2C_DEFAULT_BASE;

int i2c_set_bus_num(unsigned int bus)
{

    if \(bus == 1\)
            i2c\_base = \(i2c\_t \*\)I2C\_BASE2;
    else
            i2c\_base = \(i2c\_t \*\)I2C\_BASE1;

    return 0;

}

and convert all readx/writex to stuct style:

- writew(0x2, I2C_SYSC);
+ writew(0x2, &i2c_base->sysc);

Wolfgang will be happy with this and you don't need the wrapper macros.

I have not yet made this change and will seek to do so.

I made those changes, as well as created patches with my other recommended changes for Rev C production u-boot in the attachments. The I2C code is giving me this error on my HDMI TV:

OMAP3 beagleboard.org # ide 2
Setting bus to 2
OMAP3 beagleboard.org # imd 0x50 0 10
timed out in wait_for_pin: I2C_STAT=1000
I2C read: I/O error
Error reading the chip.

Khasim, can you apply your patches to your branch on your git tree so that I can see the behavior and differences?

The gitweb at [1] shows my patch status. There is a build of this image at [2].

[1] http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=shortlog;h=revc-validation-20090203d
[2] http://www.beagleboard.org/~arago/u-boot-20090203d.bin

0001-OMAP3-BeagleBoard-Added-splash-screen-with-BeagleB.patch (137 KB)

0002-OMAP3-BeagleBoard-Redefined-default-u-boot-configu.patch (2.6 KB)

0003-OMAP3-BeagleBoard-Additional-build-to-ignore-envir.patch (4.3 KB)

0004-Add-I2C-multibus-support-for-OMAP2-3-boards.patch (13.9 KB)

Syed Mohammed, Khasim wrote:

Hi all,

I am hereby attaching the splash screen and I2C multibus support
in u-boot for REV C.

Seems that patches in attachment are independent. But it might help
if
you give numbering to make clear in which order to apply patches next
time.

The u-boot source is base lined from http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=shortlog;h=for-
...

Now that [1] is now based off of the patches accepted at [2], I'm now
comfortable generating patches off of [1]. I applied your I2C patch
to [3], but I left my logo. I applied a counter bug fix, which causes
it to work with my LG L1933-TR DVI-D monitor. I'll try with my HDTV
and Pico Projector when I get home.

I'll also generate patches to send to the list, but I had some problem
with the I2C:

OMAP3 beagleboard.org # ide 2
Setting bus to 2
OMAP3 beagleboard.org # imd 0x50 0 100
I2C read: I/O error
Error reading the chip.
.
.
.
Error reading the chip.
I2C read: I/O error

Some times I see this, but it will print the EDID again.
Can you try iprobe on BUS 0, it will show 4A 4B ....

I'm not sure if this is due to my monitor or what. Perhaps this
misses some I2C fix?

I dont think so.

Khasim, can you apply your patches to your branch on your git tree so
that I can see the behavior and differences?

I would like to wait till I get musb and power measurements done. Till
then I will use your tree as baseline and submit my patches (if I get
these working).

Regards,
Khasim

Syed Mohammed, Khasim wrote:

Hi all,

I am hereby attaching the splash screen and I2C multibus support
in u-boot for REV C.

Seems that patches in attachment are independent. But it might help
if
you give numbering to make clear in which order to apply patches
next
time.

The u-boot source is base lined from http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=shortlog;h=for-
...

Now that [1] is now based off of the patches accepted at [2], I'm
now
comfortable generating patches off of [1]. I applied your I2C patch
to [3], but I left my logo. I applied a counter bug fix, which
causes
it to work with my LG L1933-TR DVI-D monitor. I'll try with my HDTV
and Pico Projector when I get home.

I'll also generate patches to send to the list, but I had some
problem
with the I2C:

OMAP3 beagleboard.org # ide 2
Setting bus to 2
OMAP3 beagleboard.org # imd 0x50 0 100
I2C read: I/O error
Error reading the chip.
.
.
.
Error reading the chip.
I2C read: I/O error

Some times I see this, but it will print the EDID again.
Can you try iprobe on BUS 0, it will show 4A 4B ....

OMAP3 beagleboard.org # ide 0
Setting bus to 0
OMAP3 beagleboard.org # iprobe
Valid chip addresses: 48 49 4A 4B
OMAP3 beagleboard.org # ide 2
Setting bus to 2
OMAP3 beagleboard.org # iprobe
Valid chip addresses: 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11
12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28
29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56
57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D
6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F

Jason Kridner wrote:

I made those changes, as well as created patches with my other recommended changes for Rev C production u-boot in the attachments.

Hmm, anything wrong with the patches in attachment? Or anything wrong at my side?

Saving the attachments and opening them with text editor, I get something like

117=20+=0A=20board/omap3/beagle/logo.h=20=20=20|12505=20=
+++++++++++++++++++++++++++++++++++++++++++=0A=202=20files=20changed,=20=
12622=20insertions(+),=200=20deletions(-)=0A=20create=20mode=20100644=20=
board/omap3/beagle/logo.h=0A=0Adiff=20--git=20=
a/board/omap3/beagle/beagle.c=20b/board/omap3/beagle/beagle.c=0Aindex=20=
643d826..70ac1cb=20100644=0A---=20a/board/omap3/beagle/beagle.c=0A+++=20=
b/board/omap3/beagle/beagle.c=0A@@=20-35,6=20+35,7=20@@=0A=20#include=20=
<asm/arch/sys_prot

The gitweb at [1] shows my patch status. There is a build of this image at [2].

[1] http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=shortlog;h=revc-validation-20090203d

As patch is broken for me :wink: , is

http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=blobdiff;f=board/omap3/beagle/beagle.c;h=70ac1cbbf696905a715cb7f8a60dad49a7048ec1;hp=643d8260782047b2e65dda735d83149abdfc1ce5;hb=1f06d99341e5bf2a0e9a6b9ea512fad0477da758;hpb=9b2ce2517110405bef47eae6a1efcb88a4cb6730

the latest version of logo patch?

If yes, do you like to test if replacing

*((unsigned short *)(0x80500000 + i*2)) = ((((pixel[0])&0xf8) << 8) | (((pixel[1])&0xfc) << 3) | (((pixel[2])&0xf8) >> 3));

with

writew(((((pixel[0])&0xf8) << 8) | (((pixel[1])&0xfc) << 3) | (((pixel[2])&0xf8) >> 3)) , 0x80500000 + i*2);

does work?

Regards

Dirk

Btw: In last review, I forgot to mention that you most probably don't want to change main command file

http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=blobdiff;f=common/cmd_i2c.c;h=ea09296c73177628da31f8326fff78d92df2d16f;hp=16439ac489c4948fc833bd38e456eea8905f4be2;hb=52eddcd07c2e7ad61d15bab2cf2d0d21466eaca2;hpb=732893dff4759603c6773fe181ce0e46db55aeff

but instead implement a custom command like we did for nandecc

http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=blob;f=cpu/arm_cortexa8/omap3/board.c;h=7bb3e284b5ffb4c8ee0cde8b7e094fc57565e091;hb=revc-validation-20090203d#l316

Dirk,

I will incorporate your comments.

Regards,
Khasim

Jason Kridner wrote:

I made those changes, as well as created patches with my other
recommended changes for Rev C production u-boot in the attachments.

Hmm, anything wrong with the patches in attachment? Or anything wrong at my
side?

Saving the attachments and opening them with text editor, I get something
like

117=20+=0A=20board/omap3/beagle/logo.h=20=20=20|12505=20=
+++++++++++++++++++++++++++++++++++++++++++=0A=202=20files=20changed,=20=
12622=20insertions(+),=200=20deletions(-)=0A=20create=20mode=20100644=20=
board/omap3/beagle/logo.h=0A=0Adiff=20--git=20=
a/board/omap3/beagle/beagle.c=20b/board/omap3/beagle/beagle.c=0Aindex=20=
643d826..70ac1cb=20100644=0A---=20a/board/omap3/beagle/beagle.c=0A+++=20=
b/board/omap3/beagle/beagle.c=0A@@=20-35,6=20+35,7=20@@=0A=20#include=20=
<asm/arch/sys_prot

The gitweb at [1] shows my patch status. There is a build of this image
at [2].

[1]
http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=shortlog;h=revc-validation-20090203d

As patch is broken for me :wink: , is

http://www.beagleboard.org/gitweb/?p=u-boot-arm.git;a=blobdiff;f=board/omap3/beagle/beagle.c;h=70ac1cbbf696905a715cb7f8a60dad49a7048ec1;hp=643d8260782047b2e65dda735d83149abdfc1ce5;hb=1f06d99341e5bf2a0e9a6b9ea512fad0477da758;hpb=9b2ce2517110405bef47eae6a1efcb88a4cb6730

the latest version of logo patch?

If yes, do you like to test if replacing

*((unsigned short *)(0x80500000 + i*2)) = ((((pixel[0])&0xf8) << 8) |
(((pixel[1])&0xfc) << 3) | (((pixel[2])&0xf8) >> 3));

with

This doesn't work, but

writew(((((pixel[0])&0xf8) << 8) | (((pixel[1])&0xfc) << 3) |
(((pixel[2])&0xf8) >> 3)) , 0x80500000 + i*2);

The below one does.
writew(((((pixel[0])&0xf8) << 8) | (((pixel[1])&0xfc) << 3)
                        > (((pixel[2])&0xf8) >> 3)) , (0x80500000 + i
+ offset));

I am changing to writew.

Regards,
Khasim

I have two more things pending (Dirk's comments to be incorporated) in u-boot,

I2C command to be like nandecc. Not changing the command file
I2C base address switch with structures than the current one.

I think I have incorporated the other changes. I am holding on
choosing a final GIT tree for all these changes.

a) Sakoman's omap3-dev-usb - then I need to take few patches from jason's tree.
b) Jason's tree as baseline - then I need to fix USB tty on the same.

I will be out of work for a workshop at IIT kanpur, will be back on
this as soon as I get some time.

Along with these,

- We have to fix the hard reset issue (USB TTY doesn't after pressing
the reset button)

Thanks for the comments and suggestions so far.

Regards,
Khasim

Is there now a "final" patch to restore the splash screen in u-boot? The
patch from this thread does not apply correctly to any of the current
u-boots I've tried pulling from the most common trees. My application
requires both a splash screen and multibus i2c.

Also my scope on the I2C3_SCL line shows that it is toggling at 757kHz when
the i2c driver sets it for 100kHz. This result was on a Gumstix Overo. Has
anyone else checked the i2c clock lines with a scope and can tell me that
they are seeing the right frequencies?