From 898cce256fbdc393df0d2897d890f19d8bcb53fe Mon Sep 17 00:00:00 2001 From: Thomas Veerman Date: Tue, 15 Mar 2011 10:04:35 +0000 Subject: [PATCH] Add support for the 82567LM flavor of e1000 --- commands/netconf/netconf.sh | 2 +- drivers/e1000/e1000.c | 30 +++++++++++++++++++++--------- etc/system.conf | 1 + 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/commands/netconf/netconf.sh b/commands/netconf/netconf.sh index 9606e64ce..d6513deaa 100644 --- a/commands/netconf/netconf.sh +++ b/commands/netconf/netconf.sh @@ -111,7 +111,7 @@ cards() card 6 "NE2000, 3com 503 or WD based card (also emulated by Bochs)" card 7 "AMD LANCE (also emulated by VMWare and VirtualBox)" "1022:2000" card 8 "Intel PRO/1000 Gigabit" \ - "8086:100E" "8086:107C" "8086:10CD" "8086:10D3" + "8086:100E" "8086:107C" "8086:10CD" "8086:10D3" "8086:10DE" card 9 "Attansic/Atheros L2 FastEthernet" "1969:2048" card 10 "DEC Tulip 21140A in VirtualPC" "1011:0009" diff --git a/drivers/e1000/e1000.c b/drivers/e1000/e1000.c index 976e7dd0b..b7cb86b42 100644 --- a/drivers/e1000/e1000.c +++ b/drivers/e1000/e1000.c @@ -25,6 +25,7 @@ PRIVATE u16_t pcitab_e1000[] = { E1000_DEV_ID_82540EM, E1000_DEV_ID_82541GI_LF, + E1000_DEV_ID_ICH10_D_BM_LM, E1000_DEV_ID_ICH10_R_BM_LF, E1000_DEV_ID_82574L, 0, @@ -282,11 +283,12 @@ PRIVATE int e1000_probe(e1000_t *e, int skip) */ switch (did) { + case E1000_DEV_ID_ICH10_D_BM_LM: case E1000_DEV_ID_ICH10_R_BM_LF: e->eeprom_read = eeprom_ich; break; - case E1000_DEV_ID_82574L: + case E1000_DEV_ID_82574L: case E1000_DEV_ID_82541GI_LF: e->eeprom_done_bit = (1 << 1); e->eeprom_addr_off = 2; @@ -326,14 +328,24 @@ PRIVATE int e1000_probe(e1000_t *e, int skip) did != E1000_DEV_ID_82540EP && pci_attr_r32(devind, PCI_BAR_2)) { - if((e->flash = vm_map_phys(SELF, - (void *) pci_attr_r32(devind, PCI_BAR_2), 0x10000)) == MAP_FAILED) { - if((e->flash = vm_map_phys(SELF, - (void *) pci_attr_r32(devind, PCI_BAR_2), 0x1000)) - == MAP_FAILED) { - panic("e1000: couldn't map in flash."); - } - } + size_t flash_size; + + /* 82566/82567/82562V series support mapping 4kB of flash memory */ + switch(did) + { + case E1000_DEV_ID_ICH10_D_BM_LM: + case E1000_DEV_ID_ICH10_R_BM_LF: + flash_size = 0x1000; + break; + default: + flash_size = 0x10000; + } + + if ((e->flash = vm_map_phys(SELF, + (void *) pci_attr_r32(devind, PCI_BAR_2), + flash_size)) == MAP_FAILED) { + panic("e1000: couldn't map in flash."); + } gfpreg = E1000_READ_FLASH_REG(e, ICH_FLASH_GFPREG); /* diff --git a/etc/system.conf b/etc/system.conf index 466315d58..dc6d45409 100644 --- a/etc/system.conf +++ b/etc/system.conf @@ -600,6 +600,7 @@ service e1000 pci device 8086/107c; pci device 8086/10cd; pci device 8086/10d3; + pci device 8086/10de; ipc SYSTEM pm rs log tty ds vm pci inet ; -- 2.44.0