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/+/85878?usp=email )
Change subject: soc/mediatek/common: Get storage type from mainboard ......................................................................
soc/mediatek/common: Get storage type from mainboard
Add common definitions and `mainboard_get_storage_type` API for determining the storage type from mainboard.
TEST=emerge-rauru coreboot
Change-Id: I5dba2b54b29a701b825fb9bfcac74eb45a563d71 Signed-off-by: Yidi Lin yidilin@chromium.org --- A src/soc/mediatek/common/include/soc/storage.h 1 file changed, 24 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/78/85878/1
diff --git a/src/soc/mediatek/common/include/soc/storage.h b/src/soc/mediatek/common/include/soc/storage.h new file mode 100644 index 0000000..d56ef6c --- /dev/null +++ b/src/soc/mediatek/common/include/soc/storage.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */ + +#ifndef SOC_MEDIATEK_COMMON_STORAGE_H +#define SOC_MEDIATEK_COMMON_STORAGE_H + +/* Bits [31:28] for base type (e.g. UFS, NvME). */ +#define _BASE_TYPE_SHIFT 28 +#define _BASE_TYPE_MASK (0xf << _BASE_TYPE_SHIFT) +#define _BASE_TYPE(x) ((x & 0xf) << _BASE_TYPE_SHIFT) + +#define _BASE_TYPE_UFS _BASE_TYPE(0x0) +#define _BASE_TYPE_NVME _BASE_TYPE(0x1) + +enum mtk_storage_type { + STORAGE_UNKNOWN = 0, + STORAGE_UFS_31 = _BASE_TYPE_UFS | 0x310, + STORAGE_UFS_40 = _BASE_TYPE_UFS | 0x400, + STORAGE_UFS_40_HS = _BASE_TYPE_UFS | 0x401, + STORAGE_NVME = _BASE_TYPE_NVME, +}; + +enum mtk_storage_type mainboard_get_storage_type(void); + +#endif /* SOC_MEDIATEK_COMMON_STORAGE_H */