Dear coreboot folks,
currently the ASRock E350M1 has the following code copied from AMD Inagua for setting voltages.
$ nl -ba src/mainboard/amd/inagua/BiosCallOuts.c […] 487 /* Call the host environment interface to provide a user hook opportunity. */ 488 AGESA_STATUS BiosHookBeforeDramInit(UINT32 Func, UINT32 Data, VOID * ConfigPtr) 489 { 490 AGESA_STATUS Status; 491 UINTN FcnData; 492 MEM_DATA_STRUCT *MemData; 493 UINT32 AcpiMmioAddr; 494 UINT32 GpioMmioAddr; 495 UINT8 Data8; 496 UINT16 Data16; 497 UINT8 TempData8; 498 499 FcnData = Data; 500 MemData = ConfigPtr; 501 502 Status = AGESA_SUCCESS; 503 /* Get SB MMIO Base (AcpiMmioAddr) */ 504 WriteIo8(0xCD6, 0x27); 505 Data8 = ReadIo8(0xCD7); 506 Data16 = Data8 << 8; 507 WriteIo8(0xCD6, 0x26); 508 Data8 = ReadIo8(0xCD7); 509 Data16 |= Data8; 510 AcpiMmioAddr = (UINT32) Data16 << 16; 511 GpioMmioAddr = AcpiMmioAddr + GPIO_BASE; 512 513 Data8 = Read64Mem8(GpioMmioAddr + SB_GPIO_REG178); 514 Data8 &= ~BIT5; 515 TempData8 = Read64Mem8(GpioMmioAddr + SB_GPIO_REG178); 516 TempData8 &= 0x03; 517 TempData8 |= Data8; 518 Write64Mem8(GpioMmioAddr + SB_GPIO_REG178, TempData8); 519 520 Data8 |= BIT2 + BIT3; 521 Data8 &= ~BIT4; 522 TempData8 = Read64Mem8(GpioMmioAddr + SB_GPIO_REG178); 523 TempData8 &= 0x23; 524 TempData8 |= Data8; 525 Write64Mem8(GpioMmioAddr + SB_GPIO_REG178, TempData8); 526 527 Data8 = Read64Mem8(GpioMmioAddr + SB_GPIO_REG179); 528 Data8 &= ~BIT5; 529 TempData8 = Read64Mem8(GpioMmioAddr + SB_GPIO_REG179); 530 TempData8 &= 0x03; 531 TempData8 |= Data8; 532 Write64Mem8(GpioMmioAddr + SB_GPIO_REG179, TempData8); 533 534 Data8 |= BIT2 + BIT3; 535 Data8 &= ~BIT4; 536 TempData8 = Read64Mem8(GpioMmioAddr + SB_GPIO_REG179); 537 TempData8 &= 0x23; 538 TempData8 |= Data8; 539 Write64Mem8(GpioMmioAddr + SB_GPIO_REG179, TempData8); 540 541 switch (MemData->ParameterListPtr->DDR3Voltage) { 542 case VOLT1_35: 543 Data8 = Read64Mem8(GpioMmioAddr + SB_GPIO_REG178); 544 Data8 &= ~(UINT8) BIT6; 545 Write64Mem8(GpioMmioAddr + SB_GPIO_REG178, Data8); 546 Data8 = Read64Mem8(GpioMmioAddr + SB_GPIO_REG179); 547 Data8 |= (UINT8) BIT6; 548 Write64Mem8(GpioMmioAddr + SB_GPIO_REG179, Data8); 549 break; 550 case VOLT1_25: 551 Data8 = Read64Mem8(GpioMmioAddr + SB_GPIO_REG178); 552 Data8 &= ~(UINT8) BIT6; 553 Write64Mem8(GpioMmioAddr + SB_GPIO_REG178, Data8); 554 Data8 = Read64Mem8(GpioMmioAddr + SB_GPIO_REG179); 555 Data8 &= ~(UINT8) BIT6; 556 Write64Mem8(GpioMmioAddr + SB_GPIO_REG179, Data8); 557 break; 558 case VOLT1_5: 559 default: 560 Data8 = Read64Mem8(GpioMmioAddr + SB_GPIO_REG178); 561 Data8 |= (UINT8) BIT6; 562 Write64Mem8(GpioMmioAddr + SB_GPIO_REG178, Data8); 563 Data8 = Read64Mem8(GpioMmioAddr + SB_GPIO_REG179); 564 Data8 &= ~(UINT8) BIT6; 565 Write64Mem8(GpioMmioAddr + SB_GPIO_REG179, Data8); 566 } 567 return Status; 568 } […]
The attached screenshot from Alvaro shows, that the vendor BIOS of the ASRock E350M1 [1] offers even more options for the voltages. Especially the AUTO options sounds nice.
First I have to say, that I have not tried yet to change the voltage on my ASRock E350M1, so I have no idea if the code from AMD Inagua works or not.
Secondly I have no idea how to check under the operating system, what the voltage is.
So how would I find out what to do on the ASRock E350M1 without having any schematics?
a) Disassemble the vendor BIOS binary? b) Use SerialICE and look at the differences when changing the option in the vendor BIOS menu?
Thanks,
Paul
[1] http://www.asrock.com/mb/overview.asp?cat=Download&os=BIOS&Model=E35...
Hi,
For F2A85-M I did that via config option. I think best would be to use similar approach as you noted.
How to find out? I would say best approach so far is to monitor changes on GPIO or I2C devices.
I did this on asrock board I think. I wrote some script which dumped all GPIO settings in hex from SB and superIO.
Then i changed value in bios and compared what GPIO has been changed.
http://www.coreboot.org/ASRock_939A785GMH-128M
Here is how it is working.
On F2A85-M it was not-so-easy. No GPIO was ever changed and it drove me crazy. It turned out that the answer was that there is a device on I2C bus which controls this. But beware, modern AMD chipsets usualy have more than 1 i2c bus and not all is supported in linux driver. In my case I had to modify the linux driver so I could see the bus and the I used i2cdump to dump the device.
Good approach is to use also some overclocking utils for windows, if you are lucky some of them contain *.ini files where is written for example GP50 for this and that.
Thanks Rudolf
In the long term, would it be possible to do this stuff from the OS, not some bios setup screen? Or is it too late by the time the OS is booted? On the SiS 630 we controlled overclocking parameters via a user mode command once Linux had booted, but that was long ago ... do the new chips make this easier, or harder?
ron