|
33 | 33 | #define RISCV_CFG_BGR_REG 0xd0c
|
34 | 34 | #define PPU_BGR_REG 0x1ac
|
35 | 35 |
|
36 |
| -/* |
37 |
| - * CSRs |
38 |
| - */ |
39 |
| - |
40 |
| -#define CSR_MXSTATUS 0x7c0 |
41 |
| -#define CSR_MHCR 0x7c1 |
42 |
| -#define CSR_MCOR 0x7c2 |
43 |
| -#define CSR_MHINT 0x7c5 |
44 |
| - |
45 | 36 | static unsigned long csr_mxstatus;
|
46 | 37 | static unsigned long csr_mhcr;
|
47 | 38 | static unsigned long csr_mhint;
|
48 | 39 |
|
49 | 40 | static void sun20i_d1_csr_save(void)
|
50 | 41 | {
|
51 | 42 | /* Save custom CSRs. */
|
52 |
| - csr_mxstatus = csr_read(CSR_MXSTATUS); |
53 |
| - csr_mhcr = csr_read(CSR_MHCR); |
54 |
| - csr_mhint = csr_read(CSR_MHINT); |
| 43 | + csr_mxstatus = csr_read(THEAD_C9XX_CSR_MXSTATUS); |
| 44 | + csr_mhcr = csr_read(THEAD_C9XX_CSR_MHCR); |
| 45 | + csr_mhint = csr_read(THEAD_C9XX_CSR_MHINT); |
55 | 46 |
|
56 | 47 | /* Flush and disable caches. */
|
57 |
| - csr_write(CSR_MCOR, 0x22); |
58 |
| - csr_write(CSR_MHCR, 0x0); |
| 48 | + csr_write(THEAD_C9XX_CSR_MCOR, 0x22); |
| 49 | + csr_write(THEAD_C9XX_CSR_MHCR, 0x0); |
59 | 50 | }
|
60 | 51 |
|
61 | 52 | static void sun20i_d1_csr_restore(void)
|
62 | 53 | {
|
63 | 54 | /* Invalidate caches and the branch predictor. */
|
64 |
| - csr_write(CSR_MCOR, 0x70013); |
| 55 | + csr_write(THEAD_C9XX_CSR_MCOR, 0x70013); |
65 | 56 |
|
66 | 57 | /* Restore custom CSRs, including the cache state. */
|
67 |
| - csr_write(CSR_MXSTATUS, csr_mxstatus); |
68 |
| - csr_write(CSR_MHCR, csr_mhcr); |
69 |
| - csr_write(CSR_MHINT, csr_mhint); |
| 58 | + csr_write(THEAD_C9XX_CSR_MXSTATUS, csr_mxstatus); |
| 59 | + csr_write(THEAD_C9XX_CSR_MHCR, csr_mhcr); |
| 60 | + csr_write(THEAD_C9XX_CSR_MHINT, csr_mhint); |
70 | 61 | }
|
71 | 62 |
|
72 | 63 | /*
|
|
0 commit comments