hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/arch/powerpc/kernel/btext.c
....@@ -9,13 +9,13 @@
99 #include <linux/init.h>
1010 #include <linux/export.h>
1111 #include <linux/memblock.h>
12
+#include <linux/pgtable.h>
1213
1314 #include <asm/sections.h>
1415 #include <asm/prom.h>
1516 #include <asm/btext.h>
1617 #include <asm/page.h>
1718 #include <asm/mmu.h>
18
-#include <asm/pgtable.h>
1919 #include <asm/io.h>
2020 #include <asm/processor.h>
2121 #include <asm/udbg.h>
....@@ -26,7 +26,7 @@
2626 static void scrollscreen(void);
2727 #endif
2828
29
-#define __force_data __attribute__((__section__(".data")))
29
+#define __force_data __section(".data")
3030
3131 static int g_loc_X __force_data;
3232 static int g_loc_Y __force_data;
....@@ -95,19 +95,10 @@
9595 boot_text_mapped = 0;
9696 return;
9797 }
98
- if (PVR_VER(mfspr(SPRN_PVR)) != 1) {
99
- /* 603, 604, G3, G4, ... */
100
- lowbits = addr & ~0xFF000000UL;
101
- addr &= 0xFF000000UL;
102
- disp_BAT[0] = vaddr | (BL_16M<<2) | 2;
103
- disp_BAT[1] = addr | (_PAGE_NO_CACHE | _PAGE_GUARDED | BPP_RW);
104
- } else {
105
- /* 601 */
106
- lowbits = addr & ~0xFF800000UL;
107
- addr &= 0xFF800000UL;
108
- disp_BAT[0] = vaddr | (_PAGE_NO_CACHE | PP_RWXX) | 4;
109
- disp_BAT[1] = addr | BL_8M | 0x40;
110
- }
98
+ lowbits = addr & ~0xFF000000UL;
99
+ addr &= 0xFF000000UL;
100
+ disp_BAT[0] = vaddr | (BL_16M<<2) | 2;
101
+ disp_BAT[1] = addr | (_PAGE_NO_CACHE | _PAGE_GUARDED | BPP_RW);
111102 logicalDisplayBase = (void *) (vaddr + lowbits);
112103 }
113104 #endif
....@@ -163,7 +154,7 @@
163154 offset = ((unsigned long) dispDeviceBase) - base;
164155 size = dispDeviceRowBytes * dispDeviceRect[3] + offset
165156 + dispDeviceRect[0];
166
- vbase = __ioremap(base, size, pgprot_val(pgprot_noncached_wc(__pgprot(0))));
157
+ vbase = ioremap_wc(base, size);
167158 if (!vbase)
168159 return;
169160 logicalDisplayBase = vbase + offset;
....@@ -232,20 +223,12 @@
232223
233224 int __init btext_find_display(int allow_nonstdout)
234225 {
235
- const char *name;
236
- struct device_node *np = NULL;
226
+ struct device_node *np = of_stdout;
237227 int rc = -ENODEV;
238228
239
- name = of_get_property(of_chosen, "linux,stdout-path", NULL);
240
- if (name != NULL) {
241
- np = of_find_node_by_path(name);
242
- if (np != NULL) {
243
- if (strcmp(np->type, "display") != 0) {
244
- printk("boot stdout isn't a display !\n");
245
- of_node_put(np);
246
- np = NULL;
247
- }
248
- }
229
+ if (!of_node_is_type(np, "display")) {
230
+ printk("boot stdout isn't a display !\n");
231
+ np = NULL;
249232 }
250233 if (np)
251234 rc = btext_initialize(np);