dragonbluep / uboot-mt7621 Goto Github PK
View Code? Open in Web Editor NEWMTK U-Boot (MT7621) v2018.09 Build Customized u-boot Online
MTK U-Boot (MT7621) v2018.09 Build Customized u-boot Online
Hi,there. sorry for my English.
the common gpio is 19,it seems to be resetted after the firmware loaded controlled by the code of firewarm.
I need to reset or init pcie -reset-gpios like 19 24 25. before the firmware loaded.but I didnt find any way in the u-boot code
int hex2int(char ch)
{
if(isdigit(ch))
return ch - 48;
if( ch < 'A' || (ch > 'F' && ch < 'a') || ch > 'f' )
return -1;
if(isalpha(ch))
return isupper(ch) ? ch - 55 : ch - 87;
return -1;
}
static int do_testflash(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]){
if ( argc <= 3 )
return cmd_usage(cmdtp);
void *flash;
flash = mtk_board_get_flash_dev();
ulong offset=simple_strtoul(argv[2], NULL, 16);
uint8_t *buf ={0x01};
int ret;
if ( strcmp(argv[1], "r") == 0 ){
printf("testflash read ...\n");
ulong length=simple_strtoul(argv[3], NULL, 16);
ret = mtk_board_flash_read(flash, offset, length, buf);
print_buffer(offset, buf, 1, length, 16);
int i;
for(i=0; i<length; i++){
printf("buf_r[%d]= %d \n", i,buf[i]);
}
// unmap_sysmem(buf);
return 0;
}
else if ( strcmp(argv[1], "w") == 0 ) {
printf("testflash write ...\n");
size_t length = strlen(argv[3]);
if (length % 2 == 1 ) {
return cmd_usage(cmdtp);
}
printf("length= %d \n", length);
int i,m,n;
int k=0;
uint8_t j;
for(i=0; i<length; i=i+2){
m = hex2int(argv[3][i]);
n = hex2int(argv[3][i+1]);
if ( m == -1 || n == -1 ) {
return cmd_usage(cmdtp);
k=1;
break;
}
j = ( ( m << 4 ) + n );
printf("combine=%d \n", j);
buf[i>>1]=j;
}
length = length>>1;
for(i=0; i<length; i++){
printf("buf[%d]= %d \n", i,buf[i]);
}
if ( k == 0 ){
ret = mtk_board_flash_write(flash, offset, length, buf);
printf("ret=%d \n", ret);
}
printf("ret=%d \n", ret);
return 0;
}
else
{
return cmd_usage(cmdtp);
}
}
U_BOOT_CMD(testflash, 4, 0, do_testflash,
"MTK testflash utility",
"testflash <r|w> <offset> <len>\n"
"type - upgrade file type\n"
" r|w - Read or Write\n"
" offset - First offset\n"
" len/hex - Length/HEX\n"
);
testflash r works fine.
testflash w works not fine;
usually,it works fine when the content of flash has not been written
but if the content of the flash has been written ,Even if the power is replugged,it works maybe not fine
I try to run sf 0x3fff000 0xff0000 0x100
as what i know
0x3fff000 should be ram address
0xff0000 should be flash offset
0x100 should be the length read from flash to ram
but compare before to after the command:
the result of md.b read 0x3fff000 0x100 are same
Is it an issue?
我ZTE E8820s用的最新的源码编译的128m的nand flash的uboot,内存是256m,刷小于30m的factory固件可以正常刷入,但是刷46m左右的就会直接提示upgrade failed,请问是我的方法不对,还是确实有固件大小的限制?用专用的breed,可以刷任意大小的固件。
Sorry for my English.
For this target,I have done:
static int abortboot(int bootdelay)
{
int abort = 0;
/*
* If 192.168.1.2 exist,stop autoboot
*/
int a=run_command("ping 192.168.1.2", 0);
printf("a = %d\n", a);
if (a == 1) {
if (bootdelay >= 0)
abort = __abortboot(bootdelay);
}
else {
abort = 1;
run_command("httpd", 0);
}
printf("abort = %d\n", abort);
#ifdef CONFIG_SILENT_CONSOLE
#ifndef CONFIG_NET_RETRY_COUNT
# define ARP_TIMEOUT_COUNT 5 /* # of timeouts before giving up */
#else
# define ARP_TIMEOUT_COUNT CONFIG_NET_RETRY_COUNT
#endif
# define ARP_TIMEOUT 5000UL
# define ARP_TIMEOUT_COUNT 3
一、It wokes fine,but I dont want to change arp.c to decrease the whole time of arp-timeout ,is there any function could be programming into autoboot.c let the function ping run for a fixed time?
二、A better way for abortbooting is reciving a text by tcp or udp,could I get some advices how to make it?Do I need to find a library file like tcp.c?
三、What I need alway helps not issues,Is it suitable write here and is there a more suitable way for it?
Can I upgrade other Bootloader image by this uboot?
是否能够添加1g内存的支持?谢谢
I get a connection reset after uploading firmware via the web interface, but TFTP works just fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.