Next Previous Contents  

4.2 Porting Linux when target board booting is disable

4.2.1 Uploading ¡°vivi¡± by using JTAG

JTAG cable and Jflash program are needed to port by this method.
Jflash program and HOWTO_USE.txt written about usage of Jflash program are located under /linuette/target/box/Jflash directory.

# cd /linuette/target/box/Jflash

Because we will write vivi(bootloader) to SMC by Jflash program, copy Jflash program to image directory. When or Why JTAG is used are mentioned in chap 4. Refer it.

# cp ./Jflash-s3c2410 /image

Connect target board and host PC by JTAG. Check the size of SMC(flash memory), then supply power to target board. The capacity of SMC is written at backside of itself.

# ./Jflash-s3c2410 --help

+------------------------------------+
| SEC JTAG FLASH(SJF) v 0.11 +
| modified by MIZI 2002.7.13 +
+------------------------------------+
Usage: SJF <filename> /t=<flash_type> /d=<delay>
Flash Type List
1:SMDK2410:K9S3208 4MB
2:SMDK2410:K9S6408 8MB
3:SMDK2410:K9S2808 16MB
4:SMDK2410:K9S5608 32MB
5:SMDK2410:K9S1208 64MB
6:SMDK2410:AM29LV800BB

Also if you perform above command, you can know that it¡¯s needed different options when executing Jflash program according to the size of flash memory. MIZI-tool-box uses 64MB SMC, so we have to give ¡°/t=5¡± option.
Execute Jflash program with ¡°/t=5¡± option. If you uses different flash memory, option will be changed.

# ./Jflash-s3c2410 vivi /t=5

+------------------------------------+
| SEC JTAG FLASH(SJF) v 0.11 +
| modified by MIZI 2002.7.13 +
+------------------------------------+
> flashType=5
> S3C2410X(ID=0x0032409d) is detected.
> K9S1208 is detected. ID=0xec76

K9S1208 NAND Flash JTAG Programmer Ver 0.0
0:K9S1208 Program 1:K9S1208 Pr BlkPage 2: Exit

Select the function to test :0 : Input ¡°0¡±.

[SMC(K9S1208) NAND Flash Writing Program]

Source size: 0xe4af

Available target block number: 0~4095
Input target block number:0 : Input ¡°0¡±.
target start block number =0
target size (0x4000*n) =0x10000
STATUS:Epppppppppppppppppppppppppppppppp
Epppppppppppppppppppppppppppppppp
Epppppppppppppppppppppppppppppppp
Epppppppppppppppppppppppppppppppp

K9S1208 NAND Flash JTAG Programmer Ver 0.0
0:K9S1208 Program 1:K9S1208 Pr BlkPage 2: Exit

Select the function to test :2 :Quit by pushing ¡°2¡±.

Through above work, vivi is written to flash memory.

4.2.2 Porting images by using ¡°vivi¡±

Above all things vivi(bootloader) should be stored in SMC(flash memory), only so we can write vivi(bootloader), kernel image, root filesystem etc. to SMC on prompt mode of vivi(bootloader). Exactly, if bootloader doesn¡¯t exist in flash memory, we first write bootloader by JTAG.
We have uploaded vivi to SMC in above pages, so Now we will downloaded vivi(bootloader), kernel, Root filesystem etc. by xmodem of minicom.

Executing ¡°vivi¡± prompt mode

Execute minicom after connecting host to target board by serial cable.
Supply power to target board, in that case target board is waiting inputs during the times defined by developer. If we do not input anything or press ¡°Enter¡±, target board begins to boot. Instead, if you input ¡°space-bar¡± key, target board enters vivi prompt mode. The waiting time of target board is very short so press ¡°space-bar¡± quickly if you want to use target board console.

# minicom
Supply power to target board, then press ¡°space-bar¡± quickly.
vivi>

SMC Partitioning and Writing vivi image

If writing vivi on SMC is done successfully, you can boot(?) a little and use vivi prompt. In here, you can write all images including vivi again through vivi prompt.
But before writing the images, you have to do partitioning SMC to assign the memories.
SMC is composed of bon filesystem and vivi supports this. So you can make partitions through vivi prompt.
Make partitions by following command.

vivi> bon part 0 192k 1M

This command make three partitions which size are 0~192k, 192k~1M, and 1M~64M.

0~192k       : vivi will be written here.
192k~1M   : zImage(kernel) will be written here.
1M~64M    : root.cramfs(root filesystem) will be written here.

Above command does formatting SMC as well as partitioning it. So if you do next steps like writting kernel and root filesystem, you have to write vivi again.
Write vivi by following command.

vivi> load flash vivi x


Writing kernel image

# cd /image
# minicom
Supply power to target board, then press ¡°space-bar¡± quickly.

After sending ¡°load flash kernel x¡± command, press ¡°Ctrl+A¡± keys, and without delay press ¡°S¡± key. Window questioning about transfer mode will appear. In there, select xmodem.
Then terminal executing minicom will show the present location of host PC. Find the kernel image and select that by ¡°space-bar¡±. Pressing ¡°Enter¡±, transferring will starts.

vivi> load flash kernel x

Quickly press ¡°Ctrl + A¡± and ¡°S¡±, then select xmodem for transfer mode.

If you press ¡°space-bar¡± twice, directory changing happens and if you press ¡°space-bar¡± once, relevant data is selected.
Select zImage by pressing ¡°space-bar¡± one time.

Press ¡°Enter¡±, then transmission begins.

If ¡°transfer incomplete¡± message is appeared when writing images, the cause is that the timeout of xmodem_initial is too short. In this case, you can solve the problem by increasing the timeout of xmodem_initial.
First check the value of ¡°xmodem_initial_timeout¡± parameter. Then you think it is too short, extend timeout properly.

# param show
# param set xmodem_initial_timeout 1000000 : ¡°1000000¡± means 1 second because a unit is microsecond.
# param save

After setting like above, do writing images again.

Writing root image

Let's write root filesystem in SMC. The steps of this work are the same as those of above. But there is one caution.
vivi can't write the root image, which size is bigger than 1.2MB, on SMC. Because vivi is coded to use decided partition size of bon filesystem that is a kinds of layer for nand flash, although it controls all area of SMC. The decided size is approximately 1.2~1.3MB.
So, please use small size of root image when writing root filesystem on SMC. If you have finished this work well and rebooted target system, you can use the console of target system.

The detail steps of writing root image are listed as bellowing. Just follow.
Send ¡°load flash root x¡± command, then press ¡°Ctrl+A¡± keys, and ¡°S¡± key without delay. Window questioning about transfer mode will appear. In there, select xmodem.
Then terminal executing minicom will show the present location of host PC. Find the root image and select that by ¡°space-bar¡±. Pressing ¡°Enter¡±, transferring will starts.

vivi> load flash root x

Quickly press ¡°Ctrl + A¡± and ¡°S¡±, then select xmodem for transfer mode.

If you press ¡°space-bar¡± twice, directory changing happens and if you press ¡°space-bar¡± once, relevant data is selected.
Select root.cramfs by pressing ¡°space-bar¡± one time.

Press ¡°Enter¡±, then transmission begins.

If you want to use bigger size of root filesystem that includes usr applications(GUI), upload the root image such as root_english.cramfs to tmp directory of target system throuth ztelnet and then write it to SMC by using imagewrite utility.
The detail steps of it are explained in "4.1.3 imagewrite". Refer it.

Writing root image is devided into two parts because loading big root image through serial cable takes too long.


Next Previous Contents