Skip to contentSkip to conversation

Barebox working on freescale-mx25-3-stack?

DISCUSSION Matthias Kaehlcke 4 participants 13 messages Mar 23, 2010 – Mar 24, 2010

lore
Share & tools
lore
#0 lore raw

hi,

i'm trying to run barebox on a Freescale i.MX25 3-Stack board. for this purpose i built barebox with the freescale-mx25-3-stack defconfig, using the toolchain provided by the Freescale BSP (i also tried it with a custom one). i then dumped the barebox.bin on a MMC card, plugged the card into the socket of the board and switched the board on, but nothing happened :(

booting u-boot or redboot from MMC succeeds, so the settings of SW21 and SW22 shouldn't be the problem

is barebox supposed to work on this board or is the port still in preliminary state?

best regards

Signature · 15 lines
Matthias Kaehlcke
Embedded Linux Developer
Barcelona

            Nothing is more despicable than respect based on fear
                              (Albert Camus)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

Hi Matthias,

Quoted 7 lines · Matthias Kaehlcke

i'm trying to run barebox on a Freescale i.MX25 3-Stack board. for this purpose i built barebox with the freescale-mx25-3-stack defconfig, using the toolchain provided by the Freescale BSP (i also tried it with a custom one). i then dumped the barebox.bin on a MMC card, plugged the card into the socket of the board and switched the board on, but nothing happened :(

Quoted 6 lines

booting u-boot or redboot from MMC succeeds, so the settings of SW21 and SW22 shouldn't be the problem

is barebox supposed to work on this board or is the port still in preliminary state?

you can check the patch I sent last friday, it works fine on our i.MX25 board for NAND boot (MMC boot not tested yet). I'll post an updated version of the patch in a few days as per Sascha's comments + a few tuning in the env.

Eric

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#2 lore raw
In reply to Matthias Kaehlcke

Hi Matthias,

Quoted 8 lines · Matthias Kaehlcke

hi,

i'm trying to run barebox on a Freescale i.MX25 3-Stack board. for this purpose i built barebox with the freescale-mx25-3-stack defconfig, using the toolchain provided by the Freescale BSP (i also tried it with a custom one). i then dumped the barebox.bin on a MMC card, plugged the card into the socket of the board and switched the board on, but nothing happened :(

I just checked, it works, but not with the current defconfig. Please enable CONFIG_ARCH_IMX_INTERNAL_BOOT to boot from MMC. Note that currently the CPLD is not initialised in barebox and so the FEC is not working (It is working if barebox runs as a second stage loader after Freescales redboot).

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

hi sascha,

El Tue, Mar 23, 2010 at 03:26:43PM +0100 Sascha Hauer ha dit:

Quoted 10 lines · Matthias Kaehlcke
Quoted 8 lines

hi,

i'm trying to run barebox on a Freescale i.MX25 3-Stack board. for this purpose i built barebox with the freescale-mx25-3-stack defconfig, using the toolchain provided by the Freescale BSP (i also tried it with a custom one). i then dumped the barebox.bin on a MMC card, plugged the card into the socket of the board and switched the board on, but nothing happened :(

Quoted 5 lines

I just checked, it works, but not with the current defconfig. Please enable CONFIG_ARCH_IMX_INTERNAL_BOOT to boot from MMC. Note that currently the CPLD is not initialised in barebox and so the FEC is not working (It is working if barebox runs as a second stage loader after Freescales redboot).

thanks for checking and for your reply

i enabled CONFIG_ARCH_IMX_INTERNAL_BOOT, but it doesn't work either. i also tried to start barebox from NAND, but no way :(

the barebox version is v2010.03.0, i forgot to mention that in my initial post

if you can send me the barebox image that works on your board i'll check if it works on mine, and we'll have some more certainty about whether there is some obscure problem in my build process or my board is somehow different to yours

Signature · 15 lines
Matthias Kaehlcke
Embedded Linux Developer
Barcelona

          Dreams and reality are opposites. Action synthesizes them
                             (Assata Shakur)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

Hi Matthias,

Quoted 5 lines · Matthias Kaehlcke

if you can send me the barebox image that works on your board i'll check if it works on mine, and we'll have some more certainty about whether there is some obscure problem in my build process or my board is somehow different to yours

one possible diff : do you have DDR2 or Mobile DDR on your board ?

Eric

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#5 lore raw

Hi Eric,

El Tue, Mar 23, 2010 at 04:31:11PM +0100 Eric Bénard ha dit:

Quoted 7 lines · Matthias Kaehlcke
Quoted 5 lines

if you can send me the barebox image that works on your board i'll check if it works on mine, and we'll have some more certainty about whether there is some obscure problem in my build process or my board is somehow different to yours

one possible diff : do you have DDR2 or Mobile DDR on your board ?

according to the board documentation it's DDR2

is this what barebox expects to find?

Signature · 15 lines
Matthias Kaehlcke
Embedded Linux Developer
Barcelona

      Debugging is like alien abduction. Large blocks of time disappear,
                    for which you have no explanation
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

Hi Matthias,

Quoted 8 lines · Matthias Kaehlcke

El Tue, Mar 23, 2010 at 04:31:11PM +0100 Eric Bénard ha dit:

Quoted 6 lines · Matthias Kaehlcke
Quoted 5 lines

if you can send me the barebox image that works on your board i'll check if it works on mine, and we'll have some more certainty about whether there is some obscure problem in my build process or my board is somehow different to yours

Quoted 6 lines
Quoted 1 line

one possible diff : do you have DDR2 or Mobile DDR on your board ?

according to the board documentation it's DDR2

is this what barebox expects to find?

for the 3stack yes (but I think there may be some 3stack with mDDR as both init sequence are in redboot for example). If you try my patch, it's for mDDR.

Eric

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#7 lore raw
In reply to Matthias Kaehlcke
Quoted 4 lines · Matthias Kaehlcke

according to the board documentation it's DDR2

is this what barebox expects to find?

I have an IMX25PDK with DDR2 memory (Samsung K4T51163QE-ZCE6).

To boot barebox from an SD card, I had to apply the following patch to the current HEAD (ce2411432e23b5cc313c92278b2320bf1547c002):

(quoted diff) +0 -0

b/board/freescale-mx25-3-stack/3stack.c
index 5590e55..d1f0fdc 100644

board/freescale-mx25-3-stack/3stack.c +19 -11
@@ -48,17 +48,25 @@ struct imx_dcd_entry __dcd_entry_0x400 dcd_entry[] = {
 	{ .ptr_type = 4, .addr = 0xb8002050, .val = 0x0000d843, },
 	{ .ptr_type = 4, .addr = 0xb8002054, .val = 0x22252521, },
 	{ .ptr_type = 4, .addr = 0xb8002058, .val = 0x22220a00, },
-	{ .ptr_type = 4, .addr = 0xb8001010, .val = 0x00000004, },
-	{ .ptr_type = 4, .addr = 0xb8001000, .val = 0x92100000, },
-	{ .ptr_type = 1, .addr = 0x80000400, .val = 0x21, },
-	{ .ptr_type = 4, .addr = 0xb8001000, .val = 0xa2100000, },
-	{ .ptr_type = 4, .addr = 0x80000000, .val = 0x12344321, },
-	{ .ptr_type = 4, .addr = 0x80000000, .val = 0x12344321, },
-	{ .ptr_type = 4, .addr = 0xb8001000, .val = 0xb2100000, },
-	{ .ptr_type = 1, .addr = 0x80000033, .val = 0xda, },
-	{ .ptr_type = 1, .addr = 0x81000000, .val = 0xff, },
-	{ .ptr_type = 4, .addr = 0xb8001000, .val = 0x82216880, },
-	{ .ptr_type = 4, .addr = 0xb8001004, .val = 0x00295729, },
+	{ .ptr_type = 4, .addr = 0xb8001004, .val = 0x0076e83a, },
+	{ .ptr_type = 4, .addr = 0xb8001010, .val = 0x00000304, },
+	{ .ptr_type = 4, .addr = 0xb8001000, .val = 0x92210000, },
+	{ .ptr_type = 4, .addr = 0x80000f00, .val = 0x12344321, },
+	{ .ptr_type = 4, .addr = 0xb8001000, .val = 0xb2210000, },
+	{ .ptr_type = 1, .addr = 0x82000000, .val = 0xda, },
+	{ .ptr_type = 1, .addr = 0x83000000, .val = 0xda, },
+	{ .ptr_type = 1, .addr = 0x81000400, .val = 0xda, },
+	{ .ptr_type = 1, .addr = 0x80000333, .val = 0xda, },
+	{ .ptr_type = 4, .addr = 0xb8001000, .val = 0x92210000, },
+	{ .ptr_type = 4, .addr = 0x80000400, .val = 0x12344321, },
+	{ .ptr_type = 4, .addr = 0xb8001000, .val = 0xa2210000, },
+	{ .ptr_type = 4, .addr = 0x80000000, .val = 0x87654321, },
+	{ .ptr_type = 4, .addr = 0x80000000, .val = 0x87654321, },
+	{ .ptr_type = 4, .addr = 0xb8001000, .val = 0xb2210000, },
+	{ .ptr_type = 1, .addr = 0x80000233, .val = 0xda, },
+	{ .ptr_type = 1, .addr = 0x81000780, .val = 0xda, },
+	{ .ptr_type = 1, .addr = 0x81000400, .val = 0xda, },
+	{ .ptr_type = 4, .addr = 0xb8001000, .val = 0x82216080, },
 	{ .ptr_type = 4, .addr = 0x53f80008, .val = 0x20034000, },
 };
 

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#8 lore raw

Hi Ivo,

El Wed, Mar 24, 2010 at 03:54:21PM +0100 Ivo Clarysse ha dit:

Quoted 11 lines
Quoted 4 lines · Matthias Kaehlcke

according to the board documentation it's DDR2

is this what barebox expects to find?

I have an IMX25PDK with DDR2 memory (Samsung K4T51163QE-ZCE6).

To boot barebox from an SD card, I had to apply the following patch to the current HEAD (ce2411432e23b5cc313c92278b2320bf1547c002):

after applying your patch barebox effectivly came up :)

thanks a lot!

could you explain in few words why the patch is needed?

Signature · 15 lines
Matthias Kaehlcke
Embedded Linux Developer
Barcelona

              We build too many walls and not enough bridges
                             (Isaac Newton)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#9 lore raw
Quoted 6 lines · Matthias Kaehlcke

after applying your patch barebox effectivly came up :)

thanks a lot!

could you explain in few words why the patch is needed?

RAM initialization is implemented in two places: lowlevel_init.S and the "Device Configuration Data" (DCD) block.

When booting from an SD card, the i.MX25 reads out the DCD block and applies the settings found there.

The RAM initialization in lowlevel_init.S is skipped when booting from SD; by the time board_init_lowlevel gets executed,
that routine is already running from RAM, and will skip initializing memory.

The DCD table in barebox git contains entries for mDDR memory. This does not work with DDR2 memory.

Probably barebox needs a compile-time option to switch between 128 MiB mDDR memory installed on older MCIMX25PDK CPU engine boards and the 64 MiB DDR2 memory found on newer boards.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#10 lore raw

hi ivo,

El Wed, Mar 24, 2010 at 04:23:33PM +0100 Ivo Clarysse ha dit:

Quoted 19 lines
Quoted 6 lines · Matthias Kaehlcke

after applying your patch barebox effectivly came up :)

thanks a lot!

could you explain in few words why the patch is needed?

RAM initialization is implemented in two places: lowlevel_init.S and the "Device Configuration Data" (DCD) block.

When booting from an SD card, the i.MX25 reads out the DCD block and applies the settings found there.

The RAM initialization in lowlevel_init.S is skipped when booting from SD; by the time board_init_lowlevel gets executed,
that routine is already running from RAM, and will skip initializing memory.

Quoted 6 lines

The DCD table in barebox git contains entries for mDDR memory. This does not work with DDR2 memory.

Probably barebox needs a compile-time option to switch between 128 MiB mDDR memory installed on older MCIMX25PDK CPU engine boards and the 64 MiB DDR2 memory found on newer boards.

thanks a lot for your explication!

i wasn't aware that differently equipped CPU engine boards exists, good to know

best regards

Signature · 15 lines
Matthias Kaehlcke
Embedded Linux Developer
Barcelona

    Me lo contaron y lo olvidé, lo vi y lo entendí, lo hice y lo aprendí
                              (Confucio)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#11 lore raw
In reply to Matthias Kaehlcke
Quoted 25 lines · Matthias Kaehlcke

hi sascha,

El Tue, Mar 23, 2010 at 03:26:43PM +0100 Sascha Hauer ha dit:

Quoted 10 lines · Matthias Kaehlcke
Quoted 8 lines

hi,

i'm trying to run barebox on a Freescale i.MX25 3-Stack board. for this purpose i built barebox with the freescale-mx25-3-stack defconfig, using the toolchain provided by the Freescale BSP (i also tried it with a custom one). i then dumped the barebox.bin on a MMC card, plugged the card into the socket of the board and switched the board on, but nothing happened :(

Quoted 5 lines

I just checked, it works, but not with the current defconfig. Please enable CONFIG_ARCH_IMX_INTERNAL_BOOT to boot from MMC. Note that currently the CPLD is not initialised in barebox and so the FEC is not working (It is working if barebox runs as a second stage loader after Freescales redboot).

thanks for checking and for your reply

i enabled CONFIG_ARCH_IMX_INTERNAL_BOOT, but it doesn't work either. i also tried to start barebox from NAND, but no way :(

Quoted 7 lines

the barebox version is v2010.03.0, i forgot to mention that in my initial post

if you can send me the barebox image that works on your board i'll check if it works on mine, and we'll have some more certainty about whether there is some obscure problem in my build process or my board is somehow different to yours

I sent the image to you in private. Here are my dip switch settings, I don't know which of them are important:

On the baseboard:
sw22: 00000000
sw21: 11000000

On the Debug board:

sw5 .. SW10: 0

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#12 lore raw

El Tue, Mar 23, 2010 at 04:31:48PM +0100 Sascha Hauer ha dit:

Quoted 16 lines · Matthias Kaehlcke
Quoted 11 lines

i enabled CONFIG_ARCH_IMX_INTERNAL_BOOT, but it doesn't work either. i also tried to start barebox from NAND, but no way :(

the barebox version is v2010.03.0, i forgot to mention that in my initial post

if you can send me the barebox image that works on your board i'll check if it works on mine, and we'll have some more certainty about whether there is some obscure problem in my build process or my board is somehow different to yours

I sent the image to you in private. Here are my dip switch settings, I don't know which of them are important:

Quoted 7 lines

On the baseboard:
sw22: 00000000
sw21: 11000000

On the Debug board:

sw5 .. SW10: 0

thanks for the image and your dip switch settings (mine are the same)

i flashed the image (first at MMC then at NAND), the board still doesn't come up :(

i'm running out of ideas at this point. there must be some difference in our hardware, as it clearly works on your board but not on mine

for the moment i'll stick with u-boot ...

thanks for your help

Signature · 15 lines
Matthias Kaehlcke
Embedded Linux Developer
Barcelona

  Si deseas mantener tu libertad, debes estar preparado para defenderla
                          (Richard Stallman)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox