Merge with 2.3.48.
[linux-2.6/linux-mips.git] / arch / ppc / kernel / setup.c
blob5a57ba8a24dd61ab0fb9ebd956c67ee43cc36e30
1 /*
2 * $Id: setup.c,v 1.160 1999/10/08 01:56:38 paulus Exp $
3 * Common prep/pmac/chrp boot and setup code.
4 */
6 #include <linux/config.h>
7 #include <linux/module.h>
8 #include <linux/string.h>
9 #include <linux/sched.h>
10 #include <linux/init.h>
11 #include <linux/reboot.h>
12 #include <linux/delay.h>
13 #include <linux/blk.h>
14 #include <linux/ide.h>
16 #include <asm/init.h>
17 #include <asm/residual.h>
18 #include <asm/io.h>
19 #include <asm/prom.h>
20 #include <asm/processor.h>
21 #include <asm/pgtable.h>
22 #include <asm/bootinfo.h>
23 #include <asm/setup.h>
24 #include <asm/amigappc.h>
25 #include <asm/smp.h>
26 #ifdef CONFIG_8xx
27 #include <asm/mpc8xx.h>
28 #include <asm/8xx_immap.h>
29 #endif
30 #include <asm/bootx.h>
31 #include <asm/machdep.h>
32 #ifdef CONFIG_OAK
33 #include "oak_setup.h"
34 #endif /* CONFIG_OAK */
36 extern void pmac_init(unsigned long r3,
37 unsigned long r4,
38 unsigned long r5,
39 unsigned long r6,
40 unsigned long r7);
42 extern void chrp_init(unsigned long r3,
43 unsigned long r4,
44 unsigned long r5,
45 unsigned long r6,
46 unsigned long r7);
48 extern void prep_init(unsigned long r3,
49 unsigned long r4,
50 unsigned long r5,
51 unsigned long r6,
52 unsigned long r7);
54 extern void m8xx_init(unsigned long r3,
55 unsigned long r4,
56 unsigned long r5,
57 unsigned long r6,
58 unsigned long r7);
60 extern void apus_init(unsigned long r3,
61 unsigned long r4,
62 unsigned long r5,
63 unsigned long r6,
64 unsigned long r7);
66 extern void gemini_init(unsigned long r3,
67 unsigned long r4,
68 unsigned long r5,
69 unsigned long r6,
70 unsigned long r7);
72 #ifdef CONFIG_BOOTX_TEXT
73 extern void map_bootx_text(void);
74 #endif
75 #ifdef CONFIG_XMON
76 extern void xmon_map_scc(void);
77 #endif
79 extern boot_infos_t *boot_infos;
80 char saved_command_line[256];
81 unsigned char aux_device_present;
82 struct int_control_struct int_control =
84 __no_use_cli,
85 __no_use_sti,
86 __no_use_restore_flags,
87 __no_use_save_flags
89 struct ide_machdep_calls ppc_ide_md;
90 int parse_bootinfo(void);
92 unsigned long ISA_DMA_THRESHOLD;
93 unsigned long DMA_MODE_READ, DMA_MODE_WRITE;
95 #ifndef CONFIG_MACH_SPECIFIC
96 int _machine = 0;
97 int have_of = 0;
98 #endif /* CONFIG_MACH_SPECIFIC */
100 #ifdef CONFIG_MAGIC_SYSRQ
101 unsigned long SYSRQ_KEY;
102 #endif /* CONFIG_MAGIC_SYSRQ */
104 struct machdep_calls ppc_md;
107 * Perhaps we can put the pmac screen_info[] here
108 * on pmac as well so we don't need the ifdef's.
109 * Until we get multiple-console support in here
110 * that is. -- Cort
112 #if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
113 struct screen_info screen_info = {
114 0, 25, /* orig-x, orig-y */
115 0, /* unused */
116 0, /* orig-video-page */
117 0, /* orig-video-mode */
118 80, /* orig-video-cols */
119 0,0,0, /* ega_ax, ega_bx, ega_cx */
120 25, /* orig-video-lines */
121 1, /* orig-video-isVGA */
122 16 /* orig-video-points */
126 * I really need to add multiple-console support... -- Cort
128 int __init pmac_display_supported(char *name)
130 return 0;
132 void __init pmac_find_display(void)
136 #else /* CONFIG_4xx || CONFIG_8xx */
138 /* We need this to satisfy some external references until we can
139 * strip the kernel down.
141 struct screen_info screen_info = {
142 0, 25, /* orig-x, orig-y */
143 0, /* unused */
144 0, /* orig-video-page */
145 0, /* orig-video-mode */
146 80, /* orig-video-cols */
147 0,0,0, /* ega_ax, ega_bx, ega_cx */
148 25, /* orig-video-lines */
149 0, /* orig-video-isVGA */
150 16 /* orig-video-points */
152 #endif /* !CONFIG_4xx && !CONFIG_8xx */
154 void machine_restart(char *cmd)
156 ppc_md.restart(cmd);
159 void machine_power_off(void)
161 ppc_md.power_off();
164 void machine_halt(void)
166 ppc_md.halt();
169 unsigned long cpu_temp(void)
171 unsigned char thres = 0;
173 #if 0
174 /* disable thrm2 */
175 _set_THRM2( 0 );
176 /* threshold 0 C, tid: exceeding threshold, tie: don't generate interrupt */
177 _set_THRM1( THRM1_V );
179 /* we need 20us to do the compare - assume 300MHz processor clock */
180 _set_THRM3(0);
181 _set_THRM3(THRM3_E | (300*30)<<18 );
183 udelay(100);
184 /* wait for the compare to complete */
185 /*while ( !(_get_THRM1() & THRM1_TIV) ) ;*/
186 if ( !(_get_THRM1() & THRM1_TIV) )
187 printk("no tiv\n");
188 if ( _get_THRM1() & THRM1_TIN )
189 printk("crossed\n");
190 /* turn everything off */
191 _set_THRM3(0);
192 _set_THRM1(0);
193 #endif
195 return thres;
198 int get_cpuinfo(char *buffer)
200 unsigned long len = 0;
201 unsigned long bogosum = 0;
202 unsigned long i;
203 unsigned int pvr;
204 unsigned short maj, min;
206 #ifdef __SMP__
207 #define CPU_PRESENT(x) (cpu_callin_map[(x)])
208 #define GET_PVR ((long int)(cpu_data[i].pvr))
209 #define CD(x) (cpu_data[i].x)
210 #else
211 #define CPU_PRESENT(x) ((x)==0)
212 #define smp_num_cpus 1
213 #define GET_PVR ((long int)_get_PVR())
214 #define CD(x) (x)
215 #endif
217 for ( i = 0; i < smp_num_cpus ; i++ )
219 if ( !CPU_PRESENT(i) )
220 continue;
221 if ( i )
222 len += sprintf(len+buffer,"\n");
223 len += sprintf(len+buffer,"processor\t: %lu\n",i);
224 len += sprintf(len+buffer,"cpu\t\t: ");
226 pvr = GET_PVR;
228 switch (PVR_VER(pvr))
230 case 0x0001:
231 len += sprintf(len+buffer, "601\n");
232 break;
233 case 0x0003:
234 len += sprintf(len+buffer, "603\n");
235 break;
236 case 0x0004:
237 len += sprintf(len+buffer, "604\n");
238 break;
239 case 0x0006:
240 len += sprintf(len+buffer, "603e\n");
241 break;
242 case 0x0007:
243 len += sprintf(len+buffer, "603");
244 if (((pvr >> 12) & 0xF) == 1) {
245 pvr ^= 0x00001000; /* revision fix-up */
246 len += sprintf(len+buffer, "r\n");
247 } else {
248 len += sprintf(len+buffer, "ev\n");
250 break;
251 case 0x0008: /* 740/750(P) */
252 case 0x1008:
253 len += sprintf(len+buffer, "750%s\n",
254 PVR_VER(pvr) == 0x1008 ? "P" : "");
255 len += sprintf(len+buffer, "temperature \t: %lu C\n",
256 cpu_temp());
257 break;
258 case 0x0009: /* 604e/604r */
259 case 0x000A:
260 len += sprintf(len+buffer, "604");
262 if (PVR_VER(pvr) == 0x000A ||
263 ((pvr >> 12) & 0xF) != 0) {
264 pvr &= ~0x00003000; /* revision fix-up */
265 len += sprintf(len+buffer, "r\n");
266 } else {
267 len += sprintf(len+buffer, "e\n");
269 break;
270 case 0x000C:
271 len += sprintf(len+buffer, "7400 (G4)\n");
272 break;
273 case 0x0020:
274 len += sprintf(len+buffer, "403G");
275 switch ((pvr >> 8) & 0xFF) {
276 case 0x02:
277 len += sprintf(len+buffer, "C\n");
278 break;
279 case 0x14:
280 len += sprintf(len+buffer, "CX\n");
281 break;
283 break;
284 case 0x0050:
285 len += sprintf(len+buffer, "821\n");
286 break;
287 case 0x0081:
288 len += sprintf(len+buffer, "8240\n");
289 break;
290 case 0x4011:
291 len += sprintf(len+buffer, "405GP\n");
292 break;
293 default:
294 len += sprintf(len+buffer, "unknown (%08x)\n", pvr);
295 break;
299 * Assume here that all clock rates are the same in a
300 * smp system. -- Cort
302 #if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
303 if ( have_of )
305 struct device_node *cpu_node;
306 int *fp;
308 cpu_node = find_type_devices("cpu");
309 if ( !cpu_node ) break;
311 int s;
312 for ( s = 0; (s < i) && cpu_node->next ;
313 s++, cpu_node = cpu_node->next )
314 /* nothing */ ;
315 #if 0 /* SMP Pmacs don't have all cpu nodes -- Cort */
316 if ( s != i )
317 printk("get_cpuinfo(): ran out of "
318 "cpu nodes.\n");
319 #endif
321 fp = (int *) get_property(cpu_node, "clock-frequency", NULL);
322 if ( !fp ) break;
323 len += sprintf(len+buffer, "clock\t\t: %dMHz\n",
324 *fp / 1000000);
326 #endif /* !CONFIG_4xx && !CONFIG_8xx */
328 if (ppc_md.setup_residual != NULL)
330 len += ppc_md.setup_residual(buffer + len);
333 switch (PVR_VER(pvr))
335 case 0x0020:
336 maj = PVR_MAJ(pvr) + 1;
337 min = PVR_MIN(pvr);
338 break;
339 case 0x1008:
340 maj = ((pvr >> 8) & 0xFF) - 1;
341 min = pvr & 0xFF;
342 break;
343 default:
344 maj = (pvr >> 8) & 0xFF;
345 min = pvr & 0xFF;
346 break;
349 len += sprintf(len+buffer, "revision\t: %hd.%hd\n", maj, min);
351 len += sprintf(buffer+len, "bogomips\t: %lu.%02lu\n",
352 (CD(loops_per_sec)+2500)/500000,
353 (CD(loops_per_sec)+2500)/5000 % 100);
354 bogosum += CD(loops_per_sec);
357 #ifdef __SMP__
358 if ( i )
359 len += sprintf(buffer+len, "\n");
360 len += sprintf(buffer+len,"total bogomips\t: %lu.%02lu\n",
361 (bogosum+2500)/500000,
362 (bogosum+2500)/5000 % 100);
363 #endif /* __SMP__ */
366 * Ooh's and aah's info about zero'd pages in idle task
368 len += sprintf(buffer+len,"zero pages\t: total: %u (%luKb) "
369 "current: %u (%luKb) hits: %u/%u (%u%%)\n",
370 atomic_read(&zero_cache_total),
371 (atomic_read(&zero_cache_total)*PAGE_SIZE)>>10,
372 atomic_read(&zero_cache_sz),
373 (atomic_read(&zero_cache_sz)*PAGE_SIZE)>>10,
374 atomic_read(&zero_cache_hits),atomic_read(&zero_cache_calls),
375 /* : 1 below is so we don't div by zero */
376 (atomic_read(&zero_cache_hits)*100) /
377 ((atomic_read(&zero_cache_calls))?atomic_read(&zero_cache_calls):1));
379 if (ppc_md.get_cpuinfo != NULL)
381 len += ppc_md.get_cpuinfo(buffer+len);
384 return len;
387 #ifndef CONFIG_MACH_SPECIFIC
388 void __init
389 intuit_machine_type(void)
391 char *model;
392 struct device_node *root;
394 /* ask the OF info if we're a chrp or pmac */
395 root = find_path_device("/");
396 if (root != 0) {
397 /* assume pmac unless proven to be chrp -- Cort */
398 _machine = _MACH_Pmac;
399 model = get_property(root, "device_type", NULL);
400 if (model && !strncmp("chrp", model, 4))
401 _machine = _MACH_chrp;
402 else {
403 model = get_property(root, "model", NULL);
404 if (model && !strncmp(model, "IBM", 3))
405 _machine = _MACH_chrp;
409 #endif /* CONFIG_MACH_SPECIFIC */
412 * Find out what kind of machine we're on and save any data we need
413 * from the early boot process (devtree is copied on pmac by prom_init() )
415 unsigned long __init
416 identify_machine(unsigned long r3, unsigned long r4, unsigned long r5,
417 unsigned long r6, unsigned long r7)
419 parse_bootinfo();
421 if ( ppc_md.progress ) ppc_md.progress("id mach(): start", 0x100);
423 #if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
424 #ifndef CONFIG_MACH_SPECIFIC
425 /* if we didn't get any bootinfo telling us what we are... */
426 if ( _machine == 0 )
428 /* boot loader will tell us if we're APUS */
429 if ( r3 == 0x61707573 )
431 _machine = _MACH_apus;
432 r3 = 0;
434 /* prep boot loader tells us if we're prep or not */
435 else if ( *(unsigned long *)(KERNELBASE) == (0xdeadc0de) )
437 _machine = _MACH_prep;
438 } else
439 have_of = 1;
441 #endif /* CONFIG_MACH_SPECIFIC */
443 if ( have_of )
445 /* prom_init has already been called from __start */
446 if (boot_infos)
447 relocate_nodes();
448 #ifndef CONFIG_MACH_SPECIFIC
449 /* we need to set _machine before calling finish_device_tree */
450 if (_machine == 0)
451 intuit_machine_type();
452 #endif /* CONFIG_MACH_SPECIFIC */
453 finish_device_tree();
456 * If we were booted via quik, r3 points to the physical
457 * address of the command-line parameters.
458 * If we were booted from an xcoff image (i.e. netbooted or
459 * booted from floppy), we get the command line from the
460 * bootargs property of the /chosen node.
461 * If an initial ramdisk is present, r3 and r4
462 * are used for initrd_start and initrd_size,
463 * otherwise they contain 0xdeadbeef.
465 cmd_line[0] = 0;
466 if (r3 >= 0x4000 && r3 < 0x800000 && r4 == 0) {
467 strncpy(cmd_line, (char *)r3 + KERNELBASE,
468 sizeof(cmd_line));
469 } else if (boot_infos != 0) {
470 /* booted by BootX - check for ramdisk */
471 if (boot_infos->kernelParamsOffset != 0)
472 strncpy(cmd_line, (char *) boot_infos
473 + boot_infos->kernelParamsOffset,
474 sizeof(cmd_line));
475 #ifdef CONFIG_BLK_DEV_INITRD
476 if (boot_infos->ramDisk) {
477 initrd_start = (unsigned long) boot_infos
478 + boot_infos->ramDisk;
479 initrd_end = initrd_start + boot_infos->ramDiskSize;
480 initrd_below_start_ok = 1;
482 #endif
483 } else {
484 struct device_node *chosen;
485 char *p;
487 #ifdef CONFIG_BLK_DEV_INITRD
488 if (r3 && r4 && r4 != 0xdeadbeef)
490 initrd_start = r3;
491 initrd_end = r3 + r4;
492 ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
493 initrd_below_start_ok = 1;
495 #endif
496 cmd_line[0] = 0;
497 chosen = find_devices("chosen");
498 if (chosen != NULL) {
499 p = get_property(chosen, "bootargs", NULL);
500 if (p != NULL)
501 strncpy(cmd_line, p, sizeof(cmd_line));
504 cmd_line[sizeof(cmd_line) - 1] = 0;
507 switch (_machine)
509 case _MACH_Pmac:
510 pmac_init(r3, r4, r5, r6, r7);
511 break;
512 case _MACH_prep:
513 prep_init(r3, r4, r5, r6, r7);
514 break;
515 case _MACH_chrp:
516 chrp_init(r3, r4, r5, r6, r7);
517 break;
518 #ifdef CONFIG_APUS
519 case _MACH_apus:
520 apus_init(r3, r4, r5, r6, r7);
521 break;
522 #endif
523 #ifdef CONFIG_GEMINI
524 case _MACH_gemini:
525 gemini_init(r3, r4, r5, r6, r7);
526 break;
527 #endif
528 default:
529 printk("Unknown machine type in identify_machine!\n");
532 /* Check for nobats option (used in mapin_ram). */
533 if (strstr(cmd_line, "nobats")) {
534 extern int __map_without_bats;
535 __map_without_bats = 1;
537 #else
538 #if defined(CONFIG_4xx)
539 oak_init(r3, r4, r5, r6, r7);
540 #elif defined(CONFIG_8xx)
541 m8xx_init(r3, r4, r5, r6, r7);
542 #else
543 #error "No board type has been defined for identify_machine()!"
544 #endif /* CONFIG_4xx */
545 #endif /* !CONFIG_4xx && !CONFIG_8xx */
547 /* Look for mem= option on command line */
548 if (strstr(cmd_line, "mem=")) {
549 char *p, *q;
550 unsigned long maxmem = 0;
551 extern unsigned long __max_memory;
553 for (q = cmd_line; (p = strstr(q, "mem=")) != 0; ) {
554 q = p + 4;
555 if (p > cmd_line && p[-1] != ' ')
556 continue;
557 maxmem = simple_strtoul(q, &q, 0);
558 if (*q == 'k' || *q == 'K') {
559 maxmem <<= 10;
560 ++q;
561 } else if (*q == 'm' || *q == 'M') {
562 maxmem <<= 20;
563 ++q;
566 __max_memory = maxmem;
569 /* this is for modules since _machine can be a define -- Cort */
570 ppc_md.ppc_machine = _machine;
572 if ( ppc_md.progress ) ppc_md.progress("id mach(): done", 0x200);
574 return 0;
577 int parse_bootinfo(void)
579 struct bi_record *rec;
580 extern char __bss_start[];
581 extern char *sysmap;
582 extern unsigned long sysmap_size;
584 rec = (struct bi_record *)_ALIGN((ulong)__bss_start+(1<<20)-1,(1<<20));
585 if ( rec->tag != BI_FIRST )
588 * This 0x10000 offset is a terrible hack but it will go away when
589 * we have the bootloader handle all the relocation and
590 * prom calls -- Cort
592 rec = (struct bi_record *)_ALIGN((ulong)__bss_start+0x10000+(1<<20)-1,(1<<20));
593 if ( rec->tag != BI_FIRST )
594 return -1;
596 for ( ; rec->tag != BI_LAST ;
597 rec = (struct bi_record *)((ulong)rec + rec->size) )
599 ulong *data = rec->data;
600 switch (rec->tag)
602 case BI_CMD_LINE:
603 memcpy(cmd_line, (void *)data, rec->size);
604 break;
605 case BI_SYSMAP:
606 sysmap = (char *)((data[0] >= (KERNELBASE)) ? data[0] :
607 (data[0]+KERNELBASE));
608 sysmap_size = data[1];
609 break;
610 #ifdef CONFIG_BLK_DEV_INITRD
611 case BI_INITRD:
612 initrd_start = data[0];
613 initrd_end = data[0] + rec->size;
614 break;
615 #endif /* CONFIG_BLK_DEV_INITRD */
616 #ifndef CONFIG_MACH_SPECIFIC
617 case BI_MACHTYPE:
618 _machine = data[0];
619 have_of = data[1];
620 break;
621 #endif /* CONFIG_MACH_SPECIFIC */
625 return 0;
628 /* Checks "l2cr=xxxx" command-line option */
629 void ppc_setup_l2cr(char *str, int *ints)
631 if ( ((_get_PVR() >> 16) == 8) || ((_get_PVR() >> 16) == 12) )
633 unsigned long val = simple_strtoul(str, NULL, 0);
634 printk(KERN_INFO "l2cr set to %lx\n", val);
635 _set_L2CR(0);
636 _set_L2CR(val);
640 void __init ppc_init(void)
642 /* clear the progress line */
643 if ( ppc_md.progress ) ppc_md.progress(" ", 0xffff);
645 if (ppc_md.init != NULL) {
646 ppc_md.init();
650 void __init setup_arch(char **cmdline_p)
652 extern int panic_timeout;
653 extern char _etext[], _edata[];
654 extern char *klimit;
655 extern void do_init_bootmem(void);
657 #ifdef CONFIG_BOOTX_TEXT
658 map_bootx_text();
659 #endif
661 #ifdef CONFIG_XMON
662 xmon_map_scc();
663 if (strstr(cmd_line, "xmon"))
664 xmon(0);
665 #endif /* CONFIG_XMON */
666 if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab);
667 #if defined(CONFIG_KGDB)
668 set_debug_traps();
669 breakpoint();
670 #endif
672 /* reboot on panic */
673 panic_timeout = 180;
675 init_mm.start_code = PAGE_OFFSET;
676 init_mm.end_code = (unsigned long) _etext;
677 init_mm.end_data = (unsigned long) _edata;
678 init_mm.brk = (unsigned long) klimit;
680 /* Save unparsed command line copy for /proc/cmdline */
681 strcpy(saved_command_line, cmd_line);
682 *cmdline_p = cmd_line;
684 /* set up the bootmem stuff with available memory */
685 do_init_bootmem();
686 if ( ppc_md.progress ) ppc_md.progress("setup_arch: bootmem", 0x3eab);
688 ppc_md.setup_arch();
689 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
692 void ppc_generic_ide_fix_driveid(struct hd_driveid *id)
694 int i;
695 unsigned short *stringcast;
698 id->config = __le16_to_cpu(id->config);
699 id->cyls = __le16_to_cpu(id->cyls);
700 id->reserved2 = __le16_to_cpu(id->reserved2);
701 id->heads = __le16_to_cpu(id->heads);
702 id->track_bytes = __le16_to_cpu(id->track_bytes);
703 id->sector_bytes = __le16_to_cpu(id->sector_bytes);
704 id->sectors = __le16_to_cpu(id->sectors);
705 id->vendor0 = __le16_to_cpu(id->vendor0);
706 id->vendor1 = __le16_to_cpu(id->vendor1);
707 id->vendor2 = __le16_to_cpu(id->vendor2);
708 stringcast = (unsigned short *)&id->serial_no[0];
709 for (i=0; i<(20/2); i++)
710 stringcast[i] = __le16_to_cpu(stringcast[i]);
711 id->buf_type = __le16_to_cpu(id->buf_type);
712 id->buf_size = __le16_to_cpu(id->buf_size);
713 id->ecc_bytes = __le16_to_cpu(id->ecc_bytes);
714 stringcast = (unsigned short *)&id->fw_rev[0];
715 for (i=0; i<(8/2); i++)
716 stringcast[i] = __le16_to_cpu(stringcast[i]);
717 stringcast = (unsigned short *)&id->model[0];
718 for (i=0; i<(40/2); i++)
719 stringcast[i] = __le16_to_cpu(stringcast[i]);
720 id->dword_io = __le16_to_cpu(id->dword_io);
721 id->reserved50 = __le16_to_cpu(id->reserved50);
722 id->field_valid = __le16_to_cpu(id->field_valid);
723 id->cur_cyls = __le16_to_cpu(id->cur_cyls);
724 id->cur_heads = __le16_to_cpu(id->cur_heads);
725 id->cur_sectors = __le16_to_cpu(id->cur_sectors);
726 id->cur_capacity0 = __le16_to_cpu(id->cur_capacity0);
727 id->cur_capacity1 = __le16_to_cpu(id->cur_capacity1);
728 id->lba_capacity = __le32_to_cpu(id->lba_capacity);
729 id->dma_1word = __le16_to_cpu(id->dma_1word);
730 id->dma_mword = __le16_to_cpu(id->dma_mword);
731 id->eide_pio_modes = __le16_to_cpu(id->eide_pio_modes);
732 id->eide_dma_min = __le16_to_cpu(id->eide_dma_min);
733 id->eide_dma_time = __le16_to_cpu(id->eide_dma_time);
734 id->eide_pio = __le16_to_cpu(id->eide_pio);
735 id->eide_pio_iordy = __le16_to_cpu(id->eide_pio_iordy);
736 for (i=0; i<2 i++)
737 id->words69_70[i] = __le16_to_cpu(id->words69_70[i]);
738 for (i=0; i<4 i++)
739 id->words71_74[i] = __le16_to_cpu(id->words71_74[i]);
740 id->queue_depth = __le16_to_cpu(id->queue_depth);
741 for (i=0; i<4 i++)
742 id->words76_79[i] = __le16_to_cpu(id->words76_79[i]);
743 id->major_rev_num = __le16_to_cpu(id->major_rev_num);
744 id->minor_rev_num = __le16_to_cpu(id->minor_rev_num);
745 id->command_set_1 = __le16_to_cpu(id->command_set_1);
746 id->command_set_2 = __le16_to_cpu(id->command_set_2);
747 id->cfsse = __le16_to_cpu(id->cfsse);
748 id->cfs_enable_1 = __le16_to_cpu(id->cfs_enable_1);
749 id->cfs_enable_2 = __le16_to_cpu(id->cfs_enable_2);
750 id->csf_default = __le16_to_cpu(id->csf_default);
751 id->dma_ultra = __le16_to_cpu(id->dma_ultra);
752 id->word89 = __le16_to_cpu(id->word89);
753 id->word90 = __le16_to_cpu(id->word90);
754 id->CurAPMvalues = __le16_to_cpu(id->CurAPMvalues);
755 id->word92 = __le16_to_cpu(id->word92);
756 id->hw_config = __le16_to_cpu(id->hw_config);
757 for (i=0; i<34; i++)
758 id->words94_125[i] = __le16_to_cpu(id->words94_125[i]);
759 id->last_lun = __le16_to_cpu(id->last_lun);
760 id->word127 = __le16_to_cpu(id->word127);
761 id->dlf = __le16_to_cpu(id->dlf);
762 id->csfo = __le16_to_cpu(id->csfo);
763 for (i=0; i<31; i++)
764 id->words130_159[i] = __le16_to_cpu(id->words130_159[i]);
765 for (i=0; i<97; i++)
766 id->words160_255[i] = __le16_to_cpu(id->words160_255[i]);