summaryrefslogtreecommitdiffstats
path: root/drivers/nubus
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2018-01-13 17:37:13 -0500
committerGeert Uytterhoeven <geert@linux-m68k.org>2018-01-16 10:47:29 -0500
commitf53bad0881a35c45d89bd8c552dc0498b96403c5 (patch)
tree5ebcc2e3a06d3071e4b927d4cd7c902f0ed431a0 /drivers/nubus
parent460cf95e8b6cda2823a6432253ae91d3e1e7a021 (diff)
nubus: Fix log spam
Testing shows that a single Radius PrecisionColor 24X display board, which has 95 functional resources, produces over a thousand lines of log messages. Suppress these messages with pr_debug(). Remove some redundant messages relating to nubus_get_subdir() calls. Fix the format block debug messages as the sequence of entries is backwards (my bad). Move the "scanning slots" message to its proper location. Fixes: 71ae40e4cf33 ("nubus: Clean up printk calls") Tested-by: Stan Johnson <userm57@yahoo.com> Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'drivers/nubus')
-rw-r--r--drivers/nubus/nubus.c129
1 files changed, 56 insertions, 73 deletions
diff --git a/drivers/nubus/nubus.c b/drivers/nubus/nubus.c
index 35056cee94b1..ef3a115920ca 100644
--- a/drivers/nubus/nubus.c
+++ b/drivers/nubus/nubus.c
@@ -353,15 +353,15 @@ static int __init nubus_show_display_resource(struct nubus_dev *dev,
353{ 353{
354 switch (ent->type) { 354 switch (ent->type) {
355 case NUBUS_RESID_GAMMADIR: 355 case NUBUS_RESID_GAMMADIR:
356 pr_info(" gamma directory offset: 0x%06x\n", ent->data); 356 pr_debug(" gamma directory offset: 0x%06x\n", ent->data);
357 break; 357 break;
358 case 0x0080 ... 0x0085: 358 case 0x0080 ... 0x0085:
359 pr_info(" mode %02X info offset: 0x%06x\n", 359 pr_debug(" mode 0x%02x info offset: 0x%06x\n",
360 ent->type, ent->data); 360 ent->type, ent->data);
361 break; 361 break;
362 default: 362 default:
363 pr_info(" unknown resource %02X, data 0x%06x\n", 363 pr_debug(" unknown resource 0x%02x, data 0x%06x\n",
364 ent->type, ent->data); 364 ent->type, ent->data);
365 } 365 }
366 return 0; 366 return 0;
367} 367}
@@ -375,12 +375,12 @@ static int __init nubus_show_network_resource(struct nubus_dev *dev,
375 char addr[6]; 375 char addr[6];
376 376
377 nubus_get_rsrc_mem(addr, ent, 6); 377 nubus_get_rsrc_mem(addr, ent, 6);
378 pr_info(" MAC address: %pM\n", addr); 378 pr_debug(" MAC address: %pM\n", addr);
379 break; 379 break;
380 } 380 }
381 default: 381 default:
382 pr_info(" unknown resource %02X, data 0x%06x\n", 382 pr_debug(" unknown resource 0x%02x, data 0x%06x\n",
383 ent->type, ent->data); 383 ent->type, ent->data);
384 } 384 }
385 return 0; 385 return 0;
386} 386}
@@ -394,8 +394,8 @@ static int __init nubus_show_cpu_resource(struct nubus_dev *dev,
394 unsigned long meminfo[2]; 394 unsigned long meminfo[2];
395 395
396 nubus_get_rsrc_mem(&meminfo, ent, 8); 396 nubus_get_rsrc_mem(&meminfo, ent, 8);
397 pr_info(" memory: [ 0x%08lx 0x%08lx ]\n", 397 pr_debug(" memory: [ 0x%08lx 0x%08lx ]\n",
398 meminfo[0], meminfo[1]); 398 meminfo[0], meminfo[1]);
399 break; 399 break;
400 } 400 }
401 case NUBUS_RESID_ROMINFO: 401 case NUBUS_RESID_ROMINFO:
@@ -403,13 +403,13 @@ static int __init nubus_show_cpu_resource(struct nubus_dev *dev,
403 unsigned long rominfo[2]; 403 unsigned long rominfo[2];
404 404
405 nubus_get_rsrc_mem(&rominfo, ent, 8); 405 nubus_get_rsrc_mem(&rominfo, ent, 8);
406 pr_info(" ROM: [ 0x%08lx 0x%08lx ]\n", 406 pr_debug(" ROM: [ 0x%08lx 0x%08lx ]\n",
407 rominfo[0], rominfo[1]); 407 rominfo[0], rominfo[1]);
408 break; 408 break;
409 } 409 }
410 default: 410 default:
411 pr_info(" unknown resource %02X, data 0x%06x\n", 411 pr_debug(" unknown resource 0x%02x, data 0x%06x\n",
412 ent->type, ent->data); 412 ent->type, ent->data);
413 } 413 }
414 return 0; 414 return 0;
415} 415}
@@ -428,8 +428,8 @@ static int __init nubus_show_private_resource(struct nubus_dev *dev,
428 nubus_show_cpu_resource(dev, ent); 428 nubus_show_cpu_resource(dev, ent);
429 break; 429 break;
430 default: 430 default:
431 pr_info(" unknown resource %02X, data 0x%06x\n", 431 pr_debug(" unknown resource 0x%02x, data 0x%06x\n",
432 ent->type, ent->data); 432 ent->type, ent->data);
433 } 433 }
434 return 0; 434 return 0;
435} 435}
@@ -442,12 +442,9 @@ nubus_get_functional_resource(struct nubus_board *board, int slot,
442 struct nubus_dirent ent; 442 struct nubus_dirent ent;
443 struct nubus_dev *dev; 443 struct nubus_dev *dev;
444 444
445 pr_info(" Function 0x%02x:\n", parent->type); 445 pr_debug(" Functional resource 0x%02x:\n", parent->type);
446 nubus_get_subdir(parent, &dir); 446 nubus_get_subdir(parent, &dir);
447 447
448 pr_debug("%s: parent is 0x%p, dir is 0x%p\n",
449 __func__, parent->base, dir.base);
450
451 /* Actually we should probably panic if this fails */ 448 /* Actually we should probably panic if this fails */
452 if ((dev = kzalloc(sizeof(*dev), GFP_ATOMIC)) == NULL) 449 if ((dev = kzalloc(sizeof(*dev), GFP_ATOMIC)) == NULL)
453 return NULL; 450 return NULL;
@@ -466,14 +463,14 @@ nubus_get_functional_resource(struct nubus_board *board, int slot,
466 dev->type = nbtdata[1]; 463 dev->type = nbtdata[1];
467 dev->dr_sw = nbtdata[2]; 464 dev->dr_sw = nbtdata[2];
468 dev->dr_hw = nbtdata[3]; 465 dev->dr_hw = nbtdata[3];
469 pr_info(" type: [cat 0x%x type 0x%x sw 0x%x hw 0x%x]\n", 466 pr_debug(" type: [cat 0x%x type 0x%x sw 0x%x hw 0x%x]\n",
470 nbtdata[0], nbtdata[1], nbtdata[2], nbtdata[3]); 467 nbtdata[0], nbtdata[1], nbtdata[2], nbtdata[3]);
471 break; 468 break;
472 } 469 }
473 case NUBUS_RESID_NAME: 470 case NUBUS_RESID_NAME:
474 { 471 {
475 nubus_get_rsrc_str(dev->name, &ent, sizeof(dev->name)); 472 nubus_get_rsrc_str(dev->name, &ent, sizeof(dev->name));
476 pr_info(" name: %s\n", dev->name); 473 pr_debug(" name: %s\n", dev->name);
477 break; 474 break;
478 } 475 }
479 case NUBUS_RESID_DRVRDIR: 476 case NUBUS_RESID_DRVRDIR:
@@ -486,7 +483,7 @@ nubus_get_functional_resource(struct nubus_board *board, int slot,
486 nubus_get_subdir(&ent, &drvr_dir); 483 nubus_get_subdir(&ent, &drvr_dir);
487 nubus_readdir(&drvr_dir, &drvr_ent); 484 nubus_readdir(&drvr_dir, &drvr_ent);
488 dev->driver = nubus_dirptr(&drvr_ent); 485 dev->driver = nubus_dirptr(&drvr_ent);
489 pr_info(" driver at: 0x%p\n", dev->driver); 486 pr_debug(" driver at: 0x%p\n", dev->driver);
490 break; 487 break;
491 } 488 }
492 case NUBUS_RESID_MINOR_BASEOS: 489 case NUBUS_RESID_MINOR_BASEOS:
@@ -494,20 +491,20 @@ nubus_get_functional_resource(struct nubus_board *board, int slot,
494 multiple framebuffers. It might be handy 491 multiple framebuffers. It might be handy
495 for Ethernet as well */ 492 for Ethernet as well */
496 nubus_get_rsrc_mem(&dev->iobase, &ent, 4); 493 nubus_get_rsrc_mem(&dev->iobase, &ent, 4);
497 pr_info(" memory offset: 0x%08lx\n", dev->iobase); 494 pr_debug(" memory offset: 0x%08lx\n", dev->iobase);
498 break; 495 break;
499 case NUBUS_RESID_MINOR_LENGTH: 496 case NUBUS_RESID_MINOR_LENGTH:
500 /* Ditto */ 497 /* Ditto */
501 nubus_get_rsrc_mem(&dev->iosize, &ent, 4); 498 nubus_get_rsrc_mem(&dev->iosize, &ent, 4);
502 pr_info(" memory length: 0x%08lx\n", dev->iosize); 499 pr_debug(" memory length: 0x%08lx\n", dev->iosize);
503 break; 500 break;
504 case NUBUS_RESID_FLAGS: 501 case NUBUS_RESID_FLAGS:
505 dev->flags = ent.data; 502 dev->flags = ent.data;
506 pr_info(" flags: 0x%06x\n", dev->flags); 503 pr_debug(" flags: 0x%06x\n", dev->flags);
507 break; 504 break;
508 case NUBUS_RESID_HWDEVID: 505 case NUBUS_RESID_HWDEVID:
509 dev->hwdevid = ent.data; 506 dev->hwdevid = ent.data;
510 pr_info(" hwdevid: 0x%06x\n", dev->hwdevid); 507 pr_debug(" hwdevid: 0x%06x\n", dev->hwdevid);
511 break; 508 break;
512 default: 509 default:
513 /* Local/Private resources have their own 510 /* Local/Private resources have their own
@@ -535,10 +532,8 @@ static int __init nubus_get_vidnames(struct nubus_board *board,
535 char name[36]; 532 char name[36];
536 }; 533 };
537 534
538 pr_info(" video modes supported:\n"); 535 pr_debug(" video modes supported:\n");
539 nubus_get_subdir(parent, &dir); 536 nubus_get_subdir(parent, &dir);
540 pr_debug("%s: parent is 0x%p, dir is 0x%p\n",
541 __func__, parent->base, dir.base);
542 537
543 while (nubus_readdir(&dir, &ent) != -1) { 538 while (nubus_readdir(&dir, &ent) != -1) {
544 struct vidmode mode; 539 struct vidmode mode;
@@ -552,7 +547,7 @@ static int __init nubus_get_vidnames(struct nubus_board *board,
552 size = sizeof(mode) - 1; 547 size = sizeof(mode) - 1;
553 memset(&mode, 0, sizeof(mode)); 548 memset(&mode, 0, sizeof(mode));
554 nubus_get_rsrc_mem(&mode, &ent, size); 549 nubus_get_rsrc_mem(&mode, &ent, size);
555 pr_info(" %02X: (%02X) %s\n", ent.type, 550 pr_debug(" 0x%02x: 0x%04x %s\n", ent.type,
556 mode.id, mode.name); 551 mode.id, mode.name);
557 } 552 }
558 return 0; 553 return 0;
@@ -563,25 +558,16 @@ static int __init nubus_get_icon(struct nubus_board *board,
563 const struct nubus_dirent *ent) 558 const struct nubus_dirent *ent)
564{ 559{
565 /* Should be 32x32 if my memory serves me correctly */ 560 /* Should be 32x32 if my memory serves me correctly */
566 unsigned char icon[128]; 561 u32 icon[32];
567 int x, y; 562 int i;
568 563
569 nubus_get_rsrc_mem(&icon, ent, 128); 564 nubus_get_rsrc_mem(&icon, ent, 128);
570 pr_info(" icon:\n"); 565 pr_debug(" icon:\n");
571 566 for (i = 0; i < 8; i++)
572 /* We should actually plot these somewhere in the framebuffer 567 pr_debug(" %08x %08x %08x %08x\n",
573 init. This is just to demonstrate that they do, in fact, 568 icon[i * 4 + 0], icon[i * 4 + 1],
574 exist */ 569 icon[i * 4 + 2], icon[i * 4 + 3]);
575 for (y = 0; y < 32; y++) { 570
576 pr_info(" ");
577 for (x = 0; x < 32; x++) {
578 if (icon[y * 4 + x / 8] & (0x80 >> (x % 8)))
579 pr_cont("*");
580 else
581 pr_cont(" ");
582 }
583 pr_cont("\n");
584 }
585 return 0; 571 return 0;
586} 572}
587 573
@@ -593,10 +579,8 @@ static int __init nubus_get_vendorinfo(struct nubus_board *board,
593 static char *vendor_fields[6] = { "ID", "serial", "revision", 579 static char *vendor_fields[6] = { "ID", "serial", "revision",
594 "part", "date", "unknown field" }; 580 "part", "date", "unknown field" };
595 581
596 pr_info(" vendor info:\n"); 582 pr_debug(" vendor info:\n");
597 nubus_get_subdir(parent, &dir); 583 nubus_get_subdir(parent, &dir);
598 pr_debug("%s: parent is 0x%p, dir is 0x%p\n",
599 __func__, parent->base, dir.base);
600 584
601 while (nubus_readdir(&dir, &ent) != -1) { 585 while (nubus_readdir(&dir, &ent) != -1) {
602 char name[64]; 586 char name[64];
@@ -605,7 +589,7 @@ static int __init nubus_get_vendorinfo(struct nubus_board *board,
605 nubus_get_rsrc_str(name, &ent, sizeof(name)); 589 nubus_get_rsrc_str(name, &ent, sizeof(name));
606 if (ent.type < 1 || ent.type > 5) 590 if (ent.type < 1 || ent.type > 5)
607 ent.type = 5; 591 ent.type = 5;
608 pr_info(" %s: %s\n", vendor_fields[ent.type - 1], name); 592 pr_debug(" %s: %s\n", vendor_fields[ent.type - 1], name);
609 } 593 }
610 return 0; 594 return 0;
611} 595}
@@ -616,9 +600,8 @@ static int __init nubus_get_board_resource(struct nubus_board *board, int slot,
616 struct nubus_dir dir; 600 struct nubus_dir dir;
617 struct nubus_dirent ent; 601 struct nubus_dirent ent;
618 602
603 pr_debug(" Board resource 0x%02x:\n", parent->type);
619 nubus_get_subdir(parent, &dir); 604 nubus_get_subdir(parent, &dir);
620 pr_debug("%s: parent is 0x%p, dir is 0x%p\n",
621 __func__, parent->base, dir.base);
622 605
623 while (nubus_readdir(&dir, &ent) != -1) { 606 while (nubus_readdir(&dir, &ent) != -1) {
624 switch (ent.type) { 607 switch (ent.type) {
@@ -629,8 +612,8 @@ static int __init nubus_get_board_resource(struct nubus_board *board, int slot,
629 useful except insofar as it tells us that 612 useful except insofar as it tells us that
630 we really are looking at a board resource. */ 613 we really are looking at a board resource. */
631 nubus_get_rsrc_mem(nbtdata, &ent, 8); 614 nubus_get_rsrc_mem(nbtdata, &ent, 8);
632 pr_info(" type: [cat 0x%x type 0x%x sw 0x%x hw 0x%x]\n", 615 pr_debug(" type: [cat 0x%x type 0x%x sw 0x%x hw 0x%x]\n",
633 nbtdata[0], nbtdata[1], nbtdata[2], nbtdata[3]); 616 nbtdata[0], nbtdata[1], nbtdata[2], nbtdata[3]);
634 if (nbtdata[0] != 1 || nbtdata[1] != 0 || 617 if (nbtdata[0] != 1 || nbtdata[1] != 0 ||
635 nbtdata[2] != 0 || nbtdata[3] != 0) 618 nbtdata[2] != 0 || nbtdata[3] != 0)
636 pr_err("this sResource is not a board resource!\n"); 619 pr_err("this sResource is not a board resource!\n");
@@ -639,28 +622,29 @@ static int __init nubus_get_board_resource(struct nubus_board *board, int slot,
639 case NUBUS_RESID_NAME: 622 case NUBUS_RESID_NAME:
640 nubus_get_rsrc_str(board->name, &ent, 623 nubus_get_rsrc_str(board->name, &ent,
641 sizeof(board->name)); 624 sizeof(board->name));
642 pr_info(" name: %s\n", board->name); 625 pr_debug(" name: %s\n", board->name);
643 break; 626 break;
644 case NUBUS_RESID_ICON: 627 case NUBUS_RESID_ICON:
645 nubus_get_icon(board, &ent); 628 nubus_get_icon(board, &ent);
646 break; 629 break;
647 case NUBUS_RESID_BOARDID: 630 case NUBUS_RESID_BOARDID:
648 pr_info(" board id: 0x%x\n", ent.data); 631 pr_debug(" board id: 0x%x\n", ent.data);
649 break; 632 break;
650 case NUBUS_RESID_PRIMARYINIT: 633 case NUBUS_RESID_PRIMARYINIT:
651 pr_info(" primary init offset: 0x%06x\n", ent.data); 634 pr_debug(" primary init offset: 0x%06x\n", ent.data);
652 break; 635 break;
653 case NUBUS_RESID_VENDORINFO: 636 case NUBUS_RESID_VENDORINFO:
654 nubus_get_vendorinfo(board, &ent); 637 nubus_get_vendorinfo(board, &ent);
655 break; 638 break;
656 case NUBUS_RESID_FLAGS: 639 case NUBUS_RESID_FLAGS:
657 pr_info(" flags: 0x%06x\n", ent.data); 640 pr_debug(" flags: 0x%06x\n", ent.data);
658 break; 641 break;
659 case NUBUS_RESID_HWDEVID: 642 case NUBUS_RESID_HWDEVID:
660 pr_info(" hwdevid: 0x%06x\n", ent.data); 643 pr_debug(" hwdevid: 0x%06x\n", ent.data);
661 break; 644 break;
662 case NUBUS_RESID_SECONDINIT: 645 case NUBUS_RESID_SECONDINIT:
663 pr_info(" secondary init offset: 0x%06x\n", ent.data); 646 pr_debug(" secondary init offset: 0x%06x\n",
647 ent.data);
664 break; 648 break;
665 /* WTF isn't this in the functional resources? */ 649 /* WTF isn't this in the functional resources? */
666 case NUBUS_RESID_VIDNAMES: 650 case NUBUS_RESID_VIDNAMES:
@@ -668,12 +652,12 @@ static int __init nubus_get_board_resource(struct nubus_board *board, int slot,
668 break; 652 break;
669 /* Same goes for this */ 653 /* Same goes for this */
670 case NUBUS_RESID_VIDMODES: 654 case NUBUS_RESID_VIDMODES:
671 pr_info(" video mode parameter directory offset: 0x%06x\n", 655 pr_debug(" video mode parameter directory offset: 0x%06x\n",
672 ent.data); 656 ent.data);
673 break; 657 break;
674 default: 658 default:
675 pr_info(" unknown resource %02X, data 0x%06x\n", 659 pr_debug(" unknown resource 0x%02x, data 0x%06x\n",
676 ent.type, ent.data); 660 ent.type, ent.data);
677 } 661 }
678 } 662 }
679 return 0; 663 return 0;
@@ -700,14 +684,14 @@ static struct nubus_board * __init nubus_add_board(int slot, int bytelanes)
700 684
701 /* Dump the format block for debugging purposes */ 685 /* Dump the format block for debugging purposes */
702 pr_debug("Slot %X, format block at 0x%p:\n", slot, rp); 686 pr_debug("Slot %X, format block at 0x%p:\n", slot, rp);
687 pr_debug("%08lx\n", nubus_get_rom(&rp, 4, bytelanes));
688 pr_debug("%08lx\n", nubus_get_rom(&rp, 4, bytelanes));
689 pr_debug("%08lx\n", nubus_get_rom(&rp, 4, bytelanes));
703 pr_debug("%02lx\n", nubus_get_rom(&rp, 1, bytelanes)); 690 pr_debug("%02lx\n", nubus_get_rom(&rp, 1, bytelanes));
704 pr_debug("%02lx\n", nubus_get_rom(&rp, 1, bytelanes)); 691 pr_debug("%02lx\n", nubus_get_rom(&rp, 1, bytelanes));
705 pr_debug("%08lx\n", nubus_get_rom(&rp, 4, bytelanes)); 692 pr_debug("%08lx\n", nubus_get_rom(&rp, 4, bytelanes));
706 pr_debug("%02lx\n", nubus_get_rom(&rp, 1, bytelanes)); 693 pr_debug("%02lx\n", nubus_get_rom(&rp, 1, bytelanes));
707 pr_debug("%02lx\n", nubus_get_rom(&rp, 1, bytelanes)); 694 pr_debug("%02lx\n", nubus_get_rom(&rp, 1, bytelanes));
708 pr_debug("%08lx\n", nubus_get_rom(&rp, 4, bytelanes));
709 pr_debug("%08lx\n", nubus_get_rom(&rp, 4, bytelanes));
710 pr_debug("%08lx\n", nubus_get_rom(&rp, 4, bytelanes));
711 rp = board->fblock; 695 rp = board->fblock;
712 696
713 board->slot = slot; 697 board->slot = slot;
@@ -747,7 +731,7 @@ static struct nubus_board * __init nubus_add_board(int slot, int bytelanes)
747 nubus_get_root_dir(board, &dir); 731 nubus_get_root_dir(board, &dir);
748 732
749 /* We're ready to rock */ 733 /* We're ready to rock */
750 pr_info("Slot %X:\n", slot); 734 pr_debug("Slot %X resources:\n", slot);
751 735
752 /* Each slot should have one board resource and any number of 736 /* Each slot should have one board resource and any number of
753 functional resources. So we'll fill in some fields in the 737 functional resources. So we'll fill in some fields in the
@@ -759,7 +743,6 @@ static struct nubus_board * __init nubus_add_board(int slot, int bytelanes)
759 pr_err("Board resource not found!\n"); 743 pr_err("Board resource not found!\n");
760 return NULL; 744 return NULL;
761 } else { 745 } else {
762 pr_info(" Board resource:\n");
763 nubus_get_board_resource(board, slot, &ent); 746 nubus_get_board_resource(board, slot, &ent);
764 } 747 }
765 748
@@ -831,6 +814,7 @@ static void __init nubus_scan_bus(void)
831{ 814{
832 int slot; 815 int slot;
833 816
817 pr_info("NuBus: Scanning NuBus slots.\n");
834 for (slot = 9; slot < 15; slot++) { 818 for (slot = 9; slot < 15; slot++) {
835 nubus_probe_slot(slot); 819 nubus_probe_slot(slot);
836 } 820 }
@@ -841,7 +825,6 @@ static int __init nubus_init(void)
841 if (!MACH_IS_MAC) 825 if (!MACH_IS_MAC)
842 return 0; 826 return 0;
843 827
844 pr_info("NuBus: Scanning NuBus slots.\n");
845 nubus_devices = NULL; 828 nubus_devices = NULL;
846 nubus_boards = NULL; 829 nubus_boards = NULL;
847 nubus_scan_bus(); 830 nubus_scan_bus();