Peter Stuge wrote:
]> + __outdword (0xcf8, 0x8000a3b8); ]> + __outdword (0xcfc, __indword (0xcfc) | 0 << 24); ]> + } ] ]PCI function? And maybe this, as well as the 33MHz setup, is good to ]have in the chipset code, as opposed to duplicated per mainboard?
Hello Peter,
I will try improve this and some of the others, hopefully this week. Yes, the code above looks odd, so I should at least explain why. This and the other newly added early settings indeed duplicate settings made later. The justification is/was 'early as possible' for boot time reduction. With another change or two, both persimmon and asrock e350m1 boot to DOS time drop to 600 ms.
Maybe a bigger question is why the unusual pci config write coding? Certainly a function call is just as good (and I will submit a change). The code is a quick and dirty way to paste in a pci config write and have it work for amd agesa as well as for all phases of UEFI. I used to get frustrated over how complicated UEFI makes something as simple as a write to base pci config space. A single function call? More like a couple dozen lines of code: Call the OpenProtocol function pointer from a global structure, passing half a dozen items including the GUID for PCI protocol. Check for errors then call the write() member of the structure it returns. Of course integer constants are often passed by address, so separate allocation is needed for those. Check for and handle any error returned by the write function, then call another function to close the protocol. The code sequence above was my silent protest over this ordeal, and it ended up in coreboot. I/O functions named like __outdword are supported by the Microsoft compilers used for UEFI, and can even be used with no prototype.
Thanks, Scott