1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef APREMAP_H
9 #define APREMAP_H
10 
11 #define APREMAP_CMN_ATRANS_EN_MASK 0x80000000
12 #define APREMAP_CMN_ATRANS_EN_POS  31
13 
14 #define APREMAP_ADDR_TRANS_EN            UINT32_C(1)
15 #define APREMAP_ADDR_TRANS_AP_ADDR_SHIFT 20
16 
17 #define APREMAP_1MB_ADDR(addr) (0xCB000000 + ((uintptr_t)addr & 0xFFFFF))
18 
19 #define SYSTEM_ACCESS_PORT_0_BASE 0x60000000
20 #define SYSTEM_ACCESS_PORT_1_BASE 0xA0000000
21 
22 #define ADDR_OFFSET_SYSTEM_ACCESS_PORT_0(addr) \
23     ((uintptr_t)addr + (SYSTEM_ACCESS_PORT_0_BASE - (1 * FWK_GIB)))
24 #define ADDR_OFFSET_SYSTEM_ACCESS_PORT_1(addr) \
25     ((uintptr_t)addr + SYSTEM_ACCESS_PORT_1_BASE)
26 
27 /* Data Type enum used internally within the module */
28 typedef enum mod_apremap_type_idx {
29     TYPE_UINT8,
30     TYPE_UINT16,
31     TYPE_UINT32,
32     TYPE_UINT64,
33 } mod_apremap_type_idx_t;
34 
35 #endif /* APREMAP_H */
36