Skip to content

Commit 23068f3

Browse files
andrew-mtklgirdwood
authored andcommitted
platform: mtk: add xtensa headers for mt8365
Add xtensa headers for mtk mt8365 platform. Signed-off-by: Andrew Perepech <andrew.perepech@mediatek.com>
1 parent 9a9d34b commit 23068f3

7 files changed

Lines changed: 1685 additions & 0 deletions

File tree

src/platform/mt8365/include/arch/xtensa/config/core-isa.h

Lines changed: 649 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* xtensa/config/core-matmap.h -- Memory access and translation mapping
3+
* parameters (CHAL) of the Xtensa processor core configuration.
4+
*
5+
* If you are using Xtensa Tools, see <xtensa/config/core.h> (which includes
6+
* this file) for more details.
7+
*
8+
* In the Xtensa processor products released to date, all parameters
9+
* defined in this file are derivable (at least in theory) from
10+
* information contained in the core-isa.h header file.
11+
* In particular, the following core configuration parameters are relevant:
12+
* XCHAL_HAVE_CACHEATTR
13+
* XCHAL_HAVE_MIMIC_CACHEATTR
14+
* XCHAL_HAVE_XLT_CACHEATTR
15+
* XCHAL_HAVE_PTP_MMU
16+
* XCHAL_ITLB_ARF_ENTRIES_LOG2
17+
* XCHAL_DTLB_ARF_ENTRIES_LOG2
18+
* XCHAL_DCACHE_IS_WRITEBACK
19+
* XCHAL_ICACHE_SIZE (presence of I-cache)
20+
* XCHAL_DCACHE_SIZE (presence of D-cache)
21+
* XCHAL_HW_VERSION_MAJOR
22+
* XCHAL_HW_VERSION_MINOR
23+
*/
24+
25+
/* Customer ID=13943; Build=0x75f5e; Copyright (c) 1999-2018 Tensilica Inc.
26+
27+
Permission is hereby granted, free of charge, to any person obtaining
28+
a copy of this software and associated documentation files (the
29+
"Software"), to deal in the Software without restriction, including
30+
without limitation the rights to use, copy, modify, merge, publish,
31+
distribute, sublicense, and/or sell copies of the Software, and to
32+
permit persons to whom the Software is furnished to do so, subject to
33+
the following conditions:
34+
35+
The above copyright notice and this permission notice shall be included
36+
in all copies or substantial portions of the Software.
37+
38+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
39+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
40+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
41+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
42+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
43+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
44+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
45+
46+
47+
#ifndef XTENSA_CONFIG_CORE_MATMAP_H
48+
#define XTENSA_CONFIG_CORE_MATMAP_H
49+
50+
51+
/*----------------------------------------------------------------------
52+
CACHE (MEMORY ACCESS) ATTRIBUTES
53+
----------------------------------------------------------------------*/
54+
/*----------------------------------------------------------------------
55+
MPU
56+
----------------------------------------------------------------------*/
57+
58+
/* Mappings for legacy constants where appropriate */
59+
60+
#define XCHAL_CA_WRITEBACK (XTHAL_MEM_WRITEBACK | XTHAL_AR_RWXrwx)
61+
62+
#define XCHAL_CA_WRITEBACK_NOALLOC (XTHAL_MEM_WRITEBACK_NOALLOC| XTHAL_AR_RWXrwx )
63+
64+
#define XCHAL_CA_WRITETHRU (XTHAL_MEM_WRITETHRU | XTHAL_AR_RWXrwx)
65+
66+
#define XCHAL_CA_ILLEGAL (XTHAL_AR_NONE | XTHAL_MEM_DEVICE)
67+
#define XCHAL_CA_BYPASS (XTHAL_AR_RWXrwx | XTHAL_MEM_DEVICE)
68+
#define XCHAL_CA_BYPASSBUF (XTHAL_AR_RWXrwx | XTHAL_MEM_DEVICE |\
69+
XTHAL_MEM_BUFFERABLE)
70+
#define XCHAL_CA_BYPASS_RX (XTHAL_AR_RX | XTHAL_MEM_DEVICE)
71+
#define XCHAL_CA_BYPASS_RW (XTHAL_AR_RW | XTHAL_MEM_DEVICE)
72+
#define XCHAL_CA_BYPASS_R (XTHAL_AR_R | XTHAL_MEM_DEVICE)
73+
#define XCHAL_HAVE_CA_WRITEBACK_NOALLOC 1
74+
75+
#define XCHAL_CA_R (XTHAL_AR_R)
76+
#define XCHAL_CA_RX (XTHAL_AR_RX)
77+
#define XCHAL_CA_RW (XTHAL_AR_RW)
78+
#define XCHAL_CA_RWX (XTHAL_AR_RWX)
79+
80+
81+
/*
82+
* Contents of MPU background map.
83+
* NOTE: caller must define the XCHAL_MPU_BGMAP() macro (not defined here
84+
* but specified below) before expanding the XCHAL_MPU_BACKGROUND_MAP(s) macro.
85+
*
86+
* XCHAL_MPU_BGMAP(s, vaddr_start, vaddr_last, rights, memtype, x...)
87+
*
88+
* s = passed from XCHAL_MPU_BACKGROUND_MAP(s), eg. to select how to expand
89+
* vaddr_start = first byte of region (always 0 for first entry)
90+
* vaddr_end = last byte of region (always 0xFFFFFFFF for last entry)
91+
* rights = access rights
92+
* memtype = memory type
93+
* x = reserved for future use (0 until then)
94+
*/
95+
#define XCHAL_MPU_BACKGROUND_MAP(s) \
96+
XCHAL_MPU_BGMAP(s, 0x00000000, 0x7fffffff, 7, 6, 0) \
97+
XCHAL_MPU_BGMAP(s, 0x80000000, 0xffffffff, 7, 6, 0) \
98+
/* end */
99+
100+
101+
102+
#endif /*XTENSA_CONFIG_CORE_MATMAP_H*/
103+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* Definitions for Xtensa instructions, types, and protos. */
2+
3+
/* Customer ID=13943; Build=0x75f5e; Copyright (c) 2003-2004 Tensilica Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included
14+
in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
23+
24+
/* NOTE: This file exists only for backward compatibility with T1050
25+
and earlier Xtensa releases. It includes only a subset of the
26+
available header files. */
27+
28+
#ifndef _XTENSA_BASE_HEADER
29+
#define _XTENSA_BASE_HEADER
30+
31+
#ifdef __XTENSA__
32+
33+
#include <xtensa/tie/xt_core.h>
34+
#include <xtensa/tie/xt_misc.h>
35+
#include <xtensa/tie/xt_booleans.h>
36+
37+
#endif /* __XTENSA__ */
38+
#endif /* !_XTENSA_BASE_HEADER */
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* Xtensa Special Register symbolic names
3+
*/
4+
5+
/* $Id: //depot/rel/Foxhill/dot.9/Xtensa/SWConfig/hal/specreg.h.tpp#1 $ */
6+
7+
/* Customer ID=13943; Build=0x75f5e; Copyright (c) 1998-2002 Tensilica Inc.
8+
9+
Permission is hereby granted, free of charge, to any person obtaining
10+
a copy of this software and associated documentation files (the
11+
"Software"), to deal in the Software without restriction, including
12+
without limitation the rights to use, copy, modify, merge, publish,
13+
distribute, sublicense, and/or sell copies of the Software, and to
14+
permit persons to whom the Software is furnished to do so, subject to
15+
the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included
18+
in all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
27+
28+
#ifndef XTENSA_SPECREG_H
29+
#define XTENSA_SPECREG_H
30+
31+
/* Include these special register bitfield definitions, for historical reasons: */
32+
#include <xtensa/corebits.h>
33+
34+
35+
/* Special registers: */
36+
#define LBEG 0
37+
#define LEND 1
38+
#define LCOUNT 2
39+
#define SAR 3
40+
#define BR 4
41+
#define PREFCTL 40
42+
#define WINDOWBASE 72
43+
#define WINDOWSTART 73
44+
#define MPUENB 90
45+
#define ERACCESS 95
46+
#define IBREAKENABLE 96
47+
#define MEMCTL 97
48+
#define CACHEADRDIS 98
49+
#define DDR 104
50+
#define IBREAKA_0 128
51+
#define IBREAKA_1 129
52+
#define DBREAKA_0 144
53+
#define DBREAKA_1 145
54+
#define DBREAKC_0 160
55+
#define DBREAKC_1 161
56+
#define EPC_1 177
57+
#define EPC_2 178
58+
#define EPC_3 179
59+
#define EPC_4 180
60+
#define DEPC 192
61+
#define EPS_2 194
62+
#define EPS_3 195
63+
#define EPS_4 196
64+
#define EXCSAVE_1 209
65+
#define EXCSAVE_2 210
66+
#define EXCSAVE_3 211
67+
#define EXCSAVE_4 212
68+
#define CPENABLE 224
69+
#define INTERRUPT 226
70+
#define INTENABLE 228
71+
#define PS 230
72+
#define VECBASE 231
73+
#define EXCCAUSE 232
74+
#define DEBUGCAUSE 233
75+
#define CCOUNT 234
76+
#define PRID 235
77+
#define ICOUNT 236
78+
#define ICOUNTLEVEL 237
79+
#define EXCVADDR 238
80+
#define CCOMPARE_0 240
81+
#define CCOMPARE_1 241
82+
#define CCOMPARE_2 242
83+
#define MISC_REG_0 244
84+
#define MISC_REG_1 245
85+
#define MISC_REG_2 246
86+
#define MISC_REG_3 247
87+
88+
/* Special cases (bases of special register series): */
89+
#define IBREAKA 128
90+
#define DBREAKA 144
91+
#define DBREAKC 160
92+
#define EPC 176
93+
#define EPS 192
94+
#define EXCSAVE 208
95+
#define CCOMPARE 240
96+
97+
/* Special names for read-only and write-only interrupt registers: */
98+
#define INTREAD 226
99+
#define INTSET 226
100+
#define INTCLEAR 227
101+
102+
#endif /* XTENSA_SPECREG_H */
103+

0 commit comments

Comments
 (0)