ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / ppc / platforms / k2.c
1 /*
2  * arch/ppc/platforms/k2.c
3  *
4  * Board setup routines for SBS K2
5  *
6  * Author: Matt Porter <mporter@mvista.com>
7  *
8  * Updated by: Randy Vinson <rvinson@mvista.com.
9  *
10  * 2001-2004 (c) MontaVista, Software, Inc.  This file is licensed under
11  * the terms of the GNU General Public License version 2.  This program
12  * is licensed "as is" without any warranty of any kind, whether express
13  * or implied.
14  */
15
16 #include <linux/config.h>
17 #include <linux/stddef.h>
18 #include <linux/kernel.h>
19 #include <linux/init.h>
20 #include <linux/errno.h>
21 #include <linux/reboot.h>
22 #include <linux/pci.h>
23 #include <linux/kdev_t.h>
24 #include <linux/types.h>
25 #include <linux/major.h>
26 #include <linux/initrd.h>
27 #include <linux/console.h>
28 #include <linux/delay.h>
29 #include <linux/ide.h>
30 #include <linux/irq.h>
31 #include <linux/seq_file.h>
32 #include <linux/root_dev.h>
33
34 #include <asm/system.h>
35 #include <asm/pgtable.h>
36 #include <asm/page.h>
37 #include <asm/dma.h>
38 #include <asm/io.h>
39 #include <asm/machdep.h>
40 #include <asm/time.h>
41 #include <asm/i8259.h>
42 #include <asm/todc.h>
43 #include <asm/bootinfo.h>
44
45 #include <syslib/cpc710.h>
46 #include "k2.h"
47
48 extern unsigned long loops_per_jiffy;
49 extern void gen550_progress(char *, unsigned short);
50
51 static unsigned int cpu_7xx[16] = {
52         0, 15, 14, 0, 0, 13, 5, 9, 6, 11, 8, 10, 16, 12, 7, 0
53 };
54 static unsigned int cpu_6xx[16] = {
55         0, 0, 14, 0, 0, 13, 5, 9, 6, 11, 8, 10, 0, 12, 7, 0
56 };
57
58 static inline int __init
59 k2_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
60 {
61         struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
62         /*
63          * Check our hose index.  If we are zero then we are on the
64          * local PCI hose, otherwise we are on the cPCI hose.
65          */
66         if (!hose->index) {
67                 static char pci_irq_table[][4] =
68                         /*
69                          *      PCI IDSEL/INTPIN->INTLINE
70                          *      A       B       C       D
71                          */
72                 {
73                         {1,     0,      0,      0},     /* Ethernet */
74                         {5,     5,      5,      5},     /* PMC Site 1 */
75                         {6,     6,      6,      6},     /* PMC Site 2 */
76                         {0,     0,      0,      0},     /* unused */
77                         {0,     0,      0,      0},     /* unused */
78                         {0,     0,      0,      0},     /* PCI-ISA Bridge */
79                         {0,     0,      0,      0},     /* unused */
80                         {0,     0,      0,      0},     /* unused */
81                         {0,     0,      0,      0},     /* unused */
82                         {0,     0,      0,      0},     /* unused */
83                         {0,     0,      0,      0},     /* unused */
84                         {0,     0,      0,      0},     /* unused */
85                         {0,     0,      0,      0},     /* unused */
86                         {0,     0,      0,      0},     /* unused */
87                         {15,    0,      0,      0},     /* M5229 IDE */
88                 };
89                 const long min_idsel = 3, max_idsel = 17, irqs_per_slot = 4;
90                 return PCI_IRQ_TABLE_LOOKUP;
91         } else {
92                 static char pci_irq_table[][4] =
93                 /*
94                  *      PCI IDSEL/INTPIN->INTLINE
95                  *      A       B       C       D
96                  */
97                 {
98                         {10,    11,     12,     9},     /* cPCI slot 8 */
99                         {11,    12,     9,      10},    /* cPCI slot 7 */
100                         {12,    9,      10,     11},    /* cPCI slot 6 */
101                         {9,     10,     11,     12},    /* cPCI slot 5 */
102                         {10,    11,     12,     9},     /* cPCI slot 4 */
103                         {11,    12,     9,      10},    /* cPCI slot 3 */
104                         {12,    9,      10,     11},    /* cPCI slot 2 */
105                 };
106                 const long min_idsel = 15, max_idsel = 21, irqs_per_slot = 4;
107                 return PCI_IRQ_TABLE_LOOKUP;
108         }
109 }
110
111 void k2_pcibios_fixup(void)
112 {
113 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
114         struct pci_dev *ide_dev;
115
116         /*
117          * Enable DMA support on hdc
118          */
119         ide_dev = pci_find_device(PCI_VENDOR_ID_AL,
120                                   PCI_DEVICE_ID_AL_M5229, NULL);
121
122         if (ide_dev) {
123
124                 unsigned long ide_dma_base;
125
126                 ide_dma_base = pci_resource_start(ide_dev, 4);
127                 outb(0x00, ide_dma_base + 0x2);
128                 outb(0x20, ide_dma_base + 0xa);
129         }
130 #endif
131 }
132
133 void k2_pcibios_fixup_resources(struct pci_dev *dev)
134 {
135         int i;
136
137         if ((dev->vendor == PCI_VENDOR_ID_IBM) &&
138             (dev->device == PCI_DEVICE_ID_IBM_CPC710_PCI64)) {
139                 pr_debug("Fixup CPC710 resources\n");
140                 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
141                         dev->resource[i].start = 0;
142                         dev->resource[i].end = 0;
143                 }
144         }
145 }
146
147 void k2_setup_hoses(void)
148 {
149         struct pci_controller *hose_a, *hose_b;
150
151         /*
152          * Reconfigure CPC710 memory map so
153          * we have some more PCI memory space.
154          */
155
156         /* Set FPHB mode */
157         __raw_writel(0x808000e0, PGCHP);        /* Set FPHB mode */
158
159         /* PCI32 mappings */
160         __raw_writel(0x00000000, K2_PCI32_BAR + PIBAR); /* PCI I/O base */
161         __raw_writel(0x00000000, K2_PCI32_BAR + PMBAR); /* PCI Mem base */
162         __raw_writel(0xf0000000, K2_PCI32_BAR + MSIZE); /* 256MB */
163         __raw_writel(0xfff00000, K2_PCI32_BAR + IOSIZE); /* 1MB */
164         __raw_writel(0xc0000000, K2_PCI32_BAR + SMBAR); /* Base@0xc0000000 */
165         __raw_writel(0x80000000, K2_PCI32_BAR + SIBAR); /* Base@0x80000000 */
166         __raw_writel(0x000000c0, K2_PCI32_BAR + PSSIZE); /* 1GB space */
167         __raw_writel(0x000000c0, K2_PCI32_BAR + PPSIZE); /* 1GB space */
168         __raw_writel(0x00000000, K2_PCI32_BAR + BARPS); /* Base@0x00000000 */
169         __raw_writel(0x00000000, K2_PCI32_BAR + BARPP); /* Base@0x00000000 */
170         __raw_writel(0x00000080, K2_PCI32_BAR + PSBAR); /* Base@0x80 */
171         __raw_writel(0x00000000, K2_PCI32_BAR + PPBAR);
172
173         __raw_writel(0xc0000000, K2_PCI32_BAR + BPMDLK);
174         __raw_writel(0xd0000000, K2_PCI32_BAR + TPMDLK);
175         __raw_writel(0x80000000, K2_PCI32_BAR + BIODLK);
176         __raw_writel(0x80100000, K2_PCI32_BAR + TIODLK);
177         __raw_writel(0xe0008000, K2_PCI32_BAR + DLKCTRL);
178         __raw_writel(0xffffffff, K2_PCI32_BAR + DLKDEV);
179
180         /* PCI64 mappings */
181         __raw_writel(0x00100000, K2_PCI64_BAR + PIBAR); /* PCI I/O base */
182         __raw_writel(0x10000000, K2_PCI64_BAR + PMBAR); /* PCI Mem base */
183         __raw_writel(0xf0000000, K2_PCI64_BAR + MSIZE); /* 256MB */
184         __raw_writel(0xfff00000, K2_PCI64_BAR + IOSIZE); /* 1MB */
185         __raw_writel(0xd0000000, K2_PCI64_BAR + SMBAR); /* Base@0xd0000000 */
186         __raw_writel(0x80100000, K2_PCI64_BAR + SIBAR); /* Base@0x80100000 */
187         __raw_writel(0x000000c0, K2_PCI64_BAR + PSSIZE); /* 1GB space */
188         __raw_writel(0x000000c0, K2_PCI64_BAR + PPSIZE); /* 1GB space */
189         __raw_writel(0x00000000, K2_PCI64_BAR + BARPS); /* Base@0x00000000 */
190         __raw_writel(0x00000000, K2_PCI64_BAR + BARPP); /* Base@0x00000000 */
191
192         /* Setup PCI32 hose */
193         hose_a = pcibios_alloc_controller();
194         if (!hose_a)
195                 return;
196
197         hose_a->first_busno = 0;
198         hose_a->last_busno = 0xff;
199         hose_a->pci_mem_offset = K2_PCI32_MEM_BASE;
200
201         pci_init_resource(&hose_a->io_resource,
202                           K2_PCI32_LOWER_IO,
203                           K2_PCI32_UPPER_IO,
204                           IORESOURCE_IO, "PCI32 host bridge");
205
206         pci_init_resource(&hose_a->mem_resources[0],
207                           K2_PCI32_LOWER_MEM + K2_PCI32_MEM_BASE,
208                           K2_PCI32_UPPER_MEM + K2_PCI32_MEM_BASE,
209                           IORESOURCE_MEM, "PCI32 host bridge");
210
211         hose_a->io_space.start = K2_PCI32_LOWER_IO;
212         hose_a->io_space.end = K2_PCI32_UPPER_IO;
213         hose_a->mem_space.start = K2_PCI32_LOWER_MEM;
214         hose_a->mem_space.end = K2_PCI32_UPPER_MEM;
215         hose_a->io_base_virt = (void *)K2_ISA_IO_BASE;
216
217         setup_indirect_pci(hose_a, K2_PCI32_CONFIG_ADDR, K2_PCI32_CONFIG_DATA);
218
219         /* Initialize PCI32 bus registers */
220         early_write_config_byte(hose_a,
221                                 hose_a->first_busno,
222                                 PCI_DEVFN(0, 0),
223                                 CPC710_BUS_NUMBER, hose_a->first_busno);
224
225         early_write_config_byte(hose_a,
226                                 hose_a->first_busno,
227                                 PCI_DEVFN(0, 0),
228                                 CPC710_SUB_BUS_NUMBER, hose_a->last_busno);
229
230         /* Enable PCI interrupt polling */
231         early_write_config_byte(hose_a,
232                                 hose_a->first_busno,
233                                 PCI_DEVFN(8, 0), 0x45, 0x80);
234
235         /* Route polled PCI interrupts */
236         early_write_config_byte(hose_a,
237                                 hose_a->first_busno,
238                                 PCI_DEVFN(8, 0), 0x48, 0x58);
239
240         early_write_config_byte(hose_a,
241                                 hose_a->first_busno,
242                                 PCI_DEVFN(8, 0), 0x49, 0x07);
243
244         early_write_config_byte(hose_a,
245                                 hose_a->first_busno,
246                                 PCI_DEVFN(8, 0), 0x4a, 0x31);
247
248         early_write_config_byte(hose_a,
249                                 hose_a->first_busno,
250                                 PCI_DEVFN(8, 0), 0x4b, 0xb9);
251
252         /* route secondary IDE channel interrupt to IRQ 15 */
253         early_write_config_byte(hose_a,
254                                 hose_a->first_busno,
255                                 PCI_DEVFN(8, 0), 0x75, 0x0f);
256
257         /* enable IDE controller IDSEL */
258         early_write_config_byte(hose_a,
259                                 hose_a->first_busno,
260                                 PCI_DEVFN(8, 0), 0x58, 0x48);
261
262         /* Enable IDE function */
263         early_write_config_byte(hose_a,
264                                 hose_a->first_busno,
265                                 PCI_DEVFN(17, 0), 0x50, 0x03);
266
267         /* Set M5229 IDE controller to native mode */
268         early_write_config_byte(hose_a,
269                                 hose_a->first_busno,
270                                 PCI_DEVFN(17, 0), PCI_CLASS_PROG, 0xdf);
271
272         hose_a->last_busno = pciauto_bus_scan(hose_a, hose_a->first_busno);
273
274         /* Write out correct max subordinate bus number for hose A */
275         early_write_config_byte(hose_a,
276                                 hose_a->first_busno,
277                                 PCI_DEVFN(0, 0),
278                                 CPC710_SUB_BUS_NUMBER, hose_a->last_busno);
279
280         /* Only setup PCI64 hose if we are in the system slot */
281         if (!(readb(K2_MISC_REG) & K2_SYS_SLOT_MASK)) {
282                 /* Setup PCI64 hose */
283                 hose_b = pcibios_alloc_controller();
284                 if (!hose_b)
285                         return;
286
287                 hose_b->first_busno = hose_a->last_busno + 1;
288                 hose_b->last_busno = 0xff;
289
290                 /* Reminder: quit changing the following, it is correct. */
291                 hose_b->pci_mem_offset = K2_PCI32_MEM_BASE;
292
293                 pci_init_resource(&hose_b->io_resource,
294                                   K2_PCI64_LOWER_IO,
295                                   K2_PCI64_UPPER_IO,
296                                   IORESOURCE_IO, "PCI64 host bridge");
297
298                 pci_init_resource(&hose_b->mem_resources[0],
299                                   K2_PCI64_LOWER_MEM + K2_PCI32_MEM_BASE,
300                                   K2_PCI64_UPPER_MEM + K2_PCI32_MEM_BASE,
301                                   IORESOURCE_MEM, "PCI64 host bridge");
302
303                 hose_b->io_space.start = K2_PCI64_LOWER_IO;
304                 hose_b->io_space.end = K2_PCI64_UPPER_IO;
305                 hose_b->mem_space.start = K2_PCI64_LOWER_MEM;
306                 hose_b->mem_space.end = K2_PCI64_UPPER_MEM;
307                 hose_b->io_base_virt = (void *)K2_ISA_IO_BASE;
308
309                 setup_indirect_pci(hose_b,
310                                    K2_PCI64_CONFIG_ADDR, K2_PCI64_CONFIG_DATA);
311
312                 /* Initialize PCI64 bus registers */
313                 early_write_config_byte(hose_b,
314                                         0,
315                                         PCI_DEVFN(0, 0),
316                                         CPC710_SUB_BUS_NUMBER, 0xff);
317
318                 early_write_config_byte(hose_b,
319                                         0,
320                                         PCI_DEVFN(0, 0),
321                                         CPC710_BUS_NUMBER, hose_b->first_busno);
322
323                 hose_b->last_busno = pciauto_bus_scan(hose_b,
324                                                       hose_b->first_busno);
325
326                 /* Write out correct max subordinate bus number for hose B */
327                 early_write_config_byte(hose_b,
328                                         hose_b->first_busno,
329                                         PCI_DEVFN(0, 0),
330                                         CPC710_SUB_BUS_NUMBER,
331                                         hose_b->last_busno);
332
333                 /* Configure PCI64 PSBAR */
334                 early_write_config_dword(hose_b,
335                                          hose_b->first_busno,
336                                          PCI_DEVFN(0, 0),
337                                          PCI_BASE_ADDRESS_0,
338                                          K2_PCI64_SYS_MEM_BASE);
339         }
340
341         /* Configure i8259 level/edge settings */
342         outb(0x62, 0x4d0);
343         outb(0xde, 0x4d1);
344
345 #ifdef CONFIG_CPC710_DATA_GATHERING
346         {
347                 unsigned int tmp;
348                 tmp = __raw_readl(ABCNTL);
349                 /* Enable data gathering on both PCI interfaces */
350                 __raw_writel(tmp | 0x05000000, ABCNTL);
351         }
352 #endif
353
354         ppc_md.pcibios_fixup = k2_pcibios_fixup;
355         ppc_md.pcibios_fixup_resources = k2_pcibios_fixup_resources;
356         ppc_md.pci_swizzle = common_swizzle;
357         ppc_md.pci_map_irq = k2_map_irq;
358 }
359
360 static int k2_get_bus_speed(void)
361 {
362         int bus_speed;
363         unsigned char board_id;
364
365         board_id = *(unsigned char *)K2_BOARD_ID_REG;
366
367         switch (K2_BUS_SPD(board_id)) {
368
369         case 0:
370         default:
371                 bus_speed = 100000000;
372                 break;
373
374         case 1:
375                 bus_speed = 83333333;
376                 break;
377
378         case 2:
379                 bus_speed = 75000000;
380                 break;
381
382         case 3:
383                 bus_speed = 66666666;
384                 break;
385         }
386         return bus_speed;
387 }
388
389 static int k2_get_cpu_speed(void)
390 {
391         unsigned long hid1;
392         int cpu_speed;
393
394         hid1 = mfspr(HID1) >> 28;
395
396         if ((mfspr(PVR) >> 16) == 8)
397                 hid1 = cpu_7xx[hid1];
398         else
399                 hid1 = cpu_6xx[hid1];
400
401         cpu_speed = k2_get_bus_speed() * hid1 / 2;
402         return cpu_speed;
403 }
404
405 static void __init k2_calibrate_decr(void)
406 {
407         int freq, divisor = 4;
408
409         /* determine processor bus speed */
410         freq = k2_get_bus_speed();
411         tb_ticks_per_jiffy = freq / HZ / divisor;
412         tb_to_us = mulhwu_scale_factor(freq / divisor, 1000000);
413 }
414
415 static int k2_show_cpuinfo(struct seq_file *m)
416 {
417         unsigned char k2_geo_bits, k2_system_slot;
418
419         seq_printf(m, "vendor\t\t: SBS\n");
420         seq_printf(m, "machine\t\t: K2\n");
421         seq_printf(m, "cpu speed\t: %dMhz\n", k2_get_cpu_speed() / 1000000);
422         seq_printf(m, "bus speed\t: %dMhz\n", k2_get_bus_speed() / 1000000);
423         seq_printf(m, "memory type\t: SDRAM\n");
424
425         k2_geo_bits = readb(K2_MSIZ_GEO_REG) & K2_GEO_ADR_MASK;
426         k2_system_slot = !(readb(K2_MISC_REG) & K2_SYS_SLOT_MASK);
427         seq_printf(m, "backplane\t: %s slot board",
428                    k2_system_slot ? "System" : "Non system");
429         seq_printf(m, "with geographical address %x\n", k2_geo_bits);
430
431         return 0;
432 }
433
434 TODC_ALLOC();
435
436 static void __init k2_setup_arch(void)
437 {
438         unsigned int cpu;
439
440         /* Setup TODC access */
441         TODC_INIT(TODC_TYPE_MK48T37, 0, 0,
442                   ioremap(K2_RTC_BASE_ADDRESS, K2_RTC_SIZE), 8);
443
444         /* init to some ~sane value until calibrate_delay() runs */
445         loops_per_jiffy = 50000000 / HZ;
446
447         /* make FLASH transactions higher priority than PCI to avoid deadlock */
448         __raw_writel(__raw_readl(SIOC1) | 0x80000000, SIOC1);
449
450         /* Set hardware to access FLASH page 2 */
451         __raw_writel(1 << 29, GPOUT);
452
453         /* Setup PCI host bridges */
454         k2_setup_hoses();
455
456 #ifdef CONFIG_BLK_DEV_INITRD
457         if (initrd_start)
458                 ROOT_DEV = Root_RAM0;
459         else
460 #endif
461 #ifdef CONFIG_ROOT_NFS
462                 ROOT_DEV = Root_NFS;
463 #else
464                 ROOT_DEV = Root_HDC1;
465 #endif
466
467 #ifdef CONFIG_DUMMY_CONSOLE
468         conswitchp = &dummy_con;
469 #endif
470
471         /* Identify the system */
472         printk(KERN_INFO "System Identification: SBS K2 - PowerPC 750 @ "
473                         "%d Mhz\n", k2_get_cpu_speed() / 1000000);
474         printk(KERN_INFO "Port by MontaVista Software, Inc. "
475                         "(source@mvista.com)\n");
476
477         /* Identify the CPU manufacturer */
478         cpu = PVR_REV(mfspr(PVR));
479         printk(KERN_INFO "CPU manufacturer: %s [rev=%04x]\n",
480                         (cpu & (1 << 15)) ? "IBM" : "Motorola", cpu);
481 }
482
483 static void k2_restart(char *cmd)
484 {
485         local_irq_disable();
486
487         /* Flip FLASH back to page 1 to access firmware image */
488         __raw_writel(0, GPOUT);
489
490         /* SRR0 has system reset vector, SRR1 has default MSR value */
491         /* rfi restores MSR from SRR1 and sets the PC to the SRR0 value */
492         mtspr(SRR0, 0xfff00100);
493         mtspr(SRR1, 0);
494         __asm__ __volatile__("rfi\n\t");
495
496         /* not reached */
497         for (;;) ;
498 }
499
500 static void k2_power_off(void)
501 {
502         for (;;) ;
503 }
504
505 static void k2_halt(void)
506 {
507         k2_restart(NULL);
508 }
509
510 /*
511  * Set BAT 3 to map PCI32 I/O space.
512  */
513 static __inline__ void k2_set_bat(void)
514 {
515         /* wait for all outstanding memory accesses to complete */
516         mb();
517
518         /* setup DBATs */
519         mtspr(DBAT2U, 0x80001ffe);
520         mtspr(DBAT2L, 0x8000002a);
521         mtspr(DBAT3U, 0xf0001ffe);
522         mtspr(DBAT3L, 0xf000002a);
523
524         /* wait for updates */
525         mb();
526 }
527
528 static unsigned long __init k2_find_end_of_memory(void)
529 {
530         unsigned long total;
531         unsigned char msize = 7;        /* Default to 128MB */
532
533         msize = K2_MEM_SIZE(readb(K2_MSIZ_GEO_REG));
534
535         switch (msize) {
536         case 2:
537                 /*
538                  * This will break without a lowered
539                  * KERNELBASE or CONFIG_HIGHMEM on.
540                  * It seems non 1GB builds exist yet,
541                  * though.
542                  */
543                 total = K2_MEM_SIZE_1GB;
544                 break;
545         case 3:
546         case 4:
547                 total = K2_MEM_SIZE_512MB;
548                 break;
549         case 5:
550         case 6:
551                 total = K2_MEM_SIZE_256MB;
552                 break;
553         case 7:
554                 total = K2_MEM_SIZE_128MB;
555                 break;
556         default:
557                 printk
558                     ("K2: Invalid memory size detected, defaulting to 128MB\n");
559                 total = K2_MEM_SIZE_128MB;
560                 break;
561         }
562         return total;
563 }
564
565 static void __init k2_map_io(void)
566 {
567         io_block_mapping(K2_PCI32_IO_BASE,
568                          K2_PCI32_IO_BASE, 0x00200000, _PAGE_IO);
569         io_block_mapping(0xff000000, 0xff000000, 0x01000000, _PAGE_IO);
570 }
571
572 static void __init k2_init_irq(void)
573 {
574         int i;
575
576         for (i = 0; i < 16; i++)
577                 irq_desc[i].handler = &i8259_pic;
578
579         i8259_init(0);
580 }
581
582 void __init platform_init(unsigned long r3, unsigned long r4,
583                           unsigned long r5, unsigned long r6, unsigned long r7)
584 {
585         parse_bootinfo((struct bi_record *)(r3 + KERNELBASE));
586
587         k2_set_bat();
588
589         isa_io_base = K2_ISA_IO_BASE;
590         isa_mem_base = K2_ISA_MEM_BASE;
591         pci_dram_offset = K2_PCI32_SYS_MEM_BASE;
592
593         ppc_md.setup_arch = k2_setup_arch;
594         ppc_md.show_cpuinfo = k2_show_cpuinfo;
595         ppc_md.init_IRQ = k2_init_irq;
596         ppc_md.get_irq = i8259_irq;
597
598         ppc_md.find_end_of_memory = k2_find_end_of_memory;
599         ppc_md.setup_io_mappings = k2_map_io;
600
601         ppc_md.restart = k2_restart;
602         ppc_md.power_off = k2_power_off;
603         ppc_md.halt = k2_halt;
604
605         ppc_md.time_init = todc_time_init;
606         ppc_md.set_rtc_time = todc_set_rtc_time;
607         ppc_md.get_rtc_time = todc_get_rtc_time;
608         ppc_md.calibrate_decr = k2_calibrate_decr;
609
610         ppc_md.nvram_read_val = todc_direct_read_val;
611         ppc_md.nvram_write_val = todc_direct_write_val;
612
613 #ifdef CONFIG_SERIAL_TEXT_DEBUG
614         ppc_md.progress = gen550_progress;
615 #endif
616 }