Переглянути джерело

Removed pci_find_device_x; it was too ugly to live.

tags/v0.9.3
Michael Brown 19 роки тому
джерело
коміт
67f122c645
1 змінених файлів з 2 додано та 137 видалено
  1. 2
    137
      src/core/btext.c

+ 2
- 137
src/core/btext.c Переглянути файл

@@ -36,8 +36,6 @@ static void draw_byte_16(unsigned char *bits, u32 *base, u32 rb);
36 36
 #endif
37 37
 static void draw_byte_8(unsigned char *bits, u32 *base, u32 rb);
38 38
 
39
-static int pci_find_device_x(int vendorx, int devicex, int index, struct pci_device *dev);
40
-
41 39
 static u32 g_loc_X;
42 40
 static u32 g_loc_Y;
43 41
 static u32 g_max_loc_X;
@@ -408,7 +406,8 @@ static void btext_init(void)
408 406
 #if USE_FILO_PCI_FIND==0
409 407
     struct pci_device dev;
410 408
 
411
-    pci_find_device_x(0x1002, 0x4752, 0, &dev);
409
+    #warning "pci_find_device_x no longer exists; use find_pci_device instead"
410
+    /*    pci_find_device_x(0x1002, 0x4752, 0, &dev); */
412 411
     if(dev.vendor==0) return; // no fb
413 412
 
414 413
     frame_buffer = (uint32_t)dev.membase;
@@ -442,141 +441,7 @@ static struct console_driver btext_console __console_driver = {
442 441
 
443 442
 INIT_FN ( INIT_CONSOLE, btext_init, NULL, NULL );
444 443
 
445
-#if USE_FILO_PCI_FIND==0
446
-int pci_find_device_x(int vendorx, int devicex, int index, struct pci_device *dev)
447
-{                       
448
-        unsigned int first_bus, first_devfn;
449
-        unsigned int devfn, bus, buses;
450
-#if 1
451
-        unsigned char hdr_type = 0;
452
-#endif
453
-        uint16_t vendor, device;
454
-        uint32_t l, membase;
455
-#if 0
456
-	uint32_t ioaddr, romaddr;
457
-        int reg;
458
-#endif
459
-
460
-        first_bus    = 0;
461
-        first_devfn  = 0;
462
-#if 0
463
-	if(dev->vendor!=0){
464
-                first_bus    = dev->bus;
465
-                first_devfn  = dev->devfn;
466
-                /* Re read the header type on a restart */
467
-                pcibios_read_config_byte(first_bus, first_devfn & ~0x7,
468
-                        PCI_HEADER_TYPE, &hdr_type);
469
-                dev->bus     = 0;
470
-                dev->devfn   = 0;
471
-	}
472
-#endif
473
-
474
-        /* Scan all PCI buses, until we find our card.
475
-         * We could be smart only scan the required buses but that
476
-         * is error prone, and tricky.
477
-         * By scanning all possible pci buses in order we should find
478
-         * our card eventually. 
479
-         */
480
-        buses=256;
481
-        for (bus = first_bus; bus < buses; ++bus) {
482
-                for (devfn = first_devfn; devfn < 0xff; ++devfn) {
483
-#if 1
484
-                        if (PCI_FUNC (devfn) == 0)
485
-                                pcibios_read_config_byte(bus, devfn, PCI_HEADER_TYPE, &hdr_type);
486
-                        else if (!(hdr_type & 0x80))    /* not a multi-function device */
487
-                                continue;
488
-#endif
489
-                        pcibios_read_config_dword(bus, devfn, PCI_VENDOR_ID, &l);
490
-                        /* some broken boards return 0 if a slot is empty: */
491
-                        if (l == 0xffffffff || l == 0x00000000) {
492
-                                continue;
493
-                        }
494
-                        vendor = l & 0xffff;
495
-                        device = (l >> 16) & 0xffff;
496
-#if 0
497
-                        pcibios_read_config_dword(bus, devfn, PCI_REVISION, &l);
498
-                        class = (l >> 8) & 0xffffff;
499
-#endif
500
-
501
-#if  0
502
-                {
503
-                        int i;
504
-                        printf("%hhx:%hhx.%hhx [%hX/%hX]\n",
505
-                                bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
506
-                                vendor, device);
507
-#if    0 
508
-                        for(i = 0; i < 256; i++) {
509
-                                unsigned char byte;
510
-                                if ((i & 0xf) == 0) {
511
-                                        printf("%hhx: ", i);
512
-                                }
513
-                                pcibios_read_config_byte(bus, devfn, i, &byte);
514
-                                printf("%hhx ", byte);
515
-                                if ((i & 0xf) == 0xf) {
516
-                                        printf("\n");
517
-                                }
518
-                        }
519
-#endif
520 444
 
521
-                }
522
-#endif
523
-			if(vendor != vendorx) continue;
524
-			
525
-			if(device != devicex) continue;
526
-
527
-			if(index !=0 ) {
528
-				index--;
529
-				continue;
530
-			}
531
-			
532
-				
533
-                        dev->devfn = devfn;
534
-                        dev->bus = bus;
535
-#if 0
536
-                        dev->class = class;
537
-#endif
538
-                        dev->vendor = vendor;
539
-                        dev->dev_id = device;
540
-
541
-#if 0
542
-                        /* Get the ROM base address */
543
-                        pcibios_read_config_dword(bus, devfn,
544
-                                PCI_ROM_ADDRESS, &romaddr);
545
-                        romaddr >>= 10;
546
-                        dev->romaddr = romaddr;
547
-#endif
548
-
549
-                        /* Get the ``membase'' */
550
-                        pcibios_read_config_dword(bus, devfn,
551
-                                PCI_BASE_ADDRESS_0, &membase);
552
-                        dev->membase = membase;
553
-#if 0
554
-                        /* Get the ``ioaddr'' */
555
-                        for (reg = PCI_BASE_ADDRESS_0; reg <= PCI_BASE_ADDRESS_5; reg += 4) {
556
-                                pcibios_read_config_dword(bus, devfn, reg, &ioaddr);
557
-                                if ((ioaddr & PCI_BASE_ADDRESS_IO_MASK) == 0 || (ioaddr & PCI_BASE_ADDRESS_SPACE_IO) == 0)
558
-                                        continue;
559
-
560
-
561
-                                /* Strip the I/O address out of the returned value */
562
-                                ioaddr &= PCI_BASE_ADDRESS_IO_MASK;
563
-
564
-                                /* Take the first one or the one that matches in boot ROM address */
565
-                                dev->ioaddr = ioaddr;
566
-                        }
567
-#endif
568
-#if 0
569
-                        printf("Found %s ROM address %#hx\n",
570
-                                dev->name, romaddr);
571
-#endif
572
-                        return 1;
573
-                }
574
-                first_devfn = 0;
575
-        }
576
-        first_bus = 0;
577
-	return 0;
578
-}
579
-#endif
580 445
 //come from linux/drivers/video/font-8x16.c
581 446
 /**********************************************/
582 447
 /*                                            */

Завантаження…
Відмінити
Зберегти