• Home
  • Help
  • Search
  • Login
  • Register
Pages: 1 [2] 3
Author Topic: Choosing uboot/uImage for Guru Server  (Read 9453 times)
crunch
Newbie
*

Karma: 0
Posts: 28


View Profile
« Reply #15 on: March 26, 2011, 12:05:04 AM »

@pingtoo - I wouldn't say "comfortable", but I should be able to do minimal tasks in openocd. I spent some time with openocd when I was having trouble with the guruplug installer. I was able to boot the device through openocd and telnet in. I didn't get gdb working, but it seemed doable. I did need a recent version of openocd to do this. I installed the Debian 6 package, which worked, and also got a version from http://developer.berlios.de/projects/openocd when I was testing. Somewhere I picked up some docs on the tool, which I can upload if people are interested.

@newitjames - thanks for the guide, that should be helpful for setting up imaging from USB storage. It looks like the kernel and rootfs images are the same ones I've been working with. I'll try to flash them again as a test.

I may be down for a day or two, my box appears to have a failing hard drive...
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #16 on: March 30, 2011, 08:04:30 PM »

Hi crunch, hope you are still working on this problem. anyway I have something for you to test. a u-boot at 2010-12 with a lots of options enabled, a linxe kernel-2.6.32-r7-unionfs, a initramfs of my custom build and a simple u-boot environment setup image file.

you will needd to use openocd to load uboot to memeory and place kernel,initrams and envsrc.uimg to the tftp server following my instruction we shold be good to go.

1. load u-boot, at command prompt: openocd -f /path/to/board/guruplug.cfg -s /path/to/board/..
Quote
   # I am using guruplug -installer directory structure. lets say your guruplug-installer is
   # at /tmp/guruplug-installer/, under /tmp/guruplug-install there should be a "openocd" dir
   # so for example you can, cd /tmp/guruplug-install,
   # openocd -f ./board/guruplug.cfg -s ./openocd.
2, on second windows do
Code:
telnet localhost 4444
3. at prompt do,    ######### you should have third window ready connect to /dev/ttyUSB0
Code:
guruplug_init
load_image /path/to/where/you/save/u-boot.bin 0x600000 #You must use full path.
resume 0x600000
4. at the window that connect to ttyUSB0, interrupt autoboot.
Code:
U-Boot 2010.12-dirty (Mar 28 2011 - 18:39:13)
Marvell-GuruPlug

SoC:   Kirkwood 88F6281_A1
DRAM:  512 MiB
NAND:  512 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0 [PRIME], egiga1
88E1121 Initialized on egiga0
88E1121 Initialized on egiga1
Hit any key to stop autoboot:  0
5. At the third windows with Marvell>> we need to setup for network transfer, so if you have dhcp environment handy then you can simply run "dhcp" this will setup "ipaddr" and "serverip" hopefully,
6 or you can manually setup network,
Code:
Marvell>> setenv ipaddr xxx.xxx.xxx.xxx(your plug ip address)
Marvell>> setenv serverip xxx.xxx.xxx.xxx(your tftp server address)
7 now first load the u-boot environment variables image file,
Code:
Marvell>> tftp 0x800000 /path/to/envsrc.uImg
Marvell>> imi 0x800000

## Checking Image at 00800000 ...
   Legacy image found
   Image Name:   u-boot env
   Image Type:   ARM U-Boot Script (uncompressed)
   Data Size:    647 Bytes = 647 Bytes
   Load Address: 00000000
   Entry Point:  00000000
   Contents:
      Image 0: 639 Bytes = 639 Bytes
   Verifying Checksum ... OK

Marvell>> env default -f
Marvell>> source 0x800000
8. the envsrc.uImg setup some assumuption for location of kernel and initramfs file. so if they don't match your setup you can change by
Code:
Marvell>> setenv tftpinitrdfile /path/to/guru-initramfs.uImg
Marvell>> setenv tftpkernelfile /path/to/guru-uImage
9. if you are sure the "tftpinitrdfile" and "tftpkernelfile" are correct match you setup then we are read to load them to memory,
Code:
Marvell>> run tftp_load_ki
10. after load successful we verify that we have good images in memory by,
Code:
Marvell>> imi ${k}
## Checking Image at 02000000 ...
   Legacy image found
   Image Name:   Linux-2.6.32-gentoo-r7
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1222036 Bytes = 1.2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK

Marvell>> imi ${i}
## Checking Image at 01100000 ...
   Legacy image found
   Image Name:   Guruplug initramfs 20100529
   Image Type:   ARM Linux RAMDisk Image (lzma compressed)
   Data Size:    2820877 Bytes = 2.7 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

11. if everything looks ok, we are ready to boot, if you have a UBI based rootfs and your rootfs volumne is "rootfs" then you can try to run
Code:
Marvell>> run bootmki_ubi
or else you can boot into initramfs by
Code:
Marvell>> run bootmki_interactive
12. if everything went will, you should see all the normal kernel boot up messages. if not then post what ever happen and we will work from there.

Good luck :-)

* u-boot.bin (382.42 KB - downloaded 89 times.)
* envsrc.uImg (0.71 KB - downloaded 84 times.)
* guru-initramfs.uImg (2754.83 KB - downloaded 86 times.)
* guru-uImage (1193.46 KB - downloaded 83 times.)
Logged

Good Luck Smiley

crunch
Newbie
*

Karma: 0
Posts: 28


View Profile
« Reply #17 on: March 31, 2011, 03:34:25 PM »

I will try this tonight and report back here. Thanks for your hard work putting this together.
Logged

crunch
Newbie
*

Karma: 0
Posts: 28


View Profile
« Reply #18 on: April 01, 2011, 06:02:22 AM »

I got an error from guruplug_init (I got these last time I ran openocd also, could be the timeout value is set wrong?):
Code:
> guruplug_init
Halt timed out, wake up GDB.
timed out while waiting for target halted
Runtime Error: ./board/guruplug.cfg:24:
in procedure 'guruplug_init'
in procedure 'wait_halt' called at file "./board/guruplug.cfg", line 24
I tried to load_image after this but got "target not halted" (either because wait_halt failed or because I have default uboot set up on the device), so I went for:
Code:
> reset halt
JTAG tap: feroceon.cpu tap/device found: 0x20a023d3 (mfg: 0x1e9, part: 0x0a02, ver: 0x2)
Unexpected idcode after end of chain: 64 0x0000007f
Unexpected idcode after end of chain: 224 0x0000007f
double-check your JTAG setup (interface, speed, missing TAPs, ...)
Trying to use configured scan chain anyway...
Bypassing JTAG setup events due to errors
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x000000d3 pc: 0xffff0000
MMU: disabled, D-Cache: disabled, I-Cache: disabled

This seemed somewhat encouraging so I tried guruplug_init again:
Code:
> guruplug_init                                       
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x400000d3 pc: 0xffffffe8
MMU: enabled, D-Cache: enabled, I-Cache: enabled
Runtime Error: ./board/guruplug.cfg:26: arm926ejs cp15 0 0 1 0 0x00052078: command requires more arguments
in procedure 'guruplug_init'
in procedure 'arm926ejs' called at file "./board/guruplug.cfg", line 26
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x400000d3 pc: 0xffff0dfc
MMU: enabled, D-Cache: enabled, I-Cache: enabled

I forged ahead since I have a feeling this could be an openocd bug (I tried arm926ejs with a bunch of arguments and none, it always returns this error)... I ran into these errors when I tried to load_image:

Code:
> load_image /home/rich/pingtoo/u-boot.bin 0x600000 bin
timeout waiting for SYSCOMP & DBGACK, last DBG_STATUS: 0
in procedure 'load_image'

Since that didn't seem to be working, I tried fast_load_image (with "bin" argument for hoots):
Code:
> fast_load_image /home/rich/pingtoo/u-boot.bin 0x600000 bin
391596 bytes written at address 0x00600000
Loaded 391596 bytes in 0.001213s (315266.250 KiB/s)
WARNING: image has not been loaded to target!You can issue a 'fast_load' to finish loading.
> fast_load
Write to 0x00600000, length 0x0005f9ac
target not halted

Which left me stumped after:
Code:
> resume 0x600000
target not halted
in procedure 'resume'

If I do "reset halt" before "resume 0x600000", there are no errors, but the device is not accessible via the console. I assume this is because "reset halt" clears the memory of the device?  Perhaps what I need is the proper halt command since "halt" and "wait_halt" are not working?
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #19 on: April 01, 2011, 06:59:05 AM »

If guruplug_init did not work then the rest will not work.

you will need to go back to the openocd windows to see if openocd can get successfully sync, some where in the openocd message must have this line
Quote
"Info : JTAG tap: feroceon.cpu tap/device found: 0x20a023d3 (mfg: 0x1e9, part: 0x0a02, ver: 0x2)"
the important part "found: 0x20a023d3" or something similar. only you got that message then you can proceed to the other window do the rest.

One more thing, do not flash the uboot.bin to NAND, it is not bootable, I want to make sure we got a working version before burn it in.

Good luck Smiley
Logged

Good Luck Smiley

crunch
Newbie
*

Karma: 0
Posts: 28


View Profile
« Reply #20 on: April 01, 2011, 12:41:18 PM »

I did in fact get "JTAG tap: feroceon.cpu tap/device found: 0x20a023d3 (mfg: 0x1e9, part: 0x0a02, ver: 0x2)" , but only after I did "reset halt", since guruplug_init fails after "wait_halt". I got around the first failure in guruplug_init by replacing "halt 0" with "reset halt" (though I am not sure this does the same thing).

I also got: "unexpected Feroceon EICE version signature" when the command "feroceon.cpu arp_examine" is run. I got around this by replacing the command with "feroceon.cpu arp_halt" (again, not sure if this does the same thing).

I suspect that the config files in the guruplug installer are not quite right for my hardware. On the other hand, I did sucessfully flash uboot with these config files. Right now I have the openplug.org uboot image loading by default.

my next problem in guruplug_init is this error:
Code:
Runtime Error: ./board/guruplug.cfg:27: arm926ejs cp15 0 0 1 0 0x00052078: command requires more arguments

I looked at the openocd source code (http://openocd.berlios.de/doc/doxygen/html/arm926ejs_8c_source.html) but was unable to figure it out... Perhaps tonight I'll try using an svn version of openocd.
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #21 on: April 01, 2011, 12:45:30 PM »

I am so dumb Sad, I should let you know you can tftp the u-boot.bin as well. no need to use openocd. just make sure you load it in to 0x600000.

I think my openocd is v0.3 or something there about.

Good luck Smiley
Logged

Good Luck Smiley

crunch
Newbie
*

Karma: 0
Posts: 28


View Profile
« Reply #22 on: April 04, 2011, 10:55:17 AM »

Good point. I thought that perhaps it's not possible to load uboot once you've booted a different version. Anyway, I tried it, and for some reason tftp is freezing if I load it to 0x600000:

Code:
Marvell>> tftpboot 0x600000 u-boot.bin
Using egiga0 device
TFTP from server 10.10.1.3; our IP address is 10.10.1.4
Filename 'u-boot.bin'.
Load address: 0x600000
Loading: #

The file is definitely there, and I can load it into 0x800000. I tried "nand erase" on those blocks but it didn't help. "resume" doesn't work from the uboot shell, so I tried "source", but that gave me "wrong image format for command". Any ideas?
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #23 on: April 04, 2011, 11:17:17 AM »

Sorry, once you load it, ue the "go" command. as in
Code:
go 0x60000
Logged

Good Luck Smiley

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #24 on: April 04, 2011, 11:25:38 AM »

hum, I just realize you said you load it in 0x80000, this will not work, it have to be at 0x600000. Th code was compile to that specific address.

I have one time run in to this tftp freeze problem because the cpu cache was wrong. so check you u-boot with "help" command, does it have "icache" and/or "dcache" command? if it have them run the commands without and argument, one should be "off" and the other should be "on". as which should be "on/off" I need to go home to check on my plug.

Good luck Smiley
« Last Edit: April 04, 2011, 11:28:43 AM by pingtoo » Logged

Good Luck Smiley

crunch
Newbie
*

Karma: 0
Posts: 28


View Profile
« Reply #25 on: April 04, 2011, 12:07:24 PM »

Hmm no icache or dcache commands are available. My uboot version is 2009.11-rc1-00602-gff67d57 (Feb 08 2010 - 03:53:16) . I've tried the tftp command a few times in case it was a fluke, always the same symptom. If I dump the memory at 0x600000 it's not empty, though I'm not sure what would be loading there. It looks like my plug is looking to 0x800000 by default for a kernel or whatever it loads. For example if I tftp the file without an address it defaults to 0x800000.  Any chance you could recompile uboot to load from 0x800000? 
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #26 on: April 04, 2011, 03:36:05 PM »

OK, this version load at 0x800000.

To verify, md5sum for u-boot.bin is
Code:
94d521fda4bd905831b8e292ac93049b  u-boot.bin

In your u-boot prompt do
Code:
Marvell>> mw 0x800000 0 0x60000
Marvell>> tftp 0x800000 /path/to/u-boot.bin
Marvell>> crc32 0x800000 0x60000
CRC32 for 00800000 ... 0085ffff ==> 7ae0f097
Marvell>> md 0x844688
00844688: 6f422d55 3220746f 2e313130 702d3330    U-Boot 2011.03-p
00844698: 74676e69 742d6f6f 2d747365 28203176    ingtoo-test-v1 (
008446a8: 20727041 32203430 20313130 3831202d    Apr 04 2011 - 18
008446b8: 3a35313a 0a293735 7672614d 2d6c6c65    :15:57).Marvell-
008446c8: 75727547 67756c50 00000000 00847910    GuruPlug.....y..
Marvell>>
Marvell>> go 0x800000
## Starting application at 0x00800000 ...


U-Boot 2011.03-pingtoo-test-v1 (Apr 04 2011 - 18:15:57)
Marvell-GuruPlug

SoC:   Kirkwood 88F6281_A1
DRAM:  512 MiB
NAND:  512 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0 [PRIME], egiga1
88E1121 Initialized on egiga0
88E1121 Initialized on egiga1
Hit any key to stop autoboot:  0

* u-boot.bin (370.68 KB - downloaded 79 times.)
Logged

Good Luck Smiley

crunch
Newbie
*

Karma: 0
Posts: 28


View Profile
« Reply #27 on: April 04, 2011, 08:59:08 PM »

Beautiful - I am booting a kernel for the first time in 3 weeks!  Looks like the kernel modules aren't all found so the ubi image can't load,  perhaps I've filled up the usual address space with uboot and the environment?

Code:
modprobe: module 'orion_nand' not found
modprobe: module 'mtdchar' not found
modprobe: module 'ubi' not found
UBI device number 0, total 4055 LEBs (523192320 bytes, 499.0 MiB), available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)
modprobe: module 'ubifs' not found
mounting ubi0:rootfs on /0
mount: mounting ubi0:rootfs on /0 failed: Invalid argument
searching LABEL=PINGTOOSUP
searching LABEL=XCLIENTS
searching LABEL=VNCSERVER
searching LABEL=MEDIA01
searching LABEL=MEDIA02
searching LABEL=MEDIA03
searching LABEL=APP01
searching LABEL=APP02
searching LABEL=APP03
searching LABEL=PINGTOODAT
mounting ramdisk on /0
 not found on the specified root fs

Fail to start init, using busybox/init to start a

interactive session.

...

Please press Enter to activate this console.
~ # uname -a
Linux (none) 2.6.32-gentoo-r7 #2 Tue May 25 22:26:03 EDT 2010 armv5tel unknown


I may try flashing your kernel image to see if I can regularly boot from NAND. Or perhaps I'll go for broke and flash a more recent uboot on the device. Pingtoo, I am still happy to do more testing with your uboot versions. BTW nice union-root filesystem!
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #28 on: April 05, 2011, 05:54:38 AM »

Please wait, the u-boot.bin is not bootable. the address is wrong.

You can get source code and compile you self or I can upload a new one after I got home.

Good luck Smiley
Logged

Good Luck Smiley

crunch
Newbie
*

Karma: 0
Posts: 28


View Profile
« Reply #29 on: April 05, 2011, 09:01:03 PM »

I see what you mean, it's compiled to execute from 0x800000. I can use the flipflip version from the forums here if people agree that is a safe bet - I don't have many requirements for my bootloader, other than I wouldn't mind being able to boot USB or SD. And, I'm fine with testing some builds since it's increasing my knowledge of this subject.

Looks like I have to set up ELDK on my Linux box to compile uboot? Or perhaps I could use another plug to compile... I'd like to say I can do this, but I have a feeling it might be hours of work...
Logged

Pages: 1 [2] 3
Print
Jump to: