20191001_jeffrey - silenceuncrio/diary GitHub Wiki

0905

review

繼續來解決以下 issue

M300 issue - 0000722: uboot can not turn on the IO control power at 2 port model but can turn on at 4 port lan model

1040

目前確認以下的程序可以讓 2 port lan 以及 4 port lan model 的 IO control power 都被 turn on

int board_init(void)
{

    ...

    /*
    ** led
    ** 
    ** +------------+------------+------------+
    ** |    LED_SYS | LED_RSSI_H | LED_RSSI_L |
    ** +------------+------------+------------+
    ** |    LED_VPN |  LED_SIM_1 |  LED_SIM_2 |
    ** +------------+------------+------------+
    **
    ** 0 - on
    ** 1 - off
    **
    */

    gpio_direction_output(LED_SYS , 0);
    gpio_direction_output(LED_RSSI_H , 1);
    gpio_direction_output(LED_RSSI_L , 1);
    gpio_direction_output(LED_SIM_2 , 1);
    gpio_direction_output(LED_SIM_1 , 1);
    gpio_direction_output(LED_VPN , 1);



    /*
    ** 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
    */

    gpio_direction_input(IMX_GPIO_NR(4, 21));



    /*
    ** 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);

    ...

    return 0;
}

關鍵就在於 gpio_direction_input(IMX_GPIO_NR(4, 21));

確認此解法前還需要搭配 wifi 的板子作驗證

確認經由軟體作 restart 後 wifi module 不會讓系統 hang 住

1545

下午 BU II 軟體內部開了會

  • 中華電信
    • 10-23 想給一版
    • 幫忙 porting gre 從 M300
  • Connmgr + WAN WiFi (To Do)
    • 當 wan priority 為 lte only 時, WiFi STA 不要去 scan
      • 頁面直接顯示警告訊息表示該功能只在 wan priority 不為 lte only 時才有效
    • wizard 不用去設定 wan wifi, 但要能讓使用者將 wan priority 設定成 Wifi only
  • Wan WiFi
    • signal 的值改用 signal_icon 來顯示
    • 幫忙找一下可用的圖示

1605

回到以下 issue

M300 issue - 0000722: uboot can not turn on the IO control power at 2 port model but can turn on at 4 port lan model

試著不對 IO control power 作任何控制

也就是連 gpio_direction_input(IMX_GPIO_NR(4, 21)); 也不要

結果還真的開得起來... 2 port lan 和 4 port lan 都沒問題

問題變成

  • uboot 的確在某個時間點會把電拉起來
  • 電拉起來的時間點並不在 board_init()
    • 我在 board_init() 作的 reset ethernet 1, reset ethernet 2 和 reset mobile 其實都沒有意義
    • 因為那時候周邊都還沒有電