fxp: enable bus mastering if needed
This is required for at least QEMU. However, as of writing, QEMU also requires fixes in its epro100 emulator before this driver can use it. Change-Id: Ie5c5ffe4311b1a0e581bc687f1c15de3a85f4a30
This commit is contained in:
		
							parent
							
								
									92293fafd3
								
							
						
					
					
						commit
						2e5374621d
					
				@ -424,7 +424,7 @@ static void fxp_pci_conf()
 | 
			
		||||
static int fxp_probe(fxp_t *fp, int skip)
 | 
			
		||||
{
 | 
			
		||||
	int r, devind;
 | 
			
		||||
	u16_t vid, did;
 | 
			
		||||
	u16_t vid, did, cr;
 | 
			
		||||
	u32_t bar;
 | 
			
		||||
	u8_t ilr, rev;
 | 
			
		||||
	char *str;
 | 
			
		||||
@ -452,6 +452,11 @@ static int fxp_probe(fxp_t *fp, int skip)
 | 
			
		||||
#endif
 | 
			
		||||
	pci_reserve(devind);
 | 
			
		||||
 | 
			
		||||
	/* Enable bus mastering if necessary. */
 | 
			
		||||
	cr = pci_attr_r16(devind, PCI_CR);
 | 
			
		||||
	if (!(cr & PCI_CR_MAST_EN))
 | 
			
		||||
		pci_attr_w16(devind, PCI_CR, cr | PCI_CR_MAST_EN);
 | 
			
		||||
 | 
			
		||||
	bar= pci_attr_r32(devind, PCI_BAR_2) & 0xffffffe0;
 | 
			
		||||
	if (bar < 0x400) {
 | 
			
		||||
		panic("fxp_probe: base address is not properly configured");
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user