mini210 16bit ecc nand driver opensource

Reggie
Hi All, with the kind permission of FriendlyArm and hard work by JKent and
contributions from myself (reggie), I am proud to announce an open source
nand driver for the mini210S with 16bit hardware ecc support.

This driver was originally derived from friendlyarm's s5p_nand_mlc.fo
binary blobs, disassembled, reverse engineered and lovingly crafted into
open source C.

You can download the source from here,
https://github.com/Reggi3/210-nand-patch
 it has been tested with the linux 2.6.35 and 3.0.8 kernel sources, there
are 3 main files, the Makefile, the s5pc_nand_mlc.c and s5p_phy_init_ext.c
files, for 3.0.8 kernels, simply put those 3 files into your
drivers/mtd/nand/ folder and compile your kernel.

for 2.6.35 based kernels, you can use just the s5p_nand_mlc.c/Makefile and
remove line 61 from the Makefile, again place them in your
drivers/mtd/nand/ nand folder and compile your kernel.

These drivers were based on the drivers from the mini210s-20120913.iso
image, you should use the superboot.bin from this DVD, this has also only
been tested using the android rootfs.  I have tested this driver using the
the very latest 2013 kernel sources and android rootfs with the
superboot.bin from the above DVD and everything works fine.

Whichever kernel source you use, you should set the following in your
FriendlyArm.ini file:
LowFormat = Yes

Make sure you backup your mini210S if there is anything that you don't want
to lose as it will wipe the nand.

If you study the source code, you will notice that there are references to
8bit in the function names but this really is a 16bit driver, we just used
the naming convention that samsung/friendlyarm use.

At some point we should really look at merging this into the existing code
and handling all 210 board/nand types in 1 driver.


--- Extra Notes ---
As mentioned, this is for the mini210S with 4Gb MLC nand, it hasn't been
specifically tested on the 2GB MLC versions or the new SLC versions, so if
anyone is willing to give it a try

The s5p_phy_init_ext.c file contains some functions that are a little bit
puzzling, they're for functions that are completely outside of the original
nand driver but are entirely necessary due to a couple of edits in 2
filesin the friendlyarm 3.0.8 kernel sources, drivers/mmc/host/sdhci-s3c.c
and drivers/usb/host/ehci-s5p.c, specifically the calls to s5p_phy_init_ext
in both of those files.

There is no real reason for these to be in their own seperate functions, so
in time we should move the code in the external functions back into the 2
existing drivers but we left these in for completeness at this stage.

--- Feedback Please :-) ---

There have only been 2 of us testing these drivers, so any feedback is
greatly appreciated, this will aid us in debugging.

Regards,
Reggie.

sean_h
Hi Reggie

Many thanks for all the work and for sharing it. I will build up the
courage to try it once the boot loader has been open sourced as well.

Sean

ljo
Hi Reggie
1662
Many thanks for all the work and for sharing it. I will build up the
courage to try it once the boot loader has been open sourced as well.
5360

Screwface
Hi Reggie,

I tested your NAND driver on my mini210s with lastest Android RootFS. I
tested superboot 1.16 and it seems it doesn't work (s5p-nand: ECC
uncorrectable error(s) detected). I tested with same files but with older
superboot 1.10, and then it works, as you mentionned. In each case I
low-level formatted the NAND. I also tried with lastest qtopia image and
superboot 1.10, got several ECC uncorrectable error(s) detected messages
the first minutes while everything worked perfectly, and then problems
disapeared.

Great work! Next step may be make the driver compatible with superboot
1.16, or better: have a support of barebox bootloader! I'm having a look at
that.

Thanks again for sharing your knowledge!

Reggie
you're welcome.