Changeset 933 for trunk/board_enable.c


Ignore:
Timestamp:
03/13/10 18:28:29 (2 years ago)
Author:
uwe
Message:

Various coding style and cosmetic changes (trivial).

  • Fix coding-style, whitespace, and indentation in a few places.
  • Consistently use the same spelling ("Super I/O") everywhere.
  • Make some flashrom stdout output look a bit nicer.


Signed-off-by: Uwe Hermann <uwe@…>
Acked-by: Uwe Hermann <uwe@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/board_enable.c

    r930 r933  
    8080        case SUPERIO_VENDOR_ITE: 
    8181                enter_conf_mode_ite(superio.port); 
    82                 /* Enable flash mapping. Works for most old ITE style SuperI/O. */ 
     82                /* Enable flash mapping. Works for most old ITE style Super I/O. */ 
    8383                tmp = sio_read(superio.port, 0x24); 
    8484                tmp |= 0xfc; 
     
    8888                break; 
    8989        default: 
    90                 printf_debug("Unhandled SuperI/O type!\n"); 
     90                printf_debug("Unhandled Super I/O type!\n"); 
    9191                ret = -1; 
    9292                break; 
     
    227227 *  - Shuttle AK38N: VIA KT333CF + VIA VT8235 + ITE IT8705F 
    228228 * 
    229  * SIS950 superio probably requires the same flash write enable. 
     229 * The SIS950 Super I/O probably requires the same flash write enable. 
    230230 */ 
    231231static int it8705f_write_enable_2e(const char *name) 
     
    240240        int gpio_pin = gpio % 8; 
    241241        uint16_t baseport; 
    242         uint8_t id; 
    243         uint8_t val; 
    244  
    245         if (gpio_bank > 4) 
    246         { 
     242        uint8_t id, val; 
     243 
     244        if (gpio_bank > 4) { 
    247245                fprintf(stderr, "PC87360: Invalid GPIO %d\n", gpio); 
    248246                return -1; 
     
    250248 
    251249        id = sio_read(0x2E, 0x20); 
    252         if (id != 0xE1) 
    253         { 
     250        if (id != 0xE1) { 
    254251                fprintf(stderr, "PC87360: unexpected ID %02x\n", id); 
    255252                return -1; 
    256253        } 
    257254 
    258         sio_write(0x2E, 0x07, 0x07);            /* select GPIO device */ 
     255        sio_write(0x2E, 0x07, 0x07);            /* Select GPIO device */ 
    259256        baseport = (sio_read(0x2E, 0x60) << 8) | sio_read(0x2E, 0x61); 
    260         if((baseport & 0xFFF0) == 0xFFF0 || baseport == 0) 
    261         { 
     257        if ((baseport & 0xFFF0) == 0xFFF0 || baseport == 0) { 
    262258                fprintf (stderr, "PC87360: invalid GPIO base address %04x\n", 
    263259                         baseport); 
     
    265261        } 
    266262        sio_mask (0x2E, 0x30, 0x01, 0x01);      /* Enable logical device */ 
    267         sio_write(0x2E, 0xF0, gpio_bank*16 + gpio_pin); 
     263        sio_write(0x2E, 0xF0, gpio_bank * 16 + gpio_pin); 
    268264        sio_mask (0x2E, 0xF1, 0x01, 0x01);      /* Make pin output */ 
    269265 
    270266        val = INB(baseport + bankbase[gpio_bank]); 
    271         if(raise) 
     267        if (raise) 
    272268                val |= 1 << gpio_pin; 
    273269        else 
     
    10291025{ 
    10301026        struct pci_dev *dev; 
    1031         uint16_t base; 
    1032         uint16_t temp; 
     1027        uint16_t base, temp; 
    10331028 
    10341029        dev = pci_dev_find(0x1039, 0x0962); 
     
    11341129 
    11351130        if (id != 0x8701) { 
    1136                 fprintf(stderr, "\nERROR: IT8703F SuperIO not found.\n"); 
     1131                fprintf(stderr, "\nERROR: IT8703F Super I/O not found.\n"); 
    11371132                return -1; 
    11381133        } 
     
    11451140 
    11461141        if (!base) { 
    1147                 fprintf(stderr, "\nERROR: Failed to read IT8703F SuperIO GPIO" 
     1142                fprintf(stderr, "\nERROR: Failed to read IT8703F Super I/O GPIO" 
    11481143                        " Base.\n"); 
    11491144                return -1; 
     
    11621157 * There is only some limited checking on the port numbers. 
    11631158 */ 
    1164 static int 
    1165 it8712f_gpio_set(unsigned int line, int raise) 
     1159static int it8712f_gpio_set(unsigned int line, int raise) 
    11661160{ 
    11671161        unsigned int port; 
     
    11871181 
    11881182        if (id != 0x8712) { 
    1189                 fprintf(stderr, "\nERROR: IT8712F SuperIO not found.\n"); 
     1183                fprintf(stderr, "\nERROR: IT8712F Super I/O not found.\n"); 
    11901184                return -1; 
    11911185        } 
     
    11981192 
    11991193        if (!base) { 
    1200                 fprintf(stderr, "\nERROR: Failed to read IT8712F SuperIO GPIO" 
     1194                fprintf(stderr, "\nERROR: Failed to read IT8712F Super I/O GPIO" 
    12011195                        " Base.\n"); 
    12021196                return -1; 
     
    14471441 
    14481442        if (board && board->status == NT) { 
    1449                 if (!force_boardenable) 
    1450                 { 
     1443                if (!force_boardenable) { 
    14511444                        printf("WARNING: Your mainboard is %s %s, but the mainboard-specific\n" 
    14521445                               "code has not been tested, and thus will not not be executed by default.\n" 
     
    14541447                               "can fail without running the board specific code.\n\n" 
    14551448                               "Please see the man page (section PROGRAMMER SPECIFIC INFO, subsection\n" 
    1456                                "\"internal programmer\") for details\n", 
     1449                               "\"internal programmer\") for details.\n", 
    14571450                               board->vendor_name, board->board_name); 
    14581451                        board = NULL; 
    1459                 } 
    1460                 else 
     1452                } else { 
    14611453                        printf("NOTE: Running an untested board enable procedure.\n" 
    1462                                "Please report success/failure to flashrom@flashrom.org\n"); 
     1454                               "Please report success/failure to flashrom@flashrom.org.\n"); 
     1455                } 
    14631456        } 
    14641457 
Note: See TracChangeset for help on using the changeset viewer.