20180620_jeffrey - silenceuncrio/diary GitHub Wiki

1300

早上帶老婆去婦產科確認目前懷孕的狀況

聽到心跳聲的那一刻真的很開心

醫師估計預產期為明年2月9日

1420

trace 一下 ltq_gphy_fw.c

static int __init gphy_driver_init (struct platform_device *pdev)
{	
	const __be32 *no_phys;
	gphy_dev = &pdev->dev;
	gphy_node = pdev->dev.of_node;

	off_interval = 3;
	on_interval = 3;
	pw_save_mode = 0;
	dev_id = 0;

	pr_err("jeffrey %s in", __func__);

	if (of_property_read_string(pdev->dev.of_node, "fw-mode", &g_gphy_fw_mode)) {
		dev_err(&pdev->dev, "failed to read  firmware mode\n");
		return 0;
	}
	no_phys = of_get_property(gphy_node, "no_of_phys", NULL);
	if (!no_phys) {
		dev_err(&pdev->dev, "failed to get maximum number of internal gphys ports\n");
		return 0;
	}
	g_no_phys = (*no_phys);
	
	if (of_machine_is_compatible("lantiq,vr9") || of_machine_is_compatible("lantiq,xrx220") ) {
		int type = ltq_get_soc_type();
		if (type == SOC_TYPE_VR9) /*SOC_TYPE_VR9_2*/
			dev_id = 0;
		else
			dev_id = 1;
	} else if (of_machine_is_compatible("lantiq,ar10")) {
		dev_id = 1;
		no_phys = of_get_property(gphy_node, "pw_save_mode", NULL);
		if (no_phys)
			pw_save_mode = (*no_phys);
	} else if (of_machine_is_compatible("lantiq,grx390")) {
		dev_id = 1;
		no_phys = of_get_property(gphy_node, "pw_save_mode", NULL);
		if (no_phys)
			pw_save_mode = (*no_phys);
	}
	proc_file_create();
	pr_err("%s: fw_mode:%s, no of phys:%d, mode:%d\n", \
		__func__, g_gphy_fw_mode, g_no_phys, pw_save_mode);
	
	if ( pw_save_mode == 1 ) {
		swithc_api_fd = ltq_ethsw_api_kopen("/dev/switch_api/0");
		if (swithc_api_fd == 0) {
			pr_err("%s: Open SWAPI device FAILED !!\n", __func__ );
			return -EIO;
		}
		init_waitqueue_head(&gphy_pw_wait);
		gphy_pw_id = kthread_create(gphy_pw_save_thread, NULL, "gphy_pw_save");
		if (!IS_ERR(gphy_pw_id)) {
			wake_up_process(gphy_pw_id);
		}
	}
        //For VRX220 SW control PHY LED
	if (of_machine_is_compatible("lantiq,xrx220"))
	    AR10_F2_GPHY_LED_init();

	pr_err("jeffrey %s out", __func__);

	return 0;
}

修改後利用以下命令快速產生 image

make target/linux/install -j4 V=s

執行結果如下

Starting kernel ...

[    0.000000] Linux version 3.10.12 (user@8de9e3d5af60) (gcc version 4.8.1 20130401 (prerelease) (Linaro GCC 4.8-2013.04) ) #9 Wed Jun 20 06:17:12 UTC 2018
[    0.000000] SoC: xRX200 rev 1.2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019556 (MIPS 34Kc)
[    0.000000] adding memory size:66060288 from DT
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 03f00000 @ 00000000 (usable)
[    0.690000] pcie_wait_phy_link_up port 0 timeout
[    1.200000] pcie_wait_phy_link_up port 0 timeout
[    1.710000] pcie_wait_phy_link_up port 0 timeout
[    2.220000] pcie_wait_phy_link_up port 0 timeout
[    2.730000] pcie_wait_phy_link_up port 0 timeout
[    2.740000] pcie_rc_initialize port 0 link up failed!!!!!
[    2.780000] ts-xway 1f103000.ts: temp sensor not supported in this chip !!
[    2.890000] Switch API: PCE MicroCode loaded !!
[    2.890000] jeffrey gphy_driver_init in
[    2.890000] gphy_driver_init: fw_mode:22F-FW, no of phys:2, mode:0
[    2.900000] jeffrey gphy_driver_init out

...[約2到3秒]

[重開機]

ROM VER: 1.1.4
CFG 06
NAND
NAND Read OK
...

看來兇手不是 gphy_driver_init()

而是沉默的未知... 待查

1425

M300 下禮拜三又要 release 了