| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2014 Imagination Technologies |
|---|
| 3 | 4 | * Author: Paul Burton <paul.burton@mips.com> |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 6 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 7 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 8 | | - * option) any later version. |
|---|
| 9 | 5 | */ |
|---|
| 10 | 6 | |
|---|
| 11 | 7 | #ifndef __MIPS_ASM_MIPS_MAAR_H__ |
|---|
| .. | .. |
|---|
| 36 | 32 | * @upper: The highest address that the MAAR pair will affect. Must be |
|---|
| 37 | 33 | * aligned to one byte before a 2^16 byte boundary. |
|---|
| 38 | 34 | * @attrs: The accessibility attributes to program, eg. MIPS_MAAR_S. The |
|---|
| 39 | | - * MIPS_MAAR_VL attribute will automatically be set. |
|---|
| 35 | + * MIPS_MAAR_VL/MIPS_MAAR_VH attributes will automatically be set. |
|---|
| 40 | 36 | * |
|---|
| 41 | 37 | * Program the pair of MAAR registers specified by idx to apply the attributes |
|---|
| 42 | 38 | * specified by attrs to the range of addresses from lower to higher. |
|---|
| .. | .. |
|---|
| 52 | 48 | /* Automatically set MIPS_MAAR_VL */ |
|---|
| 53 | 49 | attrs |= MIPS_MAAR_VL; |
|---|
| 54 | 50 | |
|---|
| 55 | | - /* Write the upper address & attributes (only MIPS_MAAR_VL matters) */ |
|---|
| 51 | + /* |
|---|
| 52 | + * Write the upper address & attributes (both MIPS_MAAR_VL and |
|---|
| 53 | + * MIPS_MAAR_VH matter) |
|---|
| 54 | + */ |
|---|
| 56 | 55 | write_c0_maari(idx << 1); |
|---|
| 57 | 56 | back_to_back_c0_hazard(); |
|---|
| 58 | 57 | write_c0_maar(((upper >> 4) & MIPS_MAAR_ADDR) | attrs); |
|---|
| 59 | 58 | back_to_back_c0_hazard(); |
|---|
| 59 | +#ifdef CONFIG_XPA |
|---|
| 60 | + upper >>= MIPS_MAARX_ADDR_SHIFT; |
|---|
| 61 | + writex_c0_maar(((upper >> 4) & MIPS_MAARX_ADDR) | MIPS_MAARX_VH); |
|---|
| 62 | + back_to_back_c0_hazard(); |
|---|
| 63 | +#endif |
|---|
| 60 | 64 | |
|---|
| 61 | 65 | /* Write the lower address & attributes */ |
|---|
| 62 | 66 | write_c0_maari((idx << 1) | 0x1); |
|---|
| 63 | 67 | back_to_back_c0_hazard(); |
|---|
| 64 | 68 | write_c0_maar((lower >> 4) | attrs); |
|---|
| 65 | 69 | back_to_back_c0_hazard(); |
|---|
| 70 | +#ifdef CONFIG_XPA |
|---|
| 71 | + lower >>= MIPS_MAARX_ADDR_SHIFT; |
|---|
| 72 | + writex_c0_maar(((lower >> 4) & MIPS_MAARX_ADDR) | MIPS_MAARX_VH); |
|---|
| 73 | + back_to_back_c0_hazard(); |
|---|
| 74 | +#endif |
|---|
| 66 | 75 | } |
|---|
| 67 | 76 | |
|---|
| 68 | 77 | /** |
|---|