Aaron Durbin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38613 )
Change subject: soc/amd/picasso: use SMBus speed in compliation unit ......................................................................
soc/amd/picasso: use SMBus speed in compliation unit
The fixed bus speed of 400 kHz doesn't need to reside in a header file. Just move the assumption into the code itself.
Change-Id: I8bb68607070d0daeae2ad3bcd79f49d5c20048fd Signed-off-by: Aaron Durbin adurbin@chromium.org --- M src/soc/amd/picasso/include/soc/smbus.h M src/soc/amd/picasso/southbridge.c 2 files changed, 4 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/38613/1
diff --git a/src/soc/amd/picasso/include/soc/smbus.h b/src/soc/amd/picasso/include/soc/smbus.h index c4bc28f..60b8bfa 100644 --- a/src/soc/amd/picasso/include/soc/smbus.h +++ b/src/soc/amd/picasso/include/soc/smbus.h @@ -19,8 +19,6 @@ #include <stdint.h> #include <soc/iomap.h>
-#define SMB_SPEED_400KHZ (66000000 / (400000 * 4)) - /* * Between 1-10 seconds, We should never timeout normally * Longer than this is just painful when a timeout condition occurs. diff --git a/src/soc/amd/picasso/southbridge.c b/src/soc/amd/picasso/southbridge.c index 0dff4bc..310d9a2 100644 --- a/src/soc/amd/picasso/southbridge.c +++ b/src/soc/amd/picasso/southbridge.c @@ -253,8 +253,11 @@
static void fch_smbus_init(void) { + /* 400 kHz smbus speed. */ + const uint8_t smbus_speed = (66000000 / (400000 * 4)); + pm_write8(SMB_ASF_IO_BASE, SMB_BASE_ADDR >> 8); - smbus_write8(SMBTIMING, SMB_SPEED_400KHZ); + smbus_write8(SMBTIMING, smbus_speed); /* Clear all SMBUS status bits */ smbus_write8(SMBHSTSTAT, SMBHST_STAT_CLEAR); smbus_write8(SMBSLVSTAT, SMBSLV_STAT_CLEAR);
Aaron Durbin has uploaded a new patch set (#2). ( https://review.coreboot.org/c/coreboot/+/38613 )
Change subject: soc/amd/picasso: use SMBus speed in compliation unit ......................................................................
soc/amd/picasso: use SMBus speed in compliation unit
The fixed bus speed of 400 kHz doesn't need to reside in a header file. Just move the assumption into the code itself.
Change-Id: I8bb68607070d0daeae2ad3bcd79f49d5c20048fd Signed-off-by: Aaron Durbin adurbin@chromium.org --- M src/soc/amd/picasso/include/soc/smbus.h M src/soc/amd/picasso/southbridge.c 2 files changed, 4 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/38613/2
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38613 )
Change subject: soc/amd/picasso: use SMBus speed in compliation unit ......................................................................
Patch Set 2: Code-Review+1
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38613 )
Change subject: soc/amd/picasso: use SMBus speed in compliation unit ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38613/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/38613/2//COMMIT_MSG@7 PS2, Line 7: compliation compilation
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38613 )
Change subject: soc/amd/picasso: use SMBus speed in compliation unit ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38613/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/38613/2//COMMIT_MSG@7 PS2, Line 7: compliation
compilation
Done
Hello Kyösti Mälkki, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/38613
to look at the new patch set (#3).
Change subject: soc/amd/picasso: use SMBus speed in compilation unit ......................................................................
soc/amd/picasso: use SMBus speed in compilation unit
The fixed bus speed of 400 kHz doesn't need to reside in a header file. Just move the assumption into the code itself.
Change-Id: I8bb68607070d0daeae2ad3bcd79f49d5c20048fd Signed-off-by: Aaron Durbin adurbin@chromium.org --- M src/soc/amd/picasso/include/soc/smbus.h M src/soc/amd/picasso/southbridge.c 2 files changed, 4 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/38613/3
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38613 )
Change subject: soc/amd/picasso: use SMBus speed in compilation unit ......................................................................
Patch Set 3: Code-Review+1
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38613 )
Change subject: soc/amd/picasso: use SMBus speed in compilation unit ......................................................................
Patch Set 3: Code-Review+2
Aaron Durbin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/38613 )
Change subject: soc/amd/picasso: use SMBus speed in compilation unit ......................................................................
soc/amd/picasso: use SMBus speed in compilation unit
The fixed bus speed of 400 kHz doesn't need to reside in a header file. Just move the assumption into the code itself.
Change-Id: I8bb68607070d0daeae2ad3bcd79f49d5c20048fd Signed-off-by: Aaron Durbin adurbin@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/38613 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/soc/amd/picasso/include/soc/smbus.h M src/soc/amd/picasso/southbridge.c 2 files changed, 4 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Kyösti Mälkki: Looks good to me, but someone else must approve Angel Pons: Looks good to me, approved
diff --git a/src/soc/amd/picasso/include/soc/smbus.h b/src/soc/amd/picasso/include/soc/smbus.h index c4bc28f..60b8bfa 100644 --- a/src/soc/amd/picasso/include/soc/smbus.h +++ b/src/soc/amd/picasso/include/soc/smbus.h @@ -19,8 +19,6 @@ #include <stdint.h> #include <soc/iomap.h>
-#define SMB_SPEED_400KHZ (66000000 / (400000 * 4)) - /* * Between 1-10 seconds, We should never timeout normally * Longer than this is just painful when a timeout condition occurs. diff --git a/src/soc/amd/picasso/southbridge.c b/src/soc/amd/picasso/southbridge.c index 0dff4bc..310d9a2 100644 --- a/src/soc/amd/picasso/southbridge.c +++ b/src/soc/amd/picasso/southbridge.c @@ -253,8 +253,11 @@
static void fch_smbus_init(void) { + /* 400 kHz smbus speed. */ + const uint8_t smbus_speed = (66000000 / (400000 * 4)); + pm_write8(SMB_ASF_IO_BASE, SMB_BASE_ADDR >> 8); - smbus_write8(SMBTIMING, SMB_SPEED_400KHZ); + smbus_write8(SMBTIMING, smbus_speed); /* Clear all SMBUS status bits */ smbus_write8(SMBHSTSTAT, SMBHST_STAT_CLEAR); smbus_write8(SMBSLVSTAT, SMBSLV_STAT_CLEAR);