rtl8139: enable bus mastering if needed
This resolves #2. Change-Id: Ie6736f0d5a713025f09c18de7042ba44fbb1b2f8
This commit is contained in:
parent
e321f65582
commit
b49f4cacde
1 changed files with 8 additions and 2 deletions
|
@ -411,7 +411,7 @@ re_t *rep;
|
||||||
int skip;
|
int skip;
|
||||||
{
|
{
|
||||||
int r, devind;
|
int r, devind;
|
||||||
u16_t vid, did;
|
u16_t cr, vid, did;
|
||||||
u32_t bar;
|
u32_t bar;
|
||||||
u8_t ilr;
|
u8_t ilr;
|
||||||
#if VERBOSE
|
#if VERBOSE
|
||||||
|
@ -437,7 +437,13 @@ int skip;
|
||||||
printf("%s (%x/%x) at %s\n", dname, vid, did, pci_slot_name(devind));
|
printf("%s (%x/%x) at %s\n", dname, vid, did, pci_slot_name(devind));
|
||||||
#endif
|
#endif
|
||||||
pci_reserve(devind);
|
pci_reserve(devind);
|
||||||
/* printf("cr = 0x%x\n", pci_attr_r16(devind, PCI_CR)); */
|
|
||||||
|
/* Enable bus mastering if necessary. */
|
||||||
|
cr = pci_attr_r16(devind, PCI_CR);
|
||||||
|
/* printf("cr = 0x%x\n", 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) & 0xffffffe0;
|
bar= pci_attr_r32(devind, PCI_BAR) & 0xffffffe0;
|
||||||
if (bar < 0x400) {
|
if (bar < 0x400) {
|
||||||
panic("base address is not properly configured");
|
panic("base address is not properly configured");
|
||||||
|
|
Loading…
Reference in a new issue