diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2007-05-09 10:17:44 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2007-05-09 10:17:44 +0000 |
commit | a7e0548cea45ec60616936c536efbb2a34605093 (patch) | |
tree | 8d31e1c7e3343980b1c0724103f39dbb5baae77a /msys_doc.c | |
parent | 7977f4ef2ea478a5460e6730aa2adc23e9685be1 (diff) | |
download | flashrom-a7e0548cea45ec60616936c536efbb2a34605093.tar.gz flashrom-a7e0548cea45ec60616936c536efbb2a34605093.tar.bz2 flashrom-a7e0548cea45ec60616936c536efbb2a34605093.zip |
Fix coding style of flashrom by running indent on all files
indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs *.[ch]
Some minor fixups were required, and maybe a few more cosmetic
changes are needed.
Corresponding to flashrom svn r108 and coreboot v2 svn r2643.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'msys_doc.c')
-rw-r--r-- | msys_doc.c | 53 |
1 files changed, 11 insertions, 42 deletions
@@ -19,27 +19,18 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - - #include <stdio.h> #include <unistd.h> #include "flash.h" #include "msys_doc.h" #include "debug.h" - - - static int doc_wait(volatile uint8_t *bios, int timeout); static uint8_t doc_read_chipid(volatile uint8_t *bios); static uint8_t doc_read_docstatus(volatile uint8_t *bios); static uint8_t doc_read_cdsncontrol(volatile uint8_t *bios); static void doc_write_cdsncontrol(volatile uint8_t *bios, uint8_t data); - - - - int probe_md2802(struct flashchip *flash) { volatile uint8_t *bios = flash->virt_addr; @@ -72,11 +63,9 @@ int probe_md2802(struct flashchip *flash) printf("%s: switching off write protection ...\n", __FUNCTION__); doc_write_cdsncontrol(bios, doc_read_cdsncontrol(bios) & (~0x08)); - printf("%s: switching off write protection ... done\n", - __FUNCTION__); + printf("%s: switching off write protection ... done\n", __FUNCTION__); printf("%s:\n", __FUNCTION__); - chipid = doc_read_chipid(bios); #ifndef MSYSTEMS_DOC_NO_55AA_CHECKING id_0x55 = doc_read(bios, IPL_0x0000); @@ -140,9 +129,8 @@ int probe_md2802(struct flashchip *flash) printf("\n%s: toggle result: %d/%d\n", __FUNCTION__, toggle_a, toggle_b); - if (chipid == flash->model_id - && ((toggle_a == 5 && toggle_b == 0) - || (toggle_a == 0 && toggle_b == 5)) + if (chipid == flash->model_id && ((toggle_a == 5 && toggle_b == 0) + || (toggle_a == 0 && toggle_b == 5)) #ifndef MSYSTEMS_DOC_NO_55AA_CHECKING && id_0x55 == 0x55 && id_0xAA == 0xaa #endif /* !MSYSTEMS_DOC_NO_55AA_CHECKING */ @@ -153,37 +141,31 @@ int probe_md2802(struct flashchip *flash) return (0); } /* int probe_md2802(struct flashchip *flash) */ - - int read_md2802(struct flashchip *flash, uint8_t *buf) { return (0); } /* int read_md2802(struct flashchip *flash, uint8_t *buf) */ - - int erase_md2802(struct flashchip *flash) { volatile uint8_t *bios = flash->virt_addr; return (1); - *(volatile uint8_t *) (bios + 0x5555) = 0xAA; - *(volatile uint8_t *) (bios + 0x2AAA) = 0x55; - *(volatile uint8_t *) (bios + 0x5555) = 0x80; + *(volatile uint8_t *)(bios + 0x5555) = 0xAA; + *(volatile uint8_t *)(bios + 0x2AAA) = 0x55; + *(volatile uint8_t *)(bios + 0x5555) = 0x80; - *(volatile uint8_t *) (bios + 0x5555) = 0xAA; - *(volatile uint8_t *) (bios + 0x2AAA) = 0x55; - *(volatile uint8_t *) (bios + 0x5555) = 0x10; + *(volatile uint8_t *)(bios + 0x5555) = 0xAA; + *(volatile uint8_t *)(bios + 0x2AAA) = 0x55; + *(volatile uint8_t *)(bios + 0x5555) = 0x10; } /* int erase_md2802(struct flashchip *flash) */ - - int write_md2802(struct flashchip *flash, uint8_t *buf) { int i; - int total_size = flash->total_size * 1024, page_size = - flash->page_size; + int total_size = flash->total_size * 1024; + int page_size = flash->page_size; volatile uint8_t *bios = flash->virt_addr; return (1); @@ -205,11 +187,6 @@ int write_md2802(struct flashchip *flash, uint8_t *buf) return 0; } /* int write_md2802(struct flashchip *flash, uint8_t *buf) */ - - - - - /* wait timeout msec for doc to become ready return: @@ -237,8 +214,6 @@ static int doc_wait(volatile uint8_t *bios, int timeout) return (0); } /* static int doc_wait(volatile uint8_t *bios, int timeout) */ - - static uint8_t doc_read_docstatus(volatile uint8_t *bios) { doc_read(bios, CDSNSlowIO); @@ -247,8 +222,6 @@ static uint8_t doc_read_docstatus(volatile uint8_t *bios) return (doc_read(bios, _DOCStatus)); } /* static uint8_t doc_read_docstatus(volatile uint8_t *bios) */ - - static uint8_t doc_read_chipid(volatile uint8_t *bios) { doc_read(bios, CDSNSlowIO); @@ -257,8 +230,6 @@ static uint8_t doc_read_chipid(volatile uint8_t *bios) return (doc_read(bios, _ChipID)); } /* static uint8_t doc_read_chipid(volatile uint8_t *bios) */ - - static uint8_t doc_read_cdsncontrol(volatile uint8_t *bios) { uint8_t value; @@ -273,8 +244,6 @@ static uint8_t doc_read_cdsncontrol(volatile uint8_t *bios) return (value); } /* static uint8_t doc_read_chipid(volatile char *bios) */ - - static void doc_write_cdsncontrol(volatile uint8_t *bios, uint8_t data) { doc_write(data, bios, _CDSNControl); |