Corey is correct on both comments.
All BIOS use port 80 as the debug port (including LinuxBIOS). An out to port 80 is noisy, especially in a bios debug environment. What makes it a delay is that it is a serializing read/write (it can't be pre-fetchand and can't be in the cache etc). In this particular case it is an arbitrary delay to wait for smbus devices to respond. I say arbitrary because it will change as the pci and glbus (internal geode bus) speeds change based on memory and pci loading. An inb is as good an arbitrary delay as an outb.
I don't think that this delay should there at all but I wasn't prepared to rewrite the entire section. It would be equivalent to poll the SMBus controllers IO register.
I think it would be in the best interest of LinuxBIOS to not have any outb(0x80, 0x80) delays. Either they should be inb if it can be an arbitrary delay or they should be changed to TSC based delays. See \LinuxBIOSv2\src\x86\tsc\delay_tysc.c
</soapbox>
Marc
Corey Osgood wrote:
Uwe Hermann wrote:
On Tue, May 01, 2007 at 04:48:31PM -0600, Marc Jones wrote:
Index: LinuxBIOSv2/src/southbridge/amd/cs5536/cs5536_smbus2.h
--- LinuxBIOSv2.orig/src/southbridge/amd/cs5536/cs5536_smbus2.h 2007-04-30 15:14:24.000000000 -0600 +++ LinuxBIOSv2/src/southbridge/amd/cs5536/cs5536_smbus2.h 2007-04-30 15:14:24.000000000 -0600
[...]
static void smbus_delay(void) {
- outb(0x80, 0x80);
- inb(0x80);
}
Why? Please document this in the code (what, how, why). Did you perform measurements? Why did the outb() not work?
There may be other reasons, but outb and inb both provide enough of a delay for smbus use. By using inb, you don't clear a potentially helpful post code.
Index: LinuxBIOSv2/src/mainboard/amd/norwich/auto.c
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ LinuxBIOSv2/src/mainboard/amd/norwich/auto.c 2007-05-01
01:32:02.000000000 -0600
[...]
+#define POST_CODE(x) outb(x, 0x80)
Why this? We have a post_code() function in src/console/console.c.
Isn't src/console/console.c for post ram init?
-Corey