Hammer How to JFFS2 Root

This tutorial assumes you are using Minicom to console to your Hammer Board.

This tutorial shows how to configure the Hammer Board software to boot from the flash partition (/dev/mtdblock1) instead of using an initrd in RAM. This should make more RAM available for applications.

Do these steps FIRST:
 * Turn off all initramfs and initrd support in your kernel
 * Make sure the .SIZE is set correctly in arch/arm/mach-s3c2410/mach-tct-hammer.c
 * Make sure the correct Default Kernel Commandline (in APEX, Environment) is set to point to /mnt/mtdblock1 as the root partition

You may have to edit arch/arm/mach-s3c2410/mach-tct-hammer.c to change the value of .SIZE if your kernel is larger than 1 MB. The most common values for .SIZE are 0x140000 (1280k) and 0x200000 (2048k). These values should be more than large enough for most builds. The .SIZE variable has to be large enough for the boot loader and the kernel together.

Press RESET on Hammer Press Ctrl/C to get to the APEX command prompt xreceive 0x30800000

In Minicom

Ctrl A Z S in Minicom Select Xmodem Browse to or enter the full path of the JFFS2 image to upload

Browse to or enter the name of the JFFS2 image file to upload

erase nor:1280k+0xEC0000 (that value is total amount of flash minus the amount of flash used for kernel and bootloader)

For the next step, you need to know the exact size in bytes of your JFFS2 file image. Replace with the exact filesize returned by doing

ls -l

at the shell prompt.

In APEX then do:

copy 0x30800000+10074460 nor:1280k

To make the next change permanent, you need to go into the APEX configuration and set a parameter to tell APEX about your new root file system (JFFS2) and root (/dev/mtdblock1). There is a parameter in the Environment section called "Default kernel command line", which you need to set to:

console=ttySAC0 rootfstype=jffs2 root=/dev/mtdblock1

Then rebuild APEX.

To make this change more temporary, until you reflash Hammer again, you can set the cmdline parameter in APEX by:

Rebooting Hammer and pressing Ctrl/C to get to the APEX prompt

In APEX:

setenv cmdline = "console=ttySAC0 rootfstype=jffs2 root=/dev/mtdblock1" printenv

This should show the change you just made. Now press RESET on your Hammer Carrier Board to reboot.