Skip to content

Commit 7371156

Browse files
jcmvbkbcgregkh
authored andcommitted
xtensa: move XCHAL_KIO_* definitions to kmem_layout.h
[ Upstream commit 6591685 ] These address and size definitions define xtensa kernel memory layout, move them from vectors.h to the kmem_layout.h Signed-off-by: Max Filippov <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent c82cffe commit 7371156

File tree

2 files changed

+32
-39
lines changed

2 files changed

+32
-39
lines changed

arch/xtensa/include/asm/kmem_layout.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#ifndef _XTENSA_KMEM_LAYOUT_H
1212
#define _XTENSA_KMEM_LAYOUT_H
1313

14+
#include <asm/core.h>
1415
#include <asm/types.h>
1516

1617
#ifdef CONFIG_MMU
@@ -65,6 +66,34 @@
6566

6667
#endif
6768

69+
/* KIO definition */
70+
71+
#if XCHAL_HAVE_PTP_MMU
72+
#define XCHAL_KIO_CACHED_VADDR 0xe0000000
73+
#define XCHAL_KIO_BYPASS_VADDR 0xf0000000
74+
#define XCHAL_KIO_DEFAULT_PADDR 0xf0000000
75+
#else
76+
#define XCHAL_KIO_BYPASS_VADDR XCHAL_KIO_PADDR
77+
#define XCHAL_KIO_DEFAULT_PADDR 0x90000000
78+
#endif
79+
#define XCHAL_KIO_SIZE 0x10000000
80+
81+
#if (!XCHAL_HAVE_PTP_MMU || XCHAL_HAVE_SPANNING_WAY) && defined(CONFIG_OF)
82+
#define XCHAL_KIO_PADDR xtensa_get_kio_paddr()
83+
#ifndef __ASSEMBLY__
84+
extern unsigned long xtensa_kio_paddr;
85+
86+
static inline unsigned long xtensa_get_kio_paddr(void)
87+
{
88+
return xtensa_kio_paddr;
89+
}
90+
#endif
91+
#else
92+
#define XCHAL_KIO_PADDR XCHAL_KIO_DEFAULT_PADDR
93+
#endif
94+
95+
/* KERNEL_STACK definition */
96+
6897
#ifndef CONFIG_KASAN
6998
#define KERNEL_STACK_SHIFT 13
7099
#else

arch/xtensa/include/asm/vectors.h

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,50 +21,14 @@
2121
#include <asm/core.h>
2222
#include <asm/kmem_layout.h>
2323

24-
#if XCHAL_HAVE_PTP_MMU
25-
#define XCHAL_KIO_CACHED_VADDR 0xe0000000
26-
#define XCHAL_KIO_BYPASS_VADDR 0xf0000000
27-
#define XCHAL_KIO_DEFAULT_PADDR 0xf0000000
28-
#else
29-
#define XCHAL_KIO_BYPASS_VADDR XCHAL_KIO_PADDR
30-
#define XCHAL_KIO_DEFAULT_PADDR 0x90000000
31-
#endif
32-
#define XCHAL_KIO_SIZE 0x10000000
33-
34-
#if (!XCHAL_HAVE_PTP_MMU || XCHAL_HAVE_SPANNING_WAY) && defined(CONFIG_OF)
35-
#define XCHAL_KIO_PADDR xtensa_get_kio_paddr()
36-
#ifndef __ASSEMBLY__
37-
extern unsigned long xtensa_kio_paddr;
38-
39-
static inline unsigned long xtensa_get_kio_paddr(void)
40-
{
41-
return xtensa_kio_paddr;
42-
}
43-
#endif
44-
#else
45-
#define XCHAL_KIO_PADDR XCHAL_KIO_DEFAULT_PADDR
46-
#endif
47-
48-
#if defined(CONFIG_MMU)
49-
50-
#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
51-
/* Image Virtual Start Address */
52-
#define KERNELOFFSET (XCHAL_KSEG_CACHED_VADDR + \
53-
CONFIG_KERNEL_LOAD_ADDRESS - \
24+
#if defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
25+
#define KERNELOFFSET (CONFIG_KERNEL_LOAD_ADDRESS + \
26+
XCHAL_KSEG_CACHED_VADDR - \
5427
XCHAL_KSEG_PADDR)
5528
#else
5629
#define KERNELOFFSET CONFIG_KERNEL_LOAD_ADDRESS
5730
#endif
5831

59-
#else /* !defined(CONFIG_MMU) */
60-
/* MMU Not being used - Virtual == Physical */
61-
62-
/* Location of the start of the kernel text, _start */
63-
#define KERNELOFFSET CONFIG_KERNEL_LOAD_ADDRESS
64-
65-
66-
#endif /* CONFIG_MMU */
67-
6832
#define RESET_VECTOR1_VADDR (XCHAL_RESET_VECTOR1_VADDR)
6933
#ifdef CONFIG_VECTORS_OFFSET
7034
#define VECBASE_VADDR (KERNELOFFSET - CONFIG_VECTORS_OFFSET)

0 commit comments

Comments
 (0)