Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] powerpc: Unify udbg (#2)

This patch unifies udbg for both ppc32 and ppc64 when building the
merged achitecture. xmon now has a single "back end". The powermac udbg
stuff gets enriched with some ADB capabilities and btext output. In
addition, the early_init callback is now called on ppc32 as well,
approx. in the same order as ppc64 regarding device-tree manipulations.
The init sequences of ppc32 and ppc64 are getting closer, I'll unify
them in a later patch.

For now, you can force udbg to the scc using "sccdbg" or to btext using
"btextdbg" on powermacs. I'll implement a cleaner way of forcing udbg
output to something else than the autodetected OF output device in a
later patch.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Benjamin Herrenschmidt and committed by
Paul Mackerras
51d3082f 463ce0e1

+627 -720
+1 -1
arch/powerpc/Kconfig
··· 50 50 51 51 config EARLY_PRINTK 52 52 bool 53 - default y if PPC64 53 + default y 54 54 55 55 config COMPAT 56 56 bool
+3 -4
arch/powerpc/kernel/Makefile
··· 18 18 obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ 19 19 signal_64.o ptrace32.o systbl.o \ 20 20 paca.o ioctl32.o cpu_setup_power4.o \ 21 - firmware.o sysfs.o udbg.o idle_64.o 21 + firmware.o sysfs.o idle_64.o 22 22 obj-$(CONFIG_PPC64) += vdso64/ 23 23 obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o 24 24 obj-$(CONFIG_POWER4) += idle_power4.o ··· 46 46 extra-y += vmlinux.lds 47 47 48 48 obj-y += process.o init_task.o time.o \ 49 - prom.o traps.o setup-common.o 49 + prom.o traps.o setup-common.o udbg.o 50 50 obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o systbl.o 51 51 obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o 52 52 obj-$(CONFIG_PPC_OF) += prom_init.o ··· 56 56 obj-$(CONFIG_SMP) += smp.o 57 57 obj-$(CONFIG_KPROBES) += kprobes.o 58 58 obj-$(CONFIG_PPC_MULTIPLATFORM) += legacy_serial.o 59 - obj64-$(CONFIG_PPC_MULTIPLATFORM) += udbg_16550.o 60 - obj64-$(CONFIG_PPC_PMAC) += udbg_scc.o 59 + obj-$(CONFIG_PPC_MULTIPLATFORM) += udbg_16550.o 61 60 module-$(CONFIG_PPC64) += module_64.o 62 61 obj-$(CONFIG_MODULES) += $(module-y) 63 62
+93 -37
arch/powerpc/kernel/btext.c
··· 31 31 static void draw_byte_16(unsigned char *bits, unsigned int *base, int rb); 32 32 static void draw_byte_8(unsigned char *bits, unsigned int *base, int rb); 33 33 34 - static int g_loc_X; 35 - static int g_loc_Y; 36 - static int g_max_loc_X; 37 - static int g_max_loc_Y; 34 + #define __force_data __attribute__((__section__(".data"))) 38 35 39 - static int dispDeviceRowBytes; 40 - static int dispDeviceDepth; 41 - static int dispDeviceRect[4]; 42 - static unsigned char *dispDeviceBase, *logicalDisplayBase; 36 + static int g_loc_X __force_data; 37 + static int g_loc_Y __force_data; 38 + static int g_max_loc_X __force_data; 39 + static int g_max_loc_Y __force_data; 40 + 41 + static int dispDeviceRowBytes __force_data; 42 + static int dispDeviceDepth __force_data; 43 + static int dispDeviceRect[4] __force_data; 44 + static unsigned char *dispDeviceBase __force_data; 45 + static unsigned char *logicalDisplayBase __force_data; 43 46 44 47 unsigned long disp_BAT[2] __initdata = {0, 0}; 45 48 ··· 50 47 51 48 static unsigned char vga_font[cmapsz]; 52 49 53 - int boot_text_mapped; 50 + int boot_text_mapped __force_data = 0; 54 51 int force_printk_to_btext = 0; 55 52 56 53 #ifdef CONFIG_PPC32 ··· 69 66 * is really badly aligned, but I didn't encounter this case 70 67 * yet. 71 68 */ 72 - void __init 73 - btext_prepare_BAT(void) 69 + void __init btext_prepare_BAT(void) 74 70 { 75 71 unsigned long vaddr = KERNELBASE + 0x10000000; 76 72 unsigned long addr; ··· 97 95 } 98 96 #endif 99 97 100 - /* This function will enable the early boot text when doing OF booting. This 101 - * way, xmon output should work too 98 + 99 + /* This function can be used to enable the early boot text when doing 100 + * OF booting or within bootx init. It must be followed by a btext_unmap() 101 + * call before the logical address becomes unuseable 102 102 */ 103 - void __init 104 - btext_setup_display(int width, int height, int depth, int pitch, 105 - unsigned long address) 103 + void __init btext_setup_display(int width, int height, int depth, int pitch, 104 + unsigned long address) 106 105 { 107 106 g_loc_X = 0; 108 107 g_loc_Y = 0; ··· 119 116 boot_text_mapped = 1; 120 117 } 121 118 119 + void __init btext_unmap(void) 120 + { 121 + boot_text_mapped = 0; 122 + } 123 + 122 124 /* Here's a small text engine to use during early boot 123 125 * or for debugging purposes 124 126 * ··· 135 127 * changes. 136 128 */ 137 129 138 - void map_boot_text(void) 130 + static void map_boot_text(void) 139 131 { 140 132 unsigned long base, offset, size; 141 133 unsigned char *vbase; ··· 183 175 if (prop) 184 176 address = *prop; 185 177 186 - /* FIXME: Add support for PCI reg properties */ 187 - 178 + /* FIXME: Add support for PCI reg properties. Right now, only 179 + * reliable on macs 180 + */ 188 181 if (address == 0) 189 182 return -EINVAL; 190 183 ··· 193 184 g_loc_Y = 0; 194 185 g_max_loc_X = width / 8; 195 186 g_max_loc_Y = height / 16; 196 - logicalDisplayBase = (unsigned char *)address; 197 187 dispDeviceBase = (unsigned char *)address; 198 188 dispDeviceRowBytes = pitch; 199 189 dispDeviceDepth = depth; ··· 205 197 return 0; 206 198 } 207 199 208 - void __init init_boot_display(void) 200 + int __init btext_find_display(int allow_nonstdout) 209 201 { 210 202 char *name; 211 203 struct device_node *np = NULL; ··· 226 218 } 227 219 if (np) 228 220 rc = btext_initialize(np); 229 - if (rc == 0) 230 - return; 221 + if (rc == 0 || !allow_nonstdout) 222 + return rc; 231 223 232 224 for (np = NULL; (np = of_find_node_by_type(np, "display"));) { 233 225 if (get_property(np, "linux,opened", NULL)) { ··· 236 228 printk("result: %d\n", rc); 237 229 } 238 230 if (rc == 0) 239 - return; 231 + break; 240 232 } 233 + return rc; 241 234 } 242 235 243 236 /* Calc the base address of a given point (x,y) */ ··· 286 277 287 278 void btext_clearscreen(void) 288 279 { 289 - unsigned long *base = (unsigned long *)calc_base(0, 0); 280 + unsigned int *base = (unsigned int *)calc_base(0, 0); 290 281 unsigned long width = ((dispDeviceRect[2] - dispDeviceRect[0]) * 291 - (dispDeviceDepth >> 3)) >> 3; 282 + (dispDeviceDepth >> 3)) >> 2; 292 283 int i,j; 293 284 294 285 for (i=0; i<(dispDeviceRect[3] - dispDeviceRect[1]); i++) 295 286 { 296 - unsigned long *ptr = base; 287 + unsigned int *ptr = base; 297 288 for(j=width; j; --j) 298 289 *(ptr++) = 0; 299 - base += (dispDeviceRowBytes >> 3); 290 + base += (dispDeviceRowBytes >> 2); 300 291 } 301 292 } 293 + 294 + void btext_flushscreen(void) 295 + { 296 + unsigned int *base = (unsigned int *)calc_base(0, 0); 297 + unsigned long width = ((dispDeviceRect[2] - dispDeviceRect[0]) * 298 + (dispDeviceDepth >> 3)) >> 2; 299 + int i,j; 300 + 301 + for (i=0; i < (dispDeviceRect[3] - dispDeviceRect[1]); i++) 302 + { 303 + unsigned int *ptr = base; 304 + for(j = width; j > 0; j -= 8) { 305 + __asm__ __volatile__ ("dcbst 0,%0" :: "r" (ptr)); 306 + ptr += 8; 307 + } 308 + base += (dispDeviceRowBytes >> 2); 309 + } 310 + __asm__ __volatile__ ("sync" ::: "memory"); 311 + } 312 + 313 + void btext_flushline(void) 314 + { 315 + unsigned int *base = (unsigned int *)calc_base(0, g_loc_Y << 4); 316 + unsigned long width = ((dispDeviceRect[2] - dispDeviceRect[0]) * 317 + (dispDeviceDepth >> 3)) >> 2; 318 + int i,j; 319 + 320 + for (i=0; i < 16; i++) 321 + { 322 + unsigned int *ptr = base; 323 + for(j = width; j > 0; j -= 8) { 324 + __asm__ __volatile__ ("dcbst 0,%0" :: "r" (ptr)); 325 + ptr += 8; 326 + } 327 + base += (dispDeviceRowBytes >> 2); 328 + } 329 + __asm__ __volatile__ ("sync" ::: "memory"); 330 + } 331 + 302 332 303 333 #ifndef NO_SCROLL 304 334 static void scrollscreen(void) 305 335 { 306 - unsigned long *src = (unsigned long *)calc_base(0,16); 307 - unsigned long *dst = (unsigned long *)calc_base(0,0); 336 + unsigned int *src = (unsigned int *)calc_base(0,16); 337 + unsigned int *dst = (unsigned int *)calc_base(0,0); 308 338 unsigned long width = ((dispDeviceRect[2] - dispDeviceRect[0]) * 309 - (dispDeviceDepth >> 3)) >> 3; 339 + (dispDeviceDepth >> 3)) >> 2; 310 340 int i,j; 311 341 312 342 for (i=0; i<(dispDeviceRect[3] - dispDeviceRect[1] - 16); i++) 313 343 { 314 - unsigned long *src_ptr = src; 315 - unsigned long *dst_ptr = dst; 344 + unsigned int *src_ptr = src; 345 + unsigned int *dst_ptr = dst; 316 346 for(j=width; j; --j) 317 347 *(dst_ptr++) = *(src_ptr++); 318 - src += (dispDeviceRowBytes >> 3); 319 - dst += (dispDeviceRowBytes >> 3); 348 + src += (dispDeviceRowBytes >> 2); 349 + dst += (dispDeviceRowBytes >> 2); 320 350 } 321 351 for (i=0; i<16; i++) 322 352 { 323 - unsigned long *dst_ptr = dst; 353 + unsigned int *dst_ptr = dst; 324 354 for(j=width; j; --j) 325 355 *(dst_ptr++) = 0; 326 - dst += (dispDeviceRowBytes >> 3); 356 + dst += (dispDeviceRowBytes >> 2); 327 357 } 328 358 } 329 359 #endif /* ndef NO_SCROLL */ ··· 422 374 if (!boot_text_mapped) 423 375 return; 424 376 while (*c) 377 + btext_drawchar(*c++); 378 + } 379 + 380 + void btext_drawtext(const char *c, unsigned int len) 381 + { 382 + if (!boot_text_mapped) 383 + return; 384 + while (len--) 425 385 btext_drawchar(*c++); 426 386 } 427 387
+29
arch/powerpc/kernel/head_32.S
··· 153 153 bl flush_tlbs 154 154 155 155 bl initial_bats 156 + #if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) 157 + bl setup_disp_bat 158 + #endif 156 159 157 160 /* 158 161 * Call setup_cpu for CPU 0 and initialize 6xx Idle ··· 1308 1305 isync 1309 1306 blr 1310 1307 1308 + 1309 + #if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) 1310 + setup_disp_bat: 1311 + /* 1312 + * setup the display bat prepared for us in prom.c 1313 + */ 1314 + mflr r8 1315 + bl reloc_offset 1316 + mtlr r8 1317 + addis r8,r3,disp_BAT@ha 1318 + addi r8,r8,disp_BAT@l 1319 + cmpwi cr0,r8,0 1320 + beqlr 1321 + lwz r11,0(r8) 1322 + lwz r8,4(r8) 1323 + mfspr r9,SPRN_PVR 1324 + rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */ 1325 + cmpwi 0,r9,1 1326 + beq 1f 1327 + mtspr SPRN_DBAT3L,r8 1328 + mtspr SPRN_DBAT3U,r11 1329 + blr 1330 + 1: mtspr SPRN_IBAT3L,r8 1331 + mtspr SPRN_IBAT3U,r11 1332 + blr 1333 + #endif /* !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) */ 1311 1334 1312 1335 #ifdef CONFIG_8260 1313 1336 /* Jump into the system reset for the rom.
+15 -13
arch/powerpc/kernel/setup_32.c
··· 40 40 #include <asm/xmon.h> 41 41 #include <asm/time.h> 42 42 #include <asm/serial.h> 43 + #include <asm/udbg.h> 43 44 44 45 #include "setup.h" 45 46 ··· 174 173 */ 175 174 void __init machine_init(unsigned long dt_ptr, unsigned long phys) 176 175 { 176 + /* If btext is enabled, we might have a BAT setup for early display, 177 + * thus we do enable some very basic udbg output 178 + */ 179 + #ifdef CONFIG_BOOTX_TEXT 180 + udbg_putc = btext_drawchar; 181 + #endif 182 + 183 + /* Do some early initialization based on the flat device tree */ 177 184 early_init_devtree(__va(dt_ptr)); 178 185 186 + /* Check default command line */ 179 187 #ifdef CONFIG_CMDLINE 180 - strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line)); 188 + if (cmd_line[0] == 0) 189 + strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line)); 181 190 #endif /* CONFIG_CMDLINE */ 182 191 192 + /* Base init based on machine type */ 183 193 platform_init(); 184 194 185 195 #ifdef CONFIG_6xx ··· 306 294 307 295 smp_setup_cpu_maps(); 308 296 309 - #ifdef CONFIG_BOOTX_TEXT 310 - init_boot_display(); 311 - #endif 312 - 313 - #ifdef CONFIG_PPC_PMAC 314 - /* This could be called "early setup arch", it must be done 315 - * now because xmon need it 316 - */ 317 - if (_machine == _MACH_Pmac) 318 - pmac_feature_init(); /* New cool way */ 319 - #endif 320 - 321 297 #ifdef CONFIG_XMON_DEFAULT 322 298 xmon_init(1); 323 299 #endif 300 + /* Register early console */ 301 + register_early_udbg_console(); 324 302 325 303 #if defined(CONFIG_KGDB) 326 304 if (ppc_md.kgdb_map_scc)
-4
arch/powerpc/kernel/setup_64.c
··· 474 474 */ 475 475 finish_device_tree(); 476 476 477 - #ifdef CONFIG_BOOTX_TEXT 478 - init_boot_display(); 479 - #endif 480 - 481 477 /* 482 478 * Initialize xmon 483 479 */
+5 -3
arch/powerpc/kernel/udbg.c
··· 16 16 #include <linux/console.h> 17 17 #include <asm/processor.h> 18 18 19 - void (*udbg_putc)(unsigned char c); 20 - unsigned char (*udbg_getc)(void); 19 + void (*udbg_putc)(char c); 20 + char (*udbg_getc)(void); 21 21 int (*udbg_getc_poll)(void); 22 22 23 23 /* udbg library, used by xmon et al */ ··· 78 78 #define UDBG_BUFSIZE 256 79 79 void udbg_printf(const char *fmt, ...) 80 80 { 81 - unsigned char buf[UDBG_BUFSIZE]; 81 + char buf[UDBG_BUFSIZE]; 82 82 va_list args; 83 83 84 84 va_start(args, fmt); ··· 116 116 /* called by setup_system */ 117 117 void register_early_udbg_console(void) 118 118 { 119 + if (early_console_initialized) 120 + return; 119 121 early_console_initialized = 1; 120 122 register_console(&udbg_console); 121 123 }
+2 -2
arch/powerpc/kernel/udbg_16550.c
··· 47 47 48 48 static volatile struct NS16550 __iomem *udbg_comport; 49 49 50 - static void udbg_550_putc(unsigned char c) 50 + static void udbg_550_putc(char c) 51 51 { 52 52 if (udbg_comport) { 53 53 while ((in_8(&udbg_comport->lsr) & LSR_THRE) == 0) ··· 69 69 return -1; 70 70 } 71 71 72 - static unsigned char udbg_550_getc(void) 72 + static char udbg_550_getc(void) 73 73 { 74 74 if (udbg_comport) { 75 75 while ((in_8(&udbg_comport->lsr) & LSR_DR) == 0)
+47 -17
arch/powerpc/kernel/udbg_scc.c arch/powerpc/platforms/powermac/udbg_scc.c
··· 25 25 static volatile u8 __iomem *sccc; 26 26 static volatile u8 __iomem *sccd; 27 27 28 - static void udbg_scc_putc(unsigned char c) 28 + static void udbg_scc_putc(char c) 29 29 { 30 30 if (sccc) { 31 31 while ((in_8(sccc) & SCC_TXRDY) == 0) ··· 47 47 return -1; 48 48 } 49 49 50 - static unsigned char udbg_scc_getc(void) 50 + static char udbg_scc_getc(void) 51 51 { 52 52 if (sccc) { 53 53 while ((in_8(sccc) & SCC_RXRDY) == 0) ··· 67 67 3, 0xc1, /* rx enable, 8 bits */ 68 68 }; 69 69 70 - void udbg_init_scc(struct device_node *np) 70 + void udbg_scc_init(int force_scc) 71 71 { 72 72 u32 *reg; 73 73 unsigned long addr; 74 + struct device_node *stdout = NULL, *escc = NULL, *macio = NULL; 75 + struct device_node *ch, *ch_def = NULL, *ch_a = NULL; 76 + char *path; 74 77 int i, x; 75 78 76 - if (np == NULL) 77 - np = of_find_node_by_name(NULL, "escc"); 78 - if (np == NULL || np->parent == NULL) 79 - return; 79 + escc = of_find_node_by_name(NULL, "escc"); 80 + if (escc == NULL) 81 + goto bail; 82 + macio = of_get_parent(escc); 83 + if (macio == NULL) 84 + goto bail; 85 + path = (char *)get_property(of_chosen, "linux,stdout-path", NULL); 86 + if (path != NULL) 87 + stdout = of_find_node_by_path(path); 88 + for (ch = NULL; (ch = of_get_next_child(escc, ch)) != NULL;) { 89 + if (ch == stdout) 90 + ch_def = of_node_get(ch); 91 + if (strcmp(ch->name, "ch-a") == 0) 92 + ch_a = of_node_get(ch); 93 + } 94 + if (ch_def == NULL && !force_scc) 95 + goto bail; 80 96 81 - udbg_printf("found SCC...\n"); 97 + ch = ch_def ? ch_def : ch_a; 98 + 82 99 /* Get address within mac-io ASIC */ 83 - reg = (u32 *)get_property(np, "reg", NULL); 100 + reg = (u32 *)get_property(escc, "reg", NULL); 84 101 if (reg == NULL) 85 - return; 102 + goto bail; 86 103 addr = reg[0]; 87 - udbg_printf("local addr: %lx\n", addr); 104 + 88 105 /* Get address of mac-io PCI itself */ 89 - reg = (u32 *)get_property(np->parent, "assigned-addresses", NULL); 106 + reg = (u32 *)get_property(macio, "assigned-addresses", NULL); 90 107 if (reg == NULL) 91 - return; 108 + goto bail; 92 109 addr += reg[2]; 93 - udbg_printf("final addr: %lx\n", addr); 110 + 111 + /* Lock the serial port */ 112 + pmac_call_feature(PMAC_FTR_SCC_ENABLE, ch, 113 + PMAC_SCC_ASYNC | PMAC_SCC_FLAG_XMON, 1); 114 + 94 115 95 116 /* Setup for 57600 8N1 */ 96 - addr += 0x20; 117 + if (ch == ch_a) 118 + addr += 0x20; 97 119 sccc = (volatile u8 * __iomem) ioremap(addr & PAGE_MASK, PAGE_SIZE) ; 98 120 sccc += addr & ~PAGE_MASK; 99 121 sccd = sccc + 0x10; 100 122 101 - udbg_printf("ioremap result sccc: %p\n", sccc); 102 123 mb(); 103 124 104 125 for (i = 20000; i != 0; --i) ··· 134 113 udbg_getc_poll = udbg_scc_getc_poll; 135 114 136 115 udbg_puts("Hello World !\n"); 116 + 117 + bail: 118 + of_node_put(macio); 119 + of_node_put(escc); 120 + of_node_put(stdout); 121 + of_node_put(ch_def); 122 + of_node_put(ch_a); 137 123 } 138 124 139 - static void udbg_real_scc_putc(unsigned char c) 125 + #ifdef CONFIG_PPC64 126 + static void udbg_real_scc_putc(char c) 140 127 { 141 128 while ((real_readb(sccc) & SCC_TXRDY) == 0) 142 129 ; ··· 162 133 udbg_getc = NULL; 163 134 udbg_getc_poll = NULL; 164 135 } 136 + #endif /* CONFIG_PPC64 */
+5
arch/powerpc/mm/init_32.c
··· 188 188 189 189 if (ppc_md.progress) 190 190 ppc_md.progress("MMU:exit", 0x211); 191 + 192 + /* From now on, btext is no longer BAT mapped if it was at all */ 193 + #ifdef CONFIG_BOOTX_TEXT 194 + btext_unmap(); 195 + #endif 191 196 } 192 197 193 198 /* This is only called until mem_init is done. */
+1
arch/powerpc/platforms/powermac/Makefile
··· 7 7 # ppc64 pmac doesn't define CONFIG_NVRAM but needs nvram stuff 8 8 obj-$(CONFIG_PPC64) += nvram.o 9 9 obj-$(CONFIG_SMP) += smp.o 10 + obj-$(CONFIG_PPC_MERGE) += udbg_scc.o udbg_adb.o
+43 -25
arch/powerpc/platforms/powermac/feature.c
··· 2607 2607 */ 2608 2608 static void __init probe_uninorth(void) 2609 2609 { 2610 + u32 *addrp; 2611 + phys_addr_t address; 2610 2612 unsigned long actrl; 2611 2613 2612 2614 /* Locate core99 Uni-N */ ··· 2618 2616 uninorth_node = of_find_node_by_name(NULL, "u3"); 2619 2617 uninorth_u3 = 1; 2620 2618 } 2621 - if (uninorth_node && uninorth_node->n_addrs > 0) { 2622 - unsigned long address = uninorth_node->addrs[0].address; 2623 - uninorth_base = ioremap(address, 0x40000); 2624 - uninorth_rev = in_be32(UN_REG(UNI_N_VERSION)); 2625 - if (uninorth_u3) 2626 - u3_ht = ioremap(address + U3_HT_CONFIG_BASE, 0x1000); 2627 - } else 2628 - uninorth_node = NULL; 2629 - 2630 - if (!uninorth_node) 2619 + if (uninorth_node == NULL) 2631 2620 return; 2632 2621 2633 - printk(KERN_INFO "Found %s memory controller & host bridge, revision: %d\n", 2634 - uninorth_u3 ? "U3" : "UniNorth", uninorth_rev); 2622 + addrp = (u32 *)get_property(uninorth_node, "reg", NULL); 2623 + if (addrp == NULL) 2624 + return; 2625 + address = of_translate_address(uninorth_node, addrp); 2626 + if (address == 0) 2627 + return; 2628 + uninorth_base = ioremap(address, 0x40000); 2629 + uninorth_rev = in_be32(UN_REG(UNI_N_VERSION)); 2630 + if (uninorth_u3) 2631 + u3_ht = ioremap(address + U3_HT_CONFIG_BASE, 0x1000); 2632 + 2633 + printk(KERN_INFO "Found %s memory controller & host bridge," 2634 + " revision: %d\n", uninorth_u3 ? "U3" : "UniNorth", 2635 + uninorth_rev); 2635 2636 printk(KERN_INFO "Mapped at 0x%08lx\n", (unsigned long)uninorth_base); 2636 2637 2637 2638 /* Set the arbitrer QAck delay according to what Apple does ··· 2658 2653 { 2659 2654 struct device_node* node; 2660 2655 int i; 2661 - volatile u32 __iomem * base; 2662 - u32* revp; 2656 + volatile u32 __iomem *base; 2657 + u32 *addrp, *revp; 2658 + phys_addr_t addr; 2659 + u64 size; 2663 2660 2664 - node = find_devices(name); 2665 - if (!node || !node->n_addrs) 2666 - return; 2667 - if (compat) 2668 - do { 2669 - if (device_is_compatible(node, compat)) 2670 - break; 2671 - node = node->next; 2672 - } while (node); 2661 + for (node = NULL; (node = of_find_node_by_name(node, name)) != NULL;) { 2662 + if (!compat) 2663 + break; 2664 + if (device_is_compatible(node, compat)) 2665 + break; 2666 + } 2673 2667 if (!node) 2674 2668 return; 2675 2669 for(i=0; i<MAX_MACIO_CHIPS; i++) { ··· 2677 2673 if (macio_chips[i].of_node == node) 2678 2674 return; 2679 2675 } 2676 + 2680 2677 if (i >= MAX_MACIO_CHIPS) { 2681 2678 printk(KERN_ERR "pmac_feature: Please increase MAX_MACIO_CHIPS !\n"); 2682 2679 printk(KERN_ERR "pmac_feature: %s skipped\n", node->full_name); 2683 2680 return; 2684 2681 } 2685 - base = ioremap(node->addrs[0].address, node->addrs[0].size); 2682 + addrp = of_get_pci_address(node, 0, &size); 2683 + if (addrp == NULL) { 2684 + printk(KERN_ERR "pmac_feature: %s: can't find base !\n", 2685 + node->full_name); 2686 + return; 2687 + } 2688 + addr = of_translate_address(node, addrp); 2689 + if (addr == 0) { 2690 + printk(KERN_ERR "pmac_feature: %s, can't translate base !\n", 2691 + node->full_name); 2692 + return; 2693 + } 2694 + base = ioremap(addr, (unsigned long)size); 2686 2695 if (!base) { 2687 - printk(KERN_ERR "pmac_feature: Can't map mac-io chip !\n"); 2696 + printk(KERN_ERR "pmac_feature: %s, can't map mac-io chip !\n", 2697 + node->full_name); 2688 2698 return; 2689 2699 } 2690 2700 if (type == macio_keylargo) {
+19 -8
arch/powerpc/platforms/powermac/low_i2c.c
··· 36 36 37 37 #ifdef DEBUG 38 38 #define DBG(x...) do {\ 39 - printk(KERN_DEBUG "KW:" x); \ 39 + printk(KERN_DEBUG "low_i2c:" x); \ 40 40 } while(0) 41 41 #else 42 42 #define DBG(x...) ··· 342 342 static void keywest_low_i2c_add(struct device_node *np) 343 343 { 344 344 struct low_i2c_host *host = find_low_i2c_host(NULL); 345 - u32 *psteps, *prate, steps, aoffset = 0; 345 + u32 *psteps, *prate, *addrp, steps; 346 346 struct device_node *parent; 347 347 348 348 if (host == NULL) { ··· 352 352 } 353 353 memset(host, 0, sizeof(*host)); 354 354 355 + /* Apple is kind enough to provide a valid AAPL,address property 356 + * on all i2c keywest nodes so far ... we would have to fallback 357 + * to macio parsing if that wasn't the case 358 + */ 359 + addrp = (u32 *)get_property(np, "AAPL,address", NULL); 360 + if (addrp == NULL) { 361 + printk(KERN_ERR "low_i2c: Can't find address for %s\n", 362 + np->full_name); 363 + return; 364 + } 355 365 init_MUTEX(&host->mutex); 356 366 host->np = of_node_get(np); 357 367 psteps = (u32 *)get_property(np, "AAPL,address-step", NULL); ··· 370 360 steps >>= 1; 371 361 parent = of_get_parent(np); 372 362 host->num_channels = 1; 373 - if (parent && parent->name[0] == 'u') { 363 + if (parent && parent->name[0] == 'u') 374 364 host->num_channels = 2; 375 - aoffset = 3; 376 - } 377 365 /* Select interface rate */ 378 - host->speed = KW_I2C_MODE_100KHZ; 366 + host->speed = KW_I2C_MODE_25KHZ; 379 367 prate = (u32 *)get_property(np, "AAPL,i2c-rate", NULL); 380 368 if (prate) switch(*prate) { 381 369 case 100: ··· 387 379 break; 388 380 } 389 381 382 + printk(KERN_INFO "low_i2c: Bus %s found at 0x%08x, %d channels," 383 + " speed = %d KHz\n", 384 + np->full_name, *addrp, host->num_channels, prate ? *prate : 25); 385 + 390 386 host->mode = pmac_low_i2c_mode_std; 391 - host->base = ioremap(np->addrs[0].address + aoffset, 392 - np->addrs[0].size); 387 + host->base = ioremap((*addrp), 0x1000); 393 388 host->func = keywest_low_i2c_func; 394 389 } 395 390
+1 -1
arch/powerpc/platforms/powermac/pic.c
··· 459 459 mpic_setup_cascade(irqctrler2->intrs[0].line, 460 460 pmac_u3_cascade, mpic2); 461 461 } 462 - #if defined(CONFIG_XMON) && defined(CONFIG_PPC32) 462 + #ifdef CONFIG_XMON 463 463 { 464 464 struct device_node* pswitch; 465 465 int nmi_irq;
+23 -29
arch/powerpc/platforms/powermac/setup.c
··· 77 77 #include <asm/pmc.h> 78 78 #include <asm/mpic.h> 79 79 #include <asm/lmb.h> 80 + #include <asm/udbg.h> 80 81 81 82 #include "pmac.h" 82 83 ··· 322 321 ohare_init(); 323 322 l2cr_init(); 324 323 #endif /* CONFIG_PPC32 */ 325 - 326 - #ifdef CONFIG_PPC64 327 - /* Probe motherboard chipset */ 328 - /* this is done earlier in setup_arch for 32-bit */ 329 - pmac_feature_init(); 330 - 331 - /* We can NAP */ 332 - powersave_nap = 1; 333 - printk(KERN_INFO "Using native/NAP idle loop\n"); 334 - #endif 335 324 336 325 #ifdef CONFIG_KGDB 337 326 zs_kgdb_hook(0); ··· 613 622 * and call ioremap 614 623 */ 615 624 hpte_init_native(); 625 + #endif 616 626 617 - /* Init SCC */ 618 - if (strstr(cmd_line, "sccdbg")) { 619 - sccdbg = 1; 620 - udbg_init_scc(NULL); 627 + /* Enable early btext debug if requested */ 628 + if (strstr(cmd_line, "btextdbg")) { 629 + udbg_adb_init_early(); 630 + register_early_udbg_console(); 621 631 } 622 632 633 + /* Probe motherboard chipset */ 634 + pmac_feature_init(); 635 + 636 + /* We can NAP */ 637 + powersave_nap = 1; 638 + printk(KERN_INFO "Using native/NAP idle loop\n"); 639 + 640 + /* Initialize debug stuff */ 641 + udbg_scc_init(!!strstr(cmd_line, "sccdbg")); 642 + udbg_adb_init(!!strstr(cmd_line, "btextdbg")); 643 + 644 + #ifdef CONFIG_PPC64 623 645 /* Setup interrupt mapping options */ 624 646 ppc64_interrupt_controller = IC_OPEN_PIC; 625 647 ··· 642 638 643 639 static void __init pmac_progress(char *s, unsigned short hex) 644 640 { 645 - #ifdef CONFIG_PPC64 646 - if (sccdbg) { 647 - udbg_puts(s); 648 - udbg_puts("\n"); 649 - return; 650 - } 651 - #endif 652 - #ifdef CONFIG_BOOTX_TEXT 653 - if (boot_text_mapped) { 654 - btext_drawstring(s); 655 - btext_drawchar('\n'); 656 - } 657 - #endif /* CONFIG_BOOTX_TEXT */ 641 + udbg_puts(s); 642 + udbg_puts("\n"); 658 643 } 659 644 660 645 /* ··· 728 735 } 729 736 730 737 #ifdef CONFIG_PPC64 731 - static int pmac_probe_mode(struct pci_bus *bus) 738 + /* Move that to pci.c */ 739 + static int pmac_pci_probe_mode(struct pci_bus *bus) 732 740 { 733 741 struct device_node *node = bus->sysdata; 734 742 ··· 765 771 .check_legacy_ioport = pmac_check_legacy_ioport, 766 772 .progress = pmac_progress, 767 773 #ifdef CONFIG_PPC64 768 - .pci_probe_mode = pmac_probe_mode, 774 + .pci_probe_mode = pmac_pci_probe_mode, 769 775 .idle_loop = native_idle, 770 776 .enable_pmcs = power4_enable_pmcs, 771 777 #ifdef CONFIG_KEXEC
+218
arch/powerpc/platforms/powermac/udbg_adb.c
··· 1 + #include <linux/config.h> 2 + #include <linux/string.h> 3 + #include <linux/kernel.h> 4 + #include <linux/errno.h> 5 + #include <linux/bitops.h> 6 + #include <linux/ptrace.h> 7 + #include <linux/adb.h> 8 + #include <linux/pmu.h> 9 + #include <linux/cuda.h> 10 + #include <asm/machdep.h> 11 + #include <asm/io.h> 12 + #include <asm/page.h> 13 + #include <asm/xmon.h> 14 + #include <asm/prom.h> 15 + #include <asm/bootx.h> 16 + #include <asm/machdep.h> 17 + #include <asm/errno.h> 18 + #include <asm/pmac_feature.h> 19 + #include <asm/processor.h> 20 + #include <asm/delay.h> 21 + #include <asm/btext.h> 22 + #include <asm/time.h> 23 + #include <asm/udbg.h> 24 + 25 + /* 26 + * This implementation is "special", it can "patch" the current 27 + * udbg implementation and work on top of it. It must thus be 28 + * initialized last 29 + */ 30 + 31 + static void (*udbg_adb_old_putc)(char c); 32 + static char (*udbg_adb_old_getc)(void); 33 + static int (*udbg_adb_old_getc_poll)(void); 34 + 35 + static enum { 36 + input_adb_none, 37 + input_adb_pmu, 38 + input_adb_cuda, 39 + } input_type = input_adb_none; 40 + 41 + static int udbg_adb_use_btext; 42 + 43 + int xmon_wants_key, xmon_adb_keycode; 44 + 45 + static inline void udbg_adb_poll(void) 46 + { 47 + #ifdef CONFIG_ADB_PMU 48 + if (input_type == input_adb_pmu) 49 + pmu_poll_adb(); 50 + #endif /* CONFIG_ADB_PMU */ 51 + #ifdef CONFIG_ADB_CUDA 52 + if (input_type == input_adb_cuda) 53 + cuda_poll(); 54 + #endif /* CONFIG_ADB_CUDA */ 55 + } 56 + 57 + #ifdef CONFIG_BOOTX_TEXT 58 + static int xmon_adb_shiftstate; 59 + 60 + static unsigned char xmon_keytab[128] = 61 + "asdfhgzxcv\000bqwer" /* 0x00 - 0x0f */ 62 + "yt123465=97-80]o" /* 0x10 - 0x1f */ 63 + "u[ip\rlj'k;\\,/nm." /* 0x20 - 0x2f */ 64 + "\t `\177\0\033\0\0\0\0\0\0\0\0\0\0" /* 0x30 - 0x3f */ 65 + "\0.\0*\0+\0\0\0\0\0/\r\0-\0" /* 0x40 - 0x4f */ 66 + "\0\0000123456789\0\0\0"; /* 0x50 - 0x5f */ 67 + 68 + static unsigned char xmon_shift_keytab[128] = 69 + "ASDFHGZXCV\000BQWER" /* 0x00 - 0x0f */ 70 + "YT!@#$^%+(&_*)}O" /* 0x10 - 0x1f */ 71 + "U{IP\rLJ\"K:|<?NM>" /* 0x20 - 0x2f */ 72 + "\t ~\177\0\033\0\0\0\0\0\0\0\0\0\0" /* 0x30 - 0x3f */ 73 + "\0.\0*\0+\0\0\0\0\0/\r\0-\0" /* 0x40 - 0x4f */ 74 + "\0\0000123456789\0\0\0"; /* 0x50 - 0x5f */ 75 + 76 + static char udbg_adb_local_getc(void) 77 + { 78 + int k, t, on; 79 + 80 + xmon_wants_key = 1; 81 + for (;;) { 82 + xmon_adb_keycode = -1; 83 + t = 0; 84 + on = 0; 85 + k = -1; 86 + do { 87 + if (--t < 0) { 88 + on = 1 - on; 89 + btext_drawchar(on? 0xdb: 0x20); 90 + btext_drawchar('\b'); 91 + t = 200000; 92 + } 93 + udbg_adb_poll(); 94 + if (udbg_adb_old_getc_poll) 95 + k = udbg_adb_old_getc_poll(); 96 + } while (k == -1 && xmon_adb_keycode == -1); 97 + if (on) 98 + btext_drawstring(" \b"); 99 + if (k != -1) 100 + return k; 101 + k = xmon_adb_keycode; 102 + 103 + /* test for shift keys */ 104 + if ((k & 0x7f) == 0x38 || (k & 0x7f) == 0x7b) { 105 + xmon_adb_shiftstate = (k & 0x80) == 0; 106 + continue; 107 + } 108 + if (k >= 0x80) 109 + continue; /* ignore up transitions */ 110 + k = (xmon_adb_shiftstate? xmon_shift_keytab: xmon_keytab)[k]; 111 + if (k != 0) 112 + break; 113 + } 114 + xmon_wants_key = 0; 115 + return k; 116 + } 117 + #endif /* CONFIG_BOOTX_TEXT */ 118 + 119 + static char udbg_adb_getc(void) 120 + { 121 + #ifdef CONFIG_BOOTX_TEXT 122 + if (udbg_adb_use_btext && input_type != input_adb_none) 123 + return udbg_adb_local_getc(); 124 + #endif 125 + if (udbg_adb_old_getc) 126 + return udbg_adb_old_getc(); 127 + return -1; 128 + } 129 + 130 + /* getc_poll() is not really used, unless you have the xmon-over modem 131 + * hack that doesn't quite concern us here, thus we just poll the low level 132 + * ADB driver to prevent it from timing out and call back the original poll 133 + * routine. 134 + */ 135 + static int udbg_adb_getc_poll(void) 136 + { 137 + udbg_adb_poll(); 138 + 139 + if (udbg_adb_old_getc_poll) 140 + return udbg_adb_old_getc_poll(); 141 + return -1; 142 + } 143 + 144 + static void udbg_adb_putc(char c) 145 + { 146 + #ifdef CONFIG_BOOTX_TEXT 147 + if (udbg_adb_use_btext) 148 + btext_drawchar(c); 149 + #endif 150 + if (udbg_adb_old_putc) 151 + return udbg_adb_old_putc(c); 152 + } 153 + 154 + void udbg_adb_init_early(void) 155 + { 156 + #ifdef CONFIG_BOOTX_TEXT 157 + if (btext_find_display(1) == 0) { 158 + udbg_adb_use_btext = 1; 159 + udbg_putc = udbg_adb_putc; 160 + } 161 + #endif 162 + } 163 + 164 + int udbg_adb_init(int force_btext) 165 + { 166 + struct device_node *np; 167 + 168 + /* Capture existing callbacks */ 169 + udbg_adb_old_putc = udbg_putc; 170 + udbg_adb_old_getc = udbg_getc; 171 + udbg_adb_old_getc_poll = udbg_getc_poll; 172 + 173 + /* Check if our early init was already called */ 174 + if (udbg_adb_old_putc == udbg_adb_putc || 175 + udbg_adb_old_putc == btext_drawchar) 176 + udbg_adb_old_putc = NULL; 177 + 178 + /* Set ours as output */ 179 + udbg_putc = udbg_adb_putc; 180 + udbg_getc = udbg_adb_getc; 181 + udbg_getc_poll = udbg_adb_getc_poll; 182 + 183 + #ifdef CONFIG_BOOTX_TEXT 184 + /* Check if we should use btext output */ 185 + if (btext_find_display(force_btext) == 0) 186 + udbg_adb_use_btext = 1; 187 + #endif 188 + 189 + /* See if there is a keyboard in the device tree with a parent 190 + * of type "adb". If not, we return a failure, but we keep the 191 + * bext output set for now 192 + */ 193 + for (np = NULL; (np = of_find_node_by_name(np, "keyboard")) != NULL;) { 194 + struct device_node *parent = of_get_parent(np); 195 + int found = (parent && !strcmp(parent->type, "adb") == 0); 196 + of_node_put(parent); 197 + if (found) 198 + break; 199 + } 200 + if (np == NULL) 201 + return -ENODEV; 202 + of_node_put(np); 203 + 204 + #ifdef CONFIG_ADB_PMU 205 + if (find_via_pmu()) 206 + input_type = input_adb_pmu; 207 + #endif 208 + #ifdef CONFIG_ADB_CUDA 209 + if (find_via_cuda()) 210 + input_type = input_adb_cuda; 211 + #endif 212 + 213 + /* Same as above: nothing found, keep btext set for output */ 214 + if (input_type == input_adb_none) 215 + return -ENODEV; 216 + 217 + return 0; 218 + }
+4 -4
arch/powerpc/platforms/pseries/lpar.c
··· 61 61 int vtermno; /* virtual terminal# for udbg */ 62 62 63 63 #define __ALIGNED__ __attribute__((__aligned__(sizeof(long)))) 64 - static void udbg_hvsi_putc(unsigned char c) 64 + static void udbg_hvsi_putc(char c) 65 65 { 66 66 /* packet's seqno isn't used anyways */ 67 67 uint8_t packet[] __ALIGNED__ = { 0xff, 5, 0, 0, c }; ··· 112 112 return ch; 113 113 } 114 114 115 - static unsigned char udbg_hvsi_getc(void) 115 + static char udbg_hvsi_getc(void) 116 116 { 117 117 int ch; 118 118 for (;;) { ··· 128 128 } 129 129 } 130 130 131 - static void udbg_putcLP(unsigned char c) 131 + static void udbg_putcLP(char c) 132 132 { 133 133 char buf[16]; 134 134 unsigned long rc; ··· 173 173 return ch; 174 174 } 175 175 176 - static unsigned char udbg_getcLP(void) 176 + static char udbg_getcLP(void) 177 177 { 178 178 int ch; 179 179 for (;;) {
+2 -6
arch/powerpc/xmon/Makefile
··· 3 3 ifdef CONFIG_PPC64 4 4 EXTRA_CFLAGS += -mno-minimal-toc 5 5 endif 6 - 7 - obj-$(CONFIG_8xx) += start_8xx.o 8 - obj-$(CONFIG_6xx) += start_32.o 9 - obj-$(CONFIG_4xx) += start_32.o 10 - obj-$(CONFIG_PPC64) += start_64.o 11 - obj-y += xmon.o ppc-dis.o ppc-opc.o setjmp.o nonstdio.o 6 + obj-y += xmon.o ppc-dis.o ppc-opc.o setjmp.o start.o \ 7 + nonstdio.o
-441
arch/powerpc/xmon/start_32.c
··· 1 - /* 2 - * Copyright (C) 1996 Paul Mackerras. 3 - */ 4 - #include <linux/config.h> 5 - #include <linux/string.h> 6 - #include <asm/machdep.h> 7 - #include <asm/io.h> 8 - #include <asm/page.h> 9 - #include <linux/adb.h> 10 - #include <linux/pmu.h> 11 - #include <linux/cuda.h> 12 - #include <linux/kernel.h> 13 - #include <linux/errno.h> 14 - #include <linux/bitops.h> 15 - #include <asm/xmon.h> 16 - #include <asm/prom.h> 17 - #include <asm/bootx.h> 18 - #include <asm/machdep.h> 19 - #include <asm/errno.h> 20 - #include <asm/pmac_feature.h> 21 - #include <asm/processor.h> 22 - #include <asm/delay.h> 23 - #include <asm/btext.h> 24 - #include <asm/time.h> 25 - #include "nonstdio.h" 26 - 27 - static volatile unsigned char __iomem *sccc, *sccd; 28 - unsigned int TXRDY, RXRDY, DLAB; 29 - 30 - static int use_serial; 31 - static int use_screen; 32 - static int via_modem; 33 - static int xmon_use_sccb; 34 - static struct device_node *channel_node; 35 - 36 - void buf_access(void) 37 - { 38 - if (DLAB) 39 - sccd[3] &= ~DLAB; /* reset DLAB */ 40 - } 41 - 42 - extern int adb_init(void); 43 - 44 - #ifdef CONFIG_PPC_CHRP 45 - /* 46 - * This looks in the "ranges" property for the primary PCI host bridge 47 - * to find the physical address of the start of PCI/ISA I/O space. 48 - * It is basically a cut-down version of pci_process_bridge_OF_ranges. 49 - */ 50 - static unsigned long chrp_find_phys_io_base(void) 51 - { 52 - struct device_node *node; 53 - unsigned int *ranges; 54 - unsigned long base = CHRP_ISA_IO_BASE; 55 - int rlen = 0; 56 - int np; 57 - 58 - node = find_devices("isa"); 59 - if (node != NULL) { 60 - node = node->parent; 61 - if (node == NULL || node->type == NULL 62 - || strcmp(node->type, "pci") != 0) 63 - node = NULL; 64 - } 65 - if (node == NULL) 66 - node = find_devices("pci"); 67 - if (node == NULL) 68 - return base; 69 - 70 - ranges = (unsigned int *) get_property(node, "ranges", &rlen); 71 - np = prom_n_addr_cells(node) + 5; 72 - while ((rlen -= np * sizeof(unsigned int)) >= 0) { 73 - if ((ranges[0] >> 24) == 1 && ranges[2] == 0) { 74 - /* I/O space starting at 0, grab the phys base */ 75 - base = ranges[np - 3]; 76 - break; 77 - } 78 - ranges += np; 79 - } 80 - return base; 81 - } 82 - #endif /* CONFIG_PPC_CHRP */ 83 - 84 - void xmon_map_scc(void) 85 - { 86 - #ifdef CONFIG_PPC_MULTIPLATFORM 87 - volatile unsigned char __iomem *base; 88 - 89 - if (_machine == _MACH_Pmac) { 90 - struct device_node *np; 91 - unsigned long addr; 92 - #ifdef CONFIG_BOOTX_TEXT 93 - if (!use_screen && !use_serial 94 - && !machine_is_compatible("iMac")) { 95 - /* see if there is a keyboard in the device tree 96 - with a parent of type "adb" */ 97 - for (np = find_devices("keyboard"); np; np = np->next) 98 - if (np->parent && np->parent->type 99 - && strcmp(np->parent->type, "adb") == 0) 100 - break; 101 - 102 - /* needs to be hacked if xmon_printk is to be used 103 - from within find_via_pmu() */ 104 - #ifdef CONFIG_ADB_PMU 105 - if (np != NULL && boot_text_mapped && find_via_pmu()) 106 - use_screen = 1; 107 - #endif 108 - #ifdef CONFIG_ADB_CUDA 109 - if (np != NULL && boot_text_mapped && find_via_cuda()) 110 - use_screen = 1; 111 - #endif 112 - } 113 - if (!use_screen && (np = find_devices("escc")) != NULL) { 114 - /* 115 - * look for the device node for the serial port 116 - * we're using and see if it says it has a modem 117 - */ 118 - char *name = xmon_use_sccb? "ch-b": "ch-a"; 119 - char *slots; 120 - int l; 121 - 122 - np = np->child; 123 - while (np != NULL && strcmp(np->name, name) != 0) 124 - np = np->sibling; 125 - if (np != NULL) { 126 - /* XXX should parse this properly */ 127 - channel_node = np; 128 - slots = get_property(np, "slot-names", &l); 129 - if (slots != NULL && l >= 10 130 - && strcmp(slots+4, "Modem") == 0) 131 - via_modem = 1; 132 - } 133 - } 134 - btext_drawstring("xmon uses "); 135 - if (use_screen) 136 - btext_drawstring("screen and keyboard\n"); 137 - else { 138 - if (via_modem) 139 - btext_drawstring("modem on "); 140 - btext_drawstring(xmon_use_sccb? "printer": "modem"); 141 - btext_drawstring(" port\n"); 142 - } 143 - 144 - #endif /* CONFIG_BOOTX_TEXT */ 145 - 146 - #ifdef CHRP_ESCC 147 - addr = 0xc1013020; 148 - #else 149 - addr = 0xf3013020; 150 - #endif 151 - TXRDY = 4; 152 - RXRDY = 1; 153 - 154 - np = find_devices("mac-io"); 155 - if (np && np->n_addrs) 156 - addr = np->addrs[0].address + 0x13020; 157 - base = (volatile unsigned char *) ioremap(addr & PAGE_MASK, PAGE_SIZE); 158 - sccc = base + (addr & ~PAGE_MASK); 159 - sccd = sccc + 0x10; 160 - 161 - } else { 162 - base = (volatile unsigned char *) isa_io_base; 163 - 164 - #ifdef CONFIG_PPC_CHRP 165 - if (_machine == _MACH_chrp) 166 - base = (volatile unsigned char __iomem *) 167 - ioremap(chrp_find_phys_io_base(), 0x1000); 168 - #endif 169 - 170 - sccc = base + 0x3fd; 171 - sccd = base + 0x3f8; 172 - if (xmon_use_sccb) { 173 - sccc -= 0x100; 174 - sccd -= 0x100; 175 - } 176 - TXRDY = 0x20; 177 - RXRDY = 1; 178 - DLAB = 0x80; 179 - } 180 - #elif defined(CONFIG_GEMINI) 181 - /* should already be mapped by the kernel boot */ 182 - sccc = (volatile unsigned char __iomem *) 0xffeffb0d; 183 - sccd = (volatile unsigned char __iomem *) 0xffeffb08; 184 - TXRDY = 0x20; 185 - RXRDY = 1; 186 - DLAB = 0x80; 187 - #elif defined(CONFIG_405GP) 188 - sccc = (volatile unsigned char __iomem *)0xef600305; 189 - sccd = (volatile unsigned char __iomem *)0xef600300; 190 - TXRDY = 0x20; 191 - RXRDY = 1; 192 - DLAB = 0x80; 193 - #endif /* platform */ 194 - } 195 - 196 - static int scc_initialized = 0; 197 - 198 - void xmon_init_scc(void); 199 - extern void cuda_poll(void); 200 - 201 - static inline void do_poll_adb(void) 202 - { 203 - #ifdef CONFIG_ADB_PMU 204 - if (sys_ctrler == SYS_CTRLER_PMU) 205 - pmu_poll_adb(); 206 - #endif /* CONFIG_ADB_PMU */ 207 - #ifdef CONFIG_ADB_CUDA 208 - if (sys_ctrler == SYS_CTRLER_CUDA) 209 - cuda_poll(); 210 - #endif /* CONFIG_ADB_CUDA */ 211 - } 212 - 213 - int xmon_write(void *ptr, int nb) 214 - { 215 - char *p = ptr; 216 - int i, c, ct; 217 - 218 - #ifdef CONFIG_SMP 219 - static unsigned long xmon_write_lock; 220 - int lock_wait = 1000000; 221 - int locked; 222 - 223 - while ((locked = test_and_set_bit(0, &xmon_write_lock)) != 0) 224 - if (--lock_wait == 0) 225 - break; 226 - #endif 227 - 228 - #ifdef CONFIG_BOOTX_TEXT 229 - if (use_screen) { 230 - /* write it on the screen */ 231 - for (i = 0; i < nb; ++i) 232 - btext_drawchar(*p++); 233 - goto out; 234 - } 235 - #endif 236 - if (!scc_initialized) 237 - xmon_init_scc(); 238 - ct = 0; 239 - for (i = 0; i < nb; ++i) { 240 - while ((*sccc & TXRDY) == 0) 241 - do_poll_adb(); 242 - c = p[i]; 243 - if (c == '\n' && !ct) { 244 - c = '\r'; 245 - ct = 1; 246 - --i; 247 - } else { 248 - ct = 0; 249 - } 250 - buf_access(); 251 - *sccd = c; 252 - eieio(); 253 - } 254 - 255 - out: 256 - #ifdef CONFIG_SMP 257 - if (!locked) 258 - clear_bit(0, &xmon_write_lock); 259 - #endif 260 - return nb; 261 - } 262 - 263 - int xmon_wants_key; 264 - int xmon_adb_keycode; 265 - 266 - #ifdef CONFIG_BOOTX_TEXT 267 - static int xmon_adb_shiftstate; 268 - 269 - static unsigned char xmon_keytab[128] = 270 - "asdfhgzxcv\000bqwer" /* 0x00 - 0x0f */ 271 - "yt123465=97-80]o" /* 0x10 - 0x1f */ 272 - "u[ip\rlj'k;\\,/nm." /* 0x20 - 0x2f */ 273 - "\t `\177\0\033\0\0\0\0\0\0\0\0\0\0" /* 0x30 - 0x3f */ 274 - "\0.\0*\0+\0\0\0\0\0/\r\0-\0" /* 0x40 - 0x4f */ 275 - "\0\0000123456789\0\0\0"; /* 0x50 - 0x5f */ 276 - 277 - static unsigned char xmon_shift_keytab[128] = 278 - "ASDFHGZXCV\000BQWER" /* 0x00 - 0x0f */ 279 - "YT!@#$^%+(&_*)}O" /* 0x10 - 0x1f */ 280 - "U{IP\rLJ\"K:|<?NM>" /* 0x20 - 0x2f */ 281 - "\t ~\177\0\033\0\0\0\0\0\0\0\0\0\0" /* 0x30 - 0x3f */ 282 - "\0.\0*\0+\0\0\0\0\0/\r\0-\0" /* 0x40 - 0x4f */ 283 - "\0\0000123456789\0\0\0"; /* 0x50 - 0x5f */ 284 - 285 - static int xmon_get_adb_key(void) 286 - { 287 - int k, t, on; 288 - 289 - xmon_wants_key = 1; 290 - for (;;) { 291 - xmon_adb_keycode = -1; 292 - t = 0; 293 - on = 0; 294 - do { 295 - if (--t < 0) { 296 - on = 1 - on; 297 - btext_drawchar(on? 0xdb: 0x20); 298 - btext_drawchar('\b'); 299 - t = 200000; 300 - } 301 - do_poll_adb(); 302 - } while (xmon_adb_keycode == -1); 303 - k = xmon_adb_keycode; 304 - if (on) 305 - btext_drawstring(" \b"); 306 - 307 - /* test for shift keys */ 308 - if ((k & 0x7f) == 0x38 || (k & 0x7f) == 0x7b) { 309 - xmon_adb_shiftstate = (k & 0x80) == 0; 310 - continue; 311 - } 312 - if (k >= 0x80) 313 - continue; /* ignore up transitions */ 314 - k = (xmon_adb_shiftstate? xmon_shift_keytab: xmon_keytab)[k]; 315 - if (k != 0) 316 - break; 317 - } 318 - xmon_wants_key = 0; 319 - return k; 320 - } 321 - #endif /* CONFIG_BOOTX_TEXT */ 322 - 323 - int xmon_readchar(void) 324 - { 325 - #ifdef CONFIG_BOOTX_TEXT 326 - if (use_screen) 327 - return xmon_get_adb_key(); 328 - #endif 329 - if (!scc_initialized) 330 - xmon_init_scc(); 331 - while ((*sccc & RXRDY) == 0) 332 - do_poll_adb(); 333 - buf_access(); 334 - return *sccd; 335 - } 336 - 337 - int xmon_read_poll(void) 338 - { 339 - if ((*sccc & RXRDY) == 0) { 340 - do_poll_adb(); 341 - return -1; 342 - } 343 - buf_access(); 344 - return *sccd; 345 - } 346 - 347 - static unsigned char scc_inittab[] = { 348 - 13, 0, /* set baud rate divisor */ 349 - 12, 1, 350 - 14, 1, /* baud rate gen enable, src=rtxc */ 351 - 11, 0x50, /* clocks = br gen */ 352 - 5, 0xea, /* tx 8 bits, assert DTR & RTS */ 353 - 4, 0x46, /* x16 clock, 1 stop */ 354 - 3, 0xc1, /* rx enable, 8 bits */ 355 - }; 356 - 357 - void xmon_init_scc(void) 358 - { 359 - if ( _machine == _MACH_chrp ) 360 - { 361 - sccd[3] = 0x83; eieio(); /* LCR = 8N1 + DLAB */ 362 - sccd[0] = 12; eieio(); /* DLL = 9600 baud */ 363 - sccd[1] = 0; eieio(); 364 - sccd[2] = 0; eieio(); /* FCR = 0 */ 365 - sccd[3] = 3; eieio(); /* LCR = 8N1 */ 366 - sccd[1] = 0; eieio(); /* IER = 0 */ 367 - } 368 - else if ( _machine == _MACH_Pmac ) 369 - { 370 - int i, x; 371 - unsigned long timeout; 372 - 373 - if (channel_node != 0) 374 - pmac_call_feature( 375 - PMAC_FTR_SCC_ENABLE, 376 - channel_node, 377 - PMAC_SCC_ASYNC | PMAC_SCC_FLAG_XMON, 1); 378 - printk(KERN_INFO "Serial port locked ON by debugger !\n"); 379 - if (via_modem && channel_node != 0) { 380 - unsigned int t0; 381 - 382 - pmac_call_feature( 383 - PMAC_FTR_MODEM_ENABLE, 384 - channel_node, 0, 1); 385 - printk(KERN_INFO "Modem powered up by debugger !\n"); 386 - t0 = get_tbl(); 387 - timeout = 3 * tb_ticks_per_sec; 388 - if (timeout == 0) 389 - /* assume 25MHz if tb_ticks_per_sec not set */ 390 - timeout = 75000000; 391 - while (get_tbl() - t0 < timeout) 392 - eieio(); 393 - } 394 - /* use the B channel if requested */ 395 - if (xmon_use_sccb) { 396 - sccc = (volatile unsigned char *) 397 - ((unsigned long)sccc & ~0x20); 398 - sccd = sccc + 0x10; 399 - } 400 - for (i = 20000; i != 0; --i) { 401 - x = *sccc; eieio(); 402 - } 403 - *sccc = 9; eieio(); /* reset A or B side */ 404 - *sccc = ((unsigned long)sccc & 0x20)? 0x80: 0x40; eieio(); 405 - for (i = 0; i < sizeof(scc_inittab); ++i) { 406 - *sccc = scc_inittab[i]; 407 - eieio(); 408 - } 409 - } 410 - scc_initialized = 1; 411 - if (via_modem) { 412 - for (;;) { 413 - xmon_write("ATE1V1\r", 7); 414 - if (xmon_expect("OK", 5)) { 415 - xmon_write("ATA\r", 4); 416 - if (xmon_expect("CONNECT", 40)) 417 - break; 418 - } 419 - xmon_write("+++", 3); 420 - xmon_expect("OK", 3); 421 - } 422 - } 423 - } 424 - 425 - void xmon_enter(void) 426 - { 427 - #ifdef CONFIG_ADB_PMU 428 - if (_machine == _MACH_Pmac) { 429 - pmu_suspend(); 430 - } 431 - #endif 432 - } 433 - 434 - void xmon_leave(void) 435 - { 436 - #ifdef CONFIG_ADB_PMU 437 - if (_machine == _MACH_Pmac) { 438 - pmu_resume(); 439 - } 440 - #endif 441 - }
arch/powerpc/xmon/start_64.c arch/powerpc/xmon/start.c
-44
arch/powerpc/xmon/start_8xx.c
··· 1 - /* 2 - * Copyright (C) 1996 Paul Mackerras. 3 - * Copyright (C) 2000 Dan Malek. 4 - * Quick hack of Paul's code to make XMON work on 8xx processors. Lots 5 - * of assumptions, like the SMC1 is used, it has been initialized by the 6 - * loader at some point, and we can just stuff and suck bytes. 7 - * We rely upon the 8xx uart driver to support us, as the interface 8 - * changes between boot up and operational phases of the kernel. 9 - */ 10 - #include <linux/string.h> 11 - #include <asm/machdep.h> 12 - #include <asm/io.h> 13 - #include <asm/page.h> 14 - #include <linux/kernel.h> 15 - #include <asm/8xx_immap.h> 16 - #include <asm/mpc8xx.h> 17 - #include <asm/commproc.h> 18 - #include "nonstdio.h" 19 - 20 - extern int xmon_8xx_write(char *str, int nb); 21 - extern int xmon_8xx_read_poll(void); 22 - extern int xmon_8xx_read_char(void); 23 - 24 - void xmon_map_scc(void) 25 - { 26 - cpmp = (cpm8xx_t *)&(((immap_t *)IMAP_ADDR)->im_cpm); 27 - } 28 - 29 - void xmon_init_scc(void); 30 - 31 - int xmon_write(void *ptr, int nb) 32 - { 33 - return(xmon_8xx_write(ptr, nb)); 34 - } 35 - 36 - int xmon_readchar(void) 37 - { 38 - return xmon_8xx_read_char(); 39 - } 40 - 41 - int xmon_read_poll(void) 42 - { 43 - return(xmon_8xx_read_poll()); 44 - }
+3
arch/ppc/kernel/setup.c
··· 744 744 /* so udelay does something sensible, assume <= 1000 bogomips */ 745 745 loops_per_jiffy = 500000000 / HZ; 746 746 747 + if (ppc_md.init_early) 748 + ppc_md.init_early(); 749 + 747 750 #ifdef CONFIG_PPC_MULTIPLATFORM 748 751 /* This could be called "early setup arch", it must be done 749 752 * now because xmon need it
+14 -11
drivers/i2c/busses/i2c-keywest.c
··· 505 505 create_iface(struct device_node *np, struct device *dev) 506 506 { 507 507 unsigned long steps; 508 - unsigned bsteps, tsize, i, nchan, addroffset; 508 + unsigned bsteps, tsize, i, nchan; 509 509 struct keywest_iface* iface; 510 - u32 *psteps, *prate; 510 + u32 *psteps, *prate, *addrp; 511 511 int rc; 512 512 513 - if (np->n_intrs < 1 || np->n_addrs < 1) { 514 - printk(KERN_ERR "%s: Missing interrupt or address !\n", 513 + if (np->n_intrs < 1) { 514 + printk(KERN_ERR "%s: Missing interrupt !\n", 515 515 np->full_name); 516 516 return -ENODEV; 517 517 } 518 + addrp = (u32 *)get_property(np, "AAPL,address", NULL); 519 + if (addrp == NULL) { 520 + printk(KERN_ERR "%s: Can't find address !\n", 521 + np->full_name); 522 + return -ENODEV; 523 + } 524 + 518 525 if (pmac_low_i2c_lock(np)) 519 526 return -ENODEV; 520 527 ··· 532 525 for (bsteps = 0; (steps & 0x01) == 0; bsteps++) 533 526 steps >>= 1; 534 527 535 - if (np->parent->name[0] == 'u') { 528 + if (np->parent->name[0] == 'u') 536 529 nchan = 2; 537 - addroffset = 3; 538 - } else { 539 - addroffset = 0; 530 + else 540 531 nchan = 1; 541 - } 542 532 543 533 tsize = sizeof(struct keywest_iface) + 544 534 (sizeof(struct keywest_chan) + 4) * nchan; ··· 554 550 iface->irq = np->intrs[0].line; 555 551 iface->channels = (struct keywest_chan *) 556 552 (((unsigned long)(iface + 1) + 3UL) & ~3UL); 557 - iface->base = ioremap(np->addrs[0].address + addroffset, 558 - np->addrs[0].size); 553 + iface->base = ioremap(*addrp, 0x1000); 559 554 if (!iface->base) { 560 555 printk(KERN_ERR "i2c-keywest: can't map inteface !\n"); 561 556 kfree(iface);
+24 -24
drivers/macintosh/via-cuda.c
··· 127 127 #endif /* CONFIG_ADB */ 128 128 129 129 #ifdef CONFIG_PPC 130 - int __init 131 - find_via_cuda(void) 130 + int __init find_via_cuda(void) 132 131 { 133 - int err; 134 132 struct adb_request req; 133 + phys_addr_t taddr; 134 + u32 *reg; 135 + int err; 135 136 136 137 if (vias != 0) 137 138 return 1; 138 - vias = find_devices("via-cuda"); 139 + vias = of_find_node_by_name(NULL, "via-cuda"); 139 140 if (vias == 0) 140 141 return 0; 141 - if (vias->next != 0) 142 - printk(KERN_WARNING "Warning: only using 1st via-cuda\n"); 143 142 144 - #if 0 145 - { int i; 146 - 147 - printk("find_via_cuda: node = %p, addrs =", vias->node); 148 - for (i = 0; i < vias->n_addrs; ++i) 149 - printk(" %x(%x)", vias->addrs[i].address, vias->addrs[i].size); 150 - printk(", intrs ="); 151 - for (i = 0; i < vias->n_intrs; ++i) 152 - printk(" %x", vias->intrs[i].line); 153 - printk("\n"); } 154 - #endif 155 - 156 - if (vias->n_addrs != 1 || vias->n_intrs != 1) { 157 - printk(KERN_ERR "via-cuda: expecting 1 address (%d) and 1 interrupt (%d)\n", 158 - vias->n_addrs, vias->n_intrs); 159 - if (vias->n_addrs < 1 || vias->n_intrs < 1) 160 - return 0; 143 + reg = (u32 *)get_property(vias, "reg", NULL); 144 + if (reg == NULL) { 145 + printk(KERN_ERR "via-cuda: No \"reg\" property !\n"); 146 + goto fail; 161 147 } 162 - via = ioremap(vias->addrs->address, 0x2000); 148 + taddr = of_translate_address(vias, reg); 149 + if (taddr == 0) { 150 + printk(KERN_ERR "via-cuda: Can't translate address !\n"); 151 + goto fail; 152 + } 153 + via = ioremap(taddr, 0x2000); 154 + if (via == NULL) { 155 + printk(KERN_ERR "via-cuda: Can't map address !\n"); 156 + goto fail; 157 + } 163 158 164 159 cuda_state = idle; 165 160 sys_ctrler = SYS_CTRLER_CUDA; ··· 180 185 cuda_poll(); 181 186 182 187 return 1; 188 + 189 + fail: 190 + of_node_put(vias); 191 + vias = NULL; 192 + return 0; 183 193 } 184 194 #endif /* CONFIG_PPC */ 185 195
+55 -32
drivers/macintosh/via-pmu.c
··· 147 147 static int pmu_kind = PMU_UNKNOWN; 148 148 static int pmu_fully_inited = 0; 149 149 static int pmu_has_adb; 150 + static struct device_node *gpio_node; 150 151 static unsigned char __iomem *gpio_reg = NULL; 151 152 static int gpio_irq = -1; 152 153 static int gpio_irq_enabled = -1; ··· 296 295 }; 297 296 #endif /* CONFIG_PMAC_BACKLIGHT */ 298 297 299 - int 300 - find_via_pmu(void) 298 + int __init find_via_pmu(void) 301 299 { 300 + phys_addr_t taddr; 301 + u32 *reg; 302 + 302 303 if (via != 0) 303 304 return 1; 304 - vias = find_devices("via-pmu"); 305 - if (vias == 0) 305 + vias = of_find_node_by_name(NULL, "via-pmu"); 306 + if (vias == NULL) 306 307 return 0; 307 - if (vias->next != 0) 308 - printk(KERN_WARNING "Warning: only using 1st via-pmu\n"); 309 308 310 - if (vias->n_addrs < 1 || vias->n_intrs < 1) { 311 - printk(KERN_ERR "via-pmu: %d addresses, %d interrupts!\n", 312 - vias->n_addrs, vias->n_intrs); 313 - if (vias->n_addrs < 1 || vias->n_intrs < 1) 314 - return 0; 309 + reg = (u32 *)get_property(vias, "reg", NULL); 310 + if (reg == NULL) { 311 + printk(KERN_ERR "via-pmu: No \"reg\" property !\n"); 312 + goto fail; 313 + } 314 + taddr = of_translate_address(vias, reg); 315 + if (taddr == 0) { 316 + printk(KERN_ERR "via-pmu: Can't translate address !\n"); 317 + goto fail; 315 318 } 316 319 317 320 spin_lock_init(&pmu_lock); ··· 336 331 pmu_kind = PMU_HEATHROW_BASED; 337 332 else if (device_is_compatible(vias->parent, "Keylargo") 338 333 || device_is_compatible(vias->parent, "K2-Keylargo")) { 339 - struct device_node *gpio, *gpiop; 334 + struct device_node *gpiop; 335 + phys_addr_t gaddr = 0; 340 336 341 337 pmu_kind = PMU_KEYLARGO_BASED; 342 338 pmu_has_adb = (find_type_devices("adb") != NULL); ··· 347 341 PMU_INT_TICK | 348 342 PMU_INT_ENVIRONMENT; 349 343 350 - gpiop = find_devices("gpio"); 351 - if (gpiop && gpiop->n_addrs) { 352 - gpio_reg = ioremap(gpiop->addrs->address, 0x10); 353 - gpio = find_devices("extint-gpio1"); 354 - if (gpio == NULL) 355 - gpio = find_devices("pmu-interrupt"); 356 - if (gpio && gpio->parent == gpiop && gpio->n_intrs) 357 - gpio_irq = gpio->intrs[0].line; 344 + gpiop = of_find_node_by_name(NULL, "gpio"); 345 + if (gpiop) { 346 + reg = (u32 *)get_property(gpiop, "reg", NULL); 347 + if (reg) 348 + gaddr = of_translate_address(gpiop, reg); 349 + if (gaddr != 0) 350 + gpio_reg = ioremap(gaddr, 0x10); 358 351 } 352 + if (gpio_reg == NULL) 353 + printk(KERN_ERR "via-pmu: Can't find GPIO reg !\n"); 359 354 } else 360 355 pmu_kind = PMU_UNKNOWN; 361 356 362 - via = ioremap(vias->addrs->address, 0x2000); 357 + via = ioremap(taddr, 0x2000); 358 + if (via == NULL) { 359 + printk(KERN_ERR "via-pmu: Can't map address !\n"); 360 + goto fail; 361 + } 363 362 364 363 out_8(&via[IER], IER_CLR | 0x7f); /* disable all intrs */ 365 364 out_8(&via[IFR], 0x7f); /* clear IFR */ ··· 382 371 sys_ctrler = SYS_CTRLER_PMU; 383 372 384 373 return 1; 374 + fail: 375 + of_node_put(vias); 376 + vias = NULL; 377 + return 0; 385 378 } 386 379 387 380 #ifdef CONFIG_ADB 388 - static int 389 - pmu_probe(void) 381 + static int pmu_probe(void) 390 382 { 391 383 return vias == NULL? -ENODEV: 0; 392 384 } 393 385 394 - static int __init 395 - pmu_init(void) 386 + static int __init pmu_init(void) 396 387 { 397 388 if (vias == NULL) 398 389 return -ENODEV; ··· 418 405 bright_req_2.complete = 1; 419 406 batt_req.complete = 1; 420 407 421 - #if defined(CONFIG_PPC32) && !defined(CONFIG_PPC_MERGE) 408 + #ifndef CONFIG_PPC_MERGE 422 409 if (pmu_kind == PMU_KEYLARGO_BASED) 423 410 openpic_set_irq_priority(vias->intrs[0].line, 424 411 OPENPIC_PRIORITY_DEFAULT + 1); ··· 431 418 return -EAGAIN; 432 419 } 433 420 434 - if (pmu_kind == PMU_KEYLARGO_BASED && gpio_irq != -1) { 435 - if (request_irq(gpio_irq, gpio1_interrupt, 0, "GPIO1 ADB", (void *)0)) 436 - printk(KERN_ERR "pmu: can't get irq %d (GPIO1)\n", gpio_irq); 437 - gpio_irq_enabled = 1; 421 + if (pmu_kind == PMU_KEYLARGO_BASED) { 422 + gpio_node = of_find_node_by_name(NULL, "extint-gpio1"); 423 + if (gpio_node == NULL) 424 + gpio_node = of_find_node_by_name(NULL, 425 + "pmu-interrupt"); 426 + if (gpio_node && gpio_node->n_intrs > 0) 427 + gpio_irq = gpio_node->intrs[0].line; 428 + 429 + if (gpio_irq != -1) { 430 + if (request_irq(gpio_irq, gpio1_interrupt, 0, 431 + "GPIO1 ADB", (void *)0)) 432 + printk(KERN_ERR "pmu: can't get irq %d" 433 + " (GPIO1)\n", gpio_irq); 434 + else 435 + gpio_irq_enabled = 1; 436 + } 438 437 } 439 438 440 439 /* Enable interrupts */ ··· 1396 1371 } 1397 1372 pmu_done(req); 1398 1373 } else { 1399 - #if defined(CONFIG_XMON) && !defined(CONFIG_PPC64) 1400 1374 if (len == 4 && data[1] == 0x2c) { 1401 1375 extern int xmon_wants_key, xmon_adb_keycode; 1402 1376 if (xmon_wants_key) { ··· 1403 1379 return; 1404 1380 } 1405 1381 } 1406 - #endif /* defined(CONFIG_XMON) && !defined(CONFIG_PPC64) */ 1407 1382 #ifdef CONFIG_ADB 1408 1383 /* 1409 1384 * XXX On the [23]400 the PMU gives us an up
+10 -9
include/asm-powerpc/btext.h
··· 7 7 #define __PPC_BTEXT_H 8 8 #ifdef __KERNEL__ 9 9 10 - extern void btext_clearscreen(void); 11 - extern void btext_flushscreen(void); 12 - 13 - extern int boot_text_mapped; 14 - 15 - extern int btext_initialize(struct device_node *np); 16 - 17 - extern void map_boot_text(void); 18 - extern void init_boot_display(void); 10 + extern int btext_find_display(int allow_nonstdout); 19 11 extern void btext_update_display(unsigned long phys, int width, int height, 20 12 int depth, int pitch); 13 + extern void btext_setup_display(int width, int height, int depth, int pitch, 14 + unsigned long address); 15 + extern void btext_prepare_BAT(void); 16 + extern void btext_unmap(void); 21 17 22 18 extern void btext_drawchar(char c); 23 19 extern void btext_drawstring(const char *str); 24 20 extern void btext_drawhex(unsigned long v); 21 + extern void btext_drawtext(const char *c, unsigned int len); 22 + 23 + extern void btext_clearscreen(void); 24 + extern void btext_flushscreen(void); 25 + extern void btext_flushline(void); 25 26 26 27 #endif /* __KERNEL__ */ 27 28 #endif /* __PPC_BTEXT_H */
+6 -3
include/asm-powerpc/udbg.h
··· 13 13 #include <linux/compiler.h> 14 14 #include <linux/init.h> 15 15 16 - extern void (*udbg_putc)(unsigned char c); 17 - extern unsigned char (*udbg_getc)(void); 16 + extern void (*udbg_putc)(char c); 17 + extern char (*udbg_getc)(void); 18 18 extern int (*udbg_getc_poll)(void); 19 19 20 20 extern void udbg_puts(const char *s); ··· 30 30 unsigned int clock); 31 31 32 32 struct device_node; 33 - extern void udbg_init_scc(struct device_node *np); 33 + extern void udbg_scc_init(int force_scc); 34 + extern int udbg_adb_init(int force_btext); 35 + extern void udbg_adb_init_early(void); 36 + 34 37 #endif /* _ASM_POWERPC_UDBG_H */
+1 -1
include/asm-ppc/btext.h
··· 17 17 extern boot_infos_t disp_bi; 18 18 extern int boot_text_mapped; 19 19 20 - extern void init_boot_display(void); 20 + extern void btext_init(boot_infos_t *bi); 21 21 extern void btext_welcome(void); 22 22 extern void btext_prepare_BAT(void); 23 23 extern void btext_setup_display(int width, int height, int depth, int pitch,
+3 -1
include/asm-ppc/machdep.h
··· 35 35 int (*get_irq)(struct pt_regs *); 36 36 37 37 /* A general init function, called by ppc_init in init/main.c. 38 - May be NULL. */ 38 + May be NULL. DEPRECATED ! */ 39 39 void (*init)(void); 40 + /* For compatibility with merged platforms */ 41 + void (*init_early)(void); 40 42 41 43 void (*restart)(char *cmd); 42 44 void (*power_off)(void);