[ARM] Remove EPXA10DB machine support
[linux-2.6/linux-loongson.git] / arch / ppc / platforms / apus_setup.c
blob2f74fde98ebc68276aacd92f507bbe9ca7362808
1 /*
2 * arch/ppc/platforms/apus_setup.c
4 * Copyright (C) 1998, 1999 Jesper Skov
6 * Basically what is needed to replace functionality found in
7 * arch/m68k allowing Amiga drivers to work under APUS.
8 * Bits of code and/or ideas from arch/m68k and arch/ppc files.
10 * TODO:
11 * This file needs a *really* good cleanup. Restructure and optimize.
12 * Make sure it can be compiled for non-APUS configs. Begin to move
13 * Amiga specific stuff into mach/amiga.
16 #include <linux/config.h>
17 #include <linux/kernel.h>
18 #include <linux/sched.h>
19 #include <linux/init.h>
20 #include <linux/initrd.h>
21 #include <linux/seq_file.h>
23 /* Needs INITSERIAL call in head.S! */
24 #undef APUS_DEBUG
26 #include <asm/bootinfo.h>
27 #include <asm/setup.h>
28 #include <asm/amigahw.h>
29 #include <asm/amigaints.h>
30 #include <asm/amigappc.h>
31 #include <asm/pgtable.h>
32 #include <asm/dma.h>
33 #include <asm/machdep.h>
34 #include <asm/time.h>
36 unsigned long m68k_machtype;
37 char debug_device[6] = "";
39 extern void amiga_init_IRQ(void);
41 extern void apus_setup_pci_ptrs(void);
43 void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *)) __initdata = NULL;
44 /* machine dependent irq functions */
45 void (*mach_init_IRQ) (void) __initdata = NULL;
46 void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *) = NULL;
47 void (*mach_get_model) (char *model) = NULL;
48 int (*mach_get_hardware_list) (char *buffer) = NULL;
49 int (*mach_get_irq_list) (struct seq_file *, void *) = NULL;
50 void (*mach_process_int) (int, struct pt_regs *) = NULL;
51 /* machine dependent timer functions */
52 unsigned long (*mach_gettimeoffset) (void);
53 void (*mach_gettod) (int*, int*, int*, int*, int*, int*);
54 int (*mach_hwclk) (int, struct hwclk_time*) = NULL;
55 int (*mach_set_clock_mmss) (unsigned long) = NULL;
56 void (*mach_reset)( void );
57 long mach_max_dma_address = 0x00ffffff; /* default set to the lower 16MB */
58 #if defined(CONFIG_AMIGA_FLOPPY)
59 void (*mach_floppy_setup) (char *, int *) __initdata = NULL;
60 #endif
61 #ifdef CONFIG_HEARTBEAT
62 void (*mach_heartbeat) (int) = NULL;
63 extern void apus_heartbeat (void);
64 #endif
66 extern unsigned long amiga_model;
67 extern unsigned decrementer_count;/* count value for 1e6/HZ microseconds */
68 extern unsigned count_period_num; /* 1 decrementer count equals */
69 extern unsigned count_period_den; /* count_period_num / count_period_den us */
71 int num_memory = 0;
72 struct mem_info memory[NUM_MEMINFO];/* memory description */
73 /* FIXME: Duplicate memory data to avoid conflicts with m68k shared code. */
74 int m68k_realnum_memory = 0;
75 struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */
77 struct mem_info ramdisk;
79 extern void amiga_floppy_setup(char *, int *);
80 extern void config_amiga(void);
82 static int __60nsram = 0;
84 /* for cpuinfo */
85 static int __bus_speed = 0;
86 static int __speed_test_failed = 0;
88 /********************************************** COMPILE PROTECTION */
89 /* Provide some stubs that links to Amiga specific functions.
90 * This allows CONFIG_APUS to be removed from generic PPC files while
91 * preventing link errors for other PPC targets.
93 unsigned long apus_get_rtc_time(void)
95 #ifdef CONFIG_APUS
96 extern unsigned long m68k_get_rtc_time(void);
98 return m68k_get_rtc_time ();
99 #else
100 return 0;
101 #endif
104 int apus_set_rtc_time(unsigned long nowtime)
106 #ifdef CONFIG_APUS
107 extern int m68k_set_rtc_time(unsigned long nowtime);
109 return m68k_set_rtc_time (nowtime);
110 #else
111 return 0;
112 #endif
115 /*********************************************************** SETUP */
116 /* From arch/m68k/kernel/setup.c. */
117 void __init apus_setup_arch(void)
119 #ifdef CONFIG_APUS
120 extern char cmd_line[];
121 int i;
122 char *p, *q;
124 /* Let m68k-shared code know it should do the Amiga thing. */
125 m68k_machtype = MACH_AMIGA;
127 /* Parse the command line for arch-specific options.
128 * For the m68k, this is currently only "debug=xxx" to enable printing
129 * certain kernel messages to some machine-specific device. */
130 for( p = cmd_line; p && *p; ) {
131 i = 0;
132 if (!strncmp( p, "debug=", 6 )) {
133 strlcpy( debug_device, p+6, sizeof(debug_device) );
134 if ((q = strchr( debug_device, ' ' ))) *q = 0;
135 i = 1;
136 } else if (!strncmp( p, "60nsram", 7 )) {
137 APUS_WRITE (APUS_REG_WAITSTATE,
138 REGWAITSTATE_SETRESET
139 |REGWAITSTATE_PPCR
140 |REGWAITSTATE_PPCW);
141 __60nsram = 1;
142 i = 1;
145 if (i) {
146 /* option processed, delete it */
147 if ((q = strchr( p, ' ' )))
148 strcpy( p, q+1 );
149 else
150 *p = 0;
151 } else {
152 if ((p = strchr( p, ' ' ))) ++p;
156 config_amiga();
158 #if 0 /* Enable for logging - also include logging.o in Makefile rule */
160 #define LOG_SIZE 4096
161 void* base;
163 /* Throw away some memory - the P5 firmare stomps on top
164 * of CHIP memory during bootup.
166 amiga_chip_alloc(0x1000);
168 base = amiga_chip_alloc(LOG_SIZE+sizeof(klog_data_t));
169 LOG_INIT(base, base+sizeof(klog_data_t), LOG_SIZE);
171 #endif
172 #endif
176 apus_show_cpuinfo(struct seq_file *m)
178 extern int __map_without_bats;
179 extern unsigned long powerup_PCI_present;
181 seq_printf(m, "machine\t\t: Amiga\n");
182 seq_printf(m, "bus speed\t: %d%s", __bus_speed,
183 (__speed_test_failed) ? " [failed]\n" : "\n");
184 seq_printf(m, "using BATs\t: %s\n",
185 (__map_without_bats) ? "No" : "Yes");
186 seq_printf(m, "ram speed\t: %dns\n", (__60nsram) ? 60 : 70);
187 seq_printf(m, "PCI bridge\t: %s\n",
188 (powerup_PCI_present) ? "Yes" : "No");
189 return 0;
192 static void get_current_tb(unsigned long long *time)
194 __asm __volatile ("1:mftbu 4 \n\t"
195 " mftb 5 \n\t"
196 " mftbu 6 \n\t"
197 " cmpw 4,6 \n\t"
198 " bne 1b \n\t"
199 " stw 4,0(%0)\n\t"
200 " stw 5,4(%0)\n\t"
202 : "r" (time)
203 : "r4", "r5", "r6");
207 void apus_calibrate_decr(void)
209 #ifdef CONFIG_APUS
210 unsigned long freq;
212 /* This algorithm for determining the bus speed was
213 contributed by Ralph Schmidt. */
214 unsigned long long start, stop;
215 int bus_speed;
216 int speed_test_failed = 0;
219 unsigned long loop = amiga_eclock / 10;
221 get_current_tb (&start);
222 while (loop--) {
223 unsigned char tmp;
225 tmp = ciaa.pra;
227 get_current_tb (&stop);
230 bus_speed = (((unsigned long)(stop-start))*10*4) / 1000000;
231 if (AMI_1200 == amiga_model)
232 bus_speed /= 2;
234 if ((bus_speed >= 47) && (bus_speed < 53)) {
235 bus_speed = 50;
236 freq = 12500000;
237 } else if ((bus_speed >= 57) && (bus_speed < 63)) {
238 bus_speed = 60;
239 freq = 15000000;
240 } else if ((bus_speed >= 63) && (bus_speed < 69)) {
241 bus_speed = 67;
242 freq = 16666667;
243 } else {
244 printk ("APUS: Unable to determine bus speed (%d). "
245 "Defaulting to 50MHz", bus_speed);
246 bus_speed = 50;
247 freq = 12500000;
248 speed_test_failed = 1;
251 /* Ease diagnostics... */
253 extern int __map_without_bats;
254 extern unsigned long powerup_PCI_present;
256 printk ("APUS: BATs=%d, BUS=%dMHz",
257 (__map_without_bats) ? 0 : 1,
258 bus_speed);
259 if (speed_test_failed)
260 printk ("[FAILED - please report]");
262 printk (", RAM=%dns, PCI bridge=%d\n",
263 (__60nsram) ? 60 : 70,
264 (powerup_PCI_present) ? 1 : 0);
266 /* print a bit more if asked politely... */
267 if (!(ciaa.pra & 0x40)){
268 extern unsigned int bat_addrs[4][3];
269 int b;
270 for (b = 0; b < 4; ++b) {
271 printk ("APUS: BAT%d ", b);
272 printk ("%08x-%08x -> %08x\n",
273 bat_addrs[b][0],
274 bat_addrs[b][1],
275 bat_addrs[b][2]);
281 printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
282 freq/1000000, freq%1000000);
283 tb_ticks_per_jiffy = freq / HZ;
284 tb_to_us = mulhwu_scale_factor(freq, 1000000);
286 __bus_speed = bus_speed;
287 __speed_test_failed = speed_test_failed;
288 #endif
291 void arch_gettod(int *year, int *mon, int *day, int *hour,
292 int *min, int *sec)
294 #ifdef CONFIG_APUS
295 if (mach_gettod)
296 mach_gettod(year, mon, day, hour, min, sec);
297 else
298 *year = *mon = *day = *hour = *min = *sec = 0;
299 #endif
302 /* for "kbd-reset" cmdline param */
303 __init
304 void kbd_reset_setup(char *str, int *ints)
308 /*********************************************************** FLOPPY */
309 #if defined(CONFIG_AMIGA_FLOPPY)
310 __init
311 void floppy_setup(char *str, int *ints)
313 if (mach_floppy_setup)
314 mach_floppy_setup (str, ints);
316 #endif
318 /*********************************************************** MEMORY */
319 #define KMAP_MAX 32
320 unsigned long kmap_chunks[KMAP_MAX*3];
321 int kmap_chunk_count = 0;
323 /* From pgtable.h */
324 static __inline__ pte_t *my_find_pte(struct mm_struct *mm,unsigned long va)
326 pgd_t *dir = 0;
327 pmd_t *pmd = 0;
328 pte_t *pte = 0;
330 va &= PAGE_MASK;
332 dir = pgd_offset( mm, va );
333 if (dir)
335 pmd = pmd_offset(dir, va & PAGE_MASK);
336 if (pmd && pmd_present(*pmd))
338 pte = pte_offset(pmd, va);
341 return pte;
345 /* Again simulating an m68k/mm/kmap.c function. */
346 void kernel_set_cachemode( unsigned long address, unsigned long size,
347 unsigned int cmode )
349 unsigned long mask, flags;
351 switch (cmode)
353 case IOMAP_FULL_CACHING:
354 mask = ~(_PAGE_NO_CACHE | _PAGE_GUARDED);
355 flags = 0;
356 break;
357 case IOMAP_NOCACHE_SER:
358 mask = ~0;
359 flags = (_PAGE_NO_CACHE | _PAGE_GUARDED);
360 break;
361 default:
362 panic ("kernel_set_cachemode() doesn't support mode %d\n",
363 cmode);
364 break;
367 size /= PAGE_SIZE;
368 address &= PAGE_MASK;
369 while (size--)
371 pte_t *pte;
373 pte = my_find_pte(&init_mm, address);
374 if ( !pte )
376 printk("pte NULL in kernel_set_cachemode()\n");
377 return;
380 pte_val (*pte) &= mask;
381 pte_val (*pte) |= flags;
382 flush_tlb_page(find_vma(&init_mm,address),address);
384 address += PAGE_SIZE;
388 unsigned long mm_ptov (unsigned long paddr)
390 unsigned long ret;
391 if (paddr < 16*1024*1024)
392 ret = ZTWO_VADDR(paddr);
393 else {
394 int i;
396 for (i = 0; i < kmap_chunk_count;){
397 unsigned long phys = kmap_chunks[i++];
398 unsigned long size = kmap_chunks[i++];
399 unsigned long virt = kmap_chunks[i++];
400 if (paddr >= phys
401 && paddr < (phys + size)){
402 ret = virt + paddr - phys;
403 goto exit;
407 ret = (unsigned long) __va(paddr);
409 exit:
410 #ifdef DEBUGPV
411 printk ("PTOV(%lx)=%lx\n", paddr, ret);
412 #endif
413 return ret;
416 int mm_end_of_chunk (unsigned long addr, int len)
418 if (memory[0].addr + memory[0].size == addr + len)
419 return 1;
420 return 0;
423 /*********************************************************** CACHE */
425 #define L1_CACHE_BYTES 32
426 #define MAX_CACHE_SIZE 8192
427 void cache_push(__u32 addr, int length)
429 addr = mm_ptov(addr);
431 if (MAX_CACHE_SIZE < length)
432 length = MAX_CACHE_SIZE;
434 while(length > 0){
435 __asm ("dcbf 0,%0\n\t"
436 : : "r" (addr));
437 addr += L1_CACHE_BYTES;
438 length -= L1_CACHE_BYTES;
440 /* Also flush trailing block */
441 __asm ("dcbf 0,%0\n\t"
442 "sync \n\t"
443 : : "r" (addr));
446 void cache_clear(__u32 addr, int length)
448 if (MAX_CACHE_SIZE < length)
449 length = MAX_CACHE_SIZE;
451 addr = mm_ptov(addr);
453 __asm ("dcbf 0,%0\n\t"
454 "sync \n\t"
455 "icbi 0,%0 \n\t"
456 "isync \n\t"
457 : : "r" (addr));
459 addr += L1_CACHE_BYTES;
460 length -= L1_CACHE_BYTES;
462 while(length > 0){
463 __asm ("dcbf 0,%0\n\t"
464 "sync \n\t"
465 "icbi 0,%0 \n\t"
466 "isync \n\t"
467 : : "r" (addr));
468 addr += L1_CACHE_BYTES;
469 length -= L1_CACHE_BYTES;
472 __asm ("dcbf 0,%0\n\t"
473 "sync \n\t"
474 "icbi 0,%0 \n\t"
475 "isync \n\t"
476 : : "r" (addr));
479 /****************************************************** from setup.c */
480 void
481 apus_restart(char *cmd)
483 local_irq_disable();
485 APUS_WRITE(APUS_REG_LOCK,
486 REGLOCK_BLACKMAGICK1|REGLOCK_BLACKMAGICK2);
487 APUS_WRITE(APUS_REG_LOCK,
488 REGLOCK_BLACKMAGICK1|REGLOCK_BLACKMAGICK3);
489 APUS_WRITE(APUS_REG_LOCK,
490 REGLOCK_BLACKMAGICK2|REGLOCK_BLACKMAGICK3);
491 APUS_WRITE(APUS_REG_SHADOW, REGSHADOW_SELFRESET);
492 APUS_WRITE(APUS_REG_RESET, REGRESET_AMIGARESET);
493 for(;;);
496 void
497 apus_power_off(void)
499 for (;;);
502 void
503 apus_halt(void)
505 apus_restart(NULL);
508 /****************************************************** IRQ stuff */
510 static unsigned char last_ipl[8];
512 int apus_get_irq(struct pt_regs* regs)
514 unsigned char ipl_emu, mask;
515 unsigned int level;
517 APUS_READ(APUS_IPL_EMU, ipl_emu);
518 level = (ipl_emu >> 3) & IPLEMU_IPLMASK;
519 mask = IPLEMU_SETRESET|IPLEMU_DISABLEINT|level;
520 level ^= 7;
522 /* Save previous IPL value */
523 if (last_ipl[level])
524 return -2;
525 last_ipl[level] = ipl_emu;
527 /* Set to current IPL value */
528 APUS_WRITE(APUS_IPL_EMU, mask);
529 APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT|level);
532 #ifdef __INTERRUPT_DEBUG
533 printk("<%d:%d>", level, ~ipl_emu & IPLEMU_IPLMASK);
534 #endif
535 return level + IRQ_AMIGA_AUTO;
538 void apus_end_irq(unsigned int irq)
540 unsigned char ipl_emu;
541 unsigned int level = irq - IRQ_AMIGA_AUTO;
542 #ifdef __INTERRUPT_DEBUG
543 printk("{%d}", ~last_ipl[level] & IPLEMU_IPLMASK);
544 #endif
545 /* Restore IPL to the previous value */
546 ipl_emu = last_ipl[level] & IPLEMU_IPLMASK;
547 APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET|IPLEMU_DISABLEINT|ipl_emu);
548 last_ipl[level] = 0;
549 ipl_emu ^= 7;
550 APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT|ipl_emu);
553 /****************************************************** debugging */
555 /* some serial hardware definitions */
556 #define SDR_OVRUN (1<<15)
557 #define SDR_RBF (1<<14)
558 #define SDR_TBE (1<<13)
559 #define SDR_TSRE (1<<12)
561 #define AC_SETCLR (1<<15)
562 #define AC_UARTBRK (1<<11)
564 #define SER_DTR (1<<7)
565 #define SER_RTS (1<<6)
566 #define SER_DCD (1<<5)
567 #define SER_CTS (1<<4)
568 #define SER_DSR (1<<3)
570 static __inline__ void ser_RTSon(void)
572 ciab.pra &= ~SER_RTS; /* active low */
575 int __debug_ser_out( unsigned char c )
577 custom.serdat = c | 0x100;
578 mb();
579 while (!(custom.serdatr & 0x2000))
580 barrier();
581 return 1;
584 unsigned char __debug_ser_in( void )
586 unsigned char c;
588 /* XXX: is that ok?? derived from amiga_ser.c... */
589 while( !(custom.intreqr & IF_RBF) )
590 barrier();
591 c = custom.serdatr;
592 /* clear the interrupt, so that another character can be read */
593 custom.intreq = IF_RBF;
594 return c;
597 int __debug_serinit( void )
599 unsigned long flags;
601 local_irq_save(flags);
603 /* turn off Rx and Tx interrupts */
604 custom.intena = IF_RBF | IF_TBE;
606 /* clear any pending interrupt */
607 custom.intreq = IF_RBF | IF_TBE;
609 local_irq_restore(flags);
612 * set the appropriate directions for the modem control flags,
613 * and clear RTS and DTR
615 ciab.ddra |= (SER_DTR | SER_RTS); /* outputs */
616 ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */
618 #ifdef CONFIG_KGDB
619 /* turn Rx interrupts on for GDB */
620 custom.intena = IF_SETCLR | IF_RBF;
621 ser_RTSon();
622 #endif
624 return 0;
627 void __debug_print_hex(unsigned long x)
629 int i;
630 char hexchars[] = "0123456789ABCDEF";
632 for (i = 0; i < 8; i++) {
633 __debug_ser_out(hexchars[(x >> 28) & 15]);
634 x <<= 4;
636 __debug_ser_out('\n');
637 __debug_ser_out('\r');
640 void __debug_print_string(char* s)
642 unsigned char c;
643 while((c = *s++))
644 __debug_ser_out(c);
645 __debug_ser_out('\n');
646 __debug_ser_out('\r');
649 static void apus_progress(char *s, unsigned short value)
651 __debug_print_string(s);
654 /****************************************************** init */
656 /* The number of spurious interrupts */
657 volatile unsigned int num_spurious;
659 extern struct irqaction amiga_sys_irqaction[AUTO_IRQS];
662 extern void amiga_enable_irq(unsigned int irq);
663 extern void amiga_disable_irq(unsigned int irq);
665 struct hw_interrupt_type amiga_sys_irqctrl = {
666 .typename = "Amiga IPL",
667 .end = apus_end_irq,
670 struct hw_interrupt_type amiga_irqctrl = {
671 .typename = "Amiga ",
672 .enable = amiga_enable_irq,
673 .disable = amiga_disable_irq,
676 #define HARDWARE_MAPPED_SIZE (512*1024)
677 unsigned long __init apus_find_end_of_memory(void)
679 int shadow = 0;
680 unsigned long total;
682 /* The memory size reported by ADOS excludes the 512KB
683 reserved for PPC exception registers and possibly 512KB
684 containing a shadow of the ADOS ROM. */
686 unsigned long size = memory[0].size;
688 /* If 2MB aligned, size was probably user
689 specified. We can't tell anything about shadowing
690 in this case so skip shadow assignment. */
691 if (0 != (size & 0x1fffff)){
692 /* Align to 512KB to ensure correct handling
693 of both memfile and system specified
694 sizes. */
695 size = ((size+0x0007ffff) & 0xfff80000);
696 /* If memory is 1MB aligned, assume
697 shadowing. */
698 shadow = !(size & 0x80000);
701 /* Add the chunk that ADOS does not see. by aligning
702 the size to the nearest 2MB limit upwards. */
703 memory[0].size = ((size+0x001fffff) & 0xffe00000);
706 ppc_memstart = memory[0].addr;
707 ppc_memoffset = PAGE_OFFSET - PPC_MEMSTART;
708 total = memory[0].size;
710 /* Remove the memory chunks that are controlled by special
711 Phase5 hardware. */
713 /* Remove the upper 512KB if it contains a shadow of
714 the ADOS ROM. FIXME: It might be possible to
715 disable this shadow HW. Check the booter
716 (ppc_boot.c) */
717 if (shadow)
718 total -= HARDWARE_MAPPED_SIZE;
720 /* Remove the upper 512KB where the PPC exception
721 vectors are mapped. */
722 total -= HARDWARE_MAPPED_SIZE;
724 /* Linux/APUS only handles one block of memory -- the one on
725 the PowerUP board. Other system memory is horrible slow in
726 comparison. The user can use other memory for swapping
727 using the z2ram device. */
728 return total;
731 static void __init
732 apus_map_io(void)
734 /* Map PPC exception vectors. */
735 io_block_mapping(0xfff00000, 0xfff00000, 0x00020000, _PAGE_KERNEL);
736 /* Map chip and ZorroII memory */
737 io_block_mapping(zTwoBase, 0x00000000, 0x01000000, _PAGE_IO);
740 __init
741 void apus_init_IRQ(void)
743 struct irqaction *action;
744 int i;
746 #ifdef CONFIG_PCI
747 apus_setup_pci_ptrs();
748 #endif
750 for ( i = 0 ; i < AMI_IRQS; i++ ) {
751 irq_desc[i].status = IRQ_LEVEL;
752 if (i < IRQ_AMIGA_AUTO) {
753 irq_desc[i].handler = &amiga_irqctrl;
754 } else {
755 irq_desc[i].handler = &amiga_sys_irqctrl;
756 action = &amiga_sys_irqaction[i-IRQ_AMIGA_AUTO];
757 if (action->name)
758 setup_irq(i, action);
762 amiga_init_IRQ();
766 __init
767 void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
768 unsigned long r6, unsigned long r7)
770 extern int parse_bootinfo(const struct bi_record *);
771 extern char _end[];
773 /* Parse bootinfo. The bootinfo is located right after
774 the kernel bss */
775 parse_bootinfo((const struct bi_record *)&_end);
776 #ifdef CONFIG_BLK_DEV_INITRD
777 /* Take care of initrd if we have one. Use data from
778 bootinfo to avoid the need to initialize PPC
779 registers when kernel is booted via a PPC reset. */
780 if ( ramdisk.addr ) {
781 initrd_start = (unsigned long) __va(ramdisk.addr);
782 initrd_end = (unsigned long)
783 __va(ramdisk.size + ramdisk.addr);
785 #endif /* CONFIG_BLK_DEV_INITRD */
787 ISA_DMA_THRESHOLD = 0x00ffffff;
789 ppc_md.setup_arch = apus_setup_arch;
790 ppc_md.show_cpuinfo = apus_show_cpuinfo;
791 ppc_md.init_IRQ = apus_init_IRQ;
792 ppc_md.get_irq = apus_get_irq;
794 #ifdef CONFIG_HEARTBEAT
795 ppc_md.heartbeat = apus_heartbeat;
796 ppc_md.heartbeat_count = 1;
797 #endif
798 #ifdef APUS_DEBUG
799 __debug_serinit();
800 ppc_md.progress = apus_progress;
801 #endif
802 ppc_md.init = NULL;
804 ppc_md.restart = apus_restart;
805 ppc_md.power_off = apus_power_off;
806 ppc_md.halt = apus_halt;
808 ppc_md.time_init = NULL;
809 ppc_md.set_rtc_time = apus_set_rtc_time;
810 ppc_md.get_rtc_time = apus_get_rtc_time;
811 ppc_md.calibrate_decr = apus_calibrate_decr;
813 ppc_md.find_end_of_memory = apus_find_end_of_memory;
814 ppc_md.setup_io_mappings = apus_map_io;