learning uboot support web http function in qca4531 cpu
reference :https://forum.openwrt.org/viewtopic.php?id=43237
reference :http://blog.chinaunix.net/uid-22547469-id-5048943.html
cp httpd cus531-16m/ -a
cp net/httpd.c cus531-16m/
cp net/httpd.h cus531-16m/
修改net.c
#ifdef CONFIG_STATUS_LED
#include <status_led.h>
#include <miiphy.h>
#endif
//add by panzidong
#include "httpd.h"
#include "../httpd/uipopt.h"
#include "../httpd/uip.h"
#include "../httpd/uip_arp.h"
#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
#include "sntp.h"
#endif
#if (CONFIG_COMMANDS & CFG_CMD_NET)
#if 0
#define ET_DEBUG
#endif
// add by panzidong
unsigned char *webfailsafe_data_pointer = NULL;
int webfailsafe_is_running = 0;
int webfailsafe_ready_for_upgrade = 0;
int webfailsafe_upgrade_type = WEBFAILSAFE_UPGRADE_TYPE_FIRMWARE;
void NetReceiveHttpd(volatile uchar * inpkt, int len);
extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
void
NetReceive(volatile uchar * inpkt, int len)
{
// add by panzidong
if(webfailsafe_is_running){
NetReceiveHttpd(inpkt, len);
return;
}
NetRxPkt = inpkt;
NetRxPktLen = len;
et = (Ethernet_t *)inpkt;
从蓝本的net/net.c中将后面三个函数粘贴到此。以#define BUF ((struct uip_eth_hdr *)&uip_buf[0])开头的那段代码。
增加httpd命令:
./include/net.h
/* Initialize the network adapter */
extern int NetLoop(proto_t);
//add by panzidong
extern int NetLoopHttpd(void);
extern void NetSendHttpd(void);
static int netboot_common (proto_t, cmd_tbl_t *, int , char *[]);
// add by panzidong
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);
顶层的Makefiel
board953x_config : unconfig
@ >include/config.h
@echo '#define CONFIG_ATHEROS 1' >include/config.h
@echo '#define CONFIG_MACH_QCA953x 1' >>include/config.h
@echo '#define CFG_INIT_STACK_IN_SRAM 1' >>include/config.h
@echo '#define CONFIG_'`echo $(CFG_BOARD_TYPE) | tr [a-z] [A-Z] | sed s/-/_/g`' 1' >>include/config.h
@echo '#define __CONFIG_BOARD_NAME $(CFG_BOARD_TYPE)' >>include/config.h
@echo '#define CONFIG_BOARD_NAME "$(CFG_BOARD_TYPE)"' >>include/config.h
@echo "#define BUILD_VERSION "\"$(BUILDVERSION)\" >>include/config.h
##
## add by panzidong
##
@echo "#define CONFIG_DELAY_TO_AUTORUN_HTTPD 3" >> include/config.h
@echo "#define CONFIG_DELAY_TO_AUTORUN_CONSOLE 5" >> include/config.h
@echo "#define CONFIG_DELAY_TO_AUTORUN_NETCONSOLE 7" >> include/config.h
@echo "#define CONFIG_MAX_BUTTON_PRESSING 10" >> include/config.h
Common/main.c
#ifdef CONFIG_SILENT_CONSOLE
DECLARE_GLOBAL_DATA_PTR;
#endif
// add by panzidong
extern int reset_button_status(void);
extern void all_led_on(void);
extern void all_led_off(void);
extern int NetLoopHttpd(void);
extern void udelay(unsigned long usec);
#define milisecdelay(_x) udelay((_x) * 1000)
Board/Atheros/board953x.c
// add by panzidong
int reset_button_status(void){
return 0;
}
void all_led_on(void){
}
void all_led_off(void){
}
learning uboot support web http function in qca4531 cpu的更多相关文章
- learning uboot how to enable watchdog in qca4531 cpu
find cpu datasheet , watchdog relate registers: 0x18060008 watchdong timer control 0x1806000c watchd ...
- learning uboot distro design in am335x-evm board
reference: uboot_dir/doc/README.distro Linux distributions are faced with supporting a variety of bo ...
- Orthogonal Least Squares Learning Algorithm for Radial Basis Function Networks
Orthogonal Least Squares Learning Algorithm for Radial Basis Function Networks S. Chen, C. F. N. Cow ...
- learning uboot auto switch to stanbdy system in qca4531 cpu
design: when uboot load kerne failed,we can switch to stanbdy system; how to realize: when boot fail ...
- learning uboot how to set ddr parameter in qca4531 cpu
DDR工作频率 在600MHZ. include/configs/board953x.h #define CFG_PLL_FREQ CFG_PLL_650_600_200 #d ...
- learning uboot enable protect console
reference :https://github.com/lentinj/u-boot/blob/master/doc/README.autoboot how to enable protect s ...
- learning uboot test command
uboot commad test test - minimal test like /bin/sh so we can use test command to some judge for exam ...
- learning uboot switch to standby system using button
pseudocode: If(reset_button was pressed ) { Change uboot env bootslot^1 }
- learning uboot source command
reference: http://www.denx.de/wiki/DULG/UBootCmdGroupExec => help source source - run script from ...
随机推荐
- Python3基础 逻辑运算 and or not 示例
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- DD-WRT自定义脚本更新花生壳DDNS
N年以前买了一个tp-link 841n v7,一直用的还算可以吧,除了不定期重启路由器,不然网速慢的龟爬啊!这也是TP原厂固件的通病,于是刷了DD-WRT,话说DD确实很爽,除了功能强大之外,而且很 ...
- 【Git安装】centos安装git
1 yum install git 安装后的默认存放地点/usr/bin/git
- 【第九章】 springboot + mybatis + 多数据源 (AOP实现)
在第八章 springboot + mybatis + 多数据源代码的基础上,做两点修改 1.ShopDao package com.xxx.firstboot.dao; import org.spr ...
- 对Tomcat启动或运行时,项目对jar包依赖路径的一些粗浅认知
Tomcat在运行webapp项目的时候,需要各种依赖jar包.它会从2个地方去找这些包 1.Tomcat自己的lib目录中 2.webapp目录下,webapps\{项目}\WEB-INF\lib ...
- TeamViewer 说明截图
- 转载:oracle RAC集群启动和关闭
http://www.cnblogs.com/yhfssp/p/8184761.html oracle 11G RAC集群启动和关闭: 1.停止数据库 $srvctl stop database –d ...
- SpringMVC实现多种数据类型绑定
绑定基本数据类型 Java基本数据类型int的默认值是0,在使用int进行url传递参数时,参数key是必须写的,其值也只能是int类型的,否则将会报错. 比如方法: @RequestMapping( ...
- 《剑指offer》第九题(用两个栈实现队列)
// 面试题:用两个栈实现队列 // 题目:用两个栈实现一个队列.队列的声明如下,请实现它的两个函数appendTail // 和deleteHead,分别完成在队列尾部插入结点和在队列头部删除结点的 ...
- CSS实现和选择器
CSS实现和选择器 本课内容: 一.实现CSS四种方式 1,每个html标签中都有一个style样式属性,该属性的值就是css代码.(针对一个标签)2,使用style标签的方式. 一般都定义在head ...