FS#9096 - Display NAND chip id in TCC77x bootloader

Attached to Project: Rockbox
Opened by Rob Purchase (shotofadds) - Monday, 16 June 2008, 20:27 GMT
Last edited by Rob Purchase (shotofadds) - Friday, 18 July 2008, 13:47 GMT
Task Type Patches
Category Bootloader
Status Closed
Assigned To Rob Purchase (shotofadds)
Operating System Another
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


The attached patch is a rudimentary attempt to read a NAND chip id from a TCC77x device during bootloader initialisation, for initial testing purposes (I don't currently have the correct hardware to try this myself).

It should be possible to test this on M200 (hardware rev. 1.x and 2.x(?), not 3.x or 4.x), also Logik DAX and the ATMT MP170.
This task depends upon

Closed by  Rob Purchase (shotofadds)
Friday, 18 July 2008, 13:47 GMT
Reason for closing:  Out of Date
Additional comments about closing:  Superceded by ata-nand-telechips.c in current SVN.
Comment by Marc Guay (Marc_Guay) - Tuesday, 17 June 2008, 19:09 GMT
Adding this to the Sansa c100 bootloader causes nothing to be displayed.
Comment by Robert Menes (RMenes379) - Tuesday, 17 June 2008, 19:24 GMT
Tried this on the Sansa m200 bootloader on my m240 (V1). Nothing is displayed.

Marc Guay mentioned on IRC that running the nand_read_id() function seems to be causing the problem.

Comment by Marc Guay (Marc_Guay) - Tuesday, 17 June 2008, 19:29 GMT
It's the only function! Besides the one it calls, anyway. :)
Comment by Rob Purchase (shotofadds) - Wednesday, 18 June 2008, 07:53 GMT
Ah well, it was worth a try. On my m230 rev.3 this displays NAND: 0x0 0x0... as if no NAND were present (understandable, given the bridge chip present on this model). Maybe I should stick to coding for devices I actually own...
Comment by Robert Menes (RMenes379) - Wednesday, 18 June 2008, 12:15 GMT
That's why we're swapping m200's... ;)
Comment by Mark Arigo (lowlight) - Tuesday, 08 July 2008, 19:05 GMT
This patch reads the nand id on my c100.

I'm starting to go through the other nand functions as well.
Comment by Frank Gevaerts (fg) - Tuesday, 08 July 2008, 19:19 GMT
Values on my Logik DAX 1GB:
0xEC 0xD3 0x51 0x95 0x58
Comment by Mark Arigo (lowlight) - Tuesday, 08 July 2008, 19:56 GMT
For the record, I get the same values for my C140:
0xEC 0xD3 0x51 0x95 0x58

Also, as noted by gevaerts, the printf statement is too wide for the screen. It needs to be split onto 2 lines.
Comment by Rob Purchase (shotofadds) - Tuesday, 08 July 2008, 20:04 GMT
In fact, all that's needed is to add the next couple of lines to my original patch. I'm not sure where you got all the other extra junk from ;-)

+ /* From the Sansa C100 firmware */
+ CSCFG2 = 0x318a8010;
+ GPIOC_DIR |= 0x2000000; /* output mode */
+ GPIOC_FUNC &= ~0x2000000; /* normal IO port */
+ GPIOC_FUNC |= 0x1;

For the record, my M240 also returns 0xEC 0xD3 0x51 0x95 0x58.

EDIT: New simpler patch attached.
Comment by Marc Guay (Marc_Guay) - Tuesday, 08 July 2008, 22:56 GMT
I'm not getting any values on my c150 running firmware v2.0007A. There may have been a hardware revision on the c100s. I cannot downgrade to firmware v1.0.005A from v2.0007A. Lowlight, can you verify what firmware version yours is running?
Comment by Mark Arigo (lowlight) - Wednesday, 09 July 2008, 21:19 GMT
Mine is v1.0.003A
I could not find a v1.0 version of the firmware, so I've been using the v2.0 firmware for disassembly. It seems as though it can use the NFC controller (0x90000000) or an external controller (?) through the 0x60000000 registers. And it doesn't appear to be hard coded as to which controller to use. When I get time, I will try to make a simple patch to read the id through the other interface.