update to version 2010.3 httpd-failsafe: removed warnings, cleanup html pages httpd-failsafe: kicking in if boot command fails httpd-failsafe: support of ctrl-c httpd-failsafe: fixed ether addr

thanks to Stas

SVN-Revision: 20756
v19.07.3_mercusys_ac12_duma
Ralph Hempel 14 years ago
parent c81d122238
commit f7b6aa6a44

@ -9,8 +9,9 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=u-boot
PKG_VERSION:=2009.11.1
PKG_MD5SUM:=6086421c9e2f3a0d0dbc5f706b551dbc
PKG_VERSION:=2010.03
PKG_MD5SUM:=2bf5ebf497dddc52440b1ea386cc1332
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

@ -7,9 +7,10 @@ $ make -s V=1
[CC] tools/img2srec.c
[CC] tools/bmp_logo.c
[CC] examples/hello_world.c
--- a/config.mk
+++ b/config.mk
@@ -206,17 +206,42 @@ export TEXT_BASE PLATFORM_CPPFLAGS PLATF
@@ -234,17 +234,42 @@ export TEXT_BASE PLATFORM_CPPFLAGS PLATF
#########################################################################

@ -1,6 +1,6 @@
--- a/MAKEALL
+++ b/MAKEALL
@@ -709,6 +709,12 @@ LIST_arm=" \
@@ -730,6 +730,12 @@ LIST_arm=" \
## MIPS Systems (default = big endian)
#########################################################################
@ -13,7 +13,7 @@
LIST_mips4kc=" \
incaip \
qemu_mips \
@@ -740,6 +746,7 @@ LIST_au1xx0=" \
@@ -761,6 +767,7 @@ LIST_au1xx0=" \
"
LIST_mips=" \
@ -23,7 +23,7 @@
${LIST_au1xx0} \
--- a/Makefile
+++ b/Makefile
@@ -474,7 +474,7 @@ $(obj)include/autoconf.mk: $(obj)include
@@ -447,7 +447,7 @@ $(obj)include/autoconf.mk: $(obj)include
set -e ; \
: Extract the config macros ; \
$(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \
@ -32,7 +32,7 @@
mv $@.tmp $@
#########################################################################
@@ -3354,7 +3354,7 @@ incaip_config: unconfig
@@ -3370,7 +3370,7 @@ incaip_config: unconfig
{ echo "#define CPU_CLOCK_RATE 150000000" >>$(obj)include/config.h ; \
$(XECHO) "... with 150MHz system clock" ; \
}
@ -41,7 +41,7 @@
tb0229_config: unconfig
@$(MKCONFIG) $(@:_config=) mips mips tb0229
@@ -3395,6 +3395,50 @@ vct_platinumavc_onenand_small_config: un
@@ -3411,6 +3411,50 @@ vct_platinumavc_onenand_small_config: un
@$(MKCONFIG) -a vct mips mips vct micronas
#########################################################################
@ -92,6 +92,16 @@
## MIPS32 AU1X00
#########################################################################
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -43,6 +43,7 @@ COBJS-$(CONFIG_FEC_MXC) += fec_mxc.o
COBJS-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o
COBJS-$(CONFIG_FTMAC100) += ftmac100.o
COBJS-$(CONFIG_GRETH) += greth.o
+COBJS-$(CONFIG_IFX_ETOP) += ifx_etop.o
COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
COBJS-$(CONFIG_KIRKWOOD_EGIGA) += kirkwood_egiga.o
COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -28,6 +28,7 @@ LIB := $(obj)libserial.a
@ -102,27 +112,17 @@
COBJS-$(CONFIG_MCFUART) += mcfuart.o
COBJS-$(CONFIG_NS9750_UART) += ns9750_serial.o
COBJS-$(CONFIG_SYS_NS16550) += ns16550.o
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -41,6 +41,7 @@ COBJS-$(CONFIG_FEC_MXC) += fec_mxc.o
COBJS-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o
COBJS-$(CONFIG_FTMAC100) += ftmac100.o
COBJS-$(CONFIG_GRETH) += greth.o
+COBJS-$(CONFIG_IFX_ETOP) += ifx_etop.o
COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
COBJS-$(CONFIG_KIRKWOOD_EGIGA) += kirkwood_egiga.o
COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -55,6 +55,7 @@ int fecmxc_initialize (bd_t *bis);
@@ -57,6 +57,7 @@ int fecmxc_initialize (bd_t *bis);
int ftmac100_initialize(bd_t *bits);
int greth_initialize(bd_t *bis);
void gt6426x_eth_initialize(bd_t *bis);
+int ifx_etop_initialize(bd_t *bis);
int inca_switch_initialize(bd_t *bis);
int kirkwood_egiga_initialize(bd_t *bis);
int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
@@ -82,6 +83,7 @@ int uec_standard_init(bd_t *bis);
int lan91c96_initialize(u8 dev_num, int base_addr);
@@ -85,6 +86,7 @@ int uec_standard_init(bd_t *bis);
int uli526x_initialize(bd_t *bis);
int sh_eth_initialize(bd_t *bis);
int dm9000_initialize(bd_t *bis);

@ -1,7 +1,5 @@
Index: u-boot-2009.11.1/common/env_common.c
===================================================================
--- u-boot-2009.11.1.orig/common/env_common.c 2010-01-25 09:35:12.000000000 +0100
+++ u-boot-2009.11.1/common/env_common.c 2010-03-29 13:20:50.000000000 +0200
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -26,6 +26,7 @@
#include <common.h>
@ -10,10 +8,8 @@ Index: u-boot-2009.11.1/common/env_common.c
#include <environment.h>
#include <linux/stddef.h>
#include <malloc.h>
Index: u-boot-2009.11.1/common/env_embedded.c
===================================================================
--- u-boot-2009.11.1.orig/common/env_embedded.c 2010-03-29 13:22:19.000000000 +0200
+++ u-boot-2009.11.1/common/env_embedded.c 2010-03-29 13:22:29.000000000 +0200
--- a/common/env_embedded.c
+++ b/common/env_embedded.c
@@ -27,6 +27,7 @@
#define __ASM_STUB_PROCESSOR_H__ /* don't include asm/processor. */
#include <config.h>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,530 @@
--- a/board/infineon/easy50712/danube.c
+++ b/board/infineon/easy50712/danube.c
@@ -354,7 +354,7 @@ int do_http_upgrade(const unsigned char
}
/* write the image to the flash */
puts("http ugrade ...\n");
- sprintf(buf, "era ${kernel_addr} +0x%x; cp.b ${ram_addr} ${kernel_addr} 0x%x", size, size);
+ sprintf(buf, "era ${kernel_addr} +0x%lx; cp.b ${ram_addr} ${kernel_addr} 0x%lx", size, size);
return run_command(buf, 0);
}
--- a/common/main.c
+++ b/common/main.c
@@ -273,6 +273,10 @@ static __inline__ int abortboot(int boot
void main_loop (void)
{
+#ifdef CONFIG_CMD_HTTPD
+ int ret;
+#endif
+
#ifndef CONFIG_SYS_HUSH_PARSER
static char lastcommand[CONFIG_SYS_CBSIZE] = { 0, };
int len;
@@ -403,12 +407,22 @@ void main_loop (void)
# endif
# ifndef CONFIG_SYS_HUSH_PARSER
- run_command (s, 0);
+ ret = run_command (s, 0);
# else
- parse_string_outer(s, FLAG_PARSE_SEMICOLON |
+ ret = parse_string_outer(s, FLAG_PARSE_SEMICOLON |
FLAG_EXIT_FROM_LOOP);
# endif
+# ifdef CONFIG_CMD_HTTPD
+ if (ret < 0) {
+ printf("Failed to execute bootcmd "
+ "(maybe invalid u-boot environment?), "
+ "starting httpd to update firmware...\n");
+ NetLoopHttpd();
+ }
+# endif
+
+
# ifdef CONFIG_AUTOBOOT_KEYED
disable_ctrlc(prev); /* restore Control C checking */
# endif
--- a/include/configs/easy50712.h
+++ b/include/configs/easy50712.h
@@ -114,4 +114,7 @@
#define CONFIG_CMD_HTTPD /* enable upgrade via HTTPD */
+#define CONFIG_IPADDR 192.168.0.119
+#define CONFIG_ETHADDR 00:01:02:03:04:05
+
#endif /* __CONFIG_H */
--- a/lib_mips/time.c
+++ b/lib_mips/time.c
@@ -29,6 +29,8 @@ static unsigned long timestamp;
/* how many counter cycles in a jiffy */
#define CYCLES_PER_JIFFY (CONFIG_SYS_MIPS_TIMER_FREQ + CONFIG_SYS_HZ / 2) / CONFIG_SYS_HZ
+unsigned long ifx_get_cpuclk(void);
+
/*
* timer without interrupts
*/
--- a/net/httpd.c
+++ b/net/httpd.c
@@ -35,12 +35,14 @@ HttpdHandler (void)
}
}
+#if 0
static void
HttpdTimeout (void)
{
puts ("T ");
NetSetTimeout (TIMEOUT * 1000, HttpdTimeout);
}
+#endif
void
HttpdStart (void)
--- a/net/net.c
+++ b/net/net.c
@@ -1966,7 +1966,7 @@ NetSendHttpd(void)
void
NetReceiveHttpd(volatile uchar * inpkt, int len)
{
- memcpy(uip_buf, inpkt, len);
+ memcpy(uip_buf, (const void *)inpkt, len);
uip_len = len;
if(BUF->type == htons(UIP_ETHTYPE_IP)) {
uip_arp_ipin();
@@ -1989,6 +1989,7 @@ NetLoopHttpd(void)
unsigned long long tout = 0;
bd_t *bd = gd->bd;
unsigned short int ip[2];
+ struct uip_eth_addr eaddr;
#ifdef CONFIG_NET_MULTI
NetRestarted = 0;
@@ -2039,6 +2040,15 @@ restart:
eth_getenv_enetaddr("ethaddr", NetOurEther);
#endif
+ eaddr.addr[0] = NetOurEther[0];
+ eaddr.addr[1] = NetOurEther[1];
+ eaddr.addr[2] = NetOurEther[2];
+ eaddr.addr[3] = NetOurEther[3];
+ eaddr.addr[4] = NetOurEther[4];
+ eaddr.addr[5] = NetOurEther[5];
+
+ uip_setethaddr(eaddr);
+
NetCopyIP(&NetOurIP, &bd->bi_ip_addr);
NetOurGatewayIP = getenv_IPaddr ("gatewayip");
NetOurSubnetMask= getenv_IPaddr ("netmask");
@@ -2072,6 +2082,14 @@ restart:
tout = t1;
}
}
+
+ if (ctrlc()) {
+ eth_halt();
+ puts ("\nAbort\n");
+ return (-1);
+ }
+
+
if(!httpd_upload_complete)
continue;
printf("Bytes transferred = %ld (%lx hex)\n",
--- a/net/uip-0.9/fsdata.c
+++ b/net/uip-0.9/fsdata.c
@@ -1,199 +1,108 @@
-static const char data_flashing_html[] = {
- /* /flashing.html */
- 0x2f, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
- 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32,
- 0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72,
- 0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x30,
- 0x2e, 0x39, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
- 0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73, 0x2e, 0x63,
- 0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69,
- 0x70, 0x2f, 0x29, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x74, 0x65,
- 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74,
- 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa,
- 0xd, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x3c, 0x62,
- 0x6f, 0x64, 0x79, 0x20, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3d,
- 0x22, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x20, 0x30,
- 0x70, 0x74, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x3b, 0x20, 0x68,
- 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x31, 0x30, 0x30, 0x25,
- 0x3b, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x23,
- 0x66, 0x66, 0x66, 0x3b, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67,
- 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x63, 0x6f, 0x6c, 0x6f,
- 0x72, 0x3a, 0x20, 0x23, 0x66, 0x62, 0x62, 0x30, 0x33, 0x34,
- 0x3b, 0x22, 0x3e, 0x3c, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72,
- 0x3e, 0x3c, 0x68, 0x31, 0x3e, 0x55, 0x70, 0x67, 0x72, 0x61,
- 0x64, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65,
- 0x6d, 0x20, 0x2e, 0x2e, 0x2e, 0x2e, 0x3c, 0x2f, 0x68, 0x31,
- 0x3e, 0x3c, 0x2f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3e,
- 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c, 0x2f, 0x68,
- 0x74, 0x6d, 0x6c, 0x3e, 0xa, };
-
-static const char data_fail_html[] = {
- /* /fail.html */
- 0x2f, 0x66, 0x61, 0x69, 0x6c, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
- 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32,
- 0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72,
- 0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x30,
- 0x2e, 0x39, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
- 0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73, 0x2e, 0x63,
- 0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69,
- 0x70, 0x2f, 0x29, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x74, 0x65,
- 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74,
- 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa,
- 0xd, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xa, 0x9,
- 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0xa, 0x9, 0x9, 0x3c,
- 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3e, 0xa, 0x9, 0x9, 0x9,
- 0x4c, 0x61, 0x46, 0x6f, 0x6e, 0x65, 0x72, 0x61, 0x20, 0x46,
- 0x61, 0x69, 0x6c, 0x73, 0x61, 0x66, 0x65, 0x20, 0x55, 0x49,
- 0xa, 0x9, 0x9, 0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65,
- 0x3e, 0xa, 0x9, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0xa,
- 0x9, 0x9, 0x3c, 0x68, 0x31, 0x3e, 0x46, 0x6c, 0x61, 0x73,
- 0x68, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x65,
- 0x64, 0x3c, 0x2f, 0x68, 0x31, 0x3e, 0xa, 0x9, 0x9, 0x45,
- 0x52, 0x52, 0x4f, 0x52, 0x20, 0x2d, 0x20, 0x74, 0x68, 0x65,
- 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x79, 0x6f, 0x75,
- 0x20, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x20,
- 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20,
- 0x70, 0x61, 0x73, 0x73, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66,
- 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x50,
- 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x6d, 0x61, 0x6b, 0x65,
- 0x20, 0x73, 0x75, 0x72, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x75,
- 0x73, 0x65, 0x20, 0x61, 0x6e, 0x20, 0x6f, 0x66, 0x66, 0x69,
- 0x63, 0x69, 0x61, 0x6c, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74,
- 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64,
- 0x20, 0x62, 0x79, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
- 0x2f, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x2e,
- 0x66, 0x6f, 0x6e, 0x6f, 0x73, 0x66, 0x65, 0x72, 0x61, 0x2e,
- 0x6f, 0x72, 0x67, 0x2f, 0xa, 0x9, 0x3c, 0x2f, 0x62, 0x6f,
- 0x64, 0x79, 0x3e, 0xa, 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c,
- 0x3e, 0xa, };
-
-static const char data_404_html[] = {
- /* /404.html */
- 0x2f, 0x34, 0x30, 0x34, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
- 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x34,
- 0x30, 0x34, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x6e, 0x6f,
- 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0xd, 0xa, 0x53,
- 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50,
- 0x2f, 0x30, 0x2e, 0x39, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70,
- 0x3a, 0x2f, 0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73,
- 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f,
- 0x75, 0x69, 0x70, 0x2f, 0x29, 0xd, 0xa, 0x43, 0x6f, 0x6e,
- 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a,
- 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c,
- 0xd, 0xa, 0xd, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e,
- 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x62, 0x67, 0x63, 0x6f,
- 0x6c, 0x6f, 0x72, 0x3d, 0x22, 0x77, 0x68, 0x69, 0x74, 0x65,
- 0x22, 0x3e, 0x3c, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3e,
- 0x3c, 0x68, 0x31, 0x3e, 0x34, 0x30, 0x34, 0x20, 0x2d, 0x20,
- 0x66, 0x69, 0x6c, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66,
- 0x6f, 0x75, 0x6e, 0x64, 0x3c, 0x2f, 0x68, 0x31, 0x3e, 0x3c,
- 0x2f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3e, 0x3c, 0x2f,
- 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c, 0x2f, 0x68, 0x74, 0x6d,
- 0x6c, 0x3e, };
-
-static const char data_index_html[] = {
- /* /index.html */
- 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
- 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32,
- 0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72,
- 0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x30,
- 0x2e, 0x39, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
- 0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73, 0x2e, 0x63,
- 0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69,
- 0x70, 0x2f, 0x29, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x74, 0x65,
- 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74,
- 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa,
- 0xd, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xa, 0x9,
- 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0xa, 0x9, 0x9, 0x3c,
- 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3e, 0xa, 0x9, 0x9, 0x9,
- 0x4c, 0x61, 0x46, 0x6f, 0x6e, 0x65, 0x72, 0x61, 0x20, 0x46,
- 0x61, 0x69, 0x6c, 0x73, 0x61, 0x66, 0x65, 0x20, 0x55, 0x49,
- 0xa, 0x9, 0x9, 0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65,
- 0x3e, 0xa, 0x9, 0x3c, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e,
- 0xa, 0x9, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x73, 0x74,
- 0x79, 0x6c, 0x65, 0x3d, 0x22, 0x6d, 0x61, 0x72, 0x67, 0x69,
- 0x6e, 0x3a, 0x20, 0x30, 0x70, 0x74, 0x20, 0x61, 0x75, 0x74,
- 0x6f, 0x3b, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a,
- 0x31, 0x30, 0x30, 0x25, 0x3b, 0x20, 0x63, 0x6f, 0x6c, 0x6f,
- 0x72, 0x3a, 0x20, 0x23, 0x30, 0x30, 0x30, 0x3b, 0x20, 0x62,
- 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d,
- 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x23, 0x66, 0x62,
- 0x62, 0x30, 0x33, 0x34, 0x3b, 0x22, 0x3e, 0xa, 0x9, 0x9,
- 0x3c, 0x68, 0x31, 0x3e, 0x4c, 0x61, 0x46, 0x6f, 0x6e, 0x65,
- 0x72, 0x61, 0x20, 0x46, 0x61, 0x69, 0x6c, 0x73, 0x61, 0x66,
- 0x65, 0x20, 0x55, 0x49, 0x3c, 0x2f, 0x68, 0x31, 0x3e, 0xa,
- 0x9, 0x9, 0x3c, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65,
- 0x74, 0x68, 0x6f, 0x64, 0x3d, 0x22, 0x70, 0x6f, 0x73, 0x74,
- 0x22, 0x20, 0x65, 0x6e, 0x63, 0x74, 0x79, 0x70, 0x65, 0x3d,
- 0x22, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x61, 0x72, 0x74,
- 0x2f, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61,
- 0x22, 0x3e, 0xa, 0x9, 0x9, 0x9, 0x3c, 0x69, 0x6e, 0x70,
- 0x75, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x66, 0x69,
- 0x6c, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x66, 0x69,
- 0x72, 0x6d, 0x77, 0x61, 0x72, 0x65, 0x3e, 0xa, 0x9, 0x9,
- 0x9, 0x3c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x74, 0x79,
- 0x70, 0x65, 0x3d, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x3e,
- 0xa, 0x9, 0x9, 0x3c, 0x2f, 0x66, 0x6f, 0x72, 0x6d, 0x3e,
- 0xa, 0x9, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0xa,
- 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xa, };
-
-static const char data_flash_html[] = {
- /* /flash.html */
- 0x2f, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0,
- 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32,
- 0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72,
- 0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x30,
- 0x2e, 0x39, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
- 0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73, 0x2e, 0x63,
- 0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69,
- 0x70, 0x2f, 0x29, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x74, 0x65,
- 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74,
- 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa,
- 0xd, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xa, 0x9,
- 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0xa, 0x9, 0x9, 0x3c,
- 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3e, 0xa, 0x9, 0x9, 0x9,
- 0x4c, 0x61, 0x46, 0x6f, 0x6e, 0x65, 0x72, 0x61, 0x20, 0x46,
- 0x61, 0x69, 0x6c, 0x73, 0x61, 0x66, 0x65, 0x20, 0x55, 0x49,
- 0xa, 0x9, 0x9, 0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65,
- 0x3e, 0xa, 0x9, 0x3c, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e,
- 0xa, 0x9, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x73, 0x74,
- 0x79, 0x6c, 0x65, 0x3d, 0x22, 0x6d, 0x61, 0x72, 0x67, 0x69,
- 0x6e, 0x3a, 0x20, 0x30, 0x70, 0x74, 0x20, 0x61, 0x75, 0x74,
- 0x6f, 0x3b, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a,
- 0x31, 0x30, 0x30, 0x25, 0x3b, 0x20, 0x63, 0x6f, 0x6c, 0x6f,
- 0x72, 0x3a, 0x20, 0x23, 0x30, 0x30, 0x30, 0x3b, 0x20, 0x62,
- 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d,
- 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x23, 0x66, 0x62,
- 0x62, 0x30, 0x33, 0x34, 0x3b, 0x22, 0x3e, 0xa, 0x9, 0x9,
- 0x3c, 0x68, 0x31, 0x3e, 0x46, 0x6c, 0x61, 0x73, 0x68, 0x69,
- 0x6e, 0x67, 0x3c, 0x2f, 0x68, 0x31, 0x3e, 0xa, 0x9, 0x9,
- 0x54, 0x68, 0x65, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d,
- 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x77, 0x20, 0x74, 0x72,
- 0x79, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x66, 0x6c,
- 0x61, 0x73, 0x68, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68,
- 0x65, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x70,
- 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x2c, 0x20, 0x74, 0x68,
- 0x65, 0x20, 0x6c, 0x65, 0x64, 0x73, 0x20, 0x77, 0x69, 0x6c,
- 0x6c, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x74, 0x6f,
- 0x20, 0x62, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0xa, 0xa, 0x9,
- 0x9, 0x41, 0x66, 0x74, 0x65, 0x72, 0x20, 0x61, 0x20, 0x73,
- 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x6c,
- 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68,
- 0x65, 0x20, 0x62, 0x6f, 0x78, 0x20, 0x77, 0x69, 0x6c, 0x6c,
- 0x20, 0x72, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0xa, 0x9, 0x3c,
- 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0xa, 0x3c, 0x2f, 0x68,
- 0x74, 0x6d, 0x6c, 0x3e, 0xa, };
-
-const struct fsdata_file file_flashing_html[] = {{NULL, data_flashing_html, data_flashing_html + 15, sizeof(data_flashing_html) - 15}};
+static const char data_flashing_html[] =
+"HTTP/1.0 200 OK\n"
+"Server: uIP/0.9 (http://dunkels.com/adam/uip/)\n"
+"Content-type: text/html\n"
+"\n"
+"<html>\n"
+"\t<head>\n"
+"\t\t<title>\n"
+"\t\t\tFailsafe UI\n"
+"\t\t</title>\n"
+"\t</head>\n"
+"\t<body>\n"
+"\t\t<center><h1>Upgrading system...</h1></center>\n"
+"\t</body>\n"
+"</html>\n";
+
+static const char data_fail_html[] =
+"HTTP/1.0 200 OK\n"
+"Server: uIP/0.9 (http://dunkels.com/adam/uip/)\n"
+"Content-type: text/html\n"
+"\n"
+"<html>\n"
+"\t<head>\n"
+"\t\t<title>\n"
+"\t\t\tFailsafe UI\n"
+"\t\t</title>\n"
+"\t</head>\n"
+"\t<body>\n"
+"\t\t<h1>Flashing failed</h1>\n"
+"\t\tERROR - the image you uploaded failed to pass verification.<br>\n"
+"\t\tPlease make sure to use an official update provided by http://lantiq.com/\n"
+"\t</body>\n"
+"</html>\n";
+
+static const char data_404_html[] =
+"HTTP/1.0 404 File not found\n"
+"Server: uIP/0.9 (http://dunkels.com/adam/uip/)\n"
+"Content-type: text/html\n"
+"\n"
+"<html>\n"
+"\t<head>\n"
+"\t\t<title>\n"
+"\t\t\tFailsafe UI\n"
+"\t\t</title>\n"
+"\t</head>\n"
+"\t<body>\n"
+"\t\t<center><h1>404 - file not found</h1></center>\n"
+"\t</body>\n"
+"</html>\n";
+
+static const char data_index_html[] =
+"HTTP/1.0 200 OK\n"
+"Server: uIP/0.9 (http://dunkels.com/adam/uip/)\n"
+"Content-type: text/html\n"
+"\n"
+"<html>\n"
+"\t<head>\n"
+"\t\t<title>\n"
+"\t\t\tFailsafe UI\n"
+"\t\t</title>\n"
+"\t</head>\n"
+"\t<body>\n"
+"\t\t<h1>Failsafe UI</h1>\n"
+"\t\t<form method=\"post\" enctype=\"multipart/form-data\">\n"
+"\t\t\t<input type=file name=firmware>\n"
+"\t\t\t<input type=submit>\n"
+"\t\t</form>\n"
+"\t</body>\n"
+"</html>\n";
+
+static const char data_flash_html[] =
+"HTTP/1.0 200 OK\n"
+"Server: uIP/0.9 (http://dunkels.com/adam/uip/)\n"
+"Content-type: text/html\n"
+"\n"
+"<html>\n"
+"\t<head>\n"
+"\t\t<title>\n"
+"\t\t\tFailsafe UI\n"
+"\t\t</title>\n"
+"\t</head>\n"
+"\t<body>\n"
+"\t\t<h1>Flashing...</h1>\n"
+"\t\tThe system is now trying to flash. If there is a problem, the LEDs will "
+"start to blink.<br>\n"
+"\n"
+"\t\tAfter a successful update the box will reboot\n"
+"\t</body>\n"
+"</html>\n";
+
+const struct fsdata_file file_flashing_html[] =
+{{NULL, "/flashing.html", data_flashing_html, sizeof(data_flashing_html)}};
+
+const struct fsdata_file file_fail_html[] =
+{{file_flashing_html, "/fail.html", data_fail_html, sizeof(data_fail_html)}};
-const struct fsdata_file file_fail_html[] = {{file_flashing_html, data_fail_html, data_fail_html + 11, sizeof(data_fail_html) - 11}};
+const struct fsdata_file file_404_html[] =
+{{file_fail_html, "/404.html", data_404_html, sizeof(data_404_html)}};
-const struct fsdata_file file_404_html[] = {{file_fail_html, data_404_html, data_404_html + 10, sizeof(data_404_html) - 10}};
+const struct fsdata_file file_index_html[] =
+{{file_404_html, "/index.html", data_index_html, sizeof(data_index_html)}};
-const struct fsdata_file file_index_html[] = {{file_404_html, data_index_html, data_index_html + 12, sizeof(data_index_html) - 12}};
-
-const struct fsdata_file file_flash_html[] = {{file_index_html, data_flash_html, data_flash_html + 12, sizeof(data_flash_html) - 12}};
+const struct fsdata_file file_flash_html[] =
+{{file_index_html, "/flash.html", data_flash_html, sizeof(data_flash_html)}};
#define FS_ROOT file_flash_html
-#define FS_NUMFILES 5
\ No newline at end of file
+#define FS_NUMFILES 5
--- a/net/uip-0.9/httpd.c
+++ b/net/uip-0.9/httpd.c
@@ -130,7 +130,7 @@ httpd_appcall(void)
if(!fs_open((const char *)&uip_appdata[4], &fsfile))
{
PRINTLN("couldn't open file");
- fs_open(file_index_html.name, &fsfile);
+ fs_open(file_404_html.name, &fsfile);
}
}
hs->script = 0;
@@ -141,7 +141,7 @@ httpd_appcall(void)
if(hs->state == HTTP_FIRMWARE)
{
unsigned char *start = (unsigned char*)uip_appdata;
- char *clen = strstr(start, "Content-Length:");
+ char *clen = strstr((char *)start, "Content-Length:");
int len = 0;
unsigned char *next, *end;
unsigned char *boundary_start;
@@ -150,14 +150,14 @@ httpd_appcall(void)
if(clen)
{
clen += sizeof("Content-Length:");
- next = strstr(clen, eol);
+ next = (unsigned char *)strstr(clen, eol);
if(next)
{
len = atoi(clen);
next++;
printf("expecting %d bytes\n", len);
upload_data = httpd_upload_data = (unsigned char *)do_http_tmp_address();
- printf("received data will be stored at 0x%08X\n", upload_data);
+ printf("received data will be stored at %p\n", upload_data);
if(!upload_data)
{
printf("failed to allocate memory\n");
@@ -174,14 +174,14 @@ httpd_appcall(void)
uip_close();
return;
}
- boundary_start = strstr(next, "---");
+ boundary_start = (unsigned char *)strstr((char *)next, "---");
if(!boundary_start)
{
uip_close();
return;
}
- end = strstr(boundary_start, eol);
- if(!eol)
+ end = (unsigned char *)strstr((char *)boundary_start, eol);
+ if(!end)
{
uip_close();
return;
@@ -189,13 +189,13 @@ httpd_appcall(void)
boundary_len = end - boundary_start;
memcpy(boundary, boundary_start, boundary_len);
boundary[boundary_len] = 0;
- next = strstr(boundary_start, "name=\"firmware\";");
+ next = (unsigned char *)strstr((char *)boundary_start, "name=\"firmware\";");
if(!next)
{
uip_close();
return;
}
- next = strstr(next, eol2);
+ next = (unsigned char *)strstr((char *)next, eol2);
if(!next)
{
printf("could not find start of data\n");
@@ -259,7 +259,6 @@ httpd_appcall(void)
{
if(upload_running)
{
- int i;
httpd_upload_complete = 1;
// for(i = 0; i < hs->upload_total; i++)
// printf("%c", httpd_upload_data[i]);
@@ -267,7 +266,7 @@ httpd_appcall(void)
uip_close();
}
}
- uip_send(hs->dataptr, hs->count);
+ uip_send((unsigned char *)hs->dataptr, hs->count);
}
break;
Loading…
Cancel
Save