Attention is currently required from: Hung-Te Lin, Yu-Ping Wu.
Yidi Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/85879?usp=email )
Change subject: mb/google/rauru: Implement mainboard_get_storage_type ......................................................................
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 --- M src/mainboard/google/rauru/boardid.c M src/mainboard/google/rauru/mainboard.c M src/mainboard/google/rauru/storage.h 3 files changed, 21 insertions(+), 23 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/79/85879/1
diff --git a/src/mainboard/google/rauru/boardid.c b/src/mainboard/google/rauru/boardid.c index e3e0979..d9f1585 100644 --- a/src/mainboard/google/rauru/boardid.c +++ b/src/mainboard/google/rauru/boardid.c @@ -66,21 +66,6 @@ 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; diff --git a/src/mainboard/google/rauru/mainboard.c b/src/mainboard/google/rauru/mainboard.c index a49caf6..34e4330 100644 --- a/src/mainboard/google/rauru/mainboard.c +++ b/src/mainboard/google/rauru/mainboard.c @@ -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)
@@ -46,6 +48,25 @@ 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_DEBUG, "unsupported type %u\n", index); + } + return STORAGE_UNKNOWN; +} + bool mainboard_needs_pcie_init(void) { return true; diff --git a/src/mainboard/google/rauru/storage.h b/src/mainboard/google/rauru/storage.h index a97bbcb..a1b4d63 100644 --- a/src/mainboard/google/rauru/storage.h +++ b/src/mainboard/google/rauru/storage.h @@ -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