JDP : Flash

Home :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are a guest
This is a guide how to make use of your flash unit in the javastation.

2.4 Kernel support for the flash simm


Download the patch http://www.dnd.utwente.nl/js/files/mtd-jsflash.diff and patch the kernel.Enable the following kernel options:

* Memory Technology Device (MTD) support * MTD partitioning support * Caching block device access to MTD devices * RAM/ROM/Flash chip drivers ** Detect flash chips by Common Flash Interface (CFI) probe ** Detect non-CFI AMD/JEDEC-compatible flash chips (< 2.4.22) ** Detect JEDEC JESD21c compatible flash chips (2.4.22) ** Support for AMD/Fujitsu flash chips * Mapping drivers for chip access ** Sun Microsystems Javastation OS-flash support


And it is also recommended to enable character device access. It is needed to erase the flash and install a kernel image.

* Direct char device access to MTD devices


Compile, reboot and you should see something like this:

OS-flash: Found AMD AM29LV081 OS-flash: Found 4 x8 devices at 0x0 in 32-bit mode OS-flash: Found 4 x8 devices at 0x400000 in 32-bit mode OS-flash: Found an alias at 0x800000 for the chip at 0x400000 OS-flash: Found an alias at 0xc00000 for the chip at 0x0 number of JEDEC chips: 2 Creating 2 MTD partitions on "OS-flash": 0x00000000-0x00080000 : "Bootstrap" 0x00080000-0x00800000 : "Filesystem"


2.6 Kernel support for the flash simm


Download the patch http://www.dnd.utwente.nl/js/files/js-mtd-2.6.6.diff and patch the kernel.

Enable the following kernel options:

* Memory Technology Device (MTD) support * MTD partitioning support * Caching block device access to MTD devices * RAM/ROM/Flash chip drivers ** Detect non-CFI AMD/JEDEC-compatible flash chips ** Support for AMD/Fujitsu flash chips * Mapping drivers for chip access ** Support non-linear mappings of flash chips ** Sun Javastation userflash support


And it is also recommended to enable character device access. It is needed to erase the flash and install a kernel image.

* Direct char device access to MTD devices


Compile, reboot and you should see something like this:

OS-flash: Found AMD AM29LV081 OS-flash: Found 4 x8 devices at 0x0 in 32-bit mode OS-flash: Found 4 x8 devices at 0x400000 in 32-bit mode OS-flash: Found an alias at 0x800000 for the chip at 0x400000 OS-flash: Found an alias at 0xc00000 for the chip at 0x0 number of JEDEC chips: 2 Creating 2 MTD partitions on "OS-flash": 0x00000000-0x00800000 : "OS-flash" 0x00000000-0x00100000 : "Bootstrap" 0x00100000-0x00800000 : "Filesystem"


Partitions


By default two partitions are created. This can be changed in drivers/mtd/maps/jsflash.c at line 120.

Filesystems


See [WhichFilesystemForFlash] to choose your filesystem.

Booting from flash


I assume we are building our bootable image in /tmp/flash.

Silo


Create an entry in etc/silo.conf in the image directory like this:

image = /boot/vmlinux.gz label=linux proll=/boot/proll.img append="root=/dev/mtdblock2"


Image


Create a tree with the following under /tmp/flash:
boot boot/vmlinux.gz boot/ieee32.b boot/second.b boot/proll.img etc etc/silo.conf


Quick tips on how to reduce the size of your image
- strip the kernel (strip --strip-all -R .note -R .comment)
- compress the kernel with gzip
- compress the proll gzip
- compile your own second.b with all fs support but romfs ripped out

Generate a bootable rom-image:

# dd if=/dev/zero of=flash.img bs=1k count=1 # genromfs -a 512 -f romfs.img -d /tmp/flash # cat romfs.img >> flash.img # rm -f romfs.img # losetup /dev/loop0 -o 1024 flash.img # mount -t romfs -o ro /dev/loop0 /mnt # silo -J flash.img -i /boot/ieee32.b -r /mnt # umount /mnt # losetup -d /dev/loop0


Copy the image to the flash simm:

# eraseall /dev/mtd/1 # cp flash.img /dev/mtd/1


Done.

JasperVanDerNeut
There is no comment on this page. [Display comments/form]