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基础 str partition 以参数字符串切分字符串,只切分为三部分
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- linux下设置软件使用socks5代理
1.为wget使用代理,可以直接修改/etc/wgetrc,也可以在主文件夹下新建.wgetrc,并编辑相应内容,本文采用后者. 直接往~/.wgetrc(自行创建此文件)添加如下内容: https_ ...
- vuejs全局api概念
什么是全局API? 全局API并不在构造器里,而是先声明全局变量或者直接在Vue上定义一些新功能,Vue内置了一些全局API,比如我们今天要学习的指令Vue.directive.说的简单些就是,在构造 ...
- 如何获取xml循环体报文内容
Xml报文格式如下所示: <body> <FILENAME></FILENAME> <records>20</records> < ...
- MongoDB(课时18 修改器)
3.4.3.2 修改器(原子操作) 对MongoDB数据库而言,数据的修改会牵扯到内容的变更,结构的变更(包含数组),所以在MongoDB在设计的时候就提供有一系列的修改器的应用,那么像之前使用的“$ ...
- 微信小程序 - 简述
1.小程序理解 基于微信的 免安装 MVVM 应用 编码使用 ES 6 一个页面基本组成:wxml wxss js ( html.css.js ) 2. 常见用法 ( 基本就是跟着例子走.. ) 设置 ...
- m_Orchestrate learning system---三十、项目中的dist文件一般是做什么的
m_Orchestrate learning system---三十.项目中的dist文件一般是做什么的 一.总结 一句话总结: Bootstrap switch:dist 目录是放最终的js和css ...
- 免费下载知网文献的方法 | sci-hub免费下载SCI论文方法
部分方法参考自在家里如何免费使用中国知网? - 大学生 - 知乎的回答,已注明出处. 知网文献下载:idata中国知网 idata中国知网网址:idata中国知网 https://www.cn-ki. ...
- 通过IIS寄宿WCF服务
WCF全面解析一书中的例子S104,直接将Service目录部署到iis是无法得到服务相应的,需要在项目中新建一个web项目,删除掉自动生成的所有文件之后,把Service目录下的Calculator ...
- Android之侧滑菜单DrawerLayout的使用
在android support.v4 中有一个抽屉视图控件DrawerLayout.使用这个控件,可以生成通过在屏幕上水平滑动打开或者关闭菜单,能给用户一个不错的体验效果. DrawerLayout ...