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 ...
随机推荐
- 在Android Studio中创建项目和模拟器
北京电子科技学院 实 验 报 告 课程:移动平台应用开发实践 班级:201592 姓名:杨凤 学号:20159213 成绩:___________ 指导老师:娄嘉 ...
- 把json的字符串变为json对象
如{"tag":"sendcode","data":{"phone":"18880488738"}} ...
- JQuery插件模板
(function($){ $.fn.插件名 = function(settings){ var defaultSettings = { } /* 合并默认参数和用户自定义参数 */settings ...
- ExtJS使用入门
extjs是基于 yui 由 jack slocum开发, sencha是他们的公司, sencha是由三个项目合并起来的开源项目: ExtJS, jqTouch, Raphael(拉斐尔, 圣经中的 ...
- P3870 [TJOI2009]开关
思路 重题 代码 #include <iostream> #include <vector> #include <cstdio> #include <cstr ...
- Unity3D学习笔记(三):V3、运动、帧率、OnGUI
盯着看:盯住一个点 transform.LookAt(Vector3 worldPosition); using System.Collections; using System.Collection ...
- The way to Go(1): Introduction
Reference: Github: Go Github: The way to Go Introduction to Go 设计要求: 能够以更快的速度开发软件 开发出的软件能够很好地在现代的多核计 ...
- HDU 2222 Keywords Search(AC自动机模板题)
http://acm.hdu.edu.cn/showproblem.php?pid=2222 题意:给出多个单词,最后再给出一个模式串,求在该模式串中包含了多少个单词. 思路: AC自动机的模板题. ...
- ng-model 数据不更新 及 ng-repeat【ngRepeat:dupes】错误
一.ng-include 引入的文件中 ,ng-model 数据不更新 例如, $scope.username = “Jones” .此时,在 ng-include 引入的文件中,直接使用 ng-m ...
- Java 面向对象之继承和重写OverWrite,重写和重载的区别,抽象类
01继承的概述 A:继承的概念 a:继承描述的是事物之间的所属关系,通过继承可以使多种事物之间形成一种关系体系 b:在Java中,类的继承是指在一个现有类的基础上去构建一个新的类,构建出来的新类被称作 ...