soc/mediatek: Move the MT8192 MCUPM driver to common

The MPUCM drivers can be shared by MT8192 and MT8195.

TEST=emerge-asurada coreboot;

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I07a66bcf5a149582f34df1cfd08b5514fc5c2eb9
Reviewed-on: https://review.coreboot.org/c/coreboot/+/54898
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
Rex-BC Chen 2021-05-21 11:12:19 +08:00 committed by Hung-Te Lin
parent a36a68b027
commit 9cf07f0cb9
4 changed files with 17 additions and 17 deletions

View File

@ -0,0 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef SOC_MEDIATEK_COMMON_MCUPM_H
#define SOC_MEDIATEK_COMMON_MCUPM_H
#include <soc/addressmap.h>
#include <types.h>
struct mcupm_regs {
u32 sw_rstn;
};
static struct mcupm_regs *const mcupm_reg = (void *)MCUPM_CFG_BASE;
void mcupm_init(void);
#endif /* SOC_MEDIATEK_COMMON_MCUPM_H */

View File

@ -12,7 +12,7 @@ static void reset_mcupm(struct mtk_mcu *mcu)
{ {
/* Clear abnormal boot register */ /* Clear abnormal boot register */
write32((void *)ABNORMALBOOT_REG, 0x0); write32((void *)ABNORMALBOOT_REG, 0x0);
write32(&mt8192_mcupm->sw_rstn, 0x1); write32(&mcupm_reg->sw_rstn, 0x1);
} }
static struct mtk_mcu mcupm = { static struct mtk_mcu mcupm = {
@ -26,7 +26,7 @@ void mcupm_init(void)
mcupm.load_buffer = _dram_dma; mcupm.load_buffer = _dram_dma;
mcupm.buffer_size = REGION_SIZE(dram_dma); mcupm.buffer_size = REGION_SIZE(dram_dma);
write32(&mt8192_mcupm->sw_rstn, 0x0); write32(&mcupm_reg->sw_rstn, 0x0);
if (mtk_init_mcu(&mcupm)) if (mtk_init_mcu(&mcupm))
die("%s() failed\n", __func__); die("%s() failed\n", __func__);

View File

@ -53,7 +53,7 @@ ramstage-y += ../common/gpio.c gpio.c
ramstage-y += ../common/i2c.c i2c.c ramstage-y += ../common/i2c.c i2c.c
ramstage-$(CONFIG_SPI_FLASH) += ../common/spi.c spi.c ramstage-$(CONFIG_SPI_FLASH) += ../common/spi.c spi.c
ramstage-y += ../common/mcu.c ramstage-y += ../common/mcu.c
ramstage-y += mcupm.c ramstage-y += ../common/mcupm.c
ramstage-y += ../common/mmu_operations.c mmu_operations.c ramstage-y += ../common/mmu_operations.c mmu_operations.c
ramstage-$(CONFIG_COMMONLIB_STORAGE_MMC) += ../common/msdc.c ramstage-$(CONFIG_COMMONLIB_STORAGE_MMC) += ../common/msdc.c
ramstage-y += ../common/mtcmos.c mtcmos.c ramstage-y += ../common/mtcmos.c mtcmos.c

View File

@ -1,14 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef SOC_MEDIATEK_MT8192_MCUPM_H
#define SOC_MEDIATEK_MT8192_MCUPM_H
#include <soc/addressmap.h>
#include <types.h>
struct mt8192_mcupm_regs {
u32 sw_rstn;
};
static struct mt8192_mcupm_regs *const mt8192_mcupm = (void *)MCUPM_CFG_BASE;
void mcupm_init(void);
#endif /* SOC_MEDIATEK_MT8192_MCUPM_H */