diff options
author | Thomas Petazzoni <thomas.petazzoni@bootlin.com> | 2018-07-24 07:53:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-30 16:00:56 -0400 |
commit | f0afc6b18d3953fb96f836e4d1483eb9855a36b0 (patch) | |
tree | 8a687a54f12b1e566017f83edb0d129396f14183 /arch/sparc/mm/srmmu.c | |
parent | 6f57ed681ed817a4ec444e83f3aa2ad695d5ef34 (diff) |
sparc: move MSI related definitions to where they are used
The definitions in arch/sparc/include/asm/msi.h are only used in
arch/sparc/mm/srmmu.c, so it makes sense to have them in the C file
directly.
In addition, having a custom arch/sparc/include/asm/msi.h prevents
from using the asm-generic version of this header, which is necessary
to be able to include <linux/msi.h> when CONFIG_GENERIC_MSI_IRQ_DOMAIN
is enabled.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/mm/srmmu.c')
-rw-r--r-- | arch/sparc/mm/srmmu.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index 1d70c3f6d986..be9cb0065179 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <asm/mbus.h> | 37 | #include <asm/mbus.h> |
38 | #include <asm/page.h> | 38 | #include <asm/page.h> |
39 | #include <asm/asi.h> | 39 | #include <asm/asi.h> |
40 | #include <asm/msi.h> | ||
41 | #include <asm/smp.h> | 40 | #include <asm/smp.h> |
42 | #include <asm/io.h> | 41 | #include <asm/io.h> |
43 | 42 | ||
@@ -116,6 +115,25 @@ static inline void srmmu_ctxd_set(ctxd_t *ctxp, pgd_t *pgdp) | |||
116 | set_pte((pte_t *)ctxp, pte); | 115 | set_pte((pte_t *)ctxp, pte); |
117 | } | 116 | } |
118 | 117 | ||
118 | /* | ||
119 | * Locations of MSI Registers. | ||
120 | */ | ||
121 | #define MSI_MBUS_ARBEN 0xe0001008 /* MBus Arbiter Enable register */ | ||
122 | |||
123 | /* | ||
124 | * Useful bits in the MSI Registers. | ||
125 | */ | ||
126 | #define MSI_ASYNC_MODE 0x80000000 /* Operate the MSI asynchronously */ | ||
127 | |||
128 | static void msi_set_sync(void) | ||
129 | { | ||
130 | __asm__ __volatile__ ("lda [%0] %1, %%g3\n\t" | ||
131 | "andn %%g3, %2, %%g3\n\t" | ||
132 | "sta %%g3, [%0] %1\n\t" : : | ||
133 | "r" (MSI_MBUS_ARBEN), | ||
134 | "i" (ASI_M_CTL), "r" (MSI_ASYNC_MODE) : "g3"); | ||
135 | } | ||
136 | |||
119 | void pmd_set(pmd_t *pmdp, pte_t *ptep) | 137 | void pmd_set(pmd_t *pmdp, pte_t *ptep) |
120 | { | 138 | { |
121 | unsigned long ptp; /* Physical address, shifted right by 4 */ | 139 | unsigned long ptp; /* Physical address, shifted right by 4 */ |