]> git.sur5r.net Git - u-boot/blobdiff - net/bootp.c
MX53: DDR: Fix ZQHWCTRL field TZQ_CS
[u-boot] / net / bootp.c
index 73470f2d46fc66942b65e39a975be89e43329f4a..9e324769db12e07b49b4a6dda91c01487d1fa035 100644 (file)
@@ -17,6 +17,7 @@
 #ifdef CONFIG_STATUS_LED
 #include <status_led.h>
 #endif
+#include <linux/compiler.h>
 
 #define BOOTP_VENDOR_MAGIC     0x63825363      /* RFC1048 Magic Cookie         */
 
@@ -105,7 +106,7 @@ static int BootpCheckPkt(uchar *pkt, unsigned dest, unsigned src, unsigned len)
  */
 static void BootpCopyNetParams(Bootp_t *bp)
 {
-       IPaddr_t tmp_ip;
+       __maybe_unused IPaddr_t tmp_ip;
 
        NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
 #if !defined(CONFIG_BOOTP_SERVERIP)
@@ -138,36 +139,6 @@ static int truncate_sz (const char *name, int maxlen, int curlen)
        return (curlen);
 }
 
-/*
- * Check if autoload is enabled. If so, use either NFS or TFTP to download
- * the boot file.
- */
-static void auto_load(void)
-{
-       const char *s = getenv("autoload");
-
-       if (s != NULL) {
-               if (*s == 'n') {
-                       /*
-                        * Just use BOOTP to configure system;
-                        * Do not use TFTP to load the bootfile.
-                        */
-                       NetState = NETLOOP_SUCCESS;
-                       return;
-               }
-#if defined(CONFIG_CMD_NFS)
-               if (strcmp(s, "NFS") == 0) {
-                       /*
-                        * Use NFS to load the bootfile.
-                        */
-                       NfsStart();
-                       return;
-               }
-#endif
-       }
-       TftpStart();
-}
-
 #if !defined(CONFIG_CMD_DHCP)
 
 static void BootpVendorFieldProcess (u8 * ext)
@@ -351,10 +322,11 @@ BootpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
                BootpVendorProcess((uchar *)&bp->bp_vend[4], len);
 
        NetSetTimeout(0, (thand_f *)0);
+       bootstage_mark_name(BOOTSTAGE_ID_BOOTP_STOP, "bootp_stop");
 
        debug("Got good BOOTP\n");
 
-       auto_load();
+       net_auto_load();
 }
 #endif
 
@@ -618,6 +590,7 @@ BootpRequest (void)
        Bootp_t *bp;
        int ext_len, pktlen, iplen;
 
+       bootstage_mark_name(BOOTSTAGE_ID_BOOTP_START, "bootp_start");
 #if defined(CONFIG_CMD_DHCP)
        dhcp_state = INIT;
 #endif
@@ -978,8 +951,10 @@ DhcpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
                        BootpCopyNetParams(bp); /* Store net params from reply */
                        dhcp_state = BOUND;
                        printf ("DHCP client bound to address %pI4\n", &NetOurIP);
+                       bootstage_mark_name(BOOTSTAGE_ID_BOOTP_STOP,
+                                           "bootp_stop");
 
-                       auto_load();
+                       net_auto_load();
                        return;
                }
                break;