mb/google/asurada: get SKU ID from AP strapping pins

The SKU ID for Asurada should come from AP ADC channel 5 and 6.

BUG=None
TEST=make; boots on asurada

Change-Id: I6a00c555f20aca4cd7f8bcee46ee81c17ef6ca3c
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51405
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
Hung-Te Lin 2021-03-11 16:45:54 +08:00
parent 2fcbebbbcd
commit a79d6e76b8
1 changed files with 13 additions and 1 deletions

View File

@ -10,8 +10,12 @@
#define ADC_LEVELS 15
enum {
/* RAM IDs */
RAM_ID_HIGH_CHANNEL = 4,
RAM_ID_LOW_CHANNEL = 3,
/* SKU IDs */
SKU_ID_HIGH_CHANNEL = 6,
SKU_ID_LOW_CHANNEL = 5,
};
static const unsigned int ram_voltages[ADC_LEVELS] = {
@ -58,7 +62,15 @@ static uint32_t get_adc_index(unsigned int channel)
uint32_t sku_id(void)
{
return 0;
static uint32_t cached_sku_code = BOARD_ID_INIT;
if (cached_sku_code == BOARD_ID_INIT) {
cached_sku_code = (get_adc_index(SKU_ID_HIGH_CHANNEL) << 4 |
get_adc_index(SKU_ID_LOW_CHANNEL));
printk(BIOS_DEBUG, "SKU Code: %#02x\n", cached_sku_code);
}
return cached_sku_code;
}
uint32_t ram_code(void)