coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
apusys.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <console/console.h>
4 #include <device/mmio.h>
5 #include <soc/apusys.h>
6 
7 /* MBOX Functional Configuration */
9 DEFINE_BITFIELD(NO_MPU, 16, 16)
10 
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 
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 
31 }
static uint32_t read32(const void *addr)
Definition: mmio.h:22
#define LOCK
Definition: pm.h:119
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define printk(level,...)
Definition: stdlib.h:16
#define DEFINE_BITFIELD(name, high_bit, low_bit)
Definition: mmio.h:124
#define SET32_BITFIELDS(addr,...)
Definition: mmio.h:201
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
void apusys_init(void)
Definition: apusys.c:30
static void dump_apusys_reg(void)
Definition: apusys.c:11
static struct mt8195_apu_mbox_regs *const mt8195_apu_mbox[]
Definition: apusys.h:19