/*1* longhaul.h2* (C) 2003 Dave Jones.3*4* Licensed under the terms of the GNU GPL License version 2.5*6* VIA-specific information7*/89union msr_bcr2 {10struct {11unsigned Reseved:19, // 18:012ESOFTBF:1, // 1913Reserved2:3, // 22:2014CLOCKMUL:4, // 26:2315Reserved3:5; // 31:2716} bits;17unsigned long val;18};1920union msr_longhaul {21struct {22unsigned RevisionID:4, // 3:023RevisionKey:4, // 7:424EnableSoftBusRatio:1, // 825EnableSoftVID:1, // 926EnableSoftBSEL:1, // 1027Reserved:3, // 11:1328SoftBusRatio4:1, // 1429VRMRev:1, // 1530SoftBusRatio:4, // 19:1631SoftVID:5, // 24:2032Reserved2:3, // 27:2533SoftBSEL:2, // 29:2834Reserved3:2, // 31:3035MaxMHzBR:4, // 35:3236MaximumVID:5, // 40:3637MaxMHzFSB:2, // 42:4138MaxMHzBR4:1, // 4339Reserved4:4, // 47:4440MinMHzBR:4, // 51:4841MinimumVID:5, // 56:5242MinMHzFSB:2, // 58:5743MinMHzBR4:1, // 5944Reserved5:4; // 63:6045} bits;46unsigned long long val;47};4849/*50* Clock ratio tables. Div/Mod by 10 to get ratio.51* The eblcr values specify the ratio read from the CPU.52* The mults values specify what to write to the CPU.53*/5455/*56* VIA C3 Samuel 1 & Samuel 2 (stepping 0)57*/58static const int __cpuinitdata samuel1_mults[16] = {59-1, /* 0000 -> RESERVED */6030, /* 0001 -> 3.0x */6140, /* 0010 -> 4.0x */62-1, /* 0011 -> RESERVED */63-1, /* 0100 -> RESERVED */6435, /* 0101 -> 3.5x */6545, /* 0110 -> 4.5x */6655, /* 0111 -> 5.5x */6760, /* 1000 -> 6.0x */6870, /* 1001 -> 7.0x */6980, /* 1010 -> 8.0x */7050, /* 1011 -> 5.0x */7165, /* 1100 -> 6.5x */7275, /* 1101 -> 7.5x */73-1, /* 1110 -> RESERVED */74-1, /* 1111 -> RESERVED */75};7677static const int __cpuinitdata samuel1_eblcr[16] = {7850, /* 0000 -> RESERVED */7930, /* 0001 -> 3.0x */8040, /* 0010 -> 4.0x */81-1, /* 0011 -> RESERVED */8255, /* 0100 -> 5.5x */8335, /* 0101 -> 3.5x */8445, /* 0110 -> 4.5x */85-1, /* 0111 -> RESERVED */86-1, /* 1000 -> RESERVED */8770, /* 1001 -> 7.0x */8880, /* 1010 -> 8.0x */8960, /* 1011 -> 6.0x */90-1, /* 1100 -> RESERVED */9175, /* 1101 -> 7.5x */92-1, /* 1110 -> RESERVED */9365, /* 1111 -> 6.5x */94};9596/*97* VIA C3 Samuel2 Stepping 1->1598*/99static const int __cpuinitdata samuel2_eblcr[16] = {10050, /* 0000 -> 5.0x */10130, /* 0001 -> 3.0x */10240, /* 0010 -> 4.0x */103100, /* 0011 -> 10.0x */10455, /* 0100 -> 5.5x */10535, /* 0101 -> 3.5x */10645, /* 0110 -> 4.5x */107110, /* 0111 -> 11.0x */10890, /* 1000 -> 9.0x */10970, /* 1001 -> 7.0x */11080, /* 1010 -> 8.0x */11160, /* 1011 -> 6.0x */112120, /* 1100 -> 12.0x */11375, /* 1101 -> 7.5x */114130, /* 1110 -> 13.0x */11565, /* 1111 -> 6.5x */116};117118/*119* VIA C3 Ezra120*/121static const int __cpuinitdata ezra_mults[16] = {122100, /* 0000 -> 10.0x */12330, /* 0001 -> 3.0x */12440, /* 0010 -> 4.0x */12590, /* 0011 -> 9.0x */12695, /* 0100 -> 9.5x */12735, /* 0101 -> 3.5x */12845, /* 0110 -> 4.5x */12955, /* 0111 -> 5.5x */13060, /* 1000 -> 6.0x */13170, /* 1001 -> 7.0x */13280, /* 1010 -> 8.0x */13350, /* 1011 -> 5.0x */13465, /* 1100 -> 6.5x */13575, /* 1101 -> 7.5x */13685, /* 1110 -> 8.5x */137120, /* 1111 -> 12.0x */138};139140static const int __cpuinitdata ezra_eblcr[16] = {14150, /* 0000 -> 5.0x */14230, /* 0001 -> 3.0x */14340, /* 0010 -> 4.0x */144100, /* 0011 -> 10.0x */14555, /* 0100 -> 5.5x */14635, /* 0101 -> 3.5x */14745, /* 0110 -> 4.5x */14895, /* 0111 -> 9.5x */14990, /* 1000 -> 9.0x */15070, /* 1001 -> 7.0x */15180, /* 1010 -> 8.0x */15260, /* 1011 -> 6.0x */153120, /* 1100 -> 12.0x */15475, /* 1101 -> 7.5x */15585, /* 1110 -> 8.5x */15665, /* 1111 -> 6.5x */157};158159/*160* VIA C3 (Ezra-T) [C5M].161*/162static const int __cpuinitdata ezrat_mults[32] = {163100, /* 0000 -> 10.0x */16430, /* 0001 -> 3.0x */16540, /* 0010 -> 4.0x */16690, /* 0011 -> 9.0x */16795, /* 0100 -> 9.5x */16835, /* 0101 -> 3.5x */16945, /* 0110 -> 4.5x */17055, /* 0111 -> 5.5x */17160, /* 1000 -> 6.0x */17270, /* 1001 -> 7.0x */17380, /* 1010 -> 8.0x */17450, /* 1011 -> 5.0x */17565, /* 1100 -> 6.5x */17675, /* 1101 -> 7.5x */17785, /* 1110 -> 8.5x */178120, /* 1111 -> 12.0x */179180-1, /* 0000 -> RESERVED (10.0x) */181110, /* 0001 -> 11.0x */182-1, /* 0010 -> 12.0x */183-1, /* 0011 -> RESERVED (9.0x)*/184105, /* 0100 -> 10.5x */185115, /* 0101 -> 11.5x */186125, /* 0110 -> 12.5x */187135, /* 0111 -> 13.5x */188140, /* 1000 -> 14.0x */189150, /* 1001 -> 15.0x */190160, /* 1010 -> 16.0x */191130, /* 1011 -> 13.0x */192145, /* 1100 -> 14.5x */193155, /* 1101 -> 15.5x */194-1, /* 1110 -> RESERVED (13.0x) */195-1, /* 1111 -> RESERVED (12.0x) */196};197198static const int __cpuinitdata ezrat_eblcr[32] = {19950, /* 0000 -> 5.0x */20030, /* 0001 -> 3.0x */20140, /* 0010 -> 4.0x */202100, /* 0011 -> 10.0x */20355, /* 0100 -> 5.5x */20435, /* 0101 -> 3.5x */20545, /* 0110 -> 4.5x */20695, /* 0111 -> 9.5x */20790, /* 1000 -> 9.0x */20870, /* 1001 -> 7.0x */20980, /* 1010 -> 8.0x */21060, /* 1011 -> 6.0x */211120, /* 1100 -> 12.0x */21275, /* 1101 -> 7.5x */21385, /* 1110 -> 8.5x */21465, /* 1111 -> 6.5x */215216-1, /* 0000 -> RESERVED (9.0x) */217110, /* 0001 -> 11.0x */218120, /* 0010 -> 12.0x */219-1, /* 0011 -> RESERVED (10.0x)*/220135, /* 0100 -> 13.5x */221115, /* 0101 -> 11.5x */222125, /* 0110 -> 12.5x */223105, /* 0111 -> 10.5x */224130, /* 1000 -> 13.0x */225150, /* 1001 -> 15.0x */226160, /* 1010 -> 16.0x */227140, /* 1011 -> 14.0x */228-1, /* 1100 -> RESERVED (12.0x) */229155, /* 1101 -> 15.5x */230-1, /* 1110 -> RESERVED (13.0x) */231145, /* 1111 -> 14.5x */232};233234/*235* VIA C3 Nehemiah */236237static const int __cpuinitdata nehemiah_mults[32] = {238100, /* 0000 -> 10.0x */239-1, /* 0001 -> 16.0x */24040, /* 0010 -> 4.0x */24190, /* 0011 -> 9.0x */24295, /* 0100 -> 9.5x */243-1, /* 0101 -> RESERVED */24445, /* 0110 -> 4.5x */24555, /* 0111 -> 5.5x */24660, /* 1000 -> 6.0x */24770, /* 1001 -> 7.0x */24880, /* 1010 -> 8.0x */24950, /* 1011 -> 5.0x */25065, /* 1100 -> 6.5x */25175, /* 1101 -> 7.5x */25285, /* 1110 -> 8.5x */253120, /* 1111 -> 12.0x */254-1, /* 0000 -> 10.0x */255110, /* 0001 -> 11.0x */256-1, /* 0010 -> 12.0x */257-1, /* 0011 -> 9.0x */258105, /* 0100 -> 10.5x */259115, /* 0101 -> 11.5x */260125, /* 0110 -> 12.5x */261135, /* 0111 -> 13.5x */262140, /* 1000 -> 14.0x */263150, /* 1001 -> 15.0x */264160, /* 1010 -> 16.0x */265130, /* 1011 -> 13.0x */266145, /* 1100 -> 14.5x */267155, /* 1101 -> 15.5x */268-1, /* 1110 -> RESERVED (13.0x) */269-1, /* 1111 -> 12.0x */270};271272static const int __cpuinitdata nehemiah_eblcr[32] = {27350, /* 0000 -> 5.0x */274160, /* 0001 -> 16.0x */27540, /* 0010 -> 4.0x */276100, /* 0011 -> 10.0x */27755, /* 0100 -> 5.5x */278-1, /* 0101 -> RESERVED */27945, /* 0110 -> 4.5x */28095, /* 0111 -> 9.5x */28190, /* 1000 -> 9.0x */28270, /* 1001 -> 7.0x */28380, /* 1010 -> 8.0x */28460, /* 1011 -> 6.0x */285120, /* 1100 -> 12.0x */28675, /* 1101 -> 7.5x */28785, /* 1110 -> 8.5x */28865, /* 1111 -> 6.5x */28990, /* 0000 -> 9.0x */290110, /* 0001 -> 11.0x */291120, /* 0010 -> 12.0x */292100, /* 0011 -> 10.0x */293135, /* 0100 -> 13.5x */294115, /* 0101 -> 11.5x */295125, /* 0110 -> 12.5x */296105, /* 0111 -> 10.5x */297130, /* 1000 -> 13.0x */298150, /* 1001 -> 15.0x */299160, /* 1010 -> 16.0x */300140, /* 1011 -> 14.0x */301120, /* 1100 -> 12.0x */302155, /* 1101 -> 15.5x */303-1, /* 1110 -> RESERVED (13.0x) */304145 /* 1111 -> 14.5x */305};306307/*308* Voltage scales. Div/Mod by 1000 to get actual voltage.309* Which scale to use depends on the VRM type in use.310*/311312struct mV_pos {313unsigned short mV;314unsigned short pos;315};316317static const struct mV_pos __cpuinitdata vrm85_mV[32] = {318{1250, 8}, {1200, 6}, {1150, 4}, {1100, 2},319{1050, 0}, {1800, 30}, {1750, 28}, {1700, 26},320{1650, 24}, {1600, 22}, {1550, 20}, {1500, 18},321{1450, 16}, {1400, 14}, {1350, 12}, {1300, 10},322{1275, 9}, {1225, 7}, {1175, 5}, {1125, 3},323{1075, 1}, {1825, 31}, {1775, 29}, {1725, 27},324{1675, 25}, {1625, 23}, {1575, 21}, {1525, 19},325{1475, 17}, {1425, 15}, {1375, 13}, {1325, 11}326};327328static const unsigned char __cpuinitdata mV_vrm85[32] = {3290x04, 0x14, 0x03, 0x13, 0x02, 0x12, 0x01, 0x11,3300x00, 0x10, 0x0f, 0x1f, 0x0e, 0x1e, 0x0d, 0x1d,3310x0c, 0x1c, 0x0b, 0x1b, 0x0a, 0x1a, 0x09, 0x19,3320x08, 0x18, 0x07, 0x17, 0x06, 0x16, 0x05, 0x15333};334335static const struct mV_pos __cpuinitdata mobilevrm_mV[32] = {336{1750, 31}, {1700, 30}, {1650, 29}, {1600, 28},337{1550, 27}, {1500, 26}, {1450, 25}, {1400, 24},338{1350, 23}, {1300, 22}, {1250, 21}, {1200, 20},339{1150, 19}, {1100, 18}, {1050, 17}, {1000, 16},340{975, 15}, {950, 14}, {925, 13}, {900, 12},341{875, 11}, {850, 10}, {825, 9}, {800, 8},342{775, 7}, {750, 6}, {725, 5}, {700, 4},343{675, 3}, {650, 2}, {625, 1}, {600, 0}344};345346static const unsigned char __cpuinitdata mV_mobilevrm[32] = {3470x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18,3480x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10,3490x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,3500x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00351};352353354355