hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/arch/powerpc/platforms/embedded6xx/wii.c
....@@ -1,15 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * arch/powerpc/platforms/embedded6xx/wii.c
34 *
45 * Nintendo Wii board-specific support
56 * Copyright (C) 2008-2009 The GameCube Linux Team
67 * Copyright (C) 2008,2009 Albert Herranz
7
- *
8
- * This program is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU General Public License
10
- * as published by the Free Software Foundation; either version 2
11
- * of the License, or (at your option) any later version.
12
- *
138 */
149 #define DRV_MODULE_NAME "wii"
1510 #define pr_fmt(fmt) DRV_MODULE_NAME ": " fmt
....@@ -54,10 +49,6 @@
5449 static void __iomem *hw_ctrl;
5550 static void __iomem *hw_gpio;
5651
57
-unsigned long wii_hole_start;
58
-unsigned long wii_hole_size;
59
-
60
-
6152 static int __init page_aligned(unsigned long x)
6253 {
6354 return !(x & (PAGE_SIZE-1));
....@@ -69,30 +60,6 @@
6960
7061 BUG_ON(memblock.memory.cnt != 2);
7162 BUG_ON(!page_aligned(p[0].base) || !page_aligned(p[1].base));
72
-
73
- /* determine hole */
74
- wii_hole_start = ALIGN(p[0].base + p[0].size, PAGE_SIZE);
75
- wii_hole_size = p[1].base - wii_hole_start;
76
-}
77
-
78
-unsigned long __init wii_mmu_mapin_mem2(unsigned long top)
79
-{
80
- unsigned long delta, size, bl;
81
- unsigned long max_size = (256<<20);
82
-
83
- /* MEM2 64MB@0x10000000 */
84
- delta = wii_hole_start + wii_hole_size;
85
- size = top - delta;
86
-
87
- if (__map_without_bats)
88
- return delta;
89
-
90
- for (bl = 128<<10; bl < max_size; bl <<= 1) {
91
- if (bl * 2 > size)
92
- break;
93
- }
94
- setbat(4, PAGE_OFFSET+delta, delta, bl, PAGE_KERNEL_X);
95
- return delta + bl;
9663 }
9764
9865 static void __noreturn wii_spin(void)
....@@ -116,14 +83,14 @@
11683 }
11784 error = of_address_to_resource(np, 0, &res);
11885 if (error) {
119
- pr_err("no valid reg found for %s\n", np->name);
86
+ pr_err("no valid reg found for %pOFn\n", np);
12087 goto out_put;
12188 }
12289
12390 hw_regs = ioremap(res.start, resource_size(&res));
12491 if (hw_regs) {
125
- pr_info("%s at 0x%08x mapped to 0x%p\n", name,
126
- res.start, hw_regs);
92
+ pr_info("%s at 0x%pa mapped to 0x%p\n", name,
93
+ &res.start, hw_regs);
12794 }
12895
12996 out_put:
....@@ -205,19 +172,6 @@
205172 flipper_quiesce();
206173 }
207174
208
-define_machine(wii) {
209
- .name = "wii",
210
- .probe = wii_probe,
211
- .setup_arch = wii_setup_arch,
212
- .restart = wii_restart,
213
- .halt = wii_halt,
214
- .init_IRQ = wii_pic_probe,
215
- .get_irq = flipper_pic_get_irq,
216
- .calibrate_decr = generic_calibrate_decr,
217
- .progress = udbg_progress,
218
- .machine_shutdown = wii_shutdown,
219
-};
220
-
221175 static const struct of_device_id wii_of_bus[] = {
222176 { .compatible = "nintendo,hollywood", },
223177 { },
....@@ -233,3 +187,15 @@
233187 }
234188 device_initcall(wii_device_probe);
235189
190
+define_machine(wii) {
191
+ .name = "wii",
192
+ .probe = wii_probe,
193
+ .setup_arch = wii_setup_arch,
194
+ .restart = wii_restart,
195
+ .halt = wii_halt,
196
+ .init_IRQ = wii_pic_probe,
197
+ .get_irq = flipper_pic_get_irq,
198
+ .calibrate_decr = generic_calibrate_decr,
199
+ .progress = udbg_progress,
200
+ .machine_shutdown = wii_shutdown,
201
+};