Refactoring #603
openQuestions regarding groups/backends/bus refactoring
0%
Description
Hi,
I've been working on cleaning up, organizing and trying to improve development barrier in flashrom by trying to organize some parts of the code and structure of the project.
For de time being, mostly, I've tryed to move platform dependent code to the platform/
folder and trying to separate header files for a clearer code dependency...
Now that I got a little bit more in touch with the codebase I understand that there are flashchip definitions for memory targets. Those flashchips are interacted with via programmers. Now, programmers seem to be "grouped" by the bus they are accessed with.
Here you may find a meson extract referring to those groups:
group_ftdi = get_option('programmer').contains('group_ftdi')
group_pci = get_option('programmer').contains('group_pci')
group_usb = get_option('programmer').contains('group_usb')
group_i2c = get_option('programmer').contains('group_i2c')
group_serial = get_option('programmer').contains('group_serial')
group_jlink = get_option('programmer').contains('group_jlink')
group_internal = get_option('programmer').contains('group_internal')
group_external = get_option('programmer').contains('group_external')
In meson, those "group" definitions seem to be simply options to enable and disable different kind of programmer support in compilation time.
I would like to create a folder that holds all the related code files for those "groups" but I don't think that "group" is a good name for that folder. I was wondering if anyone would like to brainstorm or give suggestions about naming for that folder.
I was thinking on backends, programmer_backends, bus, busses, programmer_bus...
For the time being, programmer_backends is my preferred one due to "bus" being used at the moment to refer to "chip bus"...
Please, let me know if you find this useful, if you feel it is a good idea or not. Feedback is much welcome.
Thanks
Updated by Anastasia Klimchuk 19 days ago
I read your idea and I remembered about the idea that was floating around some time earlier, to create a programmers/ directory! I would go for that simple naming.
As of,
programmers/
and then inside, the names of those groups,
... ftdi/
... pci/
... internal/
etc
I would say, the groups represent the platform and dependencies, not buses. Also there is a distinction between internal and external ways of programming.
There are several things to think about, probably better think before starting
- "internal" is a group, but "external" represents all external programmers, so "external" won't be a directory
- linux_spi doesn't belong to any group now? with a comment saying so?
- ni845x_spi doesn't have group (maybe it can be windows/ directory)
- pcidev.c is in multiple groups, including pci and internal