Index: board_enable.c
===================================================================
26a27
> #include <unistd.h>
30a32,33
> int usleep(useconds_t usec);
> 
148c151
< 	uint8_t enable_bit;	/* bit in 0x30 of that LDN to enable 
---
>         uint8_t enable_bit;     /* bit in 0x30 of that LDN to enable
876c879
< 		   easily told apart from each other by the class of the 
---
>                    easily told apart from each other by the class of the
1860a1864,2002
> 
> 
> static int wait_uc_writebuf_empty(uint16_t port)
> {
>     int count;
> 
>     for (count = 0; count < 50; count++)
>     {
>         /* quit if OBF bit clear */
>         if (!(INB(port + 4) & 2))
>         { 
>             msg_pinfo("EC write buffer is already empty.\n");
>             return 0;
>         }
>         usleep(10000);
>     }
>     msg_perr("wait_uc_writebuf_empty returned false or EC write buffer not empty.\n");
>     return -1;
> }
> 
> static int uc_send_command(uint16_t port, uint8_t command)
> {
>        if (wait_uc_writebuf_empty(port) != 0)
>                return -1;
>        OUTB(command, port + 4);
>        return 0;
> }
> 
> static int uc_send_data(uint16_t port, uint8_t command)
> {
>        if (wait_uc_writebuf_empty(port) != 0)
>                return -1;
>        OUTB(command, port);
>        return 0;
> }
> 
> static int compal_os_takeover_fan(void) 
> {
>     if(uc_send_command(0x60, 0x59) != 0) // system state notification
>     {
>         msg_perr("Unable to send System State Notification.\n");
>         return -1;
>     }
> 
>     if(uc_send_data(0x60, 0xA8) != 0) // disable EC fan control
>     {
>         msg_perr("Unable to disable fan control by the EC.\n");
>         return -1;
>     }
>     if(uc_send_command(0x60, 0x49) != 0) // thermal state notification
>     {
>         msg_perr("Unable to send Thermal State Notification.\n");
>         return -1;
>     }
>     if(uc_send_data(0x60, 0xA2) != 0) // set fans to level 2
>     {
>         msg_perr("Unable to set fans to high speed.\n");
>         return -1;
>     }
>     return 0;
> }
> 
> static int compal_pc87591_flash_enable(void) 
> {
>     int i;
>     unsigned int flashcontrolbase;
> 
>     /* select logical device 0xf: shared BIOS and flash control */
>     sio_write(0x4C, 0x7, 0xF);
>     sio_write(0x4C, 0x30, 0x1); /* activate processor access */
> 
>     /* get I/O base address */
>     flashcontrolbase = sio_read(0x4C, 0x61) | (sio_read(0x4C, 0x60) << 8);
>     msg_pinfo("flash control base address is 0x%x\n", flashcontrolbase);
>     for(i = 0; i < 16; i++)
>         OUTB(i * 0x10, flashcontrolbase+8); /* remove protection of flash segment i */
> 
>     if(uc_send_command(0x60, 0x59) != 0) // system state notification
>     {
>         msg_perr("Unable to send System State Notification.\n");
>         return -1;
>     }
> 
>     if(uc_send_data(0x60, 0xF2) != 0) // enter flash mode
>     {
>         msg_perr("Unable to put the EC into flash mode.\n");
>         return -1;
>     }
> 
>     return 0;
> }
> 
> static int intel_ich_gpio25_lower(void)
> {
>        return intel_ich_gpio_set(25, 0);
> }
> 
> static void toshiba_flashmode_exit(void * cmdptr) 
> {
>        if(uc_send_command(0x60, 0x49) != 0) // thermal state notification
>        {
>            msg_perr("Unable to send Thermal State Notification.\n");
>            return;
>        }
> 
>        if(uc_send_data(0x60, 0xA1) != 0) // set fans back to level 1
>        {
>            msg_perr("Unable to set fans back to level 1.\n");
>            return;
>        }
> }
> 
> static int board_toshiba_satellite_s520(void) 
> {
>     /* Copyright (C) 2004 Toshiba and Compal. */
>     if(compal_os_takeover_fan() != 0)
>     {
>         msg_perr("compal_os_takeover_fan() is not returning 0.\n");
>         return -1;
>     }
> 
>     if(compal_pc87591_flash_enable() != 0)
>     {
>         msg_perr("compal_pc87591_flash_enable() is not returning 0.\n");
>         return -1;
>     }
> 
> 
>     if (intel_ich_gpio25_lower() != 0)
>     { 
>         msg_perr("Unable to lower GPIO 25.\n");
>     	return -1;
>     }
> 
>     register_shutdown(toshiba_flashmode_exit, NULL);
>     buses_supported = CHIP_BUSTYPE_PARALLEL;
>     return 0;
> }
> 
1966c2108
< 	{0x8086, 0x2415, 0x103c, 0x1250,  0x10b7, 0x9200, 0x103c, 0x1247, NULL,          NULL,         NULL,          "HP",          "e-Vectra P2706T",       0,   OK, board_hp_p2706t}, 
---
>         {0x8086, 0x2415, 0x103c, 0x1250,  0x10b7, 0x9200, 0x103c, 0x1247, NULL,          NULL,         NULL,          "HP",          "e-Vectra P2706T",       0,   OK, board_hp_p2706t},
1970c2112
< 	{0x8086, 0x2415, 0x103c, 0x1249,  0x10b7, 0x9200, 0x103c, 0x1246, NULL,          NULL,         NULL,          "HP",          "Vectra VL400",          0,   OK, board_hp_vl400}, 
---
>         {0x8086, 0x2415, 0x103c, 0x1249,  0x10b7, 0x9200, 0x103c, 0x1246, NULL,          NULL,         NULL,          "HP",          "Vectra VL400",          0,   OK, board_hp_vl400},
2002a2145
>         {0x8086, 0x24d0, 0,      0,       0x8086, 0x24d3, 0x1179, 0xff00, "^BTQ00$",     "toshiba",    "btq00",       "COMPAL",      "BTQ00",                 0,   OK, board_toshiba_satellite_s520},
