
Wolfgang Denk skrev:
In message 4609420A.6070103@atmel.com you wrote:
Merge to two virtually identical files.
"board/at91rm9200dk/at45.c" "board/cmc_pu2/at45.c" (one bug fixed first) into "driver/at45.c" then move at91rm9200 specific functions from "driver/at45.c" to: "cpu/arm920t/at91rm9200/spi.c Update Makefiles to reflect change
Patches like this would be *much* easier to read if you used git, where file rename operations are handled properly.
True, but I am not there yet. A script doing almost the same thing as the patch would look like.
#!/bin/bash # split at45.c into two files head --lines=<-N> board/at91rm9200dk/at45.c > driver/at45.c tail --lines=<N> board/at91rm9200dk/at45.c > cpu/arm920t/at91rm9200/spi.c
rm -f board/at91rm9200dk/at45.c # remove the original file rm -f board/cmc_pu2/at45.c # remove a copy of the original file.
Then the makefiles would have to be updated and a header file added (at45.h).
--------------------- So instead of each board building at45 in their local directory they will build it in the driver directory. The reason for splitting the file is that the original file contains things which is specific for one CPU. Moving it to a cpu specific directory makes it possible to use the remainder of at45.c for other CPUs.
The U-Boot patches for at91sam926x chips use a common at45.c in the driver directory to avoid duplicating it in the board directory, but that patch cannot be applied the way u-boot works today, since it will cause a conflict with the at45.c in the board directory
The plan is that when the at91sam926x patches are applied the directory structure will look like:
---------------------------- CURRENT U_BOOT board at92rm9200dk at45.c cmc_pu2 at45.c ---------------------------- PROPOSED U_BOOT cpu arm920t at91rm9200 at91rm9200_spi.c arm926ejs at91sam926x at91sam926x_spi.c board at91rm9200df at91rm9200dk at91rm9200ek at91rm9260ek at91rm9261ek at91rm9263ek cmc_pu2 driver at45.c
---------------------------- U-BOOT IF PROPOSAL IS NOT ACCEPTED board at91rm9200df at91rm9200_at45.c at91rm9200dk at91rm9200_at45.c at91rm9200ek at91rm9200_at45.c at91rm9260ek at91sam926x_at45.c at91rm9261ek at91sam926x_at45.c at91rm9263ek at91sam926x_at45.c cmc_pu2 at91rm9200_at45.c