Welcome! Log In Create A New Profile

Advanced

uboot patch/source mismatch

Posted by DockstarPBX 
uboot patch/source mismatch
October 08, 2010 06:05AM
I tried to follow Jeff's link http://jeff.doozan.com/debian/uboot/build_uboot.htm to build uboot from source, but patch failed for "makefile" in "/tools/env".

After adding "-static" to "makefile", I got many SDRM related errors.

Has anyone tried to build uboot recently?

Does anyone know how to roll back to old source code?
Re: uboot patch/source mismatch
October 08, 2010 06:20AM
You should find the old sources here: http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=shortlog

grab the tarball (link is labeled snapshot) or use git
Re: uboot patch/source mismatch
October 08, 2010 10:06AM
Thanks.

I found "u-boot-a59e27997637a2395ae2cc7f809127f24119a167.tar.gz" (06/2010).

It seems to me download "tarball" is most preferable to avoid source/patch mismatch.

Also tarballs seem much faster to download.

I don't think I'm going to use git or snv to download source again.



Edited 1 time(s). Last edit at 10/08/2010 10:09AM by DockstarPBX.
Re: uboot patch/source mismatch
October 09, 2010 07:59PM
@DockstarPBX,

Yes, I tried to compile u-boot source from Oct 5 and it does not compile.

It looks to be that some source files are trying to be compiled without having CONFIG_SYS_ARM_WITHOUT_RELOC defined.
Re: uboot patch/source mismatch
October 09, 2010 10:17PM
I have rolled back to 2010.06 source code and built "doimage" from Pogoplug uboot source code to build "uboot.mtd0.kwb".
However, the "uboot.mtd0.kwb" failed to boot from SDRAM. The patch from Jeff's link may not be the one Jeff used to build his recent mtd0 uboot.
Re: uboot patch/source mismatch
October 10, 2010 05:48PM
@ygator
I downloaded latest u-boot, patched it with my patch and take your build steps. When I set TEXT_BASE to 0x00c00000 it's running on dockstar at 0x800200.
They made changes to relocation, you can read more here.
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/86083

___
Joc
Re: uboot patch/source mismatch
October 10, 2010 06:24PM
nevtag Wrote:
-------------------------------------------------------
> @ygator
> I downloaded latest u-boot, patched it with my
> patch and take your build steps. When I set
> TEXT_BASE to 0x00c00000 it's running on dockstar
> at 0x800200.
> They made changes to relocation, you can read more
> here.
> http://comments.gmane.org/gmane.comp.boot-loaders.
> u-boot/86083

nevtag and ygator,

Your posts on building mtd0 u-boot are very helpful and I'm trying to catch up. Currently I'm following your steps to build u-boot on Dockstar and found it's more convenient than build u-boot using cross compiler on Debian on VirtualBox.

I'll read the link about your patches for new u-boot source code. I got only few hours each day for Dockstar, but I'll try to catch up.

Thanks



Edited 1 time(s). Last edit at 10/10/2010 06:37PM by DockstarPBX.
Re: uboot patch/source mismatch
October 11, 2010 12:40PM
@nevtag

I am not sure how you are getting it to compile.
I just git the latest uboot and did not patch anything.
I did a:
make mrproper
make sheevaplug_config
make u-boot.kwb

It did not compile. It blew up trying to compile arch/arm/lib/board.c.
So the original source does not even clean compile.

I use the git command Jeff posted in compiling u-boot.
git clone git://git.denx.de/u-boot.git u-boot
ecc
Re: uboot patch/source mismatch
October 12, 2010 05:20PM
ygator Wrote:
-------------------------------------------------------
> I just git the latest uboot and did not patch anything.
> [...]
> It did not compile. It blew up trying to compile arch/arm/lib/board.c.
> So the original source does not even clean compile.
>
> I use the git command Jeff posted in compiling u-boot.
> git clone git://git.denx.de/u-boot.git u-boot

The master branch of the u-boot tree has "moved on" since then, and now has a bunch of ARM-related changes that cause the Marvell boards not to compile (yet).

If you go back to the current stable release you should have better luck applying the patches and compiling:
git co v2010.09
Re: uboot patch/source mismatch
October 15, 2010 06:42PM
nevtag Wrote:
-------------------------------------------------------
> @ygator
> I downloaded latest u-boot, patched it with my
> patch and take your build steps. When I set
> TEXT_BASE to 0x00c00000 it's running on dockstar
> at 0x800200.
> They made changes to relocation, you can read more
> here.
> http://comments.gmane.org/gmane.comp.boot-loaders.
> u-boot/86083

After changing "mkDockstar.mtd0"
from "sed -i 's/^TEXT_BASE = 0x00.00000/TEXT_BASE = 0x00600000/' board/Marvell/sheevaplug/config.mk"
to "sed -i 's/^TEXT_BASE = 0x00.00000/TEXT_BASE = 0x00c00000/' board/Marvell/sheevaplug/config.mk"

I was able to build mtd0 uboot from 2010.06 source, tested it on SDRAM and flashed it to NAND.

I'm not sure why Jeff set TEXT_BASE to 0x00600000 in his patches and mkDockstar.mtd0.



Edited 1 time(s). Last edit at 10/16/2010 05:18PM by DockstarPBX.
Re: uboot patch/source mismatch
October 16, 2010 10:08AM
@ygator

You need to add this to include/configs/sheevaplug.h

/* additions for new ARM relocation support */
#define CONFIG_SYS_SDRAM_BASE           0x00000000
/* Kirkwood has 2k of Security SRAM, use it for SP */
#define CONFIG_SYS_INIT_SP_ADDR         0xC8012000

___
Joc
Re: uboot patch/source mismatch
October 16, 2010 05:17PM
nevtag Wrote:
-------------------------------------------------------
> @ygator
>
> You need to add this to
> include/configs/sheevaplug.h
>
>
> /* additions for new ARM relocation support */
> #define CONFIG_SYS_SDRAM_BASE
> 0x00000000
> /* Kirkwood has 2k of Security SRAM, use it for SP
> */
> #define CONFIG_SYS_INIT_SP_ADDR
> 0xC8012000
>

I downloaded 2010.09 release u-boot tarball, applied all Jeff's patches (including the patch to set TEXT_BASE to 0xc00000) and your above changes, I was able to build "u-boot.mtd0.kwb", but it hang at:

go 0x800200
## Starting application at 0x00800200 ...
Re: uboot patch/source mismatch
October 16, 2010 07:25PM
tar -xzf u-boot-2010.09.tar.gz
cd u-boot
patch -p1 < 2010.09-LED-SDIO.patch
chmod +x build
codesourcery-arm-2009q3.sh
./build

Result
Preparing kirkwood boot image to boot from nand
Nand ECC mode = default
Nand page size = 0x800
Image Type:   Kirkwood Boot from NAND Flash Image
Data Size:    343448 Bytes = 335.40 kB = 0.33 MB
Load Address: 00c00000
Entry Point:  00c00000

et voilĂ 

Marvell>>
Marvell>> setenv serverip 10.255.0.5
Marvell>> setenv ipaddr 10.255.0.160
Marvell>> tftp 0x800000 u-boot.kwb.512k
Using egiga0 device
TFTP from server 10.255.0.5; our IP address is 10.255.0.160
Filename 'u-boot.kwb.512k'.
Load address: 0x800000
Loading: ####################################
done
Bytes transferred = 524288 (80000 hex)
Marvell>> go 0x800200
## Starting application at 0x00800200 ...


U-Boot 2010.09 (Oct 17 2010 - 01:47:11)
Marvell-Sheevaplug - SD/MMC

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0

If you load u-boot to RAM, u-boot uses the environment in mtd0.
If you dont want this, disable nand environment, but enable it if you write u-boot to flash, otherwise you couldn't change the env parameters.

File include/configs/sheevaplug.h
/*
 *  Environment variables configurations
 */
#ifdef CONFIG_CMD_NAND
#define CONFIG_ENV_IS_IN_NAND           0
#define CONFIG_ENV_IS_NOWHERE           1       /* if env in SDRAM */
#define CONFIG_ENV_SECT_SIZE            0x20000 /* 128K */
#else
#define CONFIG_ENV_IS_NOWHERE           1       /* if env in SDRAM */
#endif

___
Joc



Edited 1 time(s). Last edit at 10/16/2010 07:37PM by nevtag.
Attachments:
open | download - 2010.09-LED-SDIO.patch (52.1 KB)
Re: uboot patch/source mismatch
October 17, 2010 03:18PM
nevtag Wrote:
-------------------------------------------------------
> > tar -xzf u-boot-2010.09.tar.gz
> cd u-boot
> patch -p1 < 2010.09-LED-SDIO.patch
> chmod +x build
> codesourcery-arm-2009q3.sh
> ./build
>

I was able to apply you patch to 2010.09 source with a single error on "/tools/env/Makefile": I added "-static" manually.
I was able to run "uboot.mtd0.kwb" from 0x800200 using Jtag or from 2nd stage u-boot but it not from mtd0 u-boot.
Re: uboot patch/source mismatch
October 17, 2010 04:37PM
If you flash it too mtd0, check out if 0x00600000 for TEXT_BASE works.
I have the feedback that the u-boot works on mtd0.

___
Joc
Re: uboot patch/source mismatch
October 17, 2010 08:06PM
nevtag Wrote:
-------------------------------------------------------
> If you flash it too mtd0, check out if 0x00600000
> for TEXT_BASE works.
> I have the feedback that the u-boot works on mtd0.

Either 0x00600000 or 0x00c00000 for TEXT_BASE worked.

I did a search of "TEXT_BASE", it didn't seem "TEXT_BASE" was used for "Marvell" or "sheevaplug" in uboot source code.
ecc
Re: uboot patch/source mismatch
October 17, 2010 08:47PM
DockstarPBX Wrote:
-------------------------------------------------------
> I did a search of "TEXT_BASE", it didn't seem "TEXT_BASE" was used for "Marvell" or "sheevaplug"
> in uboot source code.

See arch/arm/cpu/arm926ejs/start.S and Makefile.
Re: uboot patch/source mismatch
October 17, 2010 09:32PM
ecc Wrote:
-------------------------------------------------------
> DockstarPBX Wrote:
> --------------------------------------------------
> -----
> > I did a search of "TEXT_BASE", it didn't seem
> "TEXT_BASE" was used for "Marvell" or
> "sheevaplug"
> > in uboot source code.
>
> See arch/arm/cpu/arm926ejs/start.S and Makefile.


I did search on Windows, it missed "start.S" for some reasons. Comment in "start.S" says:

*
* do important init only if we don't start from memory!
*
Is the "TEXT_BASE" used when u-boot is loaded to and executed from SDRAM "Destination address" and "Execution address" in u-boot headers?

u-boot header:

filename = c:\Dockstar\uboot-original-mtd0.kwb
Boot from NAND
Default ECC
Page size = 2048 Bytes
Image size = 470268 Bytes
Source address = 0x00000200
Destination address = 0x00600000
Execution address = 0x00670000



Edited 1 time(s). Last edit at 10/17/2010 09:32PM by DockstarPBX.
Re: uboot patch/source mismatch
October 20, 2010 07:25PM
I found when "TEXT_BASE" of mtd0 uboot was 0x600000, uboot was only relocated to 0x600000, when "TEXT_BASE" of mtd0 uboot was 0xc00000, uboot was relocated to 0x600000 and 0xc00000.

I believe mtd0 uboot can't be loaded to SDRAM and run from SDRAM by another mtd0 uboot because they are relocated to the same SDRAM address 0x600000. To test mtd0 uboot in SDRAM, it should be loaded using Jtag or from a mtd3 uboot with different relocate address (0xc00000).
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: