diff options
-rw-r--r-- | 82802ab.c | 15 | ||||
-rw-r--r-- | am29f040b.c | 8 | ||||
-rw-r--r-- | board_enable.c | 62 | ||||
-rw-r--r-- | chipset_enable.c | 17 | ||||
-rw-r--r-- | flashchips.c | 2 | ||||
-rw-r--r-- | flashrom.c | 9 | ||||
-rw-r--r-- | jedec.c | 14 | ||||
-rw-r--r-- | layout.c | 2 | ||||
-rw-r--r-- | lbtable.c | 8 | ||||
-rw-r--r-- | m29f400bt.c | 8 | ||||
-rw-r--r-- | msys_doc.c | 31 | ||||
-rw-r--r-- | mx29f002.c | 4 | ||||
-rw-r--r-- | pm49fl004.c | 2 | ||||
-rw-r--r-- | sharplhf00l04.c | 15 | ||||
-rw-r--r-- | sst28sf040.c | 8 | ||||
-rw-r--r-- | sst39sf020.c | 4 | ||||
-rw-r--r-- | sst49lf040.c | 4 | ||||
-rw-r--r-- | sst49lfxxxc.c | 12 | ||||
-rw-r--r-- | sst_fwhub.c | 8 | ||||
-rw-r--r-- | w49f002u.c | 2 |
20 files changed, 120 insertions, 115 deletions
@@ -77,7 +77,6 @@ int probe_82802ab(struct flashchip *flash) uint8_t wait_82802ab(volatile uint8_t *bios) { - uint8_t status; uint8_t id1, id2; @@ -100,9 +99,10 @@ uint8_t wait_82802ab(volatile uint8_t *bios) *(volatile uint8_t *)(bios + 0x5555) = 0xAA; *(volatile uint8_t *)(bios + 0x2AAA) = 0x55; *(volatile uint8_t *)(bios + 0x5555) = 0xF0; - return status; + return status; } + int erase_82802ab_block(struct flashchip *flash, int offset) { volatile uint8_t *bios = flash->virtual_memory + offset; @@ -126,8 +126,10 @@ int erase_82802ab_block(struct flashchip *flash, int offset) status = wait_82802ab(flash->virtual_memory); //print_82802ab_status(status); printf("DONE BLOCK 0x%x\n", offset); - return (0); + + return 0; } + int erase_82802ab(struct flashchip *flash) { int i; @@ -138,7 +140,8 @@ int erase_82802ab(struct flashchip *flash) for (i = 0; i < total_size; i += flash->page_size) erase_82802ab_block(flash, i); printf("DONE ERASE\n"); - return (0); + + return 0; } void write_page_82802ab(volatile uint8_t *bios, uint8_t *src, @@ -152,7 +155,6 @@ void write_page_82802ab(volatile uint8_t *bios, uint8_t *src, *dst++ = *src++; wait_82802ab(bios); } - } int write_82802ab(struct flashchip *flash, uint8_t *buf) @@ -176,5 +178,6 @@ int write_82802ab(struct flashchip *flash, uint8_t *buf) } printf("\n"); protect_jedec(bios); - return (0); + + return 0; } diff --git a/am29f040b.c b/am29f040b.c index e7f318b..d1c1f22 100644 --- a/am29f040b.c +++ b/am29f040b.c @@ -41,7 +41,7 @@ static __inline__ int erase_sector_29f040b(volatile uint8_t *bios, /* wait for Toggle bit ready */ toggle_ready_jedec(bios + address); - return (0); + return 0; } static __inline__ int write_sector_29f040b(volatile uint8_t *bios, @@ -68,7 +68,7 @@ static __inline__ int write_sector_29f040b(volatile uint8_t *bios, printf("\b\b\b\b\b\b\b\b\b\b"); } - return (0); + return 0; } int probe_29f040b(struct flashchip *flash) @@ -108,7 +108,7 @@ int erase_29f040b(struct flashchip *flash) myusec_delay(10); toggle_ready_jedec(bios); - return (0); + return 0; } int write_29f040b(struct flashchip *flash, uint8_t *buf) @@ -131,5 +131,5 @@ int write_29f040b(struct flashchip *flash, uint8_t *buf) } printf("\n"); - return (0); + return 0; } diff --git a/board_enable.c b/board_enable.c index 983fd18..e9066de 100644 --- a/board_enable.c +++ b/board_enable.c @@ -22,7 +22,7 @@ #include "flash.h" /* - * Helper functions for many Winbond superIOs of the w836xx range. + * Helper functions for many Winbond Super I/Os of the W836xx range. */ #define W836_INDEX 0x2E #define W836_DATA 0x2F @@ -40,7 +40,7 @@ static void w836xx_ext_leave(void) outb(0xAA, W836_INDEX); } -/* General functions for read/writing WB SuperIOs */ +/* General functions for reading/writing Winbond Super I/Os. */ static unsigned char wbsio_read(unsigned char index) { outb(index, W836_INDEX); @@ -53,8 +53,8 @@ static void wbsio_write(unsigned char index, unsigned char data) outb(data, W836_DATA); } -static void -wbsio_mask(unsigned char index, unsigned char data, unsigned char mask) +static void wbsio_mask(unsigned char index, unsigned char data, + unsigned char mask) { unsigned char tmp; @@ -63,14 +63,13 @@ wbsio_mask(unsigned char index, unsigned char data, unsigned char mask) outb(tmp | (data & mask), W836_DATA); } -/* - * WinBond w83627hf: raise GPIO24. +/** + * Winbond W83627HF: Raise GPIO24. * * Suited for: - * * Agami Aruma - * * IWILL DK8-HTX + * - Agami Aruma + * - IWILL DK8-HTX */ - static int w83627hf_gpio24_raise(const char *name) { w836xx_ext_enter(); @@ -101,12 +100,11 @@ static int w83627hf_gpio24_raise(const char *name) return 0; } -/* +/** * Suited for VIAs EPIA M and MII, and maybe other CLE266 based EPIAs. * - * We don't need to do this when using linuxbios, GPIO15 is never lowered there. + * We don't need to do this when using LinuxBIOS, GPIO15 is never lowered there. */ - static int board_via_epia_m(const char *name) { struct pci_dev *dev; @@ -135,12 +133,11 @@ static int board_via_epia_m(const char *name) return 0; } -/* +/** * Suited for: - * ASUS A7V8X-MX SE and A7V400-MX: AMD K7 + VIA KM400A + VT8235 - * Tyan Tomcat K7M: AMD Geode NX + VIA KM400 + VT8237. + * - ASUS A7V8X-MX SE and A7V400-MX: AMD K7 + VIA KM400A + VT8235 + * - Tyan Tomcat K7M: AMD Geode NX + VIA KM400 + VT8237. */ - static int board_asus_a7v8x_mx(const char *name) { struct pci_dev *dev; @@ -170,14 +167,13 @@ static int board_asus_a7v8x_mx(const char *name) return 0; } -/* +/** * Suited for ASUS P5A. * * This is rather nasty code, but there's no way to do this cleanly. * We're basically talking to some unknown device on SMBus, my guess * is that it is the Winbond W83781D that lives near the DIP BIOS. */ - static int board_asus_p5a(const char *name) { uint8_t tmp; @@ -278,16 +274,14 @@ static int board_epox_ep_bx3(const char *name) return 0; } -/* - * We use 2 sets of ids here, you're free to choose which is which. This - * to provide a very high degree of certainty when matching a board on - * the basis of Subsystem/card ids. As not every vendor handles - * subsystem/card ids in a sane manner. - * - * Keep the second set nulled if it should be ignored. +/** + * We use 2 sets of IDs here, you're free to choose which is which. This + * is to provide a very high degree of certainty when matching a board on + * the basis of subsystem/card IDs. As not every vendor handles + * subsystem/card IDs in a sane manner. * + * Keep the second set NULLed if it should be ignored. */ - struct board_pciid_enable { /* Any device, but make it sensible, like the isa bridge. */ uint16_t first_vendor; @@ -331,10 +325,9 @@ struct board_pciid_enable board_pciid_enables[] = { {0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL} /* Keep this */ }; -/* - * Match boards on linuxbios table gathered vendor and part name. - * Require main pci-ids to match too as extra safety. - * +/** + * Match boards on LinuxBIOS table gathered vendor and part name. + * Require main PCI IDs to match too as extra safety. */ static struct board_pciid_enable *board_match_linuxbios_name(char *vendor, char *part) @@ -359,9 +352,9 @@ static struct board_pciid_enable *board_match_linuxbios_name(char *vendor, return NULL; } -/* - * Match boards on pci ids and subsystem ids. - * Second set of ids can be main only or missing completely. +/** + * Match boards on PCI IDs and subsystem IDs. + * Second set of IDs can be main only or missing completely. */ static struct board_pciid_enable *board_match_pci_card_ids(void) { @@ -396,9 +389,6 @@ static struct board_pciid_enable *board_match_pci_card_ids(void) return NULL; } -/* - * - */ int board_flash_enable(char *vendor, char *part) { struct board_pciid_enable *board = NULL; diff --git a/chipset_enable.c b/chipset_enable.c index e3b0250..3b80149 100644 --- a/chipset_enable.c +++ b/chipset_enable.c @@ -112,6 +112,7 @@ static int enable_flash_piix4(struct pci_dev *dev, char *name) printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n", xbcs, new, name); return -1; } + return 0; } @@ -145,6 +146,7 @@ static int enable_flash_ich(struct pci_dev *dev, char *name, int bios_cntl) printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n", bios_cntl, new, name); return -1; } + return 0; } @@ -158,14 +160,11 @@ static int enable_flash_ich_dc(struct pci_dev *dev, char *name) return enable_flash_ich(dev, name, 0xdc); } -/* - * - */ static int enable_flash_vt823x(struct pci_dev *dev, char *name) { uint8_t val; - /* ROM Write enable */ + /* ROM write enable */ val = pci_read_byte(dev, 0x40); val |= 0x10; pci_write_byte(dev, 0x40, val); @@ -221,6 +220,7 @@ static int enable_flash_sc1100(struct pci_dev *dev, char *name) printf("tried to set register 0x%x to 0x%x on %s failed (WARNING ONLY)\n", 0x52, new, name); return -1; } + return 0; } @@ -243,6 +243,7 @@ static int enable_flash_sis5595(struct pci_dev *dev, char *name) printf("Stuck at 0x%x\n", newer); return -1; } + return 0; } @@ -275,6 +276,7 @@ static int enable_flash_amd8111(struct pci_dev *dev, char *name) printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n", 0x40, new, name); return -1; } + return 0; } @@ -308,6 +310,7 @@ static int enable_flash_ck804(struct pci_dev *dev, char *name) printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n", 0x6d, new, name); return -1; } + return 0; } @@ -393,7 +396,6 @@ static int enable_flash_mcp55(struct pci_dev *dev, char *name) } return 0; - } static int enable_flash_ht1000(struct pci_dev *dev, char *name) @@ -406,7 +408,7 @@ static int enable_flash_ht1000(struct pci_dev *dev, char *name) pci_write_byte(dev, 0x41, byte); byte = pci_read_byte(dev, 0x43); - byte |= (1<<4); + byte |= (1 << 4); pci_write_byte(dev, 0x43, byte); return 0; @@ -473,9 +475,6 @@ static FLASH_ENABLE enables[] = { {0x1166, 0x0205, "Broadcom HT-1000", enable_flash_ht1000}, }; -/* - * - */ int chipset_flash_enable(void) { struct pci_dev *dev = 0; diff --git a/flashchips.c b/flashchips.c index 2b486be..0437677 100644 --- a/flashchips.c +++ b/flashchips.c @@ -150,5 +150,3 @@ struct flashchip flashchips[] = { probe_jedec, erase_chip_jedec, write_49f002}, {NULL,} }; - - @@ -49,12 +49,8 @@ char *chip_to_probe = NULL; struct pci_access *pacc; /* For board and chipset_enable */ int exclude_start_page, exclude_end_page; int force = 0, verbose = 0; - int fd_mem; -/* - * - */ struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device) { struct pci_dev *temp; @@ -71,9 +67,6 @@ struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device) return NULL; } -/* - * - */ struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device, uint16_t card_vendor, uint16_t card_device) { @@ -163,6 +156,7 @@ struct flashchip *probe_flash(struct flashchip *flash) flash++; } + return NULL; } @@ -196,6 +190,7 @@ int verify_flash(struct flashchip *flash, uint8_t *buf) printf("\b\b\b\b\b\b\b\b\b\b "); printf("- VERIFIED \n"); + return 0; } @@ -135,7 +135,7 @@ int erase_sector_jedec(volatile uint8_t *bios, unsigned int page) /* wait for Toggle bit ready */ toggle_ready_jedec(bios); - return (0); + return 0; } int erase_block_jedec(volatile uint8_t *bios, unsigned int block) @@ -158,7 +158,7 @@ int erase_block_jedec(volatile uint8_t *bios, unsigned int block) /* wait for Toggle bit ready */ toggle_ready_jedec(bios); - return (0); + return 0; } int erase_chip_jedec(struct flashchip *flash) @@ -182,7 +182,7 @@ int erase_chip_jedec(struct flashchip *flash) toggle_ready_jedec(bios); - return (0); + return 0; } int write_page_write_jedec(volatile uint8_t *bios, uint8_t *src, @@ -229,7 +229,7 @@ retry: fprintf(stderr, " page %d failed!\n", (unsigned int)(d - bios) / page_size); } - return (!ok); + return !ok; } int write_byte_program_jedec(volatile uint8_t *bios, uint8_t *src, @@ -259,7 +259,7 @@ retry: if (tried >= MAX_REFLASH_TRIES) ok = 0; - return (!ok); + return !ok; } int write_sector_jedec(volatile uint8_t *bios, uint8_t *src, @@ -272,7 +272,7 @@ int write_sector_jedec(volatile uint8_t *bios, uint8_t *src, dst++, src++; } - return (0); + return 0; } int write_jedec(struct flashchip *flash, uint8_t *buf) @@ -301,5 +301,5 @@ int write_jedec(struct flashchip *flash, uint8_t *buf) printf("\n"); protect_jedec(bios); - return (0); + return 0; } @@ -134,6 +134,7 @@ int read_romlayout(char *name) } fclose(romlayout); + return 0; } @@ -155,6 +156,7 @@ int find_romentry(char *name) } printf("not found.\n"); // Not found. Error. + return -1; } @@ -44,6 +44,7 @@ static unsigned long compute_checksum(void *addr, unsigned long length) } value; unsigned long sum; unsigned long i; + /* In the most straight forward way possible, * compute an ip style checksum. */ @@ -64,6 +65,7 @@ static unsigned long compute_checksum(void *addr, unsigned long length) } value.byte[0] = sum & 0xff; value.byte[1] = (sum >> 8) & 0xff; + return (~value.word) & 0xFFFF; } @@ -78,10 +80,12 @@ static int count_lb_records(struct lb_header *head) { struct lb_record *rec; int count; + count = 0; for_each_lbrec(head, rec) { count++; } + return count; } @@ -89,6 +93,7 @@ static struct lb_header *find_lb_table(void *base, unsigned long start, unsigned long end) { unsigned long addr; + /* For now be stupid.... */ for (addr = start; addr < end; addr += 16) { struct lb_header *head = @@ -123,6 +128,7 @@ static struct lb_header *find_lb_table(void *base, unsigned long start, return head; }; + return 0; } @@ -131,6 +137,7 @@ static void find_mainboard(struct lb_record *ptr, unsigned long addr) struct lb_mainboard *rec; int max_size; char vendor[256], part[256]; + rec = (struct lb_mainboard *)ptr; max_size = rec->size - sizeof(*rec); printf("vendor id: %.*s part id: %.*s\n", @@ -206,5 +213,6 @@ int linuxbios_init(void) printf("No LinuxBIOS table found.\n"); return -1; } + return 0; } diff --git a/m29f400bt.c b/m29f400bt.c index eb97591..f409fec 100644 --- a/m29f400bt.c +++ b/m29f400bt.c @@ -100,7 +100,7 @@ int erase_m29f400bt(struct flashchip *flash) myusec_delay(10); toggle_ready_jedec(bios); - return (0); + return 0; } int block_erase_m29f400bt(volatile uint8_t *bios, volatile uint8_t *dst) @@ -118,7 +118,7 @@ int block_erase_m29f400bt(volatile uint8_t *bios, volatile uint8_t *dst) myusec_delay(10); toggle_ready_jedec(bios); - return (0); + return 0; } int write_m29f400bt(struct flashchip *flash, uint8_t *buf) @@ -173,7 +173,7 @@ int write_m29f400bt(struct flashchip *flash, uint8_t *buf) printf("\n"); //protect_m29f400bt (bios); - return (0); + return 0; } int write_linuxbios_m29f400bt(struct flashchip *flash, uint8_t *buf) @@ -215,5 +215,5 @@ int write_linuxbios_m29f400bt(struct flashchip *flash, uint8_t *buf) printf("\n"); //protect_m29f400bt (bios); - return (0); + return 0; } @@ -134,23 +134,23 @@ int probe_md2802(struct flashchip *flash) && id_0x55 == 0x55 && id_0xAA == 0xaa #endif /* !MSYSTEMS_DOC_NO_55AA_CHECKING */ ) { - return (1); + return 1; } - return (0); -} /* int probe_md2802(struct flashchip *flash) */ + return 0; +} int read_md2802(struct flashchip *flash, uint8_t *buf) { - - return (0); -} /* int read_md2802(struct flashchip *flash, uint8_t *buf) */ + return 0; +} int erase_md2802(struct flashchip *flash) { volatile uint8_t *bios = flash->virtual_memory; - return (1); + return 1; + *(volatile uint8_t *)(bios + 0x5555) = 0xAA; *(volatile uint8_t *)(bios + 0x2AAA) = 0x55; *(volatile uint8_t *)(bios + 0x5555) = 0x80; @@ -158,7 +158,7 @@ int erase_md2802(struct flashchip *flash) *(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) { @@ -192,6 +192,7 @@ int write_md2802(struct flashchip *flash, uint8_t *buf) 0: ready -1: timeout expired */ + static int doc_wait(volatile uint8_t *bios, int timeout) { int i = 20; @@ -210,8 +211,8 @@ static int doc_wait(volatile uint8_t *bios, int timeout) return (-1); } - return (0); -} /* static int doc_wait(volatile uint8_t *bios, int timeout) */ + return 0; +} static uint8_t doc_read_docstatus(volatile uint8_t *bios) { @@ -219,7 +220,7 @@ static uint8_t doc_read_docstatus(volatile uint8_t *bios) doc_read_2nop(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) { @@ -227,7 +228,7 @@ static uint8_t doc_read_chipid(volatile uint8_t *bios) doc_read_2nop(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) { @@ -240,11 +241,11 @@ static uint8_t doc_read_cdsncontrol(volatile uint8_t *bios) value = doc_read(bios, _CDSNControl); doc_read_2nop(bios); - return (value); -} /* static uint8_t doc_read_chipid(volatile char *bios) */ + return value; +} static void doc_write_cdsncontrol(volatile uint8_t *bios, uint8_t data) { doc_write(data, bios, _CDSNControl); doc_read_4nop(bios); -} /* static void doc_write_chipid(volatile char *bios, uint8_t data) */ +} @@ -79,7 +79,7 @@ int erase_29f002(struct flashchip *flash) *(bios + 0x3bfff) = 0x30; #endif - return (0); + return 0; } int write_29f002(struct flashchip *flash, uint8_t *buf) @@ -113,5 +113,5 @@ int write_29f002(struct flashchip *flash, uint8_t *buf) #endif printf("\n"); - return (0); + return 0; } diff --git a/pm49fl004.c b/pm49fl004.c index 42442cf..a2e22b9 100644 --- a/pm49fl004.c +++ b/pm49fl004.c @@ -51,5 +51,5 @@ int write_49fl004(struct flashchip *flash, uint8_t *buf) } printf("\n"); - return (0); + return 0; } diff --git a/sharplhf00l04.c b/sharplhf00l04.c index 1c93cc6..86d8799 100644 --- a/sharplhf00l04.c +++ b/sharplhf00l04.c @@ -77,7 +77,6 @@ int probe_lhf00l04(struct flashchip *flash) uint8_t wait_lhf00l04(volatile uint8_t *bios) { - uint8_t status; uint8_t id1, id2; @@ -100,9 +99,10 @@ uint8_t wait_lhf00l04(volatile uint8_t *bios) *(volatile uint8_t *)(bios + 0x5555) = 0xAA; *(volatile uint8_t *)(bios + 0x2AAA) = 0x55; *(volatile uint8_t *)(bios + 0x5555) = 0xF0; - return status; + return status; } + int erase_lhf00l04_block(struct flashchip *flash, int offset) { volatile uint8_t *bios = flash->virtual_memory + offset; @@ -128,8 +128,10 @@ int erase_lhf00l04_block(struct flashchip *flash, int offset) status = wait_lhf00l04(flash->virtual_memory); print_lhf00l04_status(status); printf("DONE BLOCK 0x%x\n", offset); - return (0); + + return 0; } + int erase_lhf00l04(struct flashchip *flash) { int i; @@ -140,7 +142,8 @@ int erase_lhf00l04(struct flashchip *flash) for (i = 0; i < total_size; i += flash->page_size) erase_lhf00l04_block(flash, i); printf("DONE ERASE\n"); - return (0); + + return 0; } void write_page_lhf00l04(volatile uint8_t *bios, uint8_t *src, @@ -154,7 +157,6 @@ void write_page_lhf00l04(volatile uint8_t *bios, uint8_t *src, *dst++ = *src++; wait_lhf00l04(bios); } - } int write_lhf00l04(struct flashchip *flash, uint8_t *buf) @@ -178,5 +180,6 @@ int write_lhf00l04(struct flashchip *flash, uint8_t *buf) } printf("\n"); protect_jedec(bios); - return (0); + + return 0; } diff --git a/sst28sf040.c b/sst28sf040.c index 80412c5..7f14f49 100644 --- a/sst28sf040.c +++ b/sst28sf040.c @@ -73,7 +73,7 @@ static __inline__ int erase_sector_28sf040(volatile uint8_t *bios, /* wait for Toggle bit ready */ toggle_ready_jedec(bios); - return (0); + return 0; } static __inline__ int write_sector_28sf040(volatile uint8_t *bios, @@ -98,7 +98,7 @@ static __inline__ int write_sector_28sf040(volatile uint8_t *bios, toggle_ready_jedec(bios); } - return (0); + return 0; } int probe_28sf040(struct flashchip *flash) @@ -137,7 +137,7 @@ int erase_28sf040(struct flashchip *flash) myusec_delay(10); toggle_ready_jedec(bios); - return (0); + return 0; } int write_28sf040(struct flashchip *flash, uint8_t *buf) @@ -164,5 +164,5 @@ int write_28sf040(struct flashchip *flash, uint8_t *buf) protect_28sf040(bios); - return (0); + return 0; } diff --git a/sst39sf020.c b/sst39sf020.c index bfcead6..197d612 100644 --- a/sst39sf020.c +++ b/sst39sf020.c @@ -42,7 +42,7 @@ static __inline__ int erase_sector_39sf020(volatile uint8_t *bios, /* wait for Toggle bit ready */ toggle_ready_jedec(bios); - return (0); + return 0; } int write_39sf020(struct flashchip *flash, uint8_t *buf) @@ -65,5 +65,5 @@ int write_39sf020(struct flashchip *flash, uint8_t *buf) } printf("\n"); - return (0); + return 0; } diff --git a/sst49lf040.c b/sst49lf040.c index 884895e..e5af545 100644 --- a/sst49lf040.c +++ b/sst49lf040.c @@ -24,6 +24,7 @@ * TODO: Consilidated to standard JEDEC code. * */ + #include <stdio.h> #include "flash.h" @@ -39,6 +40,7 @@ int erase_49lf040(struct flashchip *flash) * for the 49lf040. Use sector-erase instead */ erase_sector_jedec(bios, i * page_size); } + return 0; } @@ -67,5 +69,5 @@ int write_49lf040(struct flashchip *flash, uint8_t *buf) } printf("\n"); - return (0); + return 0; } diff --git a/sst49lfxxxc.c b/sst49lfxxxc.c index 8480877..2ca5842 100644 --- a/sst49lfxxxc.c +++ b/sst49lfxxxc.c @@ -71,7 +71,7 @@ static __inline__ int write_lockbits_49lfxxxc(volatile uint8_t *bios, int size, //printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFc00000 - size + address + 2, *(bios + address + 2) ); *(bios + address + 2) = bits; - return (0); + return 0; } static __inline__ int erase_sector_49lfxxxc(volatile uint8_t *bios, @@ -91,7 +91,7 @@ static __inline__ int erase_sector_49lfxxxc(volatile uint8_t *bios, } } while (!(status & STATUS_WSMS)); - return (0); + return 0; } static __inline__ int write_sector_49lfxxxc(volatile uint8_t *bios, @@ -124,7 +124,7 @@ static __inline__ int write_sector_49lfxxxc(volatile uint8_t *bios, } while (!(status & STATUS_WSMS)); } - return (0); + return 0; } int probe_49lfxxxc(struct flashchip *flash) @@ -164,7 +164,8 @@ int erase_49lfxxxc(struct flashchip *flash) return (-1); *bios = RESET; - return (0); + + return 0; } int write_49lfxxxc(struct flashchip *flash, uint8_t *buf) @@ -189,5 +190,6 @@ int write_49lfxxxc(struct flashchip *flash, uint8_t *buf) printf("\n"); *bios = RESET; - return (0); + + return 0; } diff --git a/sst_fwhub.c b/sst_fwhub.c index 9e4539b..c7266e8 100644 --- a/sst_fwhub.c +++ b/sst_fwhub.c @@ -56,7 +56,7 @@ int erase_sst_fwhub_block(struct flashchip *flash, int offset) erase_block_jedec(flash->virtual_memory, offset); toggle_ready_jedec(flash->virtual_memory); - return (0); + return 0; } int erase_sst_fwhub(struct flashchip *flash) @@ -66,7 +66,8 @@ int erase_sst_fwhub(struct flashchip *flash) for (i = 0; i < total_size; i += flash->page_size) erase_sst_fwhub_block(flash, i); - return (0); + + return 0; } int write_sst_fwhub(struct flashchip *flash, uint8_t *buf) @@ -95,5 +96,6 @@ int write_sst_fwhub(struct flashchip *flash, uint8_t *buf) printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"); } printf("\n"); - return (0); + + return 0; } @@ -49,5 +49,5 @@ int write_49f002(struct flashchip *flash, uint8_t *buf) } printf("\n"); - return (0); + return 0; } |