RTEMS 6.1-rc1
alt_address_space.h
Go to the documentation of this file.
1
11/******************************************************************************
12*
13* Copyright 2013 Altera Corporation. All Rights Reserved.
14*
15* Redistribution and use in source and binary forms, with or without
16* modification, are permitted provided that the following conditions are met:
17*
18* 1. Redistributions of source code must retain the above copyright notice,
19* this list of conditions and the following disclaimer.
20*
21* 2. Redistributions in binary form must reproduce the above copyright notice,
22* this list of conditions and the following disclaimer in the documentation
23* and/or other materials provided with the distribution.
24*
25* 3. The name of the author may not be used to endorse or promote products
26* derived from this software without specific prior written permission.
27*
28* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR
29* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO
31* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
33* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
36* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
37* OF SUCH DAMAGE.
38*
39******************************************************************************/
40
41#ifndef __ALT_ADDRESS_SPACE_H__
42#define __ALT_ADDRESS_SPACE_H__
43
44#include <stdbool.h>
45#include "hwlib.h"
46#include "socal/hps.h"
47
48#ifdef __cplusplus
49extern "C"
50{
51#endif /* __cplusplus */
52
53/******************************************************************************/
54// ARM Level 2 Cache Controller L2C-310 Register Interface
55
56// Address Filtering Start Register
57// The Address Filtering Start Register is a read and write register.
58// Bits Field Description
59// :-------|:--------------------------|:-----------------------------------------
60// [31:20] | address_filtering_start | Address filtering start address for
61// | | bits [31:20] of the filtering address.
62// [19:1] | Reserved | SBZ/RAZ
63// [0] | address_filtering_enable | 0 - address filtering disabled
64// | | 1 - address filtering enabled.
65
66// Address Filtering Start Register Address
67#define L2_CACHE_ADDR_FILTERING_START_OFST 0xC00
68#define L2_CACHE_ADDR_FILTERING_START_ADDR (ALT_MPUL2_OFST + L2_CACHE_ADDR_FILTERING_START_OFST)
69// Address Filtering Start Register - Start Value Mask
70#define L2_CACHE_ADDR_FILTERING_START_ADDR_MASK 0xFFF00000
71// Address Filtering Start Register - Reset Start Address Value (1 MB)
72#define L2_CACHE_ADDR_FILTERING_START_RESET 0x100000
73// Address Filtering Start Register - Enable Flag Mask
74#define L2_CACHE_ADDR_FILTERING_ENABLE_MASK 0x00000001
75// Address Filtering Start Register - Reset Enable Flag Value (Enabled)
76#define L2_CACHE_ADDR_FILTERING_ENABLE_RESET 0x1
77
78// Address Filtering End Register
79// The Address Filtering End Register is a read and write register.
80// Bits Field Description
81// :-------|:--------------------------|:-----------------------------------------
82// [31:20] | address_filtering_end | Address filtering end address for bits
83// | | [31:20] of the filtering address.
84// [19:0] | Reserved | SBZ/RAZ
85
86// Address Filtering End Register Address
87#define L2_CACHE_ADDR_FILTERING_END_OFST 0xC04
88#define L2_CACHE_ADDR_FILTERING_END_ADDR (ALT_MPUL2_OFST + L2_CACHE_ADDR_FILTERING_END_OFST)
89// Address Filtering End Register - End Value Mask
90#define L2_CACHE_ADDR_FILTERING_END_ADDR_MASK 0xFFF00000
91// Address Filtering End Register - Reset End Address Value (3 GiB)
92#define L2_CACHE_ADDR_FILTERING_END_RESET 0xC0000000
93
94#ifndef __ASSEMBLY__
95
96/******************************************************************************/
109/******************************************************************************/
163/******************************************************************************/
171{
190
191/******************************************************************************/
200{
213
214/******************************************************************************/
220{
231
232/******************************************************************************/
238{
249
250/******************************************************************************/
278
279/******************************************************************************/
308
311/******************************************************************************/
334/******************************************************************************/
355ALT_STATUS_CODE alt_l2_addr_filter_cfg_get(uint32_t* addr_filt_start,
356 uint32_t* addr_filt_end);
357
358/******************************************************************************/
384ALT_STATUS_CODE alt_l2_addr_filter_cfg_set(uint32_t addr_filt_start,
385 uint32_t addr_filt_end);
386
389/******************************************************************************/
477/******************************************************************************/
489#define ALT_ACP_ID_MAP_MASTER_ID_MASK 0xfff
490
492#define ALT_ACP_ID_MAP_MASTER_ID_L2M0(var) (0x00000002 | (0x000007f8 & (var)))
494#define ALT_ACP_ID_MAP_MASTER_ID_DMA(var) (0x00000001 | (0x00000078 & (var)))
496#define ALT_ACP_ID_MAP_MASTER_ID_EMAC0(var) (0x00000801 | (0x00000878 & (var)))
498#define ALT_ACP_ID_MAP_MASTER_ID_EMAC1(var) (0x00000802 | (0x00000878 & (var)))
500#define ALT_ACP_ID_MAP_MASTER_ID_USB0 0x00000803
502#define ALT_ACP_ID_MAP_MASTER_ID_USB1 0x00000806
504#define ALT_ACP_ID_MAP_MASTER_ID_NAND(var) (0x00000804 | (0x00000ff8 & (var)))
506#define ALT_ACP_ID_MAP_MASTER_ID_TMC 0x00000800
508#define ALT_ACP_ID_MAP_MASTER_ID_DAP 0x00000004
510#define ALT_ACP_ID_MAP_MASTER_ID_SDMMC 0x00000805
512#define ALT_ACP_ID_MAP_MASTER_ID_F2H(var) (0x00000000 | (0x000007f8 & (var)))
515/******************************************************************************/
520{
531
537{
543
544/******************************************************************************/
579ALT_STATUS_CODE alt_acp_id_map_fixed_read_set(const uint32_t input_id,
580 const uint32_t output_id,
582 const uint32_t aruser);
583
584/******************************************************************************/
619ALT_STATUS_CODE alt_acp_id_map_fixed_write_set(const uint32_t input_id,
620 const uint32_t output_id,
622 const uint32_t awuser);
623
624/******************************************************************************/
645ALT_STATUS_CODE alt_acp_id_map_dynamic_read_set(const uint32_t output_id);
646
647/******************************************************************************/
668ALT_STATUS_CODE alt_acp_id_map_dynamic_write_set(const uint32_t output_id);
669
670/******************************************************************************/
694 const uint32_t aruser);
695
696/******************************************************************************/
720 const uint32_t awuser);
721
722/******************************************************************************/
766ALT_STATUS_CODE alt_acp_id_map_read_options_get(const uint32_t output_id,
767 bool* fixed,
768 uint32_t* input_id,
770 uint32_t* aruser);
771
772/******************************************************************************/
817 bool* fixed,
818 uint32_t* input_id,
820 uint32_t* awuser);
821
826#endif /* __ASSEMBLY__ */
827
828#ifdef __cplusplus
829}
830#endif /* __cplusplus */
831#endif /* __ALT_ADDRESS_SPACE_H__ */
ALT_STATUS_CODE alt_acp_id_map_dynamic_read_options_set(const ALT_ACP_ID_MAP_PAGE_t page, const uint32_t aruser)
Definition: alt_address_space.c:389
ALT_STATUS_CODE alt_acp_id_map_fixed_read_set(const uint32_t input_id, const uint32_t output_id, const ALT_ACP_ID_MAP_PAGE_t page, const uint32_t aruser)
Definition: alt_address_space.c:194
ALT_STATUS_CODE alt_acp_id_map_read_options_get(const uint32_t output_id, bool *fixed, uint32_t *input_id, ALT_ACP_ID_MAP_PAGE_t *page, uint32_t *aruser)
Definition: alt_address_space.c:409
enum ALT_ACP_ID_OUTPUT_ID_e ALT_ACP_ID_OUTPUT_ID_t
ALT_STATUS_CODE alt_acp_id_map_fixed_write_set(const uint32_t input_id, const uint32_t output_id, const ALT_ACP_ID_MAP_PAGE_t page, const uint32_t awuser)
Definition: alt_address_space.c:249
ALT_STATUS_CODE alt_acp_id_map_write_options_get(const uint32_t output_id, bool *fixed, uint32_t *input_id, ALT_ACP_ID_MAP_PAGE_t *page, uint32_t *awuser)
Definition: alt_address_space.c:463
ALT_STATUS_CODE alt_acp_id_map_dynamic_write_set(const uint32_t output_id)
Definition: alt_address_space.c:347
ALT_ACP_ID_OUTPUT_ID_e
Definition: alt_address_space.h:520
ALT_STATUS_CODE alt_acp_id_map_dynamic_write_options_set(const ALT_ACP_ID_MAP_PAGE_t page, const uint32_t awuser)
Definition: alt_address_space.c:399
enum ALT_ACP_ID_MAP_PAGE_e ALT_ACP_ID_MAP_PAGE_t
ALT_STATUS_CODE alt_acp_id_map_dynamic_read_set(const uint32_t output_id)
Definition: alt_address_space.c:305
ALT_ACP_ID_MAP_PAGE_e
Definition: alt_address_space.h:537
@ ALT_ACP_ID_OUT_FIXED_ID_2
Definition: alt_address_space.h:521
@ ALT_ACP_ID_OUT_DYNAM_ID_5
Definition: alt_address_space.h:527
@ ALT_ACP_ID_OUT_DYNAM_ID_4
Definition: alt_address_space.h:526
@ ALT_ACP_ID_OUT_DYNAM_ID_7
Definition: alt_address_space.h:529
@ ALT_ACP_ID_OUT_DYNAM_ID_3
Definition: alt_address_space.h:525
@ ALT_ACP_ID_OUT_DYNAM_ID_6
Definition: alt_address_space.h:528
@ ALT_ACP_ID_MAP_PAGE_1
Definition: alt_address_space.h:539
@ ALT_ACP_ID_MAP_PAGE_0
Definition: alt_address_space.h:538
@ ALT_ACP_ID_MAP_PAGE_2
Definition: alt_address_space.h:540
@ ALT_ACP_ID_MAP_PAGE_3
Definition: alt_address_space.h:541
enum ALT_ADDR_SPACE_H2F_BRIDGE_ATTR_e ALT_ADDR_SPACE_H2F_BRIDGE_ATTR_t
enum ALT_ADDR_SPACE_MPU_ATTR_e ALT_ADDR_SPACE_MPU_ATTR_t
ALT_ADDR_SPACE_H2F_BRIDGE_ATTR_e
Definition: alt_address_space.h:220
enum ALT_ADDR_SPACE_LWH2F_BRIDGE_ATTR_e ALT_ADDR_SPACE_LWH2F_BRIDGE_ATTR_t
ALT_STATUS_CODE alt_addr_space_remap(ALT_ADDR_SPACE_MPU_ATTR_t mpu_attr, ALT_ADDR_SPACE_NONMPU_ATTR_t nonmpu_attr, ALT_ADDR_SPACE_H2F_BRIDGE_ATTR_t h2f_attr, ALT_ADDR_SPACE_LWH2F_BRIDGE_ATTR_t lwh2f_attr)
Definition: alt_address_space.c:55
enum ALT_ADDR_SPACE_NONMPU_ATTR_e ALT_ADDR_SPACE_NONMPU_ATTR_t
ALT_ADDR_SPACE_LWH2F_BRIDGE_ATTR_e
Definition: alt_address_space.h:238
ALT_STATUS_CODE alt_mpu_addr_space_remap_0_to_sdram(void)
Definition: alt_address_space.c:135
ALT_ADDR_SPACE_MPU_ATTR_e
Definition: alt_address_space.h:171
ALT_ADDR_SPACE_NONMPU_ATTR_e
Definition: alt_address_space.h:200
@ ALT_ADDR_SPACE_H2F_INACCESSIBLE
Definition: alt_address_space.h:221
@ ALT_ADDR_SPACE_H2F_ACCESSIBLE
Definition: alt_address_space.h:227
@ ALT_ADDR_SPACE_LWH2F_INACCESSIBLE
Definition: alt_address_space.h:239
@ ALT_ADDR_SPACE_LWH2F_ACCESSIBLE
Definition: alt_address_space.h:245
@ ALT_ADDR_SPACE_MPU_ZERO_AT_OCRAM
Definition: alt_address_space.h:181
@ ALT_ADDR_SPACE_MPU_ZERO_AT_BOOTROM
Definition: alt_address_space.h:172
@ ALT_ADDR_SPACE_NONMPU_ZERO_AT_OCRAM
Definition: alt_address_space.h:204
@ ALT_ADDR_SPACE_NONMPU_ZERO_AT_SDRAM
Definition: alt_address_space.h:201
ALT_STATUS_CODE alt_l2_addr_filter_cfg_set(uint32_t addr_filt_start, uint32_t addr_filt_end)
Definition: alt_address_space.c:162
ALT_STATUS_CODE alt_l2_addr_filter_cfg_get(uint32_t *addr_filt_start, uint32_t *addr_filt_end)
Definition: alt_address_space.c:145
int32_t ALT_STATUS_CODE
Definition: hwlib.h:60
Definition: misc.c:38