From 7ac11ca3d64615d1c77e48d31b1730bd67582168 Mon Sep 17 00:00:00 2001 From: Yidi Lin Date: Mon, 19 Apr 2021 15:45:16 +0800 Subject: soc/mediatek: Move mt8192 ufs driver to common Signed-off-by: Yidi Lin Change-Id: I28eb13edcded95a9a4c17bdf92da9f792883a613 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52534 Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu --- src/soc/mediatek/common/include/soc/ufs.h | 17 +++++++++++++++++ src/soc/mediatek/common/ufs.c | 9 +++++++++ src/soc/mediatek/mt8192/Makefile.inc | 2 +- src/soc/mediatek/mt8192/include/soc/ufs.h | 17 ----------------- src/soc/mediatek/mt8192/ufs.c | 9 --------- 5 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 src/soc/mediatek/common/include/soc/ufs.h create mode 100644 src/soc/mediatek/common/ufs.c delete mode 100644 src/soc/mediatek/mt8192/include/soc/ufs.h delete mode 100644 src/soc/mediatek/mt8192/ufs.c (limited to 'src') diff --git a/src/soc/mediatek/common/include/soc/ufs.h b/src/soc/mediatek/common/include/soc/ufs.h new file mode 100644 index 0000000000..98bba9da1c --- /dev/null +++ b/src/soc/mediatek/common/include/soc/ufs.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef SOC_MEDIATEK_COMMON_UFS_H +#define SOC_MEDIATEK_COMMON_UFS_H + +#include +#include + +void ufs_disable_refclk(void); + +enum ufshci_offset { + REG_UFS_REFCLK_CTRL = 0x144, +}; + +#define UFS_REFCLK_CTRL (UFSHCI_BASE + REG_UFS_REFCLK_CTRL) + +#endif /* SOC_MEDIATEK_COMMON_UFS_H */ diff --git a/src/soc/mediatek/common/ufs.c b/src/soc/mediatek/common/ufs.c new file mode 100644 index 0000000000..2537fa7883 --- /dev/null +++ b/src/soc/mediatek/common/ufs.c @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +void ufs_disable_refclk(void) +{ + /* disable ref clock to let UFSHCI release SPM signal */ + write32((void *)UFS_REFCLK_CTRL, 0); +} diff --git a/src/soc/mediatek/mt8192/Makefile.inc b/src/soc/mediatek/mt8192/Makefile.inc index 0181bfcab0..9512346984 100644 --- a/src/soc/mediatek/mt8192/Makefile.inc +++ b/src/soc/mediatek/mt8192/Makefile.inc @@ -61,7 +61,7 @@ ramstage-y += spm.c ramstage-y += sspm.c ramstage-y += ../common/timer.c ramstage-y += ../common/uart.c -ramstage-y += ufs.c +ramstage-y += ../common/ufs.c ramstage-y += ../common/usb.c usb.c MT8192_BLOB_DIR := 3rdparty/blobs/soc/mediatek/mt8192 diff --git a/src/soc/mediatek/mt8192/include/soc/ufs.h b/src/soc/mediatek/mt8192/include/soc/ufs.h deleted file mode 100644 index 70a30a9a06..0000000000 --- a/src/soc/mediatek/mt8192/include/soc/ufs.h +++ /dev/null @@ -1,17 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#ifndef SOC_MEDIATEK_MT8192_UFS_H -#define SOC_MEDIATEK_MT8192_UFS_H - -#include -#include - -void ufs_disable_refclk(void); - -enum ufshci_offset { - REG_UFS_REFCLK_CTRL = 0x144, -}; - -#define UFS_REFCLK_CTRL (UFSHCI_BASE + REG_UFS_REFCLK_CTRL) - -#endif /* SOC_MEDIATEK_MT8192_UFS_H */ diff --git a/src/soc/mediatek/mt8192/ufs.c b/src/soc/mediatek/mt8192/ufs.c deleted file mode 100644 index 2537fa7883..0000000000 --- a/src/soc/mediatek/mt8192/ufs.c +++ /dev/null @@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include - -void ufs_disable_refclk(void) -{ - /* disable ref clock to let UFSHCI release SPM signal */ - write32((void *)UFS_REFCLK_CTRL, 0); -} -- cgit v1.2.3