diff --git a/include/globalvars.h b/include/globalvars.h index b1f4ec5cc2..b144e19f98 100644 --- a/include/globalvars.h +++ b/include/globalvars.h @@ -53,6 +53,8 @@ struct global_vars { /* these two values are of interest in many stages */ u32 init_detected; struct sys_info sys_info; + /* has the spd hardware been set up? */ + int spd_inited; }; #endif /* GLOBALVARS_H */ diff --git a/southbridge/amd/cs5536/smbus_initram.c b/southbridge/amd/cs5536/smbus_initram.c index 989a705903..8304f43c20 100644 --- a/southbridge/amd/cs5536/smbus_initram.c +++ b/southbridge/amd/cs5536/smbus_initram.c @@ -321,11 +321,11 @@ err: */ int smbus_read_byte(u16 device, u8 address) { - static int first_time = 1; + struct global_vars *g = global_vars(); - if (first_time) { + if (!g->spd_inited) { smbus_init(); - first_time = 0; + g->spd_inited = 1; } return do_smbus_read_byte(SMBUS_IO_BASE, device, address);