diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2008-10-18 21:14:13 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2008-10-18 21:14:13 +0000 |
commit | 394131ef1447aa9019f9b03797955fb4fdda74bd (patch) | |
tree | 8be1ee454d786c1aae0ea45be068e22b2a7c70a5 /pm49fl00x.c | |
parent | a88daa731de1612641a9a8df2a63f5529ac7a6b1 (diff) | |
download | ast2050-flashrom-394131ef1447aa9019f9b03797955fb4fdda74bd.zip ast2050-flashrom-394131ef1447aa9019f9b03797955fb4fdda74bd.tar.gz |
Coding-style fixes for flashrom, partly indent-aided
Corresponding to flashrom svn r326 and coreboot v2 svn r3669.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'pm49fl00x.c')
-rw-r--r-- | pm49fl00x.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/pm49fl00x.c b/pm49fl00x.c index ed2fed0..fe8b974 100644 --- a/pm49fl00x.c +++ b/pm49fl00x.c @@ -26,14 +26,13 @@ extern int exclude_start_page, exclude_end_page; void write_lockbits_49fl00x(volatile uint8_t *bios, int size, - unsigned char bits, int block_size) + unsigned char bits, int block_size) { int i, left = size; for (i = 0; left >= block_size; i++, left -= block_size) { - /* pm49fl002 */ - if (block_size == 16384 && i%2) + if (block_size == 16384 && i % 2) continue; *(bios + (i * block_size) + 2) = bits; @@ -43,7 +42,7 @@ void write_lockbits_49fl00x(volatile uint8_t *bios, int size, int probe_49fl00x(struct flashchip *flash) { int ret = probe_jedec(flash); - + if (ret == 1) map_flash_registers(flash); @@ -58,9 +57,13 @@ int erase_49fl00x(struct flashchip *flash) volatile uint8_t *bios = flash->virtual_memory; /* unprotected */ - write_lockbits_49fl00x(flash->virtual_registers, total_size, 0, page_size); + write_lockbits_49fl00x(flash->virtual_registers, + total_size, 0, page_size); - //erase_chip_jedec will not work ... datasheet says "Chip erase is available in A/A Mux Mode only" + /* + * erase_chip_jedec() will not work... Datasheet says + * "Chip erase is available in A/A Mux Mode only". + */ printf("Erasing page: "); for (i = 0; i < total_size / page_size; i++) { if ((i >= exclude_start_page) && (i < exclude_end_page)) @@ -75,7 +78,8 @@ int erase_49fl00x(struct flashchip *flash) printf("\n"); /* protected */ - write_lockbits_49fl00x(flash->virtual_registers, total_size, 1, page_size); + write_lockbits_49fl00x(flash->virtual_registers, + total_size, 1, page_size); return 0; } @@ -88,7 +92,8 @@ int write_49fl00x(struct flashchip *flash, uint8_t *buf) volatile uint8_t *bios = flash->virtual_memory; /* unprotected */ - write_lockbits_49fl00x(flash->virtual_registers, total_size, 0, page_size); + write_lockbits_49fl00x(flash->virtual_registers, total_size, 0, + page_size); printf("Programming page: "); for (i = 0; i < total_size / page_size; i++) { @@ -106,9 +111,10 @@ int write_49fl00x(struct flashchip *flash, uint8_t *buf) fflush(stdout); } printf("\n"); - + /* protected */ - write_lockbits_49fl00x(flash->virtual_registers, total_size, 1, page_size); + write_lockbits_49fl00x(flash->virtual_registers, total_size, 1, + page_size); return 0; } |