mb/google/rauru: Implement mainboard_get_storage_type
Replace existing storage_type with mainboard_get_storage_type TEST=emerge-rauru coreboot Change-Id: I28e0e4294c9a44f1eb17147928ef2860227ff7d3 Signed-off-by: Yidi Lin <yidilin@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/85879 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
parent
8a62f239bd
commit
2bef056104
3 changed files with 21 additions and 23 deletions
|
|
@ -66,21 +66,6 @@ uint32_t storage_id(void)
|
|||
return cached_storage_id;
|
||||
}
|
||||
|
||||
enum ufs_type storage_type(uint32_t index)
|
||||
{
|
||||
switch (index) {
|
||||
case 0:
|
||||
return UFS_40;
|
||||
case 1:
|
||||
return UFS_31;
|
||||
case 2:
|
||||
return UFS_40_HS;
|
||||
default:
|
||||
printk(BIOS_DEBUG, "unsupported type %d\n", index);
|
||||
}
|
||||
return UFS_UNKNOWN;
|
||||
}
|
||||
|
||||
uint32_t sku_id(void)
|
||||
{
|
||||
static uint32_t cached_sku_code = BOARD_ID_INIT;
|
||||
|
|
|
|||
|
|
@ -12,9 +12,11 @@
|
|||
#include <soc/msdc.h>
|
||||
#include <soc/pcie.h>
|
||||
#include <soc/spm_common.h>
|
||||
#include <soc/storage.h>
|
||||
#include <soc/usb.h>
|
||||
|
||||
#include "gpio.h"
|
||||
#include "storage.h"
|
||||
|
||||
#define AFE_SE_SECURE_CON1 (AUDIO_BASE + 0x5634)
|
||||
|
||||
|
|
@ -68,6 +70,25 @@ static void power_on_fpmcu(void)
|
|||
gpio_output(GPIO_FP_RST_1V8_S3_L, 1);
|
||||
}
|
||||
|
||||
enum mtk_storage_type mainboard_get_storage_type(void)
|
||||
{
|
||||
uint32_t index = storage_id();
|
||||
|
||||
switch (index) {
|
||||
case 0:
|
||||
return STORAGE_UFS_40;
|
||||
case 1:
|
||||
return STORAGE_UFS_31;
|
||||
case 2:
|
||||
return STORAGE_UFS_40_HS;
|
||||
case 3:
|
||||
return STORAGE_NVME;
|
||||
default:
|
||||
printk(BIOS_WARNING, "unsupported storage id %u\n", index);
|
||||
}
|
||||
return STORAGE_UNKNOWN;
|
||||
}
|
||||
|
||||
bool mainboard_needs_pcie_init(void)
|
||||
{
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -3,14 +3,6 @@
|
|||
#ifndef __MAINBOARD_GOOGLE_RAURU_STORAGE_H__
|
||||
#define __MAINBOARD_GOOGLE_RAURU_STORAGE_H__
|
||||
|
||||
enum ufs_type {
|
||||
UFS_UNKNOWN = 0,
|
||||
UFS_31 = 0x310,
|
||||
UFS_40 = 0x400,
|
||||
UFS_40_HS = 0x401,
|
||||
};
|
||||
|
||||
uint32_t storage_id(void);
|
||||
enum ufs_type storage_type(uint32_t index);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue