Dual-boot flasher by Ignacio Garcia Perez <iggarpe@gmail.com>



History:

    2009-09-16

    * Changed NAND write mode from DATA+OOB to just DATA. The kernel has
      been hacked to handle the special OOB format required by the IPL.

    2009-08-13

    * Fixed another still standing serial port bug from previous release
      (pull-ups are not enough, fully disabled u-boot stop on keypress).

    2009-06-28

    * Fixed serial port problem: pull-ups must be left enabled or
      otherwise U-Boot sometimes will detect serial line break condition
      and will stop the boot process.
    * Fixed "white screen" glitch when booting original firmware.

    2009-06-27

    * Fixed slowdown in original firmware.
    * Added usbtool for MAC OS X 10.4 and up (by Maarten ter Huurne).
    * Added usbtool for Windows (by A600).

    2009-06-26

    * Added uninstall capability (just flashes my original
      firmware SPL).

    2009-06-25

    * Initial release.



---=== BIG FAT WARNING ===---

To write to NAND flash you must first erase the entire block, and each
block wears each time it is erased. For MLC (Multi-Level Cell) flash
chips the guaranteed minimum erase cycles are around 1000. That is not
much, and is usually not a problem because firmware and operating
systems do what is called "wear leveling". To make a long story short,
they put a translation layer that spreads writes to different blocks.
If you erase 1000 times a logical block, you will actually be erasing
1000 different physical blocks once each.

However, when you are writing directly to a block without any
intermediate translation layer, you must be careful. Flashing the dual
boot means erasing and writing the first block of your NAND flash. It
is always the first block. And it wears. It is absolutely unlikely
that I will be releasing 1000 dual boot versions, so you are on the
safe side. However, don't flash your A320 for fun every day before
breakfast.



---=== INTRODUCTION ===---

This package will allow yo to write a dual-boot flasher to your
A320 so that you can choose to boot original firmware from
internal flash (default) or linux for miniSD (SELECT key pressed
during boot).

This package WILL NOT install linux. The dual boot code will just
search for a zImage in the first partition (FAT32) of the miniSD,
load it and launch it. It is up to you to prepare a miniSD with
linux in it.

There are two dual boot binaries, one for each type of LCD known to
date. You can find out your LCD type by entering the About screen
in the System Setup and pressing the following key combination:

    up-right-down-up-right-down

Then you will see a hidden diagnostics screen. Look around and you
should see "ILI9325" or "ILI9331" somewhere. If you do not see it,
you might have an unknown LCD model and should contact me.

Also, as you can see this guide is a bit spartan. If you want to help
and rewrite it and add screenshots and such, do it and send it to me
so I can include your work in the next release.



---=== INSTRUCTIONS FOR WINDOWS ===---

1- Unplug your A320.

2- Put it in USB boot mode: reset it while holding B button pressed.
   The LCD will remain dark.

3- Plug your A320. If a "new hardware found" dialog shows up, select
   "No, not at this time", and when you're asked for a driver location
   use the directory there you unpacked the dual boot files. Go to
   step 5.

4- If the "new hardware found" dialog doesn't show up, that means you
   have the ChinaChip drivers installed. You have to uninstall them.
   Open the hardware manager dialog, find the device, right click on
   it and select "uninstall". Unplug your A320 and go to step 3.

5- Open a command shell (Start --> Run --> "cmd"), change to the
   directory where you unpacked the dual boot files and execute the
   following commands (replace ILI9325 by ILI9331 if you have the
   later LCD type):

   usbtool-win 1 hwinit.bin 0x80000000
   usbtool-win 1 zImage_dual_boot_installer_ILI9325 0x80600000
   
6- You should now see your A320 booting linux and launching the
   flasher script. Follow the instructions on the A320 screen.



---=== INSTRUCTIONS FOR LINUX ===---

Go straight to step 5 of the instructions for Windows, but replace
"usbtool-win" by "sudo ./usbtool-linux".



---=== INSTRUCTIONS FOR MAC OS X 10.4 AND UP ===---

Go straight to step 5 of the instructions for Windows, but replace
"usbtool-win" by "./usbtool-osx".

(untested, please report success/failure)


