Quick Update

Work on my new bootloader is going well, I have to functions to talk to the Flash EEPROM working properly, booting from USB seems to be working 100% now, and I can now read and boot from the NAND memory. An example is show below.

Now I just need to write the functions to write to the NAND memory. Which means figuring getting the programming commands works (not to hard), and determining how blocks are marked as good or bad (which is a bit harder). The NAND chip has 4096 blocks, each block has 32 pages, each page is 512 bytes. Each page also has an additional 16byte section (for a total of 528 bytes a page), this section is intended to be used for error checking and marking bad pages. Since how the 16bytes are being used isn't immediately obvious, I'm probably going to have to go back to staring at the original bootloader again to figure it out.


Nocturnal's RS Media BootLoader - Ver 0.4 (18/09/2007)
------------------------------------------------------------------------
Flash EEPROM : Manufacturer ID = 0x00C2, Device ID = 0x22BA
NAND Flash : Manufacturer ID = 0xEC, Device ID = 0x76, MultiPlane = 0xC0
MC9328MXL CPU : Silicon ID = 0x00D4C01D
RS Media : Device ID = 0xABCDEF01

Press any key for alternate boot-up options ...  01

Current command line is : root=fe01 ro mem=16M

0. Program bootloader image
1. Program kernel image
2. Program root-disk image
3. Download kernel and boot from RAM
4. Boot kernel from NAND Flash
5. Change command line
 . Program new boot logo
6. Call onboard bootloader
7. Read EEPROM Contents

   Please enter selection -> 4

Copying kernel to 0x08008000 ... Complete
Booting from NAND...
Booting Kernel ...

Linux version 2.4.18-rmk5-mx1ads-p3 (sam@estechsolution.com) (gcc version 2.95.3 20010315 (release)) 
#516 Wed Feb 14 16:36:08 HKT 2007
Processor: ARM/CIRRUS Arm920Tsid(wb) revision 0
Architecture: Motorola MX1ADS
On node 0 totalpages: 4096
zone(0): 4096 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=fe01 ro mem=16M
Console: colour dummy device 80x30
Calibrating delay loop... 98.50 BogoMIPS
Memory: 16MB = 16MB total
Memory: 14688KB available (1023K code, 316K data, 60K init)
Dentry-cache hash table entries: 2048 (order: 2, 16384 bytes)
Inode-cache hash table entries: 1024 (order: 1, 8192 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
ttySA0 at I/O 0x206000 (irq = 29) is a MX1ADS
ttySA1 at I/O 0x207000 (irq = 23) is a MX1ADS
pty: 256 Unix98 ptys configured
DMA Initializing 
block: 64 slots per queue, batch=16
PPP generic driver version 2.4.1
PPP Deflate Compression module registered
PPP BSD Compression module registered
SSFDC core support installed
MX1ADS nand I/O driver installed
SSFDC Partitions
nand0 : block 0x0000-0x0049 : "Kernel" 1184 KB direct map
nand1 : block 0x004a-0x0229 : "RootDisk" 7680 KB random map
nand2 : block 0x022a-0x04a9 : "DefaultDisk" 10240 KB random map
nand3 : block 0x04aa-0x0f5a : "UserDisk" 43792 KB random map
nand4 : block 0x0f5b-0x0f7a : "WritableDisk" 512 KB random map
nand5 : block 0x0f7b-0x0f9a : "PassDisk" 512 KB random map
MX1ADS nand flash partition definitions installed
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 1024 bind 1024)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com

regarding flash

Hi, the start of the chip is guaranteed not faulty block 0 its the MBR.

the 16byte correction codes for 528b smallpage nand are as follows:

byte 1,2,3 are lsn0 lsn1 lsn2 - which correspond to logical sector number

then there are two reserved bytes 4,5
the sixth byte is the invalid block information

then 7,8,9 are ecc codes

10,11 are s-ecc codes - i.e. ecc codes for lsn

12 to 16 are reserved and normally not used...

inherent & acquired invalid blocks: are marked by writing non ffh values in byte 517 (typically 0) in the first two pages of an invalid block.

one way is using the skip block method - if there are errors - just skip to the next good block.

another method is reserved block area - which is a reservoir of blocks and a replacement table at a know position in memory.

UBA user block area - RBA - reserved block area

RBA structure :

2 bytes: transition field which is always fdfeh
2 bytes: count field which is incremented by 1 for each page of the RBA map table to replace blocks
2 bytes: invalid block
2 bytes: block to replace invalid with

next next block in RBA is a duplicate of the first block - but with a major difference - the count field is continued from last value in the first block.

all fields of the map table are little endian. secded single error detection - double error detection method used for ecc
maybe this could help http://www.elnec.sk/support/application-notes/

this is just some common info - dunno if it will resolve your problem - but it could help I guess

-=> JediNforce <=-

Thanks for the thought, but

Thanks for the thought, but I already got all that out of the datasheets. The problem I had was generating the ECC, but I figured that out pretty fast (took a little while to get the bit ordering correct).

I've been sidetracked and haven't done any work on this recently, which is why there have been no further posts.