summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-08-18 22:10:51 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2019-08-26 20:54:39 +0000
commit2f944f4da402ac79ec66529f3d771b6cb1e056df (patch)
tree5c417acd3cab9e83cd72fdaf7c95ab7b19e11326 /src/mainboard
parentec88c5c688566667878123d2a89220c697bcf911 (diff)
mb/scaleway/tagada: Remove use of car_get_var()
Board has CAR_GLOBAL_MIGRATION=n and can use .bss for a variable that was previously declared with CAR_GLOBAL. Test for !defined(__PRE_RAM__) can be transformed into ENV_RAMSTAGE here as the warnings about invalid bmcinfo structure do not need to be repeated in SMM console, which is generally disabled anyways due to DEBUG_SMI=n. Change-Id: I6b63213484107fa0eeb0d952d8766916b44a3c4e Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35085 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/scaleway/tagada/bmcinfo.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/mainboard/scaleway/tagada/bmcinfo.c b/src/mainboard/scaleway/tagada/bmcinfo.c
index 237d551b59..93b45397ea 100644
--- a/src/mainboard/scaleway/tagada/bmcinfo.c
+++ b/src/mainboard/scaleway/tagada/bmcinfo.c
@@ -16,7 +16,6 @@
#include <stdint.h>
#include <stdlib.h>
-#include <arch/early_variables.h>
#include <console/console.h>
#include <console/uart.h>
@@ -52,15 +51,12 @@ enum biosBmcInfoValidFlag_e {
BMCINFO_VALID_NEED_WARN,
BMCINFO_VALID,
};
-
-static enum biosBmcInfoValidFlag_e CAR_GLOBAL biosBmcInfoValidFlag;
-
static bool bmcinfo_is_valid(size_t minsize)
{
+ static enum biosBmcInfoValidFlag_e biosBmcInfoValidFlag;
const biosBmcInfo_t *bmc_info = BMC_INFO;
- int flag = car_get_var(biosBmcInfoValidFlag);
- if (flag == BMCINFO_UNTESTED) {
- flag = BMCINFO_INVALID;
+ if (biosBmcInfoValidFlag == BMCINFO_UNTESTED) {
+ biosBmcInfoValidFlag = BMCINFO_INVALID;
if ((bmc_info->magic0 == BIOSBMCINFO_MAGIC0)
&& (bmc_info->magic1 == BIOSBMCINFO_MAGIC1)
&& (bmc_info->length >= offsetof(biosBmcInfo_t, hwRev))
@@ -73,20 +69,17 @@ static bool bmcinfo_is_valid(size_t minsize)
if (bmc_info->chksum == chksum) {
if (bmc_info->length >= offsetof(biosBmcInfo_t,
endMarker))
- flag = BMCINFO_VALID;
+ biosBmcInfoValidFlag = BMCINFO_VALID;
else
- flag = BMCINFO_VALID_NEED_WARN;
+ biosBmcInfoValidFlag = BMCINFO_VALID_NEED_WARN;
}
}
- car_set_var(biosBmcInfoValidFlag, flag);
}
-#if !defined(__PRE_RAM__)
- if (flag == BMCINFO_INVALID) {
+ if (ENV_RAMSTAGE && biosBmcInfoValidFlag == BMCINFO_INVALID) {
int length = offsetof(biosBmcInfo_t, endMarker);
printk(BIOS_CRIT, "WARNING bmcInfo struct"
"is not available please update your BMC.\n");
- flag = BMCINFO_INVALID_WARNED;
- car_set_var(biosBmcInfoValidFlag, flag);
+ biosBmcInfoValidFlag = BMCINFO_INVALID_WARNED;
printk(BIOS_CRIT, "bmcInfo magic = \"%x-%x\"\n",
bmc_info->magic0, bmc_info->magic1);
printk(BIOS_CRIT, "bmcInfo length = %d expected = %d\"\n",
@@ -99,15 +92,13 @@ static bool bmcinfo_is_valid(size_t minsize)
printk(BIOS_CRIT, "bmcInfo chksum = 0x%x expected = 0x%x\"\n",
bmc_info->chksum, chksum);
}
- if (flag == BMCINFO_VALID_NEED_WARN) {
+ if (ENV_RAMSTAGE && biosBmcInfoValidFlag == BMCINFO_VALID_NEED_WARN) {
printk(BIOS_CRIT, "WARNING bmcInfo struct"
" is incomplete please update your BMC.\n");
- flag = BMCINFO_VALID;
- car_set_var(biosBmcInfoValidFlag, flag);
+ biosBmcInfoValidFlag = BMCINFO_VALID;
}
-#endif
- if (flag < BMCINFO_VALID_NEED_WARN)
+ if (biosBmcInfoValidFlag < BMCINFO_VALID_NEED_WARN)
return false;
return (bmc_info->length >= minsize);
}