2010年3月2日 星期二

Update Kernel Image

Update Kenel Image on Mini2440

Startup Requirement

You need to have a working installed bootloader in the target system, set the switch to NAND BOOT and reset the board into the command prompt.

This update will override the old kernel image.

This also assume that you have a compiled kernel in a directory called tftpboot and managed to configure the host computer as a tftp server.


Refresh Kernel

First check the size of the uImage file.

ls -l /var/lib/tftpboot/uImage
-rw-r--r-- 1 root root 2053160 2010-03-02 22:51 uImage

Verify the table information, we need the size and offset of the kernel partition.

MINI2440 # mtdparts

device nand0 , # parts = 4                            
#: name size offset mask_flags
0: u-boot 0x00040000 0x00000000 0
1: env 0x00020000 0x00040000 0
2: kernel 0x00500000 0x00060000 0
3: root 0x07aa0000 0x00560000 0

active partition: nand0,0 - (u-boot) 0x00040000 @ 0x00000000

defaults:
mtdids : nand0=mini2440-nand
mtdparts:

The output shows that kernel is at the third block and start at 0x00060000 offset address with size of 500000.

Clean up the kernel partition.

MINI2440 # nand erase 60000 500000

NAND erase: device 0 offset 0x60000, size 0x500000                   
Erasing at 0x540000 -- 100% complete.
OK

Download image into the specify location, make sure you have start up the tftp server.

MINI2440 # tftp 32000000 uImage

dm9000 i/o: 0x20000300, id: 0x90000a46                               
DM9000: running in 16 bit mode
MAC: 08:00:2f:00:00:02
TFTP from server 192.168.114.181; our IP address is 192.168.114.190
Filename 'uImage'.
Load address: 0x3200000
Loading: T T #################################################################
#################################################################
##########
done
Bytes transferred = 2053160 (1f5428 hex)
Write image to the kernel partition, if there is a write problem you may have to refresh the NAND from scratch.

MINI2440 # nand write.e 32000000 60000 ${filesize}

NAND write: device 0 offset 0x60000, size 0x1f5428                   

Writing data at 0x255000 -- 100% complete.
2053160 bytes written: OK

Verify the number of bytes written is correct (2053160 in this example).

At last, set the boot command to load from the kernel block and save all the settings.

MINI2440 # setenv bootcmd 'nboot.e kernel;bootm'
MINI2440 # saveenv


Reboot the device to run the new update version.

MINI2440 # reset

You will see the bootloader starting up the kernel image and it will stop running at the system initialization stage because we have not yet build a root filesystem.

U-Boot 1.3.2-mini2440 (Feb 26 2010 - 17:34:45)                        

I2C: ready
DRAM: 64 MB
Flash: 2 MB
NAND: 128 MiB
Found Environment offset in OOB..
USB: S3C2410 USB Deviced
In: serial
Out: serial
Err: serial
MAC: 08:00:2f:00:00:02
Hit any key to stop autoboot: 0

Loading from NAND 128MiB 3,3V 8-bit, offset 0x60000
Image Name:
Created: 2010-03-02 14:51:28 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2053096 Bytes = 2 MB
Load Address: 30008000
Entry Point: 30008000
## Booting kernel from Legacy Image at 32000000 ...
Image Name:
Created: 2010-03-02 14:51:28 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2053096 Bytes = 2 MB
Load Address: 30008000
Entry Point: 30008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux.............................................................
Linux version 2.6.32.7 (root@gmax.localdomain) (gcc version 4.4.1 (Sourcery G++0
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: MINI2440

沒有留言:

張貼留言