2022-08-11 10:27:10 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
|
2021-06-25 17:27:56 +02:00
|
|
|
|
|
|
|
#include <console/console.h>
|
|
|
|
#include <device/mmio.h>
|
|
|
|
#include <soc/apusys.h>
|
|
|
|
|
|
|
|
/* MBOX Functional Configuration */
|
|
|
|
DEFINE_BITFIELD(LOCK, 0, 0)
|
|
|
|
DEFINE_BITFIELD(NO_MPU, 16, 16)
|
|
|
|
|
|
|
|
static void dump_apusys_reg(void)
|
|
|
|
{
|
2021-11-09 09:42:05 +01:00
|
|
|
size_t i;
|
2021-06-25 17:27:56 +02:00
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(mt8195_apu_mbox); i++) {
|
2021-11-09 09:42:05 +01:00
|
|
|
printk(BIOS_DEBUG, "APU_MBOX %p = %#x\n",
|
2021-06-25 17:27:56 +02:00
|
|
|
(void *)&mt8195_apu_mbox[i]->mbox_func_cfg,
|
|
|
|
read32(&mt8195_apu_mbox[i]->mbox_func_cfg));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void apusys_init(void)
|
|
|
|
{
|
2021-11-09 09:42:05 +01:00
|
|
|
size_t i;
|
2021-06-25 17:27:56 +02:00
|
|
|
|
2021-11-09 09:42:05 +01:00
|
|
|
/* Set up MBOX MPU for non secure access */
|
2021-06-25 17:27:56 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(mt8195_apu_mbox); i++)
|
|
|
|
SET32_BITFIELDS(&mt8195_apu_mbox[i]->mbox_func_cfg, NO_MPU, 1, LOCK, 1);
|
|
|
|
|
|
|
|
dump_apusys_reg();
|
|
|
|
}
|