[flashrom] [PATCH] splitting the code into subdirs

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Tue Feb 23 13:18:06 CET 2010

On 23.02.2010 09:25, Sean Nelson wrote:
> Move files into a directory structure.
> File operations:
> mkdir {chips,programmer,cli,include}

To be honest, I'm unhappy about a separate include dir. The include
files should live in the directory they're used for. Just IMHO, but
wanted to mention it.

> svn add {chips,programmer,cli,include}

Kill include here as well.

> svn mv 82802ab.c chips/
> svn mv flashchips.c chips/
> svn mv jedec.c chips/
> svn mv m29f400bt.c chips/
> svn mv pm49fl00x.c chips/
> svn mv sharplhf00l04.c chips/
> svn mv spi.c chips/

spi.c needs to be split into a chip driver and some generic programmer
driver stuff. Maybe call the chip driver spi25.c or something like that.

> svn mv sst28sf040.c chips/
> svn mv sst49lfxxxc.c chips/
> svn mv sst_fwhub.c chips/
> svn mv stm50flw0x0x.c chips/
> svn mv w29ee011.c chips/
> svn mv w39v040c.c chips/
> svn mv w39v080fa.c chips/

Happy with all other moves above.

> svn mv atahpt.c programmer/
> svn mv bitbang_spi.c programmer/
> svn mv board_enable.c programmer/
> svn mv buspirate_spi.c programmer/
> svn mv cbtable.c programmer/
> svn mv chipset_enable.c programmer/
> svn mv dediprog.c programmer/
> svn mv dmi.c programmer/
> svn mv drkaiser.c programmer/
> svn mv dummyflasher.c programmer/
> svn mv ft2232_spi.c programmer/
> svn mv gfxnvidia.c programmer/
> svn mv hwaccess.c programmer/

Should we separate the hardware abstraction layer from the other
programmer stuff? Imput welcome.

> svn mv ichspi.c programmer/
> svn mv internal.c programmer/
> svn mv it87spi.c programmer/
> svn mv nic3com.c programmer/
> svn mv pcidev.c programmer/
> svn mv physmap.c programmer/
> svn mv programmer.c programmer/
> svn mv satasii.c programmer/
> svn mv sb600spi.c programmer/
> svn mv serprog.c programmer/
> svn mv udelay.c programmer/
> svn mv wbsio_spi.c programmer/
> svn mv cli_classic.c cli/
> svn mv cli_output.c cli/
> svn mv print.c cli/
> svn mv print_wiki.c cli/

The print* stuff is probably generic and not part of the cli... then
again, it depends on the definition.

> svn mv spi.h include/

spi.h is just #defines for SPI chip drivers. I'd move it to chips/

> svn mv chipdrivers.h include/

-> chips/

> svn mv coreboot_tables.h include/

-> programmer/

> svn mv flash.h include/

-> /

> svn mv flashchips.h include/

-> chips/

> svn mv hwaccess.h include/

-> programmer/

To be honest, I think we have to clean up a few files before making the
move. spi.c needs to be split into programmer and chip stuff, and the
SPI programmer drivers need to lose all the intimate knowledge about SPI
flash chips. flashrom.c has to get rid of all programmer stuff (maybe
move that to programmer.c). flashchips.h should not be included by
flash.h, instead it should be included by chip drivers and by
flashchips.c. hwaccess.h should not be included by flash.h, but should
be included by all programmer drivers that need it. serprog.txt may have
to to into programmer/ since it is programmer documentation. Then again,
maybe we need doc/.

Overall, I think the split is a good idea (but I will listen to people
who doubt it). We need further cleanups to make it worthwhile, though.


"I do consider assignment statements and pointer variables to be among
computer science's most valuable treasures."
-- Donald E. Knuth

More information about the flashrom mailing list