[ELDK] reset command eventually produces "Bad Magic Number"
Detlev Zundel
dzu at denx.de
Thu Nov 25 09:44:13 CET 2010
Hi James,
> When I type reset in the xminicom command prompt the embedded planet
> restarts and begins displaying the U-Boot version and more information.
> Then it gets down to the 5 second count down of "Hit any key to stop
> autoboot:". When the 5 seconds runs out, more output is printed and
> eventually a "Bad Magic Number" is printed and the system automatically
> restarts. This continues until I choose to hit the return key during the
> 5 seconds and I get a "=>" prompt.
Stefano already told you that you should really upgrade U-Boot. Still
the error that you see can do with some more explanation.
[...]
> => tftpboot 0x300000 uImage
> Waiting for PHY auto negotiation to complete.... done
> ENET Speed is 1000 Mbps - FULL duplex connection
> Using ppc_4xx_eth0 device
> TFTP from server 172.16.2.101; our IP address is 172.16.2.102
> Filename 'uImage'.
> Load address: 0x300000
> Loading:
> #################################################################
>
> #################################################################
>
> #################################################################
>
> #################################################################
> ##########################################
> done
> Bytes transferred = 1544519 (179147 hex)
> => erase 0xFF000000 +0x179147
>
> ............ done
> Erased 12 sectors
> => cp.b 0x300000 0xFF000000 0x179147
> Copy to Flash... done
Ok, so we now have a kernel at 0xff000000.
> => <INTERRUPT>
> =>
> =>
> =>
> =>
> => tftpboot 0x300000 canyonlands.dtb
> ENET Speed is 1000 Mbps - FULL duplex connection
> Using ppc_4xx_eth0 device
> TFTP from server 172.16.2.101; our IP address is 172.16.2.102
> Filename 'canyonlands.dtb'.
> Load address: 0x300000
> Loading: ##
> done
> Bytes transferred = 10190 (27ce hex)
> => erase 0xFF2A0000 +0x27ce
>
> . done
> Erased 1 sectors
> => cp.b 0x300000 0xFF2A0000 0x27ce
> Copy to Flash... done
And now we have a dtb at 0xff2a0000. Note that the dtb is _not_ wrapped
with mkimage and will thus not be recognized by the 'imi' command.
> =>
>
> And the output of "printenv" produces
>
> => printenv
> bootdelay=5
> baudrate=115200
> loads_echo=1
> preboot=run setup_phys;echo;echo Type "run flash_nfs" to mount root
> filesystem over NFS;echo
> hostname=ep440xs
> nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath)
> ramargs=setenv bootargs ramdisk=65536 root=/dev/ram rw
> addip=setenv bootargs $(bootargs)
> ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):$(netdev):o
> ff panic=1
> addtty=setenv bootargs $(bootargs) console=ttyS0,$(baudrate)
> flash_nfs=run nfsargs addip addtty;bootm $(kernel_addr)
> flash_self=run ramargs addip addtty;bootm $(kernel_addr) $(ramdisk_addr)
> net_nfs=tftp 200000 $(bootfile);run nfsargs addip addtty;bootm
> rootpath=/opt/eldk/ppc_4xx
> bootfile=/ep440xs/uImage
> kernel_addr=fe000000
> ramdisk_addr=fe180000
> load=tftp 0x200000 u-boot.bin
> update=protect off 0xfff60000 0xffffffff;era 0xfffa0000 0xffffffff;cp.b
> 0x200000 fffa0000 60000
> upd=run load;run update
> usbact=hostdev
> fixedip=setenv bootargs $(bootargs)
> ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):$(netdev):o
> ff panic=1
> dhcp=setenv bootargs $(bootargs) ip=dhcp
> initphy=mii w ${phy} 14 e3;mii w ${phy} 18 4101;mii w ${phy} 9 e00;mii w
> ${phy} 4 1e1;mii w ${phy} 0 9140;mii w ${phy} 0 1140
> setup_phys=setenv phy 0;run initphy;setenv phy 1;run initphy;setenv phy
> progee=mw 0x100000 0x87788252;mw 0x100004 0x0957a030;mw 0x100008
> 0x40082350;mw 0x10000c 0x0d050000;eeprom write 0x54 0x100000 0x0 0x10
> diags=cp.b 0xFFF40000 0x40000 0x20000;go 0x40004
> serial#=70274
> ethaddr=00:10:ec:01:12:82
> eth1addr=00:10:ec:81:12:82
> netdev=eth0
> bootargs=acpi=off noapic nolapic noacpi console=ttyS0,115200
> root=/dev/ram rw ramdisk=19000
> ramdisk_file=canyonlands/uRamdisk
> ethact=ppc_4xx_eth0
> bootcmd=bootm FF000000 - FF2A0000
Ok and this syntax is the problem. Try a 'help bootm' in your U-Boot
and you will realize that the three argument version is not supported in
that old U-Boot. So what this command will do is actually parse the
second argument as a number and use the result 0 as a ramdisk. Of
course at 0 there is no uRamdisk so this results in the error.
> stdin=serial
> stdout=serial
> stderr=serial
> ver=U-Boot 1.1.6 (Aug 25 2010 - 16:37:50)
> filesize=27ce
> fileaddr=300000
> ipaddr=172.16.2.102
> serverip=172.16.2.101
>
> Environment size: 1865/8187 bytes
> =>
>
>
>
>
>
> U-Boot 1.1.6 (Aug 25 2010 - 16:37:50)
>
> CPU: AMCC PowerPC 440EPx Rev. A at 533.333 MHz (PLB=133, OPB=66,
> EBC=66 MHz)
> Security/Kasumi support
> I2C boot EEPROM enabled
> Bootstrap Option G - Boot ROM Location I2C (Addr 0x54)
> 32 kB I-Cache 32 kB D-Cache
> Board: Embedded Planet EP440xS, serial# 70274
> I2C: ready
> DRAM: 256 MB
> FLASH: 64 MB
> NAND: 512 MiB
> In: serial
> Out: serial
> Err: serial
> USB: Host(int phy) Device(ext phy)
> Net: ppc_4xx_eth0, ppc_4xx_eth1
>
> Type run flash_nfs to mount root filesystem over NFS
>
> Hit any key to stop autoboot: 0
> ## Booting image at ff000000 ...
> Image Name: Linux-2.6.37-rc1
> Created: 2010-11-23 14:54:10 UTC
> Image Type: PowerPC Linux Kernel Image (gzip compressed)
> Data Size: 1551046 Bytes = 1.5 MB
> Load Address: 00000000
> Entry Point: 00000000
> Verifying Checksum ... OK
> Uncompressing Kernel Image ... OK
> ## Loading RAMDisk Image at 00000000 ...
> Bad Magic Number
Ok and now we understand why it checks for a ramdisk at 0 :)
Cheers
Detlev
--
The difference between men and boys is the price of their toys.
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
More information about the eldk
mailing list