Hi all, The master branch on my repo.or.cz mirror has a couple of patches that begin to unify the flash tree, which will eventually lead to the elimination of a bit more duplicated code. It's using the container_of macro first used by the target module. The first patch introduces the basic scaffolding, and the second converts the NOR driver and bank structures to use it. These build but are untested. I should have the NAND directory converted after a little more work. When this is cleaned up and pushed, it will be easy to support new classes of flash devices.
I think the driver/instance abstractions deserve to be generalized into a lower-level/helper API that provide the generic driver loading and instantiation mechanisms for all of our "classes and their objects". In other words, the core foundation for interface, jtag, flash, target, and all other kinds of things that will have N drivers and M instances. Each of these will need the same infrastructure: find and load driver modules, register each module's driver(s) and base commands, and provide a means of creating new instances and installing them into the command system. All of this could be done as part of an 'object' helper module. If we implement this today, moving from static to dynamic modules could be done in that single source file, behind the veil of its API. Cheers, Zach _______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
