blob: b0f0dbcb881a057340583eecfa239d9428083a5a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/mmio.h>
#include <soc/dpm_v2.h>
#include <soc/mcu_common.h>
#include <soc/symbols.h>
static struct mtk_mcu dpm_mcu[] = {
{
.firmware_name = CONFIG_DPM_DM_FIRMWARE,
.run_address = (void *)DPM_DM_SRAM_BASE,
},
{
.firmware_name = CONFIG_DPM_PM_FIRMWARE,
.run_address = (void *)DPM_PM_SRAM_BASE,
.reset = dpm_reset,
},
};
void dpm_reset(struct mtk_mcu *mcu)
{
/* free RST */
setbits32p(DPM_CFG_CH0 + DPM_RST_OFFSET, DPM_SW_RSTN);
}
int dpm_init(void)
{
int i;
struct mtk_mcu *dpm;
u32 dramc_wbr_backup = read32p(DRAMC_WBR);
setbits32p(DRAMC_WBR, ENABLE_DRAMC_WBR_MASK);
for (i = 0; i < ARRAY_SIZE(dpm_mcu); i++) {
dpm = &dpm_mcu[i];
dpm->load_buffer = _dram_dma;
dpm->buffer_size = REGION_SIZE(dram_dma);
if (mtk_init_mcu(dpm))
return -1;
}
write32p(DRAMC_WBR, dramc_wbr_backup);
return 0;
}
|