Pārlūkot izejas kodu

[New feature][DM30][DW30][GPIO] Declare the EMU0(GPIO 3[7]) to GPIO output for CP open/short emergency stop feature enable/disable control, and declare the EMU1(GPIO 3[8]) to GPIO output for Wi-Fi/4G module power reset feature.

2020.08.07 / TC Hsu

Actions: Declare EMU0(GPIO 3[7]) and EMU1(GPIO 3[8]) to GPIO in dts files and main.c. Set default value of GPIO 3[7] to low to enable the CP open/short emergency stop feature. For achive the Wi-Fi/4G module power reset feature, set default value of GPIO 3[8] to high in dts file to power off Wi-Fi/4G module when kernel bootup, after application start, set value of GPIO 3[8] to low to power on the Wi-Fi/4G module.

Image version    : N/A
Image checksum   : N/A

Hardware PWB P/N : N/A
Hardware Version : N/A

Files:

	modified:   EVSE/Projects/DM30/Apps/main.c
	modified:   EVSE/Projects/DW30/Apps/main.c
	modified:   board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[DM30]am335x-evm.dts
	modified:   board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[DW30]am335x-evm.dts
TC_Hsu 4 gadi atpakaļ
vecāks
revīzija
6b7761a5a7

+ 9 - 0
EVSE/Projects/DM30/Apps/main.c

@@ -710,6 +710,15 @@ void InitGPIO()
     system("echo 116 > /sys/class/gpio/export");
     system("echo \"out\" > /sys/class/gpio/gpio116/direction");
     system("echo 0 > /sys/class/gpio/gpio116/value");
+    /* (C14) EMU0.gpio3[7] */  /*CP open/short feature enable/disable, pull low for default enable*/
+    system("echo 103 > /sys/class/gpio/export");
+    system("echo \"out\" > /sys/class/gpio/gpio103/direction");
+    system("echo 0 > /sys/class/gpio/gpio103/value");
+    /* (B14) EMU1.gpio3[8] */  /*4G module reset, pull high to reset when entry kernel, after Application start, it should be pull low.*/
+    system("echo 104 > /sys/class/gpio/export");
+    system("echo \"out\" > /sys/class/gpio/gpio104/direction");
+    system("echo 0 > /sys/class/gpio/gpio104/value");
+
 #ifdef SystemLogMessage
     DEBUG_INFO_MSG("[main]InitGPIO: Initial GPIO OK");
 #endif

+ 9 - 0
EVSE/Projects/DW30/Apps/main.c

@@ -710,6 +710,15 @@ void InitGPIO()
     system("echo 116 > /sys/class/gpio/export");
     system("echo \"out\" > /sys/class/gpio/gpio116/direction");
     system("echo 0 > /sys/class/gpio/gpio116/value");
+    /* (C14) EMU0.gpio3[7] */  /*CP open/short feature enable/disable, pull low for default enable*/
+    system("echo 103 > /sys/class/gpio/export");
+    system("echo \"out\" > /sys/class/gpio/gpio103/direction");
+    system("echo 0 > /sys/class/gpio/gpio103/value");
+    /* (B14) EMU1.gpio3[8] */  /*4G module reset, pull high to reset when entry kernel, after Application start, it should be pull low.*/
+    system("echo 104 > /sys/class/gpio/export");
+    system("echo \"out\" > /sys/class/gpio/gpio104/direction");
+    system("echo 0 > /sys/class/gpio/gpio104/value");
+
 #ifdef SystemLogMessage
     DEBUG_INFO_MSG("[main]InitGPIO: Initial GPIO OK");
 #endif

+ 2 - 0
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[DM30]am335x-evm.dts

@@ -86,6 +86,8 @@
 			0x0E0 (PIN_INPUT | MUX_MODE7)			/*LCD_VSYNC		=>	GPIO2_22*/	/*CCS communication board 2 proximity*/
 			
 			/** GPIO 3 */
+			AM33XX_IOPAD(0x9e4, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* (C14) EMU0.gpio3[7] */  /*CP open/short feature enable/disable, pull low for default enable*/
+			AM33XX_IOPAD(0x9e8, PIN_OUTPUT_PULLUP | MUX_MODE7)   /* (B14) EMU1.gpio3[8] */  /*4G module reset, pull high to reset when entry kernel, after Application start, it should be pull low.*/
 			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*/

+ 2 - 0
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[DW30]am335x-evm.dts

@@ -86,6 +86,8 @@
 			0x0E0 (PIN_INPUT | MUX_MODE7)			/*LCD_VSYNC		=>	GPIO2_22*/	/*CCS communication board 2 proximity*/
 			
 			/** GPIO 3 */
+			AM33XX_IOPAD(0x9e4, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* (C14) EMU0.gpio3[7] */  /*CP open/short feature enable/disable, pull low for default enable*/
+			AM33XX_IOPAD(0x9e8, PIN_OUTPUT_PULLUP | MUX_MODE7)   /* (B14) EMU1.gpio3[8] */  /*4G module reset, pull high to reset when entry kernel, after Application start, it should be pull low.*/
 			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*/