• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1] 2
Author Topic: Cannot tftp-boot custom kernel, but only factory default kernel  (Read 12074 times)
tilman
Newbie
*

Karma: 0
Posts: 8


View Profile
« on: May 21, 2010, 05:40:07 PM »

Hi,
my goal is to eventually replace kernel and rootfs of my GuruPlug.

I started with what seemed to be the the easiest step: building a (not so) custom kernel.

So, I got the kernel sources from the GuruPlug download area at this site (http://plugcomputer.org/index.php/us/resources/downloads?func=fileinfo&id=75). Next I copied /proc/config.gz from the plug to my workstation and rebuilt the kernel:
$ make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnueabi- uImage

The resulting uImage should be the same as the same the GuruPlug was shipped with.

However, I cannot boot my build via tftp:

> setenv ipaddr 192.168.1.3
> setenv serverip 192.168.1.1
> setenv arcNumber 2659
    I got this from grepping GURUPLUG arch/arm/tools/mach-types
> setenv mainlineLinux yes
> tftpboot 0x2000000 uImage-mine
> setenv bootargs console=ttyS0,115200 root=dev/ram rw
> bootm 0x2000000

u-boot tells me:
Uncompressing kernel... done, booting kernel.

Afterwards I get no more output.

This posting (http://plugcomputer.org/plugforum/index.php?topic=1547.msg10065#msg10065) suggests that u-boot may be incompatible with mainline kernels, BUT:
* I grabbed the kernel code from this very website
* the patch from 2.6.33.2 to the kernel tree posted there doesn't show any diverging architecture numbers

The u-boot environment that the GuruPlug comes up doesn't contain the arcNumber setting.

Interestingly, the kernel tree posted here is not the same as the one that was used to build the uImage that GuruPlug is shipped with.
So extra question: where do I get the kernel tree that corresponds to the build on the plug?

Hints please? I guess I could try flashing u-boot, but I'd rather not Grin

(FWIW, the kernel config that was posted along with the kernel tree looks sane. I enabled the GuruPlug-specific setup code, there's serial drivers enabled etc.)

Thanks,
Tilman
Logged

tilman
Newbie
*

Karma: 0
Posts: 8


View Profile
« Reply #1 on: May 22, 2010, 06:37:12 AM »

From having another look at u-boot (the one the guruplug shipped with!), I got this:

Marvell>> bdinfo                                                               
arch_number = 0x00000A29
[...]                                              
Marvell>>

I guess that means that u-boot is expecting a kernel that was compiled for architecture 0xa29 (2601).
In the posted kernel tree (and in mainline now), the GuruPlug was assigned ID 2659.

Should this mismatched have been worked around by "setenv arcNumber 2659" before booting?

To hack around the problem, I edited include/generated/mach-types.h and swapped the entries for 2659 and 2601.
That gave me an uImage I can boot Smiley
Logged

heini
Newbie
*

Karma: 0
Posts: 8


View Profile
« Reply #2 on: May 22, 2010, 08:23:40 AM »

I'm facing the same problem just now. Here's my command sequence:

Code:
Marvell>> setenv serverip 192.168.1.1
Marvell>> setenv ipaddr 192.168.1.90
Marvell>>  tftp 0x6400000 /tftpboot/uImage
Using egiga0 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.90
Filename '/tftpboot/uImage'.
Load address: 0x6400000
Loading: #################################################################
         #################################################################
         #######################################
done
Bytes transferred = 2480660 (25da14 hex)
Marvell>> setenv bootargs console=ttyS0,115200 root=/dev/sda2 rootfstype=btrfs rootflags=subvol=root
Marvell>> bootm 0x6400000
## Booting kernel from Legacy Image at 06400000 ...
   Image Name:   Linux-2.6.33.2-dirty
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2480596 Bytes =  2.4 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Note that I have attached an external HD via eSata and formatted it with btrfs (hence the custom kernel, the preinstalled only has it compiled as module). That's also the reason for using root=/dev/sda2 (sda1 is swap).

Bye...

    Dirk
Logged

heini
Newbie
*

Karma: 0
Posts: 8


View Profile
« Reply #3 on: May 22, 2010, 08:29:05 AM »

Two things to add:

1) I didn't use a cross compiler, I compiled the kernel directly on the plug.
2) Just saw there's also another thread (only a couple of hours older) about this: http://plugcomputer.org/plugforum/index.php?topic=1669.0. Maybe we should switch to this one.

Bye...

    Dirk
Logged

tilman
Newbie
*

Karma: 0
Posts: 8


View Profile
« Reply #4 on: May 22, 2010, 02:46:54 PM »

Yeah, I wasn't sure whether my problem was the same as the one begin discussed in that other thread.
I agree that it probably is though Smiley
Logged

heini
Newbie
*

Karma: 0
Posts: 8


View Profile
« Reply #5 on: May 23, 2010, 02:47:31 AM »

Didn't really recognize this right away:

Quote
To hack around the problem, I edited include/generated/mach-types.h and swapped the entries for 2659 and 2601.
That gave me an uImage I can boot Smiley

This resulted in a booting kernel for me, too. So the question remains: Would upgrading U-Boot solve that problem?

Bye...

    Dirk
Logged

vthokie
Newbie
*

Karma: 0
Posts: 8


View Profile
« Reply #6 on: May 23, 2010, 08:01:30 AM »

Quote
To hack around the problem, I edited include/generated/mach-types.h and swapped the entries for 2659 and 2601.
That gave me an uImage I can boot Smiley

This resulted in a booting kernel for me, too. So the question remains: Would upgrading U-Boot solve that problem?


Yes, upgrading U-boot to the version here (http://www.plugcomputer.org/index.php/us/resources/downloads?func=select&id=15) or upgrading to a custom compiled version from the latest git repository will fix the problem.  The factory U-Boot and kernel apparently use the incorrect  architecture number.

Now if only I could access the sd card from u-boot.
Logged

doragasu
Newbie
*

Karma: 0
Posts: 34


View Profile
« Reply #7 on: June 09, 2010, 12:24:41 PM »

I have the same problem (hang after "Uncompressing Linux... Done, booting the kernel"). I have followed the wiki instructions to download, patch and compile the kernel without luck. Then I tried to update U-Boot with the one pointed in this thread. It continued refusing to boot. Next step, I tried compiling the kernel pointed in this thread, also without luck. I have also tried setting mainlineLinux and arcNumber, but nothing worked for me.

Any suggestions?
Logged

preaton
Newbie
*

Karma: 0
Posts: 7


View Profile
« Reply #8 on: June 09, 2010, 02:33:13 PM »

Use both the kernel and uboot from the download pages and it will work. - did for me and others anyway. Once working do the new kernel compile on the plug and there should be no issues. - takes a few hours  Smiley.
Logged

flipflip
Jr. Member
**

Karma: 4
Posts: 50


Hopplaschorsch!


View Profile
« Reply #9 on: June 09, 2010, 02:47:19 PM »

I built u-boot from the "u-boot-marvell.git" and a kernel (vanilla + guruplug patches) that work fine together. Both list the 2659 arch number for the guruplug. I'm not sure what "bdinfo" in u-boot said but I assume "0x00000a63". And I'm not sure if my u-boot would boot the shipped "2601-kernel". And I cannot check. The system is live (and doing fine..).

You can download the u-boot image and the kernel image from my page and try it: http://oinkzwurgl.org/guruplug

Btw, I'm not sure if setting mainlineLinux and arcNumber does anything on the Guruplug. At least I didn't find any reference to this in the u-boot and the kernel sources (didn't look very hard, though, just a "grep -ri mainlineLinux *").

Maybe there's a kernel boot parameter for setting the arch number or bypassing the check.

Happy hacking! ;-)
Logged

GPS+ Debian Squeeze AP router firewall dhcpd named NAS Squeezebox OpenVPN All running fine.

doragasu
Newbie
*

Karma: 0
Posts: 34


View Profile
« Reply #10 on: June 10, 2010, 12:37:08 AM »

Thanks for help.

flipflip, I'll try following the instructions in your web when I get some time to test, and I'll report the results. By the way, what is the right arcNumber (supposing it's needed to set it)? I set it to 2097. Should I set it to 2659?
Logged

doragasu
Newbie
*

Karma: 0
Posts: 34


View Profile
« Reply #11 on: June 10, 2010, 11:57:15 AM »

I'm out of luck. I almost followed flipflip instructions but the kernel continues hanging in the same point. This is my environment:
Code:
bootcmd=${x_bootcmd_usb}; ${x_bootcmd_kernel}; setenv bootargs ${x_bootargs} ${x
_bootargs_root}; bootm 0x6400000;                                               
bootdelay=3                                                                     
baudrate=115200                                                                 
x_bootcmd_usb=usb start                                                         
x_bootcmd_kernel=nand read.e 0x6400000 0x100000 0x400000                       
x_bootargs=console=ttyS0,115200                                                 
x_bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs                     
ethaddr=02:XX:XX:XX:XX:XX                                                       
ethact=egiga0                                                                   
eth1addr=02:50:43:df:7a:ca                                                     
serverip=192.168.1.10                                                           
ipaddr=192.168.1.23                                                             
mainlineLinux=yes                                                               
arcNumber=2659                                                                 
stdin=serial                                                                   
stdout=serial                                                                   
stderr=serial                                                                   
                                                                               
Environment size: 498/131068 bytes

I followed the steps to build U-Boot and flash it here, and my compiled U-Boot it's working.
Then I almost followed the steps here to build the kernel. Downloaded the kernel, patched it and then executed:
Code:
make guruplug_defconfig
make menuconfig
make uImage

I didn't exec the "make-kpkg kernel_image kernel_headers", because make-kpkg isn't installed in my system. Is this step necessary? I suppose it's only to create .deb packages, right? Also I think there's an errata in the instructions, I think the line "make guruplug_config" should be "make guruplug_defconfig".

The kernel was built, but it doesn't boot Sad. Could it be the cross-compiler? Where can I download the same version you're using? (I'm using the one automatically built by OpenEmbedded). What else can be?

Edit: There must be something wrong with my plug or with the process I follow. I have updated U-Boot with downloaded flipflip's version:
Code:
tftp 0x6400000 u-boot.kwb
nand erase 0x00000000 0x0100000
nand write 0x6400000 0x0000000 0x80000
reset

Then restored my environment and tested downloaded flipflip's kernel:
Code:
tftp 0x6400000 uImage
bootm 0x6400000

And the kernel continues hanging Sad
Code:
U-Boot 2010.03-01266-g42f7128-dirty (Mai 12 2010 - 13:28:48)                   
Marvell-GuruPlug (-: flipflip's version 20100512 :-)                           
                                                                               
SoC:   Kirkwood 88F6281_A0                                                     
DRAM:  512 MB                                                                   
NAND:  512 MiB                                                                 
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Net:   egiga0, egiga1                                                           
88E1121 Initialized on egiga0                                                   
88E1121 Initialized on egiga1                                                   
Hit any key to stop autoboot:  0                                               
GuruPlug>> printenv                                                             
bootcmd=${x_bootcmd_usb}; ${x_bootcmd_kernel}; setenv bootargs ${x_bootargs} ${x
_bootargs_root}; bootm 0x6400000;                                               
bootdelay=3                                                                     
baudrate=115200                                                                 
x_bootcmd_usb=usb start                                                         
x_bootcmd_kernel=nand read.e 0x6400000 0x100000 0x400000                       
x_bootargs=console=ttyS0,115200                                                 
x_bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs                     
ethaddr=02:50:43:e3:83:15                                                       
ethact=egiga0                                                                   
eth1addr=02:XX:XX:XX:XX:XX                                                     
serverip=192.168.1.10                                                           
ipaddr=192.168.1.23                                                             
mainlineLinux=yes                                                               
arcNumber=2659                                                                 
stdin=serial                                                                   
stdout=serial                                                                   
stderr=serial                                                                   
                                                                               
Environment size: 498/131068 bytes                                             
GuruPlug>> tftp 0x6400000 uImage                                               
Using egiga0 device                                                             
TFTP from server 192.168.1.10; our IP address is 192.168.1.23                   
Filename 'uImage'.                                                             
Load address: 0x6400000                                                         
Loading: #################################################################     
         #################################################################     
         #############################################                         
done                                                                           
Bytes transferred = 2561944 (271798 hex)                                       
GuruPlug>> bootm                                                               
## Booting kernel from Legacy Image at 06400000 ...                             
   Image Name:   Linux-2.6.33.3flipflip                                         
   Image Type:   ARM Linux Kernel Image (uncompressed)                         
   Data Size:    2561880 Bytes =  2.4 MB                                       
   Load Address: 00008000                                                       
   Entry Point:  00008000                                                       
   Verifying Checksum ... OK                                                   
   Loading Kernel Image ... OK                                                 
OK                                                                             
                                                                               
Starting kernel ...                                                             
                                                                               
Uncompressing Linux... done, booting the kernel.                               

I'm starting to hate the day I bought my plug Sad. I should have bought a Beagleboard...
« Last Edit: June 10, 2010, 02:12:30 PM by doragasu » Logged

doragasu
Newbie
*

Karma: 0
Posts: 34


View Profile
« Reply #12 on: June 12, 2010, 01:43:39 AM »

I finally got my compiled kernel to boot! I'm not sure what did the trick, but I was playing with U-Boot environment and finally it booted!

Thanks for help.
Logged

mabe42
Newbie
*

Karma: 0
Posts: 11


View Profile
« Reply #13 on: June 17, 2010, 11:46:50 PM »

Hi,

could you please post your (now working) environment?

Thanks,

Matthias.
Logged

doragasu
Newbie
*

Karma: 0
Posts: 34


View Profile
« Reply #14 on: June 27, 2010, 12:31:23 PM »

I moved my plug far from my working PC. When I get some time I'll bring it back, plug the JTAG and get the environment.
Logged

Pages: [1] 2
Print
Jump to: