diff --git a/flash.h b/flash.h index c5234dcfa64b5fd063413cdeceab6a523cd5851d..d3e2e309844de7b0e03c99c0083588cb548bfb97 100644 --- a/flash.h +++ b/flash.h @@ -422,7 +422,7 @@ char *strcat_realloc(char *dest, const char *src); int show_id(uint8_t *bios, int size, int force); int read_romlayout(char *name); int find_romentry(char *name); -int handle_romentries(uint8_t *buffer, uint8_t *content); +int handle_romentries(uint8_t *buffer, struct flashchip *flash); /* cbtable.c */ int coreboot_init(void); diff --git a/flashrom.c b/flashrom.c index b531699b54ca18c577a6317c5cda191df5b08886..fc803015d00187033b965145e15750f2da83c6f1 100644 --- a/flashrom.c +++ b/flashrom.c @@ -930,8 +930,7 @@ int main(int argc, char *argv[]) // This should be moved into each flash part's code to do it // cleanly. This does the job. - /* FIXME: Adapt to the external flasher infrastructure. */ - handle_romentries(buf, (uint8_t *) flash->virtual_memory); + handle_romentries(buf, flash); // //////////////////////////////////////////////////////////// diff --git a/layout.c b/layout.c index 68684a7e12f99683958bff54ed8722fee9e16b98..c432ebe82806a13f2a768b7d23cec10bf3401195 100644 --- a/layout.c +++ b/layout.c @@ -196,11 +196,11 @@ int find_romentry(char *name) return -1; } -int handle_romentries(uint8_t *buffer, uint8_t *content) +int handle_romentries(uint8_t *buffer, struct flashchip *flash) { int i; - // This function does not safe flash write cycles. + // This function does not save flash write cycles. // // Also it does not cope with overlapping rom layout // sections. @@ -220,10 +220,9 @@ int handle_romentries(uint8_t *buffer, uint8_t *content) if (rom_entries[i].included) continue; - /* FIXME: Adapt to the external flasher infrastructure. */ - memcpy(buffer + rom_entries[i].start, - content + rom_entries[i].start, - rom_entries[i].end - rom_entries[i].start); + flash->read(flash, buffer + rom_entries[i].start, + rom_entries[i].start, + rom_entries[i].end - rom_entries[i].start + 1); } return 0;