soc/amd/picasso/soc_util: change return type of soc_is_*

All callers just check for zero/non-zero.

Change-Id: I795763ce882d879d12c97b71e7a0b35423378c36
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41559
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
Felix Held 2020-05-20 02:42:41 +02:00 committed by Felix Held
parent 5640cfdc92
commit 368873ced3
2 changed files with 12 additions and 10 deletions

View File

@ -3,6 +3,8 @@
#ifndef __PICASSO_SOC_UTIL_H__ #ifndef __PICASSO_SOC_UTIL_H__
#define __PICASSO_SOC_UTIL_H__ #define __PICASSO_SOC_UTIL_H__
#include <types.h>
enum socket_type { enum socket_type {
SOCKET_FP5 = 0, SOCKET_FP5 = 0,
SOCKET_AM4 = 2, SOCKET_AM4 = 2,
@ -11,10 +13,10 @@ enum socket_type {
void print_socket_type(void); void print_socket_type(void);
int soc_is_pollock(void); bool soc_is_pollock(void);
int soc_is_dali(void); bool soc_is_dali(void);
int soc_is_picasso(void); bool soc_is_picasso(void);
int soc_is_raven2(void); bool soc_is_raven2(void);
int soc_is_zen_plus(void); bool soc_is_zen_plus(void);
#endif /* __PICASSO_SOC_UTIL_H__ */ #endif /* __PICASSO_SOC_UTIL_H__ */

View File

@ -37,7 +37,7 @@ void print_socket_type(void)
} }
} }
int soc_is_pollock(void) bool soc_is_pollock(void)
{ {
return soc_is_zen_plus() && get_socket_type() == SOCKET_FT5; return soc_is_zen_plus() && get_socket_type() == SOCKET_FT5;
} }
@ -46,23 +46,23 @@ int soc_is_pollock(void)
* TODO: This detection works for the Dali SKUs used in Chrome-devices, but fails for other * TODO: This detection works for the Dali SKUs used in Chrome-devices, but fails for other
* Dali SKUs, since other Dali SKUs have a Zen+ CPUID and not a Raven2 one. * Dali SKUs, since other Dali SKUs have a Zen+ CPUID and not a Raven2 one.
*/ */
int soc_is_dali(void) bool soc_is_dali(void)
{ {
return soc_is_raven2() && get_socket_type() == SOCKET_FP5; return soc_is_raven2() && get_socket_type() == SOCKET_FP5;
} }
int soc_is_picasso(void) bool soc_is_picasso(void)
{ {
return soc_is_zen_plus() && get_socket_type() == SOCKET_FP5; return soc_is_zen_plus() && get_socket_type() == SOCKET_FP5;
} }
int soc_is_raven2(void) bool soc_is_raven2(void)
{ {
/* mask lower model number nibble and stepping */ /* mask lower model number nibble and stepping */
return cpuid_eax(1) >> 8 == RAVEN2_CPUID >> 8; return cpuid_eax(1) >> 8 == RAVEN2_CPUID >> 8;
} }
int soc_is_zen_plus(void) bool soc_is_zen_plus(void)
{ {
/* mask lower model number nibble and stepping */ /* mask lower model number nibble and stepping */
return cpuid_eax(1) >> 8 == PICASSO_CPUID >> 8; return cpuid_eax(1) >> 8 == PICASSO_CPUID >> 8;