Prechádzať zdrojové kódy

update usb function

Joe 7 hodín pred
rodič
commit
39baac9472

+ 18 - 0
python_test/Linux_led_V03/.vscode/c_cpp_properties.json

@@ -0,0 +1,18 @@
+{
+  "configurations": [
+    {
+      "name": "windows-gcc-x64",
+      "includePath": [
+        "${workspaceFolder}/**"
+      ],
+      "compilerPath": "C:/mingw64/bin/gcc.exe",
+      "cStandard": "${default}",
+      "cppStandard": "${default}",
+      "intelliSenseMode": "windows-gcc-x64",
+      "compilerArgs": [
+        ""
+      ]
+    }
+  ],
+  "version": 4
+}

+ 24 - 0
python_test/Linux_led_V03/.vscode/launch.json

@@ -0,0 +1,24 @@
+{
+  "version": "0.2.0",
+  "configurations": [
+    {
+      "name": "C/C++ Runner: Debug Session",
+      "type": "cppdbg",
+      "request": "launch",
+      "args": [],
+      "stopAtEntry": false,
+      "externalConsole": true,
+      "cwd": "e:/Product_Literature/S1331-ADLN/S1331_Linux_api_V02/code",
+      "program": "e:/Product_Literature/S1331-ADLN/S1331_Linux_api_V02/code/build/Debug/outDebug",
+      "MIMode": "gdb",
+      "miDebuggerPath": "gdb",
+      "setupCommands": [
+        {
+          "description": "Enable pretty-printing for gdb",
+          "text": "-enable-pretty-printing",
+          "ignoreFailures": true
+        }
+      ]
+    }
+  ]
+}

+ 59 - 0
python_test/Linux_led_V03/.vscode/settings.json

@@ -0,0 +1,59 @@
+{
+  "C_Cpp_Runner.cCompilerPath": "gcc",
+  "C_Cpp_Runner.cppCompilerPath": "g++",
+  "C_Cpp_Runner.debuggerPath": "gdb",
+  "C_Cpp_Runner.cStandard": "",
+  "C_Cpp_Runner.cppStandard": "",
+  "C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
+  "C_Cpp_Runner.useMsvc": false,
+  "C_Cpp_Runner.warnings": [
+    "-Wall",
+    "-Wextra",
+    "-Wpedantic",
+    "-Wshadow",
+    "-Wformat=2",
+    "-Wcast-align",
+    "-Wconversion",
+    "-Wsign-conversion",
+    "-Wnull-dereference"
+  ],
+  "C_Cpp_Runner.msvcWarnings": [
+    "/W4",
+    "/permissive-",
+    "/w14242",
+    "/w14287",
+    "/w14296",
+    "/w14311",
+    "/w14826",
+    "/w44062",
+    "/w44242",
+    "/w14905",
+    "/w14906",
+    "/w14263",
+    "/w44265",
+    "/w14928"
+  ],
+  "C_Cpp_Runner.enableWarnings": true,
+  "C_Cpp_Runner.warningsAsError": false,
+  "C_Cpp_Runner.compilerArgs": [],
+  "C_Cpp_Runner.linkerArgs": [],
+  "C_Cpp_Runner.includePaths": [],
+  "C_Cpp_Runner.includeSearch": [
+    "*",
+    "**/*"
+  ],
+  "C_Cpp_Runner.excludeSearch": [
+    "**/build",
+    "**/build/**",
+    "**/.*",
+    "**/.*/**",
+    "**/.vscode",
+    "**/.vscode/**"
+  ],
+  "C_Cpp_Runner.useAddressSanitizer": false,
+  "C_Cpp_Runner.useUndefinedSanitizer": false,
+  "C_Cpp_Runner.useLeakSanitizer": false,
+  "C_Cpp_Runner.showCompilationTime": false,
+  "C_Cpp_Runner.useLinkTimeOptimization": false,
+  "C_Cpp_Runner.msvcSecureNoWarnings": false
+}

+ 34 - 0
python_test/Linux_led_V03/Makefile

@@ -0,0 +1,34 @@
+# Makefile for ITE EC LED Control Tool
+CC = gcc
+#CFLAGS = -Wall -g
+CFLAGS = -Wall
+
+SRC_DIR = code
+OUT_DIR = release
+TARGET_NAME = led_tool
+TARGET = $(OUT_DIR)/$(TARGET_NAME)
+
+SRCS = $(wildcard $(SRC_DIR)/*.c)
+OBJS = $(SRCS:.c=.o)
+
+
+all: create_dir $(TARGET) clean_objs
+
+create_dir:
+	@mkdir -p $(OUT_DIR)
+
+$(TARGET): $(OBJS)
+	$(CC) $(CFLAGS) -o $@ $^
+
+$(SRC_DIR)/%.o: $(SRC_DIR)/%.c
+	$(CC) $(CFLAGS) -c $< -o $@
+
+clean_objs:
+	@rm -f $(OBJS)
+
+
+clean:
+	rm -rf $(OUT_DIR)
+	rm -f $(SRC_DIR)/*.o
+
+.PHONY: all create_dir clean clean_objs

+ 389 - 0
python_test/Linux_led_V03/code/led_ctl.c

@@ -0,0 +1,389 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/io.h>
+#include <time.h>
+#include <errno.h>
+#include "led_ctl.h"
+
+#define EC_CMD_PORT 0x66
+#define EC_DATA_PORT 0x62
+
+#define EC_OBF 0x01 // Output Buffer Full
+#define EC_IBF 0x02 // Input Buffer Full
+
+#define CMD_READ_RAM 0x97
+#define CMD_WRITE_RAM 0x98
+
+#define OFFSET_COLOR_CTL 0x01
+#define OFFSET_BLINK_TIME 0x02
+#define OFFSET_BLINK_CTL 0x03
+#define OFFSET_TURNOFF_CTL 0x04
+
+#define BIT0 (1 << 0)
+#define TIMEOUT_LOOPS 100000
+
+static int wait_ibf(void)
+{
+    int i = 0;
+    while (inb(EC_CMD_PORT) & EC_IBF)
+    {
+        if (++i > TIMEOUT_LOOPS)
+        {
+            fprintf(stderr, "Error: EC IBF Timeout!\n");
+            return -1;
+        }
+        usleep(1);
+    }
+    return 0;
+}
+
+static int wait_obf(void)
+{
+    int i = 0;
+    while (!(inb(EC_CMD_PORT) & EC_OBF))
+    {
+        if (++i > TIMEOUT_LOOPS)
+        {
+            fprintf(stderr, "Error: EC OBF Timeout!\n");
+            return -1;
+        }
+        usleep(1);
+    }
+    return 0;
+}
+
+static int ec_read_ram(uint8_t offset, uint8_t *data)
+{
+    if (wait_ibf() < 0)
+        return -1;
+    outb(CMD_READ_RAM, EC_CMD_PORT);
+
+    if (wait_ibf() < 0)
+        return -1;
+    outb(offset, EC_DATA_PORT);
+
+    if (wait_obf() < 0)
+        return -1;
+    *data = inb(EC_DATA_PORT);
+
+    return 0;
+}
+
+static int ec_write_ram(uint8_t offset, uint8_t data)
+{
+    if (wait_ibf() < 0)
+        return -1;
+    outb(CMD_WRITE_RAM, EC_CMD_PORT);
+
+    if (wait_ibf() < 0)
+        return -1;
+    outb(offset, EC_DATA_PORT);
+
+    if (wait_ibf() < 0)
+        return -1;
+    outb(data, EC_DATA_PORT);
+
+    return 0;
+}
+
+static int oem_ec_read_ram(uint8_t page, uint8_t offset, uint8_t *data)
+{
+    unsigned char WEC, REC;
+    switch(page)
+    {
+        case 0:
+        {
+            WEC = 0x96;
+            REC = 0x95;
+            break;
+        }
+        
+        case 1:
+        {
+            WEC = 0x98;
+            REC = 0x97;
+            break;
+        }
+        
+        default:
+        {
+            WEC = 0x81;
+            REC = 0x80;
+            break;
+        }
+    }    
+    if (wait_ibf() < 0)
+        return -1;
+    outb(REC, EC_CMD_PORT);
+
+    if (wait_ibf() < 0)
+        return -1;
+    outb(offset, EC_DATA_PORT);
+
+    if (wait_obf() < 0)
+        return -1;
+    *data = inb(EC_DATA_PORT);
+
+    return 0;
+}
+
+static int oem_ec_write_ram(uint8_t page, uint8_t offset, uint8_t data)
+{
+    unsigned char WEC, REC;
+    switch(page)
+    {
+        case 0:
+        {
+            WEC = 0x96;
+            REC = 0x95;
+            break;
+        }
+        
+        case 1:
+        {
+            WEC = 0x98;
+            REC = 0x97;
+            break;
+        }
+        
+        default:
+        {
+            WEC = 0x81;
+            REC = 0x80;
+            break;
+        }
+    }
+    if (wait_ibf() < 0)
+        return -1;
+    outb(WEC, EC_CMD_PORT);
+
+    if (wait_ibf() < 0)
+        return -1;
+    outb(offset, EC_DATA_PORT);
+
+    if (wait_ibf() < 0)
+        return -1;
+    outb(data, EC_DATA_PORT);
+
+    return 0;
+}
+// ---------API functions---------
+//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>heart led function begin>>>>>>>>>>>>>>>>>>>>>>>>>> 
+
+void heart_led_turn_off(void)
+{
+    oem_ec_write_ram(1, OFFSET_TURNOFF_CTL, 0x01);
+}
+
+void heart_led_turn_on(void)
+{
+    oem_ec_write_ram(1, OFFSET_TURNOFF_CTL, 0x00);
+}
+
+int led_driver_init(void)
+{
+    if (ioperm(EC_DATA_PORT, 1, 1))
+    {
+        perror("Failed to get permission for 0x62");
+        return -1;
+    }
+    if (ioperm(EC_CMD_PORT, 1, 1))
+    {
+        perror("Failed to get permission for 0x66");
+        return -1;
+    }
+    return 0;
+}
+
+int led_set_color(led_color_t color)
+{
+    uint8_t val;
+    if (ec_read_ram(OFFSET_COLOR_CTL, &val) < 0)
+        return -1;
+
+    if (color == LED_RED)
+        val |= BIT0;
+    else
+        val &= ~BIT0;
+
+    heart_led_turn_on();
+    return ec_write_ram(OFFSET_COLOR_CTL, val);
+}
+
+int led_set_blink(int enable, uint8_t interval_unit)
+{
+    uint8_t ctl;
+
+    if (enable)
+    {
+        if (ec_write_ram(OFFSET_BLINK_TIME, interval_unit) < 0)
+            return -1;
+    }
+
+    if (ec_read_ram(OFFSET_BLINK_CTL, &ctl) < 0)
+        return -1;
+
+    if (enable)
+        ctl |= BIT0;
+    else
+        ctl &= ~BIT0;
+
+    heart_led_turn_on();
+    return ec_write_ram(OFFSET_BLINK_CTL, ctl);
+}
+
+int led_print_status(void)
+{
+    uint8_t color_reg, blink_time, blink_ctl;
+
+    if (ec_read_ram(OFFSET_COLOR_CTL, &color_reg) < 0)
+        return -1;
+    if (ec_read_ram(OFFSET_BLINK_TIME, &blink_time) < 0)
+        return -1;
+    if (ec_read_ram(OFFSET_BLINK_CTL, &blink_ctl) < 0)
+        return -1;
+
+    printf(" Color     : %s\n", (color_reg & BIT0) ? "RED" : "GREEN");
+    printf(" Blink     : %s\n", (blink_ctl & BIT0) ? "ON" : "OFF");
+    if (blink_ctl & BIT0)
+    {
+        printf(" Interval  : %d ms (%d units)\n", blink_time * 100, blink_time);
+    }
+
+    return 0;
+}
+//<<<<<<<<<<<<<<<<<<<<<<<<<<<heart led function end<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>bat_led function begin>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+void bat_led_ctrl_by_sys(void)
+{
+    oem_ec_write_ram(2, 0x21, 0x3C); //enable bat led control by system 
+}
+
+void bat_led_ctrl_by_ec(void)
+{
+    oem_ec_write_ram(2, 0x21, 0x00); //enable bat led control by ec 
+}
+
+int bat_led_set_color(uint8_t state)
+{
+    uint8_t val;
+
+    /*
+    val is led state: off; red; green
+    val bit meaning:
+    bit 2-3: health led 
+    bit 4-5: charge led 
+    */
+    switch(state)
+    {
+        case 0:
+            val = 0x10; // charge led green 
+            break;
+        case 1:
+            val = 0x20; // charge led red 
+            break;           
+        case 2:
+            val = 0x04;// health led green 
+            break;
+        case 3:
+            val = 0x08;// health led red 
+            break;
+        case 4:
+            val = 0x00;//turn off both led
+            break;            
+        default:
+            return 0;
+    }
+
+    oem_ec_write_ram(2, 0x31, val);
+    bat_led_ctrl_by_sys();
+    return 1;
+
+}
+//<<<<<<<<<<<<<<<<<<<<<<<<<<<bat_led function end<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>bat infor function begin>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+void get_bat_info(void)
+{
+    uint8_t BAT1_RelativeStateOfChgL = 0;
+    uint8_t BAT1_HEALTH = 0;
+
+    oem_ec_read_ram(2, 0x93, &BAT1_RelativeStateOfChgL);
+    oem_ec_read_ram(2, 0x9D, &BAT1_HEALTH);
+
+    printf(" BAT1_RelativeStateOfChgL is : %d\n", BAT1_RelativeStateOfChgL);
+    printf(" BAT1_HEALTH is : %d\n", BAT1_HEALTH);
+}
+//<<<<<<<<<<<<<<<<<<<<<<<<<<<bat infor function end<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>AC & power function begin>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+uint8_t soft_rest_btn(void)//read GPIO of btn SW_HRST1 
+{
+    uint8_t val = 0x00;
+    if (oem_ec_read_ram(2, 0x34, &val) < 0)
+        return 0;
+
+    printf(" btn state is : %d\n", (val & 0x01) ? 1 : 0);
+    return (val & 0x01) ? 1 : 0;
+}
+
+uint8_t ac_present(void) //read GPIO of DC IN 
+{
+    uint8_t val = 0x00;
+    if (oem_ec_read_ram(2, 0x36, &val) < 0)
+        return 0;
+
+    printf(" AC state is : %d\n", (val  & 0x03) ? 1 : 0);
+    return (val & 0x08) ? 1 : 0;
+}
+
+void ac_bat_state(void) //read EC state
+{
+    /*
+    meaning of state bit 
+    #define F_BAT1_DISCHRGE     BIT(7)
+    #define F_BAT1_CHARGING     BIT(6)
+    #define F_BAT1_PRESENT      BIT(1)
+    #define F_AC_ON_LINE        BIT(0)
+    */
+    uint8_t state = 0x00;
+    oem_ec_read_ram(2, 0x80, &state);
+
+    if((state & 0x03) == 0x01)
+    {
+        printf(" DC is in, bat out\n");
+    }
+    else if((state & 0x03) == 0x02)
+    {
+        printf(" DC is out, bat in\n");
+    }
+    else if((state & 0x03) == 0x03)
+    {
+        printf(" DC is in, bat in\n");
+    }          
+    else if((state & 0xC2) == 0x82)
+    {
+        printf(" BAT is present and discharge\n");
+    }
+    else if((state & 0xC2) == 0x42)
+    {
+        printf(" BAT is present and charging\n");
+    }           
+}
+//<<<<<<<<<<<<<<<<<<<<<<<<<<AC & power function end<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+
+void get_ec_version(void)
+{
+    uint8_t val[4] = {0};
+    uint8_t i = 0 ;
+
+    for(i = 0; i < 4; i++ )
+    {
+        oem_ec_read_ram(2, i, &val[i]);
+    }
+
+    printf(" EC version is : %02x%02x%02x%02x\n", val[0], val[1], val[2], val[3]);
+}

+ 32 - 0
python_test/Linux_led_V03/code/led_ctl.h

@@ -0,0 +1,32 @@
+/* led_ctl.h - Interface for LED Control */
+#ifndef _LED_CTL_H_
+#define _LED_CTL_H_
+
+#include <stdint.h>
+
+typedef enum
+{
+    LED_GREEN = 0,
+    LED_RED = 1
+} led_color_t;
+
+void heart_led_turn_off(void);
+void heart_led_turn_on(void);
+int led_driver_init(void); // get IO port permissions
+int led_set_color(led_color_t color);
+int led_set_blink(int enable, uint8_t interval_unit);
+int led_print_status(void);
+
+void bat_led_ctrl_by_sys(void);
+void bat_led_ctrl_by_ec(void);
+int bat_led_set_color(uint8_t color);
+
+void get_bat_info(void);
+
+uint8_t soft_rest_btn(void);
+uint8_t ac_present(void);
+void ac_bat_state(void); //read EC state
+
+void get_ec_version(void);
+
+#endif // _LED_CTL_H_

+ 174 - 0
python_test/Linux_led_V03/code/main.c

@@ -0,0 +1,174 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include "led_ctl.h"
+
+void usage(const char *prog)
+{
+    printf("Usage: %s <command> [args]\n", prog);
+    printf("Commands:\n");
+    printf("  color <r|g>      Set LED color\n");
+    printf("  heartoff         turn off heart led\n");
+    printf("  blink <on|off> [time]  Set blink (time unit: 100ms, def: 5)\n");
+    printf("  status                 Show current heart_led status\n");
+    printf("  ac                     Show AC power status\n");
+    printf("  btn                    Show rst button status \n");
+    printf("  bat                    Show bat info \n");
+    printf("  batledsys [state]      Control Bat led with state by system\n");
+    printf("  batledec               Control Bat led by EC\n");
+    printf("\nExample:\n");
+    printf("  sudo %s color r       (Set color to RED)\n", prog);
+    printf("  sudo %s blink on 5    (Blink every 500ms)\n", prog);
+}
+
+int main(int argc, char *argv[])
+{
+    if (geteuid() != 0)
+    {
+        fprintf(stderr, "Error: Must run as root (sudo).\n");
+        return 1;
+    }
+
+    if (led_driver_init() < 0)
+    {
+        return 1;
+    }
+
+    if (argc < 2)
+    {
+        usage(argv[0]);
+        return 1;
+    }
+
+    get_ec_version();
+
+    const char *cmd = argv[1];
+
+    if (strcmp(cmd, "color") == 0)
+    {
+        if (argc < 3)
+        {
+            fprintf(stderr, "Error: Missing color argument.\n");
+            return 1;
+        }
+
+        if (strcmp(argv[2], "r") == 0)
+        {
+            if (led_set_color(LED_RED) == 0)
+                printf("OK: Color set to RED\n");
+        }
+        else if (strcmp(argv[2], "g") == 0)
+        {
+            if (led_set_color(LED_GREEN) == 0)
+                printf("OK: Color set to GREEN\n");
+        }
+        else
+        {
+            fprintf(stderr, "Error: Unknown color '%s'\n", argv[2]);
+            return 1;
+        }
+    }
+    else if (strcmp(cmd, "blink") == 0)
+    {
+        if (argc < 3)
+        {
+            fprintf(stderr, "Error: Missing state argument.\n");
+            return 1;
+        }
+
+        if (strcmp(argv[2], "on") == 0)
+        {
+            int t = 5; // 500ms
+            if (argc >= 4)
+                t = atoi(argv[3]);
+            if (t < 0 || t > 255)
+                t = 5;
+
+            if (led_set_blink(1, (uint8_t)t) == 0)
+                printf("OK: Blink ON (Interval: %d00ms)\n", t);
+        }
+        else if (strcmp(argv[2], "off") == 0)
+        {
+            if (led_set_blink(0, 0) == 0)
+                printf("OK: Blink OFF\n");
+        }
+        else
+        {
+            fprintf(stderr, "Error: Unknown state '%s'\n", argv[2]);
+            return 1;
+        }
+    }
+    else if (strcmp(cmd, "status") == 0)
+    {
+        led_print_status();
+    }
+    else if (strcmp(cmd, "heartoff") == 0)
+    {
+        heart_led_turn_off();
+    }
+    else if (strcmp(cmd, "batledsys") == 0)
+    {
+        if (argc < 3)
+        {
+            fprintf(stderr, "Error: Missing color argument.\n");
+            return 1;
+        }
+
+        if (strcmp(argv[2], "0") == 0)
+        {
+            if (bat_led_set_color(0) == 1)
+                printf("OK: Color set to green\n");
+        }
+        else if (strcmp(argv[2], "1") == 0)
+        {
+            if (bat_led_set_color(1) == 1)
+                printf("OK: Color set to red\n");
+        }        
+        else if (strcmp(argv[2], "2") == 0)
+        {
+            if (bat_led_set_color(2) == 1)
+                printf("OK: Color set to green\n");
+        }
+        else if (strcmp(argv[2], "3") == 0)
+        {
+            if (bat_led_set_color(3) == 1)
+                printf("OK: Color set to red\n");
+        }  
+        else if (strcmp(argv[2], "4") == 0)
+        {
+            if (bat_led_set_color(4) == 1)
+                printf("OK: turn off all \n");
+        }               
+        else
+        {
+            fprintf(stderr, "Error: Unknown color '%s'\n", argv[2]);
+            return 1;
+        }
+    }    
+    else if (strcmp(cmd, "batledec") == 0)
+    {
+        bat_led_ctrl_by_ec();
+    }
+    else if (strcmp(cmd, "bat") == 0)
+    {
+        get_bat_info();
+        ac_bat_state();
+    }    
+    else if (strcmp(cmd, "ac") == 0)
+    {
+        ac_present();
+    }    
+    else if (strcmp(cmd, "btn") == 0)
+    {
+        soft_rest_btn();
+    }    
+    else
+    {
+        usage(argv[0]);
+        return 1;
+    }
+
+
+    return 0;
+}

+ 27 - 0
python_test/Linux_led_V03/readme.txt

@@ -0,0 +1,27 @@
+*注意:由于工具需要直接操作硬件 I/O 端口 (Port 0x62/0x66),必须使用 sudo 权限运行。
+
+1、 设置颜色
+sudo ./led_tool color <r|g>
+e.g. sudo ./led_tool color r		设置红色
+e.g. sudo ./led_tool bat 1		设置bat灯色
+	
+
+2、 设置闪烁状态,无参数默认频率500ms
+sudo ./led_tool blink <on|off> [time]
+e.g. sudo ./led_tool blink on 3		设置闪烁开启,频率300ms
+	 sudo ./led_tool blink off	设置闪烁关闭
+
+3、关闭心跳灯
+sudo ./led_tool heartoff
+
+4、查询当前心跳灯状态
+sudo ./led_tool status
+
+5、电池灯控制&电池信息获取
+sudo ./led_tool batledsys [state]	电池灯由系统控制
+sudo ./led_tool batledec		电池灯由EC控制
+sudo ./led_tool bat			获取电池状态
+
+6、其余状态
+e.g. sudo ./led_tool ac  		读取DC IN状态
+e.g. sudo ./led_tool btn 		读取reset_btn状态

BIN
python_test/Linux_led_V03/release/led_tool


+ 2 - 2
python_test/boot_test_v16/action.cfg

@@ -1,5 +1,5 @@
 ACTION=ec
 TIMER=1
-TIMECTRL=1775986148
-LOG=ec20260412.log
+TIMECTRL=1777019126
+LOG=ec20260424.log
 

+ 3 - 1
python_test/os-ver.sh

@@ -6,7 +6,9 @@
 
 # get bios version
 if [  "$1"  =  "bios"  ]; then
-  bios_ver=`cat /var/log/kern.log | grep -E "BIOS +.*\w+\/\w+\/\w+" | awk -F"BIOS " '{print $2}' | awk '{print $1}' | head -1`
+  #bios_ver=`cat /var/log/kern.log | grep -E "BIOS +.*\w+\/\w+\/\w+" | awk -F"BIOS " '{print $2}' | awk '{print $1}' | head -1`
+  ec_suspend=`echo "111111" | sudo -S ls`
+  bios_ver=`sudo dmidecode -s bios-version`
 fi
 
 if [  "$1"  =  "HDMI"  ]; then

+ 1 - 1
python_test/test_function.py

@@ -182,7 +182,7 @@ def step8_routine(context):
         a_int = int(a)
     except ValueError:
         return False, "Invalid output: {}".format(a)
-    if a_int == 5:
+    if a_int == 6:
         return True, a
     else:
         return False, "FAIL " + a