// SPDX-License-Identifier: BSD-3-Clause
/*
 * Copyright (c) 2024, MediaTek Inc. All rights reserved.
 *
 */

#include <common/debug.h>
#include <lib/mmio.h>
#include <devapc.h>

/* Infra_ao */
static const struct APC_PERI_DOM_16 INFRA_AO_SYS0_Devices[] = {

/* 0 */
DAPC_INFRA_AO_SYS0_ATTR("NET_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("NET_S-1",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("PCIE_AXI_S2",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("PCIE_AXI_S3",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("SGMII_SBUS0_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("SGMII_SBUS1_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("ETH2P5G_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("MCUSYS_CFGREG_APB_S-1",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("MCUSYS_CFGREG_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_EAST_APB0_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),

/* 10 */
DAPC_INFRA_AO_SYS0_ATTR("BND_EAST_APB1_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_EAST_APB2_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_EAST_APB3_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_EAST_APB4_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_EAST_APB5_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_EAST_APB6_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_EAST_APB7_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_SOUTH_APB0_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_SOUTH_APB1_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_SOUTH_APB2_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),

/* 20 */
DAPC_INFRA_AO_SYS0_ATTR("BND_SOUTH_APB3_S",
			SEC_RW_NS_R,   FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_SOUTH_APB4_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_SOUTH_APB5_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_SOUTH_APB6_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_SOUTH_APB7_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_WEST_APB0_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_WEST_APB1_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_WEST_APB2_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_WEST_APB3_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_WEST_APB4_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),

/* 30 */
DAPC_INFRA_AO_SYS0_ATTR("BND_WEST_APB5_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_WEST_APB6_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_WEST_APB7_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_NORTH_APB0_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_NORTH_APB1_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_NORTH_APB2_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_NORTH_APB3_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_NORTH_APB4_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_NORTH_APB5_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BND_NORTH_APB6_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),

/* 40 */
DAPC_INFRA_AO_SYS0_ATTR("BND_NORTH_APB7_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("INFRACFG_AO_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("INFRACFG_AO_AUTO_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("INFRACFG_AO_MEM_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("RESERVED_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("AP_CIRQ_EINT_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("SYS_TIMER_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("CKSYS_APB0_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("CKSYS_APB1_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("CKSYS_APB2_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),

/* 50 */
DAPC_INFRA_AO_SYS0_ATTR("TOP_CENTER_APB0_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("TOP_CENTER_APB1_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("TOP_CENTER_APB2_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("TOP_CENTER_APB3_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("TOP_CENTER_APB4_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BCRM_INFRA_AO_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BCRM_PERI_AO_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DEBUG_CTRL_INFRA_AO_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DEVICE_APC_INFRA_AO_APB_S",
			SEC_RW_ONLY,   FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("AUDIO_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),

/* 60 */
DAPC_INFRA_AO_SYS0_ATTR("AUDIO_S-1",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("SSUSB_P1_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("SSUSB_P1_S-1",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("SSUSB_P1_S-2",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DEBUGSYS_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH0_TOP0_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH0_TOP1_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH0_TOP2_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH0_TOP3_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH0_TOP4_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),

/* 70 */
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH0_TOP5_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH0_TOP6_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH1_TOP0_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH1_TOP1_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH1_TOP2_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH1_TOP3_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH1_TOP4_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH1_TOP5_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_CH1_TOP6_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DRAMC_MD32_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),

/* 80 */
DAPC_INFRA_AO_SYS0_ATTR("APXGPT_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("SEJ_APB_S",
			SEC_RW_ONLY,   FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("SECURITY_AO_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("PWM_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BCRM_PERI_AO2_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DEBUG_CTRL_FMEM_AO_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DEVICE_APC_FMEM_AO_APB_S",
			SEC_RW_ONLY,   FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("SYS_CIRQ_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("INFRACFG_PDN_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("INFRACFG_PDN_AUTO_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),

/* 90 */
DAPC_INFRA_AO_SYS0_ATTR("SSR_RNG_APB_S",
			SEC_RW_ONLY,   FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("CQ_DMA_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("SRAMROM_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("INFRACFG_MEM_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("INFRA_DEBUG_TRACKER_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("DEVICE_APC_INFRA_PDN_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("PERI_DEBUG_TRACKER_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("EMI_FAKE_ENGINE_0_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("EMI_FAKE_ENGINE_1_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("EMI_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),

/* 100 */
DAPC_INFRA_AO_SYS0_ATTR("EMI_MPU_APB_S",
			SEC_RW_ONLY,   FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BCRM_FMEM_PDN_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BCRM_INFRA_PDN_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BCRM_PERI_PDN_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BCRM_PERI_PDN2_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("PCIE_AHB_S2",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("PCIE_AHB_S3",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("MSDC0_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("UART0_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("UART1_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),

/* 110 */
DAPC_INFRA_AO_SYS0_ATTR("UART2_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("SPI0_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("SPI1_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("SPI2_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("AUXADC_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("PTP_THERM_CTRL_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("I2C_APB0_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("I2C_APB1_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("PERICFG_PDN_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("PERICFG_PDN_AUTO_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),

/* 120 */
DAPC_INFRA_AO_SYS0_ATTR("NFI_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("NFIECC_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("APDMA_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BCRM_PERI_PAR_PDN_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("PERICFG_AO_AUTO_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("PERICFG_AO_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
DAPC_INFRA_AO_SYS0_ATTR("BCRM_PERI_PAR_AO_APB_S",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN,
			FORBIDDEN,     FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
};

static const struct APC_PERI_DOM_4 INFRA_AO_SYS1_Devices[] = {

/* 0 */
DAPC_INFRA_AO_SYS1_ATTR("SRAMROM_S-1",
			NO_PROTECTION, FORBIDDEN,     FORBIDDEN,     FORBIDDEN),
};

/* 4-bit to 2-bit remapping */
static const struct devapc_remap_table infra_dom_remap[] = {
	DAPC_DOM_REMAP(DOMAIN_0, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_1, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_2, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_3, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_4, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_5, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_6, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_7, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_8, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_9, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_10, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_11, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_12, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_13, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_14, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_15, DOMAIN_0)
};

/* 4-bit to 8-bit remapping */
static const struct devapc_remap_table fmem_dom_remap[] = {
	DAPC_DOM_REMAP(DOMAIN_0, DOMAIN_0),
	DAPC_DOM_REMAP(DOMAIN_1, DOMAIN_1),
	DAPC_DOM_REMAP(DOMAIN_2, DOMAIN_2),
	DAPC_DOM_REMAP(DOMAIN_3, DOMAIN_3),
	DAPC_DOM_REMAP(DOMAIN_4, DOMAIN_4),
	DAPC_DOM_REMAP(DOMAIN_5, DOMAIN_5),
	DAPC_DOM_REMAP(DOMAIN_6, DOMAIN_6),
	DAPC_DOM_REMAP(DOMAIN_7, DOMAIN_7),
	DAPC_DOM_REMAP(DOMAIN_8, DOMAIN_8),
	DAPC_DOM_REMAP(DOMAIN_9, DOMAIN_9),
	DAPC_DOM_REMAP(DOMAIN_10, DOMAIN_10),
	DAPC_DOM_REMAP(DOMAIN_11, DOMAIN_11),
	DAPC_DOM_REMAP(DOMAIN_12, DOMAIN_12),
	DAPC_DOM_REMAP(DOMAIN_13, DOMAIN_13),
	DAPC_DOM_REMAP(DOMAIN_14, DOMAIN_14),
	DAPC_DOM_REMAP(DOMAIN_15, DOMAIN_15)
};

/* INFRA_ao */
static const struct devapc_ao_master INFRA_AO_Masters[] = {
	DAPC_MAS_ATTR("MCU_DFD_M", -1, 0, DOMAIN_0, DAPC_NSEC),
	DAPC_MAS_ATTR("PWM_M", 0, 1, DOMAIN_0, DAPC_NSEC),
	DAPC_MAS_ATTR("AUDIO_M", 1, 2, DOMAIN_0, DAPC_NSEC),
	DAPC_MAS_ATTR("PCIE_M2", 2, 3, DOMAIN_4, DAPC_NSEC),
	DAPC_MAS_ATTR("PCIE_M3", 3, 4, DOMAIN_4, DAPC_NSEC),
	DAPC_MAS_ATTR("EMI_L2C_M", 4, 5, DOMAIN_0, DAPC_NSEC),
	DAPC_MAS_ATTR("SSUSB_P1_M0", 5, 6, DOMAIN_0, DAPC_NSEC),
	DAPC_MAS_ATTR("SSUSB_P1_M1", 6, 7, DOMAIN_0, DAPC_NSEC),
	DAPC_MAS_ATTR("MSDC0_M", 7, 8, DOMAIN_0, DAPC_NSEC),
	DAPC_MAS_ATTR("NFI_M", 8, 9, DOMAIN_0, DAPC_NSEC),
	DAPC_MAS_ATTR("THERM_M", 9, 10, DOMAIN_0, DAPC_NSEC),
	DAPC_MAS_ATTR("DEBUG_M", 10, 11, DOMAIN_0, DAPC_NSEC)
};

/* FMEM_ao */
static const struct devapc_ao_master FMEM_AO_Masters[] = {
	DAPC_MAS_ATTR("EMI_FAKE_ENGINE_0_M", 0, 0, DOMAIN_0, DAPC_NSEC),
	DAPC_MAS_ATTR("NETSYS_INFRA_M", 1, 1, DOMAIN_0, DAPC_NSEC),
	DAPC_MAS_ATTR("EMI_FAKE_ENGINE_1_M", 2, 2, DOMAIN_0, DAPC_NSEC),
	DAPC_MAS_ATTR("NETSYS_EMI_M0", 3, 3, DOMAIN_0, DAPC_NSEC),
	DAPC_MAS_ATTR("MCU_M0_M", 4, 4, DOMAIN_0, DAPC_NSEC)
};

static const struct devapc_ao_system infra_ao_sys[] = {
	{
		.id = SYS_ID_INFRA_AO_SYS0,
		.mod_num = SLAVE_NUM_INFRA_AO_SYS0,
		.modules = INFRA_AO_SYS0_Devices,
		.dom_num = DOM_NUM_INFRA_AO_SYS0
	}, {
		.id = SYS_ID_INFRA_AO_SYS1,
		.mod_num = SLAVE_NUM_INFRA_AO_SYS1,
		.modules = INFRA_AO_SYS1_Devices,
		.dom_num = DOM_NUM_INFRA_AO_SYS1
	},
};

static const struct devapc_desc dapc_list[] = {
	[DEVAPC_INFRA_AO] = {
		.ao_base = DEVAPC_INFRA_AO_BASE,
		.pd_base = DEVAPC_INFRA_PDN_BASE,

		.dom_bit = DOM_BIT_INFRA_AO,
		.remap_dom_bit = REMAP_DOM_BIT_INFRA_AO,
		.remap_table = infra_dom_remap,

		.mas_num = MAS_NUM_INFRA_AO,
		.mas = INFRA_AO_Masters,

		.sys_num = SYS_ID_INFRA_AO_MAX,
		.sys = infra_ao_sys
	},
	[DEVAPC_FMEM_AO] = {
		.ao_base = DEVAPC_FMEM_AO_BASE,

		.dom_bit = DOM_BIT_FMEM_AO,
		.remap_dom_bit = REMAP_DOM_BIT_FMEM_AO,
		.remap_table = fmem_dom_remap,

		.mas_num = MAS_NUM_FMEM_AO,
		.mas = FMEM_AO_Masters
	}
};

static void set_ao_master_domain(const struct devapc_desc *desc,
				 int master, uint8_t domain)
{
	uint32_t mas_dom_reg_index;
	uint32_t mas_dom_set_index;
	uintptr_t reg;
	uint32_t clr_bit;
	uint32_t set_bit;

	if (master >= 0) {
		mas_dom_reg_index = master / MAS_NO_IN_1_MAS_DOM;
		mas_dom_set_index = master % MAS_NO_IN_1_MAS_DOM;

		clr_bit = 0xfU << (mas_dom_set_index * 8);
		set_bit = (uint32_t)domain << (mas_dom_set_index * 8);

		reg = AO_MAS_DOM(desc->ao_base) + mas_dom_reg_index * 4;
		mmio_clrsetbits_32(reg, clr_bit, set_bit);
	}
}

static void set_ao_master_secure(const struct devapc_desc *desc,
				 int master, uint8_t secure)
{
	uint32_t mas_sec_reg_index;
	uint32_t mas_sec_set_index;
	uintptr_t reg;
	uint32_t clr_bit;
	uint32_t set_bit;

	if (master >= 0) {
		mas_sec_reg_index = master / 32;
		mas_sec_set_index = master % 32;

		clr_bit = 1U << mas_sec_set_index;
		set_bit = (uint32_t)secure << mas_sec_set_index;

		reg = AO_MAS_SEC(desc->ao_base) + mas_sec_reg_index * 4;
		mmio_clrsetbits_32(reg, clr_bit, set_bit);
	}
}

static void set_ao_master_attr(const struct devapc_desc *desc)
{
	uint32_t i;

	for (i = 0; i < desc->mas_num; i++) {
		set_ao_master_domain(desc, desc->mas[i].dom_idx, desc->mas[i].dom);
		set_ao_master_secure(desc, desc->mas[i].sec_idx, desc->mas[i].sec);
	}
}

static void set_domain_remap(const struct devapc_desc *desc, uint8_t remap_dom_bit,
			     uint8_t domain, uint8_t remap_dom)
{
	uint32_t dom_remap_reg_index;
	uint32_t dom_remap_set_index;
	uintptr_t reg;
	uint32_t clr_bit;
	uint32_t set_bit;

	dom_remap_reg_index = domain * remap_dom_bit / 32;
	dom_remap_set_index = domain * remap_dom_bit % 32;

	clr_bit = GENMASK(remap_dom_bit - 1, 0) << dom_remap_set_index;
	set_bit = (uint32_t)remap_dom << dom_remap_set_index;

	reg = AO_DOM_REMAP(desc->ao_base) + dom_remap_reg_index * 4;
	mmio_clrsetbits_32(reg, clr_bit, set_bit);
}

static void set_ao_domain_remap(const struct devapc_desc *desc)
{
	uint32_t i;

	if (desc->remap_dom_bit) {
		for (i = 0; i < (1 << desc->dom_bit); i++) {
			set_domain_remap(desc, desc->remap_dom_bit,
					 desc->remap_table[i].dom,
					 desc->remap_table[i].remap_dom);
		}
	}
}

static void set_module_apc(const struct devapc_desc *desc,
			   const struct devapc_ao_system *sys,
			   uint32_t module, uint8_t domain, int8_t perm)
{
	uint32_t apc_reg_index;
	uint32_t apc_set_index;
	uintptr_t base, reg;
	uint32_t clr_bit;
	uint32_t set_bit;

	apc_reg_index = module / MOD_NO_IN_1_DEVAPC;
	apc_set_index = module % MOD_NO_IN_1_DEVAPC;

	clr_bit = 0x3U << (apc_set_index * 2);
	set_bit = (uint32_t)perm << (apc_set_index * 2);

	base = AO_SYS0_D0_APC(desc->ao_base) + sys->id * 0x1000;
	reg = base + domain * 0x40 + apc_reg_index * 4;

	mmio_clrsetbits_32(reg, clr_bit, set_bit);
}

static void set_module_apc_16(const struct devapc_desc *desc,
			      const struct devapc_ao_system *sys,
			      const void *modules, uint32_t mod_num)
{
	const struct APC_PERI_DOM_16 *mod_apc = modules;
	uint32_t i;

	for (i = 0; i < mod_num; i++) {
		set_module_apc(desc, sys, i, DOMAIN_0, mod_apc[i].d0_permission);
		set_module_apc(desc, sys, i, DOMAIN_1, mod_apc[i].d1_permission);
		set_module_apc(desc, sys, i, DOMAIN_2, mod_apc[i].d2_permission);
		set_module_apc(desc, sys, i, DOMAIN_3, mod_apc[i].d3_permission);
		set_module_apc(desc, sys, i, DOMAIN_4, mod_apc[i].d4_permission);
		set_module_apc(desc, sys, i, DOMAIN_5, mod_apc[i].d5_permission);
		set_module_apc(desc, sys, i, DOMAIN_6, mod_apc[i].d6_permission);
		set_module_apc(desc, sys, i, DOMAIN_7, mod_apc[i].d7_permission);
		set_module_apc(desc, sys, i, DOMAIN_8, mod_apc[i].d8_permission);
		set_module_apc(desc, sys, i, DOMAIN_9, mod_apc[i].d9_permission);
		set_module_apc(desc, sys, i, DOMAIN_10, mod_apc[i].d10_permission);
		set_module_apc(desc, sys, i, DOMAIN_11, mod_apc[i].d11_permission);
		set_module_apc(desc, sys, i, DOMAIN_12, mod_apc[i].d12_permission);
		set_module_apc(desc, sys, i, DOMAIN_13, mod_apc[i].d13_permission);
		set_module_apc(desc, sys, i, DOMAIN_14, mod_apc[i].d14_permission);
		set_module_apc(desc, sys, i, DOMAIN_15, mod_apc[i].d15_permission);
	}
}

static void set_module_apc_4(const struct devapc_desc *desc,
			     const struct devapc_ao_system *sys,
			     const void *modules, uint32_t mod_num)
{
	const struct APC_PERI_DOM_4 *mod_apc = modules;
	uint32_t i;

	for (i = 0; i < mod_num; i++) {
		set_module_apc(desc, sys, i, DOMAIN_0, mod_apc[i].d0_permission);
		set_module_apc(desc, sys, i, DOMAIN_1, mod_apc[i].d1_permission);
		set_module_apc(desc, sys, i, DOMAIN_2, mod_apc[i].d2_permission);
		set_module_apc(desc, sys, i, DOMAIN_3, mod_apc[i].d3_permission);
	}
}

static void set_system_apc(const struct devapc_desc *desc,
			   const struct devapc_ao_system *sys, uint32_t dom_num)
{
	if (dom_num == 16) {
		set_module_apc_16(desc, sys, sys->modules, sys->mod_num);
	} else if (dom_num == 4) {
		set_module_apc_4(desc, sys, sys->modules, sys->mod_num);
	} else {
		ERROR("[DEVAPC] Invalid domain number\n");
		panic();
	}
}

static void set_ao_system_apc(const struct devapc_desc *desc)
{
	uint32_t i;

	for (i = 0; i < desc->sys_num; i++)
		set_system_apc(desc, &desc->sys[i], desc->sys[i].dom_num);
}

static void set_ao_system_apc_lock(const struct devapc_desc *desc,
				   const struct devapc_ao_system *sys,
				   uint32_t mod_num, uint32_t dom_num)
{
	uint32_t i;
	uint32_t reg;
	uint32_t reg_num;
	uint32_t last_mod_num;

	reg_num = (mod_num - 1) / 32;
	last_mod_num = mod_num % 32;
	for (i = 0; i <= reg_num; i++) {
		reg = AO_SYS0_APC_LOCK(desc->ao_base) + sys->id * 0x1000 + i * 4;
		if (i == reg_num)
			devapc_writel(GENMASK(last_mod_num, 0), reg);
		else
			devapc_writel(GENMASK(31, 0), reg);
	}
}

static void set_ao_apc_lock(const struct devapc_desc *desc)
{
	uint32_t i;

	devapc_writel(0x30a, AO_APC_CON1(desc->ao_base));

	for (i = 0; i < desc->sys_num; i++) {
		set_ao_system_apc_lock(desc, &desc->sys[i], desc->sys[i].mod_num,
				       desc->sys[i].dom_num);
	}
}

static void dump_ao_master_domain(const struct devapc_desc *desc, uint32_t mas_num)
{
	uint32_t i;
	uint32_t reg_num;
	uint32_t mas_dom_num = 0;

	for (i = 0; i < mas_num; i++) {
		if (desc->mas[i].dom_idx >= 0)
			mas_dom_num++;
	}

	reg_num = (mas_dom_num - 1) / MAS_NO_IN_1_MAS_DOM;
	for (i = 0; i <= reg_num; i++) {
		VERBOSE("[DEVAPC] MAS_DOM_%u: 0x%08x\n", i,
			devapc_readl(AO_MAS_DOM(desc->ao_base) + i * 4));
	}
}

static void dump_ao_master_secure(const struct devapc_desc *desc, uint32_t mas_num)
{
	uint32_t i;
	uint32_t reg_num;

	reg_num = (mas_num - 1) / 32;
	for (i = 0; i <= reg_num; i++) {
		VERBOSE("[DEVAPC] MAS_SEC_%u: 0x%08x\n", i,
			devapc_readl(AO_MAS_SEC(desc->ao_base) + i * 4));
	}
}

static void dump_ao_master_attr(const struct devapc_desc *desc)
{
	dump_ao_master_domain(desc, desc->mas_num);
	dump_ao_master_secure(desc, desc->mas_num);
}

static void dump_ao_domain_remap(const struct devapc_desc *desc)
{
	uint32_t i;
	uint32_t reg_num;

	reg_num = GENMASK(desc->dom_bit - 1, 0) * desc->remap_dom_bit / 32;
	for (i = 0; i <= reg_num; i++) {
		VERBOSE("[DEVAPC] DOM_REMAP_%u: 0x%08x\n", i,
			devapc_readl(AO_DOM_REMAP(desc->ao_base) + i * 4));
	}
}

static void dump_system_apc(const struct devapc_desc *desc,
			    const struct devapc_ao_system *sys,
			    uint32_t mod_num, uint32_t dom_num)
{
	uint32_t d, i;
	uint32_t base;
	uint32_t reg_num;

	base = AO_SYS0_D0_APC(desc->ao_base) + sys->id * 0x1000;

	reg_num = (mod_num - 1) / MOD_NO_IN_1_DEVAPC;
	for (d = 0; d < dom_num; d++) {
		for (i = 0; i <= reg_num; i++) {
			VERBOSE("[DEVAPC] D%u_APC_%u: 0x%08x\n",
				d, i, devapc_readl(base + d * 0x40 + i * 4)
			);
		}
	}
}

static void dump_ao_system_apc(const struct devapc_desc *desc)
{
	uint32_t i;

	for (i = 0; i < desc->sys_num; i++) {
		dump_system_apc(desc, &desc->sys[i], desc->sys[i].mod_num,
				desc->sys[i].dom_num);
	}
}

static void dump_ao_system_apc_lock(const struct devapc_desc *desc,
				    const struct devapc_ao_system *sys,
				    uint32_t mod_num)
{
	uint32_t i;
	uint32_t base;
	uint32_t reg_num;

	base = AO_SYS0_APC_LOCK(desc->ao_base) + sys->id * 0x1000;

	reg_num = (mod_num - 1) / 32;
	for (i = 0; i <= reg_num; i++) {
		VERBOSE("[DEVAPC] AO_SYS_APC_LOCK_%u=%08x\n", i,
			devapc_readl(base + i * 4));
	}
}

static void dump_ao_apc_lock(const struct devapc_desc *desc)
{
	uint32_t i;

	VERBOSE("[DEVAPC] AO_APC_CON1=0x%08x\n",
		devapc_readl(AO_APC_CON1(desc->ao_base)));

	for (i = 0; i < desc->sys_num; i++)
		dump_ao_system_apc_lock(desc, &desc->sys[i], desc->sys[i].mod_num);
}

void infra_devapc_init(void)
{
	const struct devapc_desc *dapc_desc;
	uint32_t dapc_num;
	uint32_t i;

	dapc_desc = &dapc_list[0];
	dapc_num = ARRAY_SIZE(dapc_list);

	for (i = 0; i < dapc_num; i++) {
		devapc_writel(BIT(31), AO_APC_CON(dapc_desc[i].ao_base));
		mmio_setbits_32(AO_APC_CON(dapc_desc[i].ao_base), APC_CON_SEN);

		if (dapc_desc[i].pd_base)
			devapc_writel(BIT(31), AO_APC_CON(dapc_desc[i].pd_base));

		set_ao_master_attr(&dapc_desc[i]);
		set_ao_domain_remap(&dapc_desc[i]);

		set_ao_system_apc(&dapc_desc[i]);
		set_ao_apc_lock(&dapc_desc[i]);
	}

	for (i = 0; i < dapc_num; i++) {
		dump_ao_master_attr(&dapc_desc[i]);
		dump_ao_domain_remap(&dapc_desc[i]);

		dump_ao_system_apc(&dapc_desc[i]);
		dump_ao_apc_lock(&dapc_desc[i]);
	}

	INFO("[DEVAPC] %s done\n", __func__);
}
