File tree 7 files changed +56
-5
lines changed
7 files changed +56
-5
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,9 @@ config ARCH_HAS_ILOG2_U32
71
71
config ARCH_HAS_ILOG2_U64
72
72
def_bool n
73
73
74
+ config ARCH_MTD_XIP
75
+ def_bool y
76
+
74
77
config NO_IOPORT_MAP
75
78
def_bool n
76
79
Original file line number Diff line number Diff line change 52
52
#define XTENSA_STACK_ALIGNMENT 16
53
53
#endif
54
54
55
+ #ifndef XCHAL_HW_MIN_VERSION
56
+ #if defined(XCHAL_HW_MIN_VERSION_MAJOR ) && defined(XCHAL_HW_MIN_VERSION_MINOR )
57
+ #define XCHAL_HW_MIN_VERSION (XCHAL_HW_MIN_VERSION_MAJOR * 100 + \
58
+ XCHAL_HW_MIN_VERSION_MINOR)
59
+ #else
60
+ #define XCHAL_HW_MIN_VERSION 0
61
+ #endif
62
+ #endif
63
+
55
64
#endif
Original file line number Diff line number Diff line change
1
+ /* SPDX-License-Identifier: GPL-2.0-only */
2
+
3
+ #ifndef _ASM_MTD_XIP_H
4
+ #define _ASM_MTD_XIP_H
5
+
6
+ #include <asm/processor.h>
7
+
8
+ #define xip_irqpending () (xtensa_get_sr(interrupt) & xtensa_get_sr(intenable))
9
+ #define xip_currtime () (xtensa_get_sr(ccount))
10
+ #define xip_elapsed_since (x ) ((xtensa_get_sr(ccount) - (x)) / 1000) /* should work up to 1GHz */
11
+ #define xip_cpu_idle () do { asm volatile ("waiti 0"); } while (0)
12
+
13
+ #endif /* _ASM_MTD_XIP_H */
14
+
Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ extern char _SecondaryResetVector_text_start[];
34
34
extern char _SecondaryResetVector_text_end [];
35
35
#endif
36
36
#ifdef CONFIG_XIP_KERNEL
37
+ #ifdef CONFIG_VECTORS_ADDR
38
+ extern char _xip_text_start [];
39
+ extern char _xip_text_end [];
40
+ #endif
37
41
extern char _xip_start [];
38
42
extern char _xip_end [];
39
43
#endif
Original file line number Diff line number Diff line change 13
13
#include <linux/perf_event.h>
14
14
#include <linux/platform_device.h>
15
15
16
+ #include <asm/core.h>
16
17
#include <asm/processor.h>
17
18
#include <asm/stacktrace.h>
18
19
20
+ #define XTENSA_HWVERSION_RG_2015_0 260000
21
+
22
+ #if XCHAL_HW_MIN_VERSION >= XTENSA_HWVERSION_RG_2015_0
23
+ #define XTENSA_PMU_ERI_BASE 0x00101000
24
+ #else
25
+ #define XTENSA_PMU_ERI_BASE 0x00001000
26
+ #endif
27
+
19
28
/* Global control/status for all perf counters */
20
- #define XTENSA_PMU_PMG 0x1000
29
+ #define XTENSA_PMU_PMG XTENSA_PMU_ERI_BASE
21
30
/* Perf counter values */
22
- #define XTENSA_PMU_PM (i ) (0x1080 + (i) * 4)
31
+ #define XTENSA_PMU_PM (i ) (XTENSA_PMU_ERI_BASE + 0x80 + (i) * 4)
23
32
/* Perf counter control registers */
24
- #define XTENSA_PMU_PMCTRL (i ) (0x1100 + (i) * 4)
33
+ #define XTENSA_PMU_PMCTRL (i ) (XTENSA_PMU_ERI_BASE + 0x100 + (i) * 4)
25
34
/* Perf counter status registers */
26
- #define XTENSA_PMU_PMSTAT (i ) (0x1180 + (i) * 4)
35
+ #define XTENSA_PMU_PMSTAT (i ) (XTENSA_PMU_ERI_BASE + 0x180 + (i) * 4)
27
36
28
37
#define XTENSA_PMU_PMG_PMEN 0x1
29
38
Original file line number Diff line number Diff line change @@ -311,6 +311,9 @@ void __init setup_arch(char **cmdline_p)
311
311
312
312
mem_reserve (__pa (_stext ), __pa (_end ));
313
313
#ifdef CONFIG_XIP_KERNEL
314
+ #ifdef CONFIG_VECTORS_ADDR
315
+ mem_reserve (__pa (_xip_text_start ), __pa (_xip_text_end ));
316
+ #endif
314
317
mem_reserve (__pa (_xip_start ), __pa (_xip_end ));
315
318
#endif
316
319
Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ SECTIONS
118
118
SECTION_VECTOR2 (.DoubleExceptionVector.text, DOUBLEEXC_VECTOR_VADDR)
119
119
120
120
*(.exception.text)
121
+ *(.xiptext)
121
122
#endif
122
123
123
124
IRQENTRY_TEXT
@@ -201,6 +202,9 @@ SECTIONS
201
202
.DebugInterruptVector.text);
202
203
RELOCATE_ENTRY(_exception_text,
203
204
.exception.text);
205
+ #ifdef CONFIG_XIP_KERNEL
206
+ RELOCATE_ENTRY(_xip_text, .xiptext);
207
+ #endif
204
208
#endif
205
209
#ifdef CONFIG_XIP_KERNEL
206
210
RELOCATE_ENTRY(_xip_data, .data );
@@ -319,7 +323,12 @@ SECTIONS
319
323
LAST)
320
324
#undef LAST
321
325
#define LAST .exception.text
322
-
326
+ SECTION_VECTOR4 (_xip_text,
327
+ .xiptext,
328
+ ,
329
+ LAST)
330
+ #undef LAST
331
+ #define LAST .xiptext
323
332
#endif
324
333
. = (LOADADDR(LAST) + SIZEOF(LAST) + 3 ) & ~ 3 ;
325
334
You can’t perform that action at this time.
0 commit comments