Skip to content

Commit 4c4fe4c

Browse files
committed
Merge tag 'metag-fixes-v4.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/metag
Pull arch/metag fix from James Hogan: "Another metag architecture fix for v4.0 This is another single fix, for an include dependency problem when using ioremap_wc() from asm/io.h without also including asm/pgtable.h" * tag 'metag-fixes-v4.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/metag: metag: Fix ioremap_wc/ioremap_cached build errors
2 parents 9c8e30d + 0164a71 commit 4c4fe4c

File tree

3 files changed

+106
-94
lines changed

3 files changed

+106
-94
lines changed

arch/metag/include/asm/io.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define _ASM_METAG_IO_H
33

44
#include <linux/types.h>
5+
#include <asm/pgtable-bits.h>
56

67
#define IO_SPACE_LIMIT 0
78

arch/metag/include/asm/pgtable-bits.h

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/*
2+
* Meta page table definitions.
3+
*/
4+
5+
#ifndef _METAG_PGTABLE_BITS_H
6+
#define _METAG_PGTABLE_BITS_H
7+
8+
#include <asm/metag_mem.h>
9+
10+
/*
11+
* Definitions for MMU descriptors
12+
*
13+
* These are the hardware bits in the MMCU pte entries.
14+
* Derived from the Meta toolkit headers.
15+
*/
16+
#define _PAGE_PRESENT MMCU_ENTRY_VAL_BIT
17+
#define _PAGE_WRITE MMCU_ENTRY_WR_BIT
18+
#define _PAGE_PRIV MMCU_ENTRY_PRIV_BIT
19+
/* Write combine bit - this can cause writes to occur out of order */
20+
#define _PAGE_WR_COMBINE MMCU_ENTRY_WRC_BIT
21+
/* Sys coherent bit - this bit is never used by Linux */
22+
#define _PAGE_SYS_COHERENT MMCU_ENTRY_SYS_BIT
23+
#define _PAGE_ALWAYS_ZERO_1 0x020
24+
#define _PAGE_CACHE_CTRL0 0x040
25+
#define _PAGE_CACHE_CTRL1 0x080
26+
#define _PAGE_ALWAYS_ZERO_2 0x100
27+
#define _PAGE_ALWAYS_ZERO_3 0x200
28+
#define _PAGE_ALWAYS_ZERO_4 0x400
29+
#define _PAGE_ALWAYS_ZERO_5 0x800
30+
31+
/* These are software bits that we stuff into the gaps in the hardware
32+
* pte entries that are not used. Note, these DO get stored in the actual
33+
* hardware, but the hardware just does not use them.
34+
*/
35+
#define _PAGE_ACCESSED _PAGE_ALWAYS_ZERO_1
36+
#define _PAGE_DIRTY _PAGE_ALWAYS_ZERO_2
37+
38+
/* Pages owned, and protected by, the kernel. */
39+
#define _PAGE_KERNEL _PAGE_PRIV
40+
41+
/* No cacheing of this page */
42+
#define _PAGE_CACHE_WIN0 (MMCU_CWIN_UNCACHED << MMCU_ENTRY_CWIN_S)
43+
/* burst cacheing - good for data streaming */
44+
#define _PAGE_CACHE_WIN1 (MMCU_CWIN_BURST << MMCU_ENTRY_CWIN_S)
45+
/* One cache way per thread */
46+
#define _PAGE_CACHE_WIN2 (MMCU_CWIN_C1SET << MMCU_ENTRY_CWIN_S)
47+
/* Full on cacheing */
48+
#define _PAGE_CACHE_WIN3 (MMCU_CWIN_CACHED << MMCU_ENTRY_CWIN_S)
49+
50+
#define _PAGE_CACHEABLE (_PAGE_CACHE_WIN3 | _PAGE_WR_COMBINE)
51+
52+
/* which bits are used for cache control ... */
53+
#define _PAGE_CACHE_MASK (_PAGE_CACHE_CTRL0 | _PAGE_CACHE_CTRL1 | \
54+
_PAGE_WR_COMBINE)
55+
56+
/* This is a mask of the bits that pte_modify is allowed to change. */
57+
#define _PAGE_CHG_MASK (PAGE_MASK)
58+
59+
#define _PAGE_SZ_SHIFT 1
60+
#define _PAGE_SZ_4K (0x0)
61+
#define _PAGE_SZ_8K (0x1 << _PAGE_SZ_SHIFT)
62+
#define _PAGE_SZ_16K (0x2 << _PAGE_SZ_SHIFT)
63+
#define _PAGE_SZ_32K (0x3 << _PAGE_SZ_SHIFT)
64+
#define _PAGE_SZ_64K (0x4 << _PAGE_SZ_SHIFT)
65+
#define _PAGE_SZ_128K (0x5 << _PAGE_SZ_SHIFT)
66+
#define _PAGE_SZ_256K (0x6 << _PAGE_SZ_SHIFT)
67+
#define _PAGE_SZ_512K (0x7 << _PAGE_SZ_SHIFT)
68+
#define _PAGE_SZ_1M (0x8 << _PAGE_SZ_SHIFT)
69+
#define _PAGE_SZ_2M (0x9 << _PAGE_SZ_SHIFT)
70+
#define _PAGE_SZ_4M (0xa << _PAGE_SZ_SHIFT)
71+
#define _PAGE_SZ_MASK (0xf << _PAGE_SZ_SHIFT)
72+
73+
#if defined(CONFIG_PAGE_SIZE_4K)
74+
#define _PAGE_SZ (_PAGE_SZ_4K)
75+
#elif defined(CONFIG_PAGE_SIZE_8K)
76+
#define _PAGE_SZ (_PAGE_SZ_8K)
77+
#elif defined(CONFIG_PAGE_SIZE_16K)
78+
#define _PAGE_SZ (_PAGE_SZ_16K)
79+
#endif
80+
#define _PAGE_TABLE (_PAGE_SZ | _PAGE_PRESENT)
81+
82+
#if defined(CONFIG_HUGETLB_PAGE_SIZE_8K)
83+
# define _PAGE_SZHUGE (_PAGE_SZ_8K)
84+
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_16K)
85+
# define _PAGE_SZHUGE (_PAGE_SZ_16K)
86+
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_32K)
87+
# define _PAGE_SZHUGE (_PAGE_SZ_32K)
88+
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
89+
# define _PAGE_SZHUGE (_PAGE_SZ_64K)
90+
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_128K)
91+
# define _PAGE_SZHUGE (_PAGE_SZ_128K)
92+
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_256K)
93+
# define _PAGE_SZHUGE (_PAGE_SZ_256K)
94+
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_512K)
95+
# define _PAGE_SZHUGE (_PAGE_SZ_512K)
96+
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_1M)
97+
# define _PAGE_SZHUGE (_PAGE_SZ_1M)
98+
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_2M)
99+
# define _PAGE_SZHUGE (_PAGE_SZ_2M)
100+
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_4M)
101+
# define _PAGE_SZHUGE (_PAGE_SZ_4M)
102+
#endif
103+
104+
#endif /* _METAG_PGTABLE_BITS_H */

arch/metag/include/asm/pgtable.h

Lines changed: 1 addition & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#ifndef _METAG_PGTABLE_H
66
#define _METAG_PGTABLE_H
77

8+
#include <asm/pgtable-bits.h>
89
#include <asm-generic/pgtable-nopmd.h>
910

1011
/* Invalid regions on Meta: 0x00000000-0x001FFFFF and 0xFFFF0000-0xFFFFFFFF */
@@ -20,100 +21,6 @@
2021
#define VMALLOC_END 0x7FFFFFFF
2122
#endif
2223

23-
/*
24-
* Definitions for MMU descriptors
25-
*
26-
* These are the hardware bits in the MMCU pte entries.
27-
* Derived from the Meta toolkit headers.
28-
*/
29-
#define _PAGE_PRESENT MMCU_ENTRY_VAL_BIT
30-
#define _PAGE_WRITE MMCU_ENTRY_WR_BIT
31-
#define _PAGE_PRIV MMCU_ENTRY_PRIV_BIT
32-
/* Write combine bit - this can cause writes to occur out of order */
33-
#define _PAGE_WR_COMBINE MMCU_ENTRY_WRC_BIT
34-
/* Sys coherent bit - this bit is never used by Linux */
35-
#define _PAGE_SYS_COHERENT MMCU_ENTRY_SYS_BIT
36-
#define _PAGE_ALWAYS_ZERO_1 0x020
37-
#define _PAGE_CACHE_CTRL0 0x040
38-
#define _PAGE_CACHE_CTRL1 0x080
39-
#define _PAGE_ALWAYS_ZERO_2 0x100
40-
#define _PAGE_ALWAYS_ZERO_3 0x200
41-
#define _PAGE_ALWAYS_ZERO_4 0x400
42-
#define _PAGE_ALWAYS_ZERO_5 0x800
43-
44-
/* These are software bits that we stuff into the gaps in the hardware
45-
* pte entries that are not used. Note, these DO get stored in the actual
46-
* hardware, but the hardware just does not use them.
47-
*/
48-
#define _PAGE_ACCESSED _PAGE_ALWAYS_ZERO_1
49-
#define _PAGE_DIRTY _PAGE_ALWAYS_ZERO_2
50-
51-
/* Pages owned, and protected by, the kernel. */
52-
#define _PAGE_KERNEL _PAGE_PRIV
53-
54-
/* No cacheing of this page */
55-
#define _PAGE_CACHE_WIN0 (MMCU_CWIN_UNCACHED << MMCU_ENTRY_CWIN_S)
56-
/* burst cacheing - good for data streaming */
57-
#define _PAGE_CACHE_WIN1 (MMCU_CWIN_BURST << MMCU_ENTRY_CWIN_S)
58-
/* One cache way per thread */
59-
#define _PAGE_CACHE_WIN2 (MMCU_CWIN_C1SET << MMCU_ENTRY_CWIN_S)
60-
/* Full on cacheing */
61-
#define _PAGE_CACHE_WIN3 (MMCU_CWIN_CACHED << MMCU_ENTRY_CWIN_S)
62-
63-
#define _PAGE_CACHEABLE (_PAGE_CACHE_WIN3 | _PAGE_WR_COMBINE)
64-
65-
/* which bits are used for cache control ... */
66-
#define _PAGE_CACHE_MASK (_PAGE_CACHE_CTRL0 | _PAGE_CACHE_CTRL1 | \
67-
_PAGE_WR_COMBINE)
68-
69-
/* This is a mask of the bits that pte_modify is allowed to change. */
70-
#define _PAGE_CHG_MASK (PAGE_MASK)
71-
72-
#define _PAGE_SZ_SHIFT 1
73-
#define _PAGE_SZ_4K (0x0)
74-
#define _PAGE_SZ_8K (0x1 << _PAGE_SZ_SHIFT)
75-
#define _PAGE_SZ_16K (0x2 << _PAGE_SZ_SHIFT)
76-
#define _PAGE_SZ_32K (0x3 << _PAGE_SZ_SHIFT)
77-
#define _PAGE_SZ_64K (0x4 << _PAGE_SZ_SHIFT)
78-
#define _PAGE_SZ_128K (0x5 << _PAGE_SZ_SHIFT)
79-
#define _PAGE_SZ_256K (0x6 << _PAGE_SZ_SHIFT)
80-
#define _PAGE_SZ_512K (0x7 << _PAGE_SZ_SHIFT)
81-
#define _PAGE_SZ_1M (0x8 << _PAGE_SZ_SHIFT)
82-
#define _PAGE_SZ_2M (0x9 << _PAGE_SZ_SHIFT)
83-
#define _PAGE_SZ_4M (0xa << _PAGE_SZ_SHIFT)
84-
#define _PAGE_SZ_MASK (0xf << _PAGE_SZ_SHIFT)
85-
86-
#if defined(CONFIG_PAGE_SIZE_4K)
87-
#define _PAGE_SZ (_PAGE_SZ_4K)
88-
#elif defined(CONFIG_PAGE_SIZE_8K)
89-
#define _PAGE_SZ (_PAGE_SZ_8K)
90-
#elif defined(CONFIG_PAGE_SIZE_16K)
91-
#define _PAGE_SZ (_PAGE_SZ_16K)
92-
#endif
93-
#define _PAGE_TABLE (_PAGE_SZ | _PAGE_PRESENT)
94-
95-
#if defined(CONFIG_HUGETLB_PAGE_SIZE_8K)
96-
# define _PAGE_SZHUGE (_PAGE_SZ_8K)
97-
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_16K)
98-
# define _PAGE_SZHUGE (_PAGE_SZ_16K)
99-
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_32K)
100-
# define _PAGE_SZHUGE (_PAGE_SZ_32K)
101-
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
102-
# define _PAGE_SZHUGE (_PAGE_SZ_64K)
103-
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_128K)
104-
# define _PAGE_SZHUGE (_PAGE_SZ_128K)
105-
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_256K)
106-
# define _PAGE_SZHUGE (_PAGE_SZ_256K)
107-
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_512K)
108-
# define _PAGE_SZHUGE (_PAGE_SZ_512K)
109-
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_1M)
110-
# define _PAGE_SZHUGE (_PAGE_SZ_1M)
111-
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_2M)
112-
# define _PAGE_SZHUGE (_PAGE_SZ_2M)
113-
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_4M)
114-
# define _PAGE_SZHUGE (_PAGE_SZ_4M)
115-
#endif
116-
11724
/*
11825
* The Linux memory management assumes a three-level page table setup. On
11926
* Meta, we use that, but "fold" the mid level into the top-level page

0 commit comments

Comments
 (0)