Attention is currently required from: Hung-Te Lin. Rex-BC Chen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60394 )
Change subject: soc/mediatek/mt8195: Move some definations of devapc to common folder ......................................................................
soc/mediatek/mt8195: Move some definations of devapc to common folder
Move some definations of devapc for sharing between MT8195 and MT8186.
BUG=b:202871018 TEST=emerge-cherry coreboot; emerge-corsola coreboot;
Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Change-Id: Ia1769ede790f106a320ead9be7e2a596fe96930a --- A src/soc/mediatek/common/include/soc/devapc_common.h M src/soc/mediatek/mt8195/apusys_devapc.c M src/soc/mediatek/mt8195/devapc.c M src/soc/mediatek/mt8195/include/soc/devapc.h 4 files changed, 52 insertions(+), 45 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/60394/1
diff --git a/src/soc/mediatek/common/include/soc/devapc_common.h b/src/soc/mediatek/common/include/soc/devapc_common.h new file mode 100644 index 0000000..666fc70 --- /dev/null +++ b/src/soc/mediatek/common/include/soc/devapc_common.h @@ -0,0 +1,50 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef SOC_MEDIATEK_COMMON_DEVAPC_H +#define SOC_MEDIATEK_COMMON_DEVAPC_H + +#define DAPC_PERM_ATTR_4(DEV_NAME, PERM_ATTR0, PERM_ATTR1, \ + PERM_ATTR2, PERM_ATTR3) \ + (unsigned char)PERM_ATTR0, (unsigned char)PERM_ATTR1, \ + (unsigned char)PERM_ATTR2, (unsigned char)PERM_ATTR3, + +#define DAPC_PERM_ATTR_8(DEV_NAME, PERM_ATTR0, PERM_ATTR1, \ + PERM_ATTR2, PERM_ATTR3, PERM_ATTR4, PERM_ATTR5, \ + PERM_ATTR6, PERM_ATTR7) \ + DAPC_PERM_ATTR_4(DEV_NAME, PERM_ATTR0, PERM_ATTR1, \ + PERM_ATTR2, PERM_ATTR3) \ + DAPC_PERM_ATTR_4(DEV_NAME, PERM_ATTR4, PERM_ATTR5, \ + PERM_ATTR6, PERM_ATTR7) + +#define DAPC_PERM_ATTR_16(DEV_NAME, PERM_ATTR0, PERM_ATTR1, \ + PERM_ATTR2, PERM_ATTR3, PERM_ATTR4, PERM_ATTR5, \ + PERM_ATTR6, PERM_ATTR7, PERM_ATTR8, PERM_ATTR9, \ + PERM_ATTR10, PERM_ATTR11, PERM_ATTR12, PERM_ATTR13, \ + PERM_ATTR14, PERM_ATTR15) \ + DAPC_PERM_ATTR_8(DEV_NAME, PERM_ATTR0, PERM_ATTR1, \ + PERM_ATTR2, PERM_ATTR3, \ + PERM_ATTR4, PERM_ATTR5, \ + PERM_ATTR6, PERM_ATTR7) \ + DAPC_PERM_ATTR_8(DEV_NAME, PERM_ATTR8, PERM_ATTR9, \ + PERM_ATTR10, PERM_ATTR11, \ + PERM_ATTR12, PERM_ATTR13, \ + PERM_ATTR14, PERM_ATTR15) + +#define FORBIDDEN2 FORBIDDEN, FORBIDDEN +#define FORBIDDEN3 FORBIDDEN2, FORBIDDEN +#define FORBIDDEN4 FORBIDDEN3, FORBIDDEN +#define FORBIDDEN5 FORBIDDEN4, FORBIDDEN +#define FORBIDDEN6 FORBIDDEN5, FORBIDDEN +#define FORBIDDEN7 FORBIDDEN6, FORBIDDEN +#define FORBIDDEN10 FORBIDDEN3, FORBIDDEN7 +#define FORBIDDEN11 FORBIDDEN10, FORBIDDEN +#define FORBIDDEN12 FORBIDDEN11, FORBIDDEN +#define FORBIDDEN13 FORBIDDEN12, FORBIDDEN +#define FORBIDDEN14 FORBIDDEN13, FORBIDDEN +#define FORBIDDEN15 FORBIDDEN14, FORBIDDEN + +#define NO_PROTECTION2 NO_PROTECTION, NO_PROTECTION +#define NO_PROTECTION3 NO_PROTECTION2, NO_PROTECTION +#define NO_PROTECTION4 NO_PROTECTION3, NO_PROTECTION + +#endif diff --git a/src/soc/mediatek/mt8195/apusys_devapc.c b/src/soc/mediatek/mt8195/apusys_devapc.c index 3e86289..3a49e38 100644 --- a/src/soc/mediatek/mt8195/apusys_devapc.c +++ b/src/soc/mediatek/mt8195/apusys_devapc.c @@ -3,6 +3,7 @@ #include <console/console.h> #include <soc/apusys_devapc.h> #include <soc/devapc.h> +#include <soc/devapc_common.h>
static const enum domain_id domain_map[] = { DOMAIN_0, DOMAIN_1, DOMAIN_2, DOMAIN_3, DOMAIN_4, DOMAIN_5, DOMAIN_6, DOMAIN_7, diff --git a/src/soc/mediatek/mt8195/devapc.c b/src/soc/mediatek/mt8195/devapc.c index 1b0de8c..ac3e6db 100644 --- a/src/soc/mediatek/mt8195/devapc.c +++ b/src/soc/mediatek/mt8195/devapc.c @@ -2,6 +2,7 @@
#include <console/console.h> #include <soc/devapc.h> +#include <soc/devapc_common.h> #include <soc/apusys_devapc.h>
static const struct apc_infra_peri_dom_16 infra_ao_sys0_devices[] = { diff --git a/src/soc/mediatek/mt8195/include/soc/devapc.h b/src/soc/mediatek/mt8195/include/soc/devapc.h index 5267b3b..a355fdf 100644 --- a/src/soc/mediatek/mt8195/include/soc/devapc.h +++ b/src/soc/mediatek/mt8195/include/soc/devapc.h @@ -76,51 +76,6 @@ unsigned char d_permission[4]; };
-#define DAPC_PERM_ATTR_4(DEV_NAME, PERM_ATTR0, PERM_ATTR1, \ - PERM_ATTR2, PERM_ATTR3) \ - (unsigned char)PERM_ATTR0, (unsigned char)PERM_ATTR1, \ - (unsigned char)PERM_ATTR2, (unsigned char)PERM_ATTR3, - -#define DAPC_PERM_ATTR_8(DEV_NAME, PERM_ATTR0, PERM_ATTR1, \ - PERM_ATTR2, PERM_ATTR3, PERM_ATTR4, PERM_ATTR5, \ - PERM_ATTR6, PERM_ATTR7) \ - DAPC_PERM_ATTR_4(DEV_NAME, PERM_ATTR0, PERM_ATTR1, \ - PERM_ATTR2, PERM_ATTR3) \ - DAPC_PERM_ATTR_4(DEV_NAME, PERM_ATTR4, PERM_ATTR5, \ - PERM_ATTR6, PERM_ATTR7) - -#define DAPC_PERM_ATTR_16(DEV_NAME, PERM_ATTR0, PERM_ATTR1, \ - PERM_ATTR2, PERM_ATTR3, PERM_ATTR4, PERM_ATTR5, \ - PERM_ATTR6, PERM_ATTR7, PERM_ATTR8, PERM_ATTR9, \ - PERM_ATTR10, PERM_ATTR11, PERM_ATTR12, PERM_ATTR13, \ - PERM_ATTR14, PERM_ATTR15) \ - DAPC_PERM_ATTR_8(DEV_NAME, PERM_ATTR0, PERM_ATTR1, \ - PERM_ATTR2, PERM_ATTR3, \ - PERM_ATTR4, PERM_ATTR5, \ - PERM_ATTR6, PERM_ATTR7) \ - DAPC_PERM_ATTR_8(DEV_NAME, PERM_ATTR8, PERM_ATTR9, \ - PERM_ATTR10, PERM_ATTR11, \ - PERM_ATTR12, PERM_ATTR13, \ - PERM_ATTR14, PERM_ATTR15) - -#define NO_PROTECTION2 NO_PROTECTION, NO_PROTECTION -#define NO_PROTECTION3 NO_PROTECTION2, NO_PROTECTION - -#define FORBIDDEN2 FORBIDDEN, FORBIDDEN -#define FORBIDDEN3 FORBIDDEN, FORBIDDEN, FORBIDDEN -#define FORBIDDEN7 FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, \ - FORBIDDEN, FORBIDDEN -#define FORBIDDEN10 FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, \ - FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, \ - FORBIDDEN -#define FORBIDDEN11 FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, \ - FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN, \ - FORBIDDEN -#define FORBIDDEN12 FORBIDDEN11, FORBIDDEN -#define FORBIDDEN13 FORBIDDEN12, FORBIDDEN -#define FORBIDDEN14 FORBIDDEN13, FORBIDDEN -#define FORBIDDEN15 FORBIDDEN14, FORBIDDEN - enum devapc_sys_dom_num { DOM_NUM_INFRA_AO_SYS0 = 16, DOM_NUM_INFRA_AO_SYS1 = 4,