Giter Site home page Giter Site logo

dragonbluep / uboot-mt7621 Goto Github PK

View Code? Open in Web Editor NEW
53.0 53.0 134.0 21.59 MB

MTK U-Boot (MT7621) v2018.09 Build Customized u-boot Online

Makefile 0.71% C 94.98% Assembly 1.49% Python 1.74% Shell 0.17% ASL 0.09% GDB 0.01% Tcl 0.01% Batchfile 0.01% C++ 0.13% HTML 0.01% CSS 0.01% Perl 0.57% SmPL 0.03% sed 0.01% Lex 0.02% Yacc 0.04% Awk 0.01%

uboot-mt7621's People

Contributors

andy-shev avatar dragonbluep avatar gl-zhaojianhui avatar shenghuang147 avatar sjg20 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

uboot-mt7621's Issues

Is there any methods to reset or init gpios

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

Does the command 'mtk_board_flash_write' have issue?

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

is the command sf works 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,可以刷任意大小的固件。

May I get some programming advices about how to abortboot by network?

Sorry for my English.
For this target,I have done:

  1. common/autoboot.c
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
  1. net/arp.c
#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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.