1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
2
3 #include <console/console.h>
4 #include <device/mmio.h>
5 #include <soc/apusys.h>
6
7 /* MBOX Functional Configuration */
8 DEFINE_BITFIELD(LOCK, 0, 0)
9 DEFINE_BITFIELD(NO_MPU, 16, 16)
10
dump_apusys_reg(void)11 static void dump_apusys_reg(void)
12 {
13 size_t i;
14
15 for (i = 0; i < ARRAY_SIZE(mt8195_apu_mbox); i++) {
16 printk(BIOS_DEBUG, "APU_MBOX %p = %#x\n",
17 (void *)&mt8195_apu_mbox[i]->mbox_func_cfg,
18 read32(&mt8195_apu_mbox[i]->mbox_func_cfg));
19 }
20 }
21
apusys_init(void)22 void apusys_init(void)
23 {
24 size_t i;
25
26 /* Set up MBOX MPU for non secure access */
27 for (i = 0; i < ARRAY_SIZE(mt8195_apu_mbox); i++)
28 SET32_BITFIELDS(&mt8195_apu_mbox[i]->mbox_func_cfg, NO_MPU, 1, LOCK, 1);
29
30 dump_apusys_reg();
31 }
32