20190118_jeffrey - silenceuncrio/diary GitHub Wiki

0900

昨天下班前放著的 device 又卡住了

先 build 一版不會自動重開機的來試一下怎麼從 linux 來控制 GPIO

rc.local

diff --git a/proscend/memory_fs/nandflash/default/rootfs/etc/rc.local b/proscend/memory_fs/nandflash/default/rootfs/etc/rc.local
index d5211ca..d3b8d25 100644
--- a/proscend/memory_fs/nandflash/default/rootfs/etc/rc.local
+++ b/proscend/memory_fs/nandflash/default/rootfs/etc/rc.local
@@ -39,12 +39,6 @@ function core_uboot_env_loose_indicate {
 # recover the corrupt /etc/passwd file
 /usr/sbin/icos/passwd_recover.sh

-# apply the uboot env variables related to current application
-/usr/sbin/icos/uboot_env.sh
-
-# run bootcmd_v1.3 define in uboot_env.sh
-fw_setenv bootcmd 'run bootcmd_v1.3'
-


 app_a_mtdn=5

do_some_actions_at_board_init.patch

Index: git/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
===================================================================
--- git.orig/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
+++ git/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
@@ -905,13 +905,146 @@ void ldo_mode_set(int ldo_bypass)
 #endif
 #endif
 
+
+
+
+
+
+static iomux_v3_cfg_t const proscend_pads[] = {
+/* proscend - IO control power */
+MX6_PAD_CSI_DATA00__GPIO4_IO21      | MUX_PAD_CTRL(NO_PAD_CTRL),
+
+/* proscend - sys led */
+MX6_PAD_SD1_DATA2__GPIO2_IO20       | MUX_PAD_CTRL(NO_PAD_CTRL),
+
+/* proscend - LTE SIM Select */
+MX6_PAD_SD1_CLK__GPIO2_IO17         | MUX_PAD_CTRL(NO_PAD_CTRL),
+
+/* proscend - Ethernet 1 Reset PIN */
+MX6_PAD_UART5_TX_DATA__GPIO1_IO30   | MUX_PAD_CTRL(NO_PAD_CTRL),
+
+/* proscend - Ethernet 2 Reset PIN */
+MX6_PAD_UART5_RX_DATA__GPIO1_IO31   | MUX_PAD_CTRL(NO_PAD_CTRL),
+
+/* proscend - Mobile Reset PIN */
+MX6_PAD_SNVS_TAMPER7__GPIO5_IO07   | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
+
+
 int board_init(void)
 {
+    int ret;
+    int retry_reset_io_control_power_counter = 0;;
+
 	/* Address of boot parameters */
 	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
 	imx_iomux_v3_setup_multiple_pads(iox_pads, ARRAY_SIZE(iox_pads));
 
+
+
+    imx_iomux_v3_setup_multiple_pads(proscend_pads, ARRAY_SIZE(proscend_pads));
+
+    /*
+    ** IO control power - GPIO5-IO9
+    ** +----------+--------+--------------+-----------------+
+    ** | Instance | Signal | Pad          | Mode            |
+    ** | GPIO5    | IO9    | SNVS_TAMPER9 | No Muxing(ALT5) |
+    ** +----------+--------+--------------+-----------------+
+    **
+    ** 0 - off
+    ** 1 - on
+    **
+    ** turn on the IO control power
+    */
+    printf("turn on the IO control power\n");
+    gpio_direction_output(IMX_GPIO_NR(5, 9) , 1);
+
+    /*
+    ** PAD - MX6_PAD_SD1_DATA2__GPIO2_IO20
+    ** sys led - GPIO2-IO20
+    ** +----------+--------+-----------+------+
+    ** | Instance | Signal | Pad       | Mode |
+    ** | GPIO2    | IO20   | SD1_DATA2 | ALT5 |
+    ** +----------+--------+-----------+------+
+    **
+    ** 0 - off
+    ** 1 - on
+    **
+    ** turn on sys led
+    */
+    printf("turn on sys led\n");
+    gpio_direction_output(IMX_GPIO_NR(2, 20) , 0);
+
+    /*
+    ** LTE SIM Select - GPIO2-IO17
+    ** +----------+--------+-----------+------+
+    ** | Instance | Signal | Pad       | Mode |
+    ** | GPIO2    | IO17   | SD1_CLK   | ALT5 |
+    ** +----------+--------+-----------+------+
+    **
+    ** 0 - SIM1
+    ** 1 - SIM2
+    **
+    ** select SIM1
+    */
+    printf("select SIM1\n");
+    gpio_direction_output(IMX_GPIO_NR(2, 17) , 0);
+
+    /*
+    ** Ethernet 1 Reset PIN - GPIO1-IO30
+    ** +----------+--------+---------------+------+
+    ** | Instance | Signal | Pad           | Mode |
+    ** | GPIO1    | IO30   | UART5_TX_DATA | ALT5 |
+    ** +----------+--------+---------------+------+
+    **
+    ** 0 - off
+    ** 1 - on
+    **
+    ** reset Ethernet 1
+    */
+    printf("reset Ethernet 1\n");
+    gpio_direction_output(IMX_GPIO_NR(1, 30) , 0);
+    udelay(500);
+    gpio_direction_output(IMX_GPIO_NR(1, 30) , 1);
+
+    /*
+    ** Ethernet 2 Reset PIN - GPIO1-IO30
+    ** +----------+--------+---------------+------+
+    ** | Instance | Signal | Pad           | Mode |
+    ** | GPIO1    | IO31   | UART5_RX_DATA | ALT5 |
+    ** +----------+--------+---------------+------+
+    **
+    ** 0 - off
+    ** 1 - on
+    **
+    ** reset Ethernet 2
+    */
+    printf("reset Ethernet 2\n");
+    gpio_direction_output(IMX_GPIO_NR(1, 31) , 0);
+    udelay(500);
+    gpio_direction_output(IMX_GPIO_NR(1, 31) , 1);
+
+    /*
+    ** Mobile Reset PIN - GPIO5-IO7
+    ** +----------+--------+--------------+-----------------+
+    ** | Instance | Signal | Pad          | Mode            |
+    ** | GPIO5    | IO7    | SNVS_TAMPER7 | No Muxing(ALT5) |
+    ** +----------+--------+--------------+-----------------+
+    **
+    ** 0 - off
+    ** 1 - on
+    **
+    ** reset Mobile
+    */
+    printf("reset Mobile\n");
+    gpio_direction_output(IMX_GPIO_NR(5, 7) , 0);
+    udelay(500);
+    gpio_direction_output(IMX_GPIO_NR(5, 7) , 1);
+
+
+
 	iox74lv_init();
 
 #ifdef CONFIG_SYS_I2C_MXC
Index: git/include/configs/mx6ul_14x14_evk.h
===================================================================
--- git.orig/include/configs/mx6ul_14x14_evk.h
+++ git/include/configs/mx6ul_14x14_evk.h
@@ -205,13 +205,12 @@
         "else echo b to a; setenv app_primary a; setenv app_secondary b;" \
         "fi\0" \
     "no_good=.\0" \
-    "uboot_env_ver=1.0\0" \
+    "uboot_env_ver=1.3\0" \
 	\
 	/* do not allow user stop autoboot - no chance to change the uboot env */ \
 	"bootdelay=0\0" \
 	\
-    "bootcmd=mw 0x020A0004 00100000 1; mw 0x020E01CC 0x00000005 1;" \
-        "run app_choose;" \
+    "bootcmd=run app_choose;" \
         "echo run bootargs_${app_primary}; run bootargs_${app_primary};" \
         "run nandread_${app_primary};" \
         "setenv no_good ${no_good}x; saveenv;" \

1310

直接改來試了

rc.local

diff --git a/proscend/memory_fs/nandflash/default/rootfs/etc/rc.local b/proscend/memory_fs/nandflash/default/rootfs/etc/rc.local
index d5211ca..d479512 100644
--- a/proscend/memory_fs/nandflash/default/rootfs/etc/rc.local
+++ b/proscend/memory_fs/nandflash/default/rootfs/etc/rc.local
@@ -39,12 +39,6 @@ function core_uboot_env_loose_indicate {
 # recover the corrupt /etc/passwd file
 /usr/sbin/icos/passwd_recover.sh

-# apply the uboot env variables related to current application
-/usr/sbin/icos/uboot_env.sh
-
-# run bootcmd_v1.3 define in uboot_env.sh
-fw_setenv bootcmd 'run bootcmd_v1.3'
-


 app_a_mtdn=5
@@ -349,4 +343,13 @@ telnetd &
 #sleep 3
 sleep 1

+
+
+################################
+# jeffrey test
+/usr/sbin/icosconfig coldreboot
+################################
+
+
+
 /usr/sbin/read_modem &

icosmain.c - 讓 icosconfig bootinit 時先去 turn off the IO control power

diff --git a/proscend/prosrc/icos/icosshell/icosmain.c b/proscend/prosrc/icos/icosshell/icosmain.c
index 2249466..5eec19f 100644
--- a/proscend/prosrc/icos/icosshell/icosmain.c
+++ b/proscend/prosrc/icos/icosshell/icosmain.c
@@ -77,6 +77,26 @@ int    main(int argc, char *argv[])
             printf(" icos: reboot...\n");
         }
         fflush(stdout);
+
+
+
+        /*
+        ** IO control power - GPIO5-IO9
+        ** +----------+--------+--------------+-----------------+
+        ** | Instance | Signal | Pad          | Mode            |
+        ** | GPIO5    | IO9    | SNVS_TAMPER9 | No Muxing(ALT5) |
+        ** +----------+--------+--------------+-----------------+
+        **
+        ** 0 - off
+        ** 1 - on
+        **
+        ** turn off the IO control power
+        */
+        printf("turn off the IO control power\n");
+        GPIOSetOutputValue(5, 9, 0);
+
+
+
         res=ICOS_ColdReboot(0);
     }
     else if (!strcmp(argv[1], "warmreboot"))          // show info when it is called by cli, hide info when it is called by web

build image

mfgtool 燒錄

...
### module <schedule-reboot> init
### module <wifi_apsta> init
### module <wifi_ate> init
 icos: reboot...
turn off the IO control power
蕞錢?鶘}~>?|?}>驂?|~~~>~~~~?~?~~??╮═╙||??|~???蘥?|▓~╙|??~~?錫~~~~~}>|╯鸓~~~~>?|}~╯|~|??蘥~鸓??|||?????|~~~>?~~?糕~>}>?|}~~~~~~~??錫╯▓|}??錫~~}>?|~~>>~~>?>????~}~~?蘡~?襶>?~~??糕蘥|~?襶?蘜鸓錢蘡~?襶?~>?|}>??鶘~>?~???~~~~????|~>?齘╯?|~~?~??|~?????~~~|

發現一 turn off the IO control power 就再也起不來了 - 照理說 uboot 會把電拉起來才對呀

再改一下 icosmain.c - 拉成 low 後睡個 2 秒再拉成 high

diff --git a/proscend/prosrc/icos/icosshell/icosmain.c b/proscend/prosrc/icos/icosshell/icosmain.c
index 2249466..0ed4b37 100644
--- a/proscend/prosrc/icos/icosshell/icosmain.c
+++ b/proscend/prosrc/icos/icosshell/icosmain.c
@@ -77,6 +77,28 @@ int    main(int argc, char *argv[])
             printf(" icos: reboot...\n");
         }
         fflush(stdout);
+
+
+
+        /*
+        ** IO control power - GPIO5-IO9
+        ** +----------+--------+--------------+-----------------+
+        ** | Instance | Signal | Pad          | Mode            |
+        ** | GPIO5    | IO9    | SNVS_TAMPER9 | No Muxing(ALT5) |
+        ** +----------+--------+--------------+-----------------+
+        **
+        ** 0 - off
+        ** 1 - on
+        **
+        ** reset the IO control power
+        */
+        printf("reset the IO control power\n");
+        GPIOSetOutputValue(5, 9, 0);
+        sleep(2);
+        GPIOSetOutputValue(5, 9, 1);
+
+
+
         res=ICOS_ColdReboot(0);
     }
     else if (!strcmp(argv[1], "warmreboot"))          // show info when it is called by cli, hide info when it is called by web

build image

mfgtoo 燒錄

1350

再度測試

又卡住了

### module <schedule-reboot> init
### module <wifi_apsta> init
### module <wifi_ate> init
 icos: reboot...
reset the IO control power
.

### module <wifi_ate> exit

M301-GW login: wlan0     no private ioctls.

wlan0     no private ioctls.

### module <wifi_apsta> exit
### module <schedule-reboot> exit
### module <l2tp> exit
### module <pptpd> exit
### module <gre> exit
### module <ip_alias> exit
### module <bgp> exit
### module <rip> exit
### module <ospf> exit
### module <smtp> exit
### module <zebra> exit
### module <route> exit
### module <vrrp> exit
### module <mqtt> exit
### module <modbus> exit
### module <lan_control> exit
### module <cli> exit
### module <wan_select> exit
### module <dmz> exit
### module <connmgr> exit
### module <netmon> exit
### module <openvpn> exit
### module <vcom> exit
### module <com> exit
### module <lte> exit

看來斷電的時間點要往後調一下

不過過了快兩分鐘竟然又動了

看來是斷電再開讓 module <lte> exit 卡了快兩分鐘

1410

找一下怎麼在 shell 去控制 GPIO

以 GPIO5-IO9 而言

//GPIO export, called before any other IO
int GPIOExport(int port, int pin)
{
    int number = _get_gpio_number(port, pin);

    char path[GPIO_PATH_LEN];
    if (access(_get_gpio_path(number, path, sizeof(path)), F_OK) == 0)
    {
        return RETCODE_SUCCESS;
    }

    return _write_gpio_value(GPIO_EXPORT, "%d", number);
}

gpio_number 為 (5 - 1) * 32 + 9 = 137

我要先 export

bash-4.3# echo 137 > /sys/class/gpio/export

然後要設定方向

bash-4.3# echo out > /sys/class/gpio/gpio137/direction
bash-4.3# cat /sys/class/gpio/gpio137/direction
out

然後就去寫值了

bash-4.3# echo 0 > /sys/class/gpio/gpio137/value

1430

修改如下

diff --git a/proscend/prosrc/icos/script/SysReboot.sh b/proscend/prosrc/icos/script/SysReboot.sh
index d9c820b..3af5c66 100755
--- a/proscend/prosrc/icos/script/SysReboot.sh
+++ b/proscend/prosrc/icos/script/SysReboot.sh
@@ -13,6 +13,27 @@ sync
 sync
 sync

+
+
+# IO control power - GPIO5-IO9
+# +----------+--------+--------------+-----------------+
+# | Instance | Signal | Pad          | Mode            |
+# | GPIO5    | IO9    | SNVS_TAMPER9 | No Muxing(ALT5) |
+# +----------+--------+--------------+-----------------+
+#
+# 0 - off
+# 1 - on
+#
+# turn off the IO control power
+# gpio number = (5 - 1) * 32 + 9 = 137
+
+echo "turn off the IO control power"
+echo 137 > /sys/class/gpio/export
+echo out > /sys/class/gpio/gpio137/direction
+echo 0 > /sys/class/gpio/gpio137/value
+
+
+
 ####################################################################################
 #   Do Reboot
 ####################################################################################

build image

mfgtool 燒錄

1450

開機試試吧

1500

整理一次這禮拜的工作摘要

  • M300
    • Set to SIM 1 slot in uboot
      • done
    • WiFi: hidden page (ATE)
      • done
    • WiFi: warm reboot cause hang
      • 從 uboot 去控制該 io control power GPIO 的話 - 約 30 次裡有一次沒有拉成 low
      • 試著讓 uboot 負責第一時間把 io control power GPIO 拉成 high; linux 負責在 restart 前拉成 low
    • Cisco DMVPN
    • Wizard
    • MFG tool with UBI
  • M360
    • Schedule Reboot

就這樣寫週報吧

1550

還沒有 hang 住

看來可以把板子拿給 morris 讓他把 io control power 的控制從 GPIO5-IO9 改回 GPIO4-IO21

來改一下 code

rc.local - sleep 個 9 秒便觸發 reboot

diff --git a/proscend/memory_fs/nandflash/default/rootfs/etc/rc.local b/proscend/memory_fs/nandflash/default/rootfs/etc/rc.local
index d5211ca..eb04fca 100644
--- a/proscend/memory_fs/nandflash/default/rootfs/etc/rc.local
+++ b/proscend/memory_fs/nandflash/default/rootfs/etc/rc.local
@@ -39,12 +39,6 @@ function core_uboot_env_loose_indicate {
 # recover the corrupt /etc/passwd file
 /usr/sbin/icos/passwd_recover.sh

-# apply the uboot env variables related to current application
-/usr/sbin/icos/uboot_env.sh
-
-# run bootcmd_v1.3 define in uboot_env.sh
-fw_setenv bootcmd 'run bootcmd_v1.3'
-


 app_a_mtdn=5
@@ -349,4 +343,14 @@ telnetd &
 #sleep 3
 sleep 1

+
+
+################################
+# jeffrey test
+sleep 9
+/usr/sbin/icosconfig coldreboot
+################################
+
+
+
 /usr/sbin/read_modem &

SysReboot.sh

diff --git a/proscend/prosrc/icos/script/SysReboot.sh b/proscend/prosrc/icos/script/SysReboot.sh
index d9c820b..122c759 100755
--- a/proscend/prosrc/icos/script/SysReboot.sh
+++ b/proscend/prosrc/icos/script/SysReboot.sh
@@ -13,6 +13,27 @@ sync
 sync
 sync

+
+
+# IO control power - GPIO4-IO21
+# +----------+--------+------------+-----------------+
+# | Instance | Signal | Pad        | Mode            |
+# | GPIO4    | IO21   | CSI_DATA00 | No Muxing(ALT5) |
+# +----------+--------+------------+-----------------+
+#
+# 0 - off
+# 1 - on
+#
+# turn off the IO control power
+# gpio number = (4 - 1) * 32 + 21 = 117
+
+echo "turn off the IO control power"
+echo 117 > /sys/class/gpio/export
+echo out > /sys/class/gpio/gpio117/direction
+echo 0 > /sys/class/gpio/gpio117/value
+
+
+
 ####################################################################################
 #   Do Reboot
 ####################################################################################

do_some_actions_at_board_init.patch

Index: git/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
===================================================================
--- git.orig/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
+++ git/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
@@ -905,13 +905,146 @@ void ldo_mode_set(int ldo_bypass)
 #endif
 #endif
 
+
+
+
+
+
+static iomux_v3_cfg_t const proscend_pads[] = {
+/* proscend - IO control power */
+MX6_PAD_CSI_DATA00__GPIO4_IO21      | MUX_PAD_CTRL(NO_PAD_CTRL),
+
+/* proscend - sys led */
+MX6_PAD_SD1_DATA2__GPIO2_IO20       | MUX_PAD_CTRL(NO_PAD_CTRL),
+
+/* proscend - LTE SIM Select */
+MX6_PAD_SD1_CLK__GPIO2_IO17         | MUX_PAD_CTRL(NO_PAD_CTRL),
+
+/* proscend - Ethernet 1 Reset PIN */
+MX6_PAD_UART5_TX_DATA__GPIO1_IO30   | MUX_PAD_CTRL(NO_PAD_CTRL),
+
+/* proscend - Ethernet 2 Reset PIN */
+MX6_PAD_UART5_RX_DATA__GPIO1_IO31   | MUX_PAD_CTRL(NO_PAD_CTRL),
+
+/* proscend - Mobile Reset PIN */
+MX6_PAD_SNVS_TAMPER7__GPIO5_IO07   | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
+
+
 int board_init(void)
 {
+    int ret;
+    int retry_reset_io_control_power_counter = 0;;
+
 	/* Address of boot parameters */
 	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
 	imx_iomux_v3_setup_multiple_pads(iox_pads, ARRAY_SIZE(iox_pads));
 
+
+
+    imx_iomux_v3_setup_multiple_pads(proscend_pads, ARRAY_SIZE(proscend_pads));
+
+    /*
+    ** IO control power - GPIO4-IO21
+    ** +----------+--------+------------+-----------------+
+    ** | Instance | Signal | Pad        | Mode            |
+    ** | GPIO4    | IO21   | CSI_DATA00 | No Muxing(ALT5) |
+    ** +----------+--------+------------+-----------------+
+    **
+    ** 0 - off
+    ** 1 - on
+    **
+    ** turn on the IO control power
+    */
+    printf("turn on the IO control power\n");
+    gpio_direction_output(IMX_GPIO_NR(4, 21) , 1);
+
+    /*
+    ** PAD - MX6_PAD_SD1_DATA2__GPIO2_IO20
+    ** sys led - GPIO2-IO20
+    ** +----------+--------+-----------+------+
+    ** | Instance | Signal | Pad       | Mode |
+    ** | GPIO2    | IO20   | SD1_DATA2 | ALT5 |
+    ** +----------+--------+-----------+------+
+    **
+    ** 0 - off
+    ** 1 - on
+    **
+    ** turn on sys led
+    */
+    printf("turn on sys led\n");
+    gpio_direction_output(IMX_GPIO_NR(2, 20) , 0);
+
+    /*
+    ** LTE SIM Select - GPIO2-IO17
+    ** +----------+--------+-----------+------+
+    ** | Instance | Signal | Pad       | Mode |
+    ** | GPIO2    | IO17   | SD1_CLK   | ALT5 |
+    ** +----------+--------+-----------+------+
+    **
+    ** 0 - SIM1
+    ** 1 - SIM2
+    **
+    ** select SIM1
+    */
+    printf("select SIM1\n");
+    gpio_direction_output(IMX_GPIO_NR(2, 17) , 0);
+
+    /*
+    ** Ethernet 1 Reset PIN - GPIO1-IO30
+    ** +----------+--------+---------------+------+
+    ** | Instance | Signal | Pad           | Mode |
+    ** | GPIO1    | IO30   | UART5_TX_DATA | ALT5 |
+    ** +----------+--------+---------------+------+
+    **
+    ** 0 - off
+    ** 1 - on
+    **
+    ** reset Ethernet 1
+    */
+    printf("reset Ethernet 1\n");
+    gpio_direction_output(IMX_GPIO_NR(1, 30) , 0);
+    udelay(500);
+    gpio_direction_output(IMX_GPIO_NR(1, 30) , 1);
+
+    /*
+    ** Ethernet 2 Reset PIN - GPIO1-IO30
+    ** +----------+--------+---------------+------+
+    ** | Instance | Signal | Pad           | Mode |
+    ** | GPIO1    | IO31   | UART5_RX_DATA | ALT5 |
+    ** +----------+--------+---------------+------+
+    **
+    ** 0 - off
+    ** 1 - on
+    **
+    ** reset Ethernet 2
+    */
+    printf("reset Ethernet 2\n");
+    gpio_direction_output(IMX_GPIO_NR(1, 31) , 0);
+    udelay(500);
+    gpio_direction_output(IMX_GPIO_NR(1, 31) , 1);
+
+    /*
+    ** Mobile Reset PIN - GPIO5-IO7
+    ** +----------+--------+--------------+-----------------+
+    ** | Instance | Signal | Pad          | Mode            |
+    ** | GPIO5    | IO7    | SNVS_TAMPER7 | No Muxing(ALT5) |
+    ** +----------+--------+--------------+-----------------+
+    **
+    ** 0 - off
+    ** 1 - on
+    **
+    ** reset Mobile
+    */
+    printf("reset Mobile\n");
+    gpio_direction_output(IMX_GPIO_NR(5, 7) , 0);
+    udelay(500);
+    gpio_direction_output(IMX_GPIO_NR(5, 7) , 1);
+
+
+
 	iox74lv_init();
 
 #ifdef CONFIG_SYS_I2C_MXC
Index: git/include/configs/mx6ul_14x14_evk.h
===================================================================
--- git.orig/include/configs/mx6ul_14x14_evk.h
+++ git/include/configs/mx6ul_14x14_evk.h
@@ -205,13 +205,12 @@
         "else echo b to a; setenv app_primary a; setenv app_secondary b;" \
         "fi\0" \
     "no_good=.\0" \
-    "uboot_env_ver=1.0\0" \
+    "uboot_env_ver=1.3\0" \
 	\
 	/* do not allow user stop autoboot - no chance to change the uboot env */ \
 	"bootdelay=0\0" \
 	\
-    "bootcmd=mw 0x020A0004 00100000 1; mw 0x020E01CC 0x00000005 1;" \
-        "run app_choose;" \
+    "bootcmd=run app_choose;" \
         "echo run bootargs_${app_primary}; run bootargs_${app_primary};" \
         "run nandread_${app_primary};" \
         "setenv no_good ${no_good}x; saveenv;" \

build image

mfgtool 燒錄

1640

搭配 morris 改完的板子

開機做測試

1645

morris 表示從 web ui 去 restart 大概 20 多次會有一次 reset ic 會沒有 reset

就是因為這樣他才不敢直接用那顆 reset ic 來跟 ic control power 連動

才特別拉一根 GPIO 到 io control power 讓我來控制

john 提到說會不會是因為 /usr/sbin/icosconfig coldreboot 的關係導致 morris 發現的現象

這等下禮拜可以來試一下

rc.local 裡 /usr/sbin/icosconfig coldreboot 換成 reboot 即可

1730

又卡住了

從目前的 SysReboot.sh 來看 SysReboot.sh

diff --git a/proscend/prosrc/icos/script/SysReboot.sh b/proscend/prosrc/icos/script/SysReboot.sh
index d9c820b..122c759 100755
--- a/proscend/prosrc/icos/script/SysReboot.sh
+++ b/proscend/prosrc/icos/script/SysReboot.sh
@@ -13,6 +13,27 @@ sync
 sync
 sync

+
+
+# IO control power - GPIO4-IO21
+# +----------+--------+------------+-----------------+
+# | Instance | Signal | Pad        | Mode            |
+# | GPIO4    | IO21   | CSI_DATA00 | No Muxing(ALT5) |
+# +----------+--------+------------+-----------------+
+#
+# 0 - off
+# 1 - on
+#
+# turn off the IO control power
+# gpio number = (4 - 1) * 32 + 21 = 117
+
+echo "turn off the IO control power"
+echo 117 > /sys/class/gpio/export
+echo out > /sys/class/gpio/gpio117/direction
+echo 0 > /sys/class/gpio/gpio117/value
+
+
+
 ####################################################################################
 #   Do Reboot
 ####################################################################################

turn off the IO control power 這件事會失敗肯定不是後面的 linux reboot 害的

那只有可能是前面的 icosconfig coldreboot

再來改一版

不做 /usr/sbin/icosconfig shutdown 1>/dev/console 2>&1

diff --git a/proscend/prosrc/icos/script/SysReboot.sh b/proscend/prosrc/icos/script/SysReboot.sh
index d9c820b..cc857b3 100755
--- a/proscend/prosrc/icos/script/SysReboot.sh
+++ b/proscend/prosrc/icos/script/SysReboot.sh
@@ -7,11 +7,32 @@
 #   Usage  : SysReboot.sh
 ####################################################################################

-sync
-sync
-/usr/sbin/icosconfig shutdown 1>/dev/console 2>&1
-sync
-sync
+#sync
+#sync
+#/usr/sbin/icosconfig shutdown 1>/dev/console 2>&1
+#sync
+#sync
+
+
+
+# IO control power - GPIO4-IO21
+# +----------+--------+------------+-----------------+
+# | Instance | Signal | Pad        | Mode            |
+# | GPIO4    | IO21   | CSI_DATA00 | No Muxing(ALT5) |
+# +----------+--------+------------+-----------------+
+#
+# 0 - off
+# 1 - on
+#
+# turn off the IO control power
+# gpio number = (4 - 1) * 32 + 21 = 117
+
+echo "turn off the IO control power"
+echo 117 > /sys/class/gpio/export
+echo out > /sys/class/gpio/gpio117/direction
+echo 0 > /sys/class/gpio/gpio117/value
+
+

 ####################################################################################
 #   Do Reboot

build image

mfgtool 燒錄

1750

開始測試

⚠️ **GitHub.com Fallback** ⚠️