diff options
author | Nina Wu <nina-cm.wu@mediatek.com> | 2020-09-04 10:11:27 +0800 |
---|---|---|
committer | Hung-Te Lin <hungte@chromium.org> | 2020-12-28 13:38:38 +0000 |
commit | 87c30a064c33071d4494c03c34abf2cdea6ff850 (patch) | |
tree | 1e7d181d5f7039231784fc267ba8c16edb1534dc /src/soc/mediatek/mt8192/include | |
parent | 396035114149f92d69b1ebe3ecb661ba59181e7f (diff) |
soc/mediatek/mt8192: devapc: add basic devapc drivers
Add basic devapc (device access permission control) drivers.
DAPC driver is used to set up bus fabric security and data protection
among hardwares. DAPC driver groups the master hardwares into different
domains and gives secure and non-secure property. The slave hardware can
configure different access permissions for different domains via DAPC
driver.
Change-Id: I2ad47c86b88047c76854a6f8a67b251b6a9d4013
Signed-off-by: Nina Wu <nina-cm.wu@mediatek.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46402
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/soc/mediatek/mt8192/include')
-rw-r--r-- | src/soc/mediatek/mt8192/include/soc/addressmap.h | 5 | ||||
-rw-r--r-- | src/soc/mediatek/mt8192/include/soc/devapc.h | 52 |
2 files changed, 57 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8192/include/soc/addressmap.h b/src/soc/mediatek/mt8192/include/soc/addressmap.h index 7660bccac1..e4d57b05fc 100644 --- a/src/soc/mediatek/mt8192/include/soc/addressmap.h +++ b/src/soc/mediatek/mt8192/include/soc/addressmap.h @@ -28,6 +28,11 @@ enum { PMIF_SPMI_BASE = IO_PHYS + 0x00027000, PMICSPI_MST_BASE = IO_PHYS + 0x00028000, SPMI_MST_BASE = IO_PHYS + 0x00029000, + DEVAPC_INFRA_AO_BASE = IO_PHYS + 0x00030000, + DEVAPC_PERI_AO_BASE = IO_PHYS + 0x00034000, + DEVAPC_PERI2_AO_BASE = IO_PHYS + 0x00038000, + DEVAPC_PERI_PAR_AO_BASE = IO_PHYS + 0x0003C000, + DEVAPC_FMEM_AO_BASE = IO_PHYS + 0x00044000, I2C_DMA_BASE = IO_PHYS + 0x00217080, EMI_BASE = IO_PHYS + 0x00219000, EMI_MPU_BASE = IO_PHYS + 0x00226000, diff --git a/src/soc/mediatek/mt8192/include/soc/devapc.h b/src/soc/mediatek/mt8192/include/soc/devapc.h new file mode 100644 index 0000000000..f227aaadd3 --- /dev/null +++ b/src/soc/mediatek/mt8192/include/soc/devapc.h @@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef SOC_MEDIATEK_MT8192_DEVAPC_H +#define SOC_MEDIATEK_MT8192_DEVAPC_H + +#include <device/mmio.h> +#include <soc/addressmap.h> + +void dapc_init(void); + +#define DEVAPC_AO_MAX 6 + +enum devapc_ao_offset { + MAS_DOM_0 = 0x0900, + MAS_DOM_1 = 0x0904, + MAS_SEC_0 = 0x0A00, + AO_APC_CON = 0x0F00, +}; + +/* INFRA */ +DEFINE_BIT(SCP_SSPM_SEC, 3) +DEFINE_BIT(CPU_EB_SEC, 4) + +DEFINE_BITFIELD(PCIE_DOM, 19, 16) /* 2 */ +DEFINE_BITFIELD(SCP_SSPM_DOM, 3, 0) /* 4 */ +DEFINE_BITFIELD(CPU_EB_DOM, 11, 8) /* 5 */ + +/* PERI */ +DEFINE_BITFIELD(SPM_DOM, 3, 0) /* 0 */ + +enum master_domain { + MAS_DOMAIN_0 = 0, + MAS_DOMAIN_1, + MAS_DOMAIN_2, + MAS_DOMAIN_3, + MAS_DOMAIN_4, + MAS_DOMAIN_5, + MAS_DOMAIN_6, + MAS_DOMAIN_7, + MAS_DOMAIN_8, + MAS_DOMAIN_9, + MAS_DOMAIN_10, + MAS_DOMAIN_11, + MAS_DOMAIN_12, + MAS_DOMAIN_13, + MAS_DOMAIN_14, + MAS_DOMAIN_15, + MAS_DOMAIN_MAX, +}; + + +#endif /* SOC_MEDIATEK_MT8192_DEVAPC_H */ |