[OLPC-devel] OLPCflash: Almost there

Richard Smith smithbone at gmail.com
Mon Aug 14 03:05:55 EDT 2006


I'm so !@&#$^*& close I can taste it.

I can erase the part.
I can write the the part.
I properly avoid the EC code.  No bricks yet.

What I can't do is write anything other than a zero. :(

For whatever reason my writes into the SPIDAT (0xfeab) register don't
work.  I've verified this in both the olpcflash.c and in my own little
utilites that just read and write EC registers.

I can write to each of the registers before and after SPIDAT and I can
read from SPIDAT just fine after a READ command.  But write to SPIDAT
and then do a read and you just get zero.

The attached olpcflash.c will erase your SPI flash from 0x10000 to
0xfffff. And then it trys to write 256 bytes from the file you give it

olpcflash -w <filename>

After it tries to put the data to write into the SPIDAT register it
will read it back print it out issue the write and then try to verify
the byte.

Fails every time.

olpcflash -r dump
hd dump | less

You will see a file that is entirely 0xff except for the fist 2 bytes
which are zero.  Why 2 and not 1?  I don't know yet.  But this shows I
wrote to the part with exactly what was in the register.

Also attached are 2 small utilites that allow you to read and write EC
registers.
inreg and outreg.

You can do the following:

outreg 0xfeab 0xaa
inreg 0xfeab
will print '00'

Do the same with 0xfeaa or 0xfeac and it works.

Ray???

-- 
Richard A. Smith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: olpcflash.c
Type: text/x-csrc
Size: 13116 bytes
Desc: not available
URL: <http://lists.laptop.org/pipermail/devel/attachments/20060814/5043354a/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inreg.c
Type: text/x-csrc
Size: 1396 bytes
Desc: not available
URL: <http://lists.laptop.org/pipermail/devel/attachments/20060814/5043354a/attachment-0001.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: outreg.c
Type: text/x-csrc
Size: 1400 bytes
Desc: not available
URL: <http://lists.laptop.org/pipermail/devel/attachments/20060814/5043354a/attachment-0002.c>


More information about the Devel mailing list