Hi all,

To give some background on what I'm playing with, I'm trying to do an
implementation for dataflash devices.  This work is not looking into doing
SPI over FT2232 or anything, I'm looking at running some native code on my
ARM9 that will copy items to a dataflash device, much like the NAND driver I
did before.  At any rate, my question follows.

There appears to be a bunch of reused code in reference to the linked list
implementation for flash drivers.  It's true for NAND, NOR, and currently,
data flashes.  I'm thinking at this point it might be good to refactor it
(post 0.4) so that we can gauruntee a common flash interface across the
board.  The biggest question is if there is a way we can use a common
structure for flash devices (right now I'm thinking everything has a name
and next pointer, so this common struct would start there) that we can use
to consolidate the linked list implementation for searching for devices and
what not.  I was thinking this can be done with just a straight pointer cast
if we make sure all structures agree on the position of the name and next
pointer.  Either that or stuff everything in a union with all the different
device types and read from the common interface (I believe the pointer
locations have to also be the same here, so perhaps this is the same
thing?).

I'm not really sure if this is a worth while task, but it would reduce some
of the code redundancy.  Any thoughts?

-- 
// Dean Glazeski
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to