
G'Day,
Feel free to harsh me if I've got this wrong. (I'm writing this so I don't get harshed when I submit my patch).
I've just borrowed the code from the sixnet board for talking to 28F320C3 flash chips (advanced boot sector, yada, yada) which was written by Wolfgang at some point. Its dropped in very nicely and works very well (once I'd worked out what i was doing).
I've had two problems. The first has been that that the code uses the get_timer(x) function, which is not implemented properly on ARM. (It just returns the value of the OS counter, ignoring the value passed to it. I had to replace the get_timer stuff with get_timer_masked and reset_timer_masked. I could try fixing the arm implementation of get_timer, but figured you guys wouldn't want me touching that bit of code since other bits and pieces now depend on it. Is there some way of doing this nicely?
The second was that one part of the code munges some bytes into a word to get them ready for writing. This is broken with respect to endian-ness, and breaks on my XScale running in little-endian mode. Is it possible (or appropriate?) to add a CFG_LITTLE_ENDIAN (or something similar)? Is there a better way of switching between the two? It would be nice if this code could be re-used without these sorts of problems.
Cheers,
Dave.
- David Snowdon PhD Student National ICT Australia (NICTA) Phone: 9385 7355 Email: daves@cse.unsw.edu.au