Browse Source

2020-01-07 / Folus Wen

Actions:
1. EVSE/Projects/define.h add variable CsuBootLoadFwRev to SysConfigData struct for u-boot version info synchronization.
2. board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/common/autoboot.c implement u-boot version update function.

Files:
1. As follow commit history.
FolusWen 5 years ago
parent
commit
5ba5aa0b8c

+ 1 - 0
EVSE/Projects/define.h

@@ -201,6 +201,7 @@ struct BtConfigData
 struct SysConfigData
 {
 	/**************System***************/
+	unsigned char 			CsuBootLoadFwRev[32];			//CSU board bootloader firmware version
 	unsigned char			ModelName[64];				//charger model name
 	unsigned char			SerialNumber[64];			//charger system serial number
 	unsigned char			SystemId[128];				//charger system ID

+ 12 - 0
board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/common/autoboot.c

@@ -17,6 +17,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define uboot_version "01.00"
+
 #define MAX_DELAY_STOP_STR 32
 
 #ifndef DEBUG_BOOTKEYS
@@ -343,6 +345,16 @@ void autoboot_command(const char *s)
 {
 	debug("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
 
+	{
+		unsigned char *BufTmp;
+
+		run_command_list("nand read 0x80000000 0x09C00000 0x00600000", -1, 0);
+		BufTmp=0x80000000;
+		sprintf(BufTmp,&uboot_version,strlen(uboot_version));
+		run_command_list("nand erase 0x09C00000 0x00600000", -1, 0);
+		run_command_list("nand write 0x80000000 0x09C00000 0x00600000", -1, 0);
+	}
+	
 	if (stored_bootdelay != -1 && s && !abortboot(stored_bootdelay)) {
 #if defined(CONFIG_AUTOBOOT_KEYED) && !defined(CONFIG_AUTOBOOT_KEYED_CTRLC)
 		int prev = disable_ctrlc(1);	/* disable Control C checking */