Welcome! Log In Create A New Profile

Advanced

Can't excute "doimage"

Posted by DockstarPBX 
Can't excute "doimage"
October 08, 2010 12:40PM
I was able to download old u-boot source code and built u-boot to the last step but get the following error:

bash: ./doimage: cannot execute binary file

I have done "chmod +x doimage" and tried as user and root.

Does anyone know what does "doimage" do and if source code is available?

Thanks
Re: Can't excute "doimage"
October 08, 2010 01:38PM
Re: Can't excute "doimage"
October 08, 2010 03:53PM
That link is very helpful. It seems Jeff's "mkDockstar.mtd0" is outdated, "doimage" has been replaced by "mkimage".

Does anyone know how to use "mkimage" to replace the following in Jeff's "mkDockstar.mtd0"?

#####################################################
make u-boot.kwb

echo "Removing bad u-boot.kwb"
rm u-boot.kwb

echo "Creating u-boot.nand"
rm u-boot.nand
./doimage -T nand -D 0x600000 -E 0x600000 -P 2048 -R dramregs_pp128_A.txt u-boot.bin u-boot.nand

echo "Creating uboot.mtd0.kwb padded to 512k"
rm uboot.mtd0.kwb
dd if=u-boot.nand of=uboot.mtd0.kwb ibs=512K conv=sync

#####################################################
Re: Can't excute "doimage"
October 09, 2010 08:19PM
There are a couple other threads that talk about this, but I'll go ahead and put the details here.

With a proper board/Marvell/sheevaplug/kwimage.cfg file the doimage and dramregs_pp128_A.txt are not needed.

To make u-boot you just do the following steps.

make mrproper
make sheevaplug_config
make u-boot.kwb

The produced u-boot.kwb is good to go.

Some say it is better to pad it to 512k before writing it to nand so you can do:
perl -e 'for ($i=0;$i<512;$i++){printf("\xFF" x 1024)}' > /tmp/ff.512k
cat u-boot.kwb /tmp/ff.512k | dd of=u-boot.kwb.512k bs=1 count=512k

Now you have u-boot.kwb.512k which is just u-boot.kwb padded to 512k.

The only files I end up patching in the u-boot source are:

board/Marvell/sheevaplug/sheevaplug.c
board/Marvell/sheevaplug/kwimage.cfg
include/configs/sheevaplug.h
tools/env/fw_env.config

I believe all come from Jeffs patches except for kwimage.cfg which is below.
This is for the dockstar.


diff --git a/board/Marvell/sheevaplug/kwbimage.cfg b/board/Marvell/sheevaplug/kwbimage.cfg
index 3b9c53f..bacb9bc 100644
--- a/board/Marvell/sheevaplug/kwbimage.cfg
+++ b/board/Marvell/sheevaplug/kwbimage.cfg
@@ -74,11 +74,11 @@ DATA 0xFFD0140C 0x00000a33 # DDR Timing (High)
# bit12-11: TW2W
# bit31-13: zero required

-DATA 0xFFD01410 0x000000cc # DDR Address Control
-# bit1-0: 00, Cs0width=x8
+DATA 0xFFD01410 0x0000000d # DDR Address Control
+# bit1-0: 01, Cs0width=x8
# bit3-2: 11, Cs0size=1Gb
-# bit5-4: 00, Cs1width=x8
-# bit7-6: 11, Cs1size=1Gb
+# bit5-4: 00, Cs1width=nonexistent
+# bit7-6: 00, Cs1size =nonexistent
# bit9-8: 00, Cs2width=nonexistent
# bit11-10: 00, Cs2size =nonexistent
# bit13-12: 00, Cs3width=nonexistent
@@ -135,7 +135,7 @@ DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default
values)
DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values)

DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0
-DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size
+DATA 0xFFD01504 0x07FFFFF1 # CS[0]n Size
# bit0: 1, Window enabled
# bit1: 0, Write Protect disabled
# bit3-2: 00, CS0 hit selected
@@ -143,7 +143,7 @@ DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size
# bit31-24: 0x0F, Size (i.e. 256MB)

DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb
-DATA 0xFFD0150C 0x0FFFFFF5 # CS[1]n Size 256Mb Window enabled for CS1
+DATA 0xFFD0150C 0x00000000 # CS[1]n Size, window disabled

DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled
DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled



Edited 1 time(s). Last edit at 10/09/2010 08:22PM by ygator.
Re: Can't excute "doimage"
October 09, 2010 08:39PM
@DockstarPBX

./tools/mkimage -n ./board/Marvell/sheevaplug/kwbimage.cfg -T kwbimage -a 0x00600000 -e 0x00600000 -d u-boot.bin u-boot.kwb

mkimage only, tells you the parameter.
The kwbimage.cfg can be locatet at an other place. Modify it as discribed in the uboot.mtd0.patch.


But you are all right, I can build a mtd3 uboot and it's running. The mtd0 one starts not at 0x800200.
I made a work around and cut the 512 Byte from a running mt0 uboot and cat it with the running uboot.bin to a new file whitch I blow up to 512k with dd. That one starts at 0x800200, but after flashing the nand with this uboot, dockstar is dead and need resuscitation by JTAG.

I have build many u-boot versions and no one starts at 0x800200, but I know I have build a running one at first time.

Take a look here, they are working on a DockStar patch for u-boot.
http://www.mail-archive.com/u-boot@lists.denx.de/msg37505.html

@ygator

This is the header of Jeffs uboot.
I miss the 0xFFD01500 entry.
0000000: 8b00 0008 102e 0500 0000 0000 0002 0000  ................
0000010: 0000 6000 0000 6000 0000 0000 0000 0199  ..`...`.........
0000020: 4000 0000 0000 0000 0000 0000 0000 0000  @...............
0000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000040: e000 d1ff 9b1b 1b1b 0014 d0ff 300c 0043  ............0..C
0000050: 0414 d0ff 0030 5437 0814 d0ff 5154 1222  .....0T7....QT."
0000060: 0c14 d0ff 330a 0000 1014 d0ff 0d00 0000  ....3...........
0000070: 1414 d0ff 0000 0000 1814 d0ff 0000 0000  ................
0000080: 1c14 d0ff 520c 0000 2014 d0ff 4000 0000  ....R... ...@...
0000090: 2414 d0ff 7ff1 0000 2814 d0ff 2055 0800  $.......(... U..
00000a0: 7c14 d0ff 5285 0000 0415 d0ff f1ff ff07  |...R...........
00000b0: 0815 d0ff 0000 0010 0c15 d0ff 0000 0000  ................
00000c0: 1415 d0ff 0000 0000 1c15 d0ff 0000 0000  ................
00000d0: 9414 d0ff 0000 0300 9814 d0ff 0000 0000  ................
00000e0: 9c14 d0ff 03e8 0000 8014 d0ff 0100 0000  ................

___
Joc



Edited 3 time(s). Last edit at 10/09/2010 09:12PM by nevtag.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: