]>
Commit | Line | Data |
---|---|---|
4134f2bd AB |
1 | ; |
2 | ; Copyright (c) 2014-2018, Linaro Limited. All rights reserved. | |
3 | ; | |
4 | ; This program and the accompanying materials are licensed and made available | |
5 | ; under the terms and conditions of the BSD License which accompanies this | |
6 | ; distribution. The full text of the license may be found at | |
7 | ; http:;opensource.org/licenses/bsd-license.php | |
8 | ; | |
9 | ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, | |
10 | ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | |
11 | ; | |
12 | ||
13 | ||
14 | AREA IoLibMmio, CODE, READONLY | |
15 | ||
16 | EXPORT MmioRead8Internal | |
17 | EXPORT MmioWrite8Internal | |
18 | EXPORT MmioRead16Internal | |
19 | EXPORT MmioWrite16Internal | |
20 | EXPORT MmioRead32Internal | |
21 | EXPORT MmioWrite32Internal | |
22 | EXPORT MmioRead64Internal | |
23 | EXPORT MmioWrite64Internal | |
24 | ||
25 | ; | |
26 | ; Reads an 8-bit MMIO register. | |
27 | ; | |
28 | ; Reads the 8-bit MMIO register specified by Address. The 8-bit read value is | |
29 | ; returned. This function must guarantee that all MMIO read and write | |
30 | ; operations are serialized. | |
31 | ; | |
32 | ; @param Address The MMIO register to read. | |
33 | ; | |
34 | ; @return The value read. | |
35 | ; | |
36 | MmioRead8Internal | |
37 | ldrb w0, [x0] | |
38 | dmb ld | |
39 | ret | |
40 | ||
41 | ; | |
42 | ; Writes an 8-bit MMIO register. | |
43 | ; | |
44 | ; Writes the 8-bit MMIO register specified by Address with the value specified | |
45 | ; by Value and returns Value. This function must guarantee that all MMIO read | |
46 | ; and write operations are serialized. | |
47 | ; | |
48 | ; @param Address The MMIO register to write. | |
49 | ; @param Value The value to write to the MMIO register. | |
50 | ; | |
51 | MmioWrite8Internal | |
52 | dmb st | |
53 | strb w1, [x0] | |
54 | ret | |
55 | ||
56 | ; | |
57 | ; Reads a 16-bit MMIO register. | |
58 | ; | |
59 | ; Reads the 16-bit MMIO register specified by Address. The 16-bit read value is | |
60 | ; returned. This function must guarantee that all MMIO read and write | |
61 | ; operations are serialized. | |
62 | ; | |
63 | ; @param Address The MMIO register to read. | |
64 | ; | |
65 | ; @return The value read. | |
66 | ; | |
67 | MmioRead16Internal | |
68 | ldrh w0, [x0] | |
69 | dmb ld | |
70 | ret | |
71 | ||
72 | ; | |
73 | ; Writes a 16-bit MMIO register. | |
74 | ; | |
75 | ; Writes the 16-bit MMIO register specified by Address with the value specified | |
76 | ; by Value and returns Value. This function must guarantee that all MMIO read | |
77 | ; and write operations are serialized. | |
78 | ; | |
79 | ; @param Address The MMIO register to write. | |
80 | ; @param Value The value to write to the MMIO register. | |
81 | ; | |
82 | MmioWrite16Internal | |
83 | dmb st | |
84 | strh w1, [x0] | |
85 | ret | |
86 | ||
87 | ; | |
88 | ; Reads a 32-bit MMIO register. | |
89 | ; | |
90 | ; Reads the 32-bit MMIO register specified by Address. The 32-bit read value is | |
91 | ; returned. This function must guarantee that all MMIO read and write | |
92 | ; operations are serialized. | |
93 | ; | |
94 | ; @param Address The MMIO register to read. | |
95 | ; | |
96 | ; @return The value read. | |
97 | ; | |
98 | MmioRead32Internal | |
99 | ldr w0, [x0] | |
100 | dmb ld | |
101 | ret | |
102 | ||
103 | ; | |
104 | ; Writes a 32-bit MMIO register. | |
105 | ; | |
106 | ; Writes the 32-bit MMIO register specified by Address with the value specified | |
107 | ; by Value and returns Value. This function must guarantee that all MMIO read | |
108 | ; and write operations are serialized. | |
109 | ; | |
110 | ; @param Address The MMIO register to write. | |
111 | ; @param Value The value to write to the MMIO register. | |
112 | ; | |
113 | MmioWrite32Internal | |
114 | dmb st | |
115 | str w1, [x0] | |
116 | ret | |
117 | ||
118 | ; | |
119 | ; Reads a 64-bit MMIO register. | |
120 | ; | |
121 | ; Reads the 64-bit MMIO register specified by Address. The 64-bit read value is | |
122 | ; returned. This function must guarantee that all MMIO read and write | |
123 | ; operations are serialized. | |
124 | ; | |
125 | ; @param Address The MMIO register to read. | |
126 | ; | |
127 | ; @return The value read. | |
128 | ; | |
129 | MmioRead64Internal | |
130 | ldr x0, [x0] | |
131 | dmb ld | |
132 | ret | |
133 | ||
134 | ; | |
135 | ; Writes a 64-bit MMIO register. | |
136 | ; | |
137 | ; Writes the 64-bit MMIO register specified by Address with the value specified | |
138 | ; by Value and returns Value. This function must guarantee that all MMIO read | |
139 | ; and write operations are serialized. | |
140 | ; | |
141 | ; @param Address The MMIO register to write. | |
142 | ; @param Value The value to write to the MMIO register. | |
143 | ; | |
144 | MmioWrite64Internal | |
145 | dmb st | |
146 | str x1, [x0] | |
147 | ret | |
148 | ||
149 | END |