瀏覽代碼

2020-07-27 /Edward Lien

Actions:
1.Merge from AW-Regular V52.

Files:
1. As follow commit history

Image version: D0.26.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
Edward Lien 4 年之前
父節點
當前提交
07e240683e
共有 36 個文件被更改,包括 1055 次插入698 次删除
  1. 2 2
      EVSE/Projects/AW-CCS/Apps/Module_EventLogging.c
  2. 23 0
      EVSE/Projects/AW-CCS/Apps/Module_InternalComm.c
  3. 445 56
      EVSE/Projects/AW-CCS/Apps/main.c
  4. 1 0
      EVSE/Projects/AW-CCS/Apps/main.h
  5. 二進制
      EVSE/Projects/AW-CCS/Images/FactoryDefaultConfig.bin
  6. 二進制
      EVSE/Projects/AW-CCS/Images/MLO
  7. 二進制
      EVSE/Projects/AW-CCS/Images/am335x-evm.dtb
  8. 二進制
      EVSE/Projects/AW-CCS/Images/ramdisk.gz
  9. 二進制
      EVSE/Projects/AW-CCS/Images/u-boot-spl.bin
  10. 二進制
      EVSE/Projects/AW-CCS/Images/u-boot.img
  11. 二進制
      EVSE/Projects/AW-CCS/Images/zImage
  12. 二進制
      EVSE/Projects/AW-Regular/Images/FactoryDefaultConfig.bin
  13. 二進制
      EVSE/Projects/AW-Regular/Images/MLO
  14. 二進制
      EVSE/Projects/AW-Regular/Images/ramdisk.gz
  15. 二進制
      EVSE/Projects/AW-Regular/Images/u-boot.img
  16. 二進制
      EVSE/Projects/AW-Regular/Images/zImage
  17. 二進制
      EVSE/Projects/BYTON-GB/Images/FactoryDefaultConfig.bin
  18. 二進制
      EVSE/Projects/BYTON-GB/Images/MLO
  19. 二進制
      EVSE/Projects/BYTON-GB/Images/ramdisk.gz
  20. 二進制
      EVSE/Projects/BYTON-GB/Images/u-boot.img
  21. 二進制
      EVSE/Projects/BYTON-GB/Images/zImage
  22. 二進制
      EVSE/Projects/Noodoe/Images/FactoryDefaultConfig.bin
  23. 二進制
      EVSE/Projects/Noodoe/Images/MLO
  24. 二進制
      EVSE/Projects/Noodoe/Images/ramdisk.gz
  25. 二進制
      EVSE/Projects/Noodoe/Images/u-boot-spl.bin
  26. 二進制
      EVSE/Projects/Noodoe/Images/u-boot.img
  27. 二進制
      EVSE/Projects/Noodoe/Images/zImage
  28. 150 150
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_System.map
  29. 150 150
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_kallsyms1.S
  30. 150 150
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_kallsyms2.S
  31. 1 1
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.version
  32. 45 98
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/.am335x-evm.dtb.dts.tmp
  33. 73 83
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dts
  34. 13 6
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/lib/.gen_crc32table.cmd
  35. 1 1
      board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/.am335x-evm.dtb.dts.tmp
  36. 1 1
      board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/am335x-evm.dts

+ 2 - 2
EVSE/Projects/AW-CCS/Apps/Module_EventLogging.c

@@ -96,7 +96,7 @@ int StoreEventLogMsg(const char *fmt, ...)
 
 	if((ShmSysConfigAndInfo->SysConfig.ModelName != NULL) && (ShmSysConfigAndInfo->SysConfig.SerialNumber != NULL) && (strlen((char*)ShmSysConfigAndInfo->SysConfig.ModelName) >= 14))
 	{
-		sprintf(Buf,"echo \"[%04d.%02d.%02d %02d:%02d:%02d] - %s\" >> /Storage/EventLog/[%04d.%02d]%s_%s_EventLog",
+		sprintf(Buf,"echo -n \"[%04d.%02d.%02d %02d:%02d:%02d] - %s\" >> /Storage/EventLog/[%04d.%02d]%s_%s_EventLog",
 					tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
 					buffer,
 					tm->tm_year+1900,tm->tm_mon+1,
@@ -105,7 +105,7 @@ int StoreEventLogMsg(const char *fmt, ...)
 	}
 	else
 	{
-		sprintf(Buf,"echo \"[%04d.%02d.%02d %02d:%02d:%02d] - %s\" >> /Storage/EventLog/[%04d.%02d]EventLog",
+		sprintf(Buf,"echo -n \"[%04d.%02d.%02d %02d:%02d:%02d] - %s\" >> /Storage/EventLog/[%04d.%02d]EventLog",
 					tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
 					buffer,
 					tm->tm_year+1900,tm->tm_mon+1);

+ 23 - 0
EVSE/Projects/AW-CCS/Apps/Module_InternalComm.c

@@ -31,6 +31,8 @@
 #include	"main.h"
 #include	"Module_InternalComm.h"
 
+//#define SIMULATION
+
 #define FAIL_SPEC_COMM		1000
 #define ARRAY_SIZE(A)		(sizeof(A) / sizeof(A[0]))
 #define PASS				1
@@ -50,6 +52,8 @@ struct OCPP16Data 				*ShmOCPP16Data;
 struct Charger					*ShmCharger;
 
 uint16_t						stepIndex;
+long long						tsLast, tsNow;
+double							tmpPowerConsumption;
 
 void trim(char *s);
 int mystrcmp(char *p1,char *p2);
@@ -111,6 +115,14 @@ int DiffTimeb(struct timeb ST, struct timeb ET)
 	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
 }
 
+long long current_timestamp()
+{
+    struct timeval te;
+    gettimeofday(&te, NULL); // get current time
+    long long milliseconds = te.tv_sec*1000LL + te.tv_usec/1000; // calculate milliseconds
+    return milliseconds;
+}
+
 //=================================
 // Common routine
 //=================================
@@ -969,10 +981,17 @@ unsigned char Query_Power_Consumption(unsigned char fd, unsigned char targetAddr
 		   (rx[1] == tx[2]) &&
 		   (rx[3] == tx[3]))
 		{
+#ifndef SIMULATION
 			Ret_Buf_T-> power_consumption = ((uint32_t)rx[6] | (((uint32_t)rx[7])<<8) | (((uint32_t)rx[8])<<16) | (((uint32_t)rx[9])<<24));
 			Ret_Buf_L1-> power_consumption = ((uint32_t)rx[10] | (((uint32_t)rx[11])<<8) | (((uint32_t)rx[12])<<16) | (((uint32_t)rx[13])<<24));
 			Ret_Buf_L2-> power_consumption = ((uint32_t)rx[14] | (((uint32_t)rx[15])<<8) | (((uint32_t)rx[16])<<16) | (((uint32_t)rx[17])<<24));
 			Ret_Buf_L3-> power_consumption = ((uint32_t)rx[18] | (((uint32_t)rx[19])<<8) | (((uint32_t)rx[20])<<16) | (((uint32_t)rx[21])<<24));
+#else	//SIMULATION
+			tsNow = current_timestamp();
+			tmpPowerConsumption += (ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingVoltage*ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingCurrent)*((tsNow-tsLast)/36000000.0);
+			Ret_Buf_T-> power_consumption = (uint32_t)tmpPowerConsumption;
+			tsLast = tsNow;
+#endif	//SIMULATION
 			result = PASS;
 		}
 	}
@@ -2320,6 +2339,7 @@ int main(void)
 						//===============================
 						if(Query_Present_OutputCurrent(Uart1Fd, (gun_index>0?ADDR_AC_PRIMARY_2:ADDR_AC_PRIMARY_1), &ShmCharger->gun_info[gun_index].outputCurrent) == PASS)
 						{
+#ifndef SIMULATION
 							ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrent = (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];
 							ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrentL2 = (float)ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0];
 							ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrentL3 = (float)ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0];
@@ -2328,6 +2348,9 @@ int main(void)
 							ShmCharger->gun_info[gun_index].acCcsInfo.EVSEPresentCurrent[0] = (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];
 							ShmCharger->gun_info[gun_index].acCcsInfo.EVSEPresentCurrent[1] = (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];
 							ShmCharger->gun_info[gun_index].acCcsInfo.EVSEPresentCurrent[2] = (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];							
+#else	//SIMULATION
+						ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrent = (float)(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus==SYS_MODE_CHARGING?(((rand()%10)+((ShmCharger->gun_info[gun_index].targetCurrent*10)-5))/10.0):0) ;
+#endif	//SIMULATION
 
 							failCount[gun_index] = 0;
 						}

+ 445 - 56
EVSE/Projects/AW-CCS/Apps/main.c

@@ -23,7 +23,7 @@
 #define TMR_IDX_PROFILE_PREPARE			3
 #define TMR_IDX_BS_HLC_HANDSHAKE		4
 #define TMR_IDX_CCS_HEARTBEAT_COUNT_RESET	5
-#define TMR_IDX_6						6
+#define TMR_IDX_PWN_CHANGE						6
 #define TMR_IDX_7						7
 #define TMR_IDX_8						8
 #define TMR_IDX_9 						9
@@ -37,6 +37,7 @@
 #define TIMEOUT_SPEC_EV_READY					30000
 #define TIMEOUT_SPEC_CCS_HEARTBEAT_COUNT_RESET		10000
 #define TIMEOUT_SPEC_CCS_HANDSHAKE				120000
+#define TIMEOUT_SPEC_PWN_CHANGE			5000
 
 #define MtdBlockSize 					0x600000
 
@@ -797,10 +798,9 @@ int LoadSysConfigAndInfo(struct SysConfigData *ptr)
 			fd = open("/dev/mtdblock12", O_RDWR);
 			if (fd < 0)
 			{
-				free(buf);
-
 				DEBUG_ERROR("open mtdblock12 (Factory default) NG,rebooting..\r\n");
-
+				
+				free(buf);
 				if(ShmStatusCodeData!=NULL)
 				{
 					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
@@ -815,10 +815,9 @@ int LoadSysConfigAndInfo(struct SysConfigData *ptr)
     		close(fd);
 			if(wrd<MtdBlockSize)
 			{
-				free(buf);
-
 				DEBUG_ERROR("read factory default  SysConfigData data NG,rebooting..\r\n");
-
+				
+				free(buf);
 				if(ShmStatusCodeData!=NULL)
 				{
 					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
@@ -901,8 +900,8 @@ int StoreUsrConfigData(struct SysConfigData *UsrData)
 			}
 			else
 			{
-		    		DEBUG_ERROR("write /dev/mtdblock10 NG\r\n");
-		    		result = FAIL;
+		    	DEBUG_ERROR("write /dev/mtdblock10 NG\r\n");
+		    	result = FAIL;
 			}
 		}
 		else
@@ -914,8 +913,9 @@ int StoreUsrConfigData(struct SysConfigData *UsrData)
 	else
 	{
 		DEBUG_ERROR("alloc BlockSize NG\r\n");
-    		result = FAIL;
+    	result = FAIL;
 	}
+	
 	if(BufTmp!=NULL)
 		free(BufTmp);
 
@@ -987,14 +987,13 @@ void InitEthernet()
 			{
 				if(++cnt_pingDNS_Fail > 3)
 				{
-					
 					ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaEthernet=ON;
 				}
 			}
 			
 			if(ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaEthernet &&
-				ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaWiFi &&
-				ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectVia4Gi)
+			   ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaWiFi &&
+			   ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectVia4Gi)
 			{
 				ShmSysConfigAndInfo->SysInfo.InternetConn = OFF;
 			}
@@ -1197,7 +1196,7 @@ void get_firmware_version(unsigned char gun_index)
 	strcpy((char*)ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, ShmCharger->gun_info[gun_index].ver.Version_FW);
 
 	// Get CSU root file system version
-	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "D0.25.00.0000.00");
+	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "D0.26.00.0000.00");
 
 	// Get AC connector type from model name
 	for(uint8_t idx=0;idx<3;idx++)
@@ -1685,34 +1684,63 @@ int isReachableInternet()
 	FILE *fp;
 	char cmd[256];
 	char buf[512];
-	//char tmp[512];
-
-	for(int idx=0;idx<ARRAY_SIZE(valid_Internet);idx++)
+	char tmp[512];
+	
+	if(ShmOCPP16Data->OcppConnStatus == PASS)
 	{
-		sprintf(cmd, "ping -c 1 -w 3 -I eth0 %s", valid_Internet[idx]);
+		result = PASS;
+	}
+	else
+	{
+		strcpy(cmd, "ifconfig eth0");
 		fp = popen(cmd, "r");
-		if(fp != NULL)
+
+		if (fp != NULL)
 		{
 			while(fgets(buf, sizeof(buf), fp) != NULL)
 			{
-				if(strstr(buf, "transmitted") > 0)
+				if (strstr(buf, "inet addr:") > 0)
 				{
-					//sscanf(buf, "%*s%*s%*s%*s%*s%*s%s", tmp);
+					sscanf(buf, "%*s%s", tmp);
+					substr(tmp, tmp, strspn(tmp, "addr:"), strlen(buf)-strspn(tmp, "addr:"));
 
-					if(strstr(buf,"100%") != NULL)
+					if (strcmp(tmp, (char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress) != 0)
 					{
-
+						strcpy((char *) ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress, tmp);
 					}
-					else
+				}
+			}
+		}
+		pclose(fp);
+		memset(buf, 0x00, sizeof(buf));
+
+		for(int idx=0;idx<ARRAY_SIZE(valid_Internet);idx++)
+		{
+			sprintf(cmd, "ping -c 1 -w 3 -I eth0 %s", valid_Internet[idx]);
+			fp = popen(cmd, "r");
+			if(fp != NULL)
+			{
+				while(fgets(buf, sizeof(buf), fp) != NULL)
+				{
+					if(strstr(buf, "transmitted") > 0)
 					{
-						result = PASS;
+						//sscanf(buf, "%*s%*s%*s%*s%*s%*s%s", tmp);
+
+						if(strstr(buf,"100%") != NULL)
+						{
+
+						}
+						else
+						{
+							result = PASS;
+						}
+						//DEBUG_INFO("%s",buf);
+						//DEBUG_INFO("%s\n",tmp);
 					}
-					//DEBUG_INFO("%s",buf);
-					//DEBUG_INFO("%s\n",tmp);
 				}
 			}
+			pclose(fp);
 		}
-		pclose(fp);
 	}
 
 	return result;
@@ -1789,7 +1817,6 @@ int getScheduleStart(int gun_index)
 	struct tm tmScheduleStart;;
 	struct timeb tbScheduleStart;
 
-
 	if((sscanf((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.StartSchedule, "%4d-%2d-%2dT%2d:%2d:%2d", &tmScheduleStart.tm_year, &tmScheduleStart.tm_mon, &tmScheduleStart.tm_mday, &tmScheduleStart.tm_hour, &tmScheduleStart.tm_min, &tmScheduleStart.tm_sec) == 6))
 	{
 		tmScheduleStart.tm_year -= 1900;
@@ -1798,8 +1825,7 @@ int getScheduleStart(int gun_index)
 		tbScheduleStart.millitm = 0;
 
 		result = DiffTimebWithNow(tbScheduleStart)/1000;
-
-		DEBUG_INFO("Schedule start compare Now(seconds): %d\r\n", result);
+		//DEBUG_INFO("Schedule start compare Now(seconds): %d\r\n", result);
 	}
 	else
 	{
@@ -1827,7 +1853,7 @@ int getStartSinceToday()
 	tbStartToday.time = mktime(tmStartToday);
 
 	result = DiffTimebWithNow(tbStartToday)/1000;
-	DEBUG_INFO("Start today compare Now(seconds): %d\r\n", result);
+	//DEBUG_INFO("Start today compare Now(seconds): %d\r\n", result);
 
 	return result;
 }
@@ -1851,8 +1877,7 @@ int getStartSinceWeek()
 	tbStartWeek.time = mktime(tmStartWeek);
 
 	result = DiffTimebWithNow(tbStartWeek)/1000;
-
-	DEBUG_INFO("Start week compare Now(seconds): %d\r\n", result);
+	//DEBUG_INFO("Start week compare Now(seconds): %d\r\n", result);
 
 	return result;
 }
@@ -1885,7 +1910,7 @@ int getEth0MacAddress()
 	char buf[512];
 	char tmp[512];
 
-	strcpy(cmd, "ifconfig");;
+	strcpy(cmd, "ifconfig eth0");
 	fp = popen(cmd, "r");
 	if(fp != NULL)
 	{
@@ -2435,7 +2460,7 @@ int main(void)
 						{
 							ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod = START_METHOD_FREE;
 							memcpy(ShmSysConfigAndInfo->SysConfig.UserId, ShmSysConfigAndInfo->SysConfig.SerialNumber, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.SerialNumber));
-							DEBUG_INFO("Start Method : FREE..\r\n");
+							DEBUG_INFO("Start Method : FREE...\r\n");
 						}
 
 						ShmCharger->gun_info[gun_index].rfidReq = OFF;
@@ -2455,6 +2480,7 @@ int main(void)
 						ftime(&startTime[gun_index][TMR_IDX_AUTH]);
 						if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_RFID)
 						{
+							memset(ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, 0x00, ARRAY_SIZE(ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status));
 							switch(ShmSysConfigAndInfo->SysConfig.AuthorisationMode)
 							{
 								case AUTH_MODE_ENABLE:
@@ -2489,7 +2515,7 @@ int main(void)
 						}
 						ShmCharger->gun_info[gun_index].mcuFlag.isSetCpPwmDuty = YES;
 					}
-
+					
 					if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_AUTH]) > TIMEOUT_SPEC_AUTH)
 					{
 						// Authorization timeout process.
@@ -2895,6 +2921,11 @@ int main(void)
 						ftime(&startChargingTime[gun_index]);
 						ftime(&startTime[gun_index][TMR_IDX_LOGPPRINTOUT]);
 						ftime(&startTime[gun_index][TMR_IDX_PROFILE_PREPARE]);
+						ftime(&startTime[gun_index][TMR_IDX_PWN_CHANGE]);
+						startTime[gun_index][TMR_IDX_AUTH].time -= TIMEOUT_SPEC_AUTH;
+						ShmOCPP16Data->SpMsg.bits.AuthorizeReq = OFF;
+						ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingProfileId = 0;
+						ShmCharger->gun_info[gun_index].isChargerStopByCondition = NO;
 					}
 					switch(ShmCharger->gun_info[gun_index].chargingMode)
 					{
@@ -2908,6 +2939,7 @@ int main(void)
 							{
 								if(ShmCharger->gun_info[gun_index].rfidReq)
 								{
+								DEBUG_INFO("Certified in charging mode... \r\n");
 									// If RFID SN different with start user, it need to authorize ID
 									if((ShmCharger->gun_info[gun_index].rfidReq == ON) && !isMatchStartUser(gun_index))
 									{
@@ -2957,10 +2989,10 @@ int main(void)
 												}
 											}
 											DEBUG_INFO("End request User Id : %s\r\n", ShmSysConfigAndInfo->SysConfig.UserId);
-											DEBUG_INFO("Start method : %d...\r\n ", ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod);
+											DEBUG_INFO("Start method : %d\r\n ", ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod);
 
 											if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_RFID) ||
-											   (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_BACKEND) ||
+											   //(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_BACKEND) ||
 											   (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_BLE))
 											{
 												switch(ShmSysConfigAndInfo->SysConfig.AuthorisationMode)
@@ -2994,6 +3026,11 @@ int main(void)
 														break;
 												}
 											}
+									else if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_BACKEND)
+									{
+										DEBUG_INFO("Should be remote stop charger... \r\n");
+										ShmCharger->gun_info[gun_index].rfidReq = OFF;
+									} 
 										}
 										else
 										{
@@ -3036,15 +3073,9 @@ int main(void)
 							{
 								setLedMotion(gun_index,LED_ACTION_CHARGING);
 								ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/100);
-								//ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption[0] = (ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption/100);
-								//ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption[1] = (ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption/100);
-								//ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption[2] = (ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption/100);			
 								ftime(&endChargingTime[gun_index]);
 								ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index])/1000;
 								ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy = ((float)(ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption - ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption_at_start))/100;
-								//ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy[0] = ((float)(ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption - ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption_at_start))/100;
-								//ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy[1] = ((float)(ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption - ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption_at_start))/100;
-								//ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy[2] = ((float)(ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption - ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption_at_start))/100;
 
 								// Response StartTransactionConf
 								if(ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionConf == ON)
@@ -3067,8 +3098,8 @@ int main(void)
 								}
 
 								// Checking profile id > 0 and current time is between charging profile validFrom & validTo
-								if((ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingProfileId>0) &&
-								   (ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq != ON)	&&
+								if((ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingProfileId > 0) &&
+								   (ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq != ON) &&
 								   (((strlen((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ValidFrom)>0) && (strlen((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ValidTo)>0)) ? isProfileValid(gun_index) : ON))
 								{
 									// Debug information
@@ -3107,7 +3138,69 @@ int main(void)
 										}
 									}
 
-								}								
+							else if((mystrcmp((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingProfileKind, "Relative") == PASS))
+							{
+								// Relative profile
+								if(((mystrcmp((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingProfilePurpose, "TxProfile") == PASS) && (ShmOCPP16Data->SmartChargingProfile[gun_index].TransactionId == ShmOCPP16Data->StartTransaction[gun_index].ResponseTransactionId)) ||
+									(mystrcmp((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingProfilePurpose, "TxProfile") == FAIL))
+								{
+									// Checking limitation
+									for(uint8_t idx_period=0;idx_period<ARRAY_SIZE(ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod);idx_period++)
+									{
+										if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration > ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].StartPeriod) &&
+										   (((ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].StartPeriod == 0) && (ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].Limit != 0)) || (ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].StartPeriod > 0)))
+										{
+											ShmCharger->gun_info[gun_index].targetCurrent = (mystrcmp((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingRateUnit,"W")==PASS?ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].Limit/220:ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].Limit);
+											DEBUG_INFO("ShmCharger->gun_info[%d].targetCurrent on period[%d]: %d\r\n", gun_index, idx_period, ShmCharger->gun_info[gun_index].targetCurrent);
+										}
+										else
+											break;
+									}
+								}
+							}
+							else
+							{
+								// Recurring profile
+								if(((mystrcmp((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingProfilePurpose, "TxProfile") == PASS) && (ShmOCPP16Data->SmartChargingProfile[gun_index].TransactionId == ShmOCPP16Data->StartTransaction[gun_index].ResponseTransactionId)) ||
+									(mystrcmp((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingProfilePurpose, "TxProfile") == FAIL))
+								{
+									if((mystrcmp((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].RecurrencyKind, "Daily") == PASS))
+									{
+										// Checking limitation
+										for(uint8_t idx_period=0;idx_period<ARRAY_SIZE(ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod);idx_period++)
+										{
+											if((getStartSinceToday() > ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].StartPeriod) &&
+											   (((ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].StartPeriod == 0) && (ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].Limit != 0)) || (ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].StartPeriod > 0)))
+											{
+												ShmCharger->gun_info[gun_index].targetCurrent = (mystrcmp((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingRateUnit,"W")==PASS?ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].Limit/220:ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].Limit);
+												DEBUG_INFO("ShmCharger->gun_info[%d].targetCurrent on period[%d]: %d\r\n", gun_index, idx_period, ShmCharger->gun_info[gun_index].targetCurrent);
+											}
+											else
+												break;
+										}
+									}
+									else
+									{
+										// Checking limitation
+										for(uint8_t idx_period=0;idx_period<ARRAY_SIZE(ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod);idx_period++)
+										{
+											if((getStartSinceWeek() > ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].StartPeriod) &&
+											   (((ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].StartPeriod == 0) && (ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].Limit != 0)) || (ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].StartPeriod > 0)))
+											{
+												ShmCharger->gun_info[gun_index].targetCurrent = (mystrcmp((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingRateUnit,"W")==PASS?ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].Limit/220:ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.ChargingSchedulePeriod[idx_period].Limit);
+												DEBUG_INFO("ShmCharger->gun_info[%d].targetCurrent on period[%d]: %d\r\n", gun_index, idx_period, ShmCharger->gun_info[gun_index].targetCurrent);
+											}
+											else
+												break;
+										}
+									}
+								}
+							}
+						}
+						else if((ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingProfileId == 0) && (ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq != ON))
+						{
+							ShmCharger->gun_info[gun_index].targetCurrent = ShmCharger->gun_info[gun_index].primaryMcuState.rating_current;
+						}								
 
 								// Determine max charging current to MCU
 								if(ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent == 0)
@@ -3115,18 +3208,28 @@ int main(void)
 									ShmCharger->gun_info[gun_index].targetCurrent = ((ShmCharger->gun_info[gun_index].targetCurrent > ShmCharger->gun_info[gun_index].primaryMcuState.rating_current)?ShmCharger->gun_info[gun_index].primaryMcuState.rating_current:ShmCharger->gun_info[gun_index].targetCurrent);
 									if(ShmCharger->gun_info[gun_index].targetCurrent != ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current)
 									{
-										ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current = ((ShmCharger->gun_info[gun_index].targetCurrent > ShmCharger->gun_info[gun_index].primaryMcuState.rating_current)?ShmCharger->gun_info[gun_index].primaryMcuState.rating_current:ShmCharger->gun_info[gun_index].targetCurrent);
-										ShmCharger->gun_info[gun_index].mcuFlag.isSetCpPwmDuty = YES;
-									}
+								if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_PWN_CHANGE]) > TIMEOUT_SPEC_PWN_CHANGE)
+								{
+									ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current = ((ShmCharger->gun_info[gun_index].targetCurrent > ShmCharger->gun_info[gun_index].primaryMcuState.rating_current)?ShmCharger->gun_info[gun_index].primaryMcuState.rating_current:ShmCharger->gun_info[gun_index].targetCurrent);
+									ShmCharger->gun_info[gun_index].mcuFlag.isSetCpPwmDuty = YES;
+									ftime(&startTime[gun_index][TMR_IDX_PWN_CHANGE]);
+								}
+								else
+								{}									}
 								}
 								else
 								{
 									ShmCharger->gun_info[gun_index].targetCurrent = ((ShmCharger->gun_info[gun_index].targetCurrent > ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent)?ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent:ShmCharger->gun_info[gun_index].targetCurrent);
 									if(ShmCharger->gun_info[gun_index].targetCurrent != ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current)
 									{
-										ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current = ((ShmCharger->gun_info[gun_index].targetCurrent > ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent)?ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent:ShmCharger->gun_info[gun_index].targetCurrent);
-										ShmCharger->gun_info[gun_index].mcuFlag.isSetCpPwmDuty = YES;
-									}
+								if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_PWN_CHANGE]) > TIMEOUT_SPEC_PWN_CHANGE)
+								{
+									ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current = ((ShmCharger->gun_info[gun_index].targetCurrent > ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent)?ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent:ShmCharger->gun_info[gun_index].targetCurrent);
+									ShmCharger->gun_info[gun_index].mcuFlag.isSetCpPwmDuty = YES;
+									ftime(&startTime[gun_index][TMR_IDX_PWN_CHANGE]);
+								}
+								else
+								{}									}
 								}
 
 								// Debug information
@@ -3145,16 +3248,23 @@ int main(void)
 									// On-line max condition check
 									if((ShmSysConfigAndInfo->SysConfig.MaxChargingDuration > 0) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration >= (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration*60)))
 									{
+									setRelay(gun_index, OFF);
+									setRequest(gun_index, OFF);
+									ShmCharger->gun_info[gun_index].isChargerStopByCondition = YES;
 										setChargerMode(gun_index, SYS_MODE_TERMINATING);
 										DEBUG_INFO("Connector-%d charging duration(%d) already over max duration(%d) in second.\r\n", gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration, (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration*60));
 									}
 									else if((ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy > 0) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy >= ((float)ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy)))
 									{
+									setRelay(gun_index, OFF);
+									setRequest(gun_index, OFF);
+									ShmCharger->gun_info[gun_index].isChargerStopByCondition = YES;
 										setChargerMode(gun_index, SYS_MODE_TERMINATING);
 										DEBUG_INFO("Connector-%d charging energy(%.2f) already over max energy(%.2f) in KWH.\r\n", gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy, ((float)ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy));
 									}
 									else
 									{
+									ShmCharger->gun_info[gun_index].isChargerStopByCondition = NO;
 										setRelay(gun_index, ON);
 									}
 								}
@@ -3167,16 +3277,26 @@ int main(void)
 									{
 										if(((ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration > 0) ? (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration >= (ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration*60)) : (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration > 0) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration >= (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration*60))))
 										{
+									setRelay(gun_index, OFF);
+									setRequest(gun_index, OFF);
+									ShmCharger->gun_info[gun_index].isChargerStopByCondition = YES;
+
 											setChargerMode(gun_index, SYS_MODE_TERMINATING);
 											DEBUG_INFO("Connector-%d charging duration(%d) already over off-line max duration(%d) in second.\r\n", gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration, (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration*60));
 										}
 										else if(((ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy > 0) ? (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy >= ((float)ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy)) : (ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy > 0) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy >= ((float)ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy))))
 										{
+									setRelay(gun_index, OFF);
+									setRequest(gun_index, OFF);
+									ShmCharger->gun_info[gun_index].isChargerStopByCondition = YES;
+
 											setChargerMode(gun_index, SYS_MODE_TERMINATING);
 											DEBUG_INFO("Connector-%d charging energy(%.2f) already over off-line max energy(%.2f) in KWH.\r\n", gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy, ((float)ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy));
 										}
 										else
 										{
+									ShmCharger->gun_info[gun_index].isChargerStopByCondition = NO;
+
 											setRelay(gun_index, ON);
 										}
 									}
@@ -3573,6 +3693,140 @@ int main(void)
 								}
 								else
 								{
+									// If the charger stops charging, the led should be stoped blink
+									if(!ShmCharger->gun_info[gun_index].primaryMcuState.relay_state)
+									{
+										setLedMotion(gun_index, LED_ACTION_STOP);
+									}
+									
+									if(ShmCharger->gun_info[gun_index].rfidReq)
+									{
+										DEBUG_INFO("Certified in terminating mode... \r\n");
+										
+										// If RFID SN different with start user, it need to authorize ID
+										if((ShmCharger->gun_info[gun_index].rfidReq == ON) && !isMatchStartUser(gun_index))
+										{
+											if((DiffTimebWithNow(startTime[gun_index][TMR_IDX_AUTH]) > TIMEOUT_SPEC_AUTH) && !ShmOCPP16Data->SpMsg.bits.AuthorizeReq)
+											{
+												// Request authorization
+												ftime(&startTime[gun_index][TMR_IDX_AUTH]);
+												memset(ShmSysConfigAndInfo->SysConfig.UserId, 0x00, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.UserId));
+												if(ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian)
+												{
+													// Big endian
+													switch(rfid.snType)
+													{
+														case RFID_SN_TYPE_6BYTE:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5]);
+															break;
+														case RFID_SN_TYPE_7BYTE:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5], rfid.currentCard[6]);
+															break;
+														case RFID_SN_TYPE_10BYTE:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5], rfid.currentCard[6], rfid.currentCard[7], rfid.currentCard[8], rfid.currentCard[9]);
+															break;
+														case RFID_SN_TYPE_4BYTE:
+														default:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3]);
+															break;
+													}
+												}
+												else
+												{
+													// Little endian
+													switch(rfid.snType)
+													{
+														case RFID_SN_TYPE_6BYTE:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X%02X%02X", rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
+															break;
+														case RFID_SN_TYPE_7BYTE:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[6], rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
+															break;
+														case RFID_SN_TYPE_10BYTE:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[9], rfid.currentCard[8], rfid.currentCard[7], rfid.currentCard[6], rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
+															break;
+														case RFID_SN_TYPE_4BYTE:
+														default:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X", rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
+															break;
+													}
+												}
+												
+												DEBUG_INFO("End request User Id : %s... \r\n", ShmSysConfigAndInfo->SysConfig.UserId);
+												DEBUG_INFO("Start method : %d... \r\n ", ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod);
+
+												if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_RFID) ||
+												   //(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_BACKEND) ||
+												   (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_BLE))
+												{
+													switch(ShmSysConfigAndInfo->SysConfig.AuthorisationMode)
+													{
+														case AUTH_MODE_ENABLE:
+															if(ShmOCPP16Data->OcppConnStatus)
+															{
+																// On line
+																ShmOCPP16Data->SpMsg.bits.AuthorizeReq = ON;
+															}
+															else
+															{
+																// Off line
+																switch(ShmSysConfigAndInfo->SysConfig.OfflinePolicy)
+																{
+																	case OFF_POLICY_LOCALLIST:
+																		ShmOCPP16Data->SpMsg.bits.AuthorizeReq = ON;
+																		break;
+																	case OFF_POLICY_PH_RFID:
+																		break;
+																	case OFF_POLICY_FREE:
+																		break;
+																	case OFF_POLICY_NOCHARGE:
+																	default:
+																		break;
+																}
+															}
+															break;
+														case AUTH_MODE_DISABLE:
+														default:
+															break;
+													}
+												}
+												else if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_BACKEND)
+												{
+													DEBUG_INFO("Should be remote stop charger... \r\n");
+													ShmCharger->gun_info[gun_index].rfidReq = OFF;
+												} 
+											}
+											else
+											{
+												if(ShmOCPP16Data->SpMsg.bits.AuthorizeConf ||
+												  (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE) ||
+												  (!ShmOCPP16Data->OcppConnStatus && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_LOCALLIST)) ||
+												  (!ShmOCPP16Data->OcppConnStatus && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_FREE)))
+												{
+													if((strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted")==0) ||
+													   (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE) ||
+													   (!ShmOCPP16Data->OcppConnStatus && (isValidLocalWhiteCard() == PASS) && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_LOCALLIST)) ||
+													   (!ShmOCPP16Data->OcppConnStatus && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_FREE)))
+													{
+														ShmCharger->gun_info[gun_index].isAuthPassEnd = ON;
+													}
+													else
+													{
+														ShmCharger->gun_info[gun_index].rfidReq = OFF;
+														ShmOCPP16Data->SpMsg.bits.AuthorizeReq = OFF;
+														DEBUG_INFO("Authorize fail... \r\n");
+														setSpeaker(ON,SPEAKER_INTERVAL_3COUNT);
+														setLedMotion(gun_index,LED_ACTION_RFID_FAIL);
+														sleep(3);
+													}
+
+													startTime[gun_index][TMR_IDX_AUTH].time -= TIMEOUT_SPEC_AUTH;
+													ShmOCPP16Data->SpMsg.bits.AuthorizeConf = OFF;
+												}
+											}
+										}
+									}									
+									
 									if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C) &&
 									   (ShmCharger->gun_info[gun_index].rfidReq != ON) &&
 									   (ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop != ON)  &&
@@ -3634,6 +3888,141 @@ int main(void)
 								}
 								else
 								{
+									// If the charger stops charging, the led should be stoped blink
+									if(!ShmCharger->gun_info[gun_index].primaryMcuState.relay_state)
+									{
+										setLedMotion(gun_index, LED_ACTION_STOP);
+									}
+									
+									if(ShmCharger->gun_info[gun_index].rfidReq)
+									{
+										DEBUG_INFO("Certified in terminating mode... \r\n");
+										
+										// If RFID SN different with start user, it need to authorize ID
+										if((ShmCharger->gun_info[gun_index].rfidReq == ON) && !isMatchStartUser(gun_index))
+										{
+											if((DiffTimebWithNow(startTime[gun_index][TMR_IDX_AUTH]) > TIMEOUT_SPEC_AUTH) && !ShmOCPP16Data->SpMsg.bits.AuthorizeReq)
+											{
+												// Request authorization
+												ftime(&startTime[gun_index][TMR_IDX_AUTH]);
+												memset(ShmSysConfigAndInfo->SysConfig.UserId, 0x00, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.UserId));
+												if(ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian)
+												{
+													// Big endian
+													switch(rfid.snType)
+													{
+														case RFID_SN_TYPE_6BYTE:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5]);
+															break;
+														case RFID_SN_TYPE_7BYTE:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5], rfid.currentCard[6]);
+															break;
+														case RFID_SN_TYPE_10BYTE:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5], rfid.currentCard[6], rfid.currentCard[7], rfid.currentCard[8], rfid.currentCard[9]);
+															break;
+														case RFID_SN_TYPE_4BYTE:
+														default:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3]);
+															break;
+													}
+												}
+												else
+												{
+													// Little endian
+													switch(rfid.snType)
+													{
+														case RFID_SN_TYPE_6BYTE:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X%02X%02X", rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
+															break;
+														case RFID_SN_TYPE_7BYTE:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[6], rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
+															break;
+														case RFID_SN_TYPE_10BYTE:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[9], rfid.currentCard[8], rfid.currentCard[7], rfid.currentCard[6], rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
+															break;
+														case RFID_SN_TYPE_4BYTE:
+														default:
+															sprintf((char*)ShmSysConfigAndInfo->SysConfig.UserId, "%02X%02X%02X%02X", rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
+															break;
+													}
+												}
+												
+												DEBUG_INFO("End request User Id : %s... \r\n", ShmSysConfigAndInfo->SysConfig.UserId);
+												DEBUG_INFO("Start method : %d... \r\n ", ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod);
+
+												if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_RFID) ||
+												   //(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_BACKEND) ||
+												   (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_BLE))
+												{
+													switch(ShmSysConfigAndInfo->SysConfig.AuthorisationMode)
+													{
+														case AUTH_MODE_ENABLE:
+															if(ShmOCPP16Data->OcppConnStatus)
+															{
+																// On line
+																ShmOCPP16Data->SpMsg.bits.AuthorizeReq = ON;
+															}
+															else
+															{
+																// Off line
+																switch(ShmSysConfigAndInfo->SysConfig.OfflinePolicy)
+																{
+																	case OFF_POLICY_LOCALLIST:
+																		ShmOCPP16Data->SpMsg.bits.AuthorizeReq = ON;
+																		break;
+																	case OFF_POLICY_PH_RFID:
+																		break;
+																	case OFF_POLICY_FREE:
+																		break;
+																	case OFF_POLICY_NOCHARGE:
+																	default:
+																		break;
+																}
+															}
+															break;
+														case AUTH_MODE_DISABLE:
+														default:
+															break;
+													}
+												}
+												else if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_BACKEND)
+												{
+													DEBUG_INFO("Should be remote stop charger... \r\n");
+													ShmCharger->gun_info[gun_index].rfidReq = OFF;
+												} 
+											}
+											else
+											{
+												if(ShmOCPP16Data->SpMsg.bits.AuthorizeConf ||
+												  (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE) ||
+												  (!ShmOCPP16Data->OcppConnStatus && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_LOCALLIST)) ||
+												  (!ShmOCPP16Data->OcppConnStatus && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_FREE)))
+												{
+													if((strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted")==0) ||
+													   (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE) ||
+													   (!ShmOCPP16Data->OcppConnStatus && (isValidLocalWhiteCard() == PASS) && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_LOCALLIST)) ||
+													   (!ShmOCPP16Data->OcppConnStatus && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_FREE)))
+													{
+														ShmCharger->gun_info[gun_index].isAuthPassEnd = ON;
+													}
+													else
+													{
+														ShmCharger->gun_info[gun_index].rfidReq = OFF;
+														ShmOCPP16Data->SpMsg.bits.AuthorizeReq = OFF;
+														DEBUG_INFO("Authorize fail... \r\n");
+														setSpeaker(ON,SPEAKER_INTERVAL_3COUNT);
+														setLedMotion(gun_index,LED_ACTION_RFID_FAIL);
+														sleep(3);
+													}
+
+													startTime[gun_index][TMR_IDX_AUTH].time -= TIMEOUT_SPEC_AUTH;
+													ShmOCPP16Data->SpMsg.bits.AuthorizeConf = OFF;
+												}
+											}
+										}
+									}									
+									
+									
 									if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C) &&
 									   (ShmCharger->gun_info[gun_index].rfidReq != ON) &&
 									   (ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop != ON)  &&
@@ -3822,7 +4211,7 @@ int main(void)
 						ShmSysConfigAndInfo->SysInfo.FirmwareUpdate = OFF;
 						int value = upgrade_check();
 
-						DEBUG_INFO("Local update Value: %d...\r\n",value);
+						DEBUG_INFO("Local update Value: %s... \r\n",((value == PASS)?"Pass": "Fail"));
 						if(value == PASS)
 						{
 							if(ShmStatusCodeData->InfoCode.InfoEvents.bits.CsuFimrwareUpdateFail == ON)
@@ -3859,7 +4248,7 @@ int main(void)
 							ShmOCPP16Data->MsMsg.bits.UpdateFirmwareReq = OFF;
 							int result = upgrade_check();
 
-							DEBUG_INFO("Remote update Result: %d...\r\n",result);
+							DEBUG_INFO("Remote update Result: %s... \r\n",((result == PASS)?"Pass": "Fail"));
 							if(result == PASS)
 							{
 								if(ShmStatusCodeData->InfoCode.InfoEvents.bits.CsuFimrwareUpdateFail == ON)

+ 1 - 0
EVSE/Projects/AW-CCS/Apps/main.h

@@ -628,6 +628,7 @@ typedef struct GUN_INFO
 	uint16_t										isCCSStartTransation:1;
 	uint16_t										isEvReady2StateE:1;
 	uint16_t										isDoEvReadyOnce:1;
+	uint16_t										isChargerStopByCondition:1;
 }Gun_Info;
 
 struct Charger

二進制
EVSE/Projects/AW-CCS/Images/FactoryDefaultConfig.bin


二進制
EVSE/Projects/AW-CCS/Images/MLO


二進制
EVSE/Projects/AW-CCS/Images/am335x-evm.dtb


二進制
EVSE/Projects/AW-CCS/Images/ramdisk.gz


二進制
EVSE/Projects/AW-CCS/Images/u-boot-spl.bin


二進制
EVSE/Projects/AW-CCS/Images/u-boot.img


二進制
EVSE/Projects/AW-CCS/Images/zImage


二進制
EVSE/Projects/AW-Regular/Images/FactoryDefaultConfig.bin


二進制
EVSE/Projects/AW-Regular/Images/MLO


二進制
EVSE/Projects/AW-Regular/Images/ramdisk.gz


二進制
EVSE/Projects/AW-Regular/Images/u-boot.img


二進制
EVSE/Projects/AW-Regular/Images/zImage


二進制
EVSE/Projects/BYTON-GB/Images/FactoryDefaultConfig.bin


二進制
EVSE/Projects/BYTON-GB/Images/MLO


二進制
EVSE/Projects/BYTON-GB/Images/ramdisk.gz


二進制
EVSE/Projects/BYTON-GB/Images/u-boot.img


二進制
EVSE/Projects/BYTON-GB/Images/zImage


二進制
EVSE/Projects/Noodoe/Images/FactoryDefaultConfig.bin


二進制
EVSE/Projects/Noodoe/Images/MLO


二進制
EVSE/Projects/Noodoe/Images/ramdisk.gz


二進制
EVSE/Projects/Noodoe/Images/u-boot-spl.bin


二進制
EVSE/Projects/Noodoe/Images/u-boot.img


二進制
EVSE/Projects/Noodoe/Images/zImage


+ 150 - 150
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_System.map

@@ -34572,155 +34572,155 @@ c0a00000 R __start_rodata
 c0a00000 A __start_rodata_section_aligned
 c0a00000 R _etext
 c0a00010 R linux_proc_banner
-c0a0006c R linux_banner
-c0a00100 r __func__.5825
-c0a00110 r sqrt_oddadjust
-c0a00130 r sqrt_evenadjust
-c0a00150 r __func__.5807
-c0a00160 r cc_map
-c0a00180 r isa_modes
-c0a00190 r processor_modes
-c0a00210 r sigpage_mapping
-c0a00220 r regoffset_table
-c0a002b8 r user_arm_view
-c0a002cc r arm_regsets
-c0a00338 r hwcap_str
-c0a00394 r hwcap2_str
-c0a003ac r proc_arch
-c0a003f0 R cpuinfo_op
-c0a00400 R sigreturn_codes
-c0a0041c r handler
-c0a00430 r atags_fops
-c0a004a8 r pmresrn_table.31150
-c0a004b8 r pmresrn_table.31002
-c0a004c4 r scorpion_perf_cache_map
-c0a0056c r scorpion_perf_map
-c0a00594 r krait_perf_cache_map
-c0a0063c r krait_perf_map
-c0a00664 r krait_perf_map_no_branch
-c0a0068c r armv7_a5_perf_cache_map
-c0a00734 r armv7_a5_perf_map
-c0a0075c r armv7_a7_perf_cache_map
-c0a00804 r armv7_a7_perf_map
-c0a0082c r armv7_a8_perf_cache_map
-c0a008d4 r armv7_a8_perf_map
-c0a008fc r armv7_a9_perf_cache_map
-c0a009a4 r armv7_a9_perf_map
-c0a009cc r armv7_a12_perf_cache_map
-c0a00a74 r armv7_a12_perf_map
-c0a00a9c r armv7_a15_perf_cache_map
-c0a00b44 r armv7_a15_perf_map
-c0a00b6c r armv7_pmu_probe_table
-c0a00b90 r armv7_pmu_of_device_ids
-c0a013fc r usermode_action
-c0a01414 r alignment_proc_fops
-c0a0148c r subset.21772
-c0a014ac r subset.21782
-c0a014bc r __param_str_alignment
-c0a014c8 r cpu_arch_name
-c0a014ce r cpu_elf_name
-c0a014d4 r l2c220_data
-c0a0151c r omap_types
-c0a01530 r __func__.28508
-c0a01548 r __func__.29284
-c0a01568 r __func__.29289
-c0a01588 r am33xx_control_reg_offsets
-c0a01648 r am43xx_control_reg_offsets
-c0a01724 r omap_scrm_dt_match_table
-c0a01ecc r omap2_ctrl_data
-c0a01ed4 r omap_mux_dbg_signal_fops
-c0a01f4c r omap_mux_dbg_board_fops
-c0a01fc4 r __func__.28699
-c0a01fd8 r __func__.28741
-c0a01ff0 r __func__.28758
-c0a02008 r __func__.28788
-c0a0201c r __func__.29075
-c0a02030 r __func__.29089
-c0a02044 r __func__.29126
-c0a02054 r __func__.29002
-c0a0206c r __func__.29015
-c0a02088 r __func__.29102
-c0a0209c r __func__.30036
-c0a020bc r __func__.30084
-c0a020d0 r __func__.30078
-c0a020e0 r __func__.36712
-c0a020f4 r omap_pm_ops
-c0a0211c r reg_map
-c0a021f0 r __func__.31257
-c0a0220c r __func__.27253
-c0a02224 r __func__.27271
-c0a0223c r __func__.28011
-c0a0224c r name
-c0a02258 r __func__.27252
-c0a0226c r __func__.36709
-c0a0227c r modck.36708
-c0a02284 r __func__.37246
-c0a022a0 r __func__.28074
-c0a022b8 r __func__.28070
-c0a022d4 r __func__.28103
-c0a022e8 r __func__.28109
-c0a022fc r __func__.28161
-c0a02314 r __func__.28135
-c0a02334 r __func__.25577
-c0a02348 r __func__.23975
-c0a02368 r __func__.23985
-c0a02384 r __func__.30938
-c0a02394 r debug_fops
-c0a0240c r pm_dbg_option_fops
-c0a02484 r pwrdm_suspend_fops
-c0a024fc r pwrdm_state_names
-c0a0250c r __func__.30154
-c0a02524 r __func__.30166
-c0a02544 r __func__.30177
-c0a02568 r __func__.30189
-c0a02584 r __func__.30203
-c0a025a0 r __func__.30215
-c0a025c0 r __func__.30227
-c0a025d8 r __func__.30239
-c0a025f0 r __func__.30248
-c0a0260c r __func__.30257
-c0a02628 r __func__.19941
-c0a0263c r __func__.19953
-c0a02658 r __func__.19965
-c0a02674 r __func__.19977
-c0a0268c r __func__.19988
-c0a026a4 r __func__.28041
-c0a026b8 r __func__.28049
-c0a026c8 r __func__.28057
-c0a026d8 r __func__.28062
-c0a026f4 r __func__.28068
-c0a02710 r __func__.28076
-c0a0272c r __func__.28081
-c0a02744 r __func__.14518
-c0a02758 r __func__.14345
-c0a0276c r __func__.14379
-c0a02784 r __func__.14532
-c0a0279c r __func__.14512
-c0a027b0 r __func__.27364
-c0a027c0 r __func__.27389
-c0a027dc r __func__.27402
-c0a027ec r __func__.27409
-c0a027fc r __func__.34357
-c0a02814 r __func__.34364
-c0a02834 r __func__.27872
-c0a02848 r __func__.29301
-c0a02858 r __func__.36945
-c0a0286c r __func__.36957
-c0a0287c r __func__.36800
-c0a02890 r __func__.26969
-c0a028a8 r __func__.26938
-c0a028c0 r __func__.26928
-c0a028d4 r omap_timer_match
-c0a02ef4 r __func__.27014
-c0a02f08 r __func__.26797
-c0a02f20 r __func__.26943
-c0a02f3c r __func__.26966
-c0a02f58 r __func__.26977
-c0a02f74 r CSWTCH.92
-c0a02f80 r __func__.26836
-c0a02f9c r __func__.26648
-c0a02fb8 r __func__.26712
-c0a02fd8 r omap3plus_pdata
+c0a00068 R linux_banner
+c0a000fc r __func__.5825
+c0a0010c r sqrt_oddadjust
+c0a0012c r sqrt_evenadjust
+c0a0014c r __func__.5807
+c0a0015c r cc_map
+c0a0017c r isa_modes
+c0a0018c r processor_modes
+c0a0020c r sigpage_mapping
+c0a0021c r regoffset_table
+c0a002b4 r user_arm_view
+c0a002c8 r arm_regsets
+c0a00334 r hwcap_str
+c0a00390 r hwcap2_str
+c0a003a8 r proc_arch
+c0a003ec R cpuinfo_op
+c0a003fc R sigreturn_codes
+c0a00418 r handler
+c0a0042c r atags_fops
+c0a004a4 r pmresrn_table.31150
+c0a004b4 r pmresrn_table.31002
+c0a004c0 r scorpion_perf_cache_map
+c0a00568 r scorpion_perf_map
+c0a00590 r krait_perf_cache_map
+c0a00638 r krait_perf_map
+c0a00660 r krait_perf_map_no_branch
+c0a00688 r armv7_a5_perf_cache_map
+c0a00730 r armv7_a5_perf_map
+c0a00758 r armv7_a7_perf_cache_map
+c0a00800 r armv7_a7_perf_map
+c0a00828 r armv7_a8_perf_cache_map
+c0a008d0 r armv7_a8_perf_map
+c0a008f8 r armv7_a9_perf_cache_map
+c0a009a0 r armv7_a9_perf_map
+c0a009c8 r armv7_a12_perf_cache_map
+c0a00a70 r armv7_a12_perf_map
+c0a00a98 r armv7_a15_perf_cache_map
+c0a00b40 r armv7_a15_perf_map
+c0a00b68 r armv7_pmu_probe_table
+c0a00b8c r armv7_pmu_of_device_ids
+c0a013f8 r usermode_action
+c0a01410 r alignment_proc_fops
+c0a01488 r subset.21772
+c0a014a8 r subset.21782
+c0a014b8 r __param_str_alignment
+c0a014c4 r cpu_arch_name
+c0a014ca r cpu_elf_name
+c0a014d0 r l2c220_data
+c0a01518 r omap_types
+c0a0152c r __func__.28508
+c0a01544 r __func__.29284
+c0a01564 r __func__.29289
+c0a01584 r am33xx_control_reg_offsets
+c0a01644 r am43xx_control_reg_offsets
+c0a01720 r omap_scrm_dt_match_table
+c0a01ec8 r omap2_ctrl_data
+c0a01ed0 r omap_mux_dbg_signal_fops
+c0a01f48 r omap_mux_dbg_board_fops
+c0a01fc0 r __func__.28699
+c0a01fd4 r __func__.28741
+c0a01fec r __func__.28758
+c0a02004 r __func__.28788
+c0a02018 r __func__.29075
+c0a0202c r __func__.29089
+c0a02040 r __func__.29126
+c0a02050 r __func__.29002
+c0a02068 r __func__.29015
+c0a02084 r __func__.29102
+c0a02098 r __func__.30036
+c0a020b8 r __func__.30084
+c0a020cc r __func__.30078
+c0a020dc r __func__.36712
+c0a020f0 r omap_pm_ops
+c0a02118 r reg_map
+c0a021ec r __func__.31257
+c0a02208 r __func__.27253
+c0a02220 r __func__.27271
+c0a02238 r __func__.28011
+c0a02248 r name
+c0a02254 r __func__.27252
+c0a02268 r __func__.36709
+c0a02278 r modck.36708
+c0a02280 r __func__.37246
+c0a0229c r __func__.28074
+c0a022b4 r __func__.28070
+c0a022d0 r __func__.28103
+c0a022e4 r __func__.28109
+c0a022f8 r __func__.28161
+c0a02310 r __func__.28135
+c0a02330 r __func__.25577
+c0a02344 r __func__.23975
+c0a02364 r __func__.23985
+c0a02380 r __func__.30938
+c0a02390 r debug_fops
+c0a02408 r pm_dbg_option_fops
+c0a02480 r pwrdm_suspend_fops
+c0a024f8 r pwrdm_state_names
+c0a02508 r __func__.30154
+c0a02520 r __func__.30166
+c0a02540 r __func__.30177
+c0a02564 r __func__.30189
+c0a02580 r __func__.30203
+c0a0259c r __func__.30215
+c0a025bc r __func__.30227
+c0a025d4 r __func__.30239
+c0a025ec r __func__.30248
+c0a02608 r __func__.30257
+c0a02624 r __func__.19941
+c0a02638 r __func__.19953
+c0a02654 r __func__.19965
+c0a02670 r __func__.19977
+c0a02688 r __func__.19988
+c0a026a0 r __func__.28041
+c0a026b4 r __func__.28049
+c0a026c4 r __func__.28057
+c0a026d4 r __func__.28062
+c0a026f0 r __func__.28068
+c0a0270c r __func__.28076
+c0a02728 r __func__.28081
+c0a02740 r __func__.14518
+c0a02754 r __func__.14345
+c0a02768 r __func__.14379
+c0a02780 r __func__.14532
+c0a02798 r __func__.14512
+c0a027ac r __func__.27364
+c0a027bc r __func__.27389
+c0a027d8 r __func__.27402
+c0a027e8 r __func__.27409
+c0a027f8 r __func__.34357
+c0a02810 r __func__.34364
+c0a02830 r __func__.27872
+c0a02844 r __func__.29301
+c0a02854 r __func__.36945
+c0a02868 r __func__.36957
+c0a02878 r __func__.36800
+c0a0288c r __func__.26969
+c0a028a4 r __func__.26938
+c0a028bc r __func__.26928
+c0a028d0 r omap_timer_match
+c0a02ef0 r __func__.27014
+c0a02f04 r __func__.26797
+c0a02f1c r __func__.26943
+c0a02f38 r __func__.26966
+c0a02f54 r __func__.26977
+c0a02f70 r CSWTCH.92
+c0a02f7c r __func__.26836
+c0a02f98 r __func__.26648
+c0a02fb4 r __func__.26712
+c0a02fd4 r omap3plus_pdata
 c0a02fe8 r execdomains_proc_fops
 c0a03060 r tnts
 c0a03090 r __param_str_crash_kexec_post_notifiers
@@ -70318,7 +70318,7 @@ c0d4b848 T __initramfs_start
 c0d4b848 t __irf_start
 c0d4b848 T __security_initcall_end
 c0d4b848 T __security_initcall_start
-c0d4b8cd t __irf_end
+c0d4b8ce t __irf_end
 c0d4b8d0 T __initramfs_size
 c0e00000 D __data_loc
 c0e00000 D __init_end

+ 150 - 150
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_kallsyms1.S

@@ -34580,155 +34580,155 @@ kallsyms_offsets:
 	.long	0x9f8000
 	.long	0x9f8000
 	.long	0x9f8010
-	.long	0x9f806c
-	.long	0x9f8100
-	.long	0x9f8110
-	.long	0x9f8130
-	.long	0x9f8150
-	.long	0x9f8160
-	.long	0x9f8180
-	.long	0x9f8190
-	.long	0x9f8210
-	.long	0x9f8220
-	.long	0x9f82b8
-	.long	0x9f82cc
-	.long	0x9f8338
-	.long	0x9f8394
-	.long	0x9f83ac
-	.long	0x9f83f0
-	.long	0x9f8400
-	.long	0x9f841c
-	.long	0x9f8430
-	.long	0x9f84a8
-	.long	0x9f84b8
-	.long	0x9f84c4
-	.long	0x9f856c
-	.long	0x9f8594
-	.long	0x9f863c
-	.long	0x9f8664
-	.long	0x9f868c
-	.long	0x9f8734
-	.long	0x9f875c
-	.long	0x9f8804
-	.long	0x9f882c
-	.long	0x9f88d4
-	.long	0x9f88fc
-	.long	0x9f89a4
-	.long	0x9f89cc
-	.long	0x9f8a74
-	.long	0x9f8a9c
-	.long	0x9f8b44
-	.long	0x9f8b6c
-	.long	0x9f8b90
-	.long	0x9f93fc
-	.long	0x9f9414
-	.long	0x9f948c
-	.long	0x9f94ac
-	.long	0x9f94bc
-	.long	0x9f94c8
-	.long	0x9f94ce
-	.long	0x9f94d4
-	.long	0x9f951c
-	.long	0x9f9530
-	.long	0x9f9548
-	.long	0x9f9568
-	.long	0x9f9588
-	.long	0x9f9648
-	.long	0x9f9724
-	.long	0x9f9ecc
-	.long	0x9f9ed4
-	.long	0x9f9f4c
-	.long	0x9f9fc4
-	.long	0x9f9fd8
-	.long	0x9f9ff0
-	.long	0x9fa008
-	.long	0x9fa01c
-	.long	0x9fa030
-	.long	0x9fa044
-	.long	0x9fa054
-	.long	0x9fa06c
-	.long	0x9fa088
-	.long	0x9fa09c
-	.long	0x9fa0bc
-	.long	0x9fa0d0
-	.long	0x9fa0e0
-	.long	0x9fa0f4
-	.long	0x9fa11c
-	.long	0x9fa1f0
-	.long	0x9fa20c
-	.long	0x9fa224
-	.long	0x9fa23c
-	.long	0x9fa24c
-	.long	0x9fa258
-	.long	0x9fa26c
-	.long	0x9fa27c
-	.long	0x9fa284
-	.long	0x9fa2a0
-	.long	0x9fa2b8
-	.long	0x9fa2d4
-	.long	0x9fa2e8
-	.long	0x9fa2fc
-	.long	0x9fa314
-	.long	0x9fa334
-	.long	0x9fa348
-	.long	0x9fa368
-	.long	0x9fa384
-	.long	0x9fa394
-	.long	0x9fa40c
-	.long	0x9fa484
-	.long	0x9fa4fc
-	.long	0x9fa50c
-	.long	0x9fa524
-	.long	0x9fa544
-	.long	0x9fa568
-	.long	0x9fa584
-	.long	0x9fa5a0
-	.long	0x9fa5c0
-	.long	0x9fa5d8
-	.long	0x9fa5f0
-	.long	0x9fa60c
-	.long	0x9fa628
-	.long	0x9fa63c
-	.long	0x9fa658
-	.long	0x9fa674
-	.long	0x9fa68c
-	.long	0x9fa6a4
-	.long	0x9fa6b8
-	.long	0x9fa6c8
-	.long	0x9fa6d8
-	.long	0x9fa6f4
-	.long	0x9fa710
-	.long	0x9fa72c
-	.long	0x9fa744
-	.long	0x9fa758
-	.long	0x9fa76c
-	.long	0x9fa784
-	.long	0x9fa79c
-	.long	0x9fa7b0
-	.long	0x9fa7c0
-	.long	0x9fa7dc
-	.long	0x9fa7ec
-	.long	0x9fa7fc
-	.long	0x9fa814
-	.long	0x9fa834
-	.long	0x9fa848
-	.long	0x9fa858
-	.long	0x9fa86c
-	.long	0x9fa87c
-	.long	0x9fa890
-	.long	0x9fa8a8
-	.long	0x9fa8c0
-	.long	0x9fa8d4
-	.long	0x9faef4
-	.long	0x9faf08
-	.long	0x9faf20
-	.long	0x9faf3c
-	.long	0x9faf58
-	.long	0x9faf74
-	.long	0x9faf80
-	.long	0x9faf9c
-	.long	0x9fafb8
-	.long	0x9fafd8
+	.long	0x9f8068
+	.long	0x9f80fc
+	.long	0x9f810c
+	.long	0x9f812c
+	.long	0x9f814c
+	.long	0x9f815c
+	.long	0x9f817c
+	.long	0x9f818c
+	.long	0x9f820c
+	.long	0x9f821c
+	.long	0x9f82b4
+	.long	0x9f82c8
+	.long	0x9f8334
+	.long	0x9f8390
+	.long	0x9f83a8
+	.long	0x9f83ec
+	.long	0x9f83fc
+	.long	0x9f8418
+	.long	0x9f842c
+	.long	0x9f84a4
+	.long	0x9f84b4
+	.long	0x9f84c0
+	.long	0x9f8568
+	.long	0x9f8590
+	.long	0x9f8638
+	.long	0x9f8660
+	.long	0x9f8688
+	.long	0x9f8730
+	.long	0x9f8758
+	.long	0x9f8800
+	.long	0x9f8828
+	.long	0x9f88d0
+	.long	0x9f88f8
+	.long	0x9f89a0
+	.long	0x9f89c8
+	.long	0x9f8a70
+	.long	0x9f8a98
+	.long	0x9f8b40
+	.long	0x9f8b68
+	.long	0x9f8b8c
+	.long	0x9f93f8
+	.long	0x9f9410
+	.long	0x9f9488
+	.long	0x9f94a8
+	.long	0x9f94b8
+	.long	0x9f94c4
+	.long	0x9f94ca
+	.long	0x9f94d0
+	.long	0x9f9518
+	.long	0x9f952c
+	.long	0x9f9544
+	.long	0x9f9564
+	.long	0x9f9584
+	.long	0x9f9644
+	.long	0x9f9720
+	.long	0x9f9ec8
+	.long	0x9f9ed0
+	.long	0x9f9f48
+	.long	0x9f9fc0
+	.long	0x9f9fd4
+	.long	0x9f9fec
+	.long	0x9fa004
+	.long	0x9fa018
+	.long	0x9fa02c
+	.long	0x9fa040
+	.long	0x9fa050
+	.long	0x9fa068
+	.long	0x9fa084
+	.long	0x9fa098
+	.long	0x9fa0b8
+	.long	0x9fa0cc
+	.long	0x9fa0dc
+	.long	0x9fa0f0
+	.long	0x9fa118
+	.long	0x9fa1ec
+	.long	0x9fa208
+	.long	0x9fa220
+	.long	0x9fa238
+	.long	0x9fa248
+	.long	0x9fa254
+	.long	0x9fa268
+	.long	0x9fa278
+	.long	0x9fa280
+	.long	0x9fa29c
+	.long	0x9fa2b4
+	.long	0x9fa2d0
+	.long	0x9fa2e4
+	.long	0x9fa2f8
+	.long	0x9fa310
+	.long	0x9fa330
+	.long	0x9fa344
+	.long	0x9fa364
+	.long	0x9fa380
+	.long	0x9fa390
+	.long	0x9fa408
+	.long	0x9fa480
+	.long	0x9fa4f8
+	.long	0x9fa508
+	.long	0x9fa520
+	.long	0x9fa540
+	.long	0x9fa564
+	.long	0x9fa580
+	.long	0x9fa59c
+	.long	0x9fa5bc
+	.long	0x9fa5d4
+	.long	0x9fa5ec
+	.long	0x9fa608
+	.long	0x9fa624
+	.long	0x9fa638
+	.long	0x9fa654
+	.long	0x9fa670
+	.long	0x9fa688
+	.long	0x9fa6a0
+	.long	0x9fa6b4
+	.long	0x9fa6c4
+	.long	0x9fa6d4
+	.long	0x9fa6f0
+	.long	0x9fa70c
+	.long	0x9fa728
+	.long	0x9fa740
+	.long	0x9fa754
+	.long	0x9fa768
+	.long	0x9fa780
+	.long	0x9fa798
+	.long	0x9fa7ac
+	.long	0x9fa7bc
+	.long	0x9fa7d8
+	.long	0x9fa7e8
+	.long	0x9fa7f8
+	.long	0x9fa810
+	.long	0x9fa830
+	.long	0x9fa844
+	.long	0x9fa854
+	.long	0x9fa868
+	.long	0x9fa878
+	.long	0x9fa88c
+	.long	0x9fa8a4
+	.long	0x9fa8bc
+	.long	0x9fa8d0
+	.long	0x9faef0
+	.long	0x9faf04
+	.long	0x9faf1c
+	.long	0x9faf38
+	.long	0x9faf54
+	.long	0x9faf70
+	.long	0x9faf7c
+	.long	0x9faf98
+	.long	0x9fafb4
+	.long	0x9fafd4
 	.long	0x9fafe8
 	.long	0x9fb060
 	.long	0x9fb090
@@ -70319,7 +70319,7 @@ kallsyms_offsets:
 	.long	0xc43848
 	.long	0xc43848
 	.long	0xc43848
-	.long	0xc438cd
+	.long	0xc438ce
 	.long	0xc438d0
 	.long	0xcf8000
 	.long	0xcf8000

+ 150 - 150
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_kallsyms2.S

@@ -34580,155 +34580,155 @@ kallsyms_offsets:
 	.long	0x9f8000
 	.long	0x9f8000
 	.long	0x9f8010
-	.long	0x9f806c
-	.long	0x9f8100
-	.long	0x9f8110
-	.long	0x9f8130
-	.long	0x9f8150
-	.long	0x9f8160
-	.long	0x9f8180
-	.long	0x9f8190
-	.long	0x9f8210
-	.long	0x9f8220
-	.long	0x9f82b8
-	.long	0x9f82cc
-	.long	0x9f8338
-	.long	0x9f8394
-	.long	0x9f83ac
-	.long	0x9f83f0
-	.long	0x9f8400
-	.long	0x9f841c
-	.long	0x9f8430
-	.long	0x9f84a8
-	.long	0x9f84b8
-	.long	0x9f84c4
-	.long	0x9f856c
-	.long	0x9f8594
-	.long	0x9f863c
-	.long	0x9f8664
-	.long	0x9f868c
-	.long	0x9f8734
-	.long	0x9f875c
-	.long	0x9f8804
-	.long	0x9f882c
-	.long	0x9f88d4
-	.long	0x9f88fc
-	.long	0x9f89a4
-	.long	0x9f89cc
-	.long	0x9f8a74
-	.long	0x9f8a9c
-	.long	0x9f8b44
-	.long	0x9f8b6c
-	.long	0x9f8b90
-	.long	0x9f93fc
-	.long	0x9f9414
-	.long	0x9f948c
-	.long	0x9f94ac
-	.long	0x9f94bc
-	.long	0x9f94c8
-	.long	0x9f94ce
-	.long	0x9f94d4
-	.long	0x9f951c
-	.long	0x9f9530
-	.long	0x9f9548
-	.long	0x9f9568
-	.long	0x9f9588
-	.long	0x9f9648
-	.long	0x9f9724
-	.long	0x9f9ecc
-	.long	0x9f9ed4
-	.long	0x9f9f4c
-	.long	0x9f9fc4
-	.long	0x9f9fd8
-	.long	0x9f9ff0
-	.long	0x9fa008
-	.long	0x9fa01c
-	.long	0x9fa030
-	.long	0x9fa044
-	.long	0x9fa054
-	.long	0x9fa06c
-	.long	0x9fa088
-	.long	0x9fa09c
-	.long	0x9fa0bc
-	.long	0x9fa0d0
-	.long	0x9fa0e0
-	.long	0x9fa0f4
-	.long	0x9fa11c
-	.long	0x9fa1f0
-	.long	0x9fa20c
-	.long	0x9fa224
-	.long	0x9fa23c
-	.long	0x9fa24c
-	.long	0x9fa258
-	.long	0x9fa26c
-	.long	0x9fa27c
-	.long	0x9fa284
-	.long	0x9fa2a0
-	.long	0x9fa2b8
-	.long	0x9fa2d4
-	.long	0x9fa2e8
-	.long	0x9fa2fc
-	.long	0x9fa314
-	.long	0x9fa334
-	.long	0x9fa348
-	.long	0x9fa368
-	.long	0x9fa384
-	.long	0x9fa394
-	.long	0x9fa40c
-	.long	0x9fa484
-	.long	0x9fa4fc
-	.long	0x9fa50c
-	.long	0x9fa524
-	.long	0x9fa544
-	.long	0x9fa568
-	.long	0x9fa584
-	.long	0x9fa5a0
-	.long	0x9fa5c0
-	.long	0x9fa5d8
-	.long	0x9fa5f0
-	.long	0x9fa60c
-	.long	0x9fa628
-	.long	0x9fa63c
-	.long	0x9fa658
-	.long	0x9fa674
-	.long	0x9fa68c
-	.long	0x9fa6a4
-	.long	0x9fa6b8
-	.long	0x9fa6c8
-	.long	0x9fa6d8
-	.long	0x9fa6f4
-	.long	0x9fa710
-	.long	0x9fa72c
-	.long	0x9fa744
-	.long	0x9fa758
-	.long	0x9fa76c
-	.long	0x9fa784
-	.long	0x9fa79c
-	.long	0x9fa7b0
-	.long	0x9fa7c0
-	.long	0x9fa7dc
-	.long	0x9fa7ec
-	.long	0x9fa7fc
-	.long	0x9fa814
-	.long	0x9fa834
-	.long	0x9fa848
-	.long	0x9fa858
-	.long	0x9fa86c
-	.long	0x9fa87c
-	.long	0x9fa890
-	.long	0x9fa8a8
-	.long	0x9fa8c0
-	.long	0x9fa8d4
-	.long	0x9faef4
-	.long	0x9faf08
-	.long	0x9faf20
-	.long	0x9faf3c
-	.long	0x9faf58
-	.long	0x9faf74
-	.long	0x9faf80
-	.long	0x9faf9c
-	.long	0x9fafb8
-	.long	0x9fafd8
+	.long	0x9f8068
+	.long	0x9f80fc
+	.long	0x9f810c
+	.long	0x9f812c
+	.long	0x9f814c
+	.long	0x9f815c
+	.long	0x9f817c
+	.long	0x9f818c
+	.long	0x9f820c
+	.long	0x9f821c
+	.long	0x9f82b4
+	.long	0x9f82c8
+	.long	0x9f8334
+	.long	0x9f8390
+	.long	0x9f83a8
+	.long	0x9f83ec
+	.long	0x9f83fc
+	.long	0x9f8418
+	.long	0x9f842c
+	.long	0x9f84a4
+	.long	0x9f84b4
+	.long	0x9f84c0
+	.long	0x9f8568
+	.long	0x9f8590
+	.long	0x9f8638
+	.long	0x9f8660
+	.long	0x9f8688
+	.long	0x9f8730
+	.long	0x9f8758
+	.long	0x9f8800
+	.long	0x9f8828
+	.long	0x9f88d0
+	.long	0x9f88f8
+	.long	0x9f89a0
+	.long	0x9f89c8
+	.long	0x9f8a70
+	.long	0x9f8a98
+	.long	0x9f8b40
+	.long	0x9f8b68
+	.long	0x9f8b8c
+	.long	0x9f93f8
+	.long	0x9f9410
+	.long	0x9f9488
+	.long	0x9f94a8
+	.long	0x9f94b8
+	.long	0x9f94c4
+	.long	0x9f94ca
+	.long	0x9f94d0
+	.long	0x9f9518
+	.long	0x9f952c
+	.long	0x9f9544
+	.long	0x9f9564
+	.long	0x9f9584
+	.long	0x9f9644
+	.long	0x9f9720
+	.long	0x9f9ec8
+	.long	0x9f9ed0
+	.long	0x9f9f48
+	.long	0x9f9fc0
+	.long	0x9f9fd4
+	.long	0x9f9fec
+	.long	0x9fa004
+	.long	0x9fa018
+	.long	0x9fa02c
+	.long	0x9fa040
+	.long	0x9fa050
+	.long	0x9fa068
+	.long	0x9fa084
+	.long	0x9fa098
+	.long	0x9fa0b8
+	.long	0x9fa0cc
+	.long	0x9fa0dc
+	.long	0x9fa0f0
+	.long	0x9fa118
+	.long	0x9fa1ec
+	.long	0x9fa208
+	.long	0x9fa220
+	.long	0x9fa238
+	.long	0x9fa248
+	.long	0x9fa254
+	.long	0x9fa268
+	.long	0x9fa278
+	.long	0x9fa280
+	.long	0x9fa29c
+	.long	0x9fa2b4
+	.long	0x9fa2d0
+	.long	0x9fa2e4
+	.long	0x9fa2f8
+	.long	0x9fa310
+	.long	0x9fa330
+	.long	0x9fa344
+	.long	0x9fa364
+	.long	0x9fa380
+	.long	0x9fa390
+	.long	0x9fa408
+	.long	0x9fa480
+	.long	0x9fa4f8
+	.long	0x9fa508
+	.long	0x9fa520
+	.long	0x9fa540
+	.long	0x9fa564
+	.long	0x9fa580
+	.long	0x9fa59c
+	.long	0x9fa5bc
+	.long	0x9fa5d4
+	.long	0x9fa5ec
+	.long	0x9fa608
+	.long	0x9fa624
+	.long	0x9fa638
+	.long	0x9fa654
+	.long	0x9fa670
+	.long	0x9fa688
+	.long	0x9fa6a0
+	.long	0x9fa6b4
+	.long	0x9fa6c4
+	.long	0x9fa6d4
+	.long	0x9fa6f0
+	.long	0x9fa70c
+	.long	0x9fa728
+	.long	0x9fa740
+	.long	0x9fa754
+	.long	0x9fa768
+	.long	0x9fa780
+	.long	0x9fa798
+	.long	0x9fa7ac
+	.long	0x9fa7bc
+	.long	0x9fa7d8
+	.long	0x9fa7e8
+	.long	0x9fa7f8
+	.long	0x9fa810
+	.long	0x9fa830
+	.long	0x9fa844
+	.long	0x9fa854
+	.long	0x9fa868
+	.long	0x9fa878
+	.long	0x9fa88c
+	.long	0x9fa8a4
+	.long	0x9fa8bc
+	.long	0x9fa8d0
+	.long	0x9faef0
+	.long	0x9faf04
+	.long	0x9faf1c
+	.long	0x9faf38
+	.long	0x9faf54
+	.long	0x9faf70
+	.long	0x9faf7c
+	.long	0x9faf98
+	.long	0x9fafb4
+	.long	0x9fafd4
 	.long	0x9fafe8
 	.long	0x9fb060
 	.long	0x9fb090
@@ -70319,7 +70319,7 @@ kallsyms_offsets:
 	.long	0xd43848
 	.long	0xd43848
 	.long	0xd43848
-	.long	0xd438cd
+	.long	0xd438ce
 	.long	0xd438d0
 	.long	0xdf8000
 	.long	0xdf8000

+ 1 - 1
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.version

@@ -1 +1 @@
-12
+16

+ 45 - 98
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/.am335x-evm.dtb.dts.tmp

@@ -1199,35 +1199,24 @@
 
 
 
-   0x020 (((1 << 5) | (1 << 3)) | 7)
-   0x024 (((1 << 5) | (1 << 3)) | 7)
-   0x028 (((1 << 5) | (1 << 3)) | 7)
-   0x02C (((1 << 5) | (1 << 3)) | 7)
    0x144 (((1 << 5) | (1 << 3)) | 7)
    0x1B0 (((1 << 3)) | 7)
    0x1B4 (((1 << 5) | (1 << 3)) | 7)
 
 
-   0x030 (((1 << 5) | (1 << 3)) | 7)
-   0x034 (((1 << 5) | (1 << 3)) | 7)
-   0x038 (((1 << 5) | (1 << 3)) | 7)
-   0x03C (((1 << 5) | (1 << 3)) | 7)
-
-
-   0x0EC (((1 << 3)) | 7)
-   0x0E4 (((1 << 3)) | 7)
+   0x088 (((1 << 5) | (1 << 3)) | 7)
+   0x08C (((1 << 3)) | 7)
+   0x0A0 (((1 << 3)) | 7)
+   0x0A4 (((1 << 3)) | 7)
+   0x0A8 (((1 << 3)) | 7)
+   0x0AC (((1 << 3)) | 7)
+   0x0B0 (((1 << 3)) | 7)
+   0x0B4 (((1 << 3)) | 7)
    0x0E8 (((1 << 5) | (1 << 3)) | 7)
-   0x0E0 (((1 << 5) | (1 << 3)) | 7)
-
+   0x0E0 (((1 << 3)) | 7)
 
-   0x194 (((1 << 5) | (1 << 3)) | 7)
-   0x1A0 (((1 << 5) | (1 << 3)) | 7)
-   0x19C (((1 << 5) | (1 << 3)) | 7)
-   0x190 (((1 << 3)) | 7)
-   0x1A4 (((1 << 3)) | 7)
-   0x198 (((1 << 3)) | 7)
+   0x1A0 (((1 << 3)) | 7)
    0x1A8 (((1 << 3)) | 7)
-
   >;
  };
 
@@ -1272,14 +1261,7 @@
    0x164 (0 | 1)
   >;
  };
-
- uart5_pins: pinmux_uart5_pins {
-  pinctrl-single,pins = <
-   0x0C0 (0 | 4)
-   0x0C4 (((1 << 5) | (1 << 4)) | 4)
-  >;
- };
-
+# 138 "arch/arm/boot/dts/am335x-evm.dts"
  clkout2_pin: pinmux_clkout2_pin {
   pinctrl-single,pins = <
    0x1b4 (0 | 3)
@@ -1330,12 +1312,12 @@
   pinctrl-single,pins = <
 
 
-   0x108 (((1 << 5) | (1 << 4)) | 0)
-   0x10C(((1 << 5) | (1 << 4)) | 0)
+
+
    0x110 (((1 << 5) | (1 << 4)) | 0)
+   0x118 (((1 << 5) | (1 << 4)) | 0)
    0x12c (((1 << 5) | (1 << 4)) | 0)
    0x130 (((1 << 5) | (1 << 4)) | 0)
-   0x118 (((1 << 5) | (1 << 4)) | 0)
    0x134 (((1 << 5) | (1 << 4)) | 0)
    0x138 (((1 << 5) | (1 << 4)) | 0)
    0x13c (((1 << 5) | (1 << 4)) | 0)
@@ -1346,23 +1328,6 @@
    0x124 (0 | 0)
    0x128 (0 | 0)
 
-
-   ((((0x878)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
-   ((((0x888)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 2)
-
-   ((((0x858)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
-   ((((0x85c)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
-   ((((0x844)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
-   ((((0x860)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
-   ((((0x864)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
-   ((((0x868)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
-   ((((0x86c)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
-   ((((0x840)) & 0xffff) - (0x0800)) (0 | 1)
-   ((((0x848)) & 0xffff) - (0x0800)) (0 | 1)
-   ((((0x84c)) & 0xffff) - (0x0800)) (0 | 1)
-   ((((0x850)) & 0xffff) - (0x0800)) (0 | 1)
-   ((((0x854)) & 0xffff) - (0x0800)) (0 | 1)
-
   >;
  };
 
@@ -1382,23 +1347,6 @@
    0x13c (((1 << 5)) | 7)
    0x140 (((1 << 5)) | 7)
 
-
-   ((((0x888)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-   ((((0x840)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-   ((((0x844)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-   ((((0x848)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-   ((((0x84c)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-   ((((0x850)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-   ((((0x854)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-   ((((0x858)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-   ((((0x85c)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-   ((((0x860)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-   ((((0x864)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-   ((((0x868)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-   ((((0x86c)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-
-   ((((0x878)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
-
   >;
  };
 
@@ -1437,14 +1385,15 @@
    0x17C (((1 << 5)) | 2)
   >;
  };
-
- dcan1_pins_default: dcan1_pins_default {
-  pinctrl-single,pins = <
-   0x168 (((1 << 4)) | 2)
-   0x16C (((1 << 5)) | 2)
-  >;
- };
-# 327 "arch/arm/boot/dts/am335x-evm.dts"
+# 281 "arch/arm/boot/dts/am335x-evm.dts"
+ spi1_pins: spi1_pins {
+                pinctrl-single,pins = <
+                        ((((0x990)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 3)
+                        ((((0x994)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 3)
+                        ((((0x998)) & 0xffff) - (0x0800)) (((1 << 4)) | 3)
+                        ((((0x99C)) & 0xffff) - (0x0800)) (((1 << 4)) | 3)
+                >;
+        };
 };
 
 
@@ -1476,14 +1425,7 @@
 
  status = "okay";
 };
-
-&uart5 {
- pinctrl-names = "default";
- pinctrl-0 = <&uart5_pins>;
-
- status = "okay";
-};
-
+# 328 "arch/arm/boot/dts/am335x-evm.dts"
 &i2c0 {
  pinctrl-names = "default";
  pinctrl-0 = <&i2c0_pins>;
@@ -1512,6 +1454,7 @@
                 compatible = "nxp,pcf85063";
                 reg = <0x51>;
         };
+
 };
 
 &usb {
@@ -1546,7 +1489,7 @@
 &elm {
  status = "okay";
 };
-# 449 "arch/arm/boot/dts/am335x-evm.dts"
+# 412 "arch/arm/boot/dts/am335x-evm.dts"
 &gpmc {
  status = "okay";
  pinctrl-names = "default", "sleep";
@@ -1647,7 +1590,7 @@
   };
   partition@13 {
    label = "Storage";
-   reg = <0x0A200000 0x75E00000>;
+   reg = <0x0A200000 0x35E00000>;
   };
  };
 };
@@ -1732,7 +1675,7 @@
   };
  };
 };
-# 555 "arch/arm/boot/dts/am335x-evm.dts" 2
+# 518 "arch/arm/boot/dts/am335x-evm.dts" 2
 
 &tps {
  vcc1-supply = <&vbat>;
@@ -1815,7 +1758,6 @@
  pinctrl-names = "default", "sleep";
  pinctrl-0 = <&cpsw_default>;
  pinctrl-1 = <&cpsw_sleep>;
- dual_emac = <1>;
  status = "okay";
 };
 
@@ -1824,20 +1766,15 @@
  pinctrl-0 = <&davinci_mdio_default>;
  pinctrl-1 = <&davinci_mdio_sleep>;
  status = "okay";
+
 };
 
 &cpsw_emac0 {
  phy_id = <&davinci_mdio>, <1>;
   phy-mode = "mii";
-  dual_emac_res_vlan = <1>;
-};
 
-&cpsw_emac1 {
- phy_id = <&davinci_mdio>, <2>;
-  phy-mode = "mii";
-  dual_emac_res_vlan = <2>;
 };
-
+# 624 "arch/arm/boot/dts/am335x-evm.dts"
 &tscadc {
  status = "okay";
 
@@ -1884,9 +1821,19 @@
  pinctrl-names = "default";
  pinctrl-0 = <&dcan0_pins_default>;
 };
-
-&dcan1 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&dcan1_pins_default>;
+# 685 "arch/arm/boot/dts/am335x-evm.dts"
+&spi1 {
+        status = "okay";
+        pinctrl-names = "default";
+        pinctrl-0 = <&spi1_pins>;
+        qca7000@0 {
+                compatible = "qca,qca7000";
+                reg = <0>;
+                interrupt-parent = <&gpio2>;
+                interrupts = <0 1>;
+                spi-cpha;
+                spi-cpol;
+                spi-max-frequency = <10000000>;
+                qca,legacy-mode = <0>;
+        };
 };

+ 73 - 83
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dts

@@ -64,36 +64,25 @@
 		pinctrl-single,pins = <
 		
 			/** Offset: 0x800 */
-			/** GPIO 0 */   
-			0x020 (PIN_INPUT | MUX_MODE7)			/* GPMC_AD8			=> 	GPIO0_22 */	/*ID BD1_1*/
-			0x024 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD9			=>	GPIO0_23 */	/*ID BD1_2*/
-			0x028 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD10		=>	GPIO0_26 */	/*IO BD1_1*/
-			0x02C (PIN_INPUT | MUX_MODE7)    		/* GPMC_AD11		=>	GPIO0_27 */	/*IO BD1_2*/
+			/** GPIO 0 */ 
 			0x144 (PIN_INPUT | MUX_MODE7)    			/* RMII1_REF_CLK		=>	GPIO0_29 */	/*USB 0 OCP detection*/
 			0x1B0 (PIN_OUTPUT | MUX_MODE7)			/*XDMA_EVENT_INTR0	=>	GPIO0_19 */	/*AM_RFID_RST*/
 			0x1B4 (PIN_INPUT | MUX_MODE7)			/*XDMA_EVENT_INTR1	=>	GPIO0_20 */	/*AM_RFID_ICC*/
-			
-			/** GPIO 1 */
-			0x030 (PIN_INPUT | MUX_MODE7)			/* GPMC_AD12	=> 	GPIO1_12 */	/*ID BD2_1*/
-			0x034 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD13	=>	GPIO1_13 */	/*ID BD2_2*/
-			0x038 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD14	=>	GPIO1_14 */	/*IO BD2_1*/
-			0x03C (PIN_INPUT | MUX_MODE7)    		/* GPMC_AD15	=>	GPIO1_15 */	/*IO BD2_2*/
-			
+			/** GPIO 1 */			
 			/** GPIO 2 */
-			0x0EC (PIN_OUTPUT | MUX_MODE7)			/*LCD_AC_BIAS_EN	=>	GPIO2_25*/	/*RS-485 for module DE control*/
-			0x0E4 (PIN_OUTPUT | MUX_MODE7)			/*LCD_HSYNC		=>	GPIO2_23*/	/*RS-485 for module RE control*/
-			0x0E8 (PIN_INPUT | MUX_MODE7)			/*LCD_PCLK		=>	GPIO2_24*/	/*CCS communication board 1 proximity*/
-			0x0E0 (PIN_INPUT | MUX_MODE7)			/*LCD_VSYNC		=>	GPIO2_22*/	/*CCS communication board 2 proximity*/
-			
+			0x088 (PIN_INPUT | MUX_MODE7)   		/* CCS=>GPMC_CSn3.GPIO2_0*/
+			0x08C (PIN_OUTPUT | MUX_MODE7)			/*GPMC_CLK	=>	GPIO2_1*/	/*Speaker*/
+			0x0A0 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA0	=>	GPIO2_6*/	/*Panel LED control-BB_LEDR1*/
+			0x0A4 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA1	=>	GPIO2_7*/	/*Panel LED control-BB_LEDG1*/
+			0x0A8 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA2	=>	GPIO2_8*/	/*Panel LED control-BB_LEDB1*/
+			0x0AC (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA3	=>	GPIO2_9*/	/*Panel LED control-BB_LEDR2*/
+			0x0B0 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA4	=>	GPIO2_10*/	/*Panel LED control-BB_LEDG2*/
+			0x0B4 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA5	=>	GPIO2_11*/	/*Panel LED control-BB_LEDB2*/
+			0x0E8 (PIN_INPUT | MUX_MODE7)			/*LCD_PCLK	=>	GPIO2_24*/	/*communication board proximity*/
+			0x0E0 (PIN_OUTPUT | MUX_MODE7)			/*LCD_VSYNC	=>	GPIO2_22*/	/*Breath LED*/
 			/** GPIO 3 */
-			0x194 (PIN_INPUT | MUX_MODE7)			/*MCASP0_FSX		=>	GPIO3_15*/	/*Emergency Stop button detect*/
-			0x1A0 (PIN_INPUT | MUX_MODE7)			/*MCASP0_ACLKR	=>	GPIO3_18*/	/*USB1 OCP detect*/
-			0x19C (PIN_INPUT | MUX_MODE7)			/*MCASP0_AHCLKR	=>	GPIO3_17*/	/*Emergency IO for AM3352 and STM32F407*/
-			0x190 (PIN_OUTPUT | MUX_MODE7)			/*MCASP0_ACLKX	=>	GPIO3_14*/	/*Ethernet PHY reset*/
-			0x1A4 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_FSR		=>	GPIO3_19 */	/*SMR Enable control_1*/
-			0x198 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_AXR0	=>	GPIO3_16 */	/*CSU board function OK indicator.*/
-			0x1A8 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_AXR1	=>	GPIO3_20 */	/*SMR Enable control_2*/
-			
+			0x1A0 (PIN_OUTPUT | MUX_MODE7)                  /* MCASP0_AXR1  =>      GPIO3_18 */     /*control 4G reset pin*/
+			0x1A8 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_AXR1	=>	GPIO3_20 */	/*control MCU to output CP PWM*/
 		>;
 	};
 	
@@ -138,14 +127,14 @@
 			0x164 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* ECAP0_IN_PWM0_OUT		=>	uart3_txd */
 		>;
 	};
-
+#if 0
 	uart5_pins: pinmux_uart5_pins {
 		pinctrl-single,pins = <
-			0x0C0 (PIN_OUTPUT_PULLDOWN | MUX_MODE4)		/* LCD_DATA8	=>	DUART5_TX*/
-			0x0C4 (PIN_INPUT_PULLUP | MUX_MODE4)			/* LCD_DATA9	=>	UART5_RX*/
+			0x0C0 (PIN_INPUT_PULLUP | MUX_MODE4)		/* LCD_DATA8	=>	UART5_RXD*/
+			0x0C4 (PIN_OUTPUT_PULLDOWN | MUX_MODE4)	/* LCD_DATA9	=>	UART5_TXD*/
 		>;
 	};
-	
+#endif	
 	clkout2_pin: pinmux_clkout2_pin {
 		pinctrl-single,pins = <
 			0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)	/* xdma_event_intr1.clkout2 */
@@ -196,12 +185,12 @@
 		pinctrl-single,pins = <					
 		
 			/* Slave 1 */
-			0x108 (PIN_INPUT_PULLUP | MUX_MODE0)		/* MII1_COL.gmii1_col */
-			0x10C(PIN_INPUT_PULLUP | MUX_MODE0)		/* MII1_CRS.MII1_CRS */
+			//0x108 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* MII1_COL.gmii1_col */
+			//0x10C(PIN_INPUT_PULLDOWN | MUX_MODE0)		/* MII1_CRS.MII1_CRS */
 			0x110 (PIN_INPUT_PULLUP | MUX_MODE0)		/* MII1_RX_ER.gmii1_rxerr */
+			0x118 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxdv.mii1_rxdv */
 			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_txclk.mii1_txclk */
 			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxclk.mii1_rxclk */
-			0x118 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxdv.mii1_rxdv */
 			0x134 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd3.rgmii1_rd3 */
 			0x138 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd2.rgmii1_rd2 */
 			0x13c (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd1.rgmii1_rd1 */
@@ -210,24 +199,7 @@
 			0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd3.rgmii1_td3 */
 			0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd2.rgmii1_td2 */
 			0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd1.rgmii1_td1 */
-			0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd0.rgmii1_td0 */      	
-			
-			/* Slave 2 */
-			AM33XX_IOPAD(0x878, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_ben1.mii2_col */
-			AM33XX_IOPAD(0x888, PIN_INPUT_PULLUP | MUX_MODE2)					/* GPMC_CSn3.rmii2_crs_dv*/								
-			/*AM33XX_IOPAD(0x874, PIN_INPUT_PULLUP | MUX_MODE1)*/					/* gpmc_wpn.mii2_rxerr */
-			AM33XX_IOPAD(0x858, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a6.mii2_txclk */
-			AM33XX_IOPAD(0x85c, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a7.mii2_rxclk */
-			AM33XX_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a1.mii2_rxdv */
-			AM33XX_IOPAD(0x860, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a8.mii2_rxd3 */
-			AM33XX_IOPAD(0x864, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a9.mii2_rxd2 */
-			AM33XX_IOPAD(0x868, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a10.mii2_rxd1 */
-			AM33XX_IOPAD(0x86c, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a11.mii2_rxd0 */
-			AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a0.mii2_txen */
-			AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a2.mii2_txd3 */
-			AM33XX_IOPAD(0x84c, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a3.mii2_txd2 */
-			AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a4.mii2_txd1 */
-			AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a5.mii2_txd0 */
+			0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd0.rgmii1_td0 */      
 
 		>;
 	};
@@ -248,23 +220,6 @@
 			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
 			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)		
 			
-			/* Slave 2 */
-			AM33XX_IOPAD(0x888, PIN_INPUT_PULLDOWN | MUX_MODE7)					/* GPMC_CSn3.rmii2_crs_dv*/	
-			AM33XX_IOPAD(0x840, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a0.mii2_txen */
-			AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a1.mii2_rxdv */
-			AM33XX_IOPAD(0x848, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a2.mii2_txd3 */
-			AM33XX_IOPAD(0x84c, PIN_INPUT_PULLDOWN | MUX_MODE7)			/* gpmc_a3.mii2_txd2 */
-			AM33XX_IOPAD(0x850, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a4.mii2_txd1 */
-			AM33XX_IOPAD(0x854, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a5.mii2_txd0 */
-			AM33XX_IOPAD(0x858, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a6.mii2_txclk */
-			AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a7.mii2_rxclk */
-			AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a8.mii2_rxd3 */
-			AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a9.mii2_rxd2 */
-			AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a10.mii2_rxd1 */
-			AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a11.mii2_rxd0 */
-			/*AM33XX_IOPAD(0x874, PIN_INPUT_PULLDOWN | MUX_MODE7)*/	/* gpmc_wpn.mii2_rxerr */
-			AM33XX_IOPAD(0x878, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_ben1.mii2_col */
-			
 		>;
 	};
 
@@ -303,14 +258,14 @@
 			0x17C (PIN_INPUT_PULLDOWN | MUX_MODE2)		/* uart1_rtsn	=>	d_can0_rx */
 		>;
 	};
-	
+#if 0	
 	dcan1_pins_default: dcan1_pins_default {
 		pinctrl-single,pins = <
 			0x168 (PIN_OUTPUT_PULLUP | MUX_MODE2)		/* UART0_CTSn		=>	d_can1_tx */
 			0x16C (PIN_INPUT_PULLDOWN | MUX_MODE2)	/* UART0_RTSn		=>	d_can1_rx */
 		>;
 	};
-#if 0
+
 	ehrpwm1_pins: ehrpwm1_pins {
 		pinctrl-single,pins = <			
 			0x0C8 (PIN_OUTPUT | MUX_MODE2) /* LCD_DATA10.eHRPWM1A */
@@ -321,9 +276,16 @@
 		pinctrl-single,pins =< 
 			0x0A4 (PIN_OUTPUT | MUX_MODE3)	/* LCD_DATA1.eHRPWM2B */
 		>;                
-    };	
-	 
+    	};	 
 #endif  
+	spi1_pins: spi1_pins {
+                pinctrl-single,pins = <
+                        AM33XX_IOPAD(0x990, PIN_INPUT_PULLUP | MUX_MODE3) /* MCASP0_ACLKX.AM_SPI1_SCLK */
+                        AM33XX_IOPAD(0x994, PIN_INPUT_PULLUP | MUX_MODE3) /* MCASP0_FSX.AM_SPI1_D0 */
+                        AM33XX_IOPAD(0x998, PIN_OUTPUT_PULLUP | MUX_MODE3) /* MCASP0_AXR0.AM_SPI1_D1 */
+                        AM33XX_IOPAD(0x99C, PIN_OUTPUT_PULLUP | MUX_MODE3) /* MCASP0_AHCLKR.AM_SPI1_CS0 */
+                >;
+        };
 };
 
 
@@ -355,14 +317,14 @@
 
 	status = "okay";
 };
-
+#if 0
 &uart5 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart5_pins>;
 
 	status = "okay";
 };
-
+#endif
 &i2c0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c0_pins>;
@@ -373,11 +335,11 @@
 	tps: tps@2d {
 		reg = <0x2d>;
 	};
-	
+
 /*	rtc0: rtc@51 {
-                compatible = "nxp,pcf85063";
-                reg = <0x51>;
-        };*/	
+		compatible = "nxp,pcf85063";
+		reg = <0x51>;
+	};*/
 };
 #if 1
 &i2c1 {
@@ -391,6 +353,7 @@
                 compatible = "nxp,pcf85063";
                 reg = <0x51>;
         };
+
 };
 #endif
 &usb {
@@ -546,7 +509,7 @@
 		};
 		partition@13 {
 			label = "Storage";
-			reg = <0x0A200000 0x75E00000>;
+			reg = <0x0A200000 0x35E00000>;
 		};
 	};
 };
@@ -634,7 +597,6 @@
 	pinctrl-names = "default", "sleep";
 	pinctrl-0 = <&cpsw_default>;
 	pinctrl-1 = <&cpsw_sleep>;
-	dual_emac = <1>;
 	status = "okay";
 };
 
@@ -643,19 +605,21 @@
 	pinctrl-0 = <&davinci_mdio_default>;
 	pinctrl-1 = <&davinci_mdio_sleep>;
 	status = "okay";
+	//reset-gpios = <&gpio3 14 GPIO_ACTIVE_LOW>;
 };
 
 &cpsw_emac0 {
 	phy_id = <&davinci_mdio>, <1>;
  	phy-mode = "mii";
- 	dual_emac_res_vlan = <1>;
-};
 
+};
+#if 0
 &cpsw_emac1 {
 	phy_id = <&davinci_mdio>, <2>;
  	phy-mode = "mii";
- 	dual_emac_res_vlan = <2>;
+
 };
+#endif
 
 &tscadc {
 	status = "okay";
@@ -703,9 +667,35 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&dcan0_pins_default>;
 };
-
+#if 0
 &dcan1 {
 	status = "okay";	
 	pinctrl-names = "default";
 	pinctrl-0 = <&dcan1_pins_default>;
 };
+#endif
+
+/*
+The QCA7000 acts as a SPI slave and uses Mode 3: CPOL=1, CPHA=1.
+SPI data width is 8 bit. The SPI CLK period should not be less than 83.3 ns
+The SPI should be used in burst mode, meaning that the chip select is held low during a complete SPI message.
+ Note: The SPI lines between Host CPU and QCA7000 should be kept as short as possible.
+
+*/
+&spi1 {
+        status = "okay";
+        pinctrl-names = "default";
+        pinctrl-0 = <&spi1_pins>;
+        qca7000@0 {
+                compatible = "qca,qca7000";
+                reg = <0>;
+                interrupt-parent = <&gpio2>; /* GPIO2_0 */
+                interrupts = <0 1>;                     /* GPIO2_0 */
+                spi-cpha;                                        /* SPI mode: CPHA=1 */
+                spi-cpol;                                        /* SPI mode: CPOL=1 */
+                spi-max-frequency = <10000000>;  /* freq: 10MHz */
+                qca,legacy-mode = <0>;            /* Burst mode */
+        };
+};
+
+

+ 13 - 6
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/lib/.gen_crc32table.cmd

@@ -5,18 +5,23 @@ source_lib/gen_crc32table := lib/gen_crc32table.c
 deps_lib/gen_crc32table := \
   /usr/include/stdc-predef.h \
   /usr/include/stdio.h \
+  /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
   /usr/include/features.h \
   /usr/include/x86_64-linux-gnu/sys/cdefs.h \
   /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+  /usr/include/x86_64-linux-gnu/bits/long-double.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
-  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+  /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
   /usr/include/x86_64-linux-gnu/bits/types.h \
   /usr/include/x86_64-linux-gnu/bits/typesizes.h \
-  /usr/include/libio.h \
-  /usr/include/_G_config.h \
-  /usr/include/wchar.h \
-  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
+  /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
+  /usr/include/x86_64-linux-gnu/bits/types/FILE.h \
+  /usr/include/x86_64-linux-gnu/bits/libio.h \
+  /usr/include/x86_64-linux-gnu/bits/_G_config.h \
+    $(wildcard include/config/h.h) \
+  /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
+  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
   /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
   /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
   /usr/include/x86_64-linux-gnu/bits/stdio.h \
@@ -28,9 +33,11 @@ deps_lib/gen_crc32table := \
     $(wildcard include/config/crc32/bit.h) \
     $(wildcard include/config/64bit.h) \
   /usr/include/inttypes.h \
-  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h \
+  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h \
   /usr/include/stdint.h \
   /usr/include/x86_64-linux-gnu/bits/wchar.h \
+  /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
+  /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \
 
 lib/gen_crc32table: $(deps_lib/gen_crc32table)
 

+ 1 - 1
board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/.am335x-evm.dtb.dts.tmp

@@ -1495,7 +1495,7 @@
   };
   partition@13 {
    label = "Storage";
-   reg = <0x0A200000 0x75E00000>;
+   reg = <0x0A200000 0x35E00000>;
   };
  };
 };

+ 1 - 1
board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/am335x-evm.dts

@@ -607,7 +607,7 @@
 		};
 		partition@13 {
 			label = "Storage";
-			reg = <0x0A200000 0x75E00000>;
+			reg = <0x0A200000 0x35E00000>;
 		};
 	};
 };