cpu/x86/mp_init: use cb_err as mp_init_with_smm return type

Using cb_err as return type clarifies the meaning of the different
return values. This patch also adds the types.h include that provides
the definition of the cb_err enum and checks the return value of
mp_init_with_smm against the enum values instead of either checking if
it's non-zero or less than zero to handle the error case.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ibcd4a9a63cc87fe176ba885ced0f00832587d492
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58491
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Felix Held
2021-10-20 20:18:12 +02:00
committed by Felix Held
parent e0e49c858b
commit d27ef5bf6f
23 changed files with 52 additions and 36 deletions

View File

@@ -17,6 +17,7 @@
#include <northbridge/intel/haswell/haswell.h>
#include <southbridge/intel/lynxpoint/pch.h>
#include <cpu/intel/common/common.h>
#include <types.h>
#include "haswell.h"
#include "chip.h"
@@ -641,7 +642,7 @@ static const struct mp_ops mp_ops = {
void mp_init_cpus(struct bus *cpu_bus)
{
if (mp_init_with_smm(cpu_bus, &mp_ops))
if (mp_init_with_smm(cpu_bus, &mp_ops) != CB_SUCCESS)
printk(BIOS_ERR, "MP initialization failure.\n");
}

View File

@@ -7,6 +7,7 @@
#include <cpu/intel/smm_reloc.h>
#include <cpu/intel/common/common.h>
#include <device/device.h>
#include <types.h>
/* Parallel MP initialization support. */
static void pre_mp_init(void)
@@ -97,6 +98,6 @@ static const struct mp_ops mp_ops = {
void mp_init_cpus(struct bus *cpu_bus)
{
if (mp_init_with_smm(cpu_bus, &mp_ops))
if (mp_init_with_smm(cpu_bus, &mp_ops) != CB_SUCCESS)
printk(BIOS_ERR, "MP initialization failure.\n");
}

View File

@@ -19,6 +19,7 @@
#include <cpu/intel/smm_reloc.h>
#include <cpu/intel/common/common.h>
#include <smp/node.h>
#include <types.h>
static void configure_thermal_target(void)
{
@@ -174,7 +175,7 @@ static const struct mp_ops mp_ops = {
void mp_init_cpus(struct bus *cpu_bus)
{
if (mp_init_with_smm(cpu_bus, &mp_ops))
if (mp_init_with_smm(cpu_bus, &mp_ops) != CB_SUCCESS)
printk(BIOS_ERR, "MP initialization failure.\n");
}

View File

@@ -19,6 +19,7 @@
#include <cpu/intel/smm_reloc.h>
#include <cpu/intel/common/common.h>
#include <smbios.h>
#include <types.h>
/* Convert time in seconds to POWER_LIMIT_1_TIME MSR value */
static const u8 power_limit_time_sec_to_msr[] = {
@@ -430,7 +431,7 @@ static const struct mp_ops mp_ops = {
void mp_init_cpus(struct bus *cpu_bus)
{
if (mp_init_with_smm(cpu_bus, &mp_ops))
if (mp_init_with_smm(cpu_bus, &mp_ops) != CB_SUCCESS)
printk(BIOS_ERR, "MP initialization failure.\n");
}