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 #include <soc/infracfg.h>
7 
8 /* INFRA2APU_SRAM_PROT_EN */
9 DEFINE_BITFIELD(PROT_EN, 31, 30)
10 
11 /* MBOX Functional Configuration */
12 DEFINE_BITFIELD(LOCK, 0, 0)
13 DEFINE_BITFIELD(NO_MPU, 16, 16)
14 
15 static void dump_apusys_reg(void)
16 {
17  int i;
18 
19  printk(BIOS_INFO, "INFRA2APU_SRAM_PROT_EN %p = %#x\n",
22 
23  for (i = 0; i < ARRAY_SIZE(mt8192_apu_mbox); i++) {
24  printk(BIOS_INFO, "APU_MBOX %p = %#x\n",
25  (void *)&mt8192_apu_mbox[i]->mbox_func_cfg,
26  read32(&mt8192_apu_mbox[i]->mbox_func_cfg));
27  }
28 }
29 
30 void apusys_init(void)
31 {
32  int i;
33 
35 
36  /* Setup MBOX MPU for non secure access */
37  for (i = 0; i < ARRAY_SIZE(mt8192_apu_mbox); i++)
38  SET32_BITFIELDS(&mt8192_apu_mbox[i]->mbox_func_cfg, NO_MPU, 1, LOCK, 1);
39 
41 }
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_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
static void dump_apusys_reg(void)
Definition: apusys.c:15
void apusys_init(void)
Definition: apusys.c:30
static struct mt8192_apu_mbox_regs *const mt8192_apu_mbox[]
Definition: apusys.h:19
static struct mt8192_infracfg_regs *const mt8192_infracfg
Definition: infracfg.h:416