coreboot-kgpe-d16/src/soc/mediatek/mt8195/apusys.c
Macpaul Lin 5d16f8d5b9 soc/mediatek/mt8195: replace SPDX identifiers to GPL-2.0-only OR MIT
This replaces 'SPDX-License-Identifier' tags in all the files under
soc/mediatek/mt8195 for better code re-use in other open source
software stack.

These files were originally from MediaTek and follow coreboot's main
license: "GPL-2.0-only". Now MediaTek replaces these files to
"GPL-2.0-only OR MIT" license.

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Change-Id: I79a585c2a611dbfd294c1c94f998d972118b5c52
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66625
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2022-11-12 23:06:19 +00:00

31 lines
717 B
C

/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
#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)
{
size_t i;
for (i = 0; i < ARRAY_SIZE(mt8195_apu_mbox); i++) {
printk(BIOS_DEBUG, "APU_MBOX %p = %#x\n",
(void *)&mt8195_apu_mbox[i]->mbox_func_cfg,
read32(&mt8195_apu_mbox[i]->mbox_func_cfg));
}
}
void apusys_init(void)
{
size_t i;
/* Set up MBOX MPU for non secure access */
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();
}