My first thought is to move the source to the common "allwinner" directory, but other chips also use this driver. Both the 64 bit Fire3 board and the 32 bit Zynq use the gicv2. Someday the RK3328 will be supported by Kyu and it also uses the gicv2. It would be almost misleading to put the source in the "allwinner" directory. I am tempted to create a "drivers" directory, but I would rather have that contain higher level drivers such as general i2c drivers along with drivers for specific i2c devices that would be portable to any chip.
So, the logical thing is a "gic" directory. At this point it will contain only gicv2.c and the various board specific directories will have symlinks to it. The gic driver itself will need to have conditionals on "BOARD_H3" and such, only for the base address values. At least we hope that is the only difference.
I do this.
After a few minor edits, I have a source file in the gic directory that
all the boards can share. I simply abandoned the gic source I had for
the H5 directory -- it had a lot of test code from when I didn't understand
why interrupts were not working. Kyu runs fine on the H5 with the same
exact shared driver as the H3 uses.
I expected to do a bunch of comparing and fussing with several versions of the driver for the H5 that I had, but the easiest and smartest thing was to just throw it out and move on.
Tom's electronics pages / tom@mmto.org