From: Michal Maka Date: Tue, 13 Aug 2013 15:01:14 +0000 (+0200) Subject: beaglebone ethernet improvements X-Git-Tag: v3.3.0~837 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=0c044c6b02c4ca3f0b9dcea7283b092054e2309a;p=minix.git beaglebone ethernet improvements . added enable interrupts routine at the HW init stage . remove workaround, obsoleted by libnetdriver change . change netconf.sh to allow configuring this driver, changed README.txt to reflect this Change-Id: Ib659d5a55be96022b5e9013caa556dca5092ce89 --- diff --git a/commands/netconf/netconf.sh b/commands/netconf/netconf.sh index c435379af..c9f75ad9f 100644 --- a/commands/netconf/netconf.sh +++ b/commands/netconf/netconf.sh @@ -99,17 +99,18 @@ card() printf "%2d. %s %s\n" "$card_number" "$card_mark" "$card_name" } -first_pcicard=4 +first_pcicard=5 cards() { # Run lspci once to a temp file for use in 'card' function - lspci >$LSPCI || exit + lspci >$LSPCI 2>/dev/null || true card 0 "No Ethernet card (no networking)" card 1 "3Com 501 or 3Com 509 based card" card 2 "Realtek 8029 based card (also emulated by Qemu)" "10EC:8029" card 3 "NE2000, 3com 503 or WD based card (also emulated by Bochs)" + card 4 "lan8710a (on BeagleBone, BeagleBone Black)" n=$first_pcicard for pcicard in $pci_list do var=\$pci_descr$pcicard; descr="`eval echo $var`" @@ -201,6 +202,7 @@ drv_params() test "$v" = 1 && echo "Note: After installing, edit $LOCALRC to the right configuration." test "$v" = 1 && echo " chose option 4, the defaults for emulation by Bochs have been set." ;; + 4) driver=lan8710a; ;; $first_after_pci) driver="psip0"; ;; *) warn "choose a number" esac diff --git a/drivers/lan8710a/README.txt b/drivers/lan8710a/README.txt index 6b6e6e990..7dc461a0d 100644 --- a/drivers/lan8710a/README.txt +++ b/drivers/lan8710a/README.txt @@ -8,14 +8,9 @@ created July 2013, JPEmbedded (info@jpembedded.eu) -------------------------------------------------------------------------------- * INSTALLATION: * -------------------------------------------------------------------------------- -To install LAN8710A for BeagleBone under MINIX you have to edit /etc/inet.conf -by adding line: -eth0 lan8710a 0 { default; }; -and changing: -psip0 { default; }; -to: -psip1; -Restart the system and the driver should work. +To install LAN8710A for BeagleBone under MINIX you execute 'netconf' as +usual. Select the LAN8710A driver from the list. Restart the system +and the driver should work. -------------------------------------------------------------------------------- * TESTS: * diff --git a/drivers/lan8710a/lan8710a.c b/drivers/lan8710a/lan8710a.c index 506236f15..d355f55ef 100644 --- a/drivers/lan8710a/lan8710a.c +++ b/drivers/lan8710a/lan8710a.c @@ -58,7 +58,6 @@ main(int argc, char *argv[]) message m; int r; int ipc_status; - static int rx_first_enabled = FALSE; /* SEF local startup */ env_setargs(argc, argv); @@ -90,18 +89,6 @@ main(int argc, char *argv[]) break; case DL_GETSTAT_S: lan8710a_getstat(&m); - /* - * Workaround: - * Re-enabling interrupts here is made to avoid - * problem that Rx interrupt came when it can't - * be handled. When this problem occurs next Rx - * interrupts don't appear. - */ - if(rx_first_enabled == FALSE) { - rx_first_enabled = TRUE; - lan8710a_enable_interrupt(RX_INT | - TX_INT); - } break; default: panic("Illegal message: %d", m.m_type); @@ -796,6 +783,9 @@ lan8710a_init_hw(void) /* GMII RX and TX release from reset. */ lan8710a_reg_set(CPSW_SL_MACCONTROL(1), CPSW_SL_GMII_EN); + + /* Enable interrupts. */ + lan8710a_enable_interrupt(RX_INT | TX_INT); return TRUE; }