coreboot-kgpe-d16/src/soc/mediatek/common/sspm.c
Rex-BC Chen e235f9a56b soc/mediatek: Move the SSPM driver to common
The SSPM driver can be shared by MT8183, MT8192 and MT8195.

TEST=emerge-{asurada, kukui} coreboot;

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: If9779853becb298eeeabb3dc6096bc474baae202
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55050
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-06-01 08:28:30 +00:00

25 lines
489 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/mmio.h>
#include <soc/mcu_common.h>
#include <soc/sspm.h>
#include <soc/symbols.h>
static void reset_sspm(struct mtk_mcu *mcu)
{
write32(&sspm_reg->sw_rstn, 0x1);
}
static struct mtk_mcu sspm = {
.firmware_name = CONFIG_SSPM_FIRMWARE,
.run_address = (void *)SSPM_SRAM_BASE,
.reset = reset_sspm,
};
void sspm_init(void)
{
sspm.load_buffer = _dram_dma;
sspm.buffer_size = REGION_SIZE(dram_dma);
mtk_init_mcu(&sspm);
}