20180926_jeffrey - silenceuncrio/diary GitHub Wiki

0910

review

目前 M360 等待以下工作項目

  • multiple locked pci
  • dual apn dns

另外 Mitrastar 來信跟催 M360 生產後續事宜

Hi Spring

補充上周四見面討論的 FW issues update
1.     Base on Proscend u-boot開發(已試LOAD在版子上 客戶與我們FW都可以正常開機)
2.     昇頻會提供一版沒有檢查開機失敗機制的uboot (目前拿到的會判斷如果兩次沒有開機成功就會強制就B區開機)
3.     昇頻會提供boot loader 要寫入如mac imei 等string
4.     昇頻會提供在他們FW下的command 來show info for check label and show fw version
5.     昇頻會提供command for 指定A區開機
6.     昇頻fw需要有開啟telnet

再麻煩本周回覆下 第2-6點所需的資料提供的時間點。謝謝

Thank you

B.R.
Daphne #55568 

也許我可以先來準備一下 Mitrastar 需要的

0920

2. 昇頻會提供一版沒有檢查開機失敗機制的uboot

➜  ~ docker ps
CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS               NAMES
a07386063862        build-m360           "/entrypoint.sh /bin…"   2 months ago        Up 12 days                              build-uboot-m360
8de9e3d5af60        build-52xxz:ugw6.1   "/entrypoint.sh /bin…"   3 months ago        Up 12 days                              build-52xxz
be6d814a16da        build-m300           "/entrypoint.sh /bin…"   3 months ago        Up 12 days                              build-m300
10972b0a698a        build-m360           "/entrypoint.sh /bin…"   3 months ago        Up 12 days                              build-m360

負責 compile m360 uboot 有個 docker image - build-m360

目前有正在 run 的 container - build-uboot-m360

利用下面的 command 進入該 container

docker exec -it -u user build-uboot-m360 /bin/bash

先建立一個 git branch 再來修改 source code

➜  uboot-m360 git:(master) ✗ git branch no_switch
➜  uboot-m360 git:(master) ✗ git checkout no_switch
Switched to branch 'no_switch'
➜  uboot-m360 git:(no_switch) ✗

修改 lib_mips/board.c

@@ -2081,22 +2081,6 @@ __attribute__((nomips16)) void board_init_r (gd_t *id, ulong dest_addr)

         char *no_good = getenv ("no_good");
         printf("[%s:%d]no_good: %s\n", __FUNCTION__, __LINE__, no_good);
-        if (strcmp(no_good, ".xx") == 0) {
-
-            printf("\nSwitch the dual image\n");
-
-            char *dia = getenv ("dual_image_active");
-            if (strcmp(dia, "a") == 0) {
-                printf("Switch from image 'a' to 'b'\n");
-                setenv("dual_image_active", "b");
-            } else {
-                printf("Switch from image 'b' to 'a'\n");
-                setenv("dual_image_active", "a");
-            }
-
-            setenv("no_good", ".");
-
-        }



@@ -2136,7 +2120,7 @@ __attribute__((nomips16)) void board_init_r (gd_t *id, ulong dest_addr)
             printf("   \n3: System Boot system code via Flash at dual image b.\n");
         }

-        char tmp_no_good[8];
+        char tmp_no_good[80];
         sprintf(tmp_no_good, "%sx", getenv("no_good"));
         setenv("no_good", tmp_no_good);

測試

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.
   a: Write to dual image 'a' via TFTP.
   b: Write to dual image 'b' via TFTP.
   c: Write to dual images 'a' and 'b' via TFTP.
 0
[board_init_r:2083]no_good: .xxxx

Indicata linux the active dual image is b.
...

PASS

no_good 的值都到 .xxx 還不切 partition

上 code

➜  uboot-m360 git:(no_switch) ✗ git push -u origin no_switch
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 396 bytes | 0 bytes/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote:
remote: To create a merge request for no_switch, visit:
remote:   https://192.168.0.124/RD/uboot-m360/merge_requests/new?merge_request%5Bsource_branch%5D=no_switch
remote:
To [email protected]:RD/uboot-m360.git
 * [new branch]      no_switch -> no_switch
Branch no_switch set up to track remote branch no_switch from origin.
➜  uboot-m360 git:(no_switch) ✗ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
➜  uboot-m360 git:(master) ✗

先把產出的 uboot.img 另存成 uboot.proscend.no_switch.img 方便 Mitrastar 識別

這樣就解決了

0950

3. 昇頻會提供boot loader 要寫入如mac imei 等string

先參考 M360P run time 時的 /etc/rc.local


# get macaddr from uboot env
MAC=$(fw_printenv macaddr 2>/dev/null | awk -F"=" '{ print $2 }')
if [ "$MAC" = "" ]
then
    echo "WARNING: uboot env macaddr loose"
    MAC=$(fw_printenv ethaddr 2>/dev/null | awk -F"=" '{ print $2 }')
    if [ "$MAC" = "" ]
    then
        MAC="00:03:79:FF:FF:FF"
        echo "WARNING: uboot env macaddr set to default - $MAC"
        fw_setenv macaddr "$MAC"
    else
        echo "WARNING: uboot env macaddr loose, use ethaddr instead - $MAC"
    fi
fi

...

# get hw_mcsv from uboot env
HW_MCSV=$(fw_printenv hw_mcsv 2>/dev/null | awk -F"=" '{ print $2 }')
if [ "$HW_MCSV" = "" ]
then
    echo "WARNING: uboot env hw_mcsv loose"
    HW_MCSV=$(cat /etc/mcsv)
    echo "WARNING: uboot env hw_mcsv set to default - $HW_MCSV"
    fw_setenv hw_mcsv "$HW_MCSV"
fi

...

# get serialno from uboot env
SERIALNO=$(fw_printenv serialno 2>/dev/null | awk -F"=" '{ print $2 }')
if [ "$SERIALNO" = "" ]
then
    echo "WARNING: uboot env serialno loose"
    SERIALNO="NA"
    echo "WARNING: uboot env serialno set to default - $SERIALNO"
    fw_setenv serialno "$SERIALNO"
fi

每次生產時我們需要對 M360P 寫入以下三個資訊

  • macaddr: MAC Address
  • serialno: Serial Number
  • hw_mcsv: Proscend Hardware MCSV

假設某一次的生產為 10 台

那 proscend 必須提供給 mitrastar

  • 10 個 MAC Address
  • 10 個 Serial Number
  • 1 個 Proscend Hardware MCSV

以第一台為例 在 uboot 下的操作為

MT7621 # setenv macaddr 00:03:79:03:60:01
MT7621 # setenv serialno BL9TU3PM0001
MT7621 # setenv hw_mcsv 01F400000082C2BD
MT7621 # save
Saving Environment to NAND Flash...
..Erasing NAND Flash...
ranand_erase: start:80000, len:20000
.Writing to NAND Flash...
done
MT7621 # printenv
...
macaddr=00:03:79:03:60:01
serialno=BL9TU3PM0001
hw_mcsv=01F400000082C2BD

Environment size: 272/4092 bytes
MT7621 #

1005

4. 昇頻會提供在他們FW下的command 來show info for check label and show fw version

既然都能在 uboot 寫入 proscend 生產 M36P 時所需的資訊了

那該怎麼在 run time 時來 verify 呢

M360P 生產時是沒有 console 的

必須透過 ethernet 利用 telnet 或是 ssh

這邊以 telnet 為例

M360-P login: root
Password:
M360-P# mgmt info list
 hostname = M360-P
 mac      = 00:03:79:03:60:01
 sn       = BL9TU3PM0001
 smcsv    = 01F400000052C1EC
 hmcsv    = 01F400000082C2BD
 version  = V0.05
 modem    = EC25EFAR02A08M4G
 IMEI     = 864430010001091
 uptime   = 00:03:39
M360-P#

我們可以利用 mgmt info list 來確認我們在 uboot 寫入的資訊正確與否

例如剛剛在 uboot 寫入的三個資訊

MT7621 # setenv macaddr 00:03:79:03:60:01
MT7621 # setenv serialno BL9TU3PM0001
MT7621 # setenv hw_mcsv 01F400000082C2BD

對應到 mgmt info list

M360-P# mgmt info list
 ...
 mac      = 00:03:79:03:60:01
 sn       = BL9TU3PM0001
 ...
 hmcsv    = 01F400000082C2BD

1045

5. 昇頻會提供command for 指定A區開機

U-Boot 1.1.3 (Sep 26 2018 - 01:50:54)
MT7621 # print
...
dual_image_active=a
...
Environment size: 272/4092 bytes

確認 uboot 下的 env - dual_image_activea 即可

6. 昇頻fw需要有開啟telnet

確認無誤

1050

跟 Spring 確認一下是否讓我直接回信

1105

我已經直接回信了

繼續等待 M360 的工作項目

  • multiple locked pci
  • dual apn dns

1135

monkeyjj time

複習 A Complete Firebase in React Authentication Tutorial

1320

monkeyjj time

邊看邊打瞌睡

1525

幫忙看一下 aaron 那邊 52XXZ 的 lan port

uboot 階段與 PC 的 USB 網卡從燈號看來連接正常

但開到 linux 以後就異常了

我手上的 52XXZ 並沒有發現這種現象

不確定 aaron 手上的 52XXZ firmware image 跟我的差別

我想可以先借他我手上的板子讓他確認是否是因為他的手上的 firmware image 所造成

1705

aaron 從 console 看到有些 kernel 的 module init 異常

懷疑是 busybox 的 update 需要針對 proscend 外層重新 build 一次

我先拉一下 52XXZ 最新的 code

proscend 的外層 make clean 後再 make

user@8de9e3d5af60:~$ make clean
 make[1] clean
user@8de9e3d5af60:~$ make

1755

linux 再開機的過程出現的問題如下

...
tarting pid 509, tty '': '/etc/init.d/rcS S boot'
/etc/init.d/rcS: line 162: unlzma: not found
BisMpiMsg: VR268 BisMPI Driver, Version:3.00
BisMpiMsg: BisMPI_InitModule() Ok res:0, Major#:122, Mnino#:0
insmod: can't insert '/lib/modules/3.10.12/ltqusb_host.ko': No such file or directory
insmod: can't insert '/lib/modules/3.10.12/usb-storage.ko': unknown symbol in module, or unknown parameter
insmod: can't insert '/lib/modules/3.10.12/usbserial.ko': unknown symbol in module, or unknown parameter
insmod: can't insert '/lib/modules/3.10.12/usb_wwan.ko': unknown symbol in module, or unknown parameter
insmod: can't insert '/lib/modules/3.10.12/option.ko': unknown symbol in module, or unknown parameter
===Error:/mnt/data/etc/passwd error, restore default
cp: can't stat '/etc/passwd.rom': No such file or directory
cat: can't open '/mnt/data/etc/passwd': No such file or directory
===Error:/mnt/data/etc/passwd no root, restore default
cp: can't stat '/etc/passwd.rom': No such file or directory
Start soc4emain, version:2.10, Compiled on 2018/07/10, 16:30:00
...

表示 make clean 後再 make 還是沒有解決此問題

aaron 利用 git 說是比 make clean 更乾淨

明天早上再來驗收看看