summaryrefslogtreecommitdiff
path: root/src/southbridge/amd/pi
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2022-07-16 09:45:39 +0200
committerMartin L Roth <gaumless@tutanota.com>2022-07-17 21:54:55 +0000
commit558d731a4ccef1877f7edca7356eefd719563845 (patch)
tree1b5cf998545ad4677ef80c43a968bc8625ea7331 /src/southbridge/amd/pi
parentba9deba362cfed3a2a8d3d65db6333b23f59f4d9 (diff)
sb/amd/*/*/smbus_spd.c: Fix some white spaces issues
Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: I47ee16f2d4be34c42b2e7f9fa4c3a72a7a95967f Reviewed-on: https://review.coreboot.org/c/coreboot/+/65897 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/southbridge/amd/pi')
-rw-r--r--src/southbridge/amd/pi/hudson/smbus_spd.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/southbridge/amd/pi/hudson/smbus_spd.c b/src/southbridge/amd/pi/hudson/smbus_spd.c
index 5a890bc9fd..48914058ad 100644
--- a/src/southbridge/amd/pi/hudson/smbus_spd.c
+++ b/src/southbridge/amd/pi/hudson/smbus_spd.c
@@ -16,31 +16,31 @@
* readSmbusByteData - read a single SPD byte from any offset
*/
-static int readSmbusByteData (int iobase, int address, char *buffer, int offset)
+static int readSmbusByteData(int iobase, int address, char *buffer, int offset)
{
unsigned int status;
UINT64 limit;
address |= 1; // set read bit
- __outbyte (iobase + 0, 0xFF); // clear error status
- __outbyte (iobase + 1, 0x1F); // clear error status
- __outbyte (iobase + 3, offset); // offset in eeprom
- __outbyte (iobase + 4, address); // slave address and read bit
- __outbyte (iobase + 2, 0x48); // read byte command
+ __outbyte(iobase + 0, 0xFF); // clear error status
+ __outbyte(iobase + 1, 0x1F); // clear error status
+ __outbyte(iobase + 3, offset); // offset in eeprom
+ __outbyte(iobase + 4, address); // slave address and read bit
+ __outbyte(iobase + 2, 0x48); // read byte command
// time limit to avoid hanging for unexpected error status (should never happen)
- limit = __rdtsc () + 2000000000 / 10;
+ limit = __rdtsc() + 2000000000 / 10;
for (;;)
{
- status = __inbyte (iobase);
- if (__rdtsc () > limit) break;
+ status = __inbyte(iobase);
+ if (__rdtsc() > limit) break;
if ((status & 2) == 0) continue; // SMBusInterrupt not set, keep waiting
if ((status & 1) == 1) continue; // HostBusy set, keep waiting
break;
}
- buffer [0] = __inbyte (iobase + 5);
+ buffer [0] = __inbyte(iobase + 5);
if (status == 2) status = 0; // check for done with no errors
return status;
}
@@ -51,26 +51,26 @@ static int readSmbusByteData (int iobase, int address, char *buffer, int offset)
* this function is faster function readSmbusByteData
*/
-static int readSmbusByte (int iobase, int address, char *buffer)
+static int readSmbusByte(int iobase, int address, char *buffer)
{
unsigned int status;
UINT64 limit;
- __outbyte (iobase + 0, 0xFF); // clear error status
- __outbyte (iobase + 2, 0x44); // read command
+ __outbyte(iobase + 0, 0xFF); // clear error status
+ __outbyte(iobase + 2, 0x44); // read command
// time limit to avoid hanging for unexpected error status
- limit = __rdtsc () + 2000000000 / 10;
+ limit = __rdtsc() + 2000000000 / 10;
for (;;)
{
- status = __inbyte (iobase);
- if (__rdtsc () > limit) break;
+ status = __inbyte(iobase);
+ if (__rdtsc() > limit) break;
if ((status & 2) == 0) continue; // SMBusInterrupt not set, keep waiting
if ((status & 1) == 1) continue; // HostBusy set, keep waiting
break;
}
- buffer [0] = __inbyte (iobase + 5);
+ buffer [0] = __inbyte(iobase + 5);
if (status == 2) status = 0; // check for done with no errors
return status;
}
@@ -84,7 +84,7 @@ static int readSmbusByte (int iobase, int address, char *buffer)
* Reads 128 bytes in 7-8 ms at 400 KHz.
*/
-static int readspd (int iobase, int SmbusSlaveAddress, char *buffer, int count)
+static int readspd(int iobase, int SmbusSlaveAddress, char *buffer, int count)
{
int index, error;
@@ -93,7 +93,7 @@ static int readspd (int iobase, int SmbusSlaveAddress, char *buffer, int count)
iobase, SmbusSlaveAddress, count);
/* read the first byte using offset zero */
- error = readSmbusByteData (iobase, SmbusSlaveAddress, buffer, 0);
+ error = readSmbusByteData(iobase, SmbusSlaveAddress, buffer, 0);
if (error) {
printk(BIOS_ERR, "-------------SPD READ ERROR-----------\n");
@@ -103,7 +103,7 @@ static int readspd (int iobase, int SmbusSlaveAddress, char *buffer, int count)
/* read the remaining bytes using auto-increment for speed */
for (index = 1; index < count; index++)
{
- error = readSmbusByte (iobase, SmbusSlaveAddress, &buffer [index]);
+ error = readSmbusByte(iobase, SmbusSlaveAddress, &buffer [index]);
if (error) {
printk(BIOS_ERR, "-------------SPD READ ERROR-----------\n");
return error;
@@ -115,15 +115,15 @@ static int readspd (int iobase, int SmbusSlaveAddress, char *buffer, int count)
return 0;
}
-static void setupFch (int ioBase)
+static void setupFch(int ioBase)
{
pm_write16(0x2c, ioBase | 1);
- __outbyte (ioBase + 0x0E, 66000000 / 400000 / 4); // set SMBus clock to 400 KHz
+ __outbyte(ioBase + 0x0E, 66000000 / 400000 / 4); // set SMBus clock to 400 KHz
}
int hudson_readSpd(int spdAddress, char *buf, size_t len)
{
int ioBase = 0xB00;
- setupFch (ioBase);
- return readspd (ioBase, spdAddress, buf, len);
+ setupFch(ioBase);
+ return readspd(ioBase, spdAddress, buf, len);
}