00001 #include <arch/io.h>
00002 #include <stdlib.h>
00003
00004 static void write_index(uint16_t port_base, uint8_t reg, uint8_t value)
00005 {
00006 outb(reg, port_base);
00007 outb(value, port_base + 1);
00008 }
00009
00010 static const struct {
00011 uint8_t index, value;
00012 } sequence[]= {
00013
00014 { 0x00, 0x13},
00015
00016 { 0x04, 0x37},
00017
00018 { 0x05, 0xff},
00019
00020 { 0x07, 0x37},
00021
00022 { 0x08, 0xff},
00023
00024 { 0x09, 0x87},
00025
00026 { 0x0c, 0x07},
00027
00028
00029 { 0x14, 0xd7},
00030
00031 { 0x51, 0x1c},
00032
00033 { 0x5c, 0x80},
00034
00035
00036 { 0x59, 0xec},
00037 { 0x5c, 0x00},
00038
00039
00040 { 0x60, 0xff},
00041
00042 { 0x61, 0x14},
00043
00044
00045
00046 { 0x63, 0x27},
00047
00048 { 0x64, 0x90},
00049
00050 { 0x65, 0x03},
00051
00052 { 0x70, 0xff},
00053
00054 { 0x71, 0x14},
00055
00056 { 0x73, 0x20},
00057
00058 { 0x74, 0x90},
00059
00060 { 0x75, 0x03},
00061
00062 { 0x15, 0x82},
00063
00064 { 0x16, 0x82},
00065
00066 { 0x17, 0x82},
00067
00068 { 0x13, 0x77}
00069 };
00070
00071
00072
00073
00074 void init_ec(uint16_t base)
00075 {
00076 int i;
00077 for (i=0; i<ARRAY_SIZE(sequence); i++) {
00078 write_index(base, sequence[i].index, sequence[i].value);
00079 }
00080 }