Author Topic: C3200 Boot Process  (Read 6031 times)

Skaarj

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • http://necrovision.ru
C3200 Boot Process
« on: September 11, 2011, 08:24:37 am »
Hi. I'm very interesting how zaurus boots up.
What does happen when power is applied?
There is no information about internal flash in PXA270 datasheet. So where is maintenance menu (and rescue mode) code located? What does handle special key pressing?
Unfortunately, I haven't found any really useful information.

utx

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • http://www.penguin.cz/~utx/zaurus/
C3200 Boot Process
« Reply #1 on: September 11, 2011, 10:43:07 am »
Quote from: Skaarj
Hi. I'm very interesting how zaurus boots up.
What does happen when power is applied?
There is no information about internal flash in PXA270 datasheet. So where is maintenance menu (and rescue mode) code located? What does handle special key pressing?
Unfortunately, I haven't found any really useful information.

It jumps somewhere to the PROM and runs bootloader (or ROM menu). In the standard mode, it loads NAND bootloader (or NAND menu). NAND bootloader processes records in the dedicated NAND area, sets the hardware, creates kernel arguments and runs one of the kernels in the dedicated areas. Then it continues with a standard Linux boot depending on the image in the flash.

At least one code is processed by the PROM code (ROM diag), most of the rest by rthe NAND code.

Skaarj

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • http://necrovision.ru
C3200 Boot Process
« Reply #2 on: September 12, 2011, 08:50:46 am »
Quote from: utx
It jumps somewhere to the PROM and runs bootloader (or ROM menu). In the standard mode, it loads NAND bootloader (or NAND menu). NAND bootloader processes records in the dedicated NAND area, sets the hardware, creates kernel arguments and runs one of the kernels in the dedicated areas. Then it continues with a standard Linux boot depending on the image in the flash.
Thank you. Is it possible to obtain detailed information about this process somewhere?

utx

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • http://www.penguin.cz/~utx/zaurus/
C3200 Boot Process
« Reply #3 on: September 12, 2011, 10:39:24 am »
Quote from: Skaarj
Thank you. Is it possible to obtain detailed information about this process somewhere?

There is a list of known keys somewhere in this forum as well as partially decoded NAND map, but both loaders are (probably) undocumented proprietary applications. It seems that both loaders are very similar (if not the same).

Skaarj

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • http://necrovision.ru
C3200 Boot Process
« Reply #4 on: September 13, 2011, 10:50:41 am »
I've tried to make a little investigation
Code: [Select]
# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 006b0000 00020000 "Boot PROM Filesystem"
mtd1: 00700000 00020000 "Logical"
mtd2: 07900000 00020000 "JFFS2"
mtd2 contains jffs2 filesystem. After mounting /dev/mtdblock2 I've got opt/native/arm/3.4.6-xscale-sftvfp directory with system files (bin, include etc)
After dumping mtd1 and analyzing strings, I've found that it's UBoot.
One interesting string:
Quote
bootargs=console=ttyS0,115200 console=tty1 root=/dev/ram rw fbcon=rotate:1 ramdisk_size=8192
bootcmd=if testkey 101 ; then nand read.logical 0xa1000000 0x00060000 0x00540000; setenv bootargs console=ttyS0,115200 console=tty1 root=/dev/ram rw fbcon=rotate:1 ramdisk_size=8192; bootm; fi; if testkey 2 ; then nand read.logical 0xa1000000 0x005a0000 0x00160000; setenv bootargs console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p1 fbcon=rotate:1; bootm; fi; if testkey 18 ; then nand read.logical 0xa1000000 0x005a0000 0x00160000; setenv bootargs console=ttyS0,115200 console=tty1 root=/dev/hda1 fbcon=rotate:1; bootm; fi; if testkey 3 ; then nand read.logical 0xa1000000 0x005a0000 0x00160000; setenv bootargs console=ttyS0,115200 console=tty1 root=/dev/hdc1 fbcon=rotate:1; bootm; fi; nand read.logical 0xa1000000 0x005a0000 0x00160000; setenv bootargs console=ttyS0,115200 console=tty1 root=/dev/mtdblock2 rootfstype=jffs2 fbcon=rotate:1; bootm;

dmesg says that mtd0 is sharpsl flash and mtd1 and mtd2 are sharpsl nand

What is sharpsl flash?

utx

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • http://www.penguin.cz/~utx/zaurus/
C3200 Boot Process
« Reply #5 on: October 02, 2011, 05:03:11 pm »
Quote from: Skaarj
I've tried to make a little investigation
Code: [Select]
# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 006b0000 00020000 "Boot PROM Filesystem"
mtd1: 00700000 00020000 "Logical"
mtd2: 07900000 00020000 "JFFS2"
mtd2 contains jffs2 filesystem. After mounting /dev/mtdblock2 I've got opt/native/arm/3.4.6-xscale-sftvfp directory with system files (bin, include etc)
After dumping mtd1 and analyzing strings, I've found that it's UBoot.
One interesting string:
Quote
bootargs=console=ttyS0,115200 console=tty1 root=/dev/ram rw fbcon=rotate:1 ramdisk_size=8192
bootcmd=if testkey 101 ; then nand read.logical 0xa1000000 0x00060000 0x00540000; setenv bootargs console=ttyS0,115200 console=tty1 root=/dev/ram rw fbcon=rotate:1 ramdisk_size=8192; bootm; fi; if testkey 2 ; then nand read.logical 0xa1000000 0x005a0000 0x00160000; setenv bootargs console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p1 fbcon=rotate:1; bootm; fi; if testkey 18 ; then nand read.logical 0xa1000000 0x005a0000 0x00160000; setenv bootargs console=ttyS0,115200 console=tty1 root=/dev/hda1 fbcon=rotate:1; bootm; fi; if testkey 3 ; then nand read.logical 0xa1000000 0x005a0000 0x00160000; setenv bootargs console=ttyS0,115200 console=tty1 root=/dev/hdc1 fbcon=rotate:1; bootm; fi; nand read.logical 0xa1000000 0x005a0000 0x00160000; setenv bootargs console=ttyS0,115200 console=tty1 root=/dev/mtdblock2 rootfstype=jffs2 fbcon=rotate:1; bootm;

dmesg says that mtd0 is sharpsl flash and mtd1 and mtd2 are sharpsl nand

What is sharpsl flash?

There are two partitions on PROM:
Boot PROM code: invisible partition, you can find a patch to make it visible on my Zaurus web pages.
English-Japanese dictionary database: here it is called "Boot PROM Filesystem"

And three partitions on NAND:
Initial partition that does not contain filesystem and contains configuration, NAND bootloader and two kernel images
Two JFFS2 file systems with root and home for Sharp ROM. (Note that partitioning in kernel 2.6 is incorrect for SL-C3200.)

See this post for details.