Project

General

Profile

Bug #1648 » pci_boot.diff

Bill Sommerfeld, 2011-11-20 08:55 AM

View differences:

usr/src/uts/intel/io/pci/pci_boot.c Tue Nov 15 14:01:27 2011 -0500 → usr/src/uts/intel/io/pci/pci_boot.c Sun Nov 20 00:27:04 2011 -0800
1584 1584
				process_devfunc(bus, dev, func, header,
1585 1585
				    venid, config_op);
1586 1586

  
1587
				/*
1588
				 * process_devfunc may cause more functions
1589
				 * to surface
1590
				 */
1591
				if ((func == 0) && (nfunc != 8)) {
1592
					header = pci_getb(bus, dev, func,
1593
					    PCI_CONF_HEADER);
1594
					if ((header != 0xff) &&
1595
					    (header & PCI_HEADER_MULTI)) {
1596
						cmn_err(CE_NOTE, "But wait..."
1597
						    "there's more");
1598
						nfunc = 8;
1599
					}
1600
				}
1587 1601
			}
1588 1602
		}
1589 1603
	}
......
1907 1921
		return;
1908 1922
	}
1909 1923

  
1924
#define	PCI_VENDOR_ID_JMICRON		0x197b
1925
#define	PCI_DEVICE_ID_JMICRON_JMB363	0x2363
1926

  
1927
	if ((vendorid == PCI_VENDOR_ID_JMICRON) &&
1928
	    (deviceid == PCI_DEVICE_ID_JMICRON_JMB363) &&
1929
	    (func == 0)) {
1930
		/* Subset of magic numbers copied from linux */
1931
		uint32_t c1 = pci_getl(bus, dev, func, 0x40);
1932
		uint32_t c2 = pci_getl(bus, dev, func, 0x80);
1933

  
1934
		c1 &= ~0x00cff302;
1935
		c2 &= ~0x01000000;
1936

  
1937
		c1 |=  0x00c2a1b3;
1938
		c2 |=  0x01000000;
1939

  
1940
		cmn_err(CE_NOTE, "poking JMicron at %d %d %d"
1941
		    " with 0x%08x 0x%08x\n", bus, dev, func, c1, c2);
1942
		pci_putl(bus, dev, func, 0x40, c1);
1943
		pci_putl(bus, dev, func, 0x80, c2);
1944
	}
1945

  
1910 1946
	/* XXX should be use generic names? derive from class? */
1911 1947
	revclass = pci_getl(bus, dev, func, PCI_CONF_REVID);
1912 1948
	classcode = revclass >> 8;
    (1-1/1)