]> Zhao Yanbai Git Server - minix.git/commitdiff
beaglebone ethernet improvements 42/742/3
authorMichal Maka <mmaka@jpembedded.eu>
Tue, 13 Aug 2013 15:01:14 +0000 (17:01 +0200)
committerBen Gras <ben@minix3.org>
Mon, 19 Aug 2013 13:47:10 +0000 (13:47 +0000)
. 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

commands/netconf/netconf.sh
drivers/lan8710a/README.txt
drivers/lan8710a/lan8710a.c

index c435379afb909a1280eb2aa085a21d0d535ba4bf..c9f75ad9f8653f916bc7340a939808bf76b707d2 100644 (file)
@@ -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
index 6b6e6e990d372dbaa6326e4a3584d9716d6221aa..7dc461a0dd9c6c663ea4b89e6901641fa754d78d 100644 (file)
@@ -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:                                       *
index 506236f153f26d6c9a971fe9799018053d8be4eb..d355f55ef2c377dec614525c51d4ceaf4115e82f 100644 (file)
@@ -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;
 }