#include <cpu/x86/smm.h>
#include "southbridge/intel/i82801gx/nvs.h"
#include <ec/acpi/ec.h>
+#include <pc80/mc146818rtc.h>
+#include <ec/lenovo/h8/h8.h>
#include "dock.h"
#include "smi.h"
printk(BIOS_DEBUG, "initializing SMI\n");
/* Enable 0x1600/0x1600 register pair */
ec_set_bit(0x00, 0x05);
- ec_set_ports(0x1604, 0x1600);
+}
+
+static void mainboard_smi_save_cmos(void)
+{
+ u8 val;
+ u8 tmp70, tmp72, tmpcf8;
+
+ tmp70 = inb(0x70);
+ tmp72 = inb(0x72);
+ tmpcf8 = inl(0xcf8);
+
+ val = pci_read_config8(PCI_DEV(0, 2, 1), 0xf4);
+ set_option("tft_brightness", &val);
+ val = ec_read(H8_VOLUME_CONTROL);
+ set_option("volume", &val);
+
+ outb(tmp70, 0x70);
+ outb(tmp72, 0x72);
+ outb(tmpcf8, 0xcf8);
}
int mainboard_io_trap_handler(int smif)
ec_write(0x0c, 0x08);
break;
+ case SMI_SAVE_CMOS:
+ mainboard_smi_save_cmos();
+ break;
default:
return 0;
}