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 ...
随机推荐
- python函数总结
1.函数是一种子程序.程序员使用函数来减少代码重复,并用于组织或模块化程序.一旦定义了函数,它可以从程序中的许多不同位置被多次调用.参数允许函数具有可更改的部分.函数定义中出现的参数称之为形参,函数调 ...
- python创建MySQL多实例-1
python创建MySQL多实例-1 前言 什么是多实例 多实例就是允许在同一台机器上创建另外一套不同配置文件的数据库,他们之间是相互独立的,主要有以下特点, 1> 不能同时使用一个端口 2&g ...
- LOJ#2170. 「POI2011」木棍 Sticks
题目链接 题意就是给你一堆线段,然后线段有长度和颜色,让你选三条组成一个三角形,这三条线段颜色不能一样 题解: 做法:贪心 首先按照长度给这些线段排序一遍 然后贪心的去选,对于已经选出来同种颜色的,就 ...
- python 二叉排序树
class BSTNode: def __init__(self, data, left=None, right=None): self.data = data self.left = left se ...
- Python day20正则表达式和re方法
元字符6个函数以及几个元字符1.'.'通配符2.'^'以什么开头3.'$'以什么结尾4.'*'紧挨着的字符0~∞次5.'+'紧挨着的字符1~∞次6.'?'紧挨的字符0次或1次7.'{}' {0,}== ...
- [原][osg][gdal]两种方式修改tiff高程
因为对于globalmap不熟悉,不怎么怎么修改高程,好像也没有这功能. 干脆自己手动修改了高程图tiff了 由于自身一直使用osg的 自己使用了osgDB直接读取tiff,修改后保存的. 同事小周一 ...
- 在centos下解决 “致命错误:curses.h:没有那个文件或目录”
当在centos下编译带有头文件<curses.h> 的程序时,出现以下错误: “致命错误:curses.h:没有那个文件或目录” ,最后在“https://zhidao.baidu.co ...
- RabbitMQ入门_14_Policies
参考资料:https://www.rabbitmq.com/parameters.html#policies A. Policies 的用途 RabbitMQ 有很多可选参数(x-arguments) ...
- hdu 5724-Chess(状态压缩+sg函数)
hdu 5724-Chess 代码: #include<bits/stdc++.h> using namespace std; ; <<N]; bool S[N]; void ...
- UVA - 11853 Paintball(dfs)
UVA - 11853 思路:dfs,从最上面超过上边界的圆开始搜索,看能不能搜到最下面超过下边界的圆. 代码: #include<bits/stdc++.h> using namespa ...