@@ -50,8 +50,6 @@ enum reset_type {
50
50
};
51
51
52
52
struct at91_reset_data {
53
- int (* notifier_call )(struct notifier_block * this , unsigned long mode ,
54
- void * cmd );
55
53
u32 args ;
56
54
};
57
55
@@ -69,38 +67,8 @@ struct at91_reset {
69
67
* reset register it can be left driving the data bus and
70
68
* killing the chance of a subsequent boot from NAND
71
69
*/
72
- static int at91sam9260_restart (struct notifier_block * this , unsigned long mode ,
73
- void * cmd )
74
- {
75
- struct at91_reset * reset = container_of (this , struct at91_reset , nb );
76
-
77
- asm volatile (
78
- /* Align to cache lines */
79
- ".balign 32\n\t"
80
-
81
- /* Disable SDRAM accesses */
82
- "str %2, [%0, #" __stringify (AT91_SDRAMC_TR ) "]\n\t"
83
-
84
- /* Power down SDRAM */
85
- "str %3, [%0, %5]\n\t"
86
-
87
- /* Reset CPU */
88
- "str %4, [%1, #" __stringify (AT91_RSTC_CR ) "]\n\t"
89
-
90
- "b .\n\t"
91
- :
92
- : "r" (reset -> ramc_base [0 ]),
93
- "r" (reset -> rstc_base ),
94
- "r" (1 ),
95
- "r" cpu_to_le32 (AT91_SDRAMC_LPCB_POWER_DOWN ),
96
- "r" (reset -> args ),
97
- "r" (reset -> ramc_lpr ));
98
-
99
- return NOTIFY_DONE ;
100
- }
101
-
102
- static int at91sam9g45_restart (struct notifier_block * this , unsigned long mode ,
103
- void * cmd )
70
+ static int at91_reset (struct notifier_block * this , unsigned long mode ,
71
+ void * cmd )
104
72
{
105
73
struct at91_reset * reset = container_of (this , struct at91_reset , nb );
106
74
@@ -137,16 +105,6 @@ static int at91sam9g45_restart(struct notifier_block *this, unsigned long mode,
137
105
return NOTIFY_DONE ;
138
106
}
139
107
140
- static int sama5d3_restart (struct notifier_block * this , unsigned long mode ,
141
- void * cmd )
142
- {
143
- struct at91_reset * reset = container_of (this , struct at91_reset , nb );
144
-
145
- writel (reset -> args , reset -> rstc_base );
146
-
147
- return NOTIFY_DONE ;
148
- }
149
-
150
108
static void __init at91_reset_status (struct platform_device * pdev ,
151
109
void __iomem * base )
152
110
{
@@ -199,22 +157,18 @@ static const struct of_device_id at91_ramc_of_match[] = {
199
157
};
200
158
201
159
static const struct at91_reset_data at91sam9260_reset_data = {
202
- .notifier_call = at91sam9260_restart ,
203
160
.args = AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST ,
204
161
};
205
162
206
163
static const struct at91_reset_data at91sam9g45_reset_data = {
207
- .notifier_call = at91sam9g45_restart ,
208
164
.args = AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST ,
209
165
};
210
166
211
167
static const struct at91_reset_data sama5d3_reset_data = {
212
- .notifier_call = sama5d3_restart ,
213
168
.args = AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST ,
214
169
};
215
170
216
171
static const struct at91_reset_data samx7_reset_data = {
217
- .notifier_call = sama5d3_restart ,
218
172
.args = AT91_RSTC_KEY | AT91_RSTC_PROCRST ,
219
173
};
220
174
@@ -277,7 +231,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
277
231
278
232
match = of_match_node (at91_reset_of_match , pdev -> dev .of_node );
279
233
reset_data = match -> data ;
280
- reset -> nb .notifier_call = reset_data -> notifier_call ;
234
+ reset -> nb .notifier_call = at91_reset ;
281
235
reset -> nb .priority = 192 ;
282
236
reset -> args = reset_data -> args ;
283
237
0 commit comments