boardid: Minor clean up and standardization
Merge the different coreboot table strapping ID structures into one because they're really just all the same, and I want to add more. Make the signature of the board_id() function return a uint32_t because that's also what goes in the coreboot table. Add a printk to the generic code handling strapping IDs in ramstage so that not every individual mainboard implementation needs its own print. (In turn, remove one such print from fsp1_1 code because it's in the way of my next patch.) Change-Id: Ib9563edf07b623a586a4dc168fe357564c5e68b5 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/22741 Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
* ......
|
||||
* 1 1 1 H
|
||||
*/
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
void *gpiommioaddr;
|
||||
u8 value = 0;
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include <console/console.h>
|
||||
#include <gpio.h>
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ static uint8_t get_board_id(void)
|
||||
return bid;
|
||||
}
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
if (board_id_value < 0)
|
||||
board_id_value = get_board_id();
|
||||
|
@@ -66,7 +66,7 @@ static uint32_t get_index(uint32_t channel, int *cached_id)
|
||||
die("Read impossible value ( > 1023) from 10-bit ADC!");
|
||||
}
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
return get_index(1, &cached_board_id);
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#include <console/console.h>
|
||||
#include <gpio.h>
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
static int id = -1;
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include <gpio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
static int id = -1;
|
||||
gpio_t gpio[] = {[3] = GPIO(X4), [2] = GPIO(X1), /* X4 is MSB */
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include <gpio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
static int id = -1;
|
||||
gpio_t gpio[] = {[3] = GPIO(X4), [2] = GPIO(X1), /* X4 is MSB */
|
||||
|
@@ -34,7 +34,7 @@ static uint8_t get_board_id(void)
|
||||
return bid;
|
||||
}
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
if (board_id_value < 0)
|
||||
board_id_value = get_board_id();
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
||||
#include <boardid.h>
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
static int id = -1;
|
||||
|
||||
|
@@ -48,7 +48,7 @@ static uint8_t get_board_id(void)
|
||||
return bid;
|
||||
}
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
if (board_id_value < 0)
|
||||
board_id_value = get_board_id();
|
||||
|
@@ -89,7 +89,7 @@ const struct board_hw *board_get_hw(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
if (cached_board_id == -1)
|
||||
cached_board_id = retrieve_board_id();
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include <gpio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
static int id = -1;
|
||||
gpio_t pins[] = {[3] = GPIO(2, A, 7), [2] = GPIO(2, A, 2),
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include <gpio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
static int id = -1;
|
||||
gpio_t pins[] = {[3] = GPIO(2, A, 7), [2] = GPIO(2, A, 2),
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include <gpio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
static int id = -1;
|
||||
gpio_t pins[] = {[3] = GPIO(2, A, 7), [2] = GPIO(2, A, 2),
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#include <boardid.h>
|
||||
#include <stddef.h>
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
MAYBE_STATIC int id = -1;
|
||||
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#define BOARD_ID_GLK_RVP2_LP4 0x8 /* RVP2 - LP4 Socket */
|
||||
#define EC_FAB_ID_CMD 0x0D /* Get the board fab ID in the lower 3 bits */
|
||||
|
||||
uint8_t board_id(void)
|
||||
uint32_t board_id(void)
|
||||
{
|
||||
MAYBE_STATIC int id = -1;
|
||||
if (id < 0) {
|
||||
|
Reference in New Issue
Block a user