extern int do_bootm(cmd_tbl_t *, int, int, char *[]);
static int netboot_common(proto_t, cmd_tbl_t *, int, char *[]);
+#if defined(CONFIG_CMD_HTTPD)
int do_httpd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
return NetLoopHttpd();
}
U_BOOT_CMD(httpd, 1, 1, do_httpd, "start www server for firmware recovery\n", NULL);
+#endif /* CONFIG_CMD_HTTPD */
int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
return netboot_common(TFTP, cmdtp, argc, argv);
#define CONFIG_CMD_ECHO
#define CONFIG_CMD_ENV
#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_HTTPD
#define CONFIG_CMD_IMI
#define CONFIG_CMD_ITEST
#define CONFIG_CMD_LED
#error "Reset button definition is required for recovery"
#endif
+ #if defined(CONFIG_CMD_HTTPD)
+ #define SCRIPT_HTTP_PART_1 \
+ "echo - 3s for web based recovery;"
+
+ #define SCRIPT_HTTP_PART_2 \
+ "elif test $cnt -ge 3; then " \
+ "echo HTTP server is starting for firmware update...;" \
+ "setenv stop_boot 1;" \
+ "echo;" \
+ "httpd;" \
+ "elif test $cnt -lt 3; then "
+ #else
+ #define SCRIPT_HTTP_PART_1 ""
+ #define SCRIPT_HTTP_PART_2 \
+ "elif test $cnt -lt 5; then "
+ #endif
+
#define CONFIG_ENV_BTN_RECOVERY_SCRIPT \
"recovery=" \
"if button; then " \
"sleep 600;" \
"setenv cnt 0;" \
"echo Keep button pressed for at least:;" \
- "echo - 3s for web based recovery;" \
+ SCRIPT_HTTP_PART_1 \
"echo - 5s for U-Boot console;" \
"echo - 7s for network console;" \
"echo;" \
"echo Starting U-Boot console...;" \
"setenv stop_boot 1;" \
"echo;" \
- "elif test $cnt -ge 3; then " \
- "echo HTTP server is starting for firmware update...;" \
- "setenv stop_boot 1;" \
- "echo;" \
- "httpd;" \
- "elif test $cnt -lt 3; then " \
+ SCRIPT_HTTP_PART_2 \
"echo \\#\\# Error: button was not pressed long enough!;" \
"echo Continuing normal boot...;" \
"echo;" \
#include <command.h>
#include <net.h>
#include <asm/byteorder.h>
+
+#if defined(CONFIG_CMD_HTTPD)
#include "httpd.h"
#include "../httpd/uipopt.h"
return(0);
}
+#endif /* CONFIG_CMD_HTTPD */
#include "tftp.h"
#include "rarp.h"
#include "nfs.h"
+#if defined(CONFIG_CMD_HTTPD)
#include "httpd.h"
+#endif
#if defined(CONFIG_CMD_SNTP)
#include "sntp.h"
#endif
+#if defined(CONFIG_CMD_HTTPD)
#include "../httpd/uipopt.h"
#include "../httpd/uip.h"
#include "../httpd/uip_arp.h"
+#endif
#if defined(CONFIG_CMD_NET)
#define ARP_TIMEOUT_COUNT (CONFIG_NET_RETRY_COUNT)
#endif
+#if defined(CONFIG_CMD_HTTPD)
unsigned char *webfailsafe_data_pointer = NULL;
int webfailsafe_is_running = 0;
int webfailsafe_ready_for_upgrade = 0;
void NetReceiveHttpd(volatile uchar * inpkt, int len);
extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+#endif
/** BOOTP EXTENTIONS **/
IPaddr_t NetOurSubnetMask = 0; /* Our subnet mask (0=unknown) */
printf("Packet received\n");
#endif
+ #if defined(CONFIG_CMD_HTTPD)
if(webfailsafe_is_running){
NetReceiveHttpd(inpkt, len);
return;
}
+ #endif
NetRxPkt = inpkt;
NetRxPktLen = len;
* HTTPD section
*/
+#if defined(CONFIG_CMD_HTTPD)
+
#define BUF ((struct uip_eth_hdr *)&uip_buf[0])
void NetSendHttpd(void){
return(-1);
}
+#endif /* CONFIG_CMD_HTTPD */